add support for built in tool type

This commit is contained in:
Dinesh Yeduguru 2024-12-23 16:50:03 -08:00
parent 517bc9ebea
commit 1a66ddc1b5
8 changed files with 83 additions and 75 deletions

View file

@ -150,9 +150,7 @@ async def create_agent_turn_with_search_tool(
assert isinstance(tool_execution, ToolExecutionStep)
assert len(tool_execution.tool_calls) > 0
actual_tool_name = tool_execution.tool_calls[0].tool_name
if isinstance(actual_tool_name, BuiltinTool):
actual_tool_name = actual_tool_name.value
assert actual_tool_name == tool_name
assert actual_tool_name.value == tool_name
assert len(tool_execution.tool_responses) > 0
check_turn_complete_event(turn_response, session_id, search_query_messages)
@ -305,20 +303,6 @@ class TestAgents:
"brave_search",
)
@pytest.mark.asyncio
async def test_create_agent_turn_with_tavily_search(
self, agents_stack, search_query_messages, common_params
):
if "TAVILY_SEARCH_API_KEY" not in os.environ:
pytest.skip("TAVILY_SEARCH_API_KEY not set, skipping test")
await create_agent_turn_with_search_tool(
agents_stack,
search_query_messages,
common_params,
"tavily_search",
)
def check_event_types(turn_response):
event_types = [chunk.event.payload.event_type for chunk in turn_response]