类 GLMMultiAgentFormatter
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.GLMMultiAgentFormatter
- 所有已实现的接口:
Formatter<OpenAIMessage,OpenAIResponse, OpenAIRequest>
Multi-agent formatter for Zhipu GLM models.
This formatter extends OpenAIMultiAgentFormatter with GLM-specific handling:
- At least one user message is required (error 1214 otherwise)
- Only supports "auto" tool_choice
- Does NOT support strict parameter in tool definitions
Usage:
OpenAIChatModel.builder()
.formatter(new GLMMultiAgentFormatter())
.modelName("glm-4")
.baseUrl("https://open.bigmodel.cn/api/paas/v4")
.apiKey(apiKey)
.build();
-
字段概要
从类继承的字段 io.agentscope.core.formatter.openai.OpenAIBaseFormatter
messageConverter, responseParser -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidapplyToolChoice(OpenAIRequest request, ToolChoice toolChoice) Apply tool choice configuration to the request.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, 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
-
构造器详细资料
-
GLMMultiAgentFormatter
public GLMMultiAgentFormatter() -
GLMMultiAgentFormatter
-
-
方法详细资料
-
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
-
applyToolChoice
从类复制的说明:OpenAIBaseFormatterApply tool choice configuration to the request. Subclasses implement provider-specific tool choice handling.- 指定者:
applyToolChoice在接口中Formatter<OpenAIMessage,OpenAIResponse, OpenAIRequest> - 覆盖:
applyToolChoice在类中OpenAIChatFormatter- 参数:
request- OpenAI request DTOtoolChoice- Tool choice configuration (null means auto)
-