← Về thư mục
openai4s/llm/capabilities.py
- CapabilityError · class · L23-L24 — class CapabilityError(ValueError)
- UsageMapping · class · L64-L83 — class UsageMapping
- CostMetadata · class · L87-L101 — class CostMetadata
- ProviderCapabilities · class · L105-L137 — class ProviderCapabilities
- context_limit · method · L127-L129 — def context_limit(self) -> int | None
- output_limit · method · L132-L133 — def output_limit(self) -> int | None
- as_dict · method · L135-L137 — def as_dict(self) -> dict[str, Any]
- ModelCapabilities · class · L141-L178 — class ModelCapabilities
- context_limit · method · L163-L164 — def context_limit(self) -> int | None
- output_limit · method · L167-L168 — def output_limit(self) -> int | None
- usable_context_tokens · method · L171-L175 — def usable_context_tokens(self) -> int | None
- as_dict · method · L177-L178 — def as_dict(self) -> dict[str, Any]
- CapabilityCacheInfo · class · L182-L187 — class CapabilityCacheInfo
- _normalize_name · function · L356-L362 — def _normalize_name(value: str, label: str) -> str
- _normalize_endpoint · function · L365-L366 — def _normalize_endpoint(value: str | None) -> str
- _is_local_endpoint · function · L369-L381 — def _is_local_endpoint(endpoint: str) -> bool
- _coerce_nested · function · L384-L413 — def _coerce_nested(field_name: str, value: Any) -> Any
- _validated_changes · function · L431-L477 — def _validated_changes(changes: Mapping[str, Any]) -> dict[str, Any]
- _invalidate_cache_locked · function · L480-L484 — def _invalidate_cache_locked() -> None
- _overlay_key · function · L487-L492 — def _overlay_key(endpoint: str, model: str, wire: str) -> tuple[str, str, str]
- install_receipt_overlay · function · L495-L516 — def install_receipt_overlay(receipt: Mapping[str, Any]) -> bool
- drop_receipt_overlays · function · L519-L541 — def drop_receipt_overlays( profile_id: str | None = None, *, revision: int | None = None ) -> int
- adopted_receipts · function · L544-L554 — def adopted_receipts( *, profile_id: str | None = None, revision: int | None = None ) -> list[dict[str, Any]]
- _overlay_for_locked · function · L557-L562 — def _overlay_for_locked( endpoint: str, model_key: str, wire: str ) -> dict[str, Any] | None
- _apply_positive_overlay · function · L565-L590 — def _apply_positive_overlay( values: dict[str, Any], overlay: Mapping[str, Any] | None ) -> dict[str, Any]
- capability_probe_window · function · L594-L627 — def capability_probe_window( provider: str, model: str | None = None, *, base_url: str | None = None, tool_calling: bool = True, streaming: bool = False, ) -> Iterator[None]
- _probe_window_for_locked · function · L630-L641 — def _probe_window_for_locked( provider: str, model_key: str, endpoint: str ) -> dict[str, Any] | None
- tool_call_matches_schema · function · L644-L688 — def tool_call_matches_schema( call: Mapping[str, Any] | None, spec: Mapping[str, Any] | None = None ) -> bool
- classify_probe_error · function · L691-L713 — def classify_probe_error(error: BaseException) -> str
- streaming_evidence · function · L716-L721 — def streaming_evidence(*, deltas_seen: bool, finish_reason: Any) -> str
- bind_provider_registry · function · L724-L736 — def bind_provider_registry(registry: Mapping[str, Mapping[str, Any]]) -> None
- _registry_entry_locked · function · L739-L755 — def _registry_entry_locked(name: str) -> tuple[Mapping[str, Any] | None, str]
- _provider_base_locked · function · L758-L839 — def _provider_base_locked(name: str) -> tuple[ProviderCapabilities, str]
- get_provider_capabilities · function · L842-L889 — def get_provider_capabilities( provider: str, *, base_url: str | None = None ) -> ProviderCapabilities
- get_model_capabilities · function · L892-L946 — def get_model_capabilities( provider: str, model: str | None = None, *, base_url: str | None = None, ) -> ModelCapabilities
- set_capability_override · function · L955-L981 — def set_capability_override( provider: str, changes: Mapping[str, Any] | None = None, , model: str | None = None, *kwargs: Any, ) -> None
- clear_capability_overrides · function · L984-L1004 — def clear_capability_overrides( provider: str | None = None, *, model: str | None = None ) -> None
- clear_capability_cache · function · L1007-L1010 — def clear_capability_cache() -> None
- capability_cache_info · function · L1013-L1021 — def capability_cache_info() -> CapabilityCacheInfo
- validate_model_request · function · L1024-L1070 — def validate_model_request( provider: str, model: str | None = None, *, base_url: str | None = None, tool_calling: bool = False, parallel_tool_calls: bool = False, strict_tool_schema: bool = False, vision: bool = False, audio: bool = False, reasoning: bool = False, streaming: bool = False, max_output_tokens: int | None = None, ) -> ModelCapabilities
- _path_value · function · L1073-L1079 — def _path_value(usage: Mapping[str, Any], path: str) -> Any
- _token_value · function · L1082-L1093 — def _token_value(usage: Mapping[str, Any], paths: tuple[str, ...]) -> int
- normalize_usage · function · L1096-L1139 — def normalize_usage( usage: Mapping[str, Any] | None, provider_or_mapping: str | UsageMapping, *, model: str | None = None, base_url: str | None = None, ) -> dict[str, int]
- calculate_usage_cost_usd · function · L1142-L1196 — def calculate_usage_cost_usd( usage: Mapping[str, Any] | None, cost: CostMetadata, ) -> float | None
- counter · function · L1162-L1170 — def counter(name: str) -> int
- legacy_provider_specs · function · L1199-L1213 — def legacy_provider_specs() -> dict[str, dict[str, Any]]