---
version: 2
interactions:
- id: 0
  request:
    proto: HTTP/1.1
    proto_major: 1
    proto_minor: 1
    content_length: 958
    host: ""
    body: '{"messages":[{"content":"Generate information about ''The Lord of the Rings'' book by J.R.R. Tolkien, including genres like fantasy and adventure, and its publication year (1954).","role":"user"}],"model":"glm-4.5","max_tokens":4000,"tool_choice":{"function":{"name":"Book"},"type":"function"},"tools":[{"function":{"name":"Book","strict":false,"description":"A book with title, author, genres, and publication year","parameters":{"properties":{"author":{"properties":{"name":{"description":"Author''s name","type":"string"},"nationality":{"description":"Author''s nationality","type":"string"}},"required":["name","nationality"],"type":"object"},"genres":{"description":"List of genres","items":{"type":"string"},"type":"array"},"published_year":{"description":"Year the book was published","type":"integer"},"title":{"description":"The book title","type":"string"}},"required":["title","author","genres","published_year"],"type":"object"}},"type":"function"}]}'
    headers:
      Accept:
      - application/json
      Content-Type:
      - application/json
      User-Agent:
      - OpenAI/Go 2.7.1
    url: https://api.z.ai/api/coding/paas/v4/chat/completions
    method: POST
  response:
    proto: HTTP/2.0
    proto_major: 2
    proto_minor: 0
    content_length: -1
    uncompressed: true
    body: '{"choices":[{"finish_reason":"tool_calls","index":0,"message":{"content":"","reasoning_content":"\nThe user is asking me to generate information about \"The Lord of the Rings\" book. They''ve provided specific details:\n- Title: \"The Lord of the Rings\"\n- Author: J.R.R. Tolkien \n- Genres: fantasy and adventure\n- Publication year: 1954\n\nI need to use the Book function to create this information. Let me check the required parameters:\n- title: \"The Lord of the Rings\" ✓\n- author: This needs to be an object with name and nationality. The user provided \"J.R.R. Tolkien\" as the name, but didn''t specify nationality. However, I know Tolkien was British, so I should include that.\n- genres: [\"fantasy\", \"adventure\"] ✓\n- published_year: 1954 ✓\n\nFor the author parameter, I need to create an object with:\n- name: \"J.R.R. Tolkien\"\n- nationality: I should use \"British\" as Tolkien was from the UK\n\nLet me make the function call.","role":"assistant","tool_calls":[{"function":{"arguments":"{\"author\":{\"name\": \"J.R.R. Tolkien\", \"nationality\": \"British\"},\"genres\":[\"fantasy\", \"adventure\"],\"published_year\":1954,\"title\":\"The Lord of the Rings\"}","name":"Book"},"id":"call_-8178161609897772812","index":0,"type":"function"}]}}],"created":1762637648,"id":"20251109053400036d2d4153bd41bf","model":"glm-4.5","request_id":"20251109053400036d2d4153bd41bf","usage":{"completion_tokens":275,"prompt_tokens":317,"prompt_tokens_details":{"cached_tokens":43},"total_tokens":592}}'
    headers:
      Content-Type:
      - application/json; charset=UTF-8
    status: 200 OK
    code: 200
    duration: 8.903275792s
