sales_assistant / product_search_mcp_server.py
ZweliM's picture
Rename chat_mcp_server.py to product_search_mcp_server.py
fe2f058 verified
raw
history blame
718 Bytes
import gradio as gr
from web_scraper import search_your_product
def product_search(query: str) -> str:
"""
Search for products based on the provided query.
Args:
query (str): The search query for products.
Returns:
str: A message with the search results.
"""
results = search_your_product(query)
if not results:
return f"No products found for your search: '{query}'. Please try a different query."
return f"Here are the products matching your search for '{query}': {results}."
demo = gr.Interface(fn=product_search,
inputs=[],
outputs="number")
demo.launch(mcp_server=True) # exposes an MCP schema automatically