DashScopeChoice
@JsonIgnoreProperties(ignoreUnknown = true) public class DashScopeChoice
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:37–80DashScope 选项,保存相关配置项。位于 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.
DashScopeMessage返回DashScopeMessage。Returns DashScope message.
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:57–59setMessage
public void setMessage(DashScopeMessage message)
设置消息。
Sets the message.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | DashScopeMessage | 消息(类型 `DashScopeMessage`)。The message. |
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:61–63getFinishReason
public String getFinishReason()
获取 getFinishReason。
Returns the finish reason.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.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/DashScopeChoice.java:69–71getIndex
public Integer getIndex()
获取索引。
Returns the index.
Integer返回数值结果。Returns a numeric result.
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:73–75setIndex
public void setIndex(Integer index)
设置索引。
Sets the index.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
index | Integer | 索引(类型 `Integer`)。The index. |
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeChoice.java:77–79