Add configurable LLM provider adapters for email classification
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 5m3s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 5m3s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user