AIAgentTool
class AIAgentTool<Input, Output>(agentService: AIAgentService<Input, Output>, agentName: String, agentDescription: String, inputDescription: String? = null, inputSerializer: KSerializer<Input>, outputSerializer: KSerializer<Output>, json: Json = Json.Default, parentAgentId: String? = null) : Tool<AIAgentTool.AgentToolArgs, AIAgentTool.AgentToolResult> (source)
AIAgentTool is a generic tool that wraps an AI agent to facilitate integration with the context of a tool execution framework. It enables the serialization, deserialization, and execution of an AI agent's operations.
Parameters
Input
The type of input expected by the AI agent.
Output
The type of output produced by the AI agent.
parentAgentId
Optional ID of the parent AI agent. Tool agent IDs will be generated as "parentAgentId.
Constructors
Link copied to clipboard
constructor(agentService: AIAgentService<Input, Output>, agentName: String, agentDescription: String, inputDescription: String? = null, inputSerializer: KSerializer<Input>, outputSerializer: KSerializer<Output>, json: Json = Json.Default, parentAgentId: String? = null)
Types
Link copied to clipboard
Represents the arguments required for the execution of an agent tool. Wraps raw arguments.
Link copied to clipboard
data class AgentToolResult(val successful: Boolean, val errorMessage: String? = null, val result: JsonElement? = null)
Represents the result of executing an agent tool operation.
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun execute(args: AIAgentTool.AgentToolArgs, enabler: DirectToolCallsEnabler): AIAgentTool.AgentToolResult
Link copied to clipboard