AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:280–386

构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.model.dashscope.dto 包。核心成员包括 resultFormat、incrementalOutput、temperature、topP、topK、maxTokens。

A class in io.agentscope.extensions.model.dashscope.dto that talks to model services and returns generated or embedded output. Declared in io.agentscope.extensions.model.dashscope.dto.

方法摘要Method Summary

方法Method说明Description
public Builder resultFormat(String resultFormat)
设置结果格式。
Performs the result format operation.
public Builder incrementalOutput(Boolean incrementalOutput)
设置该配置项。
Performs the incremental output operation.
public Builder temperature(Double temperature)
设置该配置项。
Performs the temperature operation.
public Builder topP(Double topP)
设置该配置项。
Performs the top p operation.
public Builder topK(Integer topK)
设置该配置项。
Performs the top k operation.
public Builder maxTokens(Integer maxTokens)
设置最大令牌数。
Performs the max tokens operation.
public Builder stop(List<String> stop)
设置停止。
Performs the stop operation.
public Builder enableThinking(Boolean enableThinking)
启用该配置。
Enables the thinking.
public Builder thinkingBudget(Integer thinkingBudget)
设置该配置项。
Performs the thinking budget operation.
public Builder enableSearch(Boolean enableSearch)
启用搜索。
Enables the search.
public Builder searchOptions(DashScopeSearchOptions searchOptions)
设置搜索选项。
Searches the options.
public Builder enableCodeInterpreter(Boolean enableCodeInterpreter)
启用该配置。
Enables the code interpreter.
public Builder tools(List<DashScopeTool> tools)
设置工具。
Performs the tools operation.
public Builder toolChoice(Object toolChoice)
设置工具选项。
Performs the tool choice operation.
public Builder parallelToolCalls(Boolean parallelToolCalls)
设置该配置项。
Performs the parallel tool calls operation.
public Builder seed(Integer seed)
设置预置。
Performs the seed operation.
public Builder frequencyPenalty(Double frequencyPenalty)
设置该配置项。
Performs the frequency penalty operation.
public Builder presencePenalty(Double presencePenalty)
设置该配置项。
Performs the presence penalty operation.
public Builder repetitionPenalty(Double repetitionPenalty)
设置该配置项。
Performs the repetition penalty operation.
public Builder responseFormat(ResponseFormat responseFormat)
设置响应格式。
Performs the response format operation.
public DashScopeParameters build()
构建并返回最终实例。
Creates and returns an instance.

方法详情Method Detail

resultFormat

public Builder resultFormat(String resultFormat)

设置结果格式。

Performs the result format operation.

参数Parameters
名称Name类型Type说明Description
resultFormatString结果格式(类型 `String`)。The result format.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:283–286

incrementalOutput

public Builder incrementalOutput(Boolean incrementalOutput)

设置该配置项。

Performs the incremental output operation.

参数Parameters
名称Name类型Type说明Description
incrementalOutputBooleanincremental 输出(类型 `Boolean`)。The incremental output.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:288–291

temperature

public Builder temperature(Double temperature)

设置该配置项。

Performs the temperature operation.

参数Parameters
名称Name类型Type说明Description
temperatureDoubletemperature(类型 `Double`)。The temperature.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:293–296

topP

public Builder topP(Double topP)

设置该配置项。

Performs the top p operation.

参数Parameters
名称Name类型Type说明Description
topPDoubletop P(类型 `Double`)。The top p.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:298–301

topK

public Builder topK(Integer topK)

设置该配置项。

Performs the top k operation.

参数Parameters
名称Name类型Type说明Description
topKIntegertop K(类型 `Integer`)。The top k.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:303–306

maxTokens

public Builder maxTokens(Integer maxTokens)

设置最大令牌数。

Performs the max tokens operation.

参数Parameters
名称Name类型Type说明Description
maxTokensInteger最大令牌数(类型 `Integer`)。The max tokens.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:308–311

stop

public Builder stop(List<String> stop)

