-
Notifications
You must be signed in to change notification settings - Fork 648
Fix handling and documentation for the cleanup attribute of EvalOutputConfig
#1907
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
base: develop
Are you sure you want to change the base?
Changes from all commits
6cece48
7e25893
b76f701
a99faed
48c0fac
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 |
|---|---|---|
|
|
@@ -132,12 +132,16 @@ class EvalGeneralConfig(BaseModel): | |
| "this creates a fresh workflow instance per eval item, resetting all stateful tools to their " | ||
| "initial state. Set to False to disable this behavior.") | ||
|
|
||
| # overwrite the output_dir with the output config if present | ||
| # If output_dir is defined and output is not, define an EvalOutputConfig with output_dir as the dir | ||
| @model_validator(mode="before") | ||
| @classmethod | ||
| def override_output_dir(cls, values): | ||
| if values.get("output") and values["output"].get("dir"): | ||
| values["output_dir"] = values["output"]["dir"] | ||
| output_config = values.get("output") | ||
| if output_config is None: | ||
| output_dir = values.get("output_dir") | ||
| if output_dir is not None: | ||
| values["output"] = EvalOutputConfig(dir=output_dir) | ||
|
|
||
|
Comment on lines
+139
to
+144
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.
When 💡 Proposed fix `@model_validator`(mode="before")
`@classmethod`
def override_output_dir(cls, values):
output_config = values.get("output")
- if output_config is None:
- output_dir = values.get("output_dir")
- if output_dir is not None:
- values["output"] = EvalOutputConfig(dir=output_dir)
+ output_dir = values.get("output_dir")
+
+ if output_config is None:
+ if output_dir is not None:
+ values["output"] = EvalOutputConfig(dir=output_dir)
+ else:
+ # Keep legacy/expected precedence: output.dir overrides output_dir
+ if isinstance(output_config, dict):
+ out_dir = output_config.get("dir")
+ if out_dir is not None:
+ values["output_dir"] = out_dir
+ elif isinstance(output_config, EvalOutputConfig):
+ values["output_dir"] = output_config.dir
return values🤖 Prompt for AI Agents |
||
| return values | ||
|
|
||
| @classmethod | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.