encoding/tests/test_input_1.json
| 1 | { |
| 2 | "tools": [ |
| 3 | { |
| 4 | "type": "function", |
| 5 | "function": { |
| 6 | "name": "get_weather", |
| 7 | "description": "Get the weather for a specific location", |
| 8 | "parameters": { |
| 9 | "type": "object", |
| 10 | "properties": { |
| 11 | "location": { |
| 12 | "type": "string", |
| 13 | "description": "The city name" |
| 14 | }, |
| 15 | "unit": { |
| 16 | "type": "string", |
| 17 | "enum": ["celsius", "fahrenheit"], |
| 18 | "description": "Temperature unit" |
| 19 | } |
| 20 | }, |
| 21 | "required": ["location"] |
| 22 | } |
| 23 | } |
| 24 | }, |
| 25 | { |
| 26 | "type": "function", |
| 27 | "function": { |
| 28 | "name": "search", |
| 29 | "description": "Search the web for information", |
| 30 | "parameters": { |
| 31 | "type": "object", |
| 32 | "properties": { |
| 33 | "query": { |
| 34 | "type": "string", |
| 35 | "description": "Search query" |
| 36 | }, |
| 37 | "num_results": { |
| 38 | "type": "integer", |
| 39 | "description": "Number of results to return" |
| 40 | } |
| 41 | }, |
| 42 | "required": ["query"] |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | ], |
| 47 | "messages": [ |
| 48 | { |
| 49 | "role": "system", |
| 50 | "content": "You are a helpful assistant." |
| 51 | }, |
| 52 | { |
| 53 | "role": "user", |
| 54 | "content": "What's the weather in Beijing?" |
| 55 | }, |
| 56 | { |
| 57 | "role": "assistant", |
| 58 | "reasoning_content": "The user wants to know the weather in Beijing. I should use the get_weather tool.", |
| 59 | "tool_calls": [ |
| 60 | { |
| 61 | "id": "call_001", |
| 62 | "type": "function", |
| 63 | "function": { |
| 64 | "name": "get_weather", |
| 65 | "arguments": "{\"location\": \"Beijing\", \"unit\": \"celsius\"}" |
| 66 | } |
| 67 | } |
| 68 | ] |
| 69 | }, |
| 70 | { |
| 71 | "role": "tool", |
| 72 | "tool_call_id": "call_001", |
| 73 | "content": "{\"temperature\": 22, \"condition\": \"sunny\", \"humidity\": 45}" |
| 74 | }, |
| 75 | { |
| 76 | "role": "assistant", |
| 77 | "reasoning_content": "Got the weather data. Let me format a nice response.", |
| 78 | "content": "The weather in Beijing is currently sunny with a temperature of 22°C and 45% humidity." |
| 79 | } |
| 80 | ] |
| 81 | } |
| 82 | |