AIAgentService

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

AIAgentService is a core interface for managing AI agents. The service allows creation, removal, and management of AI agents and provides functionalities to list agents based on their statuses.

A single instance of AIAgentService manages one kind of uniform AI Agents serving same purpose and solving the same type of user task. It's useful to create, manage, and track the progress of running agents solving similar user tasks in parallel.

Type Parameters

Input

Type parameter for the input data for the agents.

Output

Type parameter for the output data generated by the agents.

Inheritors

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

AIAgentService is a core interface for managing AI agents. The service allows creation, removal, and management of AI agents and provides functionalities to list agents based on their statuses.

A single instance of AIAgentService manages one kind of uniform AI Agents serving same purpose and solving the same type of user task. It's useful to create, manage, and track the progress of running agents solving similar user tasks in parallel.

Type Parameters

Input

Type parameter for the input data for the agents.

Output

Type parameter for the output data generated by the agents.

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

AIAgentService is a core interface for managing AI agents. The service allows creation, removal, and management of AI agents and provides functionalities to list agents based on their statuses.

A single instance of AIAgentService manages one kind of uniform AI Agents serving same purpose and solving the same type of user task. It's useful to create, manage, and track the progress of running agents solving similar user tasks in parallel.

Type Parameters

Input

Type parameter for the input data for the agents.

Output

Type parameter for the output data generated by the agents.

Constructors

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

Types

Link copied to clipboard
expect object Companion

Companion object that provides factory methods for creating instances of GraphAIAgentService with various configurations.

actual object Companion

Companion object that provides factory methods for creating instances of GraphAIAgentService with various configurations.

actual object Companion

Companion object that provides factory methods for creating instances of GraphAIAgentService with various configurations.

Properties

Link copied to clipboard
expect abstract val agentConfig: AIAgentConfig

Holds the configuration details for an AI agent.

actual abstract val agentConfig: AIAgentConfig

Holds the configuration details for an AI agent.

actual abstract val agentConfig: AIAgentConfig

Holds the configuration details for an AI agent.

Link copied to clipboard
expect abstract val promptExecutor: PromptExecutor

Represents an instance of PromptExecutor responsible for executing prompt-based operations.

actual abstract val promptExecutor: PromptExecutor

Represents an instance of PromptExecutor responsible for executing prompt-based operations.

actual abstract val promptExecutor: PromptExecutor

Represents an instance of PromptExecutor responsible for executing prompt-based operations.

Link copied to clipboard
expect abstract val toolRegistry: ToolRegistry

Represents the central repository or registry for managing tools within the system.

actual abstract val toolRegistry: ToolRegistry

Represents the central repository or registry for managing tools within the system.

actual abstract val toolRegistry: ToolRegistry

Represents the central repository or registry for managing tools within the system.

Functions

Link copied to clipboard
expect abstract suspend fun agentById(id: String): TAgent?

Retrieves an AI agent based on its unique identifier.

actual abstract suspend fun agentById(id: String): TAgent?

Retrieves an AI agent based on its unique identifier.

actual abstract suspend fun agentById(id: String): TAgent?

Retrieves an AI agent based on its unique identifier.

Link copied to clipboard

Fetches an agent by its unique identifier.

Link copied to clipboard
expect abstract suspend fun createAgent(id: String? = null, additionalToolRegistry: ToolRegistry = ToolRegistry.EMPTY, agentConfig: AIAgentConfig = this.agentConfig, clock: KoogClock = KoogClock.System): TAgent

Creates a new AI agent with the specified configuration, tool registry, and optional parameters.

actual abstract suspend fun createAgent(id: String?, additionalToolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, agentConfig: AIAgentConfig, clock: ERROR CLASS: Symbol not found for KoogClock): TAgent
actual abstract suspend fun createAgent(id: String?, additionalToolRegistry: ToolRegistry, agentConfig: AIAgentConfig, clock: KoogClock): TAgent

Creates a new AI agent with the specified configuration, tool registry, and optional parameters.

Link copied to clipboard
expect abstract suspend fun createAgentAndRun(agentInput: Input, id: String? = null, additionalToolRegistry: ToolRegistry = this.toolRegistry, agentConfig: AIAgentConfig = this.agentConfig, clock: KoogClock = KoogClock.System): Output

Creates an AI agent with the specified configuration and runs it using the provided input.

actual abstract suspend fun createAgentAndRun(agentInput: Input, id: String?, additionalToolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, agentConfig: AIAgentConfig, clock: ERROR CLASS: Symbol not found for KoogClock): Output
actual abstract suspend fun createAgentAndRun(agentInput: Input, id: String?, additionalToolRegistry: ToolRegistry, agentConfig: AIAgentConfig, clock: KoogClock): Output

Creates an AI agent with the specified configuration and runs it using the provided input.

Link copied to clipboard
fun createAgentAndRunBlocking(agentInput: Input, id: String? = null, additionalToolRegistry: ERROR CLASS: Symbol not found for ToolRegistry = ToolRegistry.EMPTY, agentConfig: AIAgentConfig = this.agentConfig, clock: ERROR CLASS: Symbol not found for KoogClock = KoogClock.System): Output

Creates an AI agent using the specified parameters and immediately runs it with the provided input.

Link copied to clipboard
fun createAgentBlocking(id: String? = null, additionalToolRegistry: ERROR CLASS: Symbol not found for ToolRegistry = ToolRegistry.EMPTY, agentConfig: AIAgentConfig = this.agentConfig, clock: ERROR CLASS: Symbol not found for KoogClock = KoogClock.System): TAgent

Creates a new agent with the specified configuration and settings.

Link copied to clipboard
inline fun <Input, Output> AIAgentService<Input, Output, *>.createAgentTool(agentName: String, agentDescription: String, inputDescription: String? = null, inputType: TypeToken = typeToken<Input>(), outputType: TypeToken = typeToken<Output>(), parentAgentId: String? = null, clock: KoogClock = KoogClock.System): Tool<AIAgentTool.AgentToolInput<Input>, AIAgentTool.AgentToolResult<Output>>

Creates an AIAgent and converts it to a Tool that can be used by other AI Agents.

Link copied to clipboard
expect abstract suspend fun removeAgent(agent: TAgent): Boolean

Removes the specified AI agent from the service.

actual abstract suspend fun removeAgent(agent: TAgent): Boolean

Removes the specified AI agent from the service.

actual abstract suspend fun removeAgent(agent: TAgent): Boolean

Removes the specified AI agent from the service.

Link copied to clipboard

Removes the specified agent from the system.

Link copied to clipboard
expect abstract suspend fun removeAgentWithId(id: String): Boolean

Removes an AI agent based on its unique identifier.

actual abstract suspend fun removeAgentWithId(id: String): Boolean

Removes an AI agent based on its unique identifier.

actual abstract suspend fun removeAgentWithId(id: String): Boolean

Removes an AI agent based on its unique identifier.

Link copied to clipboard

Removes an agent identified by the provided ID.