Native Amazon Bedrock adapter support -- !:json_schema#2
Native Amazon Bedrock adapter support -- !:json_schema#2
Conversation
.vscode/settings.json
Outdated
There was a problem hiding this comment.
this should be ignored by default. I'll make the change
There was a problem hiding this comment.
I've removed it. It seems that the json file was there before thus marked deleted
| {value, rest} | ||
|
|
||
| _ -> | ||
| {nil, rest} |
There was a problem hiding this comment.
For any other type, you currently return {nil, rest} without consuming the value bytes.
Example: <<name_len, "foo", type=1, AA, BB, CC, ...>>
After reading name and type, rest = <<AA, BB, CC, ...>>.
This is then recursed with this same rest, so AA is wrongly treated as the next header's name_length. This could desync the parser and can cause MatchError or corrupted headers.
To be correct, unknown types must either be fully parsed/skipped or cause a fail-fast error, not silently ignored.
There was a problem hiding this comment.
Good catch! You're right — the original _ -> {nil, rest} clause didn't consume the value bytes, which would desync the parser for any non-string (7) header.
Fixed by explicitly handling all AWS Event Stream header types (0-9), consuming the correct number of bytes for each type.
The OpenAPI compatibility does not support all models (Anthropic models) and native API implementation is needed.
This adapter uses
converseAPI for model's response consistency.