Makes a decider for a decision model on OpenRouter
(https://openrouter.ai, alpha decisions endpoint), for example Jev or
Microsoft-Decision-1.
Arguments
- model
The OpenRouter model id, for example
"typesafe/jev-1.14"or"microsoft/microsoft-decision-1". Required.- credentials
A function with no arguments that returns the key.
NULL(the default) reads the environment variableOPENROUTER_API_KEYeach timedecide()sends requests. You generally should not need this argument. SetOPENROUTER_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
Sign up at https://openrouter.ai, then create a key on the
keys page. Set the environment variable
OPENROUTER_API_KEY.
OpenRouter documents no image field for decisions, so the table
of input types gives every OpenRouter model the input type "text".
OpenRouter reports the cost of each call, and .cost holds it.
See also
Other deciders:
decider_foundry(),
decider_openai(),
decider_systemone(),
decider_typesafe()