Skip to main content

Documentation Index

Fetch the complete documentation index at: https://tech.illasoft.com/llms.txt

Use this file to discover all available pages before exploring further.

路径

GET /agent/chatMessages/:threadId

认证

Bearer JWT

响应

{
  messages: Array<{
    id: string,
    role: "user" | "assistant",
    parts: any[],       // v5 格式
    createdAt: string   // ISO 8601
  }>
}

v4 → v5 自动迁移

后端检测到 v4 格式(toolInvocation 嵌套 / 顶层 content 字段)即后台异步转换:
  • argsinput
  • resultoutput
  • state 映射:partial-callinput-streamingcallinput-availableresultoutput-available
  • 去除 v4 字段
旧 client 可能收到 v4/v5 混合格式,前端需兼容。

流程

1. 查 messages WHERE thread_id = ? ORDER BY created_at ASC
2. 检测 v4 → 异步迁移(不阻塞响应)
3. 返回 v5

src/hono/agent/index.ts:53

相关