bstraehle commited on
Commit
1749db2
·
verified ·
1 Parent(s): 242965f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,7 +3,7 @@ import os
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 (serp_api_key == ""):
@@ -20,7 +20,7 @@ def invoke(openai_api_key, serper_api_key, stock_selection, initial_capital, ris
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,
@@ -39,7 +39,7 @@ gr.close_all()
39
 
40
  demo = gr.Interface(fn = invoke,
41
  inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
42
- gr.Textbox(label = "SERPER API Key", type = "password", lines = 1),
43
  gr.Textbox(label = "Stock Ticker", value="SAN", lines = 1),
44
  gr.Textbox(label = "Initial Capital", value=1000, lines = 1),
45
  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, serp_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 (serp_api_key == ""):
 
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"] = serp_api_key
24
 
25
  financial_trading_inputs = {
26
  'stock_selection': stock_selection,
 
39
 
40
  demo = gr.Interface(fn = invoke,
41
  inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
42
+ gr.Textbox(label = "SERP API Key", type = "password", lines = 1),
43
  gr.Textbox(label = "Stock Ticker", value="SAN", lines = 1),
44
  gr.Textbox(label = "Initial Capital", value=1000, lines = 1),
45
  gr.Textbox(label = "Risk Tolerance", value="Medium", lines = 1),