Version: 0.5.9.dev.260315

 为原有流式聊天链路补充“聊天结束后异步调用 LLM 生成对话标题并落库”的机制,相关测试已通过
📄 新增“获取对话元信息”接口,便于前端统一获取对话的各类信息,包括上述异步生成的标题
This commit is contained in:
Losita
2026-03-15 19:54:49 +08:00
parent 7603a7561a
commit d91784d65f
7 changed files with 381 additions and 1 deletions

View File

@@ -9,6 +9,20 @@ type UserSendMessageRequest struct {
Thinking bool `json:"thinking,omitempty"`
}
// GetConversationMetaResponse 是会话元信息查询接口的返回结构。
// 说明:
// 1) title 可能为空字符串(表示标题尚未生成);
// 2) has_title 便于前端快速判断是否需要展示默认占位文案;
// 3) 保留 message_count/last_message_at方便前端后续扩展会话列表排序或角标。
type GetConversationMetaResponse struct {
ConversationID string `json:"conversation_id"`
Title string `json:"title"`
HasTitle bool `json:"has_title"`
MessageCount int `json:"message_count"`
LastMessageAt *time.Time `json:"last_message_at,omitempty"`
Status string `json:"status"`
}
type SSEResponse struct {
Event string `json:"event"`
ID int `json:"id,omitempty"`