org.llm4s.capability
Members list
Type members
Classlikes
A capability as a value: the name of one marker, such as Capability.Vision for Vision, and the key of ModelMetadata.supports that says a model has it. Capable.capabilities and CapabilityCheck.missing list these, in the order of Capability.values.
A capability as a value: the name of one marker, such as Capability.Vision for Vision, and the key of ModelMetadata.supports that says a model has it. Capable.capabilities and CapabilityCheck.missing list these, in the order of Capability.values.
Value parameters
- supportsKey
-
the key of
ModelMetadata.supportsfor this capability
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
The capabilities of a capability set C, such as Vision & Tools, and how to check them against a model's metadata.
The capabilities of a capability set C, such as Vision & Tools, and how to check them against a model's metadata.
There is one given for every set: the compiler takes C apart at its &s, and refuses at compile time any part that is not one of the markers Vision, Tools, ParallelTools, StructuredOutput, Reasoning, PromptCaching and SystemMessages. A set is never written as a value; it is summoned by org.llm4s.capability.requireCapabilities and Capable.assume.
Type parameters
- C
-
the capability set
Value parameters
- capabilities
-
the set's capabilities, each once, in the order of Capability.values (the compiler may reorder an intersection, so the order it is written in is not kept)
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CapabilityCheck.type
A client whose model has the capabilities C, a set such as Vision & Tools.
A client whose model has the capabilities C, a set such as Vision & Tools.
One is made at the application's edge, by org.llm4s.capability.requireCapabilities, which checks the model's metadata, or by Capable.assume, which does not. From then on the compiler tracks the set: an operation that needs vision takes a Capable[Vision], and since Capable is covariant a Capable[Vision & Tools] is one, while a Capable[Tools] is a compile error.
Type parameters
- C
-
the capability set
Value parameters
- capabilities
-
the capabilities this value was checked (or assumed) for, which may be more than its static type shows
- client
-
the client, unchanged
- metadata
-
the model metadata the capabilities were checked against;
Nonewhen they were assumed
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
The model calls several tools in one reply (ModelMetadata.supports("parallel_function_calling")).
The model calls several tools in one reply (ModelMetadata.supports("parallel_function_calling")).
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
The provider caches the prompt for this model (ModelMetadata.supports("prompt_caching")).
The provider caches the prompt for this model (ModelMetadata.supports("prompt_caching")).
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
The model reasons before it answers (ModelMetadata.supports("reasoning")).
The model reasons before it answers (ModelMetadata.supports("reasoning")).
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
The model answers in a given JSON schema (ModelMetadata.supports("response_schema")).
The model answers in a given JSON schema (ModelMetadata.supports("response_schema")).
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
The model takes system messages (ModelMetadata.supports("system_messages")).
The model takes system messages (ModelMetadata.supports("system_messages")).
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
The model calls tools (ModelMetadata.supports("function_calling")).
The model calls tools (ModelMetadata.supports("function_calling")).
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
The model reads images (ModelMetadata.supports("vision")).
The model reads images (ModelMetadata.supports("vision")).
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Extensions
Extensions
Checks once, here, that provider's model has the capabilities C, by the registry's metadata, and returns the client typed with them: client.requireCapabilities[Vision & Tools]("openai", "gpt-4o").
Checks once, here, that provider's model has the capabilities C, by the registry's metadata, and returns the client typed with them: client.requireCapabilities[Vision & Tools]("openai", "gpt-4o").
Fails with the registry's error when it does not know the model (see Capable.assume for that case), and with a org.llm4s.error.ValidationError on the field capabilities that names every capability the model lacks.