---
version: 2
interactions:
- id: 0
  request:
    proto: HTTP/1.1
    proto_major: 1
    proto_minor: 1
    content_length: 462
    host: ""
    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"}]}'
    headers:
      Accept:
      - application/json
      Content-Type:
      - application/json
      User-Agent:
      - Charm-Fantasy/0.12.2 (https://charm.land/fantasy)
    url: https://api.x.ai/v1/chat/completions
    method: POST
  response:
    proto: HTTP/2.0
    proto_major: 2
    proto_minor: 0
    content_length: -1
    uncompressed: true
    body: '{"id":"b9a2c6b4-3fc5-d632-efd0-7e422c4946f7","object":"chat.completion","created":1773345699,"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 infer anything else; it''s straightforward.\n\nAccording to the instructions, if the user''s query can be addressed using an available function and all required parameters are provided, I should trigger a function call in the specified JSON format within <function_call> tags.\n\nThe format should be: <function_call>{\"action\": \"function_name\", \"action_input\": {\"parameter\": \"argument\"}}</function_call>\n\nFor this case, the action is \"weather\", and the action_input should have the parameter \"location\" with the argument \"Florence, Italy\".\n\nI should not make my response verbose; keep it clear. Since I''m calling a function, I don''t need to add extra text unless necessary. The instructions say to use the <function_call> tag only when deciding to call a function, and in this case, that''s the logical next step.\n\nAfter calling the function, in a multi-turn conversation, I might need to handle the response, but for now, the immediate action is to call the function.\n\nFinally, confirm: no missing parameters, function matches, so I should call it.\n\nResponse should be: <function_call>{\"action\": \"weather\", \"action_input\": {\"location\": \"Florence, Italy\"}}</function_call>","tool_calls":[{"id":"call_27480597","function":{"name":"weather","arguments":"{\"location\":\"Florence, Italy\"}"},"type":"function"}],"refusal":null},"finish_reason":"tool_calls"}],"usage":{"prompt_tokens":288,"completion_tokens":27,"total_tokens":665,"prompt_tokens_details":{"text_tokens":288,"audio_tokens":0,"image_tokens":0,"cached_tokens":7},"completion_tokens_details":{"reasoning_tokens":350,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0},"num_sources_used":0,"cost_in_usd_ticks":2733250},"system_fingerprint":"fp_25ea88a038"}'
    headers:
      Content-Type:
      - application/json
    status: 200 OK
    code: 200
    duration: 2.843427125s
- id: 1
  request:
    proto: HTTP/1.1
    proto_major: 1
    proto_minor: 1
    content_length: 2536
    host: ""
    body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence, Italy?","role":"user"},{"tool_calls":[{"id":"call_27480597","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant","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 infer anything else; it''s straightforward.\n\nAccording to the instructions, if the user''s query can be addressed using an available function and all required parameters are provided, I should trigger a function call in the specified JSON format within \u003cfunction_call\u003e tags.\n\nThe format should be: \u003cfunction_call\u003e{\"action\": \"function_name\", \"action_input\": {\"parameter\": \"argument\"}}\u003c/function_call\u003e\n\nFor this case, the action is \"weather\", and the action_input should have the parameter \"location\" with the argument \"Florence, Italy\".\n\nI should not make my response verbose; keep it clear. Since I''m calling a function, I don''t need to add extra text unless necessary. The instructions say to use the \u003cfunction_call\u003e tag only when deciding to call a function, and in this case, that''s the logical next step.\n\nAfter calling the function, in a multi-turn conversation, I might need to handle the response, but for now, the immediate action is to call the function.\n\nFinally, confirm: no missing parameters, function matches, so I should call it.\n\nResponse should be: \u003cfunction_call\u003e{\"action\": \"weather\", \"action_input\": {\"location\": \"Florence, Italy\"}}\u003c/function_call\u003e"},{"content":"40 C","tool_call_id":"call_27480597","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"}]}'
    headers:
      Accept:
      - application/json
      Content-Type:
      - application/json
      User-Agent:
      - Charm-Fantasy/0.12.2 (https://charm.land/fantasy)
    url: https://api.x.ai/v1/chat/completions
    method: POST
  response:
    proto: HTTP/2.0
    proto_major: 2
    proto_minor: 0
    content_length: -1
    uncompressed: true
    body: '{"id":"57d26e7b-64e4-50a6-4399-3f076d348451","object":"chat.completion","created":1773345702,"model":"grok-3-mini-high","choices":[{"index":0,"message":{"role":"assistant","content":"The weather in Florence, Italy is 40°C.","reasoning_content":"First, the user asked: \"What''s the weather in Florence, Italy?\" This directly matches the available function \"weather\" which gets weather information for a location.\n\nThe function requires a \"location\" parameter, which is provided in the query as \"Florence, Italy\". It''s clear and inferable, so I can call this function.\n\nIn my previous response, I already made a function call: <function_call>{\"action\": \"weather\", \"action_input\": {\"location\": \"Florence, Italy\"}}</function_call>. Now, I''m receiving a response from that function call, which is \"40 C\".\n\nThe system prompt says: \"In multi-turn conversations, continue calling relevant functions to advance the user''s request until either the user''s request is fully fulfilled or you need more information to call a function.\"\n\nThe user''s request was to get the weather, and I''ve now received the weather information from the function call. So, the request is fulfilled. I don''t need to call another function.\n\nI should respond to the user with the information I have. The prompt also says: \"Keep your response to user clear; please do not make your response verbose!\" So, I need to be concise.\n\nMy response should include the weather information: \"40 C\". But I should make it user-friendly. Perhaps say something like: \"The weather in Florence, Italy is 40 degrees Celsius.\"\n\nThe function response is \"40 C\", which I assume means 40 degrees Celsius. I should confirm that, but since it''s given, I''ll use it.\n\nFinally, I should not include any <function_call> tags in this response because no further function calls are needed. The request is complete.","refusal":null},"finish_reason":"stop"}],"usage":{"prompt_tokens":331,"completion_tokens":11,"total_tokens":674,"prompt_tokens_details":{"text_tokens":331,"audio_tokens":0,"image_tokens":0,"cached_tokens":283},"completion_tokens_details":{"reasoning_tokens":332,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0},"num_sources_used":0,"cost_in_usd_ticks":2071250},"system_fingerprint":"fp_25ea88a038"}'
    headers:
      Content-Type:
      - application/json
    status: 200 OK
    code: 200
    duration: 2.89131475s
