mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-15 07:36:08 +00:00
test stream twice
This commit is contained in:
parent
2d202f9762
commit
ad68ddbf40
@ -14,7 +14,7 @@ test tests:
|
||||
uv run --group test pytest -vvv --disable-socket --allow-unix-socket $(TEST_FILE)
|
||||
|
||||
integration_test integration_tests:
|
||||
uv run --group test --group test_integration pytest -vvv --timeout 30 $(TEST_FILE)
|
||||
uv run --group test --group test_integration pytest -vvv --timeout 30 tests/integration_tests/test_chat_models.py::test_async_stream_twice
|
||||
|
||||
test_watch:
|
||||
uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE)
|
||||
|
@ -145,6 +145,15 @@ async def test_stream_usage_override() -> None:
|
||||
assert token.usage_metadata is None
|
||||
|
||||
|
||||
async def test_async_stream_twice() -> None:
|
||||
model = ChatAnthropic(model_name=MODEL_NAME)
|
||||
async for token in model.astream("hi"):
|
||||
assert isinstance(token, AIMessageChunk)
|
||||
|
||||
async for token in model.astream("hi"):
|
||||
assert isinstance(token, AIMessageChunk)
|
||||
|
||||
|
||||
async def test_abatch() -> None:
|
||||
"""Test streaming tokens from ChatAnthropicMessages."""
|
||||
llm = ChatAnthropicMessages(model_name=MODEL_NAME) # type: ignore[call-arg, call-arg]
|
||||
|
Loading…
Reference in New Issue
Block a user