Jido.Messaging.Demo.ChatAgentRunner (Jido Messaging v1.0.0)

Copy Markdown View Source

Wrapper that runs the ChatAgent within the Jido.Messaging AgentRunner framework.

This module bridges the Jido.AI.Agent with Jido.Messaging's agent system by:

  1. Starting the ChatAgent GenServer
  2. Providing a handler function for the AgentRunner
  3. Managing the agent lifecycle

Architecture


   AgentRunner     <- Subscribes to Signal Bus
 (per-room)      

          calls handler
         

 ChatAgentRunner   <- Manages ChatAgent lifecycle

          delegates to
         

   ChatAgent       <- ReAct reasoning + tools
 (GenServer)     

Usage

# Get an agent config for use with AgentRunner
config = ChatAgentRunner.agent_config()

# Or start directly
{:ok, pid} = ChatAgentRunner.start_link(room_id: "demo:lobby", ...)

Summary

Functions

Returns an agent_config map suitable for use with AgentRunner.

Returns a specification to start this module under a supervisor.

Get the ChatAgent pid for direct interaction.

Start the ChatAgentRunner GenServer.

Types

t()

@type t() :: %Jido.Messaging.Demo.ChatAgentRunner{
  agent_pid: pid(),
  instance_module: module(),
  room_id: binary()
}

Functions

agent_config(opts \\ [])

Returns an agent_config map suitable for use with AgentRunner.

The handler will delegate to a running ChatAgent instance.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_agent_pid()

Get the ChatAgent pid for direct interaction.

start_link(opts)

Start the ChatAgentRunner GenServer.

This starts both the runner and the underlying ChatAgent.