Skip to content

Commit 617ba74

Browse files
committed
Update tests
1 parent 5d428c8 commit 617ba74

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

app/backend/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ def create_app():
750750

751751
# Log levels should be one of https://docs.python.org/3/library/logging.html#logging-levels
752752
# Set root level to WARNING to avoid seeing overly verbose logs from SDKS
753-
logging.basicConfig(level=logging.WARNING)
753+
logging.basicConfig(level=logging.DEBUG)
754754
# Set our own logger levels to INFO by default
755755
app_level = os.getenv("APP_LOG_LEVEL", "INFO")
756756
app.logger.setLevel(os.getenv("APP_LOG_LEVEL", app_level))

app/backend/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
azure-identity
22
quart
33
quart-cors
4-
openai>=1.108.1
4+
openai>=1.109.1
55
tiktoken
66
tenacity
77
azure-ai-documentintelligence==1.0.0b4

app/backend/requirements.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ exceptiongroup==1.3.0
103103
fixedint==0.1.6
104104
# via azure-monitor-opentelemetry-exporter
105105
flask==3.1.2
106-
# via
107-
# -r requirements.in
108-
# quart
106+
# via quart
109107
frozenlist==1.4.1
110108
# via
111109
# aiohttp
@@ -209,7 +207,7 @@ multidict==6.7.0
209207
# yarl
210208
oauthlib==3.3.1
211209
# via requests-oauthlib
212-
openai==1.99.8
210+
openai==2.6.1
213211
# via -r requirements.in
214212
opentelemetry-api==1.38.0
215213
# via
@@ -383,7 +381,6 @@ six==1.16.0
383381
sniffio==1.3.1
384382
# via
385383
# anyio
386-
# httpx
387384
# openai
388385
soupsieve==2.7
389386
# via beautifulsoup4
@@ -394,9 +391,7 @@ taskgroup==0.2.2
394391
tenacity==9.1.2
395392
# via -r requirements.in
396393
tiktoken==0.12.0
397-
# via
398-
# -r requirements.in
399-
# opentelemetry-instrumentation-openai
394+
# via -r requirements.in
400395
tomli==2.2.1
401396
# via hypercorn
402397
tqdm==4.66.5

tests/test_app_config.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ async def test_app_azure_custom_identity(monkeypatch, minimal_env):
5353

5454
quart_app = app.create_app()
5555
async with quart_app.test_app():
56-
api_key = quart_app.config[app.CONFIG_OPENAI_CLIENT].api_key
57-
assert callable(api_key)
58-
assert str(quart_app.config[app.CONFIG_OPENAI_CLIENT].base_url) == "http://azureapi.com/api/v1/"
56+
openai_client = quart_app.config[app.CONFIG_OPENAI_CLIENT]
57+
assert openai_client.api_key == ""
58+
# The AsyncOpenAI client stores the callable inside _api_key_provider
59+
assert getattr(openai_client, "_api_key_provider", None) is not None
60+
assert str(openai_client.base_url) == "http://azureapi.com/api/v1/"
5961

6062

6163
@pytest.mark.asyncio

0 commit comments

Comments
 (0)