mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-14 18:48:29 +00:00
max iter on new test
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user