ResponsesMultiAgentFormatter
public class ResponsesMultiAgentFormatter
io/agentscope/extensions/model/openaiofficial/ResponsesMultiAgentFormatter.java:56–355Responses Multi 智能体格式化器,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.openaiofficial 包。核心成员包括 formatHistory、ResponsesMultiAgentFormatter。
Multi-agent formatter for the OpenAI Responses API.
Converts AgentScope Msg objects to Responses API ResponseInputItem objects with multi-agent support.
The formatter groups messages into:
-
SYSTEM - extracted individually as
EasyInputMessagewith SYSTEM role -
TOOL_SEQUENCE - tool calls and results, passed through to
ResponsesRequestMapperunchanged (including reasoning replay) -
AGENT_CONVERSATION - merged into a single
EasyInputMessagewith USER role, wrapped in<history>tags -
BYPASS - messages with
BYPASS_MULTIAGENT_HISTORY_MERGEmetadata, passed through individually as user messages
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public ResponsesMultiAgentFormatter() | 创建格式化器使用默认会话历史提示词。 Create a formatter with the default conversation history prompt. |
public ResponsesMultiAgentFormatter(String conversationHistoryPrompt) | 创建格式化器使用自定义会话历史提示词。 Create a formatter with a custom conversation history prompt. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public List<ResponseInputItem> formatHistory(List<Msg> messages) | 格式化历史。 Formats AgentScope messages into Responses API input items with multi-agent merging. |
构造器详情Constructor Detail
ResponsesMultiAgentFormatter
public ResponsesMultiAgentFormatter()
创建格式化器使用默认会话历史提示词。
Create a formatter with the default conversation history prompt.
io/agentscope/extensions/model/openaiofficial/ResponsesMultiAgentFormatter.java:71–73ResponsesMultiAgentFormatter
public ResponsesMultiAgentFormatter(String conversationHistoryPrompt)
创建格式化器使用自定义会话历史提示词。
Create a formatter with a custom conversation history prompt.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
conversationHistoryPrompt | String | 会话历史提示词(类型 `String`)。the prompt to prepend before the first history block |
io/agentscope/extensions/model/openaiofficial/ResponsesMultiAgentFormatter.java:80–82方法详情Method Detail
formatHistory
public List<ResponseInputItem> formatHistory(List<Msg> messages)
格式化历史。
Formats AgentScope messages into Responses API input items with multi-agent merging.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
messages | List<Msg> | 会话历史。the conversation history |
List<ResponseInputItem>io/agentscope/extensions/model/openaiofficial/ResponsesMultiAgentFormatter.java:94–119