openai[patch]: relax Azure llm streaming callback test (#31319)

Effectively reverts
https://github.com/langchain-ai/langchain/pull/29302, but check that
counts are "less than" instead of equal to an expected count.
This commit is contained in:
ccurme 2025-05-22 12:14:53 -04:00 committed by GitHub
parent 092697de60
commit 851fd438cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -149,7 +149,7 @@ def test_openai_streaming_callback() -> None:
verbose=True,
)
llm.invoke("Write me a sentence with 100 words.")
assert callback_handler.llm_streams == 12
assert callback_handler.llm_streams < 15
@pytest.mark.scheduled
@ -172,5 +172,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 == 12
assert callback_handler.llm_streams < 15
assert isinstance(result, LLMResult)