Expand description
HTTP client, retry logic, and Context7 API calls.
This module owns the full lifecycle of API interaction: request building, status handling, and key-rotation retry.
Structs§
- Code
Block - A single code block within a documentation snippet.
- Documentation
Response - Top-level response from the documentation endpoint (
GET /api/v1/{library_id}). - Documentation
Snippet - Represents a single documentation excerpt returned by the docs endpoint (JSON mode).
- Library
List Response - Top-level response from the library search endpoint (
GET /api/v1/search). - Library
Search Result - Represents a single library entry returned by the search endpoint.
Functions§
- create_
http_ client - Creates a reusable HTTP client with rustls-TLS, 30 s timeout, and HTTP/2.
- fetch_
documentation - Fetches documentation for
library_idwith an optionalqueryfilter (JSON mode). - fetch_
documentation_ text - Fetches documentation for
library_idas raw plain text (markdown). - run_
with_ retry - Executes an API call with retry and key rotation.
- search_
library - Searches for libraries matching
namewith optional relevancecontext_query.