asTool

fun AIAgentBase.asTool(agentDescription: String, name: String? = null, requestDescription: String = "Input for the task"): Tool<AIAgentTool.AgentToolArgs, AIAgentTool.AgentToolResult>(source)

Converts the current AI agent into a tool that can be utilized with the specified parameters.

Return

a tool representation of the AI agent

Parameters

agentDescription

a descriptive text that explains the functionality or purpose of the agent

name

an optional name for the tool; if not provided, the name will be derived from the agent's class name

requestDescription

a description of the input expected for the created tool; defaults to "Input for the task"