AgentAction: AgentAction S3 Class

View source: R/Zagent.R

AgentActionR Documentation

AgentAction S3 Class

Description

An object that bundles an Agent together with a prompt and replacements so that it can be chained onto a conversation with the '+' operator.

When 'conversation + AgentAction' is called:

  1. If the agent is not yet in the conversation, it is added.

  2. The agent is prompted with the provided prompt template (and replacements).

  3. The conversation is updated with the agent's response.

Usage

AgentAction(agent, prompt_template, replacements = list(), verbose = FALSE)

Arguments

agent

An Agent object.

prompt_template

A character string (the prompt).

replacements

A named list for placeholder substitution (optional).

verbose

Logical. If TRUE, prints verbose LLM response info. Default FALSE.

Value

An object of class AgentAction, used in conversation chaining.


LLMR documentation built on April 4, 2025, 1:11 a.m.