ProviderRegistry

org.llm4s.llmconnect.spi.ProviderRegistry
See theProviderRegistry companion object
final class ProviderRegistry

The set of providers this build can resolve.

A registry is an immutable value, not a mutable global: withProvider and withModule return a new registry, and an application that wants a different set constructs one with ProviderRegistry.of and passes it in. Core code resolves a registry through a using clause, so the default is ProviderRegistry.default unless the caller supplies another.

Lookup is by ProviderId and never throws: an id nothing handles produces a Left naming the ids that are registered, which is the difference between a usable error and "provider openai not registered".

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def canonicalId(raw: String): ProviderId

Folds an alias onto the id that owns it, leaving unknown strings alone.

Folds an alias onto the id that owns it, leaving unknown strings alone.

"google" becomes "gemini" because the Gemini descriptor declares that alias. An id no provider claims is returned canonicalised but unchanged — parsing config must not depend on what happens to be on the classpath; only resolution does.

Attributes

def find(id: ProviderId): Option[ProviderDescriptor]

The registered descriptor for id, if any. Does not consider aliases.

The registered descriptor for id, if any. Does not consider aliases.

Attributes

The registered descriptor for id, or an error naming what is registered.

The registered descriptor for id, or an error naming what is registered.

Attributes

def ids: Seq[String]

Registered provider ids in canonical spelling, sorted.

Registered provider ids in canonical spelling, sorted.

Attributes

def resolve(id: ProviderId, configPath: Option[String]): Result[ProviderDescriptor]

The registered descriptor for id, or an error naming what is registered.

The registered descriptor for id, or an error naming what is registered.

Value parameters

configPath

where the id came from, e.g. "llm4s.providers.my-bedrock.provider". Included in the error so the user knows which entry to fix.

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

This registry plus every provider module supplies.

This registry plus every provider module supplies.

Attributes

This registry plus descriptor; a later registration of the same id wins.

This registry plus descriptor; a later registration of the same id wins.

Attributes

Concrete fields