tool.yaml

 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: 453
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","max_tokens":4000,"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      - Charm-Fantasy/0.12.2 (https://charm.land/fantasy)
19    url: https://fantasy-playground-resource.openai.azure.com/openai/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: |
28      {"choices":[{"content_filter_results":{},"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"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, described as \"the city\".\n\nThe user provided \"Florence, Italy\". This seems to specify both the city and the country, which should be fine since the parameter is just \"location\" and it's a string. I can use \"Florence, Italy\" as the location string.\n\nAll required parameters are provided: the location is given. No missing or unclear parts.\n\nI should call the function if it can address the query. Here, it directly matches, so I need to trigger a function call.\n\nThe function call format is: \u003cfunction_call\u003e{\"action\": \"function_name\", \"action_input\": {\"parameter\": \"argument\"}}\u003c/function_call\u003e\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: \u003cfunction_call\u003e{\"action\": \"weather\", \"action_input\": {\"location\": \"Florence, Italy\"}}\u003c/function_call\u003e\n\nMy response should only contain this function call if I'm deciding to call a function. The instructions say: \"You are only permitted to use the \u003cfunction_call\u003e tag in your response only if you have made the decision to call a function.\" And in this case, I have.\n\nI shouldn't add any other text unless necessary, like if I need clarification, but here I don't.\n\nFinally, after calling the function, in a multi-turn conversation, I might need to handle the response, but for now, this is the first step to advance the request.","refusal":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{\"location\":\"Florence, Italy\"}","call_id":null,"name":"weather"},"id":"call_88313407","type":"function"}]},"stop_reason":null}],"created":1773338570,"id":"0814c38b-a2e1-445c-8112-276b69d68a3a_sidecar","model":"grok-3-mini-high","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"filtered":false,"detected":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"usage":{"audio_prompt_tokens":0,"completion_tokens":27,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":356,"rejected_prediction_tokens":0},"num_sources_used":0,"prompt_tokens":288,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0,"image_tokens":0,"text_tokens":288},"total_tokens":671}}
29    headers:
30      Content-Type:
31      - application/json
32    status: 200 OK
33    code: 200
34    duration: 2.533727166s
35- id: 1
36  request:
37    proto: HTTP/1.1
38    proto_major: 1
39    proto_minor: 1
40    content_length: 673
41    host: ""
42    body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_88313407","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_88313407","role":"tool"}],"model":"grok-3-mini","max_tokens":4000,"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"}]}'
43    headers:
44      Accept:
45      - application/json
46      Content-Type:
47      - application/json
48      User-Agent:
49      - Charm-Fantasy/0.12.2 (https://charm.land/fantasy)
50    url: https://fantasy-playground-resource.openai.azure.com/openai/v1/chat/completions
51    method: POST
52  response:
53    proto: HTTP/2.0
54    proto_major: 2
55    proto_minor: 0
56    content_length: -1
57    uncompressed: true
58    body: |
59      {"choices":[{"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"protected_material_code":{"filtered":false,"detected":false},"protected_material_text":{"filtered":false,"detected":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}},"finish_reason":"stop","index":0,"logprobs":null,"message":{"content":"The weather in Florence, Italy is 40°C.","reasoning_content":"First, the user asked about the weather in Florence, Italy. I have an available function called \"weather\" that can retrieve weather information for a location.\n\nThe function requires a \"location\" parameter, which is a string. The user provided \"Florence, Italy\", which clearly specifies the city and country, so all required parameters are present and inferable.\n\nI should call the function if it can advance the user's request. In this case, calling the \"weather\" function directly addresses the query.\n\nThe response format specifies that I should use \u003cfunction_call\u003e tags with JSON if I'm calling a function. I did that in my initial response.\n\nNow, in this simulation, after I call the function, there's a response: \"Function: 40 C\". This seems to be the result from the function call.\n\nAs the assistant, I need to handle the conversation. Since the function call was made, and now I have the result, I should provide a clear, non-verbose response to the user with the information.\n\nThe system prompt says: \"Keep your response to user clear; please do not make your response verbose!\" So, I should directly answer the user with the weather information.\n\nThis is a multi-turn conversation. I called the function in the first response, and now I have the result. I need to continue by providing the result to the user.\n\nMy response should not include another function call unless more is needed, but here the request is fulfilled with the weather data.\n\nFinal response should be clear: e.g., \"The weather in Florence, Italy is 40°C.\"\n\nThe function response is \"40 C\", which I assume means 40 degrees Celsius. I should present it nicely.\n\nI shouldn't add extra verbosity, so keep it straightforward.","refusal":null,"role":"assistant","tool_calls":null},"stop_reason":null}],"created":1773338573,"id":"de80fb5e-e706-4433-b3da-a978c83ddae2_sidecar","model":"grok-3-mini-high","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"filtered":false,"detected":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"usage":{"audio_prompt_tokens":0,"completion_tokens":11,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":352,"rejected_prediction_tokens":0},"num_sources_used":0,"prompt_tokens":332,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0,"image_tokens":0,"text_tokens":332},"total_tokens":695}}
60    headers:
61      Content-Type:
62      - application/json
63    status: 200 OK
64    code: 200
65    duration: 2.235902458s