类class
agentscope.formatterOpenAIResponseMultiAgentFormatter
class OpenAIResponseMultiAgentFormatter(_OpenAIResponseFormatterBase)
源码Source
agentscope/formatter/_openai_response_formatter.py:406–555OpenAIResponse Multi 智能体格式化器,在智能体、模型与前端之间传递结构化消息和事件。位于 agentscope.formatter 包,继承自 _OpenAIResponseFormatterBase。核心成员包括 format。
Handles conversations where more than a user and a single agent are
involved. Tool call/result sequences are formatted with the Responses API
function_call / function_call_output items (delegated to
:class:OpenAIResponseFormatter). Agent conversation history messages
are wrapped inside <history></history> tags and presented as a single
user input item.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
conversation_history_prompt | str | 会话历史提示词字段。 | Field(default='# Conversation History\nThe content between <history></history> tags contains your conversation history\n', description='The prompt to use for the conversation history section.') |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
async def format(msgs: list[Msg]) -> list[dict[str, Any]]async | 设置格式。 Format messages for multi-agent Responses API conversations. |
属性详情Attribute Detail
conversation_history_prompt
str = Field(default='# Conversation History\nThe content between <history></history> tags contains your conversation history\n', description='The prompt to use for the conversation history section.')会话历史提示词字段。声明为 str。
The prompt to use for the conversation history section.
源码Source
agentscope/formatter/_openai_response_formatter.py:417方法详情Method Detail
format
async def format(msgs: list[Msg]) -> list[dict[str, Any]]
async
设置格式。
Format messages for multi-agent Responses API conversations.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs | list[Msg] | 消息列表(类型 `list[Msg]`)。The list of Msg objects to format. |
list[dict[str, Any]]
返回dict[str,任意]列表。`list[dict[str, Any]]`:
源码Source
agentscope/formatter/_openai_response_formatter.py:426–465