Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,11 @@ import os
|
|
3 |
|
4 |
from crew import get_financial_trading_crew
|
5 |
|
6 |
-
def invoke(openai_api_key,
|
7 |
if (openai_api_key == ""):
|
8 |
raise gr.Error("OpenAI API Key is required.")
|
9 |
-
if (
|
10 |
-
raise gr.Error("
|
11 |
if (stock_selection == ""):
|
12 |
raise gr.Error("Stock Ticker is required.")
|
13 |
if (initial_capital == ""):
|
@@ -20,7 +20,7 @@ def invoke(openai_api_key, serp_api_key, stock_selection, initial_capital, risk_
|
|
20 |
raise gr.Error("News Impact Consideration is required.")
|
21 |
|
22 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
23 |
-
os.environ["SERPER_API_KEY"] =
|
24 |
|
25 |
financial_trading_inputs = {
|
26 |
"stock_selection": stock_selection,
|
@@ -41,7 +41,7 @@ gr.close_all()
|
|
41 |
|
42 |
demo = gr.Interface(fn = invoke,
|
43 |
inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
|
44 |
-
gr.Textbox(label = "
|
45 |
gr.Textbox(label = "Stock Ticker", value="SAN", lines = 1),
|
46 |
gr.Textbox(label = "Initial Capital", value=1000, lines = 1),
|
47 |
gr.Textbox(label = "Risk Tolerance", value="Medium", lines = 1),
|
|
|
3 |
|
4 |
from crew import get_financial_trading_crew
|
5 |
|
6 |
+
def invoke(openai_api_key, serper_api_key, stock_selection, initial_capital, risk_tolerance, trading_strategy_preference, news_impact_consideration):
|
7 |
if (openai_api_key == ""):
|
8 |
raise gr.Error("OpenAI API Key is required.")
|
9 |
+
if (serper_api_key == ""):
|
10 |
+
raise gr.Error("Serper API Key is required.")
|
11 |
if (stock_selection == ""):
|
12 |
raise gr.Error("Stock Ticker is required.")
|
13 |
if (initial_capital == ""):
|
|
|
20 |
raise gr.Error("News Impact Consideration is required.")
|
21 |
|
22 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
23 |
+
os.environ["SERPER_API_KEY"] = serper_api_key
|
24 |
|
25 |
financial_trading_inputs = {
|
26 |
"stock_selection": stock_selection,
|
|
|
41 |
|
42 |
demo = gr.Interface(fn = invoke,
|
43 |
inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
|
44 |
+
gr.Textbox(label = "Serper API Key", type = "password", lines = 1),
|
45 |
gr.Textbox(label = "Stock Ticker", value="SAN", lines = 1),
|
46 |
gr.Textbox(label = "Initial Capital", value=1000, lines = 1),
|
47 |
gr.Textbox(label = "Risk Tolerance", value="Medium", lines = 1),
|