flip_api.domain.schemas.private

Classes

Results

OmopData

OmopCohortResults

TrainingMetrics

One FL training/evaluation metric point. Mirrors flip-utils' flip/schemas.py (the sender).

TrainingLog

One row for POST /model/{id}/logs: free text XOR a typed round event.

ProjectApprovalBody

ProjectApproval

TrustSpecificData

AggregatedTrustFieldResult

AggregatedFieldResult

AggregatedCohortStats

FetchedAggregationData

TrustTaskResponse

Response model for a single trust task.

TaskResultInput

Input model for submitting a task result.

Module Contents

class flip_api.domain.schemas.private.Results

Bases: pydantic.BaseModel

value: str
count: int
class flip_api.domain.schemas.private.OmopData

Bases: pydantic.BaseModel

name: str
results: list[Results]
class flip_api.domain.schemas.private.OmopCohortResults

Bases: pydantic.BaseModel

query_id: uuid.UUID
trust_id: uuid.UUID
created: str
record_count: int
data: list[OmopData]
error: str | None = None
suppressed: bool = False
ensure_data_is_list(value: Any) list[Any]
class flip_api.domain.schemas.private.TrainingMetrics

Bases: pydantic.BaseModel

One FL training/evaluation metric point. Mirrors flip-utils’ flip/schemas.py (the sender).

global_round is provenance — always the FL global round the metric was reported in, never overridden. The plot coordinate is the (x_label, x_value) pair, defaulting to the global round on the “Global Rounds” axis — see FLIP#148.

fl_client_name: str
global_round: int
label: str
result: float
x_value: float
x_label: str
classmethod _default_x_value_to_global_round(data: Any) Any

Backfill a missing/None x_value from global_round (back-compat with old senders).

class flip_api.domain.schemas.private.TrainingLog

Bases: pydantic.BaseModel

One row for POST /model/{id}/logs: free text XOR a typed round event.

Mirrored in flip-utils/flip/schemas.py (the FL-side sender) — keep the two in sync. Two mutually exclusive shapes:

  • Free text (log set): exception reports and legacy messages. The text is stored and served verbatim.

  • Typed event (event_type set): a round-progress fact. Display text is composed hub-side at serve time, so the FL layer never bakes in wording.

fl_client_name is the FL kit slot when the row is trust-attributed, or None for hub-attributed rows (e.g. ROUND_STARTED). Old FL images keep sending the original {fl_client_name, log} shape — every new field is optional with a compatible default.

fl_client_name: str | None = None
log: str | None = None
event_type: str | None
global_round: int | None
details: dict[str, Any] | None = None
success: bool = True
_log_xor_event() TrainingLog
_bound_details() TrainingLog
class flip_api.domain.schemas.private.ProjectApprovalBody

Bases: pydantic.BaseModel

trusts: list[uuid.UUID]
class flip_api.domain.schemas.private.ProjectApproval

Bases: pydantic.BaseModel

project_id: uuid.UUID
trust_ids: list[uuid.UUID]
class flip_api.domain.schemas.private.TrustSpecificData

Bases: pydantic.BaseModel

record_count: int
data: list[OmopData]
error: str | None = None
suppressed: bool = False
class flip_api.domain.schemas.private.AggregatedTrustFieldResult

Bases: pydantic.BaseModel

data: Any
trust_name: str
trust_id: str
class flip_api.domain.schemas.private.AggregatedFieldResult

Bases: pydantic.BaseModel

name: str
results: list[AggregatedTrustFieldResult]
class flip_api.domain.schemas.private.AggregatedCohortStats

Bases: pydantic.BaseModel

record_count: int
trusts_results: list[AggregatedFieldResult]
trust_record_counts: dict[str, int]
trust_errors: dict[str, str]
trust_suppressed: list[str]
class flip_api.domain.schemas.private.FetchedAggregationData

Bases: pydantic.BaseModel

trust_name: list[str]
trust_id: list[str]
data: list[str]
class flip_api.domain.schemas.private.TrustTaskResponse

Bases: pydantic.BaseModel

Response model for a single trust task.

id: uuid.UUID
task_type: flip_api.domain.schemas.status.TaskType
payload: str
created_at: datetime.datetime
class flip_api.domain.schemas.private.TaskResultInput

Bases: pydantic.BaseModel

Input model for submitting a task result.

success: bool
result: str | None