Verdict4s

com.softinio.verdict4s.Verdict4s
object Verdict4s

Batteries-included entry point.

Picks a sensible transport for whichever platform you are on — Ember on the JVM, the browser and Node Fetch API on Scala.js — so getting a working client is a one-liner, for either vendor:

Verdict4s.jev[IO](typesafeKey).use { client =>
 client.ask(Ask(Question.noul("Is this urgent?")), ticket)
}

Verdict4s.openAI[IO](openAIKey).use { client =>
 client.ask(Ask(Question.noul("Is this urgent?")), ticket)
}

If you already have an http4s Client[F], or want a backend other than the default, depend on verdict4s-client and construct a Verdict4sClient directly.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Verdict4s.type

Members list

Value members

Concrete methods

def jev[F[_] : Async](apiKey: ApiKey, baseUri: Uri = ..., config: ClientConfig = ...): Resource[F, JevClient[F]]

A Jev client backed by this platform's default transport.

A Jev client backed by this platform's default transport.

The cats.effect.kernel.Resource owns the underlying connection pool, so allocate it once for the lifetime of your application rather than once per call.

Value parameters

apiKey

your TypeSafe API key

baseUri

override for testing or for a proxy

config

model, retry policy and timeouts

Attributes

def of[F[_] : Async](vendor: Vendor, apiKey: ApiKey, baseUri: Option[Uri] = ..., config: ClientConfig = ...): Resource[F, Verdict4sClient[F]]

A client for any Vendor, when the vendor is chosen at runtime.

A client for any Vendor, when the vendor is chosen at runtime.

Value parameters

baseUri

the vendor's own address when absent

Attributes

def openAI[F[_] : Async](apiKey: ApiKey, baseUri: Uri = ..., config: ClientConfig = ...): Resource[F, OpenAIClient[F]]

An OpenAI Decisions client backed by this platform's default transport.

An OpenAI Decisions client backed by this platform's default transport.

Value parameters

apiKey

your OpenAI API key

baseUri

override for testing or for a proxy; includes /v1

config

model, retry policy and timeouts

Attributes