Note: providers

Context

The providers module supplies optional async adapters that connect attune-rag to external LLM APIs. Each adapter is installed separately so that the core package has no mandatory SDK dependencies.

Content

The module defines the LLMProvider protocol in base.py. Any conforming class must implement at least generate(); generate_with_citations() is available on providers that support document-grounded responses.

Two concrete implementations ship with the package:

Neither SDK is imported at module load time. The import happens inside the provider class, so installing only one extra does not affect the other.

Two helper functions are exported from providers/__init__.py:

The citations-related dataclasses, CitationDocument and CitedResponse, are defined in base.py and used only with providers that implement generate_with_citations(). GeminiProvider does not currently implement that method; ClaudeProvider does.

Note: The source files list a providers/openai.py module, but no OpenAIProvider class appears in the public API (__all__) or the installed extras. Treat OpenAI support as not yet available.

Tags: providers, llm, claude, gemini