← Về thư mục
openai4s/storage/delivery.py
- create_completion_delivery_schema · function · L85-L87 — def create_completion_delivery_schema(conn: sqlite3.Connection) -> None
- DeliveryConflictError · class · L90-L91 — class DeliveryConflictError(RuntimeError)
- canonical_json · function · L94-L105 — def canonical_json(value: Any) -> str
- json_sha256 · function · L108-L110 — def json_sha256(value: Any) -> str
- CompletionDeliveryRepository · class · L113-L1384 — class CompletionDeliveryRepository
- init · method · L116-L129 — def init( self, connection: sqlite3.Connection, lock: Any, *, clock_ms: Callable[[], int], id_factory: Callable[[str], str] | None = None, ) -> None
- commit_final_message · method · L131-L287 — def commit_final_message( self, *, idempotency_key: str, root_frame_id: str, branch_id: str | None, frame_id: str | None, content: str, manifest: Mapping[str, Any], message_metadata: Mapping[str, Any] | None = None, expected_manifest_sha256: str | None = None, created_at: int | None = None, snapshot_verifier: Callable[[Mapping[str, Any]], object] | None = None, ) -> dict[str, Any]
- promote_candidate_delivery · method · L289-L468 — def promote_candidate_delivery( self, *, delivery_id: str, message_id: str, root_frame_id: str, branch_id: str | None, frame_id: str | None, expected_content: str, content: str, message_metadata: Mapping[str, Any], ) -> dict[str, Any]
- bind_imported_message · method · L470-L624 — def bind_imported_message( self, *, idempotency_key: str, message_id: str, root_frame_id: str, branch_id: str | None, frame_id: str | None, expected_current_content: str, content: str, manifest: Mapping[str, Any], status: str, created_at: int, published_at: int | None = None, snapshot_verifier: Callable[[Mapping[str, Any]], object] | None = None, ) -> dict[str, Any]
- _assert_versions_visible_locked · method · L626-L714 — def _assert_versions_visible_locked( self, manifest: Mapping[str, Any], *, root_frame_id: str, snapshot_verifier: Callable[[Mapping[str, Any]], object] | None = None, ) -> list[dict[str, Any]]
- mark_published · method · L716-L770 — def mark_published( self, delivery_id: str, *, published_at: int | None = None ) -> dict[str, Any]
- get · method · L772-L775 — def get(self, delivery_id: str) -> dict[str, Any] | None
- committed · method · L777-L807 — def committed( self, *, root_frame_id: str | None = None, branch_id: str | None = None, limit: int = 1000, ) -> list[dict[str, Any]]
- reconcile_orphaned_candidates · method · L809-L862 — def reconcile_orphaned_candidates(self, *, now: int) -> list[dict[str, Any]]
- _reconcile_orphaned_candidate_locked · method · L864-L1068 — def _reconcile_orphaned_candidate_locked( self, message_id: str, *, now: int ) -> dict[str, Any] | None
- for_session · method · L1070-L1096 — def for_session( self, root_frame_id: str, *, limit: int = 10_000, ) -> list[dict[str, Any]]
- validate_message_projection · method · L1098-L1158 — def validate_message_projection( self, root_frame_id: str, messages: list[dict[str, Any]], ) -> list[dict[str, Any]]
- _chunks · method · L1161-L1165 — def _chunks(values: list[Any]) -> list[list[Any]]
- _validate_relations_locked · method · L1167-L1202 — def _validate_relations_locked(self, deliveries: list[dict[str, Any]]) -> None
- _begin · method · L1204-L1209 — def _begin(self) -> None
- _by_idempotency_key_locked · method · L1211-L1219 — def _by_idempotency_key_locked( self, key: str, root: str, branch: str ) -> dict[str, Any] | None
- _get_locked · method · L1221-L1225 — def _get_locked(self, delivery_id: str) -> dict[str, Any] | None
- _decode_and_validate_locked · method · L1227-L1230 — def _decode_and_validate_locked(self, row: sqlite3.Row) -> dict[str, Any]
- _select_sql · method · L1233-L1241 — def _select_sql() -> str
- _assert_projected_message · method · L1244-L1259 — def _assert_projected_message( cls, message: Mapping[str, Any], delivery: Mapping[str, Any], ) -> None
- _decode_projected_metadata · method · L1262-L1274 — def _decode_projected_metadata(raw: Any) -> dict[str, Any]
- _assert_equivalent · method · L1277-L1297 — def _assert_equivalent( existing: Mapping[str, Any], *, frame_id: str | None, content_sha256: str, manifest_sha256: str, message_metadata: Mapping[str, Any], ) -> None
- _canonical_message_metadata · method · L1300-L1318 — def _canonical_message_metadata( value: Mapping[str, Any] | None, ) -> dict[str, Any]
- _required_text · method · L1321-L1324 — def _required_text(name: str, value: Any) -> str
- _decode · method · L1327-L1384 — def _decode(row: sqlite3.Row) -> dict[str, Any]