agarwalamit081 commited on
Commit
18ddb05
·
verified ·
1 Parent(s): 5b5319e

Update Gradio_UI.py

Browse files

fixed metadata status validation

Files changed (1) hide show
  1. Gradio_UI.py +4 -4
Gradio_UI.py CHANGED
@@ -9,7 +9,7 @@ from smolagents.memory import MemoryStep
9
  from smolagents.utils import _is_package_available
10
 
11
  def pull_messages_from_step(step_log: MemoryStep):
12
- """Extract ChatMessage objects from agent steps with proper nesting and error resilience"""
13
  import gradio as gr
14
  if isinstance(step_log, ActionStep):
15
  step_number = f"Step {step_log.step_number}" if step_log.step_number is not None else "Processing"
@@ -74,7 +74,7 @@ def stream_to_gradio(
74
  reset_agent_memory: bool = False,
75
  additional_args: Optional[dict] = None,
76
  ):
77
- """Runs agent and streams messages as gradio ChatMessages with error resilience"""
78
  if not _is_package_available("gradio"):
79
  raise ModuleNotFoundError("Install gradio: `pip install 'smolagents[gradio]'`")
80
  import gradio as gr
@@ -135,14 +135,14 @@ class GradioUI:
135
  with gr.Row():
136
  text_input = gr.Textbox(
137
  label="Describe your trip",
138
- placeholder="e.g., '3-day trip to Lisbon from London, Sep 20-22, budget £600 GBP'",
139
  lines=2,
140
  )
141
  submit_btn = gr.Button("Plan My Trip", variant="primary")
142
  gr.Markdown("""
143
  ### 💡 Tips for best results:
144
  • Include: destination, dates, origin city, budget amount + currency
145
- • Example: *"5-day Barcelona trip from NYC, Oct 15-19, budget $1500 USD"*
146
  """)
147
  submit_btn.click(
148
  self.interact_with_agent,
 
9
  from smolagents.utils import _is_package_available
10
 
11
  def pull_messages_from_step(step_log: MemoryStep):
12
+ """Extract ChatMessage objects from agent steps with proper nesting"""
13
  import gradio as gr
14
  if isinstance(step_log, ActionStep):
15
  step_number = f"Step {step_log.step_number}" if step_log.step_number is not None else "Processing"
 
74
  reset_agent_memory: bool = False,
75
  additional_args: Optional[dict] = None,
76
  ):
77
+ """Runs agent and streams messages as gradio ChatMessages"""
78
  if not _is_package_available("gradio"):
79
  raise ModuleNotFoundError("Install gradio: `pip install 'smolagents[gradio]'`")
80
  import gradio as gr
 
135
  with gr.Row():
136
  text_input = gr.Textbox(
137
  label="Describe your trip",
138
+ placeholder="e.g., '4-day Barcelona trip from NYC, Oct 15-19, budget $1500 USD'",
139
  lines=2,
140
  )
141
  submit_btn = gr.Button("Plan My Trip", variant="primary")
142
  gr.Markdown("""
143
  ### 💡 Tips for best results:
144
  • Include: destination, dates, origin city, budget amount + currency
145
+ • Example: *"5-day Lisbon trip from London, Sep 20-24, budget £800 GBP"*
146
  """)
147
  submit_btn.click(
148
  self.interact_with_agent,