Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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)
|