Skip to content

refdocs

robotsix_llmio.clients.refdocs

Refdocs — direct HTTP access for documentation search and retrieval.

Replaces the agent-comm broker intermediary with direct REST calls.

RefdocsClientError

Bases: RobotsixLLMIOError

Error from the refdocs client (HTTP, auth, malformed response).

AsyncRefdocsClient

Bases: BaseHttpClient

Async refdocs REST client for searching and retrieving documentation.

Hits the refdocs REST API directly (no agent-comm broker). Creates a fresh, timeout-bounded httpx2.AsyncClient per request (stateless per-call pattern).

search async

search(query)

Search the documentation index for query.

Hits GET {base_url}/search?q={query}. Returns a list of result dicts, each with at least "path" and "title" keys.

Raises RefdocsClientError on any non-2xx response or network failure.

get_doc async

get_doc(path)

Retrieve the full content of the documentation at path.

Hits GET {base_url}/docs/{path}. Returns the document body as a string.

Raises RefdocsClientError on any non-2xx response or network failure.

RefdocsSettings dataclass

Configuration for the refdocs HTTP client.

Attributes

base_url: Base URL of the refdocs REST API. Defaults to http://localhost:9090. api_key: Bearer-token for authentication. When None (default), falls back to the REFDOCS_API_KEY environment variable. If still None after the fallback, requests are sent without an Authorization header. request_timeout: Per-request timeout in seconds. Defaults to 30.0.

resolved_api_key property

resolved_api_key

Return the explicit api_key or the REFDOCS_API_KEY env var.

build_refdocs_tools

build_refdocs_tools(settings)

Build pydantic-ai :class:~pydantic_ai.tools.Tool objects wrapping direct-HTTP refdocs access.

Parameters

settings: Configuration for the refdocs HTTP client (base URL, auth, timeout).

Returns

list of pydantic_ai.Tool Tools ready to pass to a pydantic-ai Agent via tools=.