web-search-mcp / app_wrapper.py
Shrijeeth-Suresh
feat: add title to web search MCP interface
4a216fe
raw
history blame
830 Bytes
import gradio as gr
class AppWrapper:
def __init__(self):
self._interfaces = [] # List of tuples: (interface_obj, tab_name)
def register_interface(self, interface_obj, tab_name):
"""
Register an interface object with a corresponding tab name.
"""
self._interfaces.append((interface_obj, tab_name))
def build_app(self):
"""
Build the Gradio TabbedInterface from registered interfaces.
"""
interface_list = [iface.interface for iface, _ in self._interfaces]
tab_names = [tab for _, tab in self._interfaces]
self.app = gr.TabbedInterface(
title="Web Search MCP",
interface_list=interface_list,
tab_names=tab_names,
)
def launch(self, **kwargs):
self.app.launch(**kwargs)