EmbeddingProviderConfig

org.llm4s.llmconnect.config.EmbeddingProviderConfig
See theEmbeddingProviderConfig companion object
@Stable
final case class EmbeddingProviderConfig

Configuration required to connect to an embedding provider endpoint.

Value parameters

apiKey

authentication key for the provider; redacted in toString

apiKeyProvider

supplies the key per request in place of apiKey, so a rotated key is used without rebuilding the provider (#2478): a block's apiKeyFile (or the vendor's shared llm4s.credentials.<id>.apiKeyFile) sets org.llm4s.llmconnect.auth.ApiKeyProvider.file, and code sets any implementation with withApiKeyProvider. apiKey then holds the key read at load. An embedding provider reads the key with currentApiKey. Build one with EmbeddingProviderConfig.apply and change it with the with* setters; the constructor and copy are private, so a new field never breaks callers.

baseUrl

base URL of the embedding service (e.g. https://api.openai.com/v1)

model

name of the embedding model to use

network

the proxy and TLS settings its HTTP calls use: llm4s.http. The default, org.llm4s.http.HttpNetworkSettings.default, is no proxy and the JDK's trust.

timeouts

how long an embedding request may take: the section's timeouts.request. Absent means the provider's own default (two minutes). timeouts.stream has no meaning for an embedding call.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

The key to send with the next request: apiKeyProvider's current key when one is set, otherwise apiKey. A key file that has become unreadable or empty is a Left naming its path, and a provider that throws is an AuthenticationError naming the exception's class, as it is for a chat client.

The key to send with the next request: apiKeyProvider's current key when one is set, otherwise apiKey. A key file that has become unreadable or empty is a Left naming its path, and a provider that throws is an AuthenticationError naming the exception's class, as it is for a chat client.

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

Sets the authentication key.

Sets the authentication key.

Attributes

Supplies the key per request from provider rather than sending apiKey.

Supplies the key per request from provider rather than sending apiKey.

Attributes

Supplies the key per request from provider, or sends apiKey when it is None.

Supplies the key per request from provider, or sends apiKey when it is None.

Attributes

def withBaseUrl(baseUrl: String): EmbeddingProviderConfig

Sets the base URL of the embedding service.

Sets the base URL of the embedding service.

Attributes

def withModel(model: String): EmbeddingProviderConfig

Sets the embedding model.

Sets the embedding model.

Attributes

Sets the proxy and TLS settings its HTTP calls use.

Sets the proxy and TLS settings its HTTP calls use.

Attributes

Sets how long an embedding request may take.

Sets how long an embedding request may take.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product