← Về thư mục
openai4s/server/auto_budget.py
- execution_action_group · function · L108-L118 — def execution_action_group(base: Any, invocation_id: Any = None) -> str
- canonical_action_fingerprint · function · L121-L144 — def canonical_action_fingerprint( *, kind: str, name: str = "", arguments: Any = None, source: str | None = None, ) -> str
- finding_set_digest · function · L147-L152 — def finding_set_digest(fingerprints: Any) -> str
- verifiable_token_usage · function · L155-L176 — def verifiable_token_usage(usage: Any) -> int | None
- token_upper_bound · function · L179-L249 — def token_upper_bound( adapter_cfg: Any, *, messages: Any = None, tools: Any = None, max_tokens: int | None = None, ) -> int | None
- value · function · L198-L201 — def value(name: str) -> Any
- nodes · function · L239-L244 — def nodes(item: Any) -> int
- inspect_budget_wiring · function · L252-L309 — def inspect_budget_wiring() -> dict[str, Any]
- user_truth_for · function · L312-L315 — def user_truth_for(reason: str | None) -> str | None
- is_completion_disguise · function · L318-L323 — def is_completion_disguise(status: Any, reason: Any) -> bool
- AutoBudgetAdmission · class · L326-L701 — class AutoBudgetAdmission
- init · method · L329-L331 — def init(self, store: Any, budgets: AutoModeBudgets | None = None) -> None
- available · method · L333-L334 — def available(self) -> bool
- token_phase_active · method · L336-L362 — def token_phase_active(self, run_id: str) -> bool
- ensure_state · method · L364-L377 — def ensure_state( self, run_id: str, *, root_run_id: str | None = None, initial_turn_tokens: int = 0, ) -> dict[str, Any] | None
- reserve · method · L379-L411 — def reserve( self, *, run_id: str, admission_id: str, consumer: str, action_group_id: str, amount: int = 1, action_sha256: str | None = None, enforce_field_limit: bool = True, token_upper_bound: int | None = None, ) -> dict[str, Any]
- commit · method · L413-L416 — def commit(self, admission_id: str, *, committed_amount: int) -> dict[str, Any]
- release · method · L418-L419 — def release(self, admission_id: str, *, started: bool) -> dict[str, Any]
- mark_unknown · method · L421-L422 — def mark_unknown(self, admission_id: str) -> dict[str, Any]
- reconcile · method · L424-L427 — def reconcile(self, admission_id: str, *, committed_amount: int) -> dict[str, Any]
- record_delta · method · L429-L434 — def record_delta(self, run_id: str, *, kind: str, cursor: str) -> dict[str, Any]
- freeze_initial_tokens · method · L436-L442 — def freeze_initial_tokens(self, run_id: str, tokens: int) -> dict[str, Any]
- trip · method · L444-L449 — def trip( self, run_id: str, *, reason: str, field: str | None = None ) -> dict[str, Any]
- fail_measurement · method · L451-L458 — def fail_measurement(self, run_id: str, admission_id: str | None = None) -> None
- project_usage · method · L460-L503 — def project_usage( self, run_id: str, *, root_frame_id: str | None = None, ) -> dict[str, Any]
- _field_usage · method · L505-L640 — def _field_usage( self, state: Mapping[str, Any], budgets: Mapping[str, Any], reservations: list[Mapping[str, Any]], *, tokens_frozen: bool, root_frame_id: str | None, ) -> dict[str, Any]
- meter · function · L514-L533 — def meter( *, limit: float | int, used: float | int, reserved: float | int, authority: str, ) -> dict[str, Any]
- _int · function · L535-L543 — def _int(name: str, default: int = 0) -> int
- _reserved · function · L545-L550 — def _reserved(consumer: str) -> int
- _guardian_usage · method · L642-L689 — def _guardian_usage(self, root_frame_id: str | None) -> dict[str, dict[str, Any]]
- guardian_meter · function · L669-L678 — def guardian_meter(limit: int, used: int) -> dict[str, Any]
- _guardian_history · method · L691-L701 — def _guardian_history(self, root_frame_id: str | None) -> list[bool]