JevClient

A Jev client over Ktor, on the platform's default engine (CIO on the JVM) unless one is supplied. Configure it inline, or rely on TYPESAFE_API_KEY:

JevClient().use { jev ->
val result = jev.ask(Triage, state = ticket)
}

Failed requests are retried per JevConfig.retry; errors surface as JevException subclasses. Close the client when done.

Constructors

Link copied to clipboard
constructor(config: JevConfig)
constructor(block: JevConfigBuilder.() -> Unit = {})

Properties

Link copied to clipboard

The same API, blocking the calling thread (JVM only). Don't call it from inside a coroutine.

Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open suspend override fun evaluate(state: JsonElement, questions: QuestionSet, model: String? = null): JevResult

Asks questions about state (POST /v1/systemone), using the default model unless model is given. A blank model counts as not given.

open suspend override fun evaluate(state: JsonElement, questions: QuestionSet, model: String?, options: JevCallOptions): JevResult

evaluate with options overriding the client's settings for this one call.

Link copied to clipboard
open suspend override fun models(): ModelList

The models this account can use (GET /v1/models), with the call's request id.

open suspend override fun models(options: JevCallOptions): ModelList

models with options overriding the client's settings. The default implementation ignores them.