Skip to content

1.1.1

Choose a tag to compare

@marcreichel marcreichel released this 27 Sep 20:11
· 97 commits to main since this release
68fbb09

Laya used to cut every state off at the checkpoint's default length, 512 or 1,024 tokens, and there was nothing you could do about it from PHP. laya-serve 0.3.21 lets a request raise that limit, and 1.1.1 passes it through.

$laya->predict($contract, $questions, maxLen: 4096);
$laya->decide($ticket, Triage::class, headMaxLen: 384);

New

  • maxLen on predict() and decide(). It sets the token budget for the state. A long contract or email thread no longer loses its second half.
  • headMaxLen on predict() and decide(). It sets the token budget for each question and its options. Raise it when a choice question with many or long option descriptions comes back as a 422.
  • Separate cache entries. Different budgets are cached separately, because the budgets are part of the request.

laya-serve caps both values at LAYA_MAX_TOKEN_BUDGET, 8,192 by default. It answers anything higher, zero or negative with a 422, which you get as a ValidationException.

Upgrading

No breaking changes. If you leave both arguments out, the request is byte for byte the same as in 1.1.0.

The new arguments need laya-serve 0.3.21 or later. A 0.3.20 server ignores them without an error and keeps using the default length, so upgrade the server before you rely on them.

compose.yaml now builds laya v0.3.21 (9d95567) for local development and the integration tests.