Initial public release
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Literal
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from app.schemas.operations import VectorSelectionBBox
|
||||
|
||||
|
||||
class AssistantChatMessage(BaseModel):
|
||||
role: Literal["user", "assistant"]
|
||||
content: str = Field(min_length=1, max_length=4_000)
|
||||
|
||||
|
||||
class AssistantQueryRequest(BaseModel):
|
||||
question: str = Field(min_length=2, max_length=2_000)
|
||||
model: str | None = Field(default=None, max_length=255)
|
||||
bbox: VectorSelectionBBox | None = None
|
||||
area_id: UUID | None = None
|
||||
history: list[AssistantChatMessage] = Field(default_factory=list, max_length=8)
|
||||
|
||||
|
||||
class AssistantModelRead(BaseModel):
|
||||
name: str
|
||||
size_bytes: int | None = None
|
||||
parameter_size: str | None = None
|
||||
quantization_level: str | None = None
|
||||
capabilities: list[str] = Field(default_factory=list)
|
||||
|
||||
|
||||
class AssistantModelList(BaseModel):
|
||||
items: list[AssistantModelRead]
|
||||
total: int
|
||||
default_model: str | None = None
|
||||
|
||||
|
||||
class AssistantStatus(BaseModel):
|
||||
enabled: bool
|
||||
reachable: bool
|
||||
status: str
|
||||
base_url: str
|
||||
default_model: str | None = None
|
||||
model_count: int = 0
|
||||
limitation_message: str
|
||||
|
||||
|
||||
class AssistantContextMetric(BaseModel):
|
||||
theme: str
|
||||
label: str
|
||||
value: float
|
||||
unit: str
|
||||
source: str
|
||||
dataset_id: UUID
|
||||
observed_at: datetime | None = None
|
||||
is_estimate: bool = False
|
||||
|
||||
|
||||
class AssistantTemporalSeries(BaseModel):
|
||||
temporal_series_key: str
|
||||
label: str
|
||||
source: str
|
||||
first_year: int
|
||||
last_year: int
|
||||
observation_count: int
|
||||
|
||||
|
||||
class AssistantEstimateDisclosure(BaseModel):
|
||||
"""A value in the answer that the source itself calls an estimate.
|
||||
|
||||
Derived from metric metadata rather than from the generated sentences, so
|
||||
the disclosure is present whatever wording the model chose.
|
||||
"""
|
||||
|
||||
theme: str
|
||||
label: str
|
||||
unit: str
|
||||
source: str
|
||||
dataset_id: UUID
|
||||
reason: str
|
||||
|
||||
|
||||
class AssistantQueryResponse(BaseModel):
|
||||
answer: str
|
||||
model: str
|
||||
scope_label: str
|
||||
context_metrics: list[AssistantContextMetric]
|
||||
temporal_series: list[AssistantTemporalSeries]
|
||||
estimate_disclosures: list[AssistantEstimateDisclosure] = Field(default_factory=list)
|
||||
source_dataset_ids: list[UUID]
|
||||
warnings: list[str]
|
||||
generated_at: datetime
|
||||
Reference in New Issue
Block a user