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: 546
10    host: ""
11    body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"qwen/qwen3-235b-a22b-2507","max_tokens":4000,"stream_options":{"include_usage":true},"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"}],"usage":{"include":true},"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://openrouter.ai/api/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":"gen-1773323586-8fBgY9x08jXm7Re44i6j","object":"chat.completion.chunk","created":1773323586,"model":"qwen/qwen3-235b-a22b-07-25","provider":"Alibaba","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"id":"call_6fee9774e3d94243a44f64","type":"function","function":{"name":"weather","arguments":""}}]},"finish_reason":null,"native_finish_reason":null}]}
28
29      data: {"id":"gen-1773323586-8fBgY9x08jXm7Re44i6j","object":"chat.completion.chunk","created":1773323586,"model":"qwen/qwen3-235b-a22b-07-25","provider":"Alibaba","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"{\"location\": \"Flo"}}]},"finish_reason":null,"native_finish_reason":null}]}
30
31      data: {"id":"gen-1773323586-8fBgY9x08jXm7Re44i6j","object":"chat.completion.chunk","created":1773323586,"model":"qwen/qwen3-235b-a22b-07-25","provider":"Alibaba","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"rence,Italy\"}"}}]},"finish_reason":null,"native_finish_reason":null}]}
32
33      data: {"id":"gen-1773323586-8fBgY9x08jXm7Re44i6j","object":"chat.completion.chunk","created":1773323586,"model":"qwen/qwen3-235b-a22b-07-25","provider":"Alibaba","choices":[{"index":0,"delta":{"content":"","role":"assistant"},"finish_reason":"tool_calls","native_finish_reason":"tool_calls"}]}
34
35      data: {"id":"gen-1773323586-8fBgY9x08jXm7Re44i6j","object":"chat.completion.chunk","created":1773323586,"model":"qwen/qwen3-235b-a22b-07-25","provider":"Alibaba","choices":[],"usage":{"prompt_tokens":167,"completion_tokens":21,"total_tokens":188,"cost":0.0000375245,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.00005773,"upstream_inference_prompt_cost":0.00003841,"upstream_inference_completions_cost":0.00001932},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}}
36
37      data: [DONE]
38
39    headers:
40      Content-Type:
41      - text/event-stream
42    status: 200 OK
43    code: 200
44    duration: 904.924959ms
45- id: 1
46  request:
47    proto: HTTP/1.1
48    proto_major: 1
49    proto_minor: 1
50    content_length: 794
51    host: ""
52    body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_6fee9774e3d94243a44f64","function":{"arguments":"{\"location\": \"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_6fee9774e3d94243a44f64","role":"tool"}],"model":"qwen/qwen3-235b-a22b-2507","max_tokens":4000,"stream_options":{"include_usage":true},"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"}],"usage":{"include":true},"stream":true}'
53    headers:
54      Accept:
55      - application/json
56      Content-Type:
57      - application/json
58      User-Agent:
59      - OpenAI/Go 2.7.1
60    url: https://openrouter.ai/api/v1/chat/completions
61    method: POST
62  response:
63    proto: HTTP/2.0
64    proto_major: 2
65    proto_minor: 0
66    content_length: -1
67    body: |+
68      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[{"index":0,"delta":{"content":"The","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
69
70      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[{"index":0,"delta":{"content":" current","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
71
72      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[{"index":0,"delta":{"content":" temperature in Florence","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
73
74      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[{"index":0,"delta":{"content":", Italy is","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
75
76      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[{"index":0,"delta":{"content":" 40°C. That","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
77
78      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[{"index":0,"delta":{"content":"'s quite hot!","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
79
80      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[{"index":0,"delta":{"content":" You might want to","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
81
82      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[{"index":0,"delta":{"content":" take precautions if you're","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
83
84      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[{"index":0,"delta":{"content":" planning to spend time outdoors.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
85
86      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[{"index":0,"delta":{"content":"","role":"assistant"},"finish_reason":"stop","native_finish_reason":"stop"}]}
87
88      data: {"id":"gen-1773323587-zYCj0NBpXscVrjnVzE2P","object":"chat.completion.chunk","created":1773323587,"model":"qwen/qwen3-235b-a22b-07-25","provider":"AtlasCloud","choices":[],"usage":{"prompt_tokens":205,"completion_tokens":33,"total_tokens":238,"cost":0.00007004,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.00007004,"upstream_inference_prompt_cost":0.000041,"upstream_inference_completions_cost":0.00002904},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}}
89
90      data: [DONE]
91
92    headers:
93      Content-Type:
94      - text/event-stream
95    status: 200 OK
96    code: 200
97    duration: 2.0409005s