Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,3 @@
|
|
1 |
-
import os
|
2 |
-
|
3 |
-
# Set the path to the service account key
|
4 |
-
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "/content/firm-catalyst-437006-s4-407500537db5.json"
|
5 |
-
|
6 |
import os
|
7 |
import gradio as gr
|
8 |
from langchain_google_genai.chat_models import ChatGoogleGenerativeAI
|
@@ -16,7 +11,7 @@ llm = ChatGoogleGenerativeAI(model="gemini-1.5-pro")
|
|
16 |
def chat_with_gemini(user_input):
|
17 |
try:
|
18 |
# Prepare the prompt in the expected format
|
19 |
-
response = llm.predict(user_input) # Using the 'predict' method
|
20 |
return response
|
21 |
except Exception as e:
|
22 |
return f"Error: {str(e)}"
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from langchain_google_genai.chat_models import ChatGoogleGenerativeAI
|
|
|
11 |
def chat_with_gemini(user_input):
|
12 |
try:
|
13 |
# Prepare the prompt in the expected format
|
14 |
+
response = llm.predict(user_input) # Using the 'predict' method
|
15 |
return response
|
16 |
except Exception as e:
|
17 |
return f"Error: {str(e)}"
|