Class DashScopeResponse
java.lang.Object
io.agentscope.extensions.model.dashscope.dto.DashScopeResponse
DashScope API response DTO.
This class represents the top-level response structure from DashScope's text-generation and multimodal-generation APIs.
Example JSON:
{
"request_id": "xxx-xxx-xxx",
"output": {
"choices": [...]
},
"usage": {
"input_tokens": 10,
"output_tokens": 20
}
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCode()getUsage()booleanisError()Check if this response represents an error.voidvoidsetMessage(String message) voidsetOutput(DashScopeOutput output) voidsetRequestId(String requestId) voidsetUsage(DashScopeUsage usage)
-
Constructor Details
-
DashScopeResponse
public DashScopeResponse()
-
-
Method Details
-
getRequestId
-
setRequestId
-
getOutput
-
setOutput
-
getUsage
-
setUsage
-
getCode
-
setCode
-
getMessage
-
setMessage
-
isError
public boolean isError()Check if this response represents an error.- Returns:
- true if the response contains an error code
-