Spaces:
Running
Running
Fix preview function and chatbot type parameter
Browse files- Remove deleted field references from preview function signature and button handler
- Set explicit type='tuples' for preview chatbot to suppress deprecation warning
- App now starts without errors
app.py
CHANGED
@@ -686,7 +686,7 @@ def update_sandbox_preview(config_data):
|
|
686 |
|
687 |
return preview_text, preview_html
|
688 |
|
689 |
-
def on_preview_combined(name, description, system_prompt, enable_research_assistant,
|
690 |
"""Generate configuration and return preview updates"""
|
691 |
if not name or not name.strip():
|
692 |
return (
|
@@ -1466,7 +1466,8 @@ with gr.Blocks(title="Chat U/I Helper") as demo:
|
|
1466 |
preview_chatbot = gr.Chatbot(
|
1467 |
value=[],
|
1468 |
label="Preview Chat Interface",
|
1469 |
-
height=400
|
|
|
1470 |
)
|
1471 |
preview_msg = gr.Textbox(
|
1472 |
label="Test your assistant",
|
@@ -1566,7 +1567,7 @@ with gr.Blocks(title="Chat U/I Helper") as demo:
|
|
1566 |
# Connect cross-tab functionality after all components are defined
|
1567 |
preview_btn.click(
|
1568 |
on_preview_combined,
|
1569 |
-
inputs=[name, description, system_prompt, enable_research_assistant,
|
1570 |
outputs=[preview_config_state, preview_status_comp, preview_chat_section_comp, config_display_comp]
|
1571 |
)
|
1572 |
|
|
|
686 |
|
687 |
return preview_text, preview_html
|
688 |
|
689 |
+
def on_preview_combined(name, description, system_prompt, enable_research_assistant, model, temperature, max_tokens, examples_text, enable_dynamic_urls, enable_vector_rag):
|
690 |
"""Generate configuration and return preview updates"""
|
691 |
if not name or not name.strip():
|
692 |
return (
|
|
|
1466 |
preview_chatbot = gr.Chatbot(
|
1467 |
value=[],
|
1468 |
label="Preview Chat Interface",
|
1469 |
+
height=400,
|
1470 |
+
type="tuples"
|
1471 |
)
|
1472 |
preview_msg = gr.Textbox(
|
1473 |
label="Test your assistant",
|
|
|
1567 |
# Connect cross-tab functionality after all components are defined
|
1568 |
preview_btn.click(
|
1569 |
on_preview_combined,
|
1570 |
+
inputs=[name, description, system_prompt, enable_research_assistant, model, temperature, max_tokens, examples_text, enable_dynamic_urls, enable_vector_rag],
|
1571 |
outputs=[preview_config_state, preview_status_comp, preview_chat_section_comp, config_display_comp]
|
1572 |
)
|
1573 |
|