Skip to content

Commit e0a9211

Browse files
authored
fix: make model field optional in LegacyLlmAsAJudgeEvaluator [AE-1306] (#1488)
1 parent 8725ce0 commit e0a9211

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

packages/uipath/src/uipath/eval/evaluators/legacy_context_precision_evaluator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import json
55
from typing import Any, Optional
66

7+
from pydantic import Field
8+
79
from uipath.platform import UiPath
810
from uipath.platform.chat import UiPathLlmChatService
911

@@ -99,7 +101,7 @@ class LegacyContextPrecisionEvaluator(
99101
The final score is the mean of all chunk relevancy scores (normalized to 0-1).
100102
"""
101103

102-
model: str
104+
model: str = Field(default="same-as-agent")
103105
query_placeholder: str = "{{Query}}"
104106
chunks_placeholder: str = "{{Chunks}}"
105107
llm: Optional[UiPathLlmChatService] = None

packages/uipath/src/uipath/eval/evaluators/legacy_faithfulness_evaluator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import json
44
from typing import Any, Optional
55

6+
from pydantic import Field
7+
68
from uipath.platform import UiPath
79
from uipath.platform.chat import UiPathLlmChatService
810

@@ -39,7 +41,7 @@ class LegacyFaithfulnessEvaluator(
3941
The final score is the percentage of claims that are grounded.
4042
"""
4143

42-
model: str
44+
model: str = Field(default="same-as-agent")
4345
llm: Optional[UiPathLlmChatService] = None
4446

4547
def model_post_init(self, __context: Any):

packages/uipath/src/uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import logging
44
from typing import Any, Optional
55

6-
from pydantic import field_validator
6+
from pydantic import Field, field_validator
77

88
from uipath.platform import UiPath
99
from uipath.platform.chat import UiPathLlmChatService
@@ -41,7 +41,7 @@ class LegacyLlmAsAJudgeEvaluator(BaseLegacyEvaluator[LegacyLlmAsAJudgeEvaluatorC
4141
"""Legacy evaluator that uses an LLM to judge the quality of agent output."""
4242

4343
prompt: str
44-
model: str
44+
model: str = Field(default="same-as-agent")
4545
actual_output_placeholder: str = "{{ActualOutput}}"
4646
expected_output_placeholder: str = "{{ExpectedOutput}}"
4747
llm: Optional[UiPathLlmChatService] = None

packages/uipath/src/uipath/eval/evaluators/legacy_trajectory_evaluator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Any, Optional
55

66
from opentelemetry.sdk.trace import ReadableSpan
7-
from pydantic import field_validator
7+
from pydantic import Field, field_validator
88

99
from uipath.platform import UiPath
1010
from uipath.platform.chat import UiPathLlmChatService
@@ -42,7 +42,7 @@ class LegacyTrajectoryEvaluator(BaseLegacyEvaluator[LegacyTrajectoryEvaluatorCon
4242
"""Legacy evaluator that analyzes the trajectory/path taken to reach outputs."""
4343

4444
prompt: str
45-
model: str
45+
model: str = Field(default="same-as-agent")
4646
expected_agent_behavior_placeholder: str = "{{ExpectedAgentBehavior}}"
4747
agent_run_history_placeholder: str = "{{AgentRunHistory}}"
4848
llm: Optional[UiPathLlmChatService] = None

0 commit comments

Comments
 (0)