-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add support for custom judges via evaluation metric key #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
8d01693
350f884
00a265e
d277b49
d67d0ab
c6d086a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -285,16 +285,17 @@ class AIJudgeConfigDefault(AIConfigDefault): | |
| Default Judge-specific AI Config with required evaluation metric key. | ||
| """ | ||
| messages: Optional[List[LDMessage]] = None | ||
| # Deprecated: evaluation_metric_key is used instead | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are sub 1.0 release as long as we can guarantee the api is always returning the new single key we should be able to just drop this and do a breaking change. They only thing that really makes this breaking is people will need to update their defaults if they defined it. If you want to drop it now update the PR to be "feat!: ". I won't block if you want to leave this in for a little while but it likely isn't necessary. The real question is how long do we want to continue sending the old values in the API as that is what will break older SDKs.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now we want to make sure this is non-breaking, but soon we're going to remove "legacy" support. For keeping this change as minimal and safe as possible I'd err on the side of caution and keep it in for the time being. |
||
| evaluation_metric_keys: Optional[List[str]] = None | ||
| evaluation_metric_key: Optional[str] = None | ||
|
|
||
| def to_dict(self) -> dict: | ||
| """ | ||
| Render the given judge config default as a dictionary object. | ||
| """ | ||
| result = self._base_to_dict() | ||
| result['messages'] = [message.to_dict() for message in self.messages] if self.messages else None | ||
| if self.evaluation_metric_keys is not None: | ||
| result['evaluationMetricKeys'] = self.evaluation_metric_keys | ||
| result['evaluationMetricKey'] = self.evaluation_metric_key | ||
| return result | ||
|
|
||
|
|
||
|
|
@@ -303,16 +304,18 @@ class AIJudgeConfig(AIConfig): | |
| """ | ||
| Judge-specific AI Config with required evaluation metric key. | ||
| """ | ||
| # Deprecated: evaluation_metric_key is used instead | ||
| evaluation_metric_keys: List[str] = field(default_factory=list) | ||
| messages: Optional[List[LDMessage]] = None | ||
| evaluation_metric_key: Optional[str] = None | ||
|
|
||
| def to_dict(self) -> dict: | ||
| """ | ||
| Render the given judge config as a dictionary object. | ||
| """ | ||
| result = self._base_to_dict() | ||
| result['evaluationMetricKeys'] = self.evaluation_metric_keys | ||
| result['messages'] = [message.to_dict() for message in self.messages] if self.messages else None | ||
| result['evaluationMetricKey'] = self.evaluation_metric_key | ||
| return result | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.