Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

docs(structured): decide_batch's model= is a per-request pin, not a predict_batch keyword

Aashishd39a88e2ce2e
diff --git a/laya/structured.py b/laya/structured.py
index c4e3a24b..780e91f6 100644
--- a/laya/structured.py
+++ b/laya/structured.py
@@ -379,9 +379,14 @@ def decide_batch(runner, states: Sequence[Any], schema: Any = None, *,
are evaluated over every state through ``runner.predict_batch`` (the same
shared-forward-pass path as :meth:`Agent.predict_batch` /
:meth:`Router.predict_batch`), then each state's answers are projected exactly as
- ``decide`` does. Pass exactly one of ``schema`` or ``questions``; extra keyword
- arguments (``batch_size=``, ``model=``, ``hooks=``, ...) are forwarded to
- ``runner.predict_batch``. With ``return_details=True`` each item is a
+ ``decide`` does. Pass exactly one of ``schema`` or ``questions``. The extra keywords you leave
+ here (``batch_size=``, ``hooks=``, ``sort_by_length=``, ...) go to ``runner.predict_batch``,
+ but the routing pins and the token budget (``model=``, ``task=``, ``lang=``, ``lang_guess=``,
+ ``max_len=``, ``head_max_len=``) are read off every *request* by a ``Router``, whose
+ ``predict_batch`` declares none of them: ``decide_batch`` copies them onto each request
+ instead, so ``model=`` pins a registered checkpoint there and raises ``TypeError`` on an
+ ``Agent``-like runner, whose ``predict_batch`` declares ``lang=`` but no ``model=``.
+ With ``return_details=True`` each item is a
``DecisionResult``. ``min_confidence`` works as in ``decide``: a field whose answer falls
below it comes back as ``None``, with the answer kept in the details.