Documentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/core/llms.txt
Use this file to discover all available pages before exploring further.
Capability is a pure PHP enum that provides a stable, provider-agnostic vocabulary for describing what a model can do. Provider adapters declare which capabilities they support, and the SDK uses these declarations to gate features and surface CapabilityNotSupportedException when a requested capability is absent. New cases are added as feature slices land; a model must never advertise a capability it cannot honor.
Capability enum cases
| Case | String name | Description |
|---|---|---|
TextGeneration | text_generation | Model can generate text responses. |
Streaming | streaming | Model supports token-by-token streaming. |
ToolCalling | tool_calling | Model can call tools and return structured function invocations. |
StructuredOutput | structured_output | Model supports constrained JSON output validated against a schema. |
Reasoning | reasoning | Model supports extended thinking/reasoning before producing output. |
ImageGeneration | image_generation | Model can generate images from text prompts. |
TextInput | text_input | Model accepts text as input. |
ImageInput | image_input | Model accepts image input (also known as vision). |
AudioInput | audio_input | Model accepts audio input. |
FileInput | file_input | Model accepts uploaded files as input. |
Static methods
Resolves a string name to its corresponding
Capability case. Accepts both the canonical snake_case names and provider aliases (e.g. 'vision' maps to Capability::ImageInput). Returns null for unrecognised strings.The string capability name to look up. Recognised values:
text_generation, streaming, tool_calling, structured_output, reasoning, image_generation, text_input, image_input, vision, audio_input, file_input.Returns the canonical snake_case string name for this enum case. This is the inverse of
fromName().CapabilitySupport
CapabilitySupport is the value object that provider adapters return to describe how — or whether — a specific capability is available for a given model. It is constructed exclusively through its three static factory methods.
The capability this support descriptor refers to.
Whether the capability is natively supported, not supported, or achieved through an adapter strategy.
A human-readable explanation of why the capability is not supported, when
state is NotSupported. null otherwise.An optional hint indicating the origin of the support declaration (e.g. a feature flag name or model identifier). Used for diagnostics.
Describes the adaptation strategy used when
state is Adapted — for example 'system-prompt-injection' or 'json-mode'.Arbitrary key–value metadata attached to this support descriptor by the provider adapter.
Static factories
CapabilitySupport::supported(Capability $capability, ?string $source, array $metadata)
CapabilitySupport
CapabilitySupport::notSupported(Capability $capability, ?string $reason, array $metadata)
CapabilitySupport
CapabilitySupport::adapted(Capability $capability, string $strategy, ?string $source, array $metadata)
CapabilitySupport
Creates a descriptor indicating the capability is available through an adapter strategy rather than native model support.
The capability being declared as adapted.
Describes how the capability is emulated (e.g.
'json-mode', 'system-prompt-injection').Optional provenance hint.
Optional extra metadata.
Instance methods
Returns
true when state is Supported or Adapted. Returns false only when state is NotSupported. Use this for boolean capability checks without inspecting the state enum directly.CapabilitySupportState enum
CapabilitySupportState is a string-backed enum with three cases that classify how a CapabilitySupport was declared.
| Case | String value | Meaning |
|---|---|---|
Supported | 'supported' | The model natively supports this capability. |
NotSupported | 'not_supported' | The model does not support this capability. |
Adapted | 'adapted' | The capability is available via an adapter strategy, not native model support. |
FinishReason enum
FinishReason is a string-backed enum that appears on TextResult and FinishPart to describe why a model stopped generating.
| Case | String value | Description |
|---|---|---|
Stop | 'stop' | The model reached a natural stopping point. |
Length | 'length' | Generation was truncated at the token or character limit. |
ToolCalls | 'tool-calls' | The model paused to issue one or more tool calls. |
ContentFilter | 'content-filter' | Output was blocked by a content safety or moderation filter. |
Error | 'error' | Generation was halted due to an error condition. |
Unknown | 'unknown' | The provider returned an unrecognised or missing stop reason. |