Skip to contents

Create an ellmer chat with a ragcat retrieval tool

Usage

make_rag_chat(
  store_location = RAG_STORE_LOCATION,
  topic = "custom_rag",
  model = "gpt-4o",
  endpoint = "https://api-dev.ai.doi.net/",
  top_k = 12L,
  system_prompt_file = NULL,
  system_prompt = NULL,
  use_saved_system_prompt = TRUE,
  output_instructions = NULL,
  output_instructions_file = NULL,
  params = ellmer::params(temperature = 0.1),
  store_description = paste0("RAG evidence for topic: ", topic),
  tool_name = "search_rag_store",
  tool_title = "Search RAG store",
  ...
)

Arguments

store_location

Path to the ragnar store.

topic

Topic label used in the retrieval tool description.

model

Azure OpenAI model name.

endpoint

Azure OpenAI endpoint.

top_k

Number of chunks retrieved by the tool.

system_prompt_file, system_prompt, use_saved_system_prompt

System prompt controls.

output_instructions, output_instructions_file

Output instruction controls.

params

ellmer model parameters.

store_description

Retrieval tool description.

tool_name, tool_title

Retrieval tool identifiers.

...

Additional arguments passed to ellmer::chat_azure_openai().

Value

An ellmer chat object.

Examples

if (FALSE) { # \dontrun{
chat <- make_rag_chat(
  store_location = file.path("data", "example_rag_store", "rag_store.duckdb"),
  topic = "Example topic",
  model = "gpt-5.2",
  endpoint = "https://api-dev.ai.doi.net/"
)
} # }