ExAgent.Session.Participant (ExAgent v3.0.0)

View Source

A member of an ExAgent.Session: either an :agent (typically backed by an ExAgent.Server) or a :human (a real person driving via LiveView/a channel).

Stability — Stable.

Participants are identified by their id. A session with a Store accepts integers and valid UTF-8 strings. A session without a Store accepts any non-nil term. The built-in turn policies compare IDs exactly, like map keys. For example, 1 and 1.0 can identify two different participants in a session without a Store. For agents, ref may hold a pid / registered name / app-defined handle so the host app can drive the agent when its turn comes. For ExAgent.Session.chat/4, set ref to the agent definition.

Summary

Functions

Build a participant from opts (:id required, :kind defaults to :human).

Types

kind()

@type kind() :: :agent | :human

t()

@type t() :: %ExAgent.Session.Participant{
  id: term(),
  kind: kind(),
  metadata: map(),
  ref: term()
}

Functions

new(opts)

@spec new(keyword()) :: t()

Build a participant from opts (:id required, :kind defaults to :human).