ITSulu Blog Publisher Odoo addon
Find a file
Nicholas Riegel 697b95a27b Implement LLMRouter and provider infrastructure for GREEN phase tests
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>
2026-05-29 12:27:58 -04:00
addons/itsulu_blog_publisher Implement LLMRouter and provider infrastructure for GREEN phase tests 2026-05-29 12:27:58 -04:00
templates Initialized from 'GitLab CI/CD components' project template 2025-03-19 11:40:54 +01:00
.gitlab-ci.yml Initialized from 'GitLab CI/CD components' project template 2025-03-19 11:40:54 +01:00
ARCHITECTURE.md Claude Sonnet 4.6 2026-05-29 01:33:30 -04:00
CLAUDE.md Added SKILL_odoo_testing_framework.md which is the Odoo Testing Framework Skill 2026-05-29 12:05:57 -04:00
LICENCE Initialized from 'GitLab CI/CD components' project template 2025-03-19 11:40:54 +01:00
main.py Claude Sonnet 4.6 2026-05-29 01:40:58 -04:00
README.md Initialized from 'GitLab CI/CD components' project template 2025-03-19 11:40:54 +01:00

Gitlab component template

Components

<Component-name>

Use this component to <component-description>.

To add this component to your CI/CD pipeline, add the following include entry to your project's CI/CD configuration:

include:
  - component: https://gitlab.com/<your project path>/<name of your template>@<tag>

Where <tag> is the release tag you want to use (releases list).

Inputs

The template contains some optional inputs:

Input Default value Description
job_name job-template The job name.
image busybox:latest The container image to use to run the job.
stage test The stage name for the job.

Documentation

This project includes a MVC structure to help you get started with Gitlab CI/CD components. The template provides the basic file structure to create your own single component. This project should be public, or one of the jobs in the project's pipeline won't work.

Licence

The licence can be changed. By default this project has the MIT Licence.