Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| import google.generativeai as genai | |
| import os | |
| from dotenv import load_dotenv | |
| load_dotenv() ## load all our environment variables | |
| os.getenv("GOOGLE_API_KEY") | |
| genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) | |
| def get_gemini_response(input): | |
| model=genai.GenerativeModel('gemini-pro') | |
| response=model.generate_content(input) | |
| return response.text | |
| ## streamlit app | |
| # Set page title and description | |
| st.set_page_config(page_title="AI Lesson Plan Generator for ICSE by Jishnu Setia", page_icon=":books:") | |
| st.title("AI Lesson Plan Generator for ICSE by Jishnu Setia") | |
| st.write("Create interactive lesson plans for your students") | |
| st.write("Note: Their may be hallucinations in some instances") | |
| # Input fields | |
| with st.form("Lesson Plan Form"): | |
| st.header("Lesson Plan Details") | |
| topic = st.text_input("Topic Name") | |
| grade = st.text_input("Grade") | |
| submit_button = st.form_submit_button("Generate Lesson Plan") | |
| # Generate and display lesson plan | |
| if submit_button: | |
| input_prompt = f""" | |
| You're an ICSE (Indian Certificate of Secondary Education) teacher preparing a lesson plan tailored to the specific needs of your students. | |
| Take into consideration the grade level {grade} and the topic to cover in your lesson. Topic is {topic}. Your task is to create a detailed lesson plan focusing on the chosen topic, ensuring it aligns with the curriculum standards for that grade level. | |
| Include engaging activities, clear explanations, and relevant visual aids to enhance understanding and retention among your students. | |
| Give your response based on the topic in this structure: | |
| Topic Name: | |
| Learning Intention | |
| Learning Objective: | |
| Success Criteria: | |
| Points which will be covered in class: (Elaborate on each point) | |
| Questions for a small quiz: | |
| Ways to make the class interactive: | |
| """ | |
| response = get_gemini_response(input_prompt.format(grade=grade, topic=topic)) | |
| st.header("Generated Lesson Plan") | |
| st.subheader(response) | |