ask primitive.
Given a prompt, optional accessibility/structural text, and zero or
more images, [AskModel.ask] returns the model’s response as a plain
string. The wire format is OpenAI-compatible chat completions, so any
provider config that points at such an endpoint works.
Constructor
Returns
AskModel
Properties
string
required
The wire-level model identifier sent in the request body.
Methods
ask()
prompt: the question or task to answer.text: optional accessibility-tree (or any) text included as structural context. Passnull/ omit to skip.images: zero or more images to attach. Each is encoded as a base64 data URL in a model-supported format and sent as animage_urlchat content part. Passnull/ omit for none.
Parameters
string
required
null | string
null | Image[]
Returns
string
availableAliases()
byAlias on this machine,
deduplicated and sorted alphabetically. Use to discover what aliases
the loaded config (bundled defaults plus any user provider files)
advertises.
Returns
string[]
byAlias()
"openrouter_gpt_4o_mini" / "openrouter_claude_opus" from the
bundled openrouter provider, or any alias declared by a user provider).
Throws if the alias is unknown.
Parameters
string
required
Returns
AskModel
checkAuth()
default()
Returns
AskModel
