Makes a decider for a model of the OpenAI Decisions API
(https://api.openai.com).
Arguments
- model
The model name.
NULL(the default) uses"gpt-6-luna"and prints a message that names it.- credentials
A function with no arguments that returns the key.
NULL(the default) reads the environment variableOPENAI_API_KEYeach timedecide()sends requests. You generally should not need this argument. SetOPENAI_API_KEYinstead. The best place to set it is.Renviron. Open that file withusethis::edit_r_environ(). The usethis package is optional: you can also edit.Renvironby hand. Give a function for more control, for example to read the key from a secret store. The decider keeps the function, not the key.- input
The input type that the model reads:
"text","image"or"text+image".NULL(the default) takes it from the internal table of input types; a model that is not in the table is not checked.decide()stops before any request when an input does not fit.
Value
A decider object for decide(). It holds no key.
Details
A ChatGPT Plus membership does not give access to the API. You need to
sign up for a developer account (and pay for it) at the
developer platform. Then set the
environment variable OPENAI_API_KEY.
OpenAI does not report a cost, so .cost is NA in the output
of decide().
See also
Other deciders:
decider_foundry(),
decider_openrouter(),
decider_systemone(),
decider_typesafe()