encoding/test_input.json
| 1 | { |
| 2 | "tools": [ |
| 3 | { |
| 4 | "type": "function", |
| 5 | "function": { |
| 6 | "name": "get_datetime", |
| 7 | "description": "Get the current date and time", |
| 8 | "parameters": { |
| 9 | "type": "object", |
| 10 | "properties": { |
| 11 | "timezone": { |
| 12 | "type": "string", |
| 13 | "description": "The timezone, e.g. Asia/Shanghai, UTC" |
| 14 | } |
| 15 | }, |
| 16 | "required": ["timezone"] |
| 17 | } |
| 18 | } |
| 19 | }, |
| 20 | { |
| 21 | "type": "function", |
| 22 | "function": { |
| 23 | "name": "get_weather", |
| 24 | "description": "Get the weather for a specific date and location", |
| 25 | "parameters": { |
| 26 | "type": "object", |
| 27 | "properties": { |
| 28 | "location": { |
| 29 | "type": "string", |
| 30 | "description": "The city name, e.g. Beijing, Hangzhou" |
| 31 | }, |
| 32 | "date": { |
| 33 | "type": "string", |
| 34 | "description": "The date in YYYY-MM-DD format" |
| 35 | } |
| 36 | }, |
| 37 | "required": ["location", "date"] |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | ], |
| 42 | "messages": [ |
| 43 | { |
| 44 | "role": "system", |
| 45 | "content": "You are a helpful Assistant." |
| 46 | }, |
| 47 | { |
| 48 | "role": "user", |
| 49 | "content": "明天杭州和北京的天气怎么样?" |
| 50 | }, |
| 51 | { |
| 52 | "role": "assistant", |
| 53 | "reasoning_content": "用户询问明天的天气,我需要先获取当前日期来计算明天的日期📅", |
| 54 | "tool_calls": [ |
| 55 | { |
| 56 | "id": "call_xK9mN3pL2qR8vT5wY6hZ1aB4", |
| 57 | "type": "function", |
| 58 | "function": { |
| 59 | "arguments": "{\"timezone\": \"Asia/Shanghai\"}", |
| 60 | "name": "get_datetime" |
| 61 | } |
| 62 | } |
| 63 | ] |
| 64 | }, |
| 65 | { |
| 66 | "tool_call_id": "call_xK9mN3pL2qR8vT5wY6hZ1aB4", |
| 67 | "role": "tool", |
| 68 | "content": "{\"current_date\": \"2024-01-15\", \"current_time\": \"14:30:00\", \"timezone\": \"Asia/Shanghai\"}" |
| 69 | }, |
| 70 | { |
| 71 | "role": "assistant", |
| 72 | "reasoning_content": "现在知道今天是2024-01-15,明天就是2024-01-16。接下来查询杭州和北京明天的天气🌤️", |
| 73 | "tool_calls": [ |
| 74 | { |
| 75 | "id": "call_bN7kR9mX3pQ2wL5vY8jZ4cD6", |
| 76 | "type": "function", |
| 77 | "function": { |
| 78 | "arguments": "{\"location\": \"Hangzhou\", \"date\": \"2024-01-16\"}", |
| 79 | "name": "get_weather" |
| 80 | } |
| 81 | }, |
| 82 | { |
| 83 | "id": "call_dP9mL7kX5rT4yN3wZ2hV8eF1", |
| 84 | "type": "function", |
| 85 | "function": { |
| 86 | "arguments": "{\"location\": \"Beijing\", \"date\": \"2024-01-16\"}", |
| 87 | "name": "get_weather" |
| 88 | } |
| 89 | } |
| 90 | ] |
| 91 | }, |
| 92 | { |
| 93 | "tool_call_id": "call_bN7kR9mX3pQ2wL5vY8jZ4cD6", |
| 94 | "role": "tool", |
| 95 | "content": "{\"location\": \"Hangzhou\", \"date\": \"2024-01-16\", \"temperature_high\": \"12\", \"temperature_low\": \"5\", \"weather\": \"多云\", \"humidity\": \"65%\"}" |
| 96 | }, |
| 97 | { |
| 98 | "tool_call_id": "call_dP9mL7kX5rT4yN3wZ2hV8eF1", |
| 99 | "role": "tool", |
| 100 | "content": "{\"location\": \"Beijing\", \"date\": \"2024-01-16\", \"temperature_high\": \"-2\", \"temperature_low\": \"-8\", \"weather\": \"晴\", \"humidity\": \"30%\"}" |
| 101 | }, |
| 102 | { |
| 103 | "role": "assistant", |
| 104 | "reasoning_content": "已获取两个城市明天的天气信息,现在整理给用户✨", |
| 105 | "content": "根据查询结果,明天(2024年1月16日)的天气情况如下:\n\n**杭州**:\n- 天气:多云\n- 最高温度:12°C\n- 最低温度:5°C\n- 湿度:65%\n\n**北京**:\n- 天气:晴\n- 最高温度:-2°C\n- 最低温度:-8°C\n- 湿度:30%\n\n杭州明天会比较温暖但有些多云,而北京会很冷但是晴天。建议在北京的朋友要注意保暖!" |
| 106 | }, |
| 107 | { |
| 108 | "role": "user", |
| 109 | "content": "谢谢!那后天呢?" |
| 110 | }, |
| 111 | { |
| 112 | "role": "assistant", |
| 113 | "reasoning_content": "用户现在问后天的天气,后天是2024-01-17,我可以直接查询(因为已知今天日期)🗓️", |
| 114 | "tool_calls": [ |
| 115 | { |
| 116 | "id": "call_fR3nK8mV7pL4xT2yW9jB5gH3", |
| 117 | "type": "function", |
| 118 | "function": { |
| 119 | "arguments": "{\"location\": \"Hangzhou\", \"date\": \"2024-01-17\"}", |
| 120 | "name": "get_weather" |
| 121 | } |
| 122 | }, |
| 123 | { |
| 124 | "id": "call_hT5pN2kY9rV6zL3wX1mD7jK8", |
| 125 | "type": "function", |
| 126 | "function": { |
| 127 | "arguments": "{\"location\": \"Beijing\", \"date\": \"2024-01-17\"}", |
| 128 | "name": "get_weather" |
| 129 | } |
| 130 | } |
| 131 | ] |
| 132 | }, |
| 133 | { |
| 134 | "tool_call_id": "call_fR3nK8mV7pL4xT2yW9jB5gH3", |
| 135 | "role": "tool", |
| 136 | "content": "{\"location\": \"Hangzhou\", \"date\": \"2024-01-17\", \"temperature_high\": \"15\", \"temperature_low\": \"8\", \"weather\": \"小雨\", \"humidity\": \"80%\"}" |
| 137 | }, |
| 138 | { |
| 139 | "tool_call_id": "call_hT5pN2kY9rV6zL3wX1mD7jK8", |
| 140 | "role": "tool", |
| 141 | "content": "{\"location\": \"Beijing\", \"date\": \"2024-01-17\", \"temperature_high\": \"0\", \"temperature_low\": \"-6\", \"weather\": \"多云\", \"humidity\": \"45%\"}" |
| 142 | }, |
| 143 | { |
| 144 | "role": "assistant", |
| 145 | "reasoning_content": "获取到后天的天气数据,整理回复给用户📝", |
| 146 | "content": "后天(2024年1月17日)的天气情况:\n\n**杭州**:\n- 天气:小雨\n- 最高温度:15°C\n- 最低温度:8°C\n- 湿度:80%\n\n**北京**:\n- 天气:多云\n- 最高温度:0°C\n- 最低温度:-6°C\n- 湿度:45%\n\n杭州后天会有小雨,温度略有回升,记得带伞。北京会稍微暖和一点,但依然很冷,请继续做好保暖措施。" |
| 147 | } |
| 148 | ] |
| 149 | } |
| 150 | |