JevApi

interface JevApi(source)

The Jev API. evaluate is the only call that sends questions; query and ask are conveniences on top of it, so application code that depends on JevApi can be tested with a fake or mock.

Inheritors

Functions

Link copied to clipboard
inline suspend fun <T : Any> JevApi.ask(query: JevQuery, state: T, model: String? = null): JevResult

Asks a JevQuery's questions about a @Serializable state.

suspend fun JevApi.ask(query: JevQuery, state: String, model: String? = null): JevResult

Asks a JevQuery's questions about a text state.

suspend fun JevApi.ask(query: JevQuery, state: JsonElement, model: String? = null): JevResult

Asks a JevQuery's questions about a JSON state.

inline suspend fun <T : Any> JevApi.ask(query: JevQuery, state: T, vararg images: JevImage, model: String? = null): JevResult

Asks a JevQuery's questions about a @Serializable state, with images attached after the query's own.

suspend fun JevApi.ask(query: JevQuery, state: String, vararg images: JevImage, model: String? = null): JevResult

Asks a JevQuery's questions about a text state, with images attached after the query's own.

suspend fun JevApi.ask(query: JevQuery, state: JsonElement, vararg images: JevImage, model: String? = null): JevResult

Asks a JevQuery's questions about a JSON state, with images attached after the query's own.

Link copied to clipboard

This API as blocking calls, for code that depends on a JevApi rather than a JevClient, so a fake or a withOptions view can be handed in. From Java: BlockingJevKt.blocking(api). The calls exist on the JVM only.

Link copied to clipboard
abstract suspend 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 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
abstract suspend fun models(): ModelList

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

open suspend fun models(options: JevCallOptions): ModelList

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

Link copied to clipboard
inline suspend fun <T : Any> JevApi.query(state: T, model: String? = null, noinline block: QueryBuilder.() -> Unit): JevResult

Asks inline questions about a @Serializable state.

suspend fun JevApi.query(state: String, model: String? = null, block: QueryBuilder.() -> Unit): JevResult

Asks inline questions about a text state.

suspend fun JevApi.query(state: JsonElement, model: String? = null, block: QueryBuilder.() -> Unit): JevResult

Asks inline questions about a JSON state.

Link copied to clipboard

This API with options applied to every call, including those made through query, ask and blocking. Options passed to a call on the result are merged over options.