Skip to content

Commit de024cf

Browse files
authored
[feat] Add full collector capability to Go (#2119)
- Updated `HTTPRequest` and `HTTPResponse` structs to derive `Clone` for better usability. - Introduced new methods in `LLMCallKind` for handling requests and streams. - Enhanced the `Collector` API in Go to support named collectors and additional functionality. - Added comprehensive tests for the collector API, including usage tracking and log management. This commit improves the overall functionality and usability of the collector, making it easier to manage and track requests and responses. ``` 2025-07-10T02:25:47.156 [BAML INFO] BAML (v0.201.0) loaded === RUN TestFooStream === PAUSE TestFooStream === CONT TestFooStream 2025-07-10T02:25:48.564 [BAML INFO] Function Foo: Client: openai/gpt-4o-mini (gpt-4o-mini-2024-07-18) - 1394ms. StopReason: stop. Tokens(in/out): 76/49 ---PROMPT--- system: Fill out this data model with some examples. Answer in JSON using any of these schemas: { item: { a: int, b: string, }, element: string, element2: string, } or { a: int, b: string, } use 8192 somewhere in the data model ---LLM REPLY--- ```json { "item": { "a": 8192, "b": "Example string for item" }, "element": "Sample element", "element2": "Another example element" } ``` ---Parsed Response (class Example2)--- { "item": { "a": 8192, "b": "Example string for item" }, "element": "Sample element", "element2": "Another example element" } main_test.go:86: Received 52 stream chunks before final result cffi name: "test-foo-stream-collector" "test-foo-stream-collector" name test-foo-stream-collector main_test.go:89: Collector name: test-foo-stream-collector main_test.go:89: Input tokens: 76 main_test.go:89: Output tokens: 49 main_test.go:89: Found 1 log entries main_test.go:89: Log ID: bfcall_01jzstfggxfyz9txzwcf83t0dj main_test.go:89: Function name: Foo main_test.go:89: Log type: stream main_test.go:89: Start time (UTC ms): 1752139547165 main_test.go:89: Duration (ms): 1399 main_test.go:89: Log input tokens: 76 main_test.go:89: Log output tokens: 49 main_test.go:89: Raw LLM response length: 153 characters main_test.go:89: Metadata keys: [baml.language] main_test.go:89: Calls count: 1 main_test.go:89: Call 0: Client name: openai/gpt-4o-mini main_test.go:89: Call 0: Provider: openai main_test.go:89: Call 0: Selected: true main_test.go:89: Call 0: Start time: 1752139547166 main_test.go:89: Call 0: Duration: 1398 ms main_test.go:89: Call 0: Input tokens: 76 main_test.go:89: Call 0: Output tokens: 49 main_test.go:89: Call 0: Request ID: breq_01jzstfggyf35st9d6ppz9s4rr main_test.go:89: Call 0: URL: https://api.openai.com/v1/chat/completions main_test.go:89: Call 0: Method: POST main_test.go:89: Call 0: Headers count: 3 main_test.go:89: Call 0: Content-Type: application/json main_test.go:89: Call 0: Has Authorization header main_test.go:89: Call 0 request: Body size: 402 bytes main_test.go:89: Call 0 request: Body text length: 402 characters main_test.go:89: Call 0 request: Body text preview: {"model":"gpt-4o-mini","messages":[{"role":"system","content":[{"type":"text","text":"Fill out this data model with some examples.\n\nAnswer in JSON using any of these schemas:\n{\n item: {\n a: i main_test.go:89: Call 0 request: Body contains valid JSON data main_test.go:89: Call 0: Found 53 SSE responses main_test.go:89: Call 0 SSE[0]: Text length: 327 characters main_test.go:89: Call 0 SSE[0]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[0]: SSE contains: map[choices:[map[delta:map[content: refusal:<nil> role:assistant] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[1]: Text length: 296 characters main_test.go:89: Call 0 SSE[1]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[1]: SSE contains: map[choices:[map[delta:map[content:```] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[2]: Text length: 297 characters main_test.go:89: Call 0 SSE[2]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[2]: SSE contains: map[choices:[map[delta:map[content:json] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[3]: Text length: 295 characters main_test.go:89: Call 0 SSE[3]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[3]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[4]: Text length: 296 characters main_test.go:89: Call 0 SSE[4]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[4]: SSE contains: map[choices:[map[delta:map[content:{ ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[5]: Text length: 294 characters main_test.go:89: Call 0 SSE[5]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[5]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[6]: Text length: 296 characters main_test.go:89: Call 0 SSE[6]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[6]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[7]: Text length: 297 characters main_test.go:89: Call 0 SSE[7]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[7]: SSE contains: map[choices:[map[delta:map[content:item] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[8]: Text length: 296 characters main_test.go:89: Call 0 SSE[8]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[8]: SSE contains: map[choices:[map[delta:map[content:":] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[9]: Text length: 297 characters main_test.go:89: Call 0 SSE[9]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[9]: SSE contains: map[choices:[map[delta:map[content: { ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[10]: Text length: 296 characters main_test.go:89: Call 0 SSE[10]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[10]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[11]: Text length: 296 characters main_test.go:89: Call 0 SSE[11]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[11]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[12]: Text length: 294 characters main_test.go:89: Call 0 SSE[12]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[12]: SSE contains: map[choices:[map[delta:map[content:a] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[13]: Text length: 296 characters main_test.go:89: Call 0 SSE[13]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[13]: SSE contains: map[choices:[map[delta:map[content:":] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[14]: Text length: 294 characters main_test.go:89: Call 0 SSE[14]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[14]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[15]: Text length: 296 characters main_test.go:89: Call 0 SSE[15]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[15]: SSE contains: map[choices:[map[delta:map[content:819] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[16]: Text length: 294 characters main_test.go:89: Call 0 SSE[16]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[16]: SSE contains: map[choices:[map[delta:map[content:2] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[17]: Text length: 296 characters main_test.go:89: Call 0 SSE[17]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[17]: SSE contains: map[choices:[map[delta:map[content:, ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[18]: Text length: 296 characters main_test.go:89: Call 0 SSE[18]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[18]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[19]: Text length: 296 characters main_test.go:89: Call 0 SSE[19]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[19]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[20]: Text length: 294 characters main_test.go:89: Call 0 SSE[20]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[20]: SSE contains: map[choices:[map[delta:map[content:b] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[21]: Text length: 296 characters main_test.go:89: Call 0 SSE[21]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[21]: SSE contains: map[choices:[map[delta:map[content:":] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[22]: Text length: 296 characters main_test.go:89: Call 0 SSE[22]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[22]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[23]: Text length: 300 characters main_test.go:89: Call 0 SSE[23]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[23]: SSE contains: map[choices:[map[delta:map[content:Example] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[24]: Text length: 300 characters main_test.go:89: Call 0 SSE[24]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[24]: SSE contains: map[choices:[map[delta:map[content: string] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[25]: Text length: 297 characters main_test.go:89: Call 0 SSE[25]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[25]: SSE contains: map[choices:[map[delta:map[content: for] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[26]: Text length: 298 characters main_test.go:89: Call 0 SSE[26]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[26]: SSE contains: map[choices:[map[delta:map[content: item] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[27]: Text length: 297 characters main_test.go:89: Call 0 SSE[27]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[27]: SSE contains: map[choices:[map[delta:map[content:" ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[28]: Text length: 294 characters main_test.go:89: Call 0 SSE[28]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[28]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[29]: Text length: 298 characters main_test.go:89: Call 0 SSE[29]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[29]: SSE contains: map[choices:[map[delta:map[content: }, ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[30]: Text length: 294 characters main_test.go:89: Call 0 SSE[30]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[30]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[31]: Text length: 296 characters main_test.go:89: Call 0 SSE[31]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[31]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[32]: Text length: 300 characters main_test.go:89: Call 0 SSE[32]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[32]: SSE contains: map[choices:[map[delta:map[content:element] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[33]: Text length: 296 characters main_test.go:89: Call 0 SSE[33]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[33]: SSE contains: map[choices:[map[delta:map[content:":] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[34]: Text length: 296 characters main_test.go:89: Call 0 SSE[34]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[34]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[35]: Text length: 299 characters main_test.go:89: Call 0 SSE[35]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[35]: SSE contains: map[choices:[map[delta:map[content:Sample] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[36]: Text length: 301 characters main_test.go:89: Call 0 SSE[36]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[36]: SSE contains: map[choices:[map[delta:map[content: element] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[37]: Text length: 298 characters main_test.go:89: Call 0 SSE[37]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[37]: SSE contains: map[choices:[map[delta:map[content:", ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[38]: Text length: 294 characters main_test.go:89: Call 0 SSE[38]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[38]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[39]: Text length: 296 characters main_test.go:89: Call 0 SSE[39]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[39]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[40]: Text length: 300 characters main_test.go:89: Call 0 SSE[40]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[40]: SSE contains: map[choices:[map[delta:map[content:element] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[41]: Text length: 294 characters main_test.go:89: Call 0 SSE[41]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[41]: SSE contains: map[choices:[map[delta:map[content:2] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[42]: Text length: 296 characters main_test.go:89: Call 0 SSE[42]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[42]: SSE contains: map[choices:[map[delta:map[content:":] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[43]: Text length: 296 characters main_test.go:89: Call 0 SSE[43]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[43]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[44]: Text length: 300 characters main_test.go:89: Call 0 SSE[44]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[44]: SSE contains: map[choices:[map[delta:map[content:Another] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[45]: Text length: 301 characters main_test.go:89: Call 0 SSE[45]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[45]: SSE contains: map[choices:[map[delta:map[content: example] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[46]: Text length: 301 characters main_test.go:89: Call 0 SSE[46]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[46]: SSE contains: map[choices:[map[delta:map[content: element] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[47]: Text length: 297 characters main_test.go:89: Call 0 SSE[47]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[47]: SSE contains: map[choices:[map[delta:map[content:" ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[48]: Text length: 296 characters main_test.go:89: Call 0 SSE[48]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[48]: SSE contains: map[choices:[map[delta:map[content:} ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[49]: Text length: 296 characters main_test.go:89: Call 0 SSE[49]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[49]: SSE contains: map[choices:[map[delta:map[content:```] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[50]: Text length: 283 characters main_test.go:89: Call 0 SSE[50]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[50]: SSE contains: map[choices:[map[delta:map[] finish_reason:stop index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Call 0 SSE[51]: Text length: 471 characters main_test.go:89: Call 0 SSE[51]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[51]: SSE contains: map[choices:[] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:map[completion_tokens:49 completion_tokens_details:map[accepted_prediction_tokens:0 audio_tokens:0 reasoning_tokens:0 rejected_prediction_tokens:0] prompt_tokens:76 prompt_tokens_details:map[audio_tokens:0 cached_tokens:0] total_tokens:125]] main_test.go:89: Call 0 SSE[52]: Text length: 6 characters main_test.go:89: Call 0 SSE[52]: Text content: [DONE] main_test.go:89: Call 0 SSE[52]: SSE JSON data is null main_test.go:89: Found selected call main_test.go:89: Selected call: Client name: openai/gpt-4o-mini main_test.go:89: Selected call: Provider: openai main_test.go:89: Selected call: Selected: true main_test.go:89: Selected call: Start time: 1752139547166 main_test.go:89: Selected call: Duration: 1398 ms main_test.go:89: Selected call: Input tokens: 76 main_test.go:89: Selected call: Output tokens: 49 main_test.go:89: Selected call: Request ID: breq_01jzstfggyf35st9d6ppz9s4rr main_test.go:89: Selected call: URL: https://api.openai.com/v1/chat/completions main_test.go:89: Selected call: Method: POST main_test.go:89: Selected call: Headers count: 3 main_test.go:89: Selected call: Content-Type: application/json main_test.go:89: Selected call: Has Authorization header main_test.go:89: Selected call request: Body size: 402 bytes main_test.go:89: Selected call request: Body text length: 402 characters main_test.go:89: Selected call request: Body text preview: {"model":"gpt-4o-mini","messages":[{"role":"system","content":[{"type":"text","text":"Fill out this data model with some examples.\n\nAnswer in JSON using any of these schemas:\n{\n item: {\n a: i main_test.go:89: Selected call request: Body contains valid JSON data main_test.go:89: Selected call: Found 53 SSE responses main_test.go:89: Selected call SSE[0]: Text length: 327 characters main_test.go:89: Selected call SSE[0]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[0]: SSE contains: map[choices:[map[delta:map[content: refusal:<nil> role:assistant] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[1]: Text length: 296 characters main_test.go:89: Selected call SSE[1]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[1]: SSE contains: map[choices:[map[delta:map[content:```] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[2]: Text length: 297 characters main_test.go:89: Selected call SSE[2]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[2]: SSE contains: map[choices:[map[delta:map[content:json] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[3]: Text length: 295 characters main_test.go:89: Selected call SSE[3]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[3]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[4]: Text length: 296 characters main_test.go:89: Selected call SSE[4]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[4]: SSE contains: map[choices:[map[delta:map[content:{ ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[5]: Text length: 294 characters main_test.go:89: Selected call SSE[5]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[5]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[6]: Text length: 296 characters main_test.go:89: Selected call SSE[6]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[6]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[7]: Text length: 297 characters main_test.go:89: Selected call SSE[7]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[7]: SSE contains: map[choices:[map[delta:map[content:item] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[8]: Text length: 296 characters main_test.go:89: Selected call SSE[8]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[8]: SSE contains: map[choices:[map[delta:map[content:":] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[9]: Text length: 297 characters main_test.go:89: Selected call SSE[9]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[9]: SSE contains: map[choices:[map[delta:map[content: { ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[10]: Text length: 296 characters main_test.go:89: Selected call SSE[10]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[10]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[11]: Text length: 296 characters main_test.go:89: Selected call SSE[11]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[11]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[12]: Text length: 294 characters main_test.go:89: Selected call SSE[12]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[12]: SSE contains: map[choices:[map[delta:map[content:a] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[13]: Text length: 296 characters main_test.go:89: Selected call SSE[13]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[13]: SSE contains: map[choices:[map[delta:map[content:":] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[14]: Text length: 294 characters main_test.go:89: Selected call SSE[14]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[14]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[15]: Text length: 296 characters main_test.go:89: Selected call SSE[15]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[15]: SSE contains: map[choices:[map[delta:map[content:819] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[16]: Text length: 294 characters main_test.go:89: Selected call SSE[16]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[16]: SSE contains: map[choices:[map[delta:map[content:2] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[17]: Text length: 296 characters main_test.go:89: Selected call SSE[17]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[17]: SSE contains: map[choices:[map[delta:map[content:, ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[18]: Text length: 296 characters main_test.go:89: Selected call SSE[18]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[18]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[19]: Text length: 296 characters main_test.go:89: Selected call SSE[19]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[19]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[20]: Text length: 294 characters main_test.go:89: Selected call SSE[20]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[20]: SSE contains: map[choices:[map[delta:map[content:b] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[21]: Text length: 296 characters main_test.go:89: Selected call SSE[21]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[21]: SSE contains: map[choices:[map[delta:map[content:":] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[22]: Text length: 296 characters main_test.go:89: Selected call SSE[22]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[22]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[23]: Text length: 300 characters main_test.go:89: Selected call SSE[23]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[23]: SSE contains: map[choices:[map[delta:map[content:Example] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[24]: Text length: 300 characters main_test.go:89: Selected call SSE[24]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[24]: SSE contains: map[choices:[map[delta:map[content: string] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[25]: Text length: 297 characters main_test.go:89: Selected call SSE[25]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[25]: SSE contains: map[choices:[map[delta:map[content: for] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[26]: Text length: 298 characters main_test.go:89: Selected call SSE[26]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[26]: SSE contains: map[choices:[map[delta:map[content: item] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[27]: Text length: 297 characters main_test.go:89: Selected call SSE[27]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[27]: SSE contains: map[choices:[map[delta:map[content:" ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[28]: Text length: 294 characters main_test.go:89: Selected call SSE[28]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[28]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[29]: Text length: 298 characters main_test.go:89: Selected call SSE[29]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[29]: SSE contains: map[choices:[map[delta:map[content: }, ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[30]: Text length: 294 characters main_test.go:89: Selected call SSE[30]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[30]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[31]: Text length: 296 characters main_test.go:89: Selected call SSE[31]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[31]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[32]: Text length: 300 characters main_test.go:89: Selected call SSE[32]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[32]: SSE contains: map[choices:[map[delta:map[content:element] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[33]: Text length: 296 characters main_test.go:89: Selected call SSE[33]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[33]: SSE contains: map[choices:[map[delta:map[content:":] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[34]: Text length: 296 characters main_test.go:89: Selected call SSE[34]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[34]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[35]: Text length: 299 characters main_test.go:89: Selected call SSE[35]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[35]: SSE contains: map[choices:[map[delta:map[content:Sample] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[36]: Text length: 301 characters main_test.go:89: Selected call SSE[36]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[36]: SSE contains: map[choices:[map[delta:map[content: element] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[37]: Text length: 298 characters main_test.go:89: Selected call SSE[37]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[37]: SSE contains: map[choices:[map[delta:map[content:", ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[38]: Text length: 294 characters main_test.go:89: Selected call SSE[38]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[38]: SSE contains: map[choices:[map[delta:map[content: ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[39]: Text length: 296 characters main_test.go:89: Selected call SSE[39]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[39]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[40]: Text length: 300 characters main_test.go:89: Selected call SSE[40]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[40]: SSE contains: map[choices:[map[delta:map[content:element] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[41]: Text length: 294 characters main_test.go:89: Selected call SSE[41]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[41]: SSE contains: map[choices:[map[delta:map[content:2] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[42]: Text length: 296 characters main_test.go:89: Selected call SSE[42]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[42]: SSE contains: map[choices:[map[delta:map[content:":] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[43]: Text length: 296 characters main_test.go:89: Selected call SSE[43]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[43]: SSE contains: map[choices:[map[delta:map[content: "] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[44]: Text length: 300 characters main_test.go:89: Selected call SSE[44]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[44]: SSE contains: map[choices:[map[delta:map[content:Another] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[45]: Text length: 301 characters main_test.go:89: Selected call SSE[45]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[45]: SSE contains: map[choices:[map[delta:map[content: example] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[46]: Text length: 301 characters main_test.go:89: Selected call SSE[46]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[46]: SSE contains: map[choices:[map[delta:map[content: element] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[47]: Text length: 297 characters main_test.go:89: Selected call SSE[47]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[47]: SSE contains: map[choices:[map[delta:map[content:" ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[48]: Text length: 296 characters main_test.go:89: Selected call SSE[48]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[48]: SSE contains: map[choices:[map[delta:map[content:} ] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[49]: Text length: 296 characters main_test.go:89: Selected call SSE[49]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[49]: SSE contains: map[choices:[map[delta:map[content:```] finish_reason:<nil> index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[50]: Text length: 283 characters main_test.go:89: Selected call SSE[50]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[50]: SSE contains: map[choices:[map[delta:map[] finish_reason:stop index:0 logprobs:<nil>]] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:<nil>] main_test.go:89: Selected call SSE[51]: Text length: 471 characters main_test.go:89: Selected call SSE[51]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Selected call SSE[51]: SSE contains: map[choices:[] created:1.752139547e+09 id:chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b model:gpt-4o-mini-2024-07-18 object:chat.completion.chunk service_tier:default system_fingerprint:fp_34a54ae93c usage:map[completion_tokens:49 completion_tokens_details:map[accepted_prediction_tokens:0 audio_tokens:0 reasoning_tokens:0 rejected_prediction_tokens:0] prompt_tokens:76 prompt_tokens_details:map[audio_tokens:0 cached_tokens:0] total_tokens:125]] main_test.go:89: Selected call SSE[52]: Text length: 6 characters main_test.go:89: Selected call SSE[52]: Text content: [DONE] main_test.go:89: Selected call SSE[52]: SSE JSON data is null main_test.go:89: Testing log entry 0 main_test.go:89: Log ID: bfcall_01jzstfggxfyz9txzwcf83t0dj main_test.go:89: Function name: Foo main_test.go:89: Log type: stream main_test.go:89: Start time (UTC ms): 1752139547165 main_test.go:89: Duration (ms): 1399 main_test.go:89: Log input tokens: 76 main_test.go:89: Log output tokens: 49 main_test.go:89: Raw LLM response length: 153 characters main_test.go:89: Metadata keys: [baml.language] main_test.go:89: Calls count: 1 main_test.go:89: Call 0: Client name: openai/gpt-4o-mini main_test.go:89: Call 0: Provider: openai main_test.go:89: Call 0: Selected: true main_test.go:89: Call 0: Start time: 1752139547166 main_test.go:89: Call 0: Duration: 1398 ms main_test.go:89: Call 0: Input tokens: 76 main_test.go:89: Call 0: Output tokens: 49 main_test.go:89: Call 0: Request ID: breq_01jzstfggyf35st9d6ppz9s4rr main_test.go:89: Call 0: URL: https://api.openai.com/v1/chat/completions main_test.go:89: Call 0: Method: POST main_test.go:89: Call 0: Headers count: 3 main_test.go:89: Call 0: Content-Type: application/json main_test.go:89: Call 0: Has Authorization header main_test.go:89: Call 0 request: Body size: 402 bytes main_test.go:89: Call 0 request: Body text length: 402 characters main_test.go:89: Call 0 request: Body text preview: {"model":"gpt-4o-mini","messages":[{"role":"system","content":[{"type":"text","text":"Fill out this data model with some examples.\n\nAnswer in JSON using any of these schemas:\n{\n item: {\n a: i main_test.go:89: Call 0 request: Body contains valid JSON data main_test.go:89: Call 0: Found 53 SSE responses main_test.go:89: Call 0 SSE[0]: Text length: 327 characters main_test.go:89: Call 0 SSE[0]: Text content: {"id":"chatcmpl-BrhpD10Az8gWlYRn1DlNDSFt9yy3b","object":"chat.completion.chunk","created":1752139547 main_test.go:89: Call 0 SSE[0]: SSE contains: map[choices:[map[delta:map[content: refusal:<nil> ro…
1 parent 1e007ec commit de024cf

169 files changed

Lines changed: 7023 additions & 3009 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/primary.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ jobs:
218218
# Find Ruby library path and add it to LD_LIBRARY_PATH
219219
RUBY_LIB_PATH=$(ruby -e 'puts RbConfig::CONFIG["libdir"]')
220220
export LD_LIBRARY_PATH="${RUBY_LIB_PATH}:${LD_LIBRARY_PATH}"
221+
# We need to build baml_cffi first so that the baml_cffi.dylib is available for the tests
222+
cargo build --package baml_cffi
221223
cargo test --lib
222224
working-directory: engine
223225

engine/Cargo.lock

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/baml-lib/baml-types/src/baml_value.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ pub enum BamlValue {
3030
Null,
3131
}
3232

33+
impl TryFrom<serde_json::Value> for BamlValue {
34+
type Error = anyhow::Error;
35+
36+
fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
37+
Ok(serde_json::from_value(value)?)
38+
}
39+
}
40+
3341
impl serde::Serialize for BamlValue {
3442
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3543
match self {

engine/baml-lib/baml-types/src/tracing/events.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ where
379379
Option::<HashMap<String, String>>::deserialize(deserializer)
380380
}
381381

382-
#[derive(Debug, Serialize, Deserialize)]
382+
#[derive(Debug, Serialize, Deserialize, Clone)]
383383
pub struct HTTPRequest {
384384
// since LLM requests could be made in parallel, we need to match the response to the request
385385
pub id: HttpRequestId,
@@ -439,17 +439,17 @@ pub struct ClientDetails {
439439
pub options: IndexMap<String, serde_json::Value>,
440440
}
441441

442-
#[derive(Debug, Serialize, Deserialize)]
442+
#[derive(Clone, Debug, Serialize, Deserialize)]
443443
pub struct HTTPResponse {
444444
// since LLM requests could be made in parallel, we need to match the response to the request
445445
pub request_id: HttpRequestId,
446446
pub status: u16,
447447
#[serde(serialize_with = "serialize_redacted_optional_headers")]
448448
#[serde(deserialize_with = "deserialize_optional_headers")]
449449
headers: Option<HashMap<String, String>>,
450-
pub body: HTTPBody,
450+
pub body: Arc<HTTPBody>,
451451

452-
pub client_details: ClientDetails,
452+
pub client_details: Arc<ClientDetails>,
453453
}
454454

455455
#[derive(Debug, Serialize, Deserialize)]
@@ -470,11 +470,15 @@ impl HTTPResponse {
470470
request_id,
471471
status,
472472
headers,
473-
body,
474-
client_details,
473+
body: Arc::new(body),
474+
client_details: Arc::new(client_details),
475475
}
476476
}
477477

478+
pub fn id(&self) -> &HttpRequestId {
479+
&self.request_id
480+
}
481+
478482
pub fn headers(&self) -> Option<&HashMap<String, String>> {
479483
self.headers.as_ref()
480484
}

engine/baml-runtime/src/tracingv2/storage/storage.rs

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -327,16 +327,22 @@ fn build_function_log(
327327

328328
// Streaming call
329329
calls.push(LLMCallKind::Stream(LLMStreamCall {
330-
client_name: client,
331-
provider,
330+
llm_call: LLMCall {
331+
client_name: client,
332+
provider,
333+
timing: Timing {
334+
start_time_utc_ms: start_t,
335+
duration_ms: Some(partial_duration),
336+
},
337+
request: call_acc.http_request.clone(),
338+
response: call_acc.http_response.clone(),
339+
usage: Some(local_usage),
340+
selected: call_acc.llm_response.is_some(),
341+
},
332342
timing: StreamTiming {
333343
start_time_utc_ms: start_t,
334344
duration_ms: Some(partial_duration),
335345
},
336-
request: call_acc.http_request.clone(),
337-
response: call_acc.http_response.clone(),
338-
usage: Some(local_usage),
339-
selected: call_acc.llm_response.is_some(),
340346
sse_chunks,
341347
}));
342348
}
@@ -568,7 +574,21 @@ impl LLMCallKind {
568574
pub fn selected(&self) -> bool {
569575
match self {
570576
LLMCallKind::Basic(c) => c.selected,
571-
LLMCallKind::Stream(c) => c.selected,
577+
LLMCallKind::Stream(c) => c.llm_call.selected,
578+
}
579+
}
580+
581+
pub fn as_request(&self) -> Option<&LLMCall> {
582+
match self {
583+
LLMCallKind::Basic(c) => Some(c),
584+
LLMCallKind::Stream(c) => None,
585+
}
586+
}
587+
588+
pub fn as_stream(&self) -> Option<&LLMStreamCall> {
589+
match self {
590+
LLMCallKind::Basic(c) => None,
591+
LLMCallKind::Stream(c) => Some(c),
572592
}
573593
}
574594
}
@@ -586,13 +606,8 @@ pub struct LLMCall {
586606

587607
#[derive(Debug, Default, Clone, Serialize)]
588608
pub struct LLMStreamCall {
589-
pub client_name: String,
590-
pub provider: String,
609+
pub llm_call: LLMCall,
591610
pub timing: StreamTiming,
592-
pub request: Option<Arc<HTTPRequest>>,
593-
pub response: Option<Arc<HTTPResponse>>,
594-
pub usage: Option<Usage>,
595-
pub selected: bool,
596611
pub sse_chunks: Option<Arc<LLMHTTPStreamResponse>>,
597612
}
598613

@@ -640,6 +655,16 @@ impl Collector {
640655
}
641656
}
642657

658+
pub fn clear(&self) -> usize {
659+
let mut guard = self.tracked_ids.lock().unwrap();
660+
for fid in guard.iter() {
661+
BAML_TRACER.lock().unwrap().dec_ref(fid);
662+
}
663+
let len = guard.len();
664+
guard.clear();
665+
len
666+
}
667+
643668
pub fn function_logs(&self) -> Vec<FunctionLog> {
644669
let guard = self.tracked_ids.lock().unwrap();
645670
guard

0 commit comments

Comments
 (0)