JevVendor

com.softinio.verdict4s.jev.JevVendor
object JevVendor extends Vendor

TypeSafe AI's Jev.

POST https://api.typesafe.ai/v1/systemone
{"state": ..., "model": "jev-latest", "questions": {"q00": {"type": "noul", ...
}}}

Jev accepts everything the shared question model can express, so it adds no validation of its own. It is also the only vendor with a models endpoint, which is why modelsUrl and parseModels live here rather than on com.softinio.verdict4s.Vendor.

@group Jev

Attributes

Graph
Supertypes
trait Vendor
class Object
trait Matchable
class Any
Self type
JevVendor.type

Members list

Value members

Concrete methods

Read a successful response body.

Read a successful response body.

Attributes

Read the models endpoint's response, unwrapping its models envelope.

Read the models endpoint's response, unwrapping its models envelope.

Attributes

def encode(request: EvaluationRequest): Json

The request body. Does not validate; see validate.

The request body. Does not validate; see validate.

Attributes

Parse the models endpoint's response, unwrapping its models envelope.

Parse the models endpoint's response, unwrapping its models envelope.

Attributes

Inherited methods

final def authorization(apiKey: ApiKey): String

The Authorization header value for a key.

The Authorization header value for a key.

Attributes

Inherited from:
Vendor
final def evaluateUrl: String

Where to POST an evaluation, using the default base URL.

Where to POST an evaluation, using the default base URL.

Attributes

Inherited from:
Vendor
final def headers(apiKey: ApiKey): List[(String, String)]

The headers every request needs, as plain pairs.

The headers every request needs, as plain pairs.

Attributes

Inherited from:
Vendor

Parse a successful response body.

Parse a successful response body.

Attributes

Inherited from:
Vendor
final def parseAsk[Q <: Tuple](ask: Ask[Q], body: String): Either[Verdict4sError, Answers[Q]]

Parse a response and project it through the questions that produced it.

Parse a response and project it through the questions that produced it.

Attributes

Inherited from:
Vendor
final def parseError(status: Int, body: String, headers: Map[String, String] = ...): Api

Turn an unsuccessful response into a typed error.

Turn an unsuccessful response into a typed error.

Value parameters

body

the raw body, which need not be JSON

headers

the response headers, for the request id and the retry delay

status

the HTTP status code

Attributes

Inherited from:
Vendor

Validate and encode in one step.

Validate and encode in one step.

Attributes

Inherited from:
Vendor
final def render(request: EvaluationRequest): String

Render a request as the JSON to send. Does not validate; see renderAsk or prepare.

Render a request as the JSON to send. Does not validate; see renderAsk or prepare.

Attributes

Inherited from:
Vendor
final def renderAsk[Q <: Tuple, S : Encoder](ask: Ask[Q], state: S, model: Model = ...): Either[Verdict4sError, String]

Build, validate and render in one step, reporting every problem at once.

Build, validate and render in one step, reporting every problem at once.

Vendor.Jev.renderAsk(Ask(q1, q2), state)

Attributes

Inherited from:
Vendor
final def renderPretty(request: EvaluationRequest): String

Render a request indented, for logs and documentation.

Render a request indented, for logs and documentation.

Attributes

Inherited from:
Vendor

A response header giving the retry delay in milliseconds, consulted before the standard Retry-After.

A response header giving the retry delay in milliseconds, consulted before the standard Retry-After.

Attributes

Inherited from:
Vendor
def retryable(error: Api): Boolean

Whether an error the retry policy would retry is worth retrying.

Whether an error the retry policy would retry is worth retrying.

The policy decides by status alone; this lets a vendor veto a retry that its error body says cannot succeed, such as OpenAI's insufficient_quota 429, which no amount of waiting fixes.

Attributes

Inherited from:
Vendor

Reject requests this vendor cannot serve, such as a feature only the other vendor has, before they cost a round trip. Every problem is reported at once.

Reject requests this vendor cannot serve, such as a feature only the other vendor has, before they cost a round trip. Every problem is reported at once.

Attributes

Inherited from:
Vendor

Concrete fields

Environment variable holding the API key, matching the official SDKs.

Environment variable holding the API key, matching the official SDKs.

Attributes

Environment variable overriding the base URL.

Environment variable overriding the base URL.

Attributes

Environment variable overriding the default model.

Environment variable overriding the default model.

Attributes

Root of the TypeSafe API.

Root of the TypeSafe API.

Attributes

jev-latest.

jev-latest.

Attributes

Path segments of the evaluation endpoint, relative to the base URL.

Path segments of the evaluation endpoint, relative to the base URL.

Attributes

Path segments of the models endpoint, relative to the base URL.

Path segments of the models endpoint, relative to the base URL.

Attributes

Where to GET the list of available models.

Where to GET the list of available models.

Attributes

val name: String

A human-readable name, for logs and error messages.

A human-readable name, for logs and error messages.

Attributes

Response header carrying the per-request correlation id.

Response header carrying the per-request correlation id.

Attributes