aws / aws/bedrock-agentcore-sdk-python

Add SSE event type and id support to _convert_to_sse

Abierto
#265 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
761
Forks
147
Merge medio
1 d 23 h
PR fusionados (30 d)
7

Descripción

**Is your feature request related to a problem? Please describe.**
`convert_to_sse` only emits data: lines. Consumers can't distinguish event types without parsing the JSON
payload, and there's no support for resumable streams via the SSE id field.

**Describe the solution you'd like**
Add an SseEvent dataclass with data, event, and id fields. When `_convert_to_sse` receives an SseEvent, it
emits the appropriate event: and id: lines. Plain values still produce data:-only frames — fully
backward-compatible.

**Describe alternatives you've considered**
- Tuple convention ((event_type, data)) — ambiguous since tuples could be legitimate data, and doesn't
support optional fields like id.
- Structured envelope dicts ({"event": "...", "data": ...}) — breaking change that moves SSE framing into
the application layer.

**Additional context**
The SSE spec defines three frame fields: event, data, and id. Supporting event lets consumers route on
event type directly. Supporting id enables resumable streams via Last-Event-ID on reconnect. Documentation: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#fields

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Locate _convert_to_sse and inspect how it currently formats plain values into data: frames. Define the requested SseEvent shape with data, event, and id, and verify that event and id lines are emitted while plain values remain data-only and backward-compatible.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
api, backend
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.