Bretts_Book_Hub / app.py
Brettapps's picture
Upload folder using huggingface_hub
cabaed4 verified
Raw
History Blame Contribute Delete
556 Bytes
import gradio as gr
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_main():
return {"message": "Fair Dinkum Book Hub is live!"}
# Define your Gradio/MCP tools
with gr.Blocks() as demo:
gr.Markdown("# Fair Dinkum MCP Tools")
@gr.mcp.tool(name="process_book")
def process_book(title: str):
"""Processes a book title for the hub."""
return f"Book '{title}' has been successfully processed into the catalog."
# Mount Gradio/MCP to the FastAPI app
app = gr.mount_gradio_app(app, demo, path="/gradio")