AS AgentScopeAPI 手册 / API Reference

DashScopeOutput

@JsonIgnoreProperties(ignoreUnknown = true) public class DashScopeOutput
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:40–92

DashScope 输出,与模型服务通信并返回生成或向量化结果。位于 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.

返回Returns List<DashScopeChoice>
返回列出。Returns list.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:57–59

setChoices

public void setChoices(List<DashScopeChoice> choices)

设置 setChoices。

Sets the choices.

参数Parameters
名称Name类型Type说明Description
choicesList<DashScopeChoice>choices(类型 `List`)。The choices.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:61–63

getFinishReason

public String getFinishReason()

获取 getFinishReason。

Returns the finish reason.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:65–67

setFinishReason

public void setFinishReason(String finishReason)

设置 setFinishReason。

Sets the finish reason.

参数Parameters
名称Name类型Type说明Description
finishReasonStringfinish 推理(类型 `String`)。The finish reason.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:69–71

getText

public String getText()

获取文本。

Returns the text.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:73–75

setText

public void setText(String text)

设置文本。

Sets the text.

参数Parameters
名称Name类型Type说明Description
textString文本(类型 `String`)。The text.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:77–79

getFirstChoice

public DashScopeChoice getFirstChoice()

获取第一个选项 if 可用。

Get the first choice if available.

返回Returns DashScopeChoice
返回DashScopeChoice。the first choice, or null if no choices
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeOutput.java:86–91
基于官方固定版本源码静态生成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.