Spaces:
Runtime error
Runtime error
Download config.py from Agents-MCP-Hackathon/WellBePlusAssistant: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/Agents-MCP-Hackathon/WellBePlusAssistant/resolve/main/config.py
- Command line
-
hf download hf://spaces/Agents-MCP-Hackathon/WellBePlusAssistant/config.py
-
curl -L -o config.py https://huggingface.co/spaces/Agents-MCP-Hackathon/WellBePlusAssistant/resolve/main/config.py
1.12 kB
| """ | |
| Centralised, cached access to runtime configuration. | |
| """ | |
| from functools import lru_cache | |
| from importlib import resources | |
| import json | |
| import os | |
| from pathlib import Path | |
| import yaml | |
| from dotenv import load_dotenv | |
| def _load_prompt_template() -> str: | |
| with open("prompts/router_prompt.yml", "r") as fh: | |
| return yaml.safe_load(fh)["template"] | |
| def _load_mcp_configs() -> dict: | |
| cfg_path = Path( | |
| os.getenv( | |
| "MCP_CONFIG_PATH", | |
| Path(__file__).resolve().parent / "settings" / "mcp_config.json", | |
| ) | |
| ) | |
| with cfg_path.open() as fh: | |
| return json.load(fh)["mcpServers"] | |
| load_dotenv() | |
| PROMPT_TEMPLATE: str = _load_prompt_template() | |
| MCP_CONFIGS: dict = _load_mcp_configs() | |
| MODEL_API_KEY: str = os.getenv("MODEL_API_KEY") | |
| OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") | |
| SMITHERY_API_KEY = os.getenv("SMITHERY_API_KEY") | |
| MCP_CONFIGS["healthcare-mcp-public"]["args"].append(SMITHERY_API_KEY) | |
| MCP_CONFIGS["healthcare-mcp-public"]["url"] = MCP_CONFIGS["healthcare-mcp-public"]["url"].format(api_key=SMITHERY_API_KEY) |