-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Setup Github Action workflow file for PromptFoo #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
Promptfoo Evaluation Results
View detailed results in Google Sheets Run |
Promptfoo Evaluation Results
View detailed results in Google Sheets Run |
Promptfoo Evaluation Results
|
Promptfoo Evaluation Results
View detailed results in Google Sheets » View eval results in CI console « |
Promptfoo Evaluation Results
|
Promptfoo Evaluation Results
|
Promptfoo Evaluation Results
|
Promptfoo Evaluation Results
View detailed results in Google Sheets » View eval results in CI console « |
Promptfoo Evaluation Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
||
- name: Create unique ID generator | ||
run: | | ||
cat > /tmp/generateUniqueId.js << 'EOF' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd consider moving the /docs/app/generateUniqueId.js out of the docs directory and into somwhere like app/src/evaluation and then referencing it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're not using /docs/app/generateUniqueId.js
here, the script used in promptfoo.ci.config.yaml
is written within the Create unique ID generator
step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can still move the JS file or just add it as a snippet to the README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that suggestion wasn't clear -- what I mean is move the file and then read from it here (or reference it directly in promptfoo.ci.config.yaml) so that you don't have to embed Javascript inside of a .yml file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, will move the script here and reference it
Co-authored-by: Kevin Boyer <kevinboyer@navapbc.com>
Promptfoo Evaluation Results
|
Promptfoo Evaluation Results
View detailed results in Google Sheets » View eval results in CI console « |
Promptfoo Evaluation Results
|
sed -i "s|GOOGLE_SHEET_INPUT_URL|${{ env.GOOGLE_SHEET_INPUT_URL }}|g" /tmp/promptfooconfig.processed.yaml | ||
sed -i "s|GOOGLE_SHEET_OUTPUT_URL|${{ env.GOOGLE_SHEET_OUTPUT_URL }}|g" /tmp/promptfooconfig.processed.yaml | ||
sed -i "s|CHATBOT_INSTANCE_URL|${{ env.CHATBOT_INSTANCE_URL }}|g" /tmp/promptfooconfig.processed.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try the envsubst
command instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice suggestion. Thank you.
Promptfoo Evaluation Results
|
Ticket
https://navalabs.atlassian.net/browse/DST-964
Changes
NavaLabs
team on PromptFoo to view the evaluation results through the shareable links.Testing
Workflow runs on PRs when changes are made to:
app/src/chat_api.py
app/src/chat_engine.py
app/src/generate.py
app/promptfooconfig.ci.yaml
Local Testing with Act
.secrets
file in the project root with the following environment variables:GITHUB_TOKEN
(for local testing only): Classic Personal Access Token (PAT) with 'repo' scope (Settings > Developer settings > Personal access tokens > Tokens (classic))GOOGLE_CREDENTIALS_JSON
: Service account JSON for Google Sheets accessecho "GOOGLE_CREDENTIALS_JSON='$(cat /path/to/service-account.json | jq -c .)'" >> .secrets
OPENAI_API_KEY
: OpenAI API key for LLM evaluationGOOGLE_SHEET_INPUT_URL
: URL to input test cases sheetGOOGLE_SHEET_OUTPUT_URL
: URL to output results sheetPROMPTFOO_API_KEY
: API key for PromptFoo cloud featuresGitHub Testing
Required secrets are configured in GitHub at:
Settings > Secrets and variables > Actions
(exclude GITHUB_TOKEN, this was only for local testing)Example workflow run: GitHub Actions Run
Example automatic PR comment:

Preview environment for app
♻️ Environment destroyed ♻️