Spaces:
Running
Running
Update app.py
Browse files1234339 unmodified lines34434534634734834935035135235335435535659 unmodified lines416417418419420421422182 unmodified lines60560660760860961061145 unmodified lines657658659660661662663# File: main/app.py# Purpose: One Space that offers four tools/tabs (all exposed as MCP tools):# 1) Fetch — extract relevant page content (title, metadata, clean text, hyperlinks)# 2) DuckDuckGo Search — compact JSONL search output (short keys to minimize tokens)339 unmodified linesreturn md or "No content could be extracted."# ===============================# DuckDuckGo Search (JSONL lines)# ===============================# ============================================# Concise DDG: ultra-succinct JSONL for tokens# ============================================def Search_DuckDuckGo( # <-- MCP tool #2 (DDG Search)59 unmodified lines# ======================================# Code Execution: Python (MCP tool #6)# ======================================def Execute_Python(code: Annotated[str, "Python source code to run; stdout is captured and returned."]) -> str:182 unmodified linessubmit_btn="Search",)## Removed Structured, Raw, and Sitemap tabs# --- Execute Python tab (simple code interpreter) ---code_interface = gr.Interface(45 unmodified linesoutputs=gr.Audio(label="Audio", type="numpy"),title="Kokoro TTS",description=("<div style=\"text-align:center\">Generate English speech with Kokoro-82M. 30 Second max output. Runs on CPU.</div>"),api_description=("Synthesize speech from text using Kokoro-82M. Returns (sample_rate, waveform) suitable for playback."123339 unmodified lines34334434534634734834935059 unmodified lines410411412413414415416182 unmodified lines59960060160260360460545 unmodified lines651652653654655656657# Purpose: One Space that offers four tools/tabs (all exposed as MCP tools):# 1) Fetch — extract relevant page content (title, metadata, clean text, hyperlinks)# 2) DuckDuckGo Search — compact JSONL search output (short keys to minimize tokens)339 unmodified linesreturn md or "No content could be extracted."# ============================================# DuckDuckGo Search: ultra-succinct JSONL# ============================================def Search_DuckDuckGo( # <-- MCP tool #2 (DDG Search)59 unmodified lines# ======================================# Code Execution: Python (MCP tool #3)# ======================================def Execute_Python(code: Annotated[str, "Python source code to run; stdout is captured and returned."]) -> str:182 unmodified linessubmit_btn="Search",)### --- Execute Python tab (simple code interpreter) ---code_interface = gr.Interface(45 unmodified linesoutputs=gr.Audio(label="Audio", type="numpy"),title="Kokoro TTS",description=("<div style=\"text-align:center\">Generate English speech with Kokoro-82M. 30 second max output. Runs on CPU or CUDA if available.</div>"),api_description=("Synthesize speech from text using Kokoro-82M. Returns (sample_rate, waveform) suitable for playback."
app.py+4-10