设置停止。

Performs the stop operation.

参数Parameters
名称Name类型Type说明Description
stopList<String>停止(类型 `List`)。The stop.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:313–316

enableThinking

public Builder enableThinking(Boolean enableThinking)

启用该配置。

Enables the thinking.

参数Parameters
名称Name类型Type说明Description
enableThinkingBoolean启用 Thinking(类型 `Boolean`)。The enable thinking.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:318–321

thinkingBudget

public Builder thinkingBudget(Integer thinkingBudget)

设置该配置项。

Performs the thinking budget operation.

参数Parameters
名称Name类型Type说明Description
thinkingBudgetIntegerthinking 预算(类型 `Integer`)。The thinking budget.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:323–326

enableSearch

public Builder enableSearch(Boolean enableSearch)

启用搜索。

Enables the search.

参数Parameters
名称Name类型Type说明Description
enableSearchBoolean启用搜索(类型 `Boolean`)。The enable search.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:328–331

searchOptions

public Builder searchOptions(DashScopeSearchOptions searchOptions)

设置搜索选项。

Searches the options.

参数Parameters
名称Name类型Type说明Description
searchOptionsDashScopeSearchOptions搜索选项(类型 `DashScopeSearchOptions`)。The search options.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:333–336

enableCodeInterpreter

public Builder enableCodeInterpreter(Boolean enableCodeInterpreter)

启用该配置。

Enables the code interpreter.

参数Parameters
名称Name类型Type说明Description
enableCodeInterpreterBoolean启用 Code Interpreter(类型 `Boolean`)。The enable code interpreter.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:338–341

tools

public Builder tools(List<DashScopeTool> tools)

设置工具。

Performs the tools operation.

参数Parameters
名称Name类型Type说明Description
toolsList<DashScopeTool>工具列表(类型 `List`)。The tools.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:343–346

toolChoice

public Builder toolChoice(Object toolChoice)

设置工具选项。

Performs the tool choice operation.

参数Parameters
名称Name类型Type说明Description
toolChoiceObject工具选项(类型 `Object`)。The tool choice.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:348–351

parallelToolCalls

public Builder parallelToolCalls(Boolean parallelToolCalls)

设置该配置项。

Performs the parallel tool calls operation.

参数Parameters
名称Name类型Type说明Description
parallelToolCallsBooleanparallel 工具调用(类型 `Boolean`)。The parallel tool calls.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:353–356

seed

public Builder seed(Integer seed)

设置预置。

Performs the seed operation.

参数Parameters
名称Name类型Type说明Description
seedInteger预置(类型 `Integer`)。The seed.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:358–361

frequencyPenalty

public Builder frequencyPenalty(Double frequencyPenalty)

设置该配置项。

Performs the frequency penalty operation.

参数Parameters
名称Name类型Type说明Description
frequencyPenaltyDoublefrequency Penalty(类型 `Double`)。The frequency penalty.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:363–366

presencePenalty

public Builder presencePenalty(Double presencePenalty)

设置该配置项。

Performs the presence penalty operation.

参数Parameters
名称Name类型Type说明Description
presencePenaltyDouble在线状态 Penalty(类型 `Double`)。The presence penalty.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:368–371

repetitionPenalty

public Builder repetitionPenalty(Double repetitionPenalty)

设置该配置项。

Performs the repetition penalty operation.

参数Parameters
名称Name类型Type说明Description
repetitionPenaltyDoublerepetition Penalty(类型 `Double`)。The repetition penalty.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:373–376

responseFormat

public Builder responseFormat(ResponseFormat responseFormat)

设置响应格式。

Performs the response format operation.

参数Parameters
名称Name类型Type说明Description
responseFormatResponseFormat响应格式(类型 `ResponseFormat`)。The response format.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:378–381

build

public DashScopeParameters build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns DashScopeParameters
返回DashScopeParameters。Returns DashScope parameters.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeParameters.java:383–385
基于官方固定版本源码静态生成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.