mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
chore(studio): pin online scorer threads to the built-in preprocessor (#50981)
Pins the online scorers' `trace.getThread()` to the built-in `thread` preprocessor, so we can set the Assistant project's default preprocessor to a [custom one for Topics](https://linear.app/supabase/issue/AI-1258/add-a-topics-preprocessor-that-caps-tool-results-in-assistant-traces) without changing scorer input. `getThread()` otherwise [uses the project default](https://github.com/braintrustdata/braintrust-sdk-javascript/blob/cc165a4843805b531645ddb1d27969204aab9ade/js/src/trace.ts#L807). Ref AI-1258 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Corrected thread retrieval to use Braintrust’s thread preprocessor, ensuring evaluation traces are processed consistently. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
1 parent
b2cf3693dd
commit
e3a937edb0
2 files changed
+3
-2
No files matched your search
@@ -70,7 +70,7 @@ describe('scorers with online (null) output', () => {
|
||||
const { trace, getThread } = mockTrace(THREAD_WITH_DOCS_URL)
|
||||
const result = await runUrlValidityScorer(null, trace)
|
||||
|
||||
expect(getThread).toHaveBeenCalled()
|
||||
expect(getThread).toHaveBeenCalledWith({ preprocessor: 'thread' })
|
||||
expect(result).toMatchObject({ name: 'URL Validity', score: 1, metadata: { urls: [DOCS_URL] } })
|
||||
|
||||
vi.unstubAllGlobals()
|
||||
|
||||
@@ -223,5 +223,6 @@ export function getThreadPartsFromThread(thread: unknown[]): Transcript {
|
||||
* in a way the offline path isn't).
|
||||
*/
|
||||
export async function getThreadParts(trace: Trace): Promise<Transcript> {
|
||||
return getThreadPartsFromThread(await trace.getThread())
|
||||
// Pinned to not rely on project's default preprocessor, which may be custom for Topics
|
||||
return getThreadPartsFromThread(await trace.getThread({ preprocessor: 'thread' }))
|
||||
}
|
||||
Reference in new issue
Block a user