fCola commited on
Commit
afc36e0
·
verified ·
1 Parent(s): 34173bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -538,9 +538,9 @@ def send_message(message, history):
538
  # Quando arriva il primo token utile, svuota la textbox
539
  if not cleared:
540
  cleared = True
541
- yield gr.update(value=""), history + [{"role": "assistant", "content": partial}], gr.update(value=context)
542
  else:
543
- yield "", history + [{"role": "assistant", "content": partial}], gr.update(value=context)
544
 
545
 
546
  # Create the dashboard
@@ -580,8 +580,7 @@ with gr.Blocks(theme=ArtemisiaTheme(), css=custom_css) as demo:
580
  gr.Markdown("## Results & Insights")
581
  gr.Markdown("Visualizations and data from your queries")
582
  with gr.Column(elem_classes="results-content"):
583
- #results_placeholder = gr.Markdown("Ask a question in the chat to analyze risk data and see insights here", elem_classes="placeholder-text", render=True)
584
- results_placeholder = gr.Code(value="Ask a question in the chat to analyze risk data and see insights here", language="json", elem_classes="placeholder-text", render=True)
585
  # Wire up the chat functionality
586
  #send_button.click(
587
  # fn=send_message,
 
538
  # Quando arriva il primo token utile, svuota la textbox
539
  if not cleared:
540
  cleared = True
541
+ yield gr.update(value=""), history + [{"role": "assistant", "content": partial}], gr.update(value="```json\n" + json.dumps(context_data, indent=2) + "\n```")
542
  else:
543
+ yield "", history + [{"role": "assistant", "content": partial}], gr.update(value="```json\n" + json.dumps(context_data, indent=2) + "\n```")
544
 
545
 
546
  # Create the dashboard
 
580
  gr.Markdown("## Results & Insights")
581
  gr.Markdown("Visualizations and data from your queries")
582
  with gr.Column(elem_classes="results-content"):
583
+ results_placeholder = gr.Markdown("Ask a question in the chat to analyze risk data and see insights here", elem_classes="placeholder-text", render=True)
 
584
  # Wire up the chat functionality
585
  #send_button.click(
586
  # fn=send_message,