Here is example of code that works. Found the solution at 1
import requests
import gradio as gr
import json
def chat_response(message, history, response_limit):
return f"You wrote: {message} and asked {response_limit}"
css = """
#chatbot {
flex-grow: 1 !important;
overflow: auto !important;
}
"""
with gr.Blocks(css=css) as demo:
gr.Markdown("# Data Query!")
with gr.Row():
with gr.Column(scale=3):
response_limit = gr.Number(label="Response Limit", value=10, interactive=True)
with gr.Column(scale=7):
chat = gr.ChatInterface(
fn=chat_response,
chatbot=gr.Chatbot(elem_id="chatbot",
render=False),
additional_inputs=[response_limit]
)
demo.launch()