aws / aws/bedrock-agentcore-sdk-python

Add SSE event type and id support to _convert_to_sse

オープン
#265 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
761
フォーク
147
平均マージ
1日 23時間
マージ済み PR(30日)
7

説明

**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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, backend
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。