AS AgentScopeAPI 手册 / API Reference

DashScopeChoice

@JsonIgnoreProperties(ignoreUnknown = true) public class DashScopeChoice
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:37–80

DashScope 选项,保存相关配置项。位于 io.agentscope.extensions.model.dashscope.dto 包。核心成员包括 getMessage、setMessage、getFinishReason、setFinishReason、getIndex、setIndex。

DashScope choice DTO.

This class represents a single choice in a DashScope API response.

Example JSON:

`{
"message": {
"role": "assistant",
"content": "Hello!"
},
"finish_reason": "stop"
}
`

构造器摘要Constructor Summary

构造器Constructor说明Description
public DashScopeChoice()
初始化 `DashScopeChoice` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public DashScopeMessage getMessage()
获取消息。
Returns the message.
public void setMessage(DashScopeMessage message)
设置消息。
Sets the message.
public String getFinishReason()
获取 `getFinishReason`。
Returns the finish reason.
public void setFinishReason(String finishReason)
设置 `setFinishReason`。
Sets the finish reason.
public Integer getIndex()
获取索引。
Returns the index.
public void setIndex(Integer index)
设置索引。
Sets the index.

构造器详情Constructor Detail

DashScopeChoice

public DashScopeChoice()

初始化 DashScopeChoice 实例。

Creates a new instance.

源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:55

方法详情Method Detail

getMessage

public DashScopeMessage getMessage()

获取消息。

Returns the message.

返回Returns DashScopeMessage
返回DashScopeMessage。Returns DashScope message.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:57–59

setMessage

public void setMessage(DashScopeMessage message)

设置消息。

Sets the message.

参数Parameters
名称Name类型Type说明Description
messageDashScopeMessage消息(类型 `DashScopeMessage`)。The message.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:61–63

getFinishReason

public String getFinishReason()

获取 getFinishReason。

Returns the finish reason.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.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/DashScopeChoice.java:69–71

getIndex

public Integer getIndex()

获取索引。

Returns the index.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:73–75

setIndex

public void setIndex(Integer index)

设置索引。

Sets the index.

参数Parameters
名称Name类型Type说明Description
indexInteger索引(类型 `Integer`)。The index.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:77–79
基于官方固定版本源码静态生成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.