OpenAIClient

com.softinio.verdict4s.OpenAIClient
final class OpenAIClient[F[_]] extends Verdict4sClient[F], SafetyIdentity[F]

A client for OpenAI Decisions: the shared surface, plus SafetyIdentity.

Built with Verdict4sClient.openAI. Its copy methods return an OpenAIClient, so withConfig never loses the safety identifier.

Attributes

Graph
Supertypes
trait SafetyIdentity[F]
trait Verdict4sClient[F]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def ask[Q <: Tuple, S : Encoder](questions: Ask[Q], state: S): F[Answers[Q]]

Ask a set of questions and get back exactly typed answers.

Ask a set of questions and get back exactly typed answers.

val (urgent, dept, mood) = client.ask(Ask(q1, q2, q3), state)

Fails with Verdict4sError.Refused if the vendor declines a question that was not built with orRefused.

Attributes

The settings this client applies to every request.

The settings this client applies to every request.

Attributes

Evaluate a request built by hand.

Evaluate a request built by hand.

The escape hatch: answers come back in the map-based algebra.Evaluation, keyed by whatever question names you chose. Use ask when the questions are known statically. The request is checked against the vendor's own limits before it is sent.

Attributes

The identifier sent with every request, if any.

The identifier sent with every request, if any.

Attributes

The vendor this client speaks to.

The vendor this client speaks to.

Attributes

A copy with different settings.

A copy with different settings.

Attributes

def withJitter(j: Jitter[F]): OpenAIClient[F]

A copy drawing retry jitter differently. Mostly useful in tests.

A copy drawing retry jitter differently. Mostly useful in tests.

Attributes

A copy sending this identifier with every request. At most 128 characters, and never your own account identity; an invalid one fails each request with Verdict4sError.Invalid before it is sent.

A copy sending this identifier with every request. At most 128 characters, and never your own account identity; an invalid one fails each request with Verdict4sError.Invalid before it is sent.

Attributes