- `+"`tool_call_name`"+` must be an exact match to one of the available tools
- `+"`tool_call_arguments`"+` must be valid JSON that strictly follows the tool's Parameters Schema
- For multiple tool calls, chain them directly without separators or spaces
<|User|>What's the weather in Paris?<|Assistant|></think><|tool▁calls▁begin|><|tool▁call▁begin|>get_weather<|tool▁sep|>{"location":"Paris"}<|tool▁call▁end|><|tool▁calls▁end|><|end▁of▁sentence|>`,
},
{
name:"tools definitions with full conversation cycle",
messages:[]api.Message{
{Role:"system",Content:"You are a helpful assistant."},
{Role:"user",Content:"What's the weather in Paris?"},
{
Role:"assistant",
Content:"I'll check the weather for you.",
ToolCalls:[]api.ToolCall{
{
Function:api.ToolCallFunction{
Name:"get_weather",
Arguments:api.ToolCallFunctionArguments{
"location":"Paris",
},
},
},
},
},
{Role:"tool",Content:"Temperature: 22°C, Sunny"},
{Role:"assistant",Content:"The weather in Paris is 22°C and sunny!"},
},
tools:[]api.Tool{
{
Type:"function",
Function:api.ToolFunction{
Name:"get_weather",
Description:"Get current weather information",
Parameters:api.ToolFunctionParameters{
Type:"object",
Properties:map[string]api.ToolProperty{
"location":{
Type:api.PropertyType{"string"},
Description:"City name",
},
},
Required:[]string{"location"},
},
},
},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are a helpful assistant.
- `+"`tool_call_name`"+` must be an exact match to one of the available tools
- `+"`tool_call_arguments`"+` must be valid JSON that strictly follows the tool's Parameters Schema
- For multiple tool calls, chain them directly without separators or spaces
<|User|>What's the weather in Paris?<|Assistant|></think>I'll check the weather for you.<|tool▁calls▁begin|><|tool▁call▁begin|>get_weather<|tool▁sep|>{"location":"Paris"}<|tool▁call▁end|><|tool▁calls▁end|><|end▁of▁sentence|><|tool▁output▁begin|>Temperature: 22°C, Sunny<|tool▁output▁end|>The weather in Paris is 22°C and sunny!<|end▁of▁sentence|>`,
},
{
name:"tools with thinking and full conversation",
messages:[]api.Message{
{Role:"system",Content:"You are a helpful assistant."},
{Role:"user",Content:"Check the weather in Tokyo"},
{
Role:"assistant",
Thinking:"The user wants weather info for Tokyo. I should use the get_weather tool.",
- `+"`tool_call_name`"+` must be an exact match to one of the available tools
- `+"`tool_call_arguments`"+` must be valid JSON that strictly follows the tool's Parameters Schema
- For multiple tool calls, chain them directly without separators or spaces
<|User|>Check the weather in Tokyo<|Assistant|></think>Let me check that for you.<|tool▁calls▁begin|><|tool▁call▁begin|>get_weather<|tool▁sep|>{"location":"Tokyo"}<|tool▁call▁end|><|tool▁calls▁end|><|end▁of▁sentence|><|tool▁output▁begin|>Temperature: 18°C, Cloudy<|tool▁output▁end|>In Tokyo, it's currently 18°C and cloudy.<|end▁of▁sentence|><|User|>What about London?<|Assistant|><think>`,
},
{
name:"multiple tools definitions",
messages:[]api.Message{
{Role:"system",Content:"You are a helpful assistant with access to multiple tools."},
{Role:"user",Content:"What can you help me with?"},
},
tools:[]api.Tool{
{
Type:"function",
Function:api.ToolFunction{
Name:"get_weather",
Description:"Get current weather information",
Parameters:api.ToolFunctionParameters{
Type:"object",
Properties:map[string]api.ToolProperty{
"location":{
Type:api.PropertyType{"string"},
Description:"City name",
},
},
Required:[]string{"location"},
},
},
},
{
Type:"function",
Function:api.ToolFunction{
Name:"calculate",
Description:"Perform mathematical calculations",
Parameters:api.ToolFunctionParameters{
Type:"object",
Properties:map[string]api.ToolProperty{
"expression":{
Type:api.PropertyType{"string"},
Description:"Mathematical expression to evaluate",
},
},
Required:[]string{"expression"},
},
},
},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are a helpful assistant with access to multiple tools.
Parameters: {"type":"object","required":["expression"],"properties":{"expression":{"type":"string","description":"Mathematical expression to evaluate"}}}
IMPORTANT: ALWAYS adhere to this exact format for tool use:
Parameters: {"type":"object","required":["expression"],"properties":{"expression":{"type":"string","description":"Mathematical expression to evaluate"}}}
IMPORTANT: ALWAYS adhere to this exact format for tool use:
- `+"`tool_call_name`"+` must be an exact match to one of the available tools
- `+"`tool_call_arguments`"+` must be valid JSON that strictly follows the tool's Parameters Schema
- For multiple tool calls, chain them directly without separators or spaces
<|User|>Get weather for Paris and calculate 25 * 4<|Assistant|></think><|tool▁calls▁begin|><|tool▁call▁begin|>get_weather<|tool▁sep|>{"location":"Paris"}<|tool▁call▁end|><|tool▁call▁begin|>calculate<|tool▁sep|>{"expression":"25 * 4"}<|tool▁call▁end|><|tool▁calls▁end|><|end▁of▁sentence|><|tool▁output▁begin|>Temperature: 22°C, Sunny<|tool▁output▁end|><|tool▁output▁begin|>Result: 100<|tool▁output▁end|>`,