AIAgent

expect abstract class AIAgent<Input, Output> : Closeable(source)

Represents a basic interface for AI agent.

Inheritors

actual abstract class AIAgent<Input, Output> : <ERROR CLASS> ERROR CLASS: Symbol not found for Closeable(source)

Represents a basic interface for AI agent.

actual abstract class AIAgent<Input, Output> : Closeable(source)

Represents a basic interface for AI agent.

Constructors

Link copied to clipboard
expect constructor()
constructor()
constructor()

Types

Link copied to clipboard
expect object Companion

Companion object with builder for AIAgent

actual object Companion

Companion object with builder for AIAgent

actual object Companion

Companion object with builder for AIAgent

Properties

Link copied to clipboard
expect abstract val agentConfig: AIAgentConfig

The configuration for the AI agent.

actual abstract val agentConfig: AIAgentConfig

The configuration for the AI agent.

actual abstract val agentConfig: AIAgentConfig

The configuration for the AI agent.

Link copied to clipboard
expect abstract val id: String

Represents the unique identifier for the AI agent.

actual abstract val id: String

Represents the unique identifier for the AI agent.

actual abstract val id: String

Represents the unique identifier for the AI agent.

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<AIAgentTool.AgentToolInput<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
abstract suspend fun close()
abstract suspend fun close()
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>

Creates a new session for executing the agent with the given input.

actual abstract fun createSession(sessionId: String?): AIAgentRunSession<Input, Output, out AIAgentContext>

Creates a new session for executing the agent with the given input.

Link copied to clipboard
expect abstract suspend fun run(agentInput: Input, sessionId: String? = null): Output

Executes the AI agent with the given input and retrieves the resulting output.

actual abstract suspend fun run(agentInput: Input, sessionId: String?): Output

Executes the AI agent with the given input and retrieves the resulting output.

actual abstract suspend fun run(agentInput: Input, sessionId: String?): Output

Executes the AI agent with the given input and retrieves the resulting output.

Link copied to clipboard
fun runBlocking(agentInput: Input, sessionId: String? = null): Output

Executes the AI agent task based on the provided input.