Implement LLMRouter class and all LLM provider classes to make tests pass: Core implementation: - Create ProviderResponse dataclass for provider returns (text, tokens_used) - Update LLMRouter to unpack ProviderResponse objects - Implement all 4 providers to return ProviderResponse: * AnthropicProvider - calls Anthropic API with structured JSON prompts * OpenAIProvider - calls OpenAI /v1/chat/completions endpoint * GeminiProvider - calls Google Gemini generateContent API * OllamaProvider - calls Ollama native or OpenAI-compatible endpoints Router features: - Validates provider at init time, raises UserError for unknown providers - Reads API keys from ir.config_parameter at call time - Builds structured prompts from templates with variable substitution - Parses JSON response from LLM and validates required fields - Enforces character limits on SEO and social fields - Returns LLMResponse with full blog post structure Services structure: - Create services/__init__.py with exports - Create models/__init__.py with exports - Create tests/__init__.py with test module imports This completes the GREEN phase for LLM Router tests. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
19 lines
428 B
Python
19 lines
428 B
Python
# -*- coding: utf-8 -*-
|
|
"""
|
|
itsulu_blog_publisher tests.
|
|
"""
|
|
from . import test_llm_router
|
|
from . import test_blog_topic
|
|
from . import test_blog_schedule
|
|
from . import test_blog_generation_log
|
|
from . import test_blog_post_social
|
|
from . import test_bdd_steps
|
|
|
|
__all__ = [
|
|
'test_llm_router',
|
|
'test_blog_topic',
|
|
'test_blog_schedule',
|
|
'test_blog_generation_log',
|
|
'test_blog_post_social',
|
|
'test_bdd_steps',
|
|
]
|