aws / aws/bedrock-agentcore-sdk-python

Allow bypass of automatic SSE conversion

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

説明

**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"}
```

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

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

調査の方向性

まず、ジェネレーターと非同期ジェネレーターを検出して `_convert_to_sse()` を呼び出す framework の経路を追跡し、すでに SSE になっているレスポンスがどのように表現されているかを比較します。サポートされるバイパスまたはカスタマイズの動作を定義し、その後、両方のストリーミング形式でカスタムイベント型が二重変換なしに保持されることを確認します。

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

評価

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

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

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