AS AgentScopeAPI 手册 / API Reference

OpenAIToolCall

@JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class OpenAIToolCall
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:40–145

OpenAI 工具调用,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.openai.dto 包。核心成员包括 getId、setId、getType、setType、getFunction、setFunction。

OpenAI tool call DTO.

This class represents a tool call made by the assistant.

Example:

`{
"id": "call_abc123",
"type": "function",
"function": {
"name": "get_weather",
"arguments": "{\"location\": \"Beijing\"}"
}
}
`

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
构建器,用于构建并配置目标实例。
A class in io.agentscope.extensions.model.openai.dto that talks to model services and returns generated or embedded output.

构造器摘要Constructor Summary

构造器Constructor说明Description
public OpenAIToolCall()
初始化 `OpenAIToolCall` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String getId()
获取标识。
Returns the id.
public void setId(String id)
设置标识。
Sets the id.
public String getType()
获取类型。
Returns the type.
public void setType(String type)
设置类型。
Sets the type.
public OpenAIFunction getFunction()
获取函数。
Returns the function.
public void setFunction(OpenAIFunction function)
设置函数。
Sets the function.
public Integer getIndex()
获取索引。
Returns the index.
public void setIndex(Integer index)
设置索引。
Sets the index.
public String getThoughtSignature()
获取 `getThoughtSignature`。
Returns the thought signature.
public void setThoughtSignature(String thoughtSignature)
设置 `setThoughtSignature`。
Sets the thought signature.
public static Builder builder()
static
返回构建器实例。
Returns the builder.

构造器详情Constructor Detail

OpenAIToolCall

public OpenAIToolCall()

初始化 OpenAIToolCall 实例。

Creates a new instance.

源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:65

方法详情Method Detail

getId

public String getId()

获取标识。

Returns the id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:67–69

setId

public void setId(String id)

设置标识。

Sets the id.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:71–73

getType

public String getType()

获取类型。

Returns the type.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:75–77

setType

public void setType(String type)

设置类型。

Sets the type.

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

getFunction

public OpenAIFunction getFunction()

获取函数。

Returns the function.

返回Returns OpenAIFunction
返回OpenAIFunction。Returns OpenAI function.
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:83–85

setFunction

public void setFunction(OpenAIFunction function)

设置函数。

Sets the function.

参数Parameters
名称Name类型Type说明Description
functionOpenAIFunction函数(类型 `OpenAIFunction`)。The function.
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:87–89

getIndex

public Integer getIndex()

获取索引。

Returns the index.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:91–93

setIndex

public void setIndex(Integer index)

设置索引。

Sets the index.

参数Parameters
名称Name类型Type说明Description
indexInteger索引(类型 `Integer`)。The index.
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:95–97

getThoughtSignature

public String getThoughtSignature()

获取 getThoughtSignature。

Returns the thought signature.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:99–101

setThoughtSignature

public void setThoughtSignature(String thoughtSignature)

设置 setThoughtSignature。

Sets the thought signature.

参数Parameters
名称Name类型Type说明Description
thoughtSignatureStringthought Signature(类型 `String`)。The thought signature.
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:103–105

builder

public static Builder builder()
static

返回构建器实例。

Returns the builder.

返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/openai/dto/OpenAIToolCall.java:107–109

嵌套类详情Nested Class Detail

Builder

public static class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.model.openai.dto 包。核心成员包括 id、type、function、index、thoughtSignature、build。

A class in io.agentscope.extensions.model.openai.dto that talks to model services and returns generated or embedded output. Declared in io.agentscope.extensions.model.openai.dto.

基于官方固定版本源码静态生成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.