接口的使用
io.agentscope.core.model.ToolChoice
使用ToolChoice的程序包
程序包
说明
-
io.agentscope.core.formatter中ToolChoice的使用
参数类型为ToolChoice的io.agentscope.core.formatter中的方法修饰符和类型方法说明default voidFormatter.applyToolChoice(TParams paramsBuilder, ToolChoice toolChoice) Apply tool choice configuration to provider-specific request parameters.default voidFormatter.applyToolChoice(TParams paramsBuilder, ToolChoice toolChoice, String baseUrl, String modelName) Apply tool choice configuration to provider-specific request parameters with provider detection. -
io.agentscope.core.formatter.dashscope中ToolChoice的使用
修饰符和类型方法说明voidDashScopeChatFormatter.applyToolChoice(DashScopeRequest request, ToolChoice toolChoice) Apply tool choice configuration to DashScopeRequest.voidDashScopeMultiAgentFormatter.applyToolChoice(DashScopeRequest request, ToolChoice toolChoice) voidDashScopeToolsHelper.applyToolChoice(DashScopeParameters params, ToolChoice toolChoice) Apply tool choice configuration to DashScopeParameters.DashScopeChatFormatter.buildRequest(String model, List<DashScopeMessage> messages, boolean stream, GenerateOptions options, GenerateOptions defaultOptions, List<ToolSchema> tools, ToolChoice toolChoice) Build a complete DashScopeRequest with full configuration.DashScopeToolsHelper.convertToolChoice(ToolChoice toolChoice) Convert tool choice to DashScope format. -
io.agentscope.core.formatter.gemini中ToolChoice的使用
修饰符和类型方法说明voidGeminiChatFormatter.applyToolChoice(com.google.genai.types.GenerateContentConfig.Builder configBuilder, ToolChoice toolChoice) voidGeminiMultiAgentFormatter.applyToolChoice(com.google.genai.types.GenerateContentConfig.Builder configBuilder, ToolChoice toolChoice) com.google.genai.types.ToolConfigGeminiToolsHelper.convertToolChoice(ToolChoice toolChoice) Create Gemini ToolConfig from AgentScope ToolChoice. -
io.agentscope.core.formatter.ollama中ToolChoice的使用
修饰符和类型方法说明voidOllamaChatFormatter.applyToolChoice(OllamaRequest request, ToolChoice toolChoice) voidOllamaMultiAgentFormatter.applyToolChoice(OllamaRequest request, ToolChoice toolChoice) voidOllamaToolsHelper.applyToolChoice(OllamaRequest request, ToolChoice toolChoice) Apply tool choice configuration to OllamaRequest.OllamaChatFormatter.buildRequest(String model, List<OllamaMessage> messages, boolean stream, OllamaOptions options, OllamaOptions defaultOptions, List<ToolSchema> tools, ToolChoice toolChoice) Build a complete OllamaRequest for the API call.OllamaMultiAgentFormatter.buildRequest(String model, List<OllamaMessage> messages, boolean stream, OllamaOptions options, OllamaOptions defaultOptions, List<ToolSchema> tools, ToolChoice toolChoice) Build a complete OllamaRequest for the API call. -
io.agentscope.core.formatter.openai中ToolChoice的使用
修饰符和类型方法说明voidGLMFormatter.applyToolChoice(OpenAIRequest request, ToolChoice toolChoice) voidGLMMultiAgentFormatter.applyToolChoice(OpenAIRequest request, ToolChoice toolChoice) abstract voidOpenAIBaseFormatter.applyToolChoice(OpenAIRequest request, ToolChoice toolChoice) Apply tool choice configuration to the request.voidOpenAIBaseFormatter.applyToolChoice(OpenAIRequest request, ToolChoice toolChoice, String baseUrl, String modelName) Apply tool choice with provider context.voidOpenAIChatFormatter.applyToolChoice(OpenAIRequest request, ToolChoice toolChoice) OpenAIBaseFormatter.buildRequest(String model, List<OpenAIMessage> messages, boolean stream, GenerateOptions options, GenerateOptions defaultOptions, List<ToolSchema> tools, ToolChoice toolChoice) Build a complete OpenAIRequest with full configuration. -
io.agentscope.core.model中ToolChoice的使用
修饰符和类型类说明static final recordAuto mode: Let the model decide whether and which tools to call.static final recordNone mode: Prevent the model from calling any tools.static final recordRequired mode: Force the model to call at least one tool.static final recordSpecific mode: Force the model to call a specific tool by name.修饰符和类型方法说明GenerateOptions.getToolChoice()Gets the tool choice configuration for controlling how the model uses tools.参数类型为ToolChoice的io.agentscope.core.model中的方法修饰符和类型方法说明GenerateOptions.Builder.toolChoice(ToolChoice toolChoice) Sets the tool choice configuration for controlling how the model uses tools.