You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ X] I have looked for existing issues (including closed) about this
Bug Report
Tool results should be passed back to the model to generate a human readable answer.
Currently the tool result is sent back to the user.
Reproduction
You can simply run any example agent with a tool which response is a structured model.
If you run an agent with the below SearchTool you will get a conversation like this:
Prompt: Can you please let me know title and url of rig platform?
Response: {"title":"Rig Documentation","url":"https://docs.rig.ai"}
SearchTool implementation:
#[derive(Deserialize,Serialize)]structSearchArgs{pubquery_string:String,}#[derive(Deserialize,Serialize)]structSearchResult{pubtitle:String,puburl:String,}#[derive(Debug, thiserror::Error)]#[error("Search error")]structSearchError;#[derive(Deserialize,Serialize)]structSearchTool;implToolforSearchTool{constNAME:&'staticstr = "search";typeError = SearchError;typeArgs = SearchArgs;typeOutput = SearchResult;asyncfndefinition(&self,_prompt:String) -> ToolDefinition{
serde_json::from_value(json!({"name":"search","description":"Search for a website, it will return the title and URL","parameters":{"type":"object","properties":{"query_string":{"type":"string","description":"The query string to search for"},}}})).expect("Tool Definition")}asyncfncall(&self,args:Self::Args) -> Result<Self::Output,Self::Error>{println!("[tool-call] Searching for: '{}'", args.query_string);if args.query_string.to_lowercase().contains("rig"){Ok(SearchResult{title:"Rig Documentation".to_string(),url:"https://docs.rig.ai".to_string(),})}else{Err(SearchError)}}}
Expected behavior
The expectation is a human readable answer sent back to the user.
Example:
Prompt: Can you please let me know title and url of rig platform?
Response: The title of the Rig platform is "Rig Documentation" and the URL is [https://docs.rig.ai](https://docs.rig.ai).
0xMochan
changed the title
bug: tool call results are not sent back to model, giving json results back to user instead of human readable text
feat: tool call results are not sent back to model, giving json results back to user instead of human readable text
Feb 25, 2025
Bug Report
Tool results should be passed back to the model to generate a human readable answer.
Currently the tool result is sent back to the user.
Reproduction
You can simply run any example agent with a tool which response is a structured model.
If you run an agent with the below
SearchTool
you will get a conversation like this:SearchTool
implementation:Expected behavior
The expectation is a human readable answer sent back to the user.
Example:
Additional context
OpenAI function calling
The text was updated successfully, but these errors were encountered: