% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/agent__initialize.R
\name{.create_http_clients}
\alias{.create_http_clients}
\title{Create HTTP Clients for API Calls}
\usage{
.create_http_clients(search_proxy, timeout)
}
\arguments{
\item{search_proxy}{Proxy URL for search tools (e.g., Tor SOCKS5) or NULL}

\item{timeout}{Timeout in seconds}
}
\value{
A list with 'direct' client (no proxy, for LLM) and 'proxied' client (for search)
}
\description{
Creates two synchronous httpx clients: one direct (no proxy) for LLM API calls,
and one proxied (with Tor) for search tools. This dual-client approach ensures
OpenAI/OpenRouter API calls don't route through Tor (which causes failures),
while DuckDuckGo searches still use Tor to avoid IP blocks.
}
\details{
Note: We intentionally do NOT create async clients. LangChain/OpenAI SDK
creates its own async client internally when needed (for async operations).
This avoids R-CRIT-001 where async client cleanup was unreliable from R
since aclose() requires an async context.
}
\keyword{internal}
