Using the Scorecard SDK
Another way of kicking off evaluations is via the Scorecard SDK. To further automate your development workflows, you can integrate Scorecard AI by GitHub Actions. Through this platform, evaluations are seamlessly run and integrated with your codebase, either automatically upon specific triggers or manually when needed.
Automated Runs on Push/PR
When integrated, GitHub Actions automatically run evaluations for Scorecard AI each time a push or pull request is made to the repository. This is a fundamental feature, ensuring that your system under test remains consistent with expected behavior after each code change.
For instance, consider you’ve made significant changes in a feature branch and raise a pull request to merge it with the main branch. Scorecard AI, using the GitHub Actions automation, will immediately run the necessary evaluations. The results can then be viewed directly on the pull request, helping developers address any discrepancies before finalizing the merge.
To set this up:
- Ensure the triggering conditions in your
.github/workflows/scorecard-eval.yml
file are appropriately set. Theon: push:
andon: pull_request:
sections should be uncommented to enable automatic runs on these events.
Manual Triggering via GitHub UI
For scenarios where you’d like to run evaluations without any code change, GitHub offers the “workflow_dispatch” event. This manual trigger allows users to start evaluations directly from the GitHub repository’s Actions tab.
Steps:
- Navigate to your repository on GitHub.
- Click on the “Actions” tab.
- Locate the “Scorecard Eval” workflow.
- Click on the “Run workflow” dropdown.
- Input the necessary parameters (like Testset ID, Scoring Config ID) if prompted.
- Click the “Run workflow” button.
This flexibility ensures that even without a new push or PR, developers can assess system performance using Scorecard AI.
Triggering via Scorecard API
For those looking for a programmatic approach to run evaluations, Scorecard AI can trigger GitHub Actions using a repository dispatch event via the Scorecard API. This method is particularly useful when integrating evaluations as part of a more extensive CI/CD process or another system.
To utilize this:
- Ensure your
.github/workflows/scorecard-eval.yml
file has therepository_dispatch
event configured. - Use the Scorecard API endpoint for triggering evaluations.
These diverse triggering methods support a broad range of development workflows, offering flexibility to best fit your specific needs.