Remove outdated truncation of tool descriptions in OpenAI and Databricks providers (#2465)
Signed-off-by: Tibor Vass <teabee89@gmail.com>
This commit is contained in:
@@ -246,15 +246,12 @@ pub fn format_tools(tools: &[Tool]) -> anyhow::Result<Vec<Value>> {
|
||||
return Err(anyhow!("Duplicate tool name: {}", tool.name));
|
||||
}
|
||||
|
||||
let mut description = tool.description.clone();
|
||||
description.truncate(1024);
|
||||
|
||||
// OpenAI's tool description max str len is 1024
|
||||
result.push(json!({
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": tool.name,
|
||||
"description": description,
|
||||
// do not silently truncate description
|
||||
"description": tool.description,
|
||||
"parameters": tool.input_schema,
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -202,15 +202,12 @@ pub fn format_tools(tools: &[Tool]) -> anyhow::Result<Vec<Value>> {
|
||||
return Err(anyhow!("Duplicate tool name: {}", tool.name));
|
||||
}
|
||||
|
||||
let mut description = tool.description.clone();
|
||||
description.truncate(1024);
|
||||
|
||||
// OpenAI's tool description max str len is 1024
|
||||
result.push(json!({
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": tool.name,
|
||||
"description": description,
|
||||
// do not silently truncate description
|
||||
"description": tool.description,
|
||||
"parameters": tool.input_schema,
|
||||
}
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user