This action analyzes test results and code to provide personalized feedback on student assignments, including identifying errors, suggesting improvements, and explaining concepts.
The AI tutor can identify logic errors, suggest more efficient algorithms, explain complex concepts in simpler terms, and even provide links to relevant documentation.
It would save instructors' time, provide more consistent feedback, and help students learn more effectively regardless of time & location.
Before using this action, ensure you have the following:
pip install pytest-json-report
python -m pytest --json-report --json-report-file=report.json tests/test_my_test_file.py
Please set GOOGLE_API_KEY
in the repository's secrets.
To use the action, create a workflow file (e.g., .github/workflows/classroom.yml
) in your repository and add the following configuration:
on: [push]
jobs:
grade:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: pip install pytest pytest-json-report
- name: Run tests
run: |
python -m pytest --json-report --json-report-file=report.json tests/test_my_test_file.py
- name: AI Python Tutor
uses: kangwonlee/gemini-python-tutor@v0.1.1
if: always()
with:
report-files: report.json
api-key: ${{ secrets.GOOGLE_API_KEY }}
student-files: exercise.py
readme-path: README.md
explanation-in: English
timeout-minutes: 5
pytest-json-report
plugin to understand the test results of your Python code and provide AI-powered feedback. report-files
: Comma-separated list of JSON report files generated by pytest-json-report. (Required)api-key
: Your Google API key. (Required)student-files
: Comma-separated list of Python files containing the student's code for review. (Required)readme-path
: Path to the assignment instructions (README.md). (Optional)explanation-in
: Language for explanations (e.g., English, Korean). (Optional, default: English)with:
report-files: 'report1.json, report2.json, reports/*.json'
api-key: ${{ secrets.GOOGLE_API_KEY }}
student-files: 'exercise1.py, exercise2.py'
readme-path: README.md
explanation-in: English
pytest-json-report
plugin to generate JSON test reports.Support multiple human languages.
Add AI model choice argument to select different AI models.
Support more programming languages.
Feedback on code passing all tests.
Add verbose
argument to provide more detailed feedback.
GOOGLE_API_KEY
in your repository secrets.pytest-json-report
and placed in the correct location (e.g., report.json
in the root of your repository).pytest-json-report
plugin with the recommended options to generate a valid report..py
extension.timeout-minutes
value in your workflow file or optimize your code.act
to run the action locally and debug your workflow.