seawolf2357 commited on
Commit
17fd055
·
verified ·
1 Parent(s): 58e1790

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -82,20 +82,20 @@ def process_financial_data(ticker):
82
  stock_info = stock.info # 주식 정보
83
  financial_data = stock.history(period="max") # 주식 데이터 다운로드 및 분석
84
  financials = stock.financials # 재무제표 다운로드 및 분석
85
- sector_data = stock.sustainability # 섹터 및 산업 데이터 조회
86
  news_links = stock.news # 최신 뉴스 조회
87
 
88
- # 간단한 출력 형식 정리
89
  return f"""**실시간 주식 가격**: {real_time_price.tail(1)}
90
- **기본 주식 정보**: {stock_info['longName']} ({stock_info['sector']})
91
  **재무 데이터 (최근 5일)**: {financial_data.tail(5)}
92
  **재무제표**: {financials.head()}
93
- **섹터 산업 데이터**: {sector_data}
94
- **최신 뉴스 링크**: {news_links}
95
  """
96
 
97
 
98
 
 
 
99
  mychatbot = gr.Chatbot(
100
  avatar_images=["./user.png", "./botm.png"],
101
  bubble_full_width=False,
 
82
  stock_info = stock.info # 주식 정보
83
  financial_data = stock.history(period="max") # 주식 데이터 다운로드 및 분석
84
  financials = stock.financials # 재무제표 다운로드 및 분석
 
85
  news_links = stock.news # 최신 뉴스 조회
86
 
87
+ # 'sustainability' 정보를 제거하고 출력 형식을 조정
88
  return f"""**실시간 주식 가격**: {real_time_price.tail(1)}
89
+ **기본 주식 정보**: {stock_info.get('longName', '정보 없음')} ({stock_info.get('sector', '정보 없음')})
90
  **재무 데이터 (최근 5일)**: {financial_data.tail(5)}
91
  **재무제표**: {financials.head()}
92
+ **최신 뉴스 링크**: {', '.join([news['title'] + ": " + news['link'] for news in news_links[:3]])} # 뉴스 링크를 최대 3개까지 출력
 
93
  """
94
 
95
 
96
 
97
+
98
+
99
  mychatbot = gr.Chatbot(
100
  avatar_images=["./user.png", "./botm.png"],
101
  bubble_full_width=False,