Applies to:
- Plan - Any
- Deployment - Any
- Use case - Inspect a deployed code scorer whose source preview is missing.
Inspect the stored definition
Use thebt CLI to retrieve the function object:
--version <version> if you’re investigating a specific deployed version. See bt functions view for all selectors.
For a bundled code scorer, check these fields in the returned function object:
Find the original source
Check the repository or files used to publish the scorer. Abundle_id identifies the executable bundle, but it isn’t a source preview. Creating another scorer that references the same bundle does not restore a missing preview or reconstruct the original source files.
If you still have the source, keep it in version control. Preview availability depends on the upload workflow, so republishing alone doesn’t guarantee a preview.
Add a preview from known source
If you have the source that matches the deployed bundle, you can add it as a display-only preview:- Retrieve the latest function object with
bt functions view --id <function-id> --json. - Copy the complete
function_dataobject and setfunction_data.data.previewto the source code as a JSON string. Preserve the other fields, includingbundle_id,location, andruntime_context. - Use Partially update function to send the updated object in the request body’s
function_datafield toPATCH /v1/function/{function_id}. - Retrieve the latest definition again to confirm the preview was saved, then refresh the scorer page to view it.
- The function ID and the version you inspected.
- The original publish command and CLI or SDK version, if known.
- The returned
function_dataobject, with sensitive source or configuration values removed.