AI_ChatBot / src /streamlit_app.py
Gunasai1907's picture
Update src/streamlit_app.py
c67009e verified
#import the packages
from langchain_google_genai import ChatGoogleGenerativeAI
import os
import streamlit as st
#setup api key to use Gemini API
from dotenv import load_dotenv
load_dotenv()
apiKey = os.getenv('GOOGLE_API_KEY')
#setup a LLM
llm = ChatGoogleGenerativeAI(model="gemini-2.0-flash" ,api_key = apiKey)
# query = input('Ask Query: ')
# res = llm.invoke(query)
# print(res.content)
#build the streamlit app
st.title('My Personal AI ChatBot')
st.header('Ask me anything')
user_input = st.text_input("Enter Your Query", key='input')
if user_input:
res = llm.invoke(user_input)
st.write(res.content)