Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -17,7 +17,6 @@ import aiohttp # Necesario para las peticiones HTTP asíncronas
|
|
| 17 |
import asyncio
|
| 18 |
|
| 19 |
import logging
|
| 20 |
-
|
| 21 |
logger = logging.getLogger(__name__)
|
| 22 |
logging.basicConfig(level=logging.INFO)
|
| 23 |
|
|
@@ -96,6 +95,29 @@ mcp = FastMCP("OnBase", port=port)
|
|
| 96 |
|
| 97 |
|
| 98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
@mcp.tool()
|
| 100 |
async def list_retrievers(source: str = None) -> dict:
|
| 101 |
"""
|
|
|
|
| 17 |
import asyncio
|
| 18 |
|
| 19 |
import logging
|
|
|
|
| 20 |
logger = logging.getLogger(__name__)
|
| 21 |
logging.basicConfig(level=logging.INFO)
|
| 22 |
|
|
|
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
+
@mcp.prompt()
|
| 99 |
+
def improve_oms_topic_prompt(topic: str, context: str = None) -> str:
|
| 100 |
+
"""Generates an optimized prompt to request detailed WHO-related information about a health topic.
|
| 101 |
+
Args:
|
| 102 |
+
topic: The health topic to inquire about (e.g., 'malaria vaccination', 'pandemic preparedness')
|
| 103 |
+
context: Optional context to make the query more specific (e.g., 'in developing countries')
|
| 104 |
+
Returns:
|
| 105 |
+
A refined prompt asking for WHO-specific information on the topic.
|
| 106 |
+
"""
|
| 107 |
+
base_prompt = f"Could you provide a comprehensive explanation of '{topic}'"
|
| 108 |
+
|
| 109 |
+
if context:
|
| 110 |
+
base_prompt += f" {context}"
|
| 111 |
+
|
| 112 |
+
return (
|
| 113 |
+
base_prompt + " based on WHO guidelines and latest recommendations? "
|
| 114 |
+
"Please include: key facts, recommended interventions, "
|
| 115 |
+
"target populations, and relevant WHO program references."
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
|
| 121 |
@mcp.tool()
|
| 122 |
async def list_retrievers(source: str = None) -> dict:
|
| 123 |
"""
|