Critico¶
relai.critico.Critico(client)
¶
Critico orchestrates evaluation of an AI agent using a configurable set of evaluators.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
AsyncRELAI
|
An instance of the AsyncRELAI client to interact with the RELAI platform. |
required |
add_evaluators(evaluators, evaluator_group='default')
¶
Adds a new evaluator to Critico to a specific evaluator group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
evaluator_group
|
str
|
The name of the evaluator group. |
'default'
|
evaluators
|
dict[Evaluator, float]
|
A dictionary where keys are |
required |
evaluate(agent_logs)
async
¶
Evaluates a list of AI agent logs against their corresponding evaluator groups using the configured evaluators.
For each AgentLog, Critico identifies the associated evaluator group and runs all evaluators configured for
that group. It then aggregates the individual evaluator results (scores and feedback) into a single
CriticoFeedback object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent_logs
|
list[AgentLog]
|
A list of |
required |
Returns:
| Type | Description |
|---|---|
list[CriticoLog]
|
list[CriticoFeedback]: A list of |
Raises:
| Type | Description |
|---|---|
KeyError
|
If a |
report(critico_logs)
async
¶
Submits the critico logs (as multiple CriticoLog objects) to the RELAI platform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
critico_logs
|
list[CriticoLog]
|
A list of |
required |
Raises:
| Type | Description |
|---|---|
RELAIError
|
If any |
reweight_evaluator(evaluator_group, evaluator, weight)
¶
Adjusts the weight of a specific evaluator in a given evaluator group.
Evaluator weights influence their contribution to the aggregate score during the evaluate() operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
evaluator_group
|
str
|
The name of the evaluator group. |
required |
evaluator
|
Evaluator
|
The |
required |
weight
|
float
|
The new weight (a positive float) for the evaluator. Higher weights give more prominence to its results in aggregation. |
required |
Raises:
| Type | Description |
|---|---|
RELAIError
|
If the |
ValueError
|
If the specified |