Skip to content

Commit 0315dff

Browse files
committed
linting + changelog
1 parent 48365f7 commit 0315dff

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4444

4545
- `opentelemetry-instrumentation-botocore`: bedrock: only decode JSON input buffer in Anthropic Claude streaming
4646
([#3875](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3875))
47+
- `opentelemetry-instrumentation-botocore`: bedrock: Add safety check for bedrock ConverseStream responses
48+
([#TBD](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/TBD))
4749
- `opentelemetry-instrumentation-aiohttp-client`, `opentelemetry-instrumentation-aiohttp-server`: Fix readme links and text
4850
([#3902](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3902))
4951
- `opentelemetry-instrumentation-aws-lambda`: Fix ImportError with slash-delimited handler paths

instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_bedrock.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3051,21 +3051,23 @@ def stream_error_callback(exc, ended):
30513051
else:
30523052
assert "input" not in tool_block
30533053

3054+
30543055
def test_converse_stream_with_missing_output_in_response():
30553056
"""Test that converse stream handles malformed response missing output key."""
3057+
30563058
def stream_done_callback(response, ended):
30573059
pass
3058-
3060+
30593061
wrapper = ConverseStreamWrapper(
30603062
stream=mock.MagicMock(),
30613063
stream_done_callback=stream_done_callback,
30623064
model_id="amazon.nova-micro-v1:0",
30633065
)
3064-
3065-
malformed_response = {"stopReason": "end_turn"}
3066-
result = wrapper._complete_stream(malformed_response)
3066+
3067+
bedrock_response = {"stopReason": "end_turn"}
3068+
result = wrapper._complete_stream(bedrock_response)
30673069
assert result is None
3068-
3070+
30693071

30703072
def amazon_nova_messages():
30713073
return [

0 commit comments

Comments
 (0)