pig/agent/msg

Agent message type for the sans-IO core.

Messages drive the state machine. They represent both user inputs and runtime responses fed back into the core:

Types

Messages that drive the agent state machine.

pub type AgentMsg {
  UserPrompt(String)
  ProviderResponded(Result(message.Message, error.AiError))
  ToolResults(
    List(#(message.ToolCall, Result(json.Json, tool.ToolError))),
  )
}

Constructors

  • UserPrompt(String)

    A new user prompt. Starts or continues the conversation.

  • ProviderResponded(Result(message.Message, error.AiError))

    The LLM provider’s response, delivered by the runtime after executing a CallProvider effect.

  • ToolResults(
      List(#(message.ToolCall, Result(json.Json, tool.ToolError))),
    )

    Tool execution outcomes, delivered by the runtime after executing an ExecuteTools effect.

Search Document