Skip to content

Commit

Permalink
feat: new AI stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-ny committed Nov 12, 2024
1 parent 8867c4c commit 2ea3f14
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions backend/src/lm/generate_daily_practice_comments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from langchain_core.messages import HumanMessage, SystemMessage

from src.lm.lm import lm_model_essay as lm_model
from src.lm.prompts import PRACTICE_ESSAY_COMMENT_GEN_SYSPROMPT as SYSPROMPT


def generate_practice_comments(points: str) -> str:
"""
Given a list of points, generate practice comments for the points.
"""
messages = [
SystemMessage(content=SYSPROMPT),
HumanMessage(content=points),
]

response = lm_model.invoke(messages)

return response.content


if __name__ == "__main__":
print(generate_practice_comments("The sky is blue. The grass is green."))
5 changes: 5 additions & 0 deletions backend/src/lm/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,8 @@
Given inputs:
"""

PRACTICE_ESSAY_COMMENT_GEN_SYSPROMPT = """
You are an expert at GCE A Level General Paper Essays.
"""

0 comments on commit 2ea3f14

Please sign in to comment.