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: 903
 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":"google/gemini-3.1-flash-lite-preview","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"}],"usage":{"include":true},"stream":true}'
 12    headers:
 13      Accept:
 14      - application/json
 15      Content-Type:
 16      - application/json
 17      User-Agent:
 18      - Charm-Fantasy/0.15.0 (https://charm.land/fantasy)
 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      : OPENROUTER PROCESSING
 28
 29      : OPENROUTER PROCESSING
 30
 31      : OPENROUTER PROCESSING
 32
 33      : OPENROUTER PROCESSING
 34
 35      : OPENROUTER PROCESSING
 36
 37      : OPENROUTER PROCESSING
 38
 39      : OPENROUTER PROCESSING
 40
 41      data: {"id":"gen-1773945409-GKBLGdVdfDpywrF53THX","object":"chat.completion.chunk","created":1773945409,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":null,"reasoning_details":[{"type":"reasoning.encrypted","data":"AY89a1+4ldhGjiNn8S1VuGpFQrS57EYj823FwVVWyxvAG0cE5Qi8Mh3qDl5zaYStVes=","format":"google-gemini-v1","id":"tool_add_sYdHLQ7pM4TsXu9boNT5","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 42
 43      data: {"id":"gen-1773945409-GKBLGdVdfDpywrF53THX","object":"chat.completion.chunk","created":1773945409,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"id":"tool_add_sYdHLQ7pM4TsXu9boNT5","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null,"native_finish_reason":null}]}
 44
 45      data: {"id":"gen-1773945409-GKBLGdVdfDpywrF53THX","object":"chat.completion.chunk","created":1773945409,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"{\"b\":3,\"a\":2}"}}]},"finish_reason":null,"native_finish_reason":null}]}
 46
 47      data: {"id":"gen-1773945409-GKBLGdVdfDpywrF53THX","object":"chat.completion.chunk","created":1773945409,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":1,"id":"tool_multiply_M7nCvf8jvQADIkrw5YKS","type":"function","function":{"name":"multiply","arguments":""}}]},"finish_reason":null,"native_finish_reason":null}]}
 48
 49      data: {"id":"gen-1773945409-GKBLGdVdfDpywrF53THX","object":"chat.completion.chunk","created":1773945409,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":1,"function":{"arguments":"{\"a\":2,\"b\":3}"}}]},"finish_reason":null,"native_finish_reason":null}]}
 50
 51      data: {"id":"gen-1773945409-GKBLGdVdfDpywrF53THX","object":"chat.completion.chunk","created":1773945409,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":null},"finish_reason":"tool_calls","native_finish_reason":"STOP"}]}
 52
 53      data: {"id":"gen-1773945409-GKBLGdVdfDpywrF53THX","object":"chat.completion.chunk","created":1773945409,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant"},"finish_reason":"tool_calls","native_finish_reason":"STOP"}],"usage":{"prompt_tokens":83,"completion_tokens":32,"total_tokens":115,"cost":0.00006875,"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.00006875,"upstream_inference_prompt_cost":0.00002075,"upstream_inference_completions_cost":0.000048},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}}
 54
 55      data: [DONE]
 56
 57    headers:
 58      Content-Type:
 59      - text/event-stream
 60    status: 200 OK
 61    code: 200
 62    duration: 3.101256s
 63- id: 1
 64  request:
 65    proto: HTTP/1.1
 66    proto_major: 1
 67    proto_minor: 1
 68    content_length: 1544
 69    host: ""
 70    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"},{"tool_calls":[{"id":"tool_add_sYdHLQ7pM4TsXu9boNT5","function":{"arguments":"{\"b\":3,\"a\":2}","name":"add"},"type":"function"},{"id":"tool_multiply_M7nCvf8jvQADIkrw5YKS","function":{"arguments":"{\"a\":2,\"b\":3}","name":"multiply"},"type":"function"}],"role":"assistant","reasoning_details":[{"data":"AY89a1+4ldhGjiNn8S1VuGpFQrS57EYj823FwVVWyxvAG0cE5Qi8Mh3qDl5zaYStVes=","format":"google-gemini-v1","id":"tool_add_sYdHLQ7pM4TsXu9boNT5","index":0,"type":"reasoning.encrypted"}]},{"content":"5","tool_call_id":"tool_add_sYdHLQ7pM4TsXu9boNT5","role":"tool"},{"content":"6","tool_call_id":"tool_multiply_M7nCvf8jvQADIkrw5YKS","role":"tool"}],"model":"google/gemini-3.1-flash-lite-preview","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"}],"usage":{"include":true},"stream":true}'
 71    headers:
 72      Accept:
 73      - application/json
 74      Content-Type:
 75      - application/json
 76      User-Agent:
 77      - Charm-Fantasy/0.15.0 (https://charm.land/fantasy)
 78    url: https://openrouter.ai/api/v1/chat/completions
 79    method: POST
 80  response:
 81    proto: HTTP/2.0
 82    proto_major: 2
 83    proto_minor: 0
 84    content_length: -1
 85    body: |+
 86      : OPENROUTER PROCESSING
 87
 88      : OPENROUTER PROCESSING
 89
 90      : OPENROUTER PROCESSING
 91
 92      : OPENROUTER PROCESSING
 93
 94      : OPENROUTER PROCESSING
 95
 96      : OPENROUTER PROCESSING
 97
 98      : OPENROUTER PROCESSING
 99
100      data: {"id":"gen-1773945413-SErDL8acdBEMsr0VlQOj","object":"chat.completion.chunk","created":1773945413,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":"The sum","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
101
102      data: {"id":"gen-1773945413-SErDL8acdBEMsr0VlQOj","object":"chat.completion.chunk","created":1773945413,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":" of 2 and ","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
103
104      data: {"id":"gen-1773945413-SErDL8acdBEMsr0VlQOj","object":"chat.completion.chunk","created":1773945413,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":"3 is 5, and the product of 2 and","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
105
106      data: {"id":"gen-1773945413-SErDL8acdBEMsr0VlQOj","object":"chat.completion.chunk","created":1773945413,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":" 3 is 6.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
107
108      data: {"id":"gen-1773945413-SErDL8acdBEMsr0VlQOj","object":"chat.completion.chunk","created":1773945413,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":null,"reasoning_details":[{"type":"reasoning.encrypted","data":"AY89a18Arm6uvbtwsskpVED8BnueFZjjOLD5zxfz/ALu6B8EI7sgVUR6svb/kSSFRmM=","format":"google-gemini-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
109
110      data: {"id":"gen-1773945413-SErDL8acdBEMsr0VlQOj","object":"chat.completion.chunk","created":1773945413,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":null},"finish_reason":"stop","native_finish_reason":"STOP"}]}
111
112      data: {"id":"gen-1773945413-SErDL8acdBEMsr0VlQOj","object":"chat.completion.chunk","created":1773945413,"model":"google/gemini-3.1-flash-lite-preview-20260303","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant"},"finish_reason":"stop","native_finish_reason":"STOP"}],"usage":{"prompt_tokens":150,"completion_tokens":25,"total_tokens":175,"cost":0.000075,"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.000075,"upstream_inference_prompt_cost":0.0000375,"upstream_inference_completions_cost":0.0000375},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}}
113
114      data: [DONE]
115
116    headers:
117      Content-Type:
118      - text/event-stream
119    status: 200 OK
120    code: 200
121    duration: 3.220695416s