Skip to content

Commit 8a77b71

Browse files
committed
Upgrade OpenAI model to GPT-4o and increase input length limit for syllabus, transcript, and grades processing
1 parent 290b9c3 commit 8a77b71

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

functions-node/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -665,13 +665,13 @@ async function processExtractedText(docs) {
665665
// Process syllabus text with OpenAI
666666
console.log('Calling OpenAI API for syllabus processing');
667667
const response = await openai.chat.completions.create({
668-
model: "gpt-3.5-turbo",
668+
model: "gpt-4o",
669669
messages: [
670670
{
671671
role: "system",
672672
content: "Extract the following information from this syllabus in JSON format: course_name, instructor, grade_weights (array of {name, weight}), assignments (array), due_dates (array of {assignment, due_date}), credit_hours"
673673
},
674-
{ role: "user", content: docs.syllabus.substring(0, 4000) } // Limit length to avoid token limits
674+
{ role: "user", content: docs.syllabus.substring(0, 10000) } // Limit length to avoid token limits
675675
]
676676
});
677677

@@ -707,13 +707,13 @@ async function processExtractedText(docs) {
707707
// Process transcript text with OpenAI
708708
console.log('Calling OpenAI API for transcript processing');
709709
const response = await openai.chat.completions.create({
710-
model: "gpt-3.5-turbo",
710+
model: "gpt-4o",
711711
messages: [
712712
{
713713
role: "system",
714714
content: "Extract the following information from this transcript in JSON format: gpa, final_grade"
715715
},
716-
{ role: "user", content: docs.transcript.substring(0, 4000) } // Limit length to avoid token limits
716+
{ role: "user", content: docs.transcript.substring(0, 10000) } // Limit length to avoid token limits
717717
]
718718
});
719719

@@ -742,13 +742,13 @@ async function processExtractedText(docs) {
742742
// Process grades text with OpenAI - improved prompt
743743
console.log('Calling OpenAI API for grades processing');
744744
const response = await openai.chat.completions.create({
745-
model: "gpt-3.5-turbo",
745+
model: "gpt-4o",
746746
messages: [
747747
{
748748
role: "system",
749749
content: "Extract current grades from this document in JSON format. Parse the document carefully, looking for assignment names and their corresponding grades. Return an array of objects, each with 'name' and 'grade' properties. For each assignment that has a score, include it as a numeric value. For assignments with 'Dropped!' status, set the grade property to 'Dropped'. Format example: [{\"name\": \"Week 1 HW\", \"grade\": 100}, {\"name\": \"Week 2 HW\", \"grade\": 95.5}, {\"name\": \"Quiz 1\", \"grade\": \"Dropped\"}]"
750750
},
751-
{ role: "user", content: docs.grades.substring(0, 4000) } // Limit length to avoid token limits
751+
{ role: "user", content: docs.grades.substring(0, 10000) } // Limit length to avoid token limits
752752
]
753753
});
754754

@@ -827,7 +827,7 @@ async function generatePrediction(structuredData) {
827827
// Call the OpenAI API
828828
console.log('Calling OpenAI API for prediction');
829829
const response = await openai.chat.completions.create({
830-
model: "gpt-3.5-turbo",
830+
model: "gpt-4o",
831831
messages: [
832832
{ role: "system", content: "You are a concise academic advisor." },
833833
{ role: "user", content: prompt }

0 commit comments

Comments
 (0)