Conversation
05c9ca9 to
ad5f899
Compare
|
Meta question: What is the pressing need for evaluators to be serializable ? |
During conversion to coded agents, we need to change the implementation from |
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
| EVALUATOR_SCHEMA_TO_EVALUATOR_CLASS = { |
There was a problem hiding this comment.
dumb question: where did this go ? how are we doing this conversion now ?
There was a problem hiding this comment.
We don't need this. TypeAdapter(CodedEvaluator).validate_python(...) uses the discriminator to resolve it correctly.
There was a problem hiding this comment.
you mean, dynamic class conversion ? Am curious, why couldn't we do that in the previous form - because of the naming inconsistency ?
There was a problem hiding this comment.
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. 🙃
There was a problem hiding this comment.
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": |
ad5f899 to
836ac54
Compare
Currently, evaluators cannot be serialized and deserialized. This implementation fixes it.
836ac54 to
c252a34
Compare
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?
BaseEvaluatortoGenericBaseEvaluator.BaseLegacyEvaluatornow extendsGenericBaseEvaluator. All legacy evaluators extends fromBaseLegacyEvaluator.BaseEvaluatornow extendsGenericBaseEvaluator. All coded agent evaluators extends fromBaseEvaluator. The nameBaseEvaluatoris NOT namedBaseCodedEvaluatorin order to keep in sync with the custom evaluator contract.nameanddescriptionare now pydantic fields.configfield removed from the object as it is redundant.*_typefields inGenericBaseEvaluatorare marked asexclude=Truefor serialization safety.TypeAdapter(Evaluator).validate_python(...).Development Package
uipath pack --nolockto get the latest dev build from this PR (requires version range).