aws / aws/bedrock-agentcore-sdk-python
Allow bypass of automatic SSE conversion
- Vorherrschende Sprache
- Python
- Sterne
- 761
- Forks
- 147
- Ø Merge
- 1 T. 23 Std.
- Gemergte PRs (30 T.)
- 7
Beschreibung
**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"}
```
Beitragsleitfaden
Rechercherichtung
Beginne damit, den Pfad im Framework nachzuverfolgen, der Generatoren und asynchrone Generatoren erkennt und `_convert_to_sse()` aufruft; vergleiche, wie bereits als SSE vorliegende Antworten dargestellt werden. Definiere das unterstützte Bypass- oder Anpassungsverhalten und überprüfe anschließend, dass benutzerdefinierte Event-Typen für beide Streaming-Formen ohne doppelte Konvertierung erhalten bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- backend-api-design
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100