@@ -259,3 +259,46 @@ async def test_app_config_for_client(client):
259259 assert result ["showGPT4VOptions" ] == (os .getenv ("USE_GPT4V" ) == "true" )
260260 assert result ["showSemanticRankerOption" ] is True
261261 assert result ["showVectorOption" ] is True
262+ assert result ["streamingEnabled" ] is True
263+ assert result ["showReasoningEffortOption" ] is False
264+
265+ @pytest .mark .asyncio
266+ async def test_app_config_for_reasoning (monkeypatch , minimal_env ):
267+ monkeypatch .setenv ("AZURE_OPENAI_CHATGPT_MODEL" , "o3-mini" )
268+ monkeypatch .setenv ("AZURE_OPENAI_CHATGPT_DEPLOYMENT" , "o3-mini" )
269+ quart_app = app .create_app ()
270+ async with quart_app .test_app () as test_app :
271+ client = test_app .test_client ()
272+ response = await client .get ("/config" )
273+ assert response .status_code == 200
274+ result = await response .get_json ()
275+ assert result ["streamingEnabled" ] is True
276+ assert result ["showReasoningEffortOption" ] is True
277+
278+ @pytest .mark .asyncio
279+ async def test_app_config_for_reasoning_without_streaming (monkeypatch , minimal_env ):
280+ monkeypatch .setenv ("AZURE_OPENAI_CHATGPT_MODEL" , "o1-preview" )
281+ monkeypatch .setenv ("AZURE_OPENAI_CHATGPT_DEPLOYMENT" , "o1-preview" )
282+ quart_app = app .create_app ()
283+ async with quart_app .test_app () as test_app :
284+ client = test_app .test_client ()
285+ response = await client .get ("/config" )
286+ assert response .status_code == 200
287+ result = await response .get_json ()
288+ assert result ["streamingEnabled" ] is False
289+ assert result ["showReasoningEffortOption" ] is True
290+
291+ @pytest .mark .asyncio
292+ async def test_app_config_for_reasoning_override_effort (monkeypatch , minimal_env ):
293+ monkeypatch .setenv ("AZURE_OPENAI_REASONING_EFFORT" , "low" )
294+ monkeypatch .setenv ("AZURE_OPENAI_CHATGPT_MODEL" , "o3-mini" )
295+ monkeypatch .setenv ("AZURE_OPENAI_CHATGPT_DEPLOYMENT" , "o3-mini" )
296+ quart_app = app .create_app ()
297+ async with quart_app .test_app () as test_app :
298+ client = test_app .test_client ()
299+ response = await client .get ("/config" )
300+ assert response .status_code == 200
301+ result = await response .get_json ()
302+ assert result ["streamingEnabled" ] is True
303+ assert result ["showReasoningEffortOption" ] is True
304+ assert result ["defaultReasoningEffort" ] == "low"
0 commit comments