import gradio as gr import requests def quote(): res = requests.get("https://api.quotable.io/random").json() return f'

{res["content"]}

{res["author"]}

' # demo = gr.Interface(fn=greet, inputs="text", outputs="text") with gr.Blocks() as demo: # text = gr.Textbox(label="Quote") btn = gr.Button(value="Random quote") html = gr.Markdown() btn.click(quote, inputs=[], outputs=[html]) demo.launch()