multi_tool_streaming.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: 866
 10    host: ""
 11    body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"zai-org/GLM-4.6:cerebras","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"stream":true}'
 12    headers:
 13      Accept:
 14      - application/json
 15      Content-Type:
 16      - application/json
 17      User-Agent:
 18      - OpenAI/Go 2.7.1
 19    url: https://router.huggingface.co/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    body: |+
 27      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"content":"","role":"assistant"},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 28
 29      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"reasoning":""},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 30
 31      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"reasoning":""},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 32
 33      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"content":"\nI"},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 34
 35      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"content":"'ll add"},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 36
 37      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"content":" and"},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 38
 39      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"content":" multiply"},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 40
 41      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"content":" the numbers 2"},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 42
 43      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"content":" and 3 for you"},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 44
 45      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"content":".\n"},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 46
 47      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{"tool_calls":[{"function":{"name":"add","arguments":"{\"a\": 2, \"b\": 3}"},"type":"function","id":"5ffda67d4","index":0},{"function":{"name":"multiply","arguments":"{\"a\": 2, \"b\": 3}"},"type":"function","id":"64c2d22d0","index":1}]},"index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 48
 49      data: {"id":"chatcmpl-9a97fd4d-1e78-462a-920f-fca9d74b2f42","choices":[{"delta":{},"finish_reason":"tool_calls","index":0}],"created":1762855283,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk","usage":{"total_tokens":358,"completion_tokens":60,"prompt_tokens":298},"time_info":{"queue_time":0.00408092,"prompt_time":0.006777905,"completion_time":0.048781309,"total_time":0.062016963958740234,"created":1762855283.6442046}}
 50
 51    headers:
 52      Content-Type:
 53      - text/event-stream; charset=utf-8
 54    status: 200 OK
 55    code: 200
 56    duration: 363.296791ms
 57- id: 1
 58  request:
 59    proto: HTTP/1.1
 60    proto_major: 1
 61    proto_minor: 1
 62    content_length: 1284
 63    host: ""
 64    body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"},{"content":"\nI''ll add and multiply the numbers 2 and 3 for you.\n","tool_calls":[{"id":"5ffda67d4","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"64c2d22d0","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"5ffda67d4","role":"tool"},{"content":"6","tool_call_id":"64c2d22d0","role":"tool"}],"model":"zai-org/GLM-4.6:cerebras","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"stream":true}'
 65    headers:
 66      Accept:
 67      - application/json
 68      Content-Type:
 69      - application/json
 70      User-Agent:
 71      - OpenAI/Go 2.7.1
 72    url: https://router.huggingface.co/v1/chat/completions
 73    method: POST
 74  response:
 75    proto: HTTP/2.0
 76    proto_major: 2
 77    proto_minor: 0
 78    content_length: -1
 79    body: |+
 80      data: {"id":"chatcmpl-cb515f18-8a70-4aef-88ee-347cc2af9f6d","choices":[{"delta":{"content":"","role":"assistant"},"index":0}],"created":1762855284,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 81
 82      data: {"id":"chatcmpl-cb515f18-8a70-4aef-88ee-347cc2af9f6d","choices":[{"delta":{"reasoning":""},"index":0}],"created":1762855284,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 83
 84      data: {"id":"chatcmpl-cb515f18-8a70-4aef-88ee-347cc2af9f6d","choices":[{"delta":{"reasoning":""},"index":0}],"created":1762855284,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 85
 86      data: {"id":"chatcmpl-cb515f18-8a70-4aef-88ee-347cc2af9f6d","choices":[{"delta":{"content":"\nFor the numbers 2"},"index":0}],"created":1762855284,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 87
 88      data: {"id":"chatcmpl-cb515f18-8a70-4aef-88ee-347cc2af9f6d","choices":[{"delta":{"content":" and 3:\n\n-"},"index":0}],"created":1762855284,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 89
 90      data: {"id":"chatcmpl-cb515f18-8a70-4aef-88ee-347cc2af9f6d","choices":[{"delta":{"content":" Addition:"},"index":0}],"created":1762855284,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 91
 92      data: {"id":"chatcmpl-cb515f18-8a70-4aef-88ee-347cc2af9f6d","choices":[{"delta":{"content":" 2 + 3 = 5\n- Multip"},"index":0}],"created":1762855284,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 93
 94      data: {"id":"chatcmpl-cb515f18-8a70-4aef-88ee-347cc2af9f6d","choices":[{"delta":{"content":"lication: 2 × 3 = 6"},"index":0}],"created":1762855284,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk"}
 95
 96      data: {"id":"chatcmpl-cb515f18-8a70-4aef-88ee-347cc2af9f6d","choices":[{"delta":{},"finish_reason":"stop","index":0}],"created":1762855284,"model":"zai-glm-4.6","system_fingerprint":"fp_b78e4418d824cdcd64e8","object":"chat.completion.chunk","usage":{"total_tokens":409,"completion_tokens":37,"prompt_tokens":372},"time_info":{"queue_time":0.003343426,"prompt_time":0.008747444,"completion_time":0.023277878,"total_time":0.037343502044677734,"created":1762855284.1050324}}
 97
 98    headers:
 99      Content-Type:
100      - text/event-stream; charset=utf-8
101    status: 200 OK
102    code: 200
103    duration: 377.104625ms