Sagents.Routers.Single (Sagents v0.8.0-rc.6)
Copy MarkdownTrivial single-factory router. Use when your app has one agent type.
defmodule MyApp.Agents.Router do
use Sagents.Routers.Single,
factory: MyApp.Agents.Factory,
config: MyApp.Agents.FactoryConfig
endThe generated resolve/3 always returns the configured factory paired
with a config built from the configured Config module. The Config
module must expose:
from_inputs(map) :: Ecto.Changeset.t()— start a build pipeline from a map containing at least:scopeand:conversation_id.build(Ecto.Changeset.t()) :: {:ok, struct} | {:error, Ecto.Changeset.t()}— finalize.
Apps with multiple agent types should hand-write resolve/3 instead.