AIAgentTool

class AIAgentTool(agent: AIAgentBase, agentName: String, agentDescription: String, requestDescription: String = "Input for the task") : Tool<AIAgentTool.AgentToolArgs, AIAgentTool.AgentToolResult> (source)

AIAgentTool is a specialized tool that integrates an AI agent for processing tasks by leveraging input arguments and producing corresponding results.

This class extends the generic Tool interface with custom argument and result types.

Parameters

agent

The AI agent that implements the AIAgentBase interface and handles task execution.

agentName

A name assigned to the tool that helps identify it.

agentDescription

A brief description of what the tool does.

requestDescription

An optional description of the input to the tool, defaulting to "Input for the task".

Constructors

Link copied to clipboard
constructor(agent: AIAgentBase, agentName: String, agentDescription: String, requestDescription: String = "Input for the task")

Creates an instance of AIAgentTool with the specified AI agent, its name, description, and an optional description for the request parameter.

Types

Link copied to clipboard
@Serializable
data class AgentToolArgs(val request: String) : Tool.Args
Link copied to clipboard
@Serializable
data class AgentToolResult(val successful: Boolean, val errorMessage: String? = null, val result: String? = null) : ToolResult

Properties

Link copied to clipboard
open override val argsSerializer: KSerializer<AIAgentTool.AgentToolArgs>
Link copied to clipboard
open override val descriptor: ToolDescriptor
Link copied to clipboard

Functions

Link copied to clipboard
fun decodeArgs(rawArgs: JsonObject): AIAgentTool.AgentToolArgs
Link copied to clipboard
fun encodeArgs(args: AIAgentTool.AgentToolArgs): JsonObject
Link copied to clipboard
Link copied to clipboard