SDK Migration Guide
Migrate your Scorecard code from the old SDK to the new SDK.
In SDK v1, we imported from scorecard
(Python) or scorecard-ai
(JavaScript).
In SDK v2, we import from scorecard_ai
(Python) or scorecard-ai
(JavaScript).
In SDK v1, we supported creating a Run with a Scoring Config (a collection of Metrics).
We specified IDs as integers.
In SDK v2, Runs can only be created with a list of Metric IDs, not a Scoring Config ID.
The IDs are the same, but are now strings instead of integers.
Specifying the Project ID is now required.
In SDK v1, Testsets were not based on schemas and required that Testcases followed the format of userQuery
and ideal
.
In SDK v2, Testsets are much more flexible and applicable to use cases beyond chat bots. You define the schema of a Testset.
Note that the Project ID now required.
In SDK v1, Testcases were created with a user_query
and ideal
.
In SDK v2, Testcases are now created with a jsonData
field that matches the schema of the Testset.
For any operations not listed here, refer to the SDK v2 docs.