hra commited on
Commit
8763c8e
1 Parent(s): 711b200

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -14,7 +14,7 @@ import json
14
 
15
  HRA_TOKEN=os.getenv("HRA_TOKEN")
16
 
17
- listofcategories=["Earnings Announcements", "Automotive","Energy","Healthcare","Retail","Technology"]
18
 
19
  headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
20
  url_hraprompts='https://us-central1-createinsightsproject.cloudfunctions.net/gethrahfprompts'
@@ -54,10 +54,11 @@ def getstuff(openapikey,category_selector):
54
  reader = RssReader()
55
  whichone=listofcategories[listofcategories.index(category_selector)]
56
 
57
- #querylist=["What are the top trends? Give output as a json (that can be converted to pandas dataframe) with 3 columns named trend, company mentioned & reason","Name the top & bottom performing companies? Give output as a json (that can be converted to pandas dataframe) with 4 columns named sector, company names, reason & top/bottom","You are an award winning email writer. Write an email summarizing the news. Do not say I am language model and cannot do this","You are an award winning email writer. Write an email summarizing the key macro trends basis the news.Do not say I am language model and cannot do this"]
58
  querylist=sector_prompt_text
59
 
60
- if whichone=="Automotive":
 
 
61
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000101"
62
  elif whichone=="Retail":
63
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000116"
@@ -71,11 +72,9 @@ def getstuff(openapikey,category_selector):
71
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000110"
72
  elif whichone=='Earnings Announcements':
73
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=15839135"
74
- #querylist=["What are the top trends? Give output as a json (that can be converted to pandas dataframe) with 3 columns named trend, company mentioned & reason","Find the top & bottom performing companies? Give output as a json (that can be converted to pandas dataframe) with 4 columns named sector, company names, reason & top/bottom","You are an award winning email writer. Write an email summarizing the news. Do not say I am language model and cannot do this","You are an award winning email writer. Write an email summarizing the key macro trends basis the news.Do not say I am language model and cannot do this"]
75
  querylist=earnings_prompt_text
76
  else:
77
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=15839135" ###should not come here but using earnings url
78
- #querylist=["Basis companies that are doing well name the sectors with positive momentum? Give output as a json (that can be converted to pandas dataframe) with 3 columns named sector, company names & reason","Find the top & bottom performing companies? Give output as a json (that can be converted to pandas dataframe) with 4 columns named sector, company names, reason & top/bottom","You are an award winning email writer. Write an email summarizing the news. Do not say I am language model and cannot do this","You are an award winning email writer. Write an email summarizing the key macro trends basis the news.Do not say I am language model and cannot do this"]
79
  querylist=earnings_prompt_text
80
 
81
  documents = reader.load_data([rssurl])
 
14
 
15
  HRA_TOKEN=os.getenv("HRA_TOKEN")
16
 
17
+ listofcategories=["Earnings Announcements", "Overall","Automotive","Energy","Healthcare","Retail","Technology"]
18
 
19
  headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
20
  url_hraprompts='https://us-central1-createinsightsproject.cloudfunctions.net/gethrahfprompts'
 
54
  reader = RssReader()
55
  whichone=listofcategories[listofcategories.index(category_selector)]
56
 
 
57
  querylist=sector_prompt_text
58
 
59
+ if whichone=="Overall":
60
+ rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=100003114"
61
+ elif whichone=="Automotive":
62
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000101"
63
  elif whichone=="Retail":
64
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000116"
 
72
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000110"
73
  elif whichone=='Earnings Announcements':
74
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=15839135"
 
75
  querylist=earnings_prompt_text
76
  else:
77
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=15839135" ###should not come here but using earnings url
 
78
  querylist=earnings_prompt_text
79
 
80
  documents = reader.load_data([rssurl])