Skip to content

Judge Invoker

Helpers for judge invokers: language-model (BaseLMInvoker) or decisions-model (BaseDMInvoker).

chain_has_dm(*groups)

Check whether any invoker in the given groups is a decisions-model invoker.

Parameters:

Name Type Description Default
*groups BaseLMInvoker | BaseDMInvoker | list[BaseLMInvoker | BaseDMInvoker] | None

Groups to inspect.

()

Returns:

Name Type Description
bool bool

True if at least one invoker is a BaseDMInvoker.

is_dm_invoker(invoker)

Check whether an object is a decisions-model invoker.

Parameters:

Name Type Description Default
invoker object

The object to check.

required

Returns:

Name Type Description
bool bool

True if the object is a BaseDMInvoker.

iter_judges(*groups)

Flatten None, single-invoker and list groups into one list.

Parameters:

Name Type Description Default
*groups BaseLMInvoker | BaseDMInvoker | list[BaseLMInvoker | BaseDMInvoker] | None

Groups to flatten.

()

Returns:

Type Description
list[BaseLMInvoker | BaseDMInvoker]

list[BaseLMInvoker | BaseDMInvoker]: All invokers, in the order given.

translate_structured_reply_errors(response_schema, context)

Translate the native decoder's invalid reply error inside a judge attempt.

Schema setup and attachment resolution stay outside this scope. InferenceValueError is not translated: it also reports invalid schemas and messages.

Parameters:

Name Type Description Default
response_schema ResponseSchema | None

The schema active for this invocation.

required
context ErrorContext

The judge-response boundary.

required

Yields:

Type Description
None

None

Raises:

Type Description
EvalJudgeResponseError

If structured decoding rejects the reply.

InferenceInvalidOutputError

If no response schema is active.