give up on agent

This commit is contained in:
Brandon Hancock
2025-03-04 16:55:49 -05:00
parent 58bc8d13d2
commit 9e240e3ea4
2 changed files with 0 additions and 417 deletions

View File

@@ -1797,46 +1797,3 @@ def test_litellm_anthropic_error_handling():
# Verify the LLM call was only made once (no retries)
mock_llm_call.assert_called_once()
@pytest.mark.vcr(filter_headers=["authorization"])
def test_agent_streaming_with_tool_calling():
"""Test that streaming works correctly with tool calling."""
# Define a tool that will be called
@tool
def retrieve_secret_information() -> str:
"""Retrieve the super secret password from the secure database."""
return "SuperSecretPassword123!"
# Create an LLM with streaming enabled
llm = LLM(
model="gpt-4o-mini",
stream=True,
)
# Create a secret agent
secret_agent = Agent(
role="Secret Information Specialist",
goal="Retrieve classified information securely",
backstory="A highly trained operative with clearance to access confidential data",
tools=[retrieve_secret_information],
llm=llm,
max_iter=3, # Limit iterations to prevent infinite loops
max_execution_time=60, # Add timeout of 60 seconds
)
# Create a secret retrieval task
secret_task = Task(
description="Retrieve the super secret password using the appropriate tool",
agent=secret_agent,
expected_output="The retrieved super secret password",
)
# Execute the task directly with the agent
output = secret_agent.execute_task(task=secret_task)
# Verify the output contains the secret password
assert (
"SuperSecretPassword123!" in output
), f"Expected secret password not found in output: {output}"