AS AgentScopeAPI 手册 / API Reference

ResponseApiRequest

@JsonIgnoreProperties(ignoreUnknown = true) public class ResponseApiRequest
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:28–312

响应 API 请求,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.runtime.protocol.responseapi.model 包。核心成员包括 getBackground、setBackground、getConversation、setConversation、getInclude、setInclude。

POJO for OpenAI Responses API request body.

方法摘要Method Summary

方法Method说明Description
public Boolean getBackground()
获取 `getBackground`。
Returns the background.
public void setBackground(Boolean background)
设置 `setBackground`。
Sets the background.
public Conversation getConversation()
获取会话。
Returns the conversation.
public void setConversation(Conversation conversation)
设置会话。
Sets the conversation.
public List<Object> getInclude()
获取 `getInclude`。
Returns the include.
public void setInclude(List<Object> include)
设置 `setInclude`。
Sets the include.
public Object getInput()
获取输入。
Returns the input.
public void setInput(Object input)
设置输入。
Sets the input.
public String getInstructions()
获取指令。
Returns the instructions.
public void setInstructions(String instructions)
设置指令。
Sets the instructions.
public Integer getMaxOutputTokens()
获取最大输出令牌数。
Returns the max output tokens.
public void setMaxOutputTokens(Integer maxOutputTokens)
设置最大输出令牌数。
Sets the max output tokens.
public Integer getMaxToolCalls()
获取最大工具调用。
Returns the max tool calls.
public void setMaxToolCalls(Integer maxToolCalls)
设置最大工具调用。
Sets the max tool calls.
public Map<String, Object> getMetadata()
获取元数据。
Returns the metadata.
public void setMetadata(Map<String, Object> metadata)
设置元数据。
Sets the metadata.
public String getModel()
获取模型。
Returns the model.
public void setModel(String model)
设置模型。
Sets the model.
public Boolean getParallelToolCalls()
获取 `getParallelToolCalls`。
Returns the parallel tool calls.
public void setParallelToolCalls(Boolean parallelToolCalls)
设置 `setParallelToolCalls`。
Sets the parallel tool calls.
public String getPreviousResponseId()
获取上一个响应标识。
Returns the previous response id.
public void setPreviousResponseId(String previousResponseId)
设置上一个响应标识。
Sets the previous response id.
public ResponsePrompt getPrompt()
获取提示词。
Returns the prompt.
public void setPrompt(ResponsePrompt prompt)
设置提示词。
Sets the prompt.
public String getPromptCacheKey()
获取提示词缓存键。
Returns the prompt cache key.
public void setPromptCacheKey(String promptCacheKey)
设置提示词缓存键。
Sets the prompt cache key.
public String getPromptCacheRetention()
获取 `getPromptCacheRetention`。
Returns the prompt cache retention.
public void setPromptCacheRetention(String promptCacheRetention)
设置 `setPromptCacheRetention`。
Sets the prompt cache retention.
public ResponseReasoning getReasoning()
获取推理。
Returns the reasoning.
public void setReasoning(ResponseReasoning reasoning)
设置推理。
Sets the reasoning.
public String getSafetyIdentifier()
获取 `getSafetyIdentifier`。
Returns the safety identifier.
public void setSafetyIdentifier(String safetyIdentifier)
设置 `setSafetyIdentifier`。
Sets the safety identifier.
public String getServiceTier()
获取 `getServiceTier`。
Returns the service tier.
public void setServiceTier(String serviceTier)
设置 `setServiceTier`。
Sets the service tier.
public Boolean getStore()
获取存储。
Returns the store.
public void setStore(Boolean store)
设置存储。
Sets the store.
public Boolean getStream()
获取流。
Returns the stream.
public void setStream(Boolean stream)
设置流。
Sets the stream.
public Object getStreamOptions()
获取流选项。
Returns the stream options.
public void setStreamOptions(Object streamOptions)
设置流选项。
Sets the stream options.
public float getTemperature()
获取 `getTemperature`。
Returns the temperature.
public void setTemperature(float temperature)
设置 `setTemperature`。
Sets the temperature.
public Object getText()
获取文本。
Returns the text.
public void setText(Object text)
设置文本。
Sets the text.
public Object getToolChoice()
获取工具选项。
Returns the tool choice.
public void setToolChoice(Object toolChoice)
设置工具选项。
Sets the tool choice.
public List<Object> getTools()
获取工具。
Returns the tools.
public void setTools(List<Object> tools)
设置工具。
Sets the tools.
public Integer getTopLogprobs()
获取 `getTopLogprobs`。
Returns the top logprobs.
public void setTopLogprobs(Integer topLogprobs)
设置 `setTopLogprobs`。
Sets the top logprobs.
public Integer getTopP()
获取 `getTopP`。
Returns the top p.
public void setTopP(Integer topP)
设置 `setTopP`。
Sets the top p.
public String getTruncation()
获取 `getTruncation`。
Returns the truncation.
public void setTruncation(String truncation)
设置 `setTruncation`。
Sets the truncation.

