Spaces:
Runtime error
Runtime error
Update app.py
Browse files103 unmodified lines104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145103 unmodified linesdemo = gr.Interface(fn=joke_generation,inputs=[gr.Textbox(label="categories",info="Comma-separated list from [Any, Programming, Misc, Pun, Dark, Spooky, Christmas] (or ignore this tool if none match)"),gr.Dropdown(label="format",choices=["json"],value="json",info="Must be 'json'"),gr.Textbox(label="lang",value="en",info="ISO 639-1 code for the joke’s language"),gr.Textbox(label="blacklistFlags",optional=True,info="Comma-separated flags to exclude: nsfw, religious, political, racist, sexist, explicit"),gr.Checkbox(label="safe_mode",info="Enable safe-mode filter"),gr.Radio(label="type",choices=["single", "twopart"],optional=True,info="If given: 'single' (one-liner) or 'twopart' (setup + delivery)"),gr.Textbox(label="contains",optional=True,info="Case-insensitive substring that must appear in the joke text"),gr.Textbox(label="idRange",optional=True,info="A single ID or range (e.g. '10-50')"),gr.Slider(label="amount",minimum=1,maximum=10,step=1,value=1,info="How many jokes to fetch (1–10)")],outputs=gr.JSON(),api_name="joke_generation",title="Joke Generation",description="Fetch jokes from JokeAPI with all available parameters.")# Launch the interface and MCP server103 unmodified lines104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154103 unmodified linesdemo = gr.Interface(fn=joke_generation,inputs=[gr.Textbox(label="categories",info="Comma-separated list from [Any, Programming, Misc, Pun, Dark, Spooky, Christmas]"),gr.Dropdown(label="format",choices=["json"],value="json",info="Must be 'json'"),gr.Textbox(label="lang",value="en",info="ISO 639-1 code for the joke’s language"),# just remove optional=True here:gr.Textbox(label="blacklistFlags",info="Comma-separated flags to exclude: nsfw, religious, political, racist, sexist, explicit"),gr.Checkbox(label="safe_mode", info="Enable safe-mode filter"),# and here:gr.Radio(label="type",choices=["single", "twopart"],info="If given: 'single' (one-liner) or 'twopart' (setup + delivery)"),gr.Textbox(label="contains",info="Case-insensitive substring that must appear in the joke text"),gr.Textbox(label="idRange",info="A single ID or range (e.g. '10-50')"),gr.Slider(label="amount",minimum=1, maximum=10, step=1, value=1,info="How many jokes to fetch (1–10)"),],outputs=gr.JSON(),api_name="joke_generation",title="Joke Generation",description="Fetch jokes from JokeAPI with all available parameters."# Launch the interface and MCP server
app.py+40-31