max iter on new test

This commit is contained in:
Brandon Hancock
2025-03-04 16:22:43 -05:00
parent 94146722a3
commit ae8d4afbc7
2 changed files with 94 additions and 94 deletions

View File

@@ -1827,6 +1827,7 @@ def test_agent_streaming_with_tool_calling():
backstory="I am an AI assistant specialized in mathematics.",
verbose=True,
llm=LLM(model="gpt-4o", stream=True), # Enable streaming
max_iter=3,
)
# Create a task that will require tool calling
@@ -1845,14 +1846,5 @@ def test_agent_streaming_with_tool_calling():
# Verify that the tool was called
assert tool_called, "Calculator tool was not called"
# Verify that the output contains the correct result
assert "1035" in output, f"Output does not contain the correct result: {output}"
# Verify that the streaming chunks form a coherent response
combined_chunks = "".join(received_chunks)
assert len(combined_chunks) > 0, "Combined chunks are empty"
# Log for debugging
print(f"Received {len(received_chunks)} chunks")
print(f"First few chunks: {received_chunks[:3]}")
print(f"Output: {output}")
# Verify the output contains the correct result (23 * 45 = 1035)
assert "1035" in output, f"Expected result '1035' not found in output: {output}"