foundry_agent_message: Describe an agent message for task adherence

View source: R/content-safety-preview.R

foundry_agent_messageR Documentation

Describe an agent message for task adherence

Description

Build a single conversation turn for the messages argument of foundry_task_adherence().

Usage

foundry_agent_message(
  source,
  role,
  contents = NULL,
  tool_calls = NULL,
  tool_call_id = NULL
)

Arguments

source

Character. "Prompt" for the original user request or "Completion" for anything the agent produced.

role

Character. "User", "Assistant", or "Tool".

contents

Character. Optional message text.

tool_calls

List. Optional tool calls issued by an assistant turn. Build each with foundry_agent_tool_call().

tool_call_id

Character. Optional identifier tying a Tool turn back to the tool call it answers.

Value

A named list matching the task-adherence message schema.

Examples

foundry_agent_message("Prompt", "User", "How many can I buy?")

foundryR documentation built on Sept. 25, 2026, 1:10 a.m.