Skip to main content
Applies to:
  • Plan -
  • Deployment -

Summary

Issue: Code scorers in the Braintrust UI fail with ReferenceError: handler is not defined when the scorer function uses any name other than handler. Cause: The UI code scorer runtime requires the function to be named exactly handler. Resolution: Rename your scorer function to handler.

Resolution Steps

For TypeScript code scorers

Step 1: Rename function to handler

Update your scorer function name to handler:

For Python code scorers

Step 1: Rename function to handler

Update your scorer function name to handler:

Additional Notes

This naming requirement only applies to code scorers created in the UI. SDK-based scorers can use any function name.