ai_client_factory¶
AI Client Factory - Creates and manages different AI clients with fallback logic
Functions
|
Parse a .env file and then load all the variables found as environment variables. |
Classes
|
Factory for creating AI clients with automatic provider selection and fallback |
|
Abstract base class for AI content generation clients |
|
Fallback AI client that provides sample content |
Exceptions
|
Exception raised when AI provider is not available or configured incorrectly |
- class ai_client_factory.AIClientFactory(base_dir='.')[source]¶
Factory for creating AI clients with automatic provider selection and fallback
- create_client()[source]¶
Create an AI client based on configuration and availability
Provider selection logic: 1. If AI_PROVIDER is set to specific provider, try that first 2. If “auto” or not set, try providers in order: Llama -> Claude -> Sample 3. If fallback is enabled, continue down the chain until one works 4. If no providers work, return a mock client with sample content
- Return type:
- class ai_client_factory.SampleAIClient(base_dir='.')[source]¶
Fallback AI client that provides sample content
- generate_all_cover_letter_content(job_description, profile_content, company_name, position_title)[source]¶
Generate sample cover letter content
- Return type: