All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 5m3s
29 lines
762 B
Python
29 lines
762 B
Python
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
|