DeepSeekMultiAgentFormatter
@Deprecated public class DeepSeekMultiAgentFormatter extends OpenAIMultiAgentFormatter
io/agentscope/extensions/model/openai/formatter/DeepSeekMultiAgentFormatter.java:44–98DeepSeek Multi 智能体格式化器,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.openai.formatter 包,继承自 OpenAIMultiAgentFormatter。核心成员包括 doFormat、supportsStrict、DeepSeekMultiAgentFormatter。
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)
-
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();
`
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public DeepSeekMultiAgentFormatter() | 初始化 `DeepSeekMultiAgentFormatter` 实例。 Creates a new instance. |
public DeepSeekMultiAgentFormatter(String conversationHistoryPrompt) | 初始化 `DeepSeekMultiAgentFormatter` 实例。 Creates a new instance. |
public DeepSeekMultiAgentFormatter(boolean appendEmptyUserIfEndsWithAssistant) | 初始化 `DeepSeekMultiAgentFormatter` 实例。 Create a DeepSeek multi-agent formatter with optional empty user message appending. |
public DeepSeekMultiAgentFormatter(String conversationHistoryPrompt, boolean appendEmptyUserIfEndsWithAssistant) | 初始化 `DeepSeekMultiAgentFormatter` 实例。 Create a DeepSeek multi-agent formatter with custom conversation history prompt and optional
empty user message appending. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
protected List<OpenAIMessage> doFormat(List<Msg> msgs) | 执行格式操作。 Performs the do format operation. |
protected boolean supportsStrict() | 返回 `supportsStrict` 结果。 Returns the supports strict. |
构造器详情Constructor Detail
DeepSeekMultiAgentFormatter
public DeepSeekMultiAgentFormatter()
初始化 DeepSeekMultiAgentFormatter 实例。
Creates a new instance.
io/agentscope/extensions/model/openai/formatter/DeepSeekMultiAgentFormatter.java:49–52DeepSeekMultiAgentFormatter
public DeepSeekMultiAgentFormatter(String conversationHistoryPrompt)
初始化 DeepSeekMultiAgentFormatter 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
conversationHistoryPrompt | String | 会话历史提示词(类型 `String`)。The conversation history prompt. |
io/agentscope/extensions/model/openai/formatter/DeepSeekMultiAgentFormatter.java:54–57DeepSeekMultiAgentFormatter
public DeepSeekMultiAgentFormatter(boolean appendEmptyUserIfEndsWithAssistant)
初始化 DeepSeekMultiAgentFormatter 实例。
Create a DeepSeek multi-agent formatter with optional empty user message appending.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
appendEmptyUserIfEndsWithAssistant | boolean | 追加 Empty 用户 If Ends 使用 Assistant(类型 `boolean`)。if true, append an empty user message when the conversation ends with an assistant message to avoid API errors |
io/agentscope/extensions/model/openai/formatter/DeepSeekMultiAgentFormatter.java:65–68DeepSeekMultiAgentFormatter
public DeepSeekMultiAgentFormatter(String conversationHistoryPrompt, boolean appendEmptyUserIfEndsWithAssistant)
初始化 DeepSeekMultiAgentFormatter 实例。
Create a DeepSeek multi-agent formatter with custom conversation history prompt and optional empty user message appending.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
conversationHistoryPrompt | String | 用于会话历史的自定义提示词。custom prompt for conversation history |
appendEmptyUserIfEndsWithAssistant | boolean | 追加 Empty 用户 If Ends 使用 Assistant(类型 `boolean`)。if true, append an empty user message when the conversation ends with an assistant message to avoid API errors |
io/agentscope/extensions/model/openai/formatter/DeepSeekMultiAgentFormatter.java:78–82方法详情Method Detail
doFormat
protected List<OpenAIMessage> doFormat(List<Msg> msgs)
执行格式操作。
Performs the do format operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs | List<Msg> | 消息列表(类型 `List`)。The msgs. |
List<OpenAIMessage>io/agentscope/extensions/model/openai/formatter/DeepSeekMultiAgentFormatter.java:84–92supportsStrict
protected boolean supportsStrict()
返回 supportsStrict 结果。
Returns the supports strict.
booleanio/agentscope/extensions/model/openai/formatter/DeepSeekMultiAgentFormatter.java:94–97