openai.DecisionsClient

OpenAI Decisions (POST {base_url}/decisions), with TypeSafe-style outputs. Bool outputs threshold a predicate at 0.5; float outputs retain its probability. Enums and finite unions use Choice. Classes flatten into one question per leaf. Use role("instructions") or @description for questions, and user content for evidence. Text and images are supported; tools and streaming are not. Float outputs are probabilities, not the API's ordered-rubric score type.

Reference version

Signature

class openai.DecisionsClient

OpenAI Decisions (POST {base_url}/decisions), with TypeSafe-style outputs. Bool outputs threshold a predicate at 0.5; float outputs retain its probability. Enums and finite unions use Choice. Classes flatten into one question per leaf. Use role("instructions") or @description for questions, and user content for evidence. Text and images are supported; tools and streaming are not. Float outputs are probabilities, not the API's ordered-rubric score type.

Source:<builtin>/openai/decisions.bamlbytes 481–2406

Fields

model

string

api_key

ai.Credential | null

base_url

ai.Credential | null

timeout

baml.time.Duration | ai.LlmTimeoutOptions | null

capture_wire

bool

Static methods

function

new

(
model: string = …,
api_key: ai.Credential | null = …,
base_url: ai.Credential | null = …,
timeout: baml.time.Duration | ai.LlmTimeoutOptions | null = …,
capture_wire: bool = …
) -> openai.DecisionsClient throws never

Construction is pure. Credentials resolve when invoking, using OPENAI_API_KEY unless an explicit credential is provided.

Implementations

ai.Client for openai.DecisionsClient

Instance methods

function

default_cache_args

(self) -> baml.json.json throws never

The args this client uses for a ${cache()} written with none (or with null): the object its wire's cache marker carries. Null when the client has no cache marker on its wire, or when the model it is configured for would reject one; a ${cache()} then sends nothing.

A client that sends cache markers passes this to ai.wire.prompt_parts(message, default_cache_args).

function

invoke

(
self,
input: ai.ModelTurnInput
) -> ai.ModelTurn throws reflect.errors.CompilationError | baml.errors.Timeout | baml.errors.UnknownError | ai.errors.Failure
function

provider

(self) -> string throws never
function

render

(
self,
input: ai.ModelTurnInput
) -> baml.http.Request throws reflect.errors.CompilationError | baml.errors.Timeout | baml.errors.UnknownError | ai.errors.Failure

Preview the request without resolving credentials or performing IO.

function

requested_model

(self) -> string throws never

Source:<builtin>/openai/decisions.bamlbytes 1626–2404