← Về thư mục
openai4s/storage/frames.py
- visible_session_clause · function · L26-L92 — def visible_session_clause( user_id: str, *, table: str = "frames", session_expr: str | None = None ) -> tuple[str, list]
- project_filter_fingerprint · function · L100-L107 — def project_filter_fingerprint(*, q: str, team_scope: str) -> str
- encode_project_cursor · function · L110-L124 — def encode_project_cursor( *, last_active_at: int | None, project_id: str, fingerprint: str, ) -> str
- decode_project_cursor · function · L127-L164 — def decode_project_cursor( value: str | None, *, fingerprint: str ) -> tuple[int | None, str] | None
- _project_listing_filters · function · L167-L214 — def _project_listing_filters( *, q: str | None, visible_to_user_id: str | None, before: tuple[int | None, str] | None = None, alias: str = "p", activity_alias: str = "a", ) -> tuple[list[str], list[Any]]
- FrameRepository · class · L226-L1596 — class FrameRepository
- init · method · L234-L250 — def init( self, connection: sqlite3.Connection, lock: Any, *, clock_ms: Callable[[], int], get_frame: Callable[[str], dict | None] | None = None, resolve_frame_scope: Callable[..., dict] | None = None, get_project: Callable[[str], dict | None] | None = None, ) -> None
- new_frame · method · L253-L301 — def new_frame( self, *, parent_id: str | None = None, project_id: str = "default", kind: str = "turn", name: str | None = None, model: str | None = None, depth: int = 0, status: str = "processing", ) -> str
- resolve_frame_scope · method · L303-L341 — def resolve_frame_scope( self, frame_id: str | None, *, fallback_project: str = "default", ) -> dict
- unpin_model · method · L343-L358 — def unpin_model(self, frame_id: str) -> None
- release_model_binding · method · L360-L388 — def release_model_binding(self, profile_id: str) -> int
- update_frame · method · L390-L398 — def update_frame(self, frame_id: str, **fields: Any) -> None
- add_frame_tokens · method · L400-L421 — def add_frame_tokens( self, frame_id: str, *, input_tokens: int = 0, output_tokens: int = 0, cost_usd: float = 0.0, ) -> None
- create_project · method · L424-L449 — def create_project( self, *, name: str, description: str = "", context: str = "", project_id: str | None = None, is_example: bool = False, ) -> dict
- get_project · method · L451-L457 — def get_project(self, project_id: str) -> dict | None
- update_project · method · L459-L467 — def update_project(self, project_id: str, **fields: Any) -> None
- delete_project · method · L469-L470 — def delete_project(self, project_id: str) -> dict
- project_session_ids · method · L472-L473 — def project_session_ids(self, project_id: str) -> list[str]
- list_projects · method · L475-L528 — def list_projects( self, *, q: str | None = None, limit: int | None = None, offset: int | None = None, before: tuple[int | None, str] | None = None, visible_to_user_id: str | None = None, ) -> list[dict]
- count_projects · method · L530-L545 — def count_projects( self, *, q: str | None = None, visible_to_user_id: str | None = None, ) -> int
- add_message · method · L548-L592 — def add_message( self, *, root_frame_id: str, branch_id: str | None = None, role: str, content: str, frame_id: str | None = None, metadata: dict | None = None, created_at: int | None = None, ) -> dict
- update_message_metadata · method · L594-L626 — def update_message_metadata(self, message_id: str, patch: dict) -> dict | None
- promote_candidate_message · method · L628-L805 — def promote_candidate_message( self, *, message_id: str, root_frame_id: str, branch_id: str, frame_id: str | None, expected_content: str, content: str, metadata: Mapping[str, Any], ) -> dict
- list_messages · method · L807-L861 — def list_messages( self, root_frame_id: str, *, branch_id: str | None = None, start: int = 0, limit: int | None = 300, before_seq: int | None = None, newest_first: bool = False, ) -> list[dict]
- list_message_boundaries · method · L863-L898 — def list_message_boundaries( self, root_frame_id: str, *, branch_id: str | None = None, start: int = 0, limit: int | None = 300, ) -> list[dict]
- message_count · method · L900-L906 — def message_count(self, root_frame_id: str) -> int
- has_message_history · method · L908-L912 — def has_message_history(self) -> bool
- has_execution_history · method · L914-L924 — def has_execution_history(self) -> bool
- cell_count · method · L926-L932 — def cell_count(self, root_frame_id: str) -> int
- latest_state_revision · method · L934-L956 — def latest_state_revision(self, root_frame_id: str) -> int
- add_step · method · L959-L997 — def add_step( self, *, step_id: str, frame_id: str, kind: str, title: str | None = None, input: dict | None = None, status: str = "running", ) -> dict
- update_step · method · L999-L1030 — def update_step( self, step_id: str, *, status: str | None = None, output: dict | None = None, title: str | None = None, summary: str | None = None, ) -> None
- list_steps · method · L1032-L1057 — def list_steps( self, frame_id: str, *, start: int = 0, limit: int = 800, ) -> list[dict]
- _read_legacy_capture_environments · method · L1059-L1138 — def _read_legacy_capture_environments(self, steps: list[dict]) -> None
- step_count · method · L1140-L1146 — def step_count(self, frame_id: str) -> int
- browse_frames · method · L1149-L1200 — def browse_frames( self, *, project_id: str | None = "default", status: str | None = None, roots_only: bool = True, limit: int = 50, before: tuple[int, str] | None = None, visible_to_user_id: str | None = None, ) -> list[dict]
- frame_detail · method · L1202-L1258 — def frame_detail( self, frame_id: str, *, page: int = 0, page_size: int = 50, visible_to_user_id: str | None = None, ) -> dict | None
- search_frames · method · L1260-L1315 — def search_frames( self, pattern: str, *, project_id: str | None = "default", limit: int = 50, visible_to_user_id: str | None = None, ) -> list[dict]
- log_cell · method · L1318-L1441 — def log_cell( self, *, frame_id: str | None, code: str, result: dict, origin: str = "agent", cell_seq: int | None = None, project_id: str = "default", root_frame_id: str | None = None, cell_index: int | None = None, state_revision: int | None = None, kernel_id: str = "python", language: str = "python", visibility: str | None = None, pin: bool = False, replay_policy: str | None = None, figures: list | None = None, files_read: list | None = None, files_written: list | None = None, generation_id: str | None = None, ) -> str
- list_cells · method · L1443-L1508 — def list_cells( self, root_frame_id: str, *, branch_id: str | None = None ) -> list[dict]
- list_cell_outputs · method · L1510-L1534 — def list_cell_outputs(self, root_frame_id: str) -> list[dict]
- cell_detail · method · L1536-L1578 — def cell_detail(self, producing_cell_id: str) -> dict | None: # Aliased apart from the raw column:
e.* now expands to a # generation_id of its own, and sqlite3.Row resolves a duplicated # name to the first (raw) column — which would shadow the # attempt-derived binding for Web cells.
- delete_frame · method · L1580-L1583 — def delete_frame(self, frame_id: str) -> dict[str, Any]
- get_frame · method · L1585-L1591 — def get_frame(self, frame_id: str) -> dict | None
- _execute · method · L1593-L1596 — def _execute(self, sql: str, params: tuple = ()) -> None