Skip to content

Commit 1ccb231

Browse files
committed
Amend correctness evaluator name when instantiating via SimpleEvaluator
1 parent 1623520 commit 1ccb231

5 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎src/elastic_evals/evaluators/correctness/evaluator.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def evaluate(params: EvaluatorParams) -> EvaluationResult:
9494
metadata=result.metadata,
9595
)
9696

97-
return SimpleEvaluator(name="correctness", kind="LLM", evaluate=evaluate)
97+
return SimpleEvaluator(name=QUALITATIVE_EVALUATOR_NAME, kind="LLM", evaluate=evaluate)
9898

9999

100100
def _analysis_explanation(summary: Any, fallback: str | None) -> str | None:

‎src/elastic_evals/integrations/agent_builder/client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import httpx
1212

13+
from elastic_evals.api.response import raise_kibana_error
14+
from elastic_evals.api.retry import retry_kibana_api_call
1315
from elastic_evals.integrations.agent_builder.constants import (
1416
AGENT_URL,
1517
AGENTS_URL,
@@ -29,8 +31,6 @@
2931
UpdateAgentRequest,
3032
UpdateToolRequest,
3133
)
32-
from elastic_evals.api.response import raise_kibana_error
33-
from elastic_evals.api.retry import retry_kibana_api_call
3434
from elastic_evals.utils.logging import log
3535

3636
logger = log.getChild(__name__)

‎src/elastic_evals/integrations/agent_builder/headers.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
from __future__ import annotations
88

9-
from elastic_evals.integrations.agent_builder.constants import AGENT_BUILDER_API_VERSION
109
from elastic_evals.api.headers import build_kibana_headers
10+
from elastic_evals.integrations.agent_builder.constants import AGENT_BUILDER_API_VERSION
1111

1212

1313
def build_agent_builder_headers(api_key: str | None) -> dict[str, str]:

‎tests/evaluators/test_kibana.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ async def test_analysis_creators_preserve_legacy_results_through_kibana(
202202
correctness_result = await correctness.evaluate(params)
203203
groundedness_result = await groundedness.evaluate(params)
204204

205+
assert correctness.name == "Correctness Analysis"
205206
assert correctness_result.score is None
206207
assert correctness_result.label == "correctness-analysis"
207208
assert correctness_result.explanation == ("Factuality: FULLY_SUPPORTED, Relevance: RELEVANT, Sequence: MATCH")

‎tests/integrations/agent_builder/test_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from pydantic import ValidationError
1414
from tenacity import wait_none
1515

16+
from elastic_evals.api.errors import KibanaAPIError
1617
from elastic_evals.integrations.agent_builder import (
1718
AgentBuilderClient,
1819
AgentBuilderError,
@@ -25,7 +26,6 @@
2526
UpdateAgentRequest,
2627
UpdateToolRequest,
2728
)
28-
from elastic_evals.api.errors import KibanaAPIError
2929

3030

3131
class _RecordingAsyncClient:

0 commit comments

Comments
 (0)