AS AgentScopeAPI 手册 / API Reference

KimiMultiAgentFormatter

public class KimiMultiAgentFormatter extends OpenAIMultiAgentFormatter
源码Source io/agentscope/extensions/model/openai/compat/kimi/KimiMultiAgentFormatter.java:51–77

Kimi Multi 智能体格式化器,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.openai.compat.kimi 包,继承自 OpenAIMultiAgentFormatter。核心成员包括 supportsStrict、applyOptions、applyToolChoice、KimiMultiAgentFormatter。

Multi-agent formatter for Kimi (Moonshot AI) models.

This formatter extends OpenAIMultiAgentFormatter with the same Kimi-specific handling as KimiFormatter:

  • Fixed sampling parameters (temperature / top_p / penalties) are stripped on kimi-* models

  • reasoning_effort is only kept for kimi-k3; thinking_budget is always stripped

  • max_tokens is mapped to max_completion_tokens

  • tool_choice is degraded when the target model does not support the requested mode (see KimiFormatter for details)

  • The strict parameter in tool definitions is not sent

Usage:

`OpenAIChatModel.builder()
.formatter(new KimiMultiAgentFormatter())
.modelName("kimi-k3")
.baseUrl("https://api.moonshot.cn/v1")
.apiKey(apiKey)
.build();
`

构造器摘要Constructor Summary

构造器Constructor说明Description
public KimiMultiAgentFormatter()
初始化 `KimiMultiAgentFormatter` 实例。
Creates a new instance.
public KimiMultiAgentFormatter(String conversationHistoryPrompt)
初始化 `KimiMultiAgentFormatter` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
protected boolean supportsStrict()
返回 `supportsStrict` 结果。
Returns the supports strict.
public void applyOptions(OpenAIRequest request, GenerateOptions options, GenerateOptions defaultOptions)
应用选项。
Performs the apply options operation.
public void applyToolChoice(OpenAIRequest request, ToolChoice toolChoice)
应用工具选项。
Performs the apply tool choice operation.

构造器详情Constructor Detail

KimiMultiAgentFormatter

public KimiMultiAgentFormatter()

初始化 KimiMultiAgentFormatter 实例。

Creates a new instance.

源码Source io/agentscope/extensions/model/openai/compat/kimi/KimiMultiAgentFormatter.java:53–55

KimiMultiAgentFormatter

public KimiMultiAgentFormatter(String conversationHistoryPrompt)

初始化 KimiMultiAgentFormatter 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
conversationHistoryPromptString会话历史提示词(类型 `String`)。The conversation history prompt.
源码Source io/agentscope/extensions/model/openai/compat/kimi/KimiMultiAgentFormatter.java:57–59

方法详情Method Detail

supportsStrict

protected boolean supportsStrict()

返回 supportsStrict 结果。

Returns the supports strict.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/openai/compat/kimi/KimiMultiAgentFormatter.java:61–64

applyOptions

public void applyOptions(OpenAIRequest request, GenerateOptions options, GenerateOptions defaultOptions)

应用选项。

Performs the apply options operation.

参数Parameters
名称Name类型Type说明Description
requestOpenAIRequest请求(类型 `OpenAIRequest`)。The request.
optionsGenerateOptions选项(类型 `GenerateOptions`)。The options.
defaultOptionsGenerateOptions默认选项(类型 `GenerateOptions`)。The default options.
源码Source io/agentscope/extensions/model/openai/compat/kimi/KimiMultiAgentFormatter.java:66–71

applyToolChoice

public void applyToolChoice(OpenAIRequest request, ToolChoice toolChoice)

应用工具选项。

Performs the apply tool choice operation.

参数Parameters
名称Name类型Type说明Description
requestOpenAIRequest请求(类型 `OpenAIRequest`)。The request.
toolChoiceToolChoice工具选项(类型 `ToolChoice`)。The tool choice.
源码Source io/agentscope/extensions/model/openai/compat/kimi/KimiMultiAgentFormatter.java:73–76

继承成员Inherited Members

继承自Methods inherited from OpenAIMultiAgentFormatter
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.