View Source Agens.Message (agens v0.1.3)

The Message struct defines the details of a message passed between Agents, Jobs and Servings.

Fields

  • :parent_pid - The process identifier of the parent/caller process.
  • :input - The input string for the message. Required.
  • :prompt - The final prompt string constructed for Agens.Serving.run/1.
  • :result - The result string for the message.
  • :agent_name - The name of the Agens.Agent.
  • :serving_name - The name of the Agens.Serving.
  • :job_name - The name of the Agens.Job.
  • :job_description - The description of the Agens.Job to be added to the LM prompt.
  • :step_index - The index of the Agens.Job.Step.
  • :step_objective - The objective of the Agens.Job.Step to be added to the LM prompt.

Summary

Types

@type t() :: %Agens.Message{
  agent_name: atom() | nil,
  input: String.t(),
  job_description: String.t() | nil,
  job_name: atom() | nil,
  parent_pid: pid() | nil,
  prompt: String.t() | Agens.Agent.Prompt.t() | nil,
  result: String.t() | nil,
  serving_name: atom() | nil,
  step_index: non_neg_integer() | nil,
  step_objective: String.t() | nil
}

Functions

@spec send(t()) :: t() | {:error, atom()}

Sends an Agens.Message to an Agens.Agent or Agens.Serving.