类 DeepSeekMultiAgentFormatter
java.lang.Object
io.agentscope.core.formatter.AbstractBaseFormatter<OpenAIMessage,OpenAIResponse,OpenAIRequest>
io.agentscope.core.formatter.openai.OpenAIBaseFormatter
io.agentscope.core.formatter.openai.OpenAIChatFormatter
io.agentscope.core.formatter.openai.OpenAIMultiAgentFormatter
io.agentscope.core.formatter.openai.DeepSeekMultiAgentFormatter
- 所有已实现的接口:
Formatter<OpenAIMessage,OpenAIResponse, OpenAIRequest>
Multi-agent formatter for DeepSeek Chat models.
This formatter extends OpenAIMultiAgentFormatter with DeepSeek-specific handling:
- No name field in messages (returns HTTP 400 if present)
- System messages converted to user messages
- Does NOT support strict parameter in tool definitions
- reasoning_content handling for thinking mode
Usage:
OpenAIChatModel.builder()
.formatter(new DeepSeekMultiAgentFormatter())
.modelName("deepseek-chat")
.baseUrl("https://api.deepseek.com/v1")
.apiKey(apiKey)
.build();
-
字段概要
从类继承的字段 io.agentscope.core.formatter.openai.OpenAIBaseFormatter
messageConverter, responseParser -
构造器概要
构造器构造器说明DeepSeekMultiAgentFormatter(boolean appendEmptyUserIfEndsWithAssistant) Create a DeepSeek multi-agent formatter with optional empty user message appending.DeepSeekMultiAgentFormatter(String conversationHistoryPrompt) DeepSeekMultiAgentFormatter(String conversationHistoryPrompt, boolean appendEmptyUserIfEndsWithAssistant) Create a DeepSeek multi-agent formatter with custom conversation history prompt and optional empty user message appending. -
方法概要
修饰符和类型方法说明protected List<OpenAIMessage> protected booleanReturns whether this formatter's target API supports the strict parameter in tool definitions.从类继承的方法 io.agentscope.core.formatter.openai.OpenAIChatFormatter
applyAdditionalBodyParams, applyMaxTokens, applyOptions, applyToolChoice, applyTools从类继承的方法 io.agentscope.core.formatter.openai.OpenAIBaseFormatter
applyCacheControl, applyToolChoice, applyTools, buildRequest, buildRequest, parseResponse从类继承的方法 io.agentscope.core.formatter.AbstractBaseFormatter
convertToolResultToString, extractTextContent, extractTextContent, format, formatRoleLabel, getOptionOrDefault, hasMediaContent, saveBase64DataToTempFile, shouldBypassHistory
-
构造器详细资料
-
DeepSeekMultiAgentFormatter
public DeepSeekMultiAgentFormatter() -
DeepSeekMultiAgentFormatter
-
DeepSeekMultiAgentFormatter
public DeepSeekMultiAgentFormatter(boolean appendEmptyUserIfEndsWithAssistant) Create a DeepSeek multi-agent formatter with optional empty user message appending.- 参数:
appendEmptyUserIfEndsWithAssistant- if true, append an empty user message when the conversation ends with an assistant message to avoid API errors
-
DeepSeekMultiAgentFormatter
public DeepSeekMultiAgentFormatter(String conversationHistoryPrompt, boolean appendEmptyUserIfEndsWithAssistant) Create a DeepSeek multi-agent formatter with custom conversation history prompt and optional empty user message appending.- 参数:
conversationHistoryPrompt- custom prompt for conversation historyappendEmptyUserIfEndsWithAssistant- if true, append an empty user message when the conversation ends with an assistant message to avoid API errors
-
-
方法详细资料
-
doFormat
- 覆盖:
doFormat在类中OpenAIMultiAgentFormatter
-
supportsStrict
protected boolean supportsStrict()从类复制的说明:OpenAIChatFormatterReturns whether this formatter's target API supports the strict parameter in tool definitions.Subclasses can override this method to disable strict parameter for providers that don't support it (e.g., DeepSeek).
- 覆盖:
supportsStrict在类中OpenAIChatFormatter- 返回:
- true if strict parameter is supported, false otherwise
-