aws / aws/bedrock-agentcore-sdk-python

Allow bypass of automatic SSE conversion

未关闭
#52 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
761
派生
147
平均合并
1 天 23 小时
30 天内合并 PR
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 摘要。