AS AgentScopeAPI 手册 / API Reference

DashScopeTool

@JsonInclude(JsonInclude.Include.NON_NULL) public class DashScopeTool
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:44–86

DashScope 工具,封装可被智能体调用的能力。位于 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

方法Method说明Description
public String getType()
获取类型。
Returns the type.
public void setType(String type)
设置类型。
Sets the type.
public DashScopeToolFunction getFunction()
获取函数。
Returns the function.
public void setFunction(DashScopeToolFunction function)
设置函数。
Sets the function.
public static DashScopeTool function(DashScopeToolFunction function)
static
创建函数工具。
Create a function tool.

构造器详情Constructor Detail

DashScopeTool

public DashScopeTool()

初始化 DashScopeTool 实例。

Creates a new instance.

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

DashScopeTool

public DashScopeTool(DashScopeToolFunction function)

初始化 DashScopeTool 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
functionDashScopeToolFunction函数(类型 `DashScopeToolFunction`)。The function.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:57–59

方法详情Method Detail

getType

public String getType()

获取类型。

Returns the type.

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

setType

public void setType(String type)

设置类型。

Sets the type.

参数Parameters
名称Name类型Type说明Description
typeString类型(类型 `String`)。The type.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:65–67

getFunction

public DashScopeToolFunction getFunction()

获取函数。

Returns the function.

返回Returns DashScopeToolFunction
返回DashScopeToolFunction。Returns DashScope tool function.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:69–71

setFunction

public void setFunction(DashScopeToolFunction function)

设置函数。

Sets the function.

参数Parameters
名称Name类型Type说明Description
functionDashScopeToolFunction函数(类型 `DashScopeToolFunction`)。The function.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:73–75

function

public static DashScopeTool function(DashScopeToolFunction function)
static

创建函数工具。

Create a function tool.

参数Parameters
名称Name类型Type说明Description
functionDashScopeToolFunction函数定义。the function definition
返回Returns DashScopeTool
一种新的DashScopeTool。a new DashScopeTool
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeTool.java:83–85
基于官方固定版本源码静态生成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.