方法详情Method Detail

getBackground

public Boolean getBackground()

获取 getBackground。

Returns the background.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:93–95

setBackground

public void setBackground(Boolean background)

设置 setBackground。

Sets the background.

参数Parameters
名称Name类型Type说明Description
backgroundBooleanbackground(类型 `Boolean`)。The background.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:97–99

getConversation

public Conversation getConversation()

获取会话。

Returns the conversation.

返回Returns Conversation
返回会话。Returns conversation.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:105–107

setConversation

public void setConversation(Conversation conversation)

设置会话。

Sets the conversation.

参数Parameters
名称Name类型Type说明Description
conversationConversation会话(类型 `Conversation`)。The conversation.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:109–111

getInclude

public List<Object> getInclude()

获取 getInclude。

Returns the include.

返回Returns List<Object>
返回列出。Returns list.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:113–115

setInclude

public void setInclude(List<Object> include)

设置 setInclude。

Sets the include.

参数Parameters
名称Name类型Type说明Description
includeList<Object>include(类型 `List`)。The include.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:117–119

getInput

public Object getInput()

获取输入。

Returns the input.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:121–123

setInput

public void setInput(Object input)

设置输入。

Sets the input.

参数Parameters
名称Name类型Type说明Description
inputObject输入消息(类型 `Object`)。The input.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:125–127

getInstructions

public String getInstructions()

获取指令。

Returns the instructions.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:129–131

setInstructions

public void setInstructions(String instructions)

设置指令。

Sets the instructions.

参数Parameters
名称Name类型Type说明Description
instructionsString指令(类型 `String`)。The instructions.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:133–135

getMaxOutputTokens

public Integer getMaxOutputTokens()

获取最大输出令牌数。

Returns the max output tokens.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:137–139

setMaxOutputTokens

public void setMaxOutputTokens(Integer maxOutputTokens)

设置最大输出令牌数。

Sets the max output tokens.

参数Parameters
名称Name类型Type说明Description
maxOutputTokensInteger最大输出令牌数(类型 `Integer`)。The max output tokens.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:141–143

getMaxToolCalls

public Integer getMaxToolCalls()

获取最大工具调用。

Returns the max tool calls.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:145–147

setMaxToolCalls

public void setMaxToolCalls(Integer maxToolCalls)

设置最大工具调用。

Sets the max tool calls.

参数Parameters
名称Name类型Type说明Description
maxToolCallsInteger最大工具调用(类型 `Integer`)。The max tool calls.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:149–151

getMetadata

public Map<String, Object> getMetadata()

获取元数据。

Returns the metadata.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:153–155

setMetadata

public void setMetadata(Map<String, Object> metadata)

设置元数据。

Sets the metadata.

参数Parameters
名称Name类型Type说明Description
metadataMap<String, Object>元数据(类型 `Map`)。The metadata.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:157–159

getModel

public String getModel()

获取模型。

Returns the model.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:161–163

setModel

public void setModel(String model)

设置模型。

Sets the model.

参数Parameters
名称Name类型Type说明Description
modelString模型实例(类型 `String`)。The model.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:165–167

getParallelToolCalls

public Boolean getParallelToolCalls()

获取 getParallelToolCalls。

Returns the parallel tool calls.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:169–171

setParallelToolCalls

public void setParallelToolCalls(Boolean parallelToolCalls)

设置 setParallelToolCalls。

Sets the parallel tool calls.

参数Parameters
名称Name类型Type说明Description
parallelToolCallsBooleanparallel 工具调用(类型 `Boolean`)。The parallel tool calls.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:173–175

getPreviousResponseId

public String getPreviousResponseId()

获取上一个响应标识。

Returns the previous response id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:177–179

setPreviousResponseId

public void setPreviousResponseId(String previousResponseId)

设置上一个响应标识。

Sets the previous response id.

参数Parameters
名称Name类型Type说明Description
previousResponseIdString上一个响应标识(类型 `String`)。The previous response id.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:181–183

getPrompt

public ResponsePrompt getPrompt()

获取提示词。

Returns the prompt.

返回Returns ResponsePrompt
返回ResponsePrompt。Returns response prompt.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:185–187

setPrompt

public void setPrompt(ResponsePrompt prompt)

设置提示词。

Sets the prompt.

参数Parameters
名称Name类型Type说明Description
promptResponsePrompt提示词(类型 `ResponsePrompt`)。The prompt.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:189–191

getPromptCacheKey

public String getPromptCacheKey()

获取提示词缓存键。

Returns the prompt cache key.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:193–195

setPromptCacheKey

public void setPromptCacheKey(String promptCacheKey)

设置提示词缓存键。

Sets the prompt cache key.

参数Parameters
名称Name类型Type说明Description
promptCacheKeyString提示词缓存键(类型 `String`)。The prompt cache key.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:197–199

getPromptCacheRetention

public String getPromptCacheRetention()

获取 getPromptCacheRetention。

