Archived
radiance 1.0.3
- A tool whose schema bounds a string or an array past 2000 (maxLength, minLength, maxItems, minItems) no longer fails every request carrying it (issue #5). The bound is held exactly, up to about 200,000; past that the request is refused with a 400 naming the tool's property and the count. A bound past 2^31, such as Number.MAX_SAFE_INTEGER, is no bound. - Compiling a grammar with a long bounded repetition is linear in the bound instead of quadratic: maxLength 32000 compiles in 0.7 s instead of 2.1 s.
This commit is contained in:
1 parent
8e3463c173
commit
f48786483d
8 files changed
+376
-78
No files matched your search
@@ -933,6 +933,13 @@ accepts no value — `false`, or `{"not": {}}`, which is how TypeBox and Arktype
|
||||
an argument no call writes. Any other `not` is refused with a 400 naming it: the grammar cannot
|
||||
express a complement, and dropping the constraint silently would serve a call the tool forbids.
|
||||
|
||||
Length bounds are held exactly: `maxLength`, `minLength`, `maxItems` and `minItems` up to about
|
||||
200,000, which costs the first request carrying the tool under a second to compile on a
|
||||
quarter-million-token vocabulary and nothing per token after that. A bound past 2^31 (as
|
||||
`Number.MAX_SAFE_INTEGER` is) is no bound, since no context holds that much. One in between is
|
||||
refused with a 400 naming the property's rule and the count. The same holds for `response_format`
|
||||
schemas and `{m,n}` in a GBNF grammar.
|
||||
|
||||
### 5.5 Constrained output
|
||||
|
||||
```sh
|
||||
|
||||
Reference in new issue
Block a user