Skip to content

symfonic.services.models.values

values

Frozen value types for the provider / model-resolution service.

Deliberately stdlib-only. symfonic.core.providers imports the descriptor table that builds on these types, so anything reachable from here at module scope would close an import cycle between the legacy core package and this service. Keeping the vocabulary dependency-free is what makes the table usable as the single source of truth on both sides of that edge.

ProviderCapabilities dataclass

ProviderCapabilities(label: str, family: ProviderFamily, cache_dialect: CacheDialect, thinking: ThinkingSupport, streaming: bool, forced_tool_choice: bool, forced_tool_choice_refusal: str | None, timeouts: TimeoutBinding, sampling: SamplingSupport)

Everything the framework knows about serving one call with one adapter.

Produced by describe_provider from the static descriptor row plus the adapter's own supports_* introspection for the specific ModelConfig in hand. Frozen because callers cache it per turn.

SamplingSupport dataclass

SamplingSupport(top_p: bool = True, top_k: bool = False)

Which sampling knobs survive to the wire for this adapter.

ThinkingSupport dataclass

ThinkingSupport(enabled: bool = False, blocks_forced_tool_choice: bool = False)

Extended-thinking capability, and what enabling it costs.

blocks_forced_tool_choice records the published Anthropic constraint: with thinking enabled the API accepts only {type:auto} / {type:none} and returns HTTP 400 for a forced tool. It is a property of the adapter, evaluated per ModelConfig by capabilities.describe_provider.

TimeoutBinding dataclass

TimeoutBinding(timeout_kwarg: str | None, http_client_kwarg: str | None = None, http_client_support: HttpClientSupport = 'unsupported')

Which LangChain constructor kwargs an adapter's timeouts thread through.

timeout_kwarg differs per adapter (default_request_timeout on Anthropic, timeout everywhere else) and is None for adapters that do not thread ModelConfig.timeout_seconds at construction at all (Bedrock puts request timeouts on the boto3 client). http_client_kwarg is None for adapters whose LangChain class builds its own transport.