Command reference
oko gateway object
One chat completion as Oko whose answer is bound to a JSON Schema, printed as the object it answered: how a program outside Oko has a model decide something without reading the first word of a line of prose.
Invocation#
oko gateway object --prompt TEXT --name NAME --schema JSONInputs and options#
- --prompt: the completion's text, the question and what each choice means; --name: the schema's name; --schema: the JSON Schema object the answer must match, sent as `response_format` `json_schema` with strict set, so every property is listed in `required` and `additionalProperties` is false.
Output and state effect#
- Asks the service `oko model-service set` declared, with its model, or Brama on Oko's declared route, as every completion Oko makes, and prints the answered object.
Refusals and safe exits#
- `oko gateway object requires --prompt <text>`, `… requires --name <text>`, `… requires --schema <text>`, `oko gateway object --schema takes a JSON Schema; it is not JSON: <error>` and `… takes a JSON Schema object; it was given <value>` (exit 2); `oko gateway object: the <route> completion answered HTTP <status>: <answer>` when the service refuses, and `oko gateway object: the <model> completion answered no <name> object: <answer>` when the answer is not one JSON object.