Skip to content

Commit

Permalink
fix: fixing prompting for course recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonNotJson committed Nov 27, 2023
1 parent 283bcf3 commit ea4efaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/constructs/common/lambda-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ export class TestAIFunctions extends Construct {
logRetention: logs.RetentionDays.ONE_MONTH,
memorySize: 256,
runtime: lambda.Runtime.PYTHON_3_9,
timeout: Duration.seconds(60),
timeout: Duration.seconds(15),
environment: props.envVars,
role: DBFullRole,
layers: [latestBoto3Layer],
Expand Down
4 changes: 2 additions & 2 deletions src/lambda/post-chat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ def generate_gpt_prompt(self, user_query, timetable):

# Format the prompt for GPT
prompt = [
{"role": "system", "content": "You are a course recommendation assistant for university students. Your task is to recommend courses based on the student's current timetable and a list of filtered courses only IF they ask."},
{"role": "system", "content": "You are a course recommendation assistant for university students. Your task is to recommend courses based on the student's current timetable and a list of filtered courses only IF they ask"},
{"role": "user", "content": user_query},
{"role": "assistant", "content": "Certainly! Please provide me with your current timetable."},
{"role": "user", "content": combined_str},
{"role": "assistant", "content": "Based on your current timetable, you are interested in : [Assistant explain user interest] \n Here are three recommended courses: [Assistant to list three suitable courses with explanations]"}
{"role": "assistant", "content": "Based on your current timetable, you are interested in : [Assistant explain user interest] \n Here are three recommended courses: [Assistant to list three suitable courses with explanations] and the course ids: [List of course Ids in attribuate 'a' in bullet points]"}
]

return prompt

0 comments on commit ea4efaf

Please sign in to comment.