Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import gradio as gr
|
|
| 4 |
from core.stock_analysis import analyze_stock
|
| 5 |
from core.market_stock_sentiment import get_market_stock_sentiment
|
| 6 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
|
|
|
| 7 |
import os
|
| 8 |
|
| 9 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
|
@@ -13,7 +14,9 @@ def analyze_api(ticker):
|
|
| 13 |
|
| 14 |
ticker_val = ticker.strip().upper()
|
| 15 |
if ticker_val == "ALL_STOCKS":
|
| 16 |
-
|
|
|
|
|
|
|
| 17 |
else:
|
| 18 |
return analyze_stock(ticker_val, llm)
|
| 19 |
|
|
|
|
| 4 |
from core.stock_analysis import analyze_stock
|
| 5 |
from core.market_stock_sentiment import get_market_stock_sentiment
|
| 6 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 7 |
+
from core.stock_history import persist_response
|
| 8 |
import os
|
| 9 |
|
| 10 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
|
|
|
| 14 |
|
| 15 |
ticker_val = ticker.strip().upper()
|
| 16 |
if ticker_val == "ALL_STOCKS":
|
| 17 |
+
response = get_market_stock_sentiment(llm)
|
| 18 |
+
persist_response(response)
|
| 19 |
+
return response
|
| 20 |
else:
|
| 21 |
return analyze_stock(ticker_val, llm)
|
| 22 |
|