JevConfig

org.llm4s.jev.JevConfig
See theJevConfig companion object
final case class JevConfig

What JevClient needs to call TypeSafe's API.

Load it from configuration with org.llm4s.config.JevConfigLoader, which reads the llm4s.jev block and the API key from TYPESAFE_API_KEY, or build one in code:

val config = JevConfig(apiKey = key).withModel("jev-1.13.0")

A config is checked by JevConfig#validate, which JevClient runs when it is built.

Value parameters

apiKey

the API key; never printed by toString or logged, and masked in an error wherever the server echoed it verbatim, JSON-escaped or URL-encoded (a partial or otherwise transformed echo of the key is not recognised)

baseUrl

the API root, without a path. It must be https: the key is sent as a bearer token, so a plain http URL is accepted only for a loopback host (localhost, 127.0.0.0/8, ::1), which is how a test points the client at a local server.

headers

extra HTTP headers for every request (a request can add its own); the client sets the credentials, content type and Accept header itself and refuses to have them replaced

model

the model a request uses unless it names one: jev-latest, or a versioned id such as jev-1.13.0 to pin the answers

retry

how a transient failure is retried

timeout

how long each HTTP attempt may take. The API documents no figure: 30 s is this client's choice, matching the retry budget of TypeSafe's SDKs. An attempt never waits past what is left of the retry budget, so the budget bounds the whole 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

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

Checks the config; the first problem is reported, naming the setting.

Checks the config; the first problem is reported, naming the setting.

Attributes

def withApiKey(apiKey: String): JevConfig
def withBaseUrl(baseUrl: String): JevConfig
def withHeaders(headers: Map[String, String]): JevConfig
def withModel(model: String): JevConfig
def withTimeout(timeout: FiniteDuration): JevConfig

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product