Expand description
Constrained sampling for tools: strict JSON-schema parameters, and OpenAI grammar-constrained custom tools.
Structs§
- Grammar
- How to send a tool as an OpenAI grammar-constrained custom tool.
- Grammar
Input - A grammar tool call’s raw input as it streams, re-encoded as the JSON text of its arguments object.
Functions§
- grammar_
input - The raw input of a grammar tool call, from the argument that holds it.
- grammar_
properties - The tools a transcript declares that are sent with a grammar, by name, with
the argument that holds each one’s raw input.
messagesis the transcript as the provider receives it, afterresolve_transcript: a model that folds later system messages into the first one sees only the current tools. - grammar_
sampling - The grammar to send
toolwith: it asks for one and the provider supports OpenAI grammar tools. Lark is preferred over regex.Errwhen the tool asks for a grammar it cannot use. - make_
strict - The schema rewritten for strict mode: every property required, optional ones
nullable, no additional properties.
Errnames the unsupported construct. - strict_
sampling - Whether to send
toolwith strict JSON-schema sampling: it asks for it, the provider supports it and the schema can be made strict.Errwhen the tool requires strict sampling that cannot be had. - tool_
parameters - The parameters to send: strict when
strict, as declared otherwise.
Type Aliases§
- Keyword
Check - A provider’s extra keyword restrictions:
(key, value)is unsupported.