import streamlit as st import os import google.generativeai as genai from dotenv import load_dotenv #Load environment variables from .env file load_dotenv() # Configure api genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) # Function to load Gemini Pro model and get responses model = genai.GenerativeModel("gemini-1.5-pro") def get_gemini_response(question): response=model.generate_content(question) return response.text # Initialize the streamlit app st.set_page_config(page_title="GemQuest") # App name st.markdown("

GemQuest

", unsafe_allow_html=True) # Input and submit input=st.text_input(" ", key="input", placeholder="Ask GemQuest") submit=st.button("Submit") ## When submit is clicked if submit: response=get_gemini_response(input) st.write(response)