The application uses the following environment variables for configuration:
-
OPEN_AI_MODEL
: Specifies the model which OpenAI's client will use to process requests. The default is gpt-3.5-turbo. -
OPEN_AI_TEMPERATURE
: Adjusts the randomness of the model's output. A higher value (like 1.0) makes the output more random, while a lower value (like 0.1) makes it more deterministic. The default value is 0.1. -
SYSTEM_PROMPT
: Contains the default system prompt to be given to the AI. If it is not set, the system_prompt_default method will be used to create a default prompt. -
USER_PROMPT
: Used to customize the part of the prompt that instructs the AI about the user's role. It provides context about the task at hand. -
ROLE_PROMPT
: Specifies the role of the AI, such as "You are an advanced Teaching Assistant AI". -
INPUT_DESCRIPTION
: Used to describe the input data format. If not provided, a default input description is used. -
OUTPUT_DESCRIPTION
: Used to describe the desired output format for the AI's response. If not provided, a default output description is used. -
OPENAI_ACCESS_TOKEN
: This is the API access token obtained from OpenAI. This is a required field and doesn't have a default value. -
OPENAI_ORGANIZATION_ID
: This is an optional ID of your organization in OpenAI. If not provided, it defaults to an empty string. -
REVIEW_END_POINT
: This environment variable specifies the URL of the endpoint where the reviews are sent. -
REVIEW_BOT_USER_TOKEN
: This environment variable represents the token used for authorization when sending the reviews.
Note: You need to specify USER_PROMPT and ROLE_PROMPT mandatorily unless you provide a SYSTEM_PROMPT.
In GitHub Actions, you can set environment variables for a specific step in your workflow file (.github/workflows/workflow.yml). Here's an example:
name: "English Language Course L1 | Auto Grade"
on:
push:
branches: ["submission-*"]
env:
OPENAI_ACCESS_TOKEN: ${{ secrets.OPENAI_ACCESS_TOKEN }}
OPENAI_ORGANIZATION_ID: ${{ secrets.OPENAI_ORGANIZATION_ID }}
REVIEW_BOT_USER_TOKEN: ${{ secrets.REVIEW_BOT_USER_TOKEN }}
REVIEW_END_POINT: ${{ secrets.REVIEW_END_POINT }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Report status to LMS
uses: pupilfirst/report-action@v1
with:
status: "in_progress"
description: "AI Review has started reviewing the submission"
- name: AI auto review
id: ai-review
uses: pupilfirst/ai-review-action@v1
with:
ROLE_PROMPT: "You are an advanced English Language Teaching Assistant AI. Your task involves reviewing and providing feedback on student submissions, paying meticulous attention to grammar, punctuation, and style errors."
USER_PROMPT: >
The conversation should include the following:
- The specific Discord channel the conversation takes place in.
- The initial question, marked with "Student: ", outlining the student's doubt.
- The instructor's response, labelled with "Instructor: ", that provides a solution.
- A follow-up question for clarification, again starting with "Student: ", to delve into what the instructor meant.
Ensure that the student applies the lessons they learned in the current level:
- Provide context, steps taken, and error messages for both the initial question and the follow-up.
- Frame questions around the "why" and "how" aspects.
- Ask for additional examples, if necessary.
- Thank the instructor in a proper and considerate manner.
The feedback should focus on the following areas (with the ideal condition in brackets):
1. Providing Context & Background (The student delivers clear and detailed context, steps taken, and error messages).
2. Clarity (The conversation is clear and easy to understand throughout).
3. Expressing Thanks (The student thanks the instructor genuinely and appropriately).
4. Appropriate Tone & Etiquette (The student maintains a professional and respectful tone throughout the conversation).
Make sure to identify and highlight all grammar, punctuation, and style errors.
The student's submission will be as follows:
${SUBMISSION}
- name: Report Status to LMS.
if: steps.ai-review.outcome == 'success'
uses: pupilfirst/report-action@v1
with:
status: "success"
description: AI has reviewed the submission successfully