Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
import gradio as gr
|
4 |
from core.stock_analysis import analyze_stock
|
|
|
5 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
6 |
import os
|
7 |
|
@@ -9,7 +10,12 @@ GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
|
9 |
llm = ChatGoogleGenerativeAI(model="gemini-2.5-pro", google_api_key=GOOGLE_API_KEY)
|
10 |
|
11 |
def analyze_api(ticker):
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
demo = gr.Interface(
|
15 |
fn=analyze_api,
|
|
|
2 |
|
3 |
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 |
|
|
|
10 |
llm = ChatGoogleGenerativeAI(model="gemini-2.5-pro", google_api_key=GOOGLE_API_KEY)
|
11 |
|
12 |
def analyze_api(ticker):
|
13 |
+
|
14 |
+
ticker_val = ticker.strip().upper()
|
15 |
+
if ticker_val == "ALL_STOCKS":
|
16 |
+
return get_market_stock_sentiment(llm)
|
17 |
+
else:
|
18 |
+
return analyze_stock(ticker_val, llm)
|
19 |
|
20 |
demo = gr.Interface(
|
21 |
fn=analyze_api,
|