complex_object.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: 964
10    host: ""
11    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.7-flash","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"}]}'
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://api.z.ai/api/coding/paas/v4/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: '{"choices":[{"finish_reason":"tool_calls","index":0,"message":{"content":"","reasoning_content":"The user is asking me to generate information about \"The Lord of the Rings\" book by J.R.R. Tolkien. They''ve provided the specific details I need:\n- Title: \"The Lord of the Rings\"\n- Author: J.R.R. Tolkien (nationality: British/English - this is well-known)\n- Genres: fantasy and adventure (they mentioned these explicitly)\n- Publication year: 1954\n\nI need to use the Book function to create this entry. Let me check the required parameters:\n- title: \"The Lord of the Rings\" ✓\n- author: Need to create an author object with name and nationality\n  - name: \"J.R.R. Tolkien\" ✓\n  - nationality: \"British\" (this is correct - Tolkien was British) ✓\n- genres: [\"fantasy\", \"adventure\"] ✓\n- published_year: 1954 ✓\n\nAll required parameters are provided or can be reasonably inferred.","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_-7807251775253113230","index":0,"type":"function"}]}}],"created":1773349517,"id":"20260313050506f00a029fba604431","model":"glm-4.7-flash","object":"chat.completion","request_id":"20260313050506f00a029fba604431","usage":{"completion_tokens":252,"completion_tokens_details":{"reasoning_tokens":194},"prompt_tokens":312,"prompt_tokens_details":{"cached_tokens":43},"total_tokens":564}}'
28    headers:
29      Content-Type:
30      - application/json; charset=UTF-8
31    status: 200 OK
32    code: 200
33    duration: 12.180893083s