AIAgent
Types
Functions
Link copied to clipboard
inline fun <Input, Output> AIAgent<Input, Output>.asTool(agentName: String, agentDescription: String, inputDescription: String? = null, inputSerializer: KSerializer<Input> = serializer(), outputSerializer: KSerializer<Output> = serializer(), json: Json = Json.Default): Tool<Input, AIAgentTool.AgentToolResult<Output>>
Converts the current AI agent into a tool to allow using it in other agents as a tool.
Link copied to clipboard
expect abstract fun createSession(sessionId: String? = null): AIAgentRunSession<Input, Output, out AIAgentContext>
Creates a new session for executing the agent with the given input.
actual abstract fun createSession(sessionId: String?): AIAgentRunSession<Input, Output, out AIAgentContext>
actual abstract fun createSession(sessionId: String?): AIAgentRunSession<Input, Output, out AIAgentContext>
Link copied to clipboard
fun javaNonSuspendRun(agentInput: Input, sessionId: String? = null, executorService: ERROR CLASS: Symbol not found for ExecutorService?? = null): Output
Executes the AI agent task based on the provided input and an optional executor service.
Link copied to clipboard
Executes the AI agent with the given input and retrieves the resulting output.