Builder
public static class Builder
io/agentscope/extensions/model/openai/dto/OpenAIRequest.java:448–611构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.model.openai.dto 包。核心成员包括 model、messages、stream、streamOptions、temperature、topP。
A class in io.agentscope.extensions.model.openai.dto that talks to model services and returns generated or embedded output. Declared in io.agentscope.extensions.model.openai.dto.
方法摘要Method Summary
方法详情Method Detail
model
public Builder model(String model)
设置模型。
Performs the model operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
model | String | 模型实例(类型 `String`)。The model. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:451–454messages
public Builder messages(List<OpenAIMessage> messages)
设置消息。
Performs the messages operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
messages | List<OpenAIMessage> | 消息列表(类型 `List`)。The messages. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:456–459stream
public Builder stream(Boolean stream)
设置流。
Performs the stream operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
stream | Boolean | 流(类型 `Boolean`)。The stream. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:461–464streamOptions
public Builder streamOptions(OpenAIStreamOptions streamOptions)
设置流选项。
Streams the options.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
streamOptions | OpenAIStreamOptions | 流选项(类型 `OpenAIStreamOptions`)。The stream options. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:466–469temperature
public Builder temperature(Double temperature)
设置该配置项。
Performs the temperature operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
temperature | Double | temperature(类型 `Double`)。The temperature. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:471–474topP
public Builder topP(Double topP)
设置该配置项。
Performs the top p operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
topP | Double | top P(类型 `Double`)。The top p. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:476–479maxTokens
public Builder maxTokens(Integer maxTokens)
设置最大令牌数。
Performs the max tokens operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
maxTokens | Integer | 最大令牌数(类型 `Integer`)。The max tokens. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:481–484maxCompletionTokens
public Builder maxCompletionTokens(Integer maxCompletionTokens)
设置最大补全令牌数。
Performs the max completion tokens operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
maxCompletionTokens | Integer | 最大补全令牌数(类型 `Integer`)。The max completion tokens. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:486–489frequencyPenalty
public Builder frequencyPenalty(Double frequencyPenalty)
设置该配置项。
Performs the frequency penalty operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
frequencyPenalty | Double | frequency Penalty(类型 `Double`)。The frequency penalty. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:491–494presencePenalty
public Builder presencePenalty(Double presencePenalty)
设置该配置项。
Performs the presence penalty operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
presencePenalty | Double | 在线状态 Penalty(类型 `Double`)。The presence penalty. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:496–499stop
public Builder stop(Object stop)
设置停止。
Performs the stop operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
stop | Object | 停止(类型 `Object`)。The stop. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:501–504seed
public Builder seed(Integer seed)
设置预置。
Performs the seed operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
seed | Integer | 预置(类型 `Integer`)。The seed. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:506–509n
public Builder n(Integer n)
设置n。
Performs the n operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
n | Integer | n(类型 `Integer`)。The n. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:511–514tools
public Builder tools(List<OpenAITool> tools)
设置工具。
Performs the tools operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
tools | List<OpenAITool> | 工具列表(类型 `List`)。The tools. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:516–519toolChoice
public Builder toolChoice(Object toolChoice)
设置工具选项。
Performs the tool choice operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolChoice | Object | 工具选项(类型 `Object`)。The tool choice. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:521–524user
public Builder user(String user)
设置用户。
Performs the user operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
user | String | 用户(类型 `String`)。The user. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:526–529responseFormat
public Builder responseFormat(Map<String, Object> responseFormat)
设置响应格式。
Performs the response format operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
responseFormat | Map<String, Object> | 响应格式(类型 `Map`)。The response format. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:531–534includeReasoning
public Builder includeReasoning(Boolean includeReasoning)
设置该配置项。
Performs the include reasoning operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
includeReasoning | Boolean | include 推理(类型 `Boolean`)。The include reasoning. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:536–539extraParam
public Builder extraParam(String key, Object value)
设置该配置项。
Performs the extra param operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 键(类型 `String`)。The key. |
value | Object | 值(类型 `Object`)。The value. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:541–544extraParams
public Builder extraParams(Map<String, Object> extraParams)
设置该配置项。
Performs the extra params operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
extraParams | Map<String, Object> | extra 参数(类型 `Map`)。The extra params. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:546–549build
public OpenAIRequest build()
构建并返回最终实例。
Creates and returns an instance.
OpenAIRequestio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:551–555logprobs
public Builder logprobs(Boolean logprobs)
设置该配置项。
Performs the logprobs operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
logprobs | Boolean | logprobs(类型 `Boolean`)。The logprobs. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:557–560topLogprobs
public Builder topLogprobs(Integer topLogprobs)
设置该配置项。
Performs the top logprobs operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
topLogprobs | Integer | top Logprobs(类型 `Integer`)。The top logprobs. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:562–565reasoningEffort
public Builder reasoningEffort(String reasoningEffort)
设置该配置项。
Performs the reasoning effort operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
reasoningEffort | String | 推理 Effort(类型 `String`)。The reasoning effort. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:567–570thinkingBudget
public Builder thinkingBudget(Integer thinkingBudget)
设置该配置项。
Performs the thinking budget operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
thinkingBudget | Integer | thinking 预算(类型 `Integer`)。The thinking budget. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:572–575parallelToolCalls
public Builder parallelToolCalls(Boolean parallelToolCalls)
设置该配置项。
Performs the parallel tool calls operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
parallelToolCalls | Boolean | parallel 工具调用(类型 `Boolean`)。The parallel tool calls. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:577–580serviceTier
public Builder serviceTier(String serviceTier)
设置该配置项。
Performs the service tier operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
serviceTier | String | 服务 Tier(类型 `String`)。The service tier. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:582–585store
public Builder store(Boolean store)
设置存储。
Performs the store operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
store | Boolean | 存储实例(类型 `Boolean`)。The store. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:587–590metadata
public Builder metadata(Map<String, Object> metadata)
设置元数据。
Performs the metadata operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
metadata | Map<String, Object> | 元数据(类型 `Map`)。The metadata. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:592–595prediction
public Builder prediction(Map<String, Object> prediction)
设置该配置项。
Performs the prediction operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
prediction | Map<String, Object> | prediction(类型 `Map`)。The prediction. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:597–600modalities
public Builder modalities(List<String> modalities)
设置该配置项。
Performs the modalities operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
modalities | List<String> | modalities(类型 `List`)。The modalities. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:602–605audio
public Builder audio(Map<String, Object> audio)
设置音频。
Performs the audio operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
audio | Map<String, Object> | 音频(类型 `Map`)。The audio. |
Builderio/agentscope/extensions/model/openai/dto/OpenAIRequest.java:607–610