Returns the prompt cache retention.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:201–203

setPromptCacheRetention

public void setPromptCacheRetention(String promptCacheRetention)

设置 setPromptCacheRetention。

Sets the prompt cache retention.

参数Parameters
名称Name类型Type说明Description
promptCacheRetentionString提示词缓存 Retention(类型 `String`)。The prompt cache retention.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:205–207

getReasoning

public ResponseReasoning getReasoning()

获取推理。

Returns the reasoning.

返回Returns ResponseReasoning
返回ResponseReasoning。Returns response reasoning.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:209–211

setReasoning

public void setReasoning(ResponseReasoning reasoning)

设置推理。

Sets the reasoning.

参数Parameters
名称Name类型Type说明Description
reasoningResponseReasoning推理(类型 `ResponseReasoning`)。The reasoning.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:213–215

getSafetyIdentifier

public String getSafetyIdentifier()

获取 getSafetyIdentifier。

Returns the safety identifier.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:217–219

setSafetyIdentifier

public void setSafetyIdentifier(String safetyIdentifier)

设置 setSafetyIdentifier。

Sets the safety identifier.

参数Parameters
名称Name类型Type说明Description
safetyIdentifierStringsafety Identifier(类型 `String`)。The safety identifier.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:221–223

getServiceTier

public String getServiceTier()

获取 getServiceTier。

Returns the service tier.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:225–227

setServiceTier

public void setServiceTier(String serviceTier)

设置 setServiceTier。

Sets the service tier.

参数Parameters
名称Name类型Type说明Description
serviceTierString服务 Tier(类型 `String`)。The service tier.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:229–231

getStore

public Boolean getStore()

获取存储。

Returns the store.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:233–235

setStore

public void setStore(Boolean store)

设置存储。

Sets the store.

参数Parameters
名称Name类型Type说明Description
storeBoolean存储实例(类型 `Boolean`)。The store.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:237–239

getStream

public Boolean getStream()

获取流。

Returns the stream.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:241–243

setStream

public void setStream(Boolean stream)

设置流。

Sets the stream.

参数Parameters
名称Name类型Type说明Description
streamBoolean流(类型 `Boolean`)。The stream.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:245–247

getStreamOptions

public Object getStreamOptions()

获取流选项。

Returns the stream options.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:249–251

setStreamOptions

public void setStreamOptions(Object streamOptions)

设置流选项。

Sets the stream options.

参数Parameters
名称Name类型Type说明Description
streamOptionsObject流选项(类型 `Object`)。The stream options.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:253–255

getTemperature

public float getTemperature()

获取 getTemperature。

Returns the temperature.

返回Returns float
返回数值结果。Returns a numeric result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:257–259

setTemperature

public void setTemperature(float temperature)

设置 setTemperature。

Sets the temperature.

参数Parameters
名称Name类型Type说明Description
temperaturefloattemperature(类型 `float`)。The temperature.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:261–263

getText

public Object getText()

获取文本。

Returns the text.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:265–267

setText

public void setText(Object text)

设置文本。

Sets the text.

参数Parameters
名称Name类型Type说明Description
textObject文本(类型 `Object`)。The text.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:269–271

getToolChoice

public Object getToolChoice()

获取工具选项。

Returns the tool choice.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:273–275

setToolChoice

public void setToolChoice(Object toolChoice)

设置工具选项。

Sets the tool choice.

参数Parameters
名称Name类型Type说明Description
toolChoiceObject工具选项(类型 `Object`)。The tool choice.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:277–279

getTools

public List<Object> getTools()

获取工具。

Returns the tools.

返回Returns List<Object>
返回列出。Returns list.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:281–283

setTools

public void setTools(List<Object> tools)

设置工具。

Sets the tools.

参数Parameters
名称Name类型Type说明Description
toolsList<Object>工具列表(类型 `List`)。The tools.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:285–287

getTopLogprobs

public Integer getTopLogprobs()

获取 getTopLogprobs。

Returns the top logprobs.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:289–291

setTopLogprobs

public void setTopLogprobs(Integer topLogprobs)

设置 setTopLogprobs。

Sets the top logprobs.

参数Parameters
名称Name类型Type说明Description
topLogprobsIntegertop Logprobs(类型 `Integer`)。The top logprobs.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:293–295

getTopP

public Integer getTopP()

获取 getTopP。

Returns the top p.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:297–299

setTopP

public void setTopP(Integer topP)

设置 setTopP。

Sets the top p.

参数Parameters
名称Name类型Type说明Description
topPIntegertop P(类型 `Integer`)。The top p.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:301–303

getTruncation

public String getTruncation()

获取 getTruncation。

Returns the truncation.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:305–307

setTruncation

public void setTruncation(String truncation)

设置 setTruncation。

Sets the truncation.

参数Parameters
名称Name类型Type说明Description
truncationStringtruncation(类型 `String`)。The truncation.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiRequest.java:309–311
基于官方固定版本源码静态生成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.