Skip to content

Commit bff5a78

Browse files
committed
Update test_agent.py
1 parent d462b8a commit bff5a78

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/tutorials/00_sync/020_streaming/tests/test_agent.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def test_send_stream_message(self, test_agent):
8686
# Collect the streaming response
8787
aggregated_content, chunks = collect_streaming_deltas(response_gen)
8888

89-
assert len(chunks) > 1
89+
# this is using the chat_completion_stream, so we will be getting chunks of data
90+
assert len(chunks) > 1, "No chunks received in streaming response."
9091

9192
# Validate we got content
9293
assert len(aggregated_content) > 0, "Should receive content"
@@ -97,6 +98,9 @@ def test_send_stream_message(self, test_agent):
9798
states = test_agent.client.states.list(task_id=test_agent.task_id)
9899
assert len(states) == 1
99100

101+
state = states[0]
102+
assert state.state is not None
103+
assert state.state.get("system_prompt") == "You are a helpful assistant that can answer questions."
100104
message_history = test_agent.client.messages.list(task_id=test_agent.task_id)
101105
assert len(message_history) == (i + 1) * 2 # user + agent messages
102106

0 commit comments

Comments
 (0)