Skip to content

feat: add UI message backend contract#56

Open
LIlGG wants to merge 1 commit into
mainfrom
feat/ui-message-stream
Open

feat: add UI message backend contract#56
LIlGG wants to merge 1 commit into
mainfrom
feat/ui-message-stream

Conversation

@LIlGG
Copy link
Copy Markdown
Member

@LIlGG LIlGG commented Jun 5, 2026

What this PR does / why we need it:

SDK UI 后端相关工作,已完成文本生成、流式生成、工具调用等能力。

此 PR 目标是在后端补齐 Halo 自有的 UI Message 契约,让调用方可以直接围绕 UIMessageUIMessageStreamResponseUIMessageChatHandlers 构建前端聊天接口。相对原来的低层 SDK 调用,现在可以更好地:

  • 将模型流转换为稳定的 UI Message 流响应。
  • 聚合流式 chunk 为可持久化的 UIMessage,方便保存和继续会话。
  • 将持久化的 UIMessage 校验并转换回模型消息,支持后续多轮调用。
  • 表达工具调用、工具结果、工具错误、工具审批请求和审批响应,并支持 UI Message 模式下继续生成。
  • 支持消息 metadata 生命周期、取消、再生成。

Which issue(s) this PR fixes:

Fixes #57

Does this PR introduce a user-facing change?

新增 UI Message Java 后端契约,简化插件将 AI 流式能力接入前端聊天界面的实现。

@LIlGG LIlGG force-pushed the feat/ui-message-stream branch from e75599f to 01e06d3 Compare June 5, 2026 10:44
@LIlGG LIlGG linked an issue Jun 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK UI 工具 - 后端支持

1 participant