类 AnthropicMultiAgentFormatter
java.lang.Object
io.agentscope.core.formatter.AbstractBaseFormatter<com.anthropic.models.messages.MessageParam,Object,com.anthropic.models.messages.MessageCreateParams.Builder>
io.agentscope.core.formatter.anthropic.AnthropicBaseFormatter
io.agentscope.core.formatter.anthropic.AnthropicMultiAgentFormatter
- 所有已实现的接口:
Formatter<com.anthropic.models.messages.MessageParam,Object, com.anthropic.models.messages.MessageCreateParams.Builder>
Multi-agent formatter for Anthropic Messages API. Converts AgentScope Msg objects to Anthropic
SDK MessageParam objects with multi-agent support.
This formatter handles conversations between multiple agents by:
- Grouping multi-agent messages into conversation history
- Using special markup (history tags) to structure conversations
- Consolidating multi-agent conversations into single user messages
-
字段概要
从类继承的字段 io.agentscope.core.formatter.anthropic.AnthropicBaseFormatter
messageConverter -
构造器概要
构造器构造器说明Create an AnthropicMultiAgentFormatter with default conversation history prompt.AnthropicMultiAgentFormatter(String conversationHistoryPrompt) Create an AnthropicMultiAgentFormatter with custom conversation history prompt. -
方法概要
修饰符和类型方法说明List<com.anthropic.models.messages.MessageParam> parseResponse(Object response, Instant startTime) Parse provider-specific response to AgentScope ChatResponse.从类继承的方法 io.agentscope.core.formatter.anthropic.AnthropicBaseFormatter
applyOptions, applySystemMessage, applyTools从类继承的方法 io.agentscope.core.formatter.AbstractBaseFormatter
convertToolResultToString, extractTextContent, extractTextContent, format, formatRoleLabel, getOptionOrDefault, hasMediaContent, saveBase64DataToTempFile, shouldBypassHistory从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 io.agentscope.core.formatter.Formatter
applyToolChoice, applyToolChoice, applyTools
-
构造器详细资料
-
AnthropicMultiAgentFormatter
public AnthropicMultiAgentFormatter()Create an AnthropicMultiAgentFormatter with default conversation history prompt. -
AnthropicMultiAgentFormatter
Create an AnthropicMultiAgentFormatter with custom conversation history prompt.- 参数:
conversationHistoryPrompt- The prompt to prepend before conversation history
-
-
方法详细资料
-
doFormat
- 指定者:
doFormat在类中AbstractBaseFormatter<com.anthropic.models.messages.MessageParam,Object, com.anthropic.models.messages.MessageCreateParams.Builder>
-
parseResponse
从接口复制的说明:FormatterParse provider-specific response to AgentScope ChatResponse.- 参数:
response- Provider-specific response objectstartTime- Request start time for calculating duration- 返回:
- AgentScope ChatResponse
-