AS AgentScopeAPI 手册 / API Reference

ResponseApiResponse

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

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

POJO for Responses API response object.

方法摘要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 Integer getCreatedAt()
获取已创建 At。
Returns the created at.
public void setCreatedAt(Integer createdAt)
设置已创建 At。
Sets the created at.
public Error getError()
获取错误。
Returns the error.
public void setError(Error error)
设置错误。
Sets the error.
public String getId()
获取标识。
Returns the id.
public void setId(String id)
设置标识。
Sets the id.
public IncompleteDetail getIncompleteDetail()
获取 `getIncompleteDetail`。
Returns the incomplete detail.
public void setIncompleteDetail(IncompleteDetail incompleteDetail)
设置 `setIncompleteDetail`。
Sets the incomplete detail.
public Object getInstructions()
获取指令。
Returns the instructions.
public void setInstructions(Object 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 String getObject()
获取对象。
Returns the object.
public void setObject(String object)
设置对象。
Sets the object.
public List<OutputMessage> getOutput()
获取输出。
Returns the output.
public void setOutput(List<OutputMessage> output)
设置输出。
Sets the output.
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 getStatus()
获取状态。
Returns the status.
public void setStatus(String status)
设置状态。
Sets the status.
public Integer getTemperature()
获取 `getTemperature`。
Returns the temperature.
public void setTemperature(Integer temperature)
设置 `setTemperature`。
Sets the temperature.
public ResponseText getText()
获取文本。
Returns the text.
public void setText(ResponseText 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.
public ResponseUsage getUsage()
获取用量。
Returns the usage.
public void setUsage(ResponseUsage usage)
设置用量。
Sets the usage.

方法详情Method Detail

getBackground

public Boolean getBackground()

获取 getBackground。

Returns the background.

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

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/ResponseApiResponse.java:105–107

getConversation

public Conversation getConversation()

获取会话。

Returns the conversation.

返回Returns Conversation
返回会话。Returns conversation.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:109–111

setConversation

public void setConversation(Conversation conversation)

设置会话。

Sets the conversation.

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

getCreatedAt

public Integer getCreatedAt()

获取已创建 At。

Returns the created at.

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

setCreatedAt

public void setCreatedAt(Integer createdAt)

设置已创建 At。

Sets the created at.

参数Parameters
名称Name类型Type说明Description
createdAtInteger已创建 At(类型 `Integer`)。The created at.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:121–123

getError

public Error getError()

获取错误。

Returns the error.

返回Returns Error
返回错误。Returns error.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:125–127

setError

public void setError(Error error)

设置错误。

Sets the error.

参数Parameters
名称Name类型Type说明Description
errorError错误(类型 `Error`)。The error.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:129–131

getId

public String getId()

获取标识。

Returns the id.

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

setId

public void setId(String id)

设置标识。

Sets the id.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:137–139

getIncompleteDetail

public IncompleteDetail getIncompleteDetail()

获取 getIncompleteDetail。

Returns the incomplete detail.

返回Returns IncompleteDetail
返回IncompleteDetail。Returns incomplete detail.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:141–143

setIncompleteDetail

public void setIncompleteDetail(IncompleteDetail incompleteDetail)

设置 setIncompleteDetail。

Sets the incomplete detail.

参数Parameters
名称Name类型Type说明Description
incompleteDetailIncompleteDetailincomplete 详情(类型 `IncompleteDetail`)。The incomplete detail.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:145–147

getInstructions

public Object getInstructions()

获取指令。

Returns the instructions.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:149–151

setInstructions

public void setInstructions(Object instructions)

设置指令。

Sets the instructions.

参数Parameters
名称Name类型Type说明Description
instructionsObject指令(类型 `Object`)。The instructions.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:153–155

getMaxOutputTokens

public Integer getMaxOutputTokens()

获取最大输出令牌数。

Returns the max output tokens.

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

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/ResponseApiResponse.java:161–163

getMaxToolCalls

public Integer getMaxToolCalls()

获取最大工具调用。

Returns the max tool calls.

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

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/ResponseApiResponse.java:169–171

getMetadata

public Map<String, Object> getMetadata()

获取元数据。

Returns the metadata.

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

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/ResponseApiResponse.java:177–179

getModel

public String getModel()

获取模型。

Returns the model.

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

setModel

public void setModel(String model)

设置模型。

Sets the model.

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

getObject

public String getObject()

获取对象。

Returns the object.

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

setObject

public void setObject(String object)

设置对象。

Sets the object.

参数Parameters
名称Name类型Type说明Description
objectString对象(类型 `String`)。The object.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:193–195

getOutput

public List<OutputMessage> getOutput()

获取输出。

Returns the output.

返回Returns List<OutputMessage>
返回列出。Returns list.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:197–199

setOutput

public void setOutput(List<OutputMessage> output)

设置输出。

Sets the output.

参数Parameters
名称Name类型Type说明Description
outputList<OutputMessage>输出(类型 `List`)。The output.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:201–203

getParallelToolCalls

public Boolean getParallelToolCalls()

获取 getParallelToolCalls。

Returns the parallel tool calls.

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

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/ResponseApiResponse.java:209–211

getPreviousResponseId

public String getPreviousResponseId()

获取上一个响应标识。

Returns the previous response id.

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

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/ResponseApiResponse.java:217–219

getPrompt

public ResponsePrompt getPrompt()

获取提示词。

Returns the prompt.

返回Returns ResponsePrompt
返回ResponsePrompt。Returns response prompt.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:221–223

setPrompt

public void setPrompt(ResponsePrompt prompt)

设置提示词。

Sets the prompt.

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

getPromptCacheKey

public String getPromptCacheKey()

获取提示词缓存键。

Returns the prompt cache key.

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

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/ResponseApiResponse.java:233–235

getPromptCacheRetention

public String getPromptCacheRetention()

获取 getPromptCacheRetention。

Returns the prompt cache retention.

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

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/ResponseApiResponse.java:241–243

getReasoning

public ResponseReasoning getReasoning()

获取推理。

Returns the reasoning.

返回Returns ResponseReasoning
返回ResponseReasoning。Returns response reasoning.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:245–247

setReasoning

public void setReasoning(ResponseReasoning reasoning)

设置推理。

Sets the reasoning.

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

getSafetyIdentifier

public String getSafetyIdentifier()

获取 getSafetyIdentifier。

Returns the safety identifier.

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

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/ResponseApiResponse.java:257–259

getStatus

public String getStatus()

获取状态。

Returns the status.

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

setStatus

public void setStatus(String status)

设置状态。

Sets the status.

参数Parameters
名称Name类型Type说明Description
statusString状态(类型 `String`)。The status.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:265–267

getTemperature

public Integer getTemperature()

获取 getTemperature。

Returns the temperature.

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

setTemperature

public void setTemperature(Integer temperature)

设置 setTemperature。

Sets the temperature.

参数Parameters
名称Name类型Type说明Description
temperatureIntegertemperature(类型 `Integer`)。The temperature.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:273–275

getText

public ResponseText getText()

获取文本。

Returns the text.

返回Returns ResponseText
返回ResponseText。Returns response text.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:277–279

setText

public void setText(ResponseText text)

设置文本。

Sets the text.

参数Parameters
名称Name类型Type说明Description
textResponseText文本(类型 `ResponseText`)。The text.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:281–283

getToolChoice

public Object getToolChoice()

获取工具选项。

Returns the tool choice.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:285–287

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/ResponseApiResponse.java:289–291

getTools

public List<Object> getTools()

获取工具。

Returns the tools.

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

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/ResponseApiResponse.java:297–299

getTopLogprobs

public Integer getTopLogprobs()

获取 getTopLogprobs。

Returns the top logprobs.

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

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/ResponseApiResponse.java:305–307

getTopP

public Integer getTopP()

获取 getTopP。

Returns the top p.

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

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/ResponseApiResponse.java:313–315

getTruncation

public String getTruncation()

获取 getTruncation。

Returns the truncation.

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

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/ResponseApiResponse.java:321–323

getUsage

public ResponseUsage getUsage()

获取用量。

Returns the usage.

返回Returns ResponseUsage
返回ResponseUsage。Returns response usage.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:325–327

setUsage

public void setUsage(ResponseUsage usage)

设置用量。

Sets the usage.

参数Parameters
名称Name类型Type说明Description
usageResponseUsage用量(类型 `ResponseUsage`)。The usage.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseApiResponse.java:329–331
基于官方固定版本源码静态生成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.