aws / aws/bedrock-agentcore-sdk-python

Allow bypass of automatic SSE conversion

Open
#52 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
761
Forks
147
Avg merge
1d 23h
Merged PRs (30d)
7

Description

**Is your feature request related to a problem? Please describe.**

The SDK automatically converts all streaming responses to SSE format even when already in SSE format. This prevents using custom SSE event types.

**Describe the solution you'd like**

Provide a way to customize SSE formatting when streaming responses. Either through a flag to bypass the automatic SSE conversion, or by detecting if the response if already in SSE format.

**Describe alternatives you've considered**

- Double-parsing on the client side.
- Including the event type in the data itself (though this makes efficient, type-safe parsing more difficult).

**Additional context**

The framework automatically detects generators/async generators and forces them through `_convert_to_sse()`.

Current behaviour:

```sse
data: "event: chunk\\ndata: {\\"bytes\\": \\"SGVsbG8gd29ybGQh\\"}\\n\\n"
```

Desired behaviour:

```sse
event: chunk
data: {"bytes": "SGVsbG8gd29ybGQh"}
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing the framework path that detects generators and async generators and calls `_convert_to_sse()`; compare how already-SSE responses are represented. Define the supported bypass or customization behavior, then verify that custom event types are preserved without double conversion for both streaming forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.