ag-ui-protocol / ag-ui-protocol/ag-ui

[Chore]: `@ag-ui/client`, bundle-size optimization: Expose HttpClient without protobuf

Offen
#1,230 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement SDK
Vorherrschende Sprache
Python
Sterne
15.9k
Forks
1.4k
Ø Merge
1 T. 17 Std.
Gemergte PRs (30 T.)
163

Beschreibung

_Originally discussed on [Discord](https://discord.com/channels/1379082175625953370/1474619674074550404)_

The current [HTTPAgent](https://github.com/ag-ui-protocol/ag-ui/blob/main/sdks/typescript/packages/client/src/agent/http.ts) uses [`transformHttpEventStream`](https://github.com/ag-ui-protocol/ag-ui/blob/main/sdks/typescript/packages/client/src/transform/http.ts) which uses/support both protobuf responses, and non-protobuf responses.

This means that consumers that do not use protobuf either need to:
- Accept that they will import `@ag-ui/proto` as a dead-weight (unused code)
- Base themselves from the [AbstractAgent](https://github.com/ag-ui-protocol/ag-ui/blob/main/sdks/typescript/packages/client/src/agent/agent.ts), and recode part of the transformHttpEventStream.

What I'd propose is to extract the actual stream handler out of the HTTPAgent and to make it a composable part instead, allowing consumers to do something like

```ts
const mySseAgent = new HTTPAgent({parser: sseParser});
const myProtoAgent = new HTTPAgent({parser: protoParse});
```

Allowing the consumer to only use, import, and bundle the parser it actually needs.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.