Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,19 @@
|
|
| 1 |
# app.py (Finance Chatbot)
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
-
from helper import get_together_api_key
|
| 5 |
from guardrail import is_safe
|
| 6 |
from together import Together
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# Initialize Together client
|
| 9 |
-
client = Together(api_key=get_together_api_key())
|
|
|
|
| 10 |
|
| 11 |
# Function to handle the chatbot's response to user queries
|
| 12 |
# You can only answer finance-related queries.
|
|
|
|
| 1 |
# app.py (Finance Chatbot)
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
+
#from helper import get_together_api_key
|
| 5 |
from guardrail import is_safe
|
| 6 |
from together import Together
|
| 7 |
+
from dotenv import load_dotenv
|
| 8 |
+
import os
|
| 9 |
+
|
| 10 |
+
# Load environment variables
|
| 11 |
+
load_dotenv()
|
| 12 |
+
api_key = os.getenv("TOGETHER_API_KEY")
|
| 13 |
|
| 14 |
# Initialize Together client
|
| 15 |
+
#client = Together(api_key=get_together_api_key())
|
| 16 |
+
client = Together(api_key=api_key)
|
| 17 |
|
| 18 |
# Function to handle the chatbot's response to user queries
|
| 19 |
# You can only answer finance-related queries.
|