Skip to content

Remove evaluator defs#1255

Merged
akshaylive merged 1 commit intomainfrom
akshaya/refactor_3
Feb 3, 2026
Merged

Remove evaluator defs#1255
akshaylive merged 1 commit intomainfrom
akshaya/refactor_3

Conversation

@akshaylive
Copy link
Collaborator

@akshaylive akshaylive commented Feb 3, 2026

Sorry for the massive PR.

The main change is that evaluators are currently not serializable. Additionally, evaluators cannot be model_dump'd and reconstructed. Addressing these issues by ensuring that all evaluator models are naturally pydantic.

This addresses #1246
This also fixes #1220

What changed?

  1. Renamed BaseEvaluator to GenericBaseEvaluator.
  2. BaseLegacyEvaluator now extends GenericBaseEvaluator. All legacy evaluators extends from BaseLegacyEvaluator.
  3. BaseEvaluator now extends GenericBaseEvaluator. All coded agent evaluators extends from BaseEvaluator. The name BaseEvaluator is NOT named BaseCodedEvaluator in order to keep in sync with the custom evaluator contract.
  4. name and description are now pydantic fields.
  5. config field removed from the object as it is redundant.
  6. *_type fields in GenericBaseEvaluator are marked as exclude=True for serialization safety.
  7. Evaluator factory is now vastly simplified considering they can be instantiated using TypeAdapter(Evaluator).validate_python(...).
  8. Standardizing evaluator naming scheme.

Development Package

  • Use uipath pack --nolock to get the latest dev build from this PR (requires version range).
  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath==2.7.1.dev1012554529",

  # Any version from PR
  "uipath>=2.7.1.dev1012550000,<2.7.1.dev1012560000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath = { index = "testpypi" }

[tool.uv]
override-dependencies = [
    "uipath>=2.7.1.dev1012550000,<2.7.1.dev1012560000",
]

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Feb 3, 2026
@akshaylive akshaylive force-pushed the akshaya/refactor_3 branch 2 times, most recently from 05c9ca9 to ad5f899 Compare February 3, 2026 17:53
@akshaylive akshaylive added the build:dev Create a dev build from the pr label Feb 3, 2026
@mjnovice
Copy link
Contributor

mjnovice commented Feb 3, 2026

Meta question: What is the pressing need for evaluators to be serializable ?

@akshaylive
Copy link
Collaborator Author

Meta question: What is the pressing need for evaluators to be serializable ?

During conversion to coded agents, we need to change the implementation from evals/ to evaluators/. The coded agents frontend does not understand legacy evaluators so we need to convert it. This change would simplify the conversion of evaluators.


logger = logging.getLogger(__name__)

EVALUATOR_SCHEMA_TO_EVALUATOR_CLASS = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dumb question: where did this go ? how are we doing this conversion now ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this. TypeAdapter(CodedEvaluator).validate_python(...) uses the discriminator to resolve it correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean, dynamic class conversion ? Am curious, why couldn't we do that in the previous form - because of the naming inconsistency ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the previous implementation, the coded evaluators were discriminating on the configs and not the evaluators. Ideally the original implementation should've been this implementation. 🙃

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was done to be too explicit in the previous implementation thanks for fixing it @akshaylive. @mjnovice we will need a few more rounds of refactoring to get it to GA level in the progress reporting side too :D

| LegacyContextPrecisionEvaluator
| LegacyFaithfulnessEvaluator,
):
if evaluator.model == "same-as-agent":
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually tested this part. Screenshot:

image

Currently, evaluators cannot be serialized and deserialized.
This implementation fixes it.
@akshaylive akshaylive merged commit 5eb0c30 into main Feb 3, 2026
181 of 196 checks passed
@akshaylive akshaylive deleted the akshaya/refactor_3 branch February 3, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:dev Create a dev build from the pr test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Legacy evaluator name is incorrect

3 participants