when:
  path: /v1/chat/completions
  method: POST
  query_param: []
  header:
  - name: accept
    value: '*/*'
  - name: content-type
    value: application/json
  body: '{"messages":[{"content":[{"text":"You are a helpful assistant. When asked about weather, use the weather tool to get the current conditions. After calling the tool, return a JSON response with the city name and the weather description. DO NOT modify the description from the tool result.","type":"text"}],"role":"system"},{"content":"Hello, whats the weather in London?","role":"user"}],"model":"gpt-4o","tools":[{"function":{"description":"Get the current weather for a city.","name":"weather","parameters":{"properties":{"city":{"type":"string"}},"required":["city"],"type":"object"}},"type":"function"}]}'
then:
  status: 200
  header:
  - name: content-type
    value: application/json
  body: '{"choices":[{"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"annotations":[],"content":null,"refusal":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{\"city\":\"London\"}","name":"weather"},"id":"call_REDACTED_1","type":"function"}]}}],"created":0,"id":"chatcmpl-REDACTED_1","model":"gpt-4o-2024-08-06","object":"chat.completion","service_tier":"default","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":13,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":101,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0},"total_tokens":114}}'
---
when:
  path: /v1/chat/completions
  method: POST
  query_param: []
  header:
  - name: accept
    value: '*/*'
  - name: content-type
    value: application/json
  body: '{"messages":[{"content":[{"text":"You are a helpful assistant. When asked about weather, use the weather tool to get the current conditions. After calling the tool, return a JSON response with the city name and the weather description. DO NOT modify the description from the tool result.","type":"text"}],"role":"system"},{"content":"Hello, whats the weather in London?","role":"user"},{"role":"assistant","tool_calls":[{"function":{"arguments":"{\"city\":\"London\"}","name":"weather"},"id":"call_REDACTED_1","type":"function"}]},{"content":"The weather in London is all fire and brimstone","role":"tool","tool_call_id":"call_REDACTED_1"}],"model":"gpt-4o","response_format":{"json_schema":{"name":"WeatherResponse","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"city":{"type":"string"},"weather":{"type":"string"}},"required":["city","weather"],"title":"WeatherResponse","type":"object"},"strict":true},"type":"json_schema"},"tools":[{"function":{"description":"Get the current weather for a city.","name":"weather","parameters":{"properties":{"city":{"type":"string"}},"required":["city"],"type":"object"}},"type":"function"}]}'
then:
  status: 200
  header:
  - name: content-type
    value: application/json
  body: '{"choices":[{"finish_reason":"stop","index":0,"logprobs":null,"message":{"annotations":[],"content":"{\"city\":\"London\",\"weather\":\"The weather in London is all fire and brimstone\"}","refusal":null,"role":"assistant"}}],"created":0,"id":"chatcmpl-REDACTED_2","model":"gpt-4o-2024-08-06","object":"chat.completion","service_tier":"default","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":23,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":166,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0},"total_tokens":189}}'
