Commit da15434
authored
Fix bedrock stalled stream protection not working with custom http client, and support additional_model_request_fields (#1877)
Supports additional_model_request_fields, to be able to enable thinking
tokens from claude models.
Also fixes the following error, which is caused by the stall-stream
config somehow not working with our custom new http client:
```
BamlClientError: Something went wrong with the LLM client: DispatchFailure(
DispatchFailure {
source: ConnectorError {
kind: Timeout,
source: ThroughputBelowMinimum {
expected: Throughput {
bytes_read: 1,
per_time_elapsed: 1s,
},
actual: Throughput {
bytes_read: 0,
per_time_elapsed: 1s,
},
},
connection: Unknown,
},
},
)
```
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Fixes stalled stream protection with custom HTTP client and adds
support for `additional_model_request_fields` in AWS Bedrock client.
>
> - **Behavior**:
> - Fixes stalled stream protection issue with custom HTTP client in
`AwsClient` by disabling `StalledStreamProtectionConfig`.
> - Adds support for `additional_model_request_fields` in
`UnresolvedAwsBedrock` and `ResolvedAwsBedrock`.
> - **Functions**:
> - Updates `chat_anyhow()` in `AwsClient` to handle multiple text
blocks.
> - Adds `without_meta()` to `UnresolvedAwsBedrock` to strip metadata.
> - **Integration Tests**:
> - Adds `TestAwsClaude37` function in `aws.baml` to test stalled stream
protection.
> - **Client Code**:
> - Updates client code in Go, Python, Ruby, and TypeScript to support
new `additional_model_request_fields` feature.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup>
for e87724c. You can
[customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->1 parent 332492c commit da15434
43 files changed
Lines changed: 2361 additions & 656 deletions
File tree
- engine
- baml-lib/llm-client/src/clients
- baml-runtime
- src/internal/llm_client/primitive/aws
- integ-tests
- baml_src/test-files/providers
- go/baml_client
- openapi/baml_client
- python
- baml_client
- tests
- react/baml_client
- react
- ruby/baml_client
- typescript-esm/baml_client
- typescript/baml_client
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | | - | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| |||
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| 82 | + | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
| |||
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
| |||
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
125 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
126 | 160 | | |
127 | 161 | | |
128 | 162 | | |
| |||
309 | 343 | | |
310 | 344 | | |
311 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
312 | 357 | | |
313 | 358 | | |
314 | 359 | | |
| |||
325 | 370 | | |
326 | 371 | | |
327 | 372 | | |
| 373 | + | |
328 | 374 | | |
329 | 375 | | |
330 | 376 | | |
331 | | - | |
332 | | - | |
333 | | - | |
| 377 | + | |
334 | 378 | | |
335 | 379 | | |
336 | 380 | | |
| |||
374 | 418 | | |
375 | 419 | | |
376 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
377 | 424 | | |
378 | 425 | | |
379 | 426 | | |
| |||
452 | 499 | | |
453 | 500 | | |
454 | 501 | | |
| 502 | + | |
455 | 503 | | |
456 | 504 | | |
457 | 505 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
| 148 | + | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
Lines changed: 93 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
95 | 128 | | |
96 | 129 | | |
97 | 130 | | |
| |||
392 | 425 | | |
393 | 426 | | |
394 | 427 | | |
| 428 | + | |
| 429 | + | |
395 | 430 | | |
396 | 431 | | |
397 | 432 | | |
398 | 433 | | |
399 | 434 | | |
400 | | - | |
| 435 | + | |
401 | 436 | | |
402 | 437 | | |
403 | 438 | | |
404 | 439 | | |
405 | 440 | | |
406 | 441 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
424 | 445 | | |
425 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
426 | 479 | | |
427 | 480 | | |
428 | 481 | | |
| |||
460 | 513 | | |
461 | 514 | | |
462 | 515 | | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
463 | 530 | | |
464 | 531 | | |
| 532 | + | |
465 | 533 | | |
466 | 534 | | |
467 | 535 | | |
| |||
596 | 664 | | |
597 | 665 | | |
598 | 666 | | |
| 667 | + | |
| 668 | + | |
599 | 669 | | |
600 | 670 | | |
601 | 671 | | |
602 | 672 | | |
603 | 673 | | |
604 | | - | |
| 674 | + | |
| 675 | + | |
605 | 676 | | |
606 | 677 | | |
607 | 678 | | |
| |||
894 | 965 | | |
895 | 966 | | |
896 | 967 | | |
| 968 | + | |
897 | 969 | | |
898 | 970 | | |
899 | 971 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
| |||
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
78 | 100 | | |
79 | 101 | | |
80 | 102 | | |
| |||
0 commit comments