AS AgentScopeAPI 手册 / API Reference

ResponsesMultiAgentFormatter

public class ResponsesMultiAgentFormatter
源码Source io/agentscope/extensions/model/openaiofficial/ResponsesMultiAgentFormatter.java:56–355

Responses 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 EasyInputMessage with SYSTEM role

  • TOOL_SEQUENCE - tool calls and results, passed through to ResponsesRequestMapper unchanged (including reasoning replay)

  • AGENT_CONVERSATION - merged into a single EasyInputMessage with USER role, wrapped in <history> tags

  • BYPASS - messages with BYPASS_MULTIAGENT_HISTORY_MERGE metadata, 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.

源码Source io/agentscope/extensions/model/openaiofficial/ResponsesMultiAgentFormatter.java:71–73

ResponsesMultiAgentFormatter

public ResponsesMultiAgentFormatter(String conversationHistoryPrompt)

创建格式化器使用自定义会话历史提示词。

Create a formatter with a custom conversation history prompt.

参数Parameters
名称Name类型Type说明Description
conversationHistoryPromptString会话历史提示词(类型 `String`)。the prompt to prepend before the first history block
源码Source 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.

参数Parameters
名称Name类型Type说明Description
messagesList<Msg>会话历史。the conversation history
返回Returns List<ResponseInputItem>
返回列出。Responses API input items
源码Source io/agentscope/extensions/model/openaiofficial/ResponsesMultiAgentFormatter.java:94–119
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.