InMemoryRunner

open class InMemoryRunner(val agent: BaseAgent, val appName: String = "InMemoryRunner", val sessionService: SessionService = InMemorySessionService(), val artifactService: ArtifactService? = InMemoryArtifactService(), val memoryService: MemoryService? = InMemoryMemoryService(), val pluginManager: PluginManager = PluginManager(), val resumabilityConfig: ResumabilityConfig = ResumabilityConfig()) : AbstractRunner

An in-memory implementation of a Runner that manages the lifecycle of a BaseAgent execution.

It provides default in-memory implementations for session, artifact, and memory services.

Inheritors

Constructors

Link copied to clipboard
constructor(agent: BaseAgent, appName: String = "InMemoryRunner", sessionService: SessionService = InMemorySessionService(), artifactService: ArtifactService? = InMemoryArtifactService(), memoryService: MemoryService? = InMemoryMemoryService(), pluginManager: PluginManager = PluginManager(), resumabilityConfig: ResumabilityConfig = ResumabilityConfig())

Properties

Link copied to clipboard
open override val agent: BaseAgent
Link copied to clipboard
open override val appName: String
Link copied to clipboard
open override val artifactService: ArtifactService?
Link copied to clipboard
open override val memoryService: MemoryService?
Link copied to clipboard
open override val pluginManager: PluginManager
Link copied to clipboard
Link copied to clipboard
open override val sessionService: SessionService

Functions

Link copied to clipboard
fun applyStateDelta(event: Event, stateDelta: Map<String, Any>?)

Applies the provided stateDelta to the given event.

Link copied to clipboard
open override fun run(userId: String, sessionId: String, newMessage: Content, runConfig: RunConfig?): Iterator<Event>

Sync interface for local testing and convenience purpose.

Link copied to clipboard
open override fun runAsync(userId: String, sessionId: String, invocationId: String?, newMessage: Content?, stateDelta: Map<String, Any>?, runConfig: RunConfig?): Flow<Event>

Main entry method to run the agent in this runner.