-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix(matchers): warn on implicit self grading fallback #10640
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: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -197,12 +197,18 @@ export async function getGradingProvider( | |
| const defaultTest = cliState.config?.defaultTest; | ||
| const defaultTestObj = typeof defaultTest === 'object' ? (defaultTest as TestCase) : null; | ||
| const fallbackProviders = [ | ||
| defaultTestObj?.provider || undefined, | ||
| defaultTestObj?.options?.provider?.text || undefined, | ||
| defaultTestObj?.options?.provider || undefined, | ||
| { provider: defaultTestObj?.provider || undefined, source: 'defaultTest.provider' }, | ||
| { | ||
| provider: defaultTestObj?.options?.provider?.text || undefined, | ||
| source: 'defaultTest.options.provider.text', | ||
| }, | ||
| { | ||
| provider: defaultTestObj?.options?.provider || undefined, | ||
| source: 'defaultTest.options.provider', | ||
| }, | ||
| ]; | ||
|
|
||
| const cfg = fallbackProviders.find((candidateProvider) => { | ||
| const fallback = fallbackProviders.find(({ provider: candidateProvider }) => { | ||
| if (!candidateProvider) { | ||
| return false; | ||
| } | ||
|
|
@@ -215,13 +221,22 @@ export async function getGradingProvider( | |
| return true; | ||
| }); | ||
|
|
||
| const cfg = fallback?.provider; | ||
| if (cfg) { | ||
| // Recursively call getGradingProvider to handle all provider types (string, object, etc.) | ||
| finalProvider = await getGradingProvider(type, cfg, defaultProvider); | ||
| if (finalProvider) { | ||
| logger.debug('[Grading] Using provider from defaultTest fallback', { | ||
| const logContext = { | ||
| providerId: finalProvider.id(), | ||
| }); | ||
| }; | ||
| if (fallback.source === 'defaultTest.provider') { | ||
| logger.warn( | ||
| '[Grading] defaultTest.provider is being used as the grader because no explicit grader is configured', | ||
| logContext, | ||
|
Comment on lines
+229
to
+235
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 Useful? React with 👍 / 👎. |
||
| ); | ||
|
Comment on lines
+233
to
+236
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 an embedding assertion such as Useful? React with 👍 / 👎.
Comment on lines
+233
to
+236
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 an eval has multiple outputs or model-graded assertions and relies on Useful? React with 👍 / 👎. |
||
| } else { | ||
| logger.debug('[Grading] Using provider from defaultTest fallback', logContext); | ||
| } | ||
| } | ||
| } else { | ||
| finalProvider = defaultProvider; | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reviewed commit uses the
fix(matchers):scope while modifying the documentation site; split this documentation change into a commit using the requireddocs(site):scope.AGENTS.md reference: site/AGENTS.md:L9-L9
Useful? React with 👍 / 👎.