DashScopeOutput
@JsonIgnoreProperties(ignoreUnknown = true) public class DashScopeOutput
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:40–92DashScope 输出,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.dashscope.dto 包。核心成员包括 getChoices、setChoices、getFinishReason、setFinishReason、getText、setText。
DashScope output DTO.
This class represents the output section of a DashScope API response.
Example JSON:
`{
"choices": [
{
"message": {...},
"finish_reason": "stop"
}
],
"finish_reason": "stop"
}
`
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public DashScopeOutput() | 初始化 `DashScopeOutput` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public List<DashScopeChoice> getChoices() | 获取 `getChoices`。 Returns the choices. |
public void setChoices(List<DashScopeChoice> choices) | 设置 `setChoices`。 Sets the choices. |
public String getFinishReason() | 获取 `getFinishReason`。 Returns the finish reason. |
public void setFinishReason(String finishReason) | 设置 `setFinishReason`。 Sets the finish reason. |
public String getText() | 获取文本。 Returns the text. |
public void setText(String text) | 设置文本。 Sets the text. |
public DashScopeChoice getFirstChoice() | 获取第一个选项 if 可用。 Get the first choice if available. |
构造器详情Constructor Detail
DashScopeOutput
public DashScopeOutput()
初始化 DashScopeOutput 实例。
Creates a new instance.
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:55方法详情Method Detail
getChoices
public List<DashScopeChoice> getChoices()
获取 getChoices。
Returns the choices.
List<DashScopeChoice>返回列出。Returns list.
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:57–59setChoices
public void setChoices(List<DashScopeChoice> choices)
设置 setChoices。
Sets the choices.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
choices | List<DashScopeChoice> | choices(类型 `List`)。The choices. |
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:61–63getFinishReason
public String getFinishReason()
获取 getFinishReason。
Returns the finish reason.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:65–67setFinishReason
public void setFinishReason(String finishReason)
设置 setFinishReason。
Sets the finish reason.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
finishReason | String | finish 推理(类型 `String`)。The finish reason. |
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:69–71getText
public String getText()
获取文本。
Returns the text.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:73–75setText
public void setText(String text)
设置文本。
Sets the text.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
text | String | 文本(类型 `String`)。The text. |
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:77–79getFirstChoice
public DashScopeChoice getFirstChoice()
获取第一个选项 if 可用。
Get the first choice if available.
DashScopeChoice返回DashScopeChoice。the first choice, or null if no choices
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:86–91