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

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

オープン
#1,230 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement SDK
主要言語
Python
スター
15.9k
フォーク
1.4k
平均マージ
1日 17時間
マージ済み PR(30日)
163

説明

_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.

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

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

評価

この issue はまだ評価されていません。

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

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