Skip to main content

Eventing

Evening is at the core of the Arc Agents framework. The Arc Agent Framework provides the following interfaces for enabling eventing between your application and components of the Arc Agent Framework:

  /**
* EventPublisher interface.
*/
fun interface EventPublisher {
fun publish(event: Event)
}

/**
* Add EventHandlers to the implementation of this event to receive events.
*/
fun interface EventListeners {
fun add(handler: EventHandler<out Event>)
}

Out of the box, components of the Arc Framework will publish various events. The events are useful for monitoring the system.

Custom events can be easily published throughout the Arc Agent DSL using the emit function.

  agent {
name = "..."
description = "..."
prompt { "..." }
filterInput {
emit(MyCustomEvent())
}
}

Currently, the following events are published by the framework:

Agent Events

Event
AgentStartedEventPublished whenever an Agent processes data.
AgentFinishedEventPublished after an Agent processes data.

AI Client Events

Event
LLMStartedEventPublished whenever an AI Client processes data.
LLMFinishedEventPublished after an AI Client processes data.
LLMFunctionCalledEventPublished after an LLM function was called.