← Về thư mục
openai4s/agent/ledger.py
- LedgerStore · class · L83-L94 — class LedgerStore(Protocol)
- append_action_group · method · L86-L86 — def append_action_group(self, **values: Any) -> dict
- append_action_event · method · L88-L88 — def append_action_event(self, **values: Any) -> dict
- append_tool_action_group · method · L90-L90 — def append_tool_action_group(self, **values: Any) -> dict
- append_action_group_with_events · method · L92-L92 — def append_action_group_with_events(self, **values: Any) -> dict
- list_action_groups · method · L94-L94 — def list_action_groups(self, root_frame_id: str, **filters: Any) -> list[dict]
- _key_name · function · L97-L98 — def _key_name(value: Any) -> str
- _resolve_tool · function · L105-L111 — def _resolve_tool(name: str, resolver: ToolResolver | None = None) -> Any | None
- _tool_secret_keys · function · L114-L142 — def _tool_secret_keys( name: str, resolver: ToolResolver | None = None ) -> frozenset[str]
- _redact_value · function · L145-L158 — def _redact_value(value: Any, secret_keys: frozenset[str]) -> Any
- _redact_free_text · function · L161-L186 — def _redact_free_text(text: str, secret_keys: frozenset[str]) -> str
- replace · function · L176-L183 — def replace(match: re.Match[str]) -> str
- _redact_message · function · L189-L202 — def _redact_message(message: Mapping[str, Any], keys: frozenset[str]) -> dict[str, Any]
- _redact_raw_arguments · function · L205-L220 — def _redact_raw_arguments(raw: Any, secret_keys: frozenset[str]) -> Any
- redact_tool_call · function · L223-L236 — def redact_tool_call( call: NativeToolCall, tool_resolver: ToolResolver | None = None, ) -> tuple[dict[str, Any], Any]
- _sanitize_reply · function · L239-L269 — def _sanitize_reply( reply: ModelReply, tool_resolver: ToolResolver | None = None, ) -> tuple[dict[str, Any], dict[str, Any]]
- _redact_embedded_argument_json · function · L272-L285 — def _redact_embedded_argument_json(value: Any, keys: frozenset[str]) -> Any
- _tool_policy · function · L288-L301 — def _tool_policy( name: str, arguments: Any, resolver: ToolResolver | None = None, ) -> tuple[str, list[str]]
- RuntimeActionLedger · class · L305-L724 — class RuntimeActionLedger
- append_user · method · L323-L337 — def append_user(self, message: Mapping[str, Any] | Any) -> dict
- emit · method · L339-L356 — def emit(self, event: AgentEvent) -> None
- _append_action · method · L358-L485 — def _append_action( self, action: CodeCell | NativeToolBatch | FinalizeAction | None ) -> None
- _record_team_usage · method · L487-L503 — def _record_team_usage(self, usage: dict[str, int] | None) -> None
- record_abandoned_usage · method · L505-L513 — def record_abandoned_usage(self, usage: Mapping[str, Any] | None) -> None
- _canonical_usage · method · L527-L560 — def _canonical_usage(cls, source: Any) -> dict[str, int] | None
- _reply_accounting · method · L562-L579 — def _reply_accounting( self, reply: ModelReply ) -> tuple[dict[str, int] | None, float | None]
- _append_outcome · method · L581-L635 — def _append_outcome(self, event: OutcomeProduced) -> None
- append_terminal · method · L637-L673 — def append_terminal( self, reason: str, *, completion: Any = None, error: Any = None, progress_reason: Any = None, ) -> dict | None
- append_compaction · method · L675-L712 — def append_compaction( self, handoff: str, covered_through_group_id: str | None, archive_id: str | None = None, ) -> dict
- covered_through_group_id · method · L714-L724 — def covered_through_group_id(self, compacted_messages: Sequence[Any]) -> str | None
- _terminal_reasons · function · L727-L736 — def _terminal_reasons(groups: Sequence[Mapping[str, Any]]) -> dict[str, str]
- _call_from_mapping · function · L739-L764 — def _call_from_mapping(value: Mapping[str, Any], ordinal: int) -> NativeToolCall
- _synthetic_tool_result · function · L767-L786 — def _synthetic_tool_result( call: NativeToolCall, *, cancelled: bool, detail: str | None = None, ) -> dict[str, Any]
- _compaction_event_fields · function · L789-L800 — def _compaction_event_fields(group: Mapping[str, Any]) -> tuple[str | None, str]
- _apply_compaction · function · L803-L855 — def _apply_compaction( history: list[tuple[int, dict[str, Any]]], note_index: int, covered_index: int, handoff: str, ) -> list[tuple[int, dict[str, Any]]]
- _reduce_action_groups_annotated · function · L858-L985 — def _reduce_action_groups_annotated( groups: Sequence[Mapping[str, Any]], ) -> list[tuple[int, dict[str, Any]]]
- _same_message · function · L988-L1004 — def _same_message(reconstructed: Mapping[str, Any], live: Any) -> bool
- compaction_cover_group_id · function · L1007-L1056 — def compaction_cover_group_id( groups: Sequence[Mapping[str, Any]], compacted_messages: Sequence[Any], ) -> str | None
- reduce_action_groups · function · L1059-L1071 — def reduce_action_groups(groups: Sequence[Mapping[str, Any]]) -> list[dict[str, Any]]
- branch_action_groups · function · L1074-L1104 — def branch_action_groups( store: LedgerStore, root_frame_id: str, *, branch_id: str | None = None, ) -> list[dict[str, Any]]
- restore_action_history · function · L1107-L1117 — def restore_action_history( store: LedgerStore, root_frame_id: str, *, branch_id: str | None = None, ) -> list[dict[str, Any]]
- restore_progress_circuit · function · L1120-L1170 — def restore_progress_circuit( store: LedgerStore, root_frame_id: str, *, branch_id: str | None = None, ) -> Any
- new_turn_id · function · L1173-L1174 — def new_turn_id() -> str