File size: 617 Bytes
c67009e
 
 
8fd8dc7
 
c67009e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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)