aws / aws/bedrock-agentcore-sdk-python

Allow bypass of automatic SSE conversion

Aperta
#52 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
761
Fork
147
Merge medio
1g 23h
PR unite (30g)
7

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia tracciando il percorso del framework che rileva generatori e generatori asincroni e chiama `_convert_to_sse()`; confronta come vengono rappresentate le risposte che sono già SSE. Definisci il comportamento di bypass o personalizzazione supportato, quindi verifica che i tipi di evento personalizzati vengano preservati senza una doppia conversione per entrambe le forme di streaming.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
backend-api-design
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.