arinbalyan commited on
Commit
d28d506
·
verified ·
1 Parent(s): 3b53b75

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -8,6 +8,19 @@ from dataclasses import dataclass, field
8
  from typing import List, Dict, Optional
9
  from enum import Enum
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  # ============================================================
12
  # Tool Definitions
13
  # ============================================================
@@ -324,8 +337,9 @@ def respond(message: str, history: list):
324
  steps = run_agent(message)
325
  html_output = format_steps_as_html(steps)
326
 
327
- # Add to history
328
- history.append((message, html_output))
 
329
  return "", history
330
 
331
 
 
8
  from typing import List, Dict, Optional
9
  from enum import Enum
10
 
11
+ # ============================================================
12
+ # Monkey-patch Gradio 5.9.0 get_api_info crash
13
+ # Fixes: TypeError: argument of type 'bool' is not iterable
14
+ # in gradio_client/utils.py:887 (if "const" in schema:)
15
+ # ============================================================
16
+ import gradio_client.utils as gradio_utils
17
+ _orig_get_type = gradio_utils.get_type
18
+ def _patched_get_type(schema):
19
+ if isinstance(schema, bool):
20
+ return "boolean"
21
+ return _orig_get_type(schema)
22
+ gradio_utils.get_type = _patched_get_type
23
+
24
  # ============================================================
25
  # Tool Definitions
26
  # ============================================================
 
337
  steps = run_agent(message)
338
  html_output = format_steps_as_html(steps)
339
 
340
+ # Add to history (type="messages" format)
341
+ history.append({"role": "user", "content": message})
342
+ history.append({"role": "assistant", "content": html_output})
343
  return "", history
344
 
345