← Về thư mục
openai4s/host/data.py
- HostDataStore · class · L30-L118 — class HostDataStore(Protocol)
- query · method · L33-L33 — def query(self, sql: str, *, params=None, limit=None, timeout_s=5.0)
- schema · method · L35-L35 — def schema(self) -> dict
- list_artifacts · method · L37-L37 — def list_artifacts(self, filters: dict | None = None) -> list[dict]
- get_artifact · method · L39-L39 — def get_artifact(self, artifact_id: str) -> dict | None
- list_versions · method · L41-L41 — def list_versions(self, artifact_id: str) -> list[dict]
- resolve_frame_scope · method · L43-L43 — def resolve_frame_scope(self, frame_id: str | None) -> dict
- resolve_artifact_path · method · L45-L45 — def resolve_artifact_path(self, ident: str) -> str | None
- record_cell_artifact · method · L47-L47 — def record_cell_artifact(self, **fields: Any) -> dict
- record_artifact_restore · method · L49-L49 — def record_artifact_restore(self, **fields: Any) -> dict
- version_meta · method · L51-L51 — def version_meta(self, version_id: str) -> dict | None
- set_version_snapshot · method · L53-L53 — def set_version_snapshot(self, version_id: str, snapshot_path: str) -> None
- materialise_artifact_version · method · L55-L69 — def materialise_artifact_version( self, *, source_version_id: str, artifact_id: str, version_id: str, filename: str, path: str, snapshot_path: str, frame_id: str | None, root_frame_id: str, project_id: str, producing_cell_id: str | None = None, publish: Callable[[str, str], str] | None = None, ) -> dict
- set_priority · method · L71-L71 — def set_priority(self, artifact_id: str, priority: int) -> dict | None
- frame_detail · method · L73-L80 — def frame_detail( self, frame_id: str, *, page: int, page_size: int, visible_to_user_id: str | None = ..., )
- search_frames · method · L82-L89 — def search_frames( self, pattern: str, *, project_id: str, limit: int, visible_to_user_id: str | None = ..., )
- browse_frames · method · L91-L99 — def browse_frames( self, *, project_id: str, status: str | None, roots_only: bool, limit: int, visible_to_user_id: str | None = ..., )
- producing_cell_for_version · method · L101-L101 — def producing_cell_for_version(self, version_id: str) -> dict | None
- lineage_inputs · method · L103-L105 — def lineage_inputs( self, version_id: str, *, producing_cell_id: str | None = None ) -> list[dict]
- list_artifact_capture_observations · method · L107-L112 — def list_artifact_capture_observations( self, *, artifact_id: str | None = None, version_id: str | None = None, ) -> list[dict]
- lineage_edges_for · method · L114-L114 — def lineage_edges_for(self, version_id: str, direction: str) -> list[dict]
- version_for_path · method · L116-L118 — def version_for_path( self, path: str, *, root_frame_id: str | None, project_id: str ) -> str | None
- _artifact_directory_flags · function · L164-L179 — def _artifact_directory_flags() -> int
- _require_artifact_dirfd · function · L182-L190 — def _require_artifact_dirfd() -> None
- _artifact_inode · function · L193-L194 — def _artifact_inode(metadata: os.stat_result) -> tuple[int, int]
- _artifact_file_state · function · L197-L207 — def _artifact_file_state( metadata: os.stat_result, ) -> tuple[int, int, int, int, int, int]
- _PinnedArtifactDirectory · class · L210-L352 — class _PinnedArtifactDirectory
- init · method · L220-L228 — def init(self, descriptor: int, *, root: Path, parts: tuple[str, ...])
- enter · method · L230-L231 — def enter(self) -> _PinnedArtifactDirectory
- exit · method · L233-L234 — def exit(self, *_args: Any) -> None
- close · method · L236-L239 — def close(self) -> None
- _component · method · L242-L251 — def _component(name: str) -> str
- open_under · method · L254-L298 — def open_under( cls, root: Path, parts: tuple[str, ...], *, create: bool, ) -> _PinnedArtifactDirectory
- assert_current · method · L300-L303 — def assert_current(self) -> None
- lstat · method · L305-L310 — def lstat(self, name: str) -> os.stat_result
- open_read · method · L312-L320 — def open_read(self, name: str) -> int
- create_exclusive · method · L322-L332 — def create_exclusive(self, name: str) -> int
- replace · method · L334-L342 — def replace(self, source: str, destination: str) -> None: # POSIX rename atomically replaces a non-directory destination. Both # names are interpreted relative to this already-pinned directory.
- unlink · method · L344-L349 — def unlink(self, name: str, *, missing_ok: bool = False) -> None
- fsync · method · L351-L352 — def fsync(self) -> None
- kernel_artifact_input_dir · function · L355-L370 — def kernel_artifact_input_dir( data_dir: Path | str, root_frame_id: str, ) -> Path
- rank_artifacts · function · L373-L394 — def rank_artifacts(items: list[dict], query: str) -> list[dict]
- HostDataService · class · L397-L1883 — class HostDataService
- init · method · L400-L421 — def init( self, *, store: HostDataStore | StoreProvider, config: Any | ConfigProvider, frame_id: str | None | FrameIdProvider, resolve_path: PathResolver, restore_artifact: ArtifactRestorer | None = None, materialise_artifact: ArtifactMaterialiser | None = None, artifact_writer: ArtifactWriter | None = None, ) -> None
- _store · method · L423-L425 — def _store(self) -> HostDataStore
- _config · method · L427-L429 — def _config(self) -> Any
- _frame_id · method · L431-L433 — def _frame_id(self) -> str | None
- _trusted_delivery_enabled · method · L435-L437 — def _trusted_delivery_enabled(self) -> bool
- _freeze_snapshot · method · L440-L517 — def _freeze_snapshot(source: Path, destination: Path) -> tuple[str, int]
- query · method · L519-L537 — def query(self, spec: dict) -> Any
- query_schema · method · L539-L540 — def query_schema(self) -> dict
- artifacts · method · L542-L560 — def artifacts(self, filters: dict | None = None) -> dict
- _scoped_artifact · method · L562-L585 — def _scoped_artifact(self, artifact_id: str) -> dict
- _scoped_version · method · L587-L620 — def _scoped_version(self, version_id: str) -> dict
- _artifact_metadata_projection · method · L623-L636 — def _artifact_metadata_projection(artifact: dict) -> dict
- _version_metadata_projection · method · L639-L664 — def _version_metadata_projection( version: dict, *, latest_version_id: str | None, ) -> dict
- artifact_metadata · method · L666-L684 — def artifact_metadata(self, spec: dict) -> dict
- artifact_versions · method · L686-L706 — def artifact_versions(self, spec: dict) -> dict
- restore_artifact_version · method · L708-L729 — def restore_artifact_version(self, spec: dict) -> dict
- restore_artifact_exact · method · L731-L735 — def restore_artifact_exact(self, artifact_id: str, version_id: str) -> dict
- set_artifact_restorer · method · L737-L749 — def set_artifact_restorer( self, restore: ArtifactRestorer | None, *, materialise: ArtifactMaterialiser | None = None, writer: ArtifactWriter | None = None, ) -> None
- _default_artifact_manager · method · L751-L791 — def _default_artifact_manager(self)
- _default_artifact_restorer · method · L793-L796 — def _default_artifact_restorer(self) -> ArtifactRestorer
- _version_integrity · method · L799-L812 — def _version_integrity(metadata: dict) -> tuple[str, int]
- _version_cache_name · method · L815-L819 — def _version_cache_name(version_id: str, metadata: dict) -> str
- _descriptor_digest · method · L822-L835 — def _descriptor_digest(descriptor: int, *, expected_size: int) -> tuple[str, int]
- _cache_usage · method · L838-L864 — def _cache_usage( directory: _PinnedArtifactDirectory, *, entry_limit: int, quota_message: str, ) -> tuple[int, int]
- _global_cache_usage · method · L867-L922 — def _global_cache_usage(data_root: Path) -> tuple[int, int]
- _enforce_stage_quota · method · L925-L973 — def _enforce_stage_quota( data_root: Path, destination: _PinnedArtifactDirectory, cache_name: str, *, size_bytes: int, ) -> None
- _cache_is_exact · method · L976-L1017 — def _cache_is_exact( directory: _PinnedArtifactDirectory, name: str, *, checksum: str, size_bytes: int, ) -> bool
- _artifact_source · method · L1019-L1070 — def _artifact_source( self, metadata: dict, *, require_snapshot: bool, ) -> tuple[Path, tuple[str, ...]]
- _copy_exact_version · method · L1073-L1134 — def _copy_exact_version( source: _PinnedArtifactDirectory, source_name: str, destination: _PinnedArtifactDirectory, pending_name: str, *, checksum: str, size_bytes: int, ) -> None
- _stage_artifact_version · method · L1136-L1241 — def _stage_artifact_version( self, version_id: str, metadata: dict, *, require_snapshot: bool, ) -> str
- artifact_path · method · L1243-L1264 — def artifact_path(self, version_id: str) -> str
- artifact_snapshot_path · method · L1266-L1286 — def artifact_snapshot_path(self, version_id: str) -> str
- materialise_artifact · method · L1288-L1299 — def materialise_artifact(self, spec: dict) -> dict
- _materialise_artifact_locked · method · L1301-L1404 — def _materialise_artifact_locked( self, spec: dict, *, materialise: ArtifactMaterialiser ) -> dict
- _scoped_lineage_inputs · method · L1406-L1434 — def _scoped_lineage_inputs(self, raw: Any) -> list[str]
- save_artifact · method · L1436-L1499 — def save_artifact(self, spec: dict) -> dict: # Before the copy: a refused lineage declaration must not leave a file in # the artifacts directory that no row will ever name.
- view_image · method · L1501-L1528 — def view_image(self, spec: dict) -> dict
- artifact_marker · method · L1530-L1539 — def artifact_marker(self, version_id: str) -> str
- frames · method · L1541-L1592 — def frames(self, spec: dict | None = None) -> Any
- _session_visible · method · L1594-L1614 — def _session_visible(self, store: Any, root_frame_id: str) -> bool
- _visibility_filter · method · L1616-L1627 — def _visibility_filter(self) -> str | None
- lineage_get · method · L1629-L1673 — def lineage_get(self, version_id: str) -> dict
- lineage_graph · method · L1675-L1728 — def lineage_graph(self, spec: dict) -> dict
- provenance_resolve_path · method · L1730-L1764 — def provenance_resolve_path(self, path: str) -> Any
- _digest_file · method · L1770-L1788 — def _digest_file(path: Path) -> tuple[str, int]
- provenance_record · method · L1790-L1883 — def provenance_record(self, spec: dict) -> dict