agentscope-ai / agentscope-ai/agentscope-java

[Feature]: Offload base64 image data from AgentStateStore to reduce history retrieval overhead

Đang mở
#2,852 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Java
Star
5.6k
Fork
1.3k
Merge trung bình
4 ngày 12 giờ
Pull request đã merge (30 ngày)
77

Mô tả

**Problem**
When `AgentStateStore` stores an `ImageBlock` that contains a base64-encoded image (transmitted in that format), it writes the full base64 string into `stateData`. This string is often very large, which significantly increases the time spent on retrieving or parsing historical messages.

**Solution**
Offload the base64-encoded image string to a new field or a separate table, and replace it with a placeholder in the original `ImageBlock`. Then, in the method that assembles historical messages for the model, add a step to restore the base64 data from the offloaded storage. This way, for routine history-reading operations, developers can choose not to query the base64 data.

**问题**
`AgentStateStore` 存储 base64 格式传输的图片消息 `ImageBlock` 时,会将图片的 base64 编码字符串存到 `stateData` 中,而这个字符串往往很大,这导致获取/解析历史消息的耗时显著变长。

**方案**
将图片的 base64 编码字符串卸载到一个新字段或者新表中,原 `ImageBlock` 中使用占位符替代,在模型组装历史消息的方法中增加还原 base64 编码的操作。这样一来,常规的历史消息读取处理时,开发者可以选择不查询 base64 编码信息。

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.