Skip to contents

Execute an OpenAI request with optional built-in tools enabled (web search, file search, code interpreter, etc.). Returns AI-generated content with response metadata attached as attributes.

Usage

openai_with_tools(
  prompt,
  sys_prompt = NULL,
  tools = list(),
  ml = NULL,
  temp = 1,
  store = FALSE
)

Arguments

prompt

User prompt text

sys_prompt

Optional system prompt

tools

List of tool configurations (use tool_* functions)

ml

Model to use (default: from config)

temp

Temperature setting

store

Whether to store for conversation continuation

Value

Response content with metadata attributes