Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,13 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
|
|
|
| 3 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 4 |
google_api_key = st.sidebar.text_input("Provide Your Google Gemini API Key")
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
def llm_response(question):
|
| 7 |
llm = ChatGoogleGenerativeAI(model="gemini-pro", temperature=0.5, google_api_key=google_api_key)
|
| 8 |
response = llm.invoke(question)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
+
import sys
|
| 4 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 5 |
google_api_key = st.sidebar.text_input("Provide Your Google Gemini API Key")
|
| 6 |
|
| 7 |
+
if not google_api_key:
|
| 8 |
+
st.write("Please Provide Your API then Try Again")
|
| 9 |
+
sys.exit(0)
|
| 10 |
+
|
| 11 |
def llm_response(question):
|
| 12 |
llm = ChatGoogleGenerativeAI(model="gemini-pro", temperature=0.5, google_api_key=google_api_key)
|
| 13 |
response = llm.invoke(question)
|