dipsmom commited on
Commit
0a834e0
1 Parent(s): e3d4c90

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ langchain-google-genai
2
+ import streamlit as st
3
+ from langchain_google_genai import ChatGoogleGenerativeAI
4
+
5
+ st.title("Gemini ChatBOT")
6
+
7
+ def llm_response(user_input):
8
+ llm = ChatGoogleGenerativeAI(model="gemini-pro")
9
+ result = llm.invoke(user_input)
10
+ return print(result.content)
11
+
12
+ user_input = st.text_area("Enter your query here...")
13
+
14
+ if st.button("Get Response") and user_input:
15
+ with st.spinner("Generating Response..."):
16
+ answer = llm_response(user_input)
17
+ if answer is not None:
18
+ st.success('Great! Response generated successfully')
19
+ st.write(answer)