Find answers from the community

Updated 3 months ago

Agent

read_code_file_tool = FunctionTool.from_defaults(fn=read_code_file)

query_engine_tools = [
QueryEngineTool(
query_engine=query_engine,
metadata=ToolMetadata(
name="codebase",
description=(
"Provides the entine code base."
"Use a detailed plain text question as input to the tool."
),
),
)
]

agent = OpenAIAgent.from_tools(tools=[query_engine_tools, read_code_file_tool],
llm=OpenAI(model="gpt-3.5-turbo-1106",temperature=0.1,api_key=str(config.OPENAI_API_KEY) ),
system_prompt=SYSTEM_PROMPT,
max_function_calls=10,
verbose=True)

gives this error: 2024-07-13 15:10:55.659 | DEBUG | core.engine.query:query_agent:34 - Error querying agent: 'list' object has no attribute 'metadata'
2024-07-13 15:10:55.706 | ERROR | core.routes.query:user_input:19 - Error processing request: too many values to unpack (expected 2)
L
B
7 comments
Pretty hard to debug without an actual traceback. Seems like it could be an issue anywhere in your code
adding both the tools in OpenAI Agent gives these errors
Sorry, I meant the full traceback if you have it πŸ‘€ you might have to remove the try excepts in your code
@Logan M this works?
Another question can using query_engine_tool and a function tool with Anthropic agent with function agent?
Seems like you passed in tools as lists of lists? Rather than a single flat list of tools? That's what the error is saying
Also yea, anthropic works as a function calling agent
Add a reply
Sign up and join the conversation on Discord