View Source Whisperer.Orchestrator (Whisperer v0.1.0)

Main orchestrator module that manages the flow of messages between users and agents. Maintains state in its own process using GenServer. TODO: Explore conversation history per agent

Summary

Functions

Registers a new agent with the orchestrator.

Returns a specification to start this module under a supervisor.

Gets the conversation history for a user's session.

Processes a user message through the appropriate agent.

Starts the orchestrator process.

Functions

add_agent(session_id, agent_module)

Registers a new agent with the orchestrator.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_conversation(session_id)

@spec get_conversation(binary()) :: [Whisperer.Message.t()]

Gets the conversation history for a user's session.

process_user_input(session_id, user_input)

@spec process_user_input(String.t(), Whisperer.Message.content()) ::
  {:ok, String.t()} | {:error, term()}

Processes a user message through the appropriate agent.

  1. Adds the received user message to the conversation history.
  2. Uses the sequencer to create a plan for executing the agents.

start_link(opts)

Starts the orchestrator process.