DashScopeTool
@JsonInclude(JsonInclude.Include.NON_NULL) public class DashScopeTool
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:44–86DashScope 工具,封装可被智能体调用的能力。位于 io.agentscope.extensions.model.dashscope.dto 包。核心成员包括 getType、setType、getFunction、setFunction、function、DashScopeTool。
DashScope tool definition DTO.
This class represents a tool that can be called by the model.
Example:
`{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string"}
},
"required": ["location"]
}
}
}
`
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public DashScopeTool() | 初始化 `DashScopeTool` 实例。 Creates a new instance. |
public DashScopeTool(DashScopeToolFunction function) | 初始化 `DashScopeTool` 实例。 Creates a new instance. |
方法摘要Method Summary
构造器详情Constructor Detail
DashScopeTool
public DashScopeTool()
初始化 DashScopeTool 实例。
Creates a new instance.
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:55DashScopeTool
public DashScopeTool(DashScopeToolFunction function)
初始化 DashScopeTool 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
function | DashScopeToolFunction | 函数(类型 `DashScopeToolFunction`)。The function. |
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:57–59方法详情Method Detail
getType
public String getType()
获取类型。
Returns the type.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:61–63setType
public void setType(String type)
设置类型。
Sets the type.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
type | String | 类型(类型 `String`)。The type. |
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:65–67getFunction
public DashScopeToolFunction getFunction()
获取函数。
Returns the function.
DashScopeToolFunction返回DashScopeToolFunction。Returns DashScope tool function.
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:69–71setFunction
public void setFunction(DashScopeToolFunction function)
设置函数。
Sets the function.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
function | DashScopeToolFunction | 函数(类型 `DashScopeToolFunction`)。The function. |
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:73–75function
public static DashScopeTool function(DashScopeToolFunction function)
static
创建函数工具。
Create a function tool.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
function | DashScopeToolFunction | 函数定义。the function definition |
DashScopeTool一种新的DashScopeTool。a new DashScopeTool
源码Source
io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:83–85