OllamaTool
@JsonInclude(JsonInclude.Include.NON_NULL) public class OllamaTool
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaTool.java:26–58Ollama 工具,封装可被智能体调用的能力。位于 io.agentscope.extensions.model.ollama.dto 包。核心成员包括 getType、setType、getFunction、setFunction、OllamaTool。
Ollama tool definition DTO. Wraps a function definition as a tool.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public OllamaTool() | 初始化 `OllamaTool` 实例。 Creates a new instance. |
public OllamaTool(OllamaToolFunction function) | 初始化 `OllamaTool` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String getType() | 获取类型。 Returns the type. |
public void setType(String type) | 设置类型。 Sets the type. |
public OllamaToolFunction getFunction() | 获取函数。 Returns the function. |
public void setFunction(OllamaToolFunction function) | 设置函数。 Sets the function. |
构造器详情Constructor Detail
OllamaTool
public OllamaTool()
初始化 OllamaTool 实例。
Creates a new instance.
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaTool.java:37OllamaTool
public OllamaTool(OllamaToolFunction function)
初始化 OllamaTool 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
function | OllamaToolFunction | 函数(类型 `OllamaToolFunction`)。The function. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaTool.java:39–41方法详情Method Detail
getType
public String getType()
获取类型。
Returns the type.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaTool.java:43–45setType
public void setType(String type)
设置类型。
Sets the type.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
type | String | 类型(类型 `String`)。The type. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaTool.java:47–49getFunction
public OllamaToolFunction getFunction()
获取函数。
Returns the function.
OllamaToolFunction返回OllamaToolFunction。Returns Ollama tool function.
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaTool.java:51–53setFunction
public void setFunction(OllamaToolFunction function)
设置函数。
Sets the function.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
function | OllamaToolFunction | 函数(类型 `OllamaToolFunction`)。The function. |
源码Source
io/agentscope/extensions/model/ollama/dto/OllamaTool.java:55–57