% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chat.R
\name{pra_chat}
\alias{pra_chat}
\title{Create a PRA Risk Analysis Chat Agent}
\usage{
pra_chat(
  chat = NULL,
  model = "llama3.2",
  rag = TRUE,
  embed_model = .pra_default_embed_model
)
}
\arguments{
\item{chat}{An optional pre-configured ellmer chat object. If provided,
\code{model} is ignored and tools are registered on this object instead.}

\item{model}{Character. Ollama model name (default \code{"llama3.2"}). Must support
tool calling. Other options: \code{"qwen2.5"}, \code{"llama3.1:70b"}.}

\item{rag}{Logical. Whether to use RAG context from the PRA knowledge base
(default \code{TRUE}). Requires Ollama embedding model to be available.}

\item{embed_model}{Character. Ollama embedding model for RAG (default
\code{"nomic-embed-text"}). Only used when \code{rag = TRUE}.}
}
\value{
A configured ellmer chat object with PRA tools registered. Use
\code{chat$chat("your question")} to interact.
}
\description{
Creates an ellmer chat object configured as a project risk analysis expert,
with all PRA functions registered as tools and optional RAG context retrieval
from the bundled knowledge base.
}
\details{
By default, uses a local Ollama model for fully offline, private operation.
Alternatively, supply a pre-configured ellmer chat object (e.g.,
\code{ellmer::chat_openai()}) via the \code{chat} parameter for cloud-hosted models.
}
\examples{
\dontrun{
# Default: local Ollama model
chat <- pra_chat()
chat$chat("Run a Monte Carlo simulation for a 3-task project with
  Task A: normal(10, 2), Task B: triangular(5, 10, 15), Task C: uniform(8, 12)")

# Use a cloud model for better accuracy
chat <- pra_chat(chat = ellmer::chat_openai(model = "gpt-4o"))

# Follow-up questions use conversation context
chat$chat("What is the contingency reserve at 95\% confidence?")
}

}
