FeatureMessageServer

Represents a server responsible for managing and facilitating communication of feature messages. Typically used for sending and handling messages within a remote server context.

A server is a pat of a Kotlin AI Agent. The server is started inside the same process as the running agent. It is used to broadcast agent execution events to connected clients (e.g., a running IDE). Please see description for a client in ai.koog.agents.local.features.common.remote.client.FeatureMessageRemoteClient.

Features:

  • Send SSE events FeatureMessage during agent execution, e.g. ai.koog.agents.core.feature.model.AgentCreateEvent;

  • Process incoming messages from a client;

  • Respond to client's health check requests to verify connection state.

Inheritors

Properties

Link copied to clipboard
abstract val isStarted: Boolean

Indicates whether the server has been started.

Functions

Link copied to clipboard
abstract suspend fun close()
Link copied to clipboard
abstract suspend fun sendMessage(message: FeatureMessage)

Sends a feature message for further processing or delivery to connected clients via server-sent events (SSE).

Link copied to clipboard
abstract suspend fun start()

Starts the server, initializing any necessary resources and beginning to listen for incoming client connections or events.