tool_streaming_groq-kimi-k2.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: 528
 10        host: ""
 11        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-instruct-0905","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"}],"stream":true}'
 12        headers:
 13            Accept:
 14              - application/json
 15            Content-Type:
 16              - application/json
 17            User-Agent:
 18              - OpenAI/Go 2.3.0
 19        url: https://api.groq.com/openai/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-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}],"x_groq":{"id":"req_01k603zbxyf6p8g3mykyjr8ayv"}}
 28
 29            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":"I'll"},"logprobs":null,"finish_reason":null}]}
 30
 31            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" check"},"logprobs":null,"finish_reason":null}]}
 32
 33            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}]}
 34
 35            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}]}
 36
 37            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}]}
 38
 39            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" Florence"},"logprobs":null,"finish_reason":null}]}
 40
 41            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
 42
 43            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" Italy"},"logprobs":null,"finish_reason":null}]}
 44
 45            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}]}
 46
 47            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}]}
 48
 49            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}]}
 50
 51            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"tool_calls":[{"id":"functions.weather:0","type":"function","function":{"name":"weather","arguments":"{\"location\":\"Florence,Italy\"}"},"index":0}]},"logprobs":null,"finish_reason":null}]}
 52
 53            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"x_groq":{"id":"req_01k603zbxyf6p8g3mykyjr8ayv","usage":{"queue_time":0.034909907,"prompt_tokens":99,"prompt_time":0.078721835,"completion_tokens":32,"completion_time":0.194281672,"total_tokens":131,"total_time":0.273003507}},"usage":{"queue_time":0.034909907,"prompt_tokens":99,"prompt_time":0.078721835,"completion_tokens":32,"completion_time":0.194281672,"total_tokens":131,"total_time":0.273003507}}
 54
 55            data: {"id":"chatcmpl-d7743865-12eb-48be-abbe-c5cb8f2aad3c","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[],"usage":{"queue_time":0.034909907,"prompt_tokens":99,"prompt_time":0.078721835,"completion_tokens":32,"completion_time":0.194281672,"total_tokens":131,"total_time":0.273003507},"service_tier":"on_demand"}
 56
 57            data: [DONE]
 58
 59        headers:
 60            Content-Type:
 61              - text/event-stream
 62        status: 200 OK
 63        code: 200
 64        duration: 172.074667ms
 65  - id: 1
 66    request:
 67        proto: HTTP/1.1
 68        proto_major: 1
 69        proto_minor: 1
 70        content_length: 822
 71        host: ""
 72        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"content":"I''ll check the weather in Florence, Italy for you.","tool_calls":[{"id":"functions.weather:0","function":{"arguments":"{\"location\":\"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"functions.weather:0","role":"tool"}],"model":"moonshotai/kimi-k2-instruct-0905","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"}],"stream":true}'
 73        headers:
 74            Accept:
 75              - application/json
 76            Content-Type:
 77              - application/json
 78            User-Agent:
 79              - OpenAI/Go 2.3.0
 80        url: https://api.groq.com/openai/v1/chat/completions
 81        method: POST
 82    response:
 83        proto: HTTP/2.0
 84        proto_major: 2
 85        proto_minor: 0
 86        content_length: -1
 87        body: |+
 88            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}],"x_groq":{"id":"req_01k603zc98f8eva6yv3pz1xj24"}}
 89
 90            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}]}
 91
 92            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" current"},"logprobs":null,"finish_reason":null}]}
 93
 94            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}]}
 95
 96            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}]}
 97
 98            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" Florence"},"logprobs":null,"finish_reason":null}]}
 99
100            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
101
102            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" Italy"},"logprobs":null,"finish_reason":null}]}
103
104            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}]}
105
106            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}]}
107
108            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":"40"},"logprobs":null,"finish_reason":null}]}
109
110            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":"°C"},"logprobs":null,"finish_reason":null}]}
111
112            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" ("},"logprobs":null,"finish_reason":null}]}
113
114            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":"104"},"logprobs":null,"finish_reason":null}]}
115
116            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":"°F"},"logprobs":null,"finish_reason":null}]}
117
118            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":")."},"logprobs":null,"finish_reason":null}]}
119
120            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" It's"},"logprobs":null,"finish_reason":null}]}
121
122            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" quite"},"logprobs":null,"finish_reason":null}]}
123
124            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" hot"},"logprobs":null,"finish_reason":null}]}
125
126            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" there"},"logprobs":null,"finish_reason":null}]}
127
128            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" right"},"logprobs":null,"finish_reason":null}]}
129
130            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":" now"},"logprobs":null,"finish_reason":null}]}
131
132            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}]}
133
134            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"x_groq":{"id":"req_01k603zc98f8eva6yv3pz1xj24","usage":{"queue_time":0.034547866,"prompt_tokens":150,"prompt_time":0.024323209,"completion_tokens":23,"completion_time":0.077130323,"total_tokens":173,"total_time":0.101453532}},"usage":{"queue_time":0.034547866,"prompt_tokens":150,"prompt_time":0.024323209,"completion_tokens":23,"completion_time":0.077130323,"total_tokens":173,"total_time":0.101453532}}
135
136            data: {"id":"chatcmpl-a82224ce-3076-4a95-9519-dcf8592339d3","object":"chat.completion.chunk","created":1758793281,"model":"moonshotai/kimi-k2-instruct-0905","system_fingerprint":"fp_6e6ff3688b","choices":[],"usage":{"queue_time":0.034547866,"prompt_tokens":150,"prompt_time":0.024323209,"completion_tokens":23,"completion_time":0.077130323,"total_tokens":173,"total_time":0.101453532},"service_tier":"on_demand"}
137
138            data: [DONE]
139
140        headers:
141            Content-Type:
142              - text/event-stream
143        status: 200 OK
144        code: 200
145        duration: 111.292708ms