20 lines
529 B
Python
20 lines
529 B
Python
"""Explicit, bounded selection of immutable experiment history."""
|
|
|
|
from uuid import UUID
|
|
|
|
from pydantic import Field, field_validator
|
|
|
|
from app.schemas.catalog import Input
|
|
|
|
|
|
class ExportHistory(Input):
|
|
run_ids: list[UUID] = Field(min_length=1, max_length=100)
|
|
include_contexts: bool = Field(False, strict=True)
|
|
|
|
@field_validator("run_ids")
|
|
@classmethod
|
|
def unique_ids(cls, value):
|
|
if len(value) != len(set(value)):
|
|
raise ValueError("检索记录编号不得重复")
|
|
return value
|