KenjiPcx / Microsoft-Imagine-Cup-2024-FeynmanLearn

https://delightful-beach-0f72d6303.4.azurestaticapps.net/
MIT License
1 stars 0 forks source link

Make a prompt to suggest similar content #23

Closed KenjiPcx closed 9 months ago

KenjiPcx commented 9 months ago

Issue details

Similar to #22, this is what happens when a user passes or excels their Feynman session, instead of suggesting them Feynman sessions for their knowledge gaps, we will focus on suggesting sessions for similar topics

KenjiPcx commented 9 months ago

@thatjosh I see this code that already done this

# Generate sugggestions for new topics in subsequent feynman sessions 
        prompt = ChatPromptTemplate.from_template("Suggest 5 topics that are {topic_type} for a student to learn about, based on the content the student explored in the session. Return just the topics as a list of strings (the output should be parsable by json.loads in python) and nothing extra. \n Questions, score and concept explored in current learning session: \n {content}")
        output_parser = StrOutputParser()
        chain = prompt | langchain_llm | output_parser
        topics_str = chain.invoke({"content": content, "topic_type": topic_type})
        topic_list = json.loads(topics_str)
        logging.info(topic_list)

Can you confirm and close?

thatjosh commented 9 months ago

Yup yup