-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
Using litelllm image v1.71.1-stable for litellm proxy
I have an error with Anthropic model calls with Tools that i don't have on openai calls for the same request :
'litellm.BadRequestError: AnthropicException - {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.0.tool_use.input: Input should be a valid dictionary"}}. Received Model Group=x-anthropic-x\n'
Sample code :
import openai from "openai";
const client = new openai({
apiKey: "xx",
baseURL: "https://litellm-xx",
});
async function main() {
const out = await client.chat.completions.create({
messages: [
{
content: "search : foo",
role: "user",
},
{
role: "assistant",
tool_calls: [
{
function: {
arguments: '"{\\"query\\": \\"foo\\"}"',
name: "WebSearch",
},
id: "toolu_01LaSrYM7jQ4snmb3h4cb2A2",
type: "function",
},
],
},
{
content: "... foo search response ....",
role: "tool",
tool_call_id: "toolu_01LaSrYM7jQ4snmb3h4cb2A2",
},
{
content: "search : bar",
role: "user",
},
],
model: "x-anthropic-x",
tool_choice: "auto",
tools: [
{
function: {
description: "Make a search",
name: "Search",
parameters: {
properties: {
query: {
description: "The search query",
type: "string",
},
},
required: ["query"],
type: "object",
},
},
type: "function",
},
],
});
console.log(out);
}
main();
Relevant log output
Are you a ML Ops Team?
No
What LiteLLM version are you on ?
v1.71.1
Twitter / LinkedIn details
No response
phihung and fcakyon
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working