← Về thư mục
openai4s/storage/artifacts.py
- ArtifactDeliveryReferenceError · class · L48-L49 — class ArtifactDeliveryReferenceError(RuntimeError)
- _legacy_mode_verdict · function · L58-L60 — def _legacy_mode_verdict(kind: str) -> str
- file_identity · function · L63-L69 — def file_identity(path: str) -> str | None
- same_file_path · function · L72-L82 — def same_file_path(left: str, right: str) -> bool
- env_snapshot_id · function · L85-L131 — def env_snapshot_id( *, kind: Any, python_version: Any, implementation: Any, platform: Any, interpreter: Any, environment_name: Any, generation_id: Any, packages_json: str, remote_json: str, ) -> str
- _encode_source · function · L134-L150 — def _encode_source(source: Any) -> str | None
- ArtifactRepository · class · L153-L2082 — class ArtifactRepository
- init · method · L156-L186 — def init( self, connection: sqlite3.Connection, lock: Any, *, clock_ms: Clock, get_frame: GetFrame, resolve_frame_scope: ResolveFrameScope, resolve_artifact_write_scope: ResolveArtifactWriteScope | None = None, execute: Execute | None = None, get_artifact: GetArtifact | None = None, get_env_snapshot: GetEnvironmentSnapshot | None = None, identify_file: FileIdentity | None = None, paths_match: SameFilePath | None = None, delete_related: DeleteArtifactRelated | None = None, ) -> None
- get_artifact · method · L188-L196 — def get_artifact(self, artifact_id: str) -> dict | None
- delete_artifact · method · L198-L294 — def delete_artifact(self, artifact_id: str) -> list[str]
- rename_artifact · method · L296-L307 — def rename_artifact(self, artifact_id: str, filename: str) -> None
- artifact_by_filename · method · L309-L332 — def artifact_by_filename( self, filename: str, root_frame_id: str | None = None, *, strict: bool = False, ) -> dict | None
- artifact_by_unique_filename · method · L334-L365 — def artifact_by_unique_filename( self, filename: str, root_frame_id: str | None = None ) -> dict | None
- artifact_by_scope_filename · method · L367-L386 — def artifact_by_scope_filename( self, filename: str, *, root_frame_id: str | None, project_id: str, ) -> dict | None
- artifact_write_scope · method · L388-L413 — def artifact_write_scope( self, *, frame_id: str | None, root_frame_id: str | None, project_id: str | None, ) -> tuple[bool, str | None, str]
- save_artifact · method · L415-L527 — def save_artifact( self, *, path: str, filename: str, content_type: str | None, size_bytes: int, checksum: str | None, producing_cell_id: str | None = None, frame_id: str | None = None, root_frame_id: str | None = None, project_id: str | None = None, artifact_id: str | None = None, is_user_upload: bool = False, priority: int = 0, env_snapshot_id: str | None = None, snapshot_path: str | None = None, source: Any = None, ) -> dict
- commit_artifact_upload · method · L529-L686 — def commit_artifact_upload( self, *, path: str, filename: str, content_type: str | None, size_bytes: int, checksum: str, frame_id: str | None, project_id: str | None, artifact_id: str | None, expected_previous_version_id: str | None, expected_previous_updated_at: int | None, publish: PublishUpload, ) -> dict
- rollback_artifact_upload · method · L688-L774 — def rollback_artifact_upload( self, *, artifact_id: str, version_id: str, previous_version_id: str | None, previous_updated_at: int | None, previous_filename: str | None, previous_content_type: str | None, ) -> bool
- record_cell_artifact · method · L776-L1143 — def record_cell_artifact( self, *, path: str, filename: str, content_type: str | None, size_bytes: int, checksum: str | None, producing_cell_id: str | None, frame_id: str | None, root_frame_id: str | None = None, project_id: str | None = None, env_snapshot_id: str | None = None, snapshot_path: str | None = None, input_version_ids: list[str] | tuple[str, ...] | None = None, source: Any = None, preserve_filename: bool = False, preserve_content_type: bool = False, reuse_policy: str = "any", reuse_matching_head: bool = False, ) -> dict
- materialise_artifact_version · method · L1145-L1313 — def materialise_artifact_version( self, *, source_version_id: str, artifact_id: str, version_id: str, filename: str, path: str, snapshot_path: str | None, frame_id: str | None, root_frame_id: str, project_id: str, producing_cell_id: str | None = None, publish: PublishUpload | None = None, ) -> dict
- record_artifact_restore · method · L1315-L1461 — def record_artifact_restore( self, *, artifact_id: str, source_version_id: str, expected_latest_version_id: str, version_id: str, path: str, snapshot_path: str | None, size_bytes: int, checksum: str, frame_id: str | None, root_frame_id: str | None = None, project_id: str | None = None, publish: PublishUpload | None = None, ) -> dict
- upsert_env_snapshot · method · L1463-L1523 — def upsert_env_snapshot(self, snapshot: dict) -> str
- delete_env_snapshots_if_unreferenced · method · L1525-L1546 — def delete_env_snapshots_if_unreferenced(self, snapshot_ids) -> int
- get_env_snapshot · method · L1548-L1567 — def get_env_snapshot(self, snapshot_id: str) -> dict | None
- _read_legacy_python_kernel · method · L1569-L1616 — def _read_legacy_python_kernel(self, snapshot: dict) -> None
- env_snapshot_for_artifact · method · L1618-L1636 — def env_snapshot_for_artifact( self, artifact_id: str, version_id: str | None = None ) -> dict | None
- list_artifacts · method · L1638-L1663 — def list_artifacts(self, filters: dict | None = None) -> list[dict]
- browse_artifacts · method · L1665-L1735 — def browse_artifacts( self, *, project_id: str, filename_query: str | None = None, content_type: str | None = None, origin: str | None = None, before: tuple[int, str] | None = None, limit: int = 50, visible_to_user_id: str | None = None, ) -> list[dict]
- list_artifact_names · method · L1737-L1749 — def list_artifact_names(self) -> list[dict]
- artifact_names_for_frame · method · L1751-L1773 — def artifact_names_for_frame(self, frame_id: str) -> list[str]
- resolve_artifact_path · method · L1775-L1790 — def resolve_artifact_path(self, ident: str) -> str | None
- version_for_path · method · L1792-L1856 — def version_for_path( self, path: str, *, root_frame_id: str | None, project_id: str ) -> str | None
- version_meta · method · L1858-L1863 — def version_meta(self, version_id: str) -> dict | None
- set_version_source · method · L1865-L1874 — def set_version_source(self, version_id: str, source: Any) -> None
- list_capture_observations · method · L1876-L1887 — def list_capture_observations( self, *, artifact_id: str | None = None, version_id: str | None = None, ) -> list[dict]
- capture_observation_cursor · method · L1889-L1899 — def capture_observation_cursor( self, *, root_frame_id: str | None = None, project_id: str | None = None, ) -> int
- capture_observations_since · method · L1901-L1921 — def capture_observations_since( self, cursor: int, *, root_frame_id: str | None, project_id: str, limit: int = MAX_DELIVERY_OBSERVATIONS, ) -> list[dict]
- list_versions · method · L1923-L1948 — def list_versions(self, artifact_id: str) -> list[dict]
- update_version_path · method · L1950-L1969 — def update_version_path( self, version_id: str, path: str, size_bytes: int | None = None, checksum: str | None = None, ) -> None
- set_version_snapshot · method · L1971-L1975 — def set_version_snapshot(self, version_id: str, snapshot_path: str) -> None
- set_priority · method · L1977-L1982 — def set_priority(self, artifact_id: str, priority: int) -> dict | None
- set_latest_version · method · L1984-L1998 — def set_latest_version(self, artifact_id: str, version_id: str) -> dict | None
- add_lineage_edge · method · L2000-L2020 — def add_lineage_edge( self, *, input_version_id: str, output_version_id: str, producing_cell_id: str | None = None, frame_id: str | None = None, ) -> None
- lineage_inputs · method · L2022-L2051 — def lineage_inputs( self, version_id: str, *, producing_cell_id: str | None = None, ) -> list[dict]
- lineage_edges_for · method · L2053-L2062 — def lineage_edges_for(self, version_id: str, direction: str) -> list[dict]
- producing_cell_for_version · method · L2064-L2074 — def producing_cell_for_version(self, version_id: str) -> dict | None
- _execute · method · L2076-L2082 — def _execute(self, sql: str, params: tuple = ()) -> None