I have an agent that uses 2 tools: FileSearchTool
and a custom function tool upload_to_vector_store
. The custom one looks something like:
@function_tool
async def upload_to_vector_store(wrapper: RunContextWrapper[UploadFile]) -> list[str]:
...
return [vector_store_ids]
And the agent looks something like:
my_agent = Agent(
name=“my_agent”,
instructions=“yada yada yada”,
model_settings=ModelSettings(tool_choice="required”),
tools=[FileSearchTool(), upload_to_vector_store],
)
Not setting vector_store_ids
parameter of FileSearchTool
is throwing a TypeError
. Is there a way to direct my agent to run upload_to_vector_store
first and use the return value for FileSearchTool
? Can you call FileSearchTool
directly in a custom function tool?
Should I have separate agents for uploading to the vector store (and getting the vector store id) and one for calling FileSearchTool
?