-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Function name misplace with fn name #17869
Comments
The issue you're encountering seems to be related to the This behavior might be due to how the Here are a few things you can check or try:
If these steps don't resolve the issue, consider reviewing the implementation details of the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
The log you gave indicates that it's calling the tool correctly no? Pretty sure providing your own schema will override the name and description you pass in |
@logan-markewich yes, the log is it's calling the tool. If provided my own schema will override the name then is there any way I still provide the schema but keep the real function name ? |
@nhantran0506 hmm, so the schema is what the LLM ends up seeing. So when the llm calls a tool, it uses the name from the schema |
@logan-markewich Yes, that right |
Bug Description
Hi, I am using FunctionAgent to code my custom agent, but I always get the error that the agent rather using the name of the tool, it using the fn name which leading to result that it couldn't access the tool
Please help me.
Version
0.12.19
Steps to Reproduce
Here is my code for the tools
tools = [ FunctionTool.from_defaults( name="search_artist", description="Search artist in vector store.", async_fn=artist_util.search_artist, fn_schema = SearchArtistPara, return_direct=True ), ]
And here is the SearchArtistPara
class SearchArtistPara(BaseModel): query: str = Field( description="The search query string used to find artists in vector database. May contain need information such as location, etc" ) location: Optional[str] = Field(description="Artist location", default="") service_offer: Optional[str] = Field( description="Service offer by artist.", default="" ) limit: Optional[int] = Field( description="The maximum search results to return.", default=5, ) alpha: Optional[int] = Field( description="The relevance factor or weight applied to search results for hybrid search.", default=0.4, )
When I tracking the tool name using
handler = _agent.run(user_msg=user_query, chat_history=chat_history) event_id = None async for event in handler.stream_events(): if isinstance(event, ToolCall): if event_id != event.tool_id: tool_msg.append( f"Use tool {event.tool_name} with input {event.tool_kwargs}" ) logger.info( f"Try : {len(tool_msg)} {event.tool_name} {event.tool_kwargs}" ) event_id = event.tool_id response = await handler
I get the log as
Try : 1 SearchArtistPara {'limit': 10.0, 'query': 'artist can dragon dance', 'location': 'new york'}
Relevant Logs/Tracbacks
The text was updated successfully, but these errors were encountered: