% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/infra__build_backend.R
\name{build_backend}
\alias{build_backend}
\title{Build the Python Backend Environment}
\usage{
build_backend(
  conda_env = NULL,
  conda = "auto",
  python_version = "3.12",
  force = FALSE,
  check_browser = TRUE,
  fix_browser = FALSE,
  chromedriver_dir = NULL
)
}
\arguments{
\item{conda_env}{Name of the conda environment. Defaults to the package
option \code{asa.default_conda_env} (or \code{"asa_env"} if unset).}

\item{conda}{Path to conda executable (default: "auto")}

\item{python_version}{Python version to use (default: "3.12")}

\item{force}{If TRUE, delete and recreate the conda environment if it already exists.}

\item{check_browser}{If TRUE, performs a best-effort check for a system Chrome/Chromium
binary and \code{chromedriver}, warning when major versions are incompatible. Set to
FALSE to skip this check.}

\item{fix_browser}{If TRUE and \code{check_browser = TRUE}, attempt to download a
matching chromedriver for the detected Chrome version and prepend it to \code{PATH}
for the current R session. The driver is stored under \code{chromedriver_dir}.}

\item{chromedriver_dir}{Optional directory to store downloaded chromedriver
binaries. Defaults to \code{~/.asa/chromedriver} when \code{fix_browser = TRUE}.}
}
\value{
Invisibly returns NULL; called for side effects.
}
\description{
Creates a conda environment with all required Python dependencies for the
asa search agent, including LangChain, LangGraph, and search tools.
}
\details{
This function creates a new conda environment and installs the following
Python packages:
\itemize{
  \item langchain_groq, langchain_community, langchain_openai, langchain_google_genai
  \item langgraph
  \item ddgs (DuckDuckGo search)
  \item selenium, primp (browser automation)
  \item undetected-chromedriver (stealth Chrome)
  \item beautifulsoup4, curl_cffi, requests
  \item langextract (schema extraction from webpage text)
  \item fake_headers, httpx
  \item stem (Tor control)
  \item pysocks, socksio (proxy support)
}

Python compatibility note:
Current LangChain releases still import parts of \code{pydantic.v1}, which emits
warnings on Python 3.14+. Prefer Python 3.12 (or 3.13) until upstream
dependencies remove that compatibility layer.
}
\examples{
\dontrun{
# Create the default environment
build_backend()

# Rebuild from scratch
build_backend(force = TRUE)

# Create with a custom name
build_backend(conda_env = "my_asa_env")
}

}
