tbdavid2019 commited on
Commit
7236baa
·
verified ·
1 Parent(s): fb2652f
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -263,6 +263,8 @@ def analyze_stock(api_key: str, ticker: str, period: str) -> str:
263
  # 組合 Prompt
264
  prompt = FUNDAMENTAL_ANALYST_PROMPT.replace("{company}", ticker)
265
  user_question = "Should I buy this stock?"
 
 
266
  analysis_prompt = f"""
267
  根據以下 {ticker} 的資料,進行全面的基本面分析並回答使用者問題:"{user_question}"
268
 
@@ -275,6 +277,7 @@ def analyze_stock(api_key: str, ticker: str, period: str) -> str:
275
  相關新聞:
276
  {json.dumps(news, ensure_ascii=False, indent=2)}
277
 
 
278
  {prompt}
279
  """
280
 
 
263
  # 組合 Prompt
264
  prompt = FUNDAMENTAL_ANALYST_PROMPT.replace("{company}", ticker)
265
  user_question = "Should I buy this stock?"
266
+
267
+
268
  analysis_prompt = f"""
269
  根據以下 {ticker} 的資料,進行全面的基本面分析並回答使用者問題:"{user_question}"
270
 
 
277
  相關新聞:
278
  {json.dumps(news, ensure_ascii=False, indent=2)}
279
 
280
+ 請注意:即使新聞的 description 或 summary 為空,也請務必根據新聞的 title、publisher 或其他字段,推斷其可能對股價與公司形象造成的影響。請將這些新聞具體列在新聞分析章節。
281
  {prompt}
282
  """
283