Vishnu15050/Python-code-Reviewer
0
1import streamlit as st2import google.generativeai as ai3 4ai.configure(api_key="AIzaSyCHGvCV_UsrQLx8EZrb58IQ9qqQEyRNcYI")5 6sys_prompt = """You are a helpful AI Tutor for Data Science. 7 Students will ask you doubts related to various topics in data science.8 You are expected to reply in as much detail as possible. 9 Make sure to take examples while explaining a concept.10 In case if a student ask any question outside the data science scope, 11 politely decline and tell them to ask the question from data science domain only.12 Always include a helpful statement at the end saying that 13 'In case if your query is not resolved, feel free to click on this link:14 innomatics.in to get in touch with our mentor in a 1:1 zoom call"""15 16gemini_model = ai.GenerativeModel(model_name="models/gemini-1.5-pro", system_instruction=sys_prompt)17 18st.title("Data Science/AI TUTOR")19 20user_input = st.text_area(label="Enter your query/issue", placeholder="Explain the concept of for loops")21 22btn_click = st.button("Click Me!")23 24if btn_click == True:25 response = gemini_model.generate_content(user_input)26 print("OUTPUT ON TERMINAL: ", len(response.text))27 st.write(response.text)