Agent Context Index
@Serializable
表示 Agent 的上下文,不持有任何消息,而是使用 UUID 索引。
在 AgentContext 的模型中,每条用户消息都会开启一个独立的轮次,每个轮次中 Agent 可能进行多轮工具调用,这些中间的工具调用称为 Turn。
每个 Turn 记录一条 Agent 消息和若干工具请求以及响应,Agent 在下一个 Turn 思考并继续调用工具。
如果 Agent 没有调用工具,Turn 将不会被创建,Agent 的消息将作为 finalAssistantMessage,CurrentRound 会被归档,转换为一条 CompletedRound 并进入 historyRounds。
Constructors
Link copied to clipboard
constructor(compactedRounds: AgentContextIndex.CompactedRounds?, historyRounds: List<AgentContextIndex.CompletedRound>?, currentRound: AgentContextIndex.CurrentRound?)
Types
Link copied to clipboard
@Serializable
上下文压缩产生的归档,包含 summary 和 summary 覆盖的若干 CompletedRound。
Link copied to clipboard
@Serializable
已完成的轮次,由用户手动终止 Agent 产生,或 LLM 在响应中未调用工具,此时 finalAssistantMessage 非空。
Link copied to clipboard
@Serializable
表示当前正在进行的一个轮次,由一条用户消息开启,LLM 将在一个轮次中进行工具调用 - 推理 - 工具调用的循环。