Add configurable LLM provider adapters for email classification
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 5m3s

This commit is contained in:
Steve W
2026-04-09 17:36:46 +00:00
parent 9ed41a3dff
commit 7c9d851a9a
9 changed files with 426 additions and 149 deletions

View File

@@ -1,5 +1,28 @@
from pydantic import BaseModel
from __future__ import annotations
from typing import Literal
from pydantic import BaseModel, Field
class EmailData(BaseModel):
subject: str
body: str
class ClassifyRequest(BaseModel):
email_data: EmailData
provider: Literal["openai", "anthropic"] | None = None
model: str | None = None
base_url: str | None = None
api_key: str | None = Field(default=None, exclude=True)
temperature: float | None = None
class ClassificationResult(BaseModel):
needs_action: bool
category: Literal["action_required", "question", "fyi", "newsletter", "promotional", "automated", "alert", "uncategorized"]
priority: Literal["high", "medium", "low"]
task_description: str | None = None
reasoning: str
confidence: float