Task 1: Create standalone FastAPI service scaffold with models, test framework, and documentation. Includes ParseRequest, ParseResponse Pydantic models matching OllamaExtraction contract, plus three passing tests validating model validation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
381 B
Python
18 lines
381 B
Python
from __future__ import annotations
|
|
from typing import Literal
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class ParseRequest(BaseModel):
|
|
query: str
|
|
lang: Literal["de", "en", "es"]
|
|
|
|
|
|
class ParseResponse(BaseModel):
|
|
personNames: list[str]
|
|
personRole: Literal["sender", "receiver", "any"]
|
|
dateFrom: str | None
|
|
dateTo: str | None
|
|
keywords: list[str]
|
|
rawQuery: str
|