KarthickAdopleAI commited on
Commit
93952b1
·
verified ·
1 Parent(s): a5f443e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -61,7 +61,7 @@ def download_report():
61
  with open(report_file_path,"w") as file:
62
  file.write(message)
63
 
64
- return message
65
 
66
  def bot(history):
67
  bot_message = sales_agent._call({})
@@ -133,7 +133,11 @@ with gr.Blocks(theme="Taithrah/Minimal") as demo:
133
  gen_report_view = gr.Textbox(label="Generated Report",container=False)
134
  with gr.Row():
135
  gen_report_btn = gr.Button("Generate Report")
136
- report_down_btn = gr.DownloadButton(label="Download Report",value=f"{os.getcwd()}/report.txt")
 
 
 
 
137
  with gr.Column(scale=0.50):
138
  with gr.Row():
139
  summary_view = gr.Textbox(label="Summary",container=False)
@@ -156,7 +160,7 @@ with gr.Blocks(theme="Taithrah/Minimal") as demo:
156
  bot, chatbot, chatbot
157
  )
158
  msg.submit(stages,[],show_stages)
159
- gen_report_btn.click(download_report,[],gen_report_view,queue=False)
160
  summary_btn.click(generate_convo_summary,[],summary_view)
161
  sentiment_btn.click(sentiment_analysis,[],sentiment_view)
162
  emotion_btn.click(emotion_analysis,[],emotion_view)
 
61
  with open(report_file_path,"w") as file:
62
  file.write(message)
63
 
64
+ return message,report_file_path
65
 
66
  def bot(history):
67
  bot_message = sales_agent._call({})
 
133
  gen_report_view = gr.Textbox(label="Generated Report",container=False)
134
  with gr.Row():
135
  gen_report_btn = gr.Button("Generate Report")
136
+ report_down_btn = [gr.File(label="Output File",
137
+ file_count="single",
138
+ file_types=["", ".", ".csv",".xls",".xlsx",".txt"])]
139
+
140
+ # report_down_btn = gr.DownloadButton(label="Download Report",value=f"{os.getcwd()}/report.txt")
141
  with gr.Column(scale=0.50):
142
  with gr.Row():
143
  summary_view = gr.Textbox(label="Summary",container=False)
 
160
  bot, chatbot, chatbot
161
  )
162
  msg.submit(stages,[],show_stages)
163
+ gen_report_btn.click(download_report,[],[gen_report_view,report_down_btn],queue=False)
164
  summary_btn.click(generate_convo_summary,[],summary_view)
165
  sentiment_btn.click(sentiment_analysis,[],sentiment_view)
166
  emotion_btn.click(emotion_analysis,[],emotion_view)