1---
2version: 2
3interactions:
4- id: 0
5 request:
6 proto: HTTP/1.1
7 proto_major: 1
8 proto_minor: 1
9 content_length: 462
10 host: ""
11 body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence, Italy?","role":"user"}],"model":"grok-3-mini","reasoning_effort":"high","tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}]}'
12 headers:
13 Accept:
14 - application/json
15 Content-Type:
16 - application/json
17 User-Agent:
18 - OpenAI/Go 2.3.0
19 url: https://api.x.ai/v1/chat/completions
20 method: POST
21 response:
22 proto: HTTP/2.0
23 proto_major: 2
24 proto_minor: 0
25 content_length: -1
26 uncompressed: true
27 body: '{"id":"f34c1057-adbf-c28f-afc3-aa8737faf493_us-east-1","object":"chat.completion","created":1758884792,"model":"grok-3-mini-high","choices":[{"index":0,"message":{"role":"assistant","content":"","reasoning_content":"First, the user is asking for the weather in Florence, Italy. I have an available function called \"weather\" that can get weather information for a location.\n\nThe function description is: \"Get weather information for a location\". The parameters require a \"location\" which is a string describing the city.\n\nIn this query, the user has provided \"Florence, Italy\", which clearly specifies the city and country. This should be sufficient as the location parameter.\n\nAll required parameters are provided: the location is \"Florence, Italy\". I don''t need to ask for clarification.\n\nI should call the function in the specified JSON format within <function_call> tags.\n\nFunction call format: <function_call>{\"action\": \"function_name\", \"action_input\": {\"parameter\": \"argument\"}}</function_call>\n\nFor this, the action is \"weather\", and the action_input should have \"location\" with the value \"Florence, Italy\".\n\nSo, the function call should be: <function_call>{\"action\": \"weather\", \"action_input\": {\"location\": \"Florence, Italy\"}}</function_call>\n\nAfter calling the function, I might need to handle the response in subsequent turns, but for now, this is the logical next step to advance the user''s request.\n\nMy response should only contain the function call since I''m deciding to call a function. I shouldn''t add any extra text unless necessary, and the instructions say to keep responses clear and not verbose.\n\nFinally, confirm: Is there any reason not to call the function? No, it matches perfectly.","tool_calls":[{"id":"call_71093541","function":{"name":"weather","arguments":"{\"location\":\"Florence, Italy\"}"},"type":"function"}],"refusal":null},"finish_reason":"tool_calls"}],"usage":{"prompt_tokens":288,"completion_tokens":27,"total_tokens":620,"prompt_tokens_details":{"text_tokens":288,"audio_tokens":0,"image_tokens":0,"cached_tokens":7},"completion_tokens_details":{"reasoning_tokens":305,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0},"num_sources_used":0},"system_fingerprint":"fp_a6fbae1a97"}'
28 headers:
29 Content-Type:
30 - application/json
31 status: 200 OK
32 code: 200
33 duration: 3.0643785s
34- id: 1
35 request:
36 proto: HTTP/1.1
37 proto_major: 1
38 proto_minor: 1
39 content_length: 682
40 host: ""
41 body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence, Italy?","role":"user"},{"tool_calls":[{"id":"call_71093541","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_71093541","role":"tool"}],"model":"grok-3-mini","reasoning_effort":"high","tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}]}'
42 headers:
43 Accept:
44 - application/json
45 Content-Type:
46 - application/json
47 User-Agent:
48 - OpenAI/Go 2.3.0
49 url: https://api.x.ai/v1/chat/completions
50 method: POST
51 response:
52 proto: HTTP/2.0
53 proto_major: 2
54 proto_minor: 0
55 content_length: -1
56 uncompressed: true
57 body: '{"id":"17c031cd-ed79-e606-6e09-2f426babeb54_us-east-1","object":"chat.completion","created":1758884795,"model":"grok-3-mini-high","choices":[{"index":0,"message":{"role":"assistant","content":"The current weather in Florence, Italy, is 40°C.","reasoning_content":"First, the user asked about the weather in Florence, Italy. I have a function available called \"weather\" that can get weather information for a location. The required parameter is \"location\", which is a string.\n\nIn my initial response, I already called the function with the location \"Florence, Italy\", as it was a direct match and all parameters were provided.\n\nNow, the function call has been executed, and the response is \"40 C\". This means the weather function returned that the temperature is 40 degrees Celsius. I need to respond to the user with this information in a helpful and clear way.\n\nMy role is to be a helpful assistant. I should present the information from the function call clearly. Since the function call was successful and provided the data, I don''t need to call any more functions unless there''s more to the user''s request.\n\nThe user''s query is fully addressed with this weather information. I should not add extra unnecessary information or verbosity, as per the instructions.\n\nFinally, I need to format my response properly. I''m not calling another function here, so I shouldn''t use the <function_call> tags. Just a straightforward response.\n\nResponse structure:\n- Keep it clear and concise.\n- State the weather based on the function''s output.","refusal":null},"finish_reason":"stop"}],"usage":{"prompt_tokens":332,"completion_tokens":13,"total_tokens":594,"prompt_tokens_details":{"text_tokens":332,"audio_tokens":0,"image_tokens":0,"cached_tokens":283},"completion_tokens_details":{"reasoning_tokens":249,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0},"num_sources_used":0},"system_fingerprint":"fp_a6fbae1a97"}'
58 headers:
59 Content-Type:
60 - application/json
61 status: 200 OK
62 code: 200
63 duration: 2.515450375s