mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-04-27 00:56:21 +02:00
feat: add PageIndex SDK with local/cloud dual-mode support (#207)
This commit is contained in:
parent
f2dcffc0b7
commit
c7fe93bb56
45 changed files with 4225 additions and 274 deletions
18
pageindex/storage/protocol.py
Normal file
18
pageindex/storage/protocol.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from __future__ import annotations
|
||||
from typing import Protocol, runtime_checkable
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class StorageEngine(Protocol):
|
||||
def create_collection(self, name: str) -> None: ...
|
||||
def get_or_create_collection(self, name: str) -> None: ...
|
||||
def list_collections(self) -> list[str]: ...
|
||||
def delete_collection(self, name: str) -> None: ...
|
||||
def save_document(self, collection: str, doc_id: str, doc: dict) -> None: ...
|
||||
def find_document_by_hash(self, collection: str, file_hash: str) -> str | None: ...
|
||||
def get_document(self, collection: str, doc_id: str) -> dict: ...
|
||||
def get_document_structure(self, collection: str, doc_id: str) -> list: ...
|
||||
def get_pages(self, collection: str, doc_id: str) -> list | None: ...
|
||||
def list_documents(self, collection: str) -> list[dict]: ...
|
||||
def delete_document(self, collection: str, doc_id: str) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
Loading…
Add table
Add a link
Reference in a new issue