From c20f7418c76e99db72706af0a6ca11cfcf7f7b09 Mon Sep 17 00:00:00 2001 From: ccurme Date: Sun, 19 Jan 2025 12:25:42 -0500 Subject: [PATCH] openai[patch]: fix Azure LLM test (#29302) The tokens I get are: ``` ['', '\n\n', 'The', ' sun', ' was', ' setting', ' over', ' the', ' horizon', ',', ' casting', ''] ``` so possibly an extra empty token is included in the output. lmk @efriis if we should look into this further. --- .../openai/tests/integration_tests/llms/test_azure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/partners/openai/tests/integration_tests/llms/test_azure.py b/libs/partners/openai/tests/integration_tests/llms/test_azure.py index 4ae9d2900d4..fcbc6b3b0aa 100644 --- a/libs/partners/openai/tests/integration_tests/llms/test_azure.py +++ b/libs/partners/openai/tests/integration_tests/llms/test_azure.py @@ -148,7 +148,7 @@ def test_openai_streaming_callback() -> None: verbose=True, ) llm.invoke("Write me a sentence with 100 words.") - assert callback_handler.llm_streams == 11 + assert callback_handler.llm_streams == 12 @pytest.mark.scheduled @@ -171,5 +171,5 @@ async def test_openai_async_streaming_callback() -> None: verbose=True, ) result = await llm.agenerate(["Write me a sentence with 100 words."]) - assert callback_handler.llm_streams == 11 + assert callback_handler.llm_streams == 12 assert isinstance(result, LLMResult)