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.
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.