Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -5,6 +5,34 @@ import aiohttp # Necesario para las peticiones HTTP asíncronas
|
|
| 5 |
port = int(os.getenv("PORT", 7860))
|
| 6 |
mcp = FastMCP("OnBase", port=port)
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
@mcp.tool()
|
| 9 |
async def search_tavily(
|
| 10 |
query: str,
|
|
|
|
| 5 |
port = int(os.getenv("PORT", 7860))
|
| 6 |
mcp = FastMCP("OnBase", port=port)
|
| 7 |
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
@mcp.prompt()
|
| 11 |
+
def ask_about_topic(
|
| 12 |
+
topic: str, # Required - no default value
|
| 13 |
+
detail_level: str = "simple", # Optional - has default value
|
| 14 |
+
examples: bool = True # Optional - has default value
|
| 15 |
+
) -> str:
|
| 16 |
+
"""Generates a user message asking for an explanation of a topic with customizable options."""
|
| 17 |
+
prompt = f"Podrías explicar el concepto de '{topic}'"
|
| 18 |
+
|
| 19 |
+
# Añadir nivel de detalle
|
| 20 |
+
if detail_level == "simple":
|
| 21 |
+
prompt += " de manera concisa"
|
| 22 |
+
elif detail_level == "technical":
|
| 23 |
+
prompt += " con terminología técnica"
|
| 24 |
+
elif detail_level == "detailed":
|
| 25 |
+
prompt += " con amplio detalle"
|
| 26 |
+
|
| 27 |
+
prompt += "?"
|
| 28 |
+
|
| 29 |
+
# Añadir petición de ejemplos
|
| 30 |
+
if examples:
|
| 31 |
+
prompt += " Incluye ejemplos prácticos si es posible."
|
| 32 |
+
|
| 33 |
+
return prompt
|
| 34 |
+
|
| 35 |
+
|
| 36 |
@mcp.tool()
|
| 37 |
async def search_tavily(
|
| 38 |
query: str,
|