hra commited on
Commit
e375a0b
1 Parent(s): ee1e26a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -27,7 +27,7 @@ def getstuff(openapikey,category_selector):
27
  elif whichone=="Retail":
28
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000116"
29
  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","Write an email summarizing the news. Do not say I am language model and cannot do this"]
30
- elif whicone=='Earnings Announcements':
31
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=15839135"
32
  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","Write an email summarizing the news. Do not say I am language model and cannot do this"]
33
  else:
@@ -53,7 +53,6 @@ def getstuff(openapikey,category_selector):
53
  answerlist.append(df)
54
  else:
55
  answerlist.append(response.response)
56
- answerlist.append(df)
57
 
58
  return answerlist
59
 
@@ -72,19 +71,16 @@ with gr.Blocks() as demo:
72
  with gr.Column():
73
  btn = gr.Button("Generate")
74
 
75
- with gr.Row() as row:
76
- with gr.Column():
77
- outputsector = gr.Textbox(placeholder='', lines=4,label='Snapshot 1')
78
- with gr.Column():
79
- outputtech = gr.Textbox(placeholder='', lines=4,label='Snapshot 2')
80
  with gr.Row() as row:
81
  table1=gr.Dataframe(
82
  #headers=["Item", "Cost"],
83
  datatype=["str", "str","str"],
84
  label="Snapshot 1",
85
  )
 
 
86
 
87
- btn.click(getstuff, inputs=[textboxopenapi,category_selector],outputs=[outputsector,outputtech,table1])
88
 
89
 
90
  demo.launch(debug=True)
 
27
  elif whichone=="Retail":
28
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000116"
29
  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","Write an email summarizing the news. Do not say I am language model and cannot do this"]
30
+ elif whichone=='Earnings Announcements':
31
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=15839135"
32
  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","Write an email summarizing the news. Do not say I am language model and cannot do this"]
33
  else:
 
53
  answerlist.append(df)
54
  else:
55
  answerlist.append(response.response)
 
56
 
57
  return answerlist
58
 
 
71
  with gr.Column():
72
  btn = gr.Button("Generate")
73
 
 
 
 
 
 
74
  with gr.Row() as row:
75
  table1=gr.Dataframe(
76
  #headers=["Item", "Cost"],
77
  datatype=["str", "str","str"],
78
  label="Snapshot 1",
79
  )
80
+ with gr.Row() as row:
81
+ outputtech = gr.Textbox(placeholder='', lines=4,label='Snapshot 2')
82
 
83
+ btn.click(getstuff, inputs=[textboxopenapi,category_selector],outputs=[table1,outputtech])
84
 
85
 
86
  demo.launch(debug=True)