Make a schema field completable so clients can request autocomplete
suggestions via completion/complete.
Pass an array of allowed values for case-insensitive prefix matching, or a
callback for dynamic/contextual suggestions.
Accepts any Standard Schema field (StandardSchemaV1); zod shown in
the example. Apply refinements like .describe() to the schema argument,
not to the completable result: refinements that clone the schema (as zod's
do) silently drop the SDK's completion marker. .optional() is the one
exception — the SDK unwraps optionals when looking for completions.
Make a schema field completable so clients can request autocomplete suggestions via
completion/complete.Pass an array of allowed values for case-insensitive prefix matching, or a callback for dynamic/contextual suggestions.
Accepts any Standard Schema field (StandardSchemaV1); zod shown in the example. Apply refinements like
.describe()to the schema argument, not to the completable result: refinements that clone the schema (as zod's do) silently drop the SDK's completion marker..optional()is the one exception — the SDK unwraps optionals when looking for completions.