OpenAIFunction
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class OpenAIFunction
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:36–93OpenAI 函数,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.openai.dto 包。核心成员包括 getName、setName、getArguments、setArguments、getThoughtSignature、setThoughtSignature。
OpenAI function call DTO.
This class represents the function details in a tool call.
Example:
`{
"name": "get_weather",
"arguments": "{\"location\": \"Beijing\"}"
}
`
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public OpenAIFunction() | 初始化 `OpenAIFunction` 实例。 Creates a new instance. |
public OpenAIFunction(String name, String arguments) | 初始化 `OpenAIFunction` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String getName() | 获取名称。 Returns the name. |
public void setName(String name) | 设置名称。 Sets the name. |
public String getArguments() | 获取参数。 Returns the arguments. |
public void setArguments(String arguments) | 设置参数。 Sets the arguments. |
public String getThoughtSignature() | 获取 `getThoughtSignature`。 Returns the thought signature. |
public void setThoughtSignature(String thoughtSignature) | 设置 `setThoughtSignature`。 Sets the thought signature. |
public static OpenAIFunction of(String name, String arguments)static | 创建并返回实例。 Creates and returns an instance. |
public static OpenAIFunction of(String name, String arguments, String thoughtSignature)static | 创建并返回实例。 Creates and returns an instance. |
构造器详情Constructor Detail
OpenAIFunction
public OpenAIFunction()
初始化 OpenAIFunction 实例。
Creates a new instance.
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:53OpenAIFunction
public OpenAIFunction(String name, String arguments)
初始化 OpenAIFunction 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
arguments | String | 参数(类型 `String`)。The arguments. |
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:55–58方法详情Method Detail
getName
public String getName()
获取名称。
Returns the name.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:60–62setName
public void setName(String name)
设置名称。
Sets the name.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:64–66getArguments
public String getArguments()
获取参数。
Returns the arguments.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:68–70setArguments
public void setArguments(String arguments)
设置参数。
Sets the arguments.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
arguments | String | 参数(类型 `String`)。The arguments. |
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:72–74getThoughtSignature
public String getThoughtSignature()
获取 getThoughtSignature。
Returns the thought signature.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:76–78setThoughtSignature
public void setThoughtSignature(String thoughtSignature)
设置 setThoughtSignature。
Sets the thought signature.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
thoughtSignature | String | thought Signature(类型 `String`)。The thought signature. |
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:80–82of
public static OpenAIFunction of(String name, String arguments)
static
创建并返回实例。
Creates and returns an instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
arguments | String | 参数(类型 `String`)。The arguments. |
OpenAIFunction返回OpenAIFunction。Returns OpenAI function.
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:84–86of
public static OpenAIFunction of(String name, String arguments, String thoughtSignature)
static
创建并返回实例。
Creates and returns an instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
arguments | String | 参数(类型 `String`)。The arguments. |
thoughtSignature | String | thought Signature(类型 `String`)。The thought signature. |
OpenAIFunction返回OpenAIFunction。Returns OpenAI function.
源码Source
io/agentscope/extensions/model/openai/dto/OpenAIFunction.java:88–92