Spaces:
Sleeping
Sleeping
Rajan Sharma
commited on
Update settings.py
Browse files- settings.py +38 -60
settings.py
CHANGED
|
@@ -1,71 +1,49 @@
|
|
| 1 |
-
# settings.py
|
| 2 |
import os
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
PERSIST_CONTENT = os.getenv("PERSIST_CONTENT", "false").lower() == "true"
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
"hospital", "clinic", "patient", "doctor", "nurse", "medical",
|
| 12 |
-
"healthcare", "diagnosis", "treatment", "pharmacy", "surgery",
|
| 13 |
-
"emergency", "icu", "ward", "bed", "capacity", "occupancy"
|
| 14 |
-
],
|
| 15 |
-
"supported_file_types": [".csv", ".json", ".txt", ".xlsx", ".xls"],
|
| 16 |
-
"max_file_size_mb": 50
|
| 17 |
-
}
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
"max_new_tokens": 2048,
|
| 22 |
-
"temperature": 0.3,
|
| 23 |
-
"top_p": 0.9,
|
| 24 |
-
"repetition_penalty": 1.15
|
| 25 |
-
}
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
You are a specialized healthcare analytics AI with expertise in:
|
| 30 |
-
- Healthcare facility operations and capacity planning
|
| 31 |
-
- Medical resource allocation and optimization
|
| 32 |
-
- Health data analysis and trend identification
|
| 33 |
-
- Healthcare policy and operational recommendations
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
- Executive Summary
|
| 38 |
-
- Data Analysis (with subsections)
|
| 39 |
-
- Key Findings
|
| 40 |
-
- Operational Recommendations
|
| 41 |
-
- Future Integration Opportunities
|
| 42 |
-
- Provenance
|
| 43 |
|
| 44 |
-
|
| 45 |
-
- Include specific metrics and calculations
|
| 46 |
-
- Provide context and interpretation
|
| 47 |
-
- Identify trends and patterns
|
| 48 |
-
- Highlight significant findings
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
| 61 |
-
""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
2. Provide accurate, well-researched information
|
| 67 |
-
3. Structure responses clearly with headings and bullet points
|
| 68 |
-
4. Cite sources when possible
|
| 69 |
-
5. Admit when you don't know something
|
| 70 |
-
6. Maintain a professional yet approachable tone
|
| 71 |
-
"""
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
from typing import Dict, Any
|
| 3 |
|
| 4 |
+
CANADA_RESIDENCY_REQUIRED = True
|
| 5 |
+
CLOUD_REGION = os.getenv("CLOUD_REGION", "ca-central-1")
|
|
|
|
| 6 |
|
| 7 |
+
COHERE_API_KEY = os.getenv("COHERE_API_KEY", "")
|
| 8 |
+
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY", "")
|
| 9 |
+
ANTHROPIC_API_KEY = os.getenv("ANTHROPIC_API_KEY", "")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
COHERE_MODEL_PRIMARY = os.getenv("COHERE_MODEL_PRIMARY", "command-r")
|
| 12 |
+
COHERE_EMBED_MODEL = os.getenv("COHERE_EMBED_MODEL", "embed-english-v3.0")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
OPENAI_MODEL_FALLBACK = os.getenv("OPENAI_MODEL_FALLBACK", "gpt-4o-mini")
|
| 15 |
+
ANTHROPIC_MODEL_FALLBACK = os.getenv("ANTHROPIC_MODEL_FALLBACK", "claude-3-5-sonnet-latest")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
LOCAL_MODEL_ID = os.getenv("LOCAL_MODEL_ID", "meta-llama/Meta-Llama-3.1-8B-Instruct")
|
| 18 |
+
LOCAL_ENABLE = os.getenv("LOCAL_ENABLE", "0") not in ("0", "false", "False")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
USE_SCENARIO_ENGINE = True
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
MODEL_SETTINGS: Dict[str, Any] = {
|
| 23 |
+
"temperature": float(os.getenv("TEMP", "0.2")),
|
| 24 |
+
"top_p": float(os.getenv("TOP_P", "0.9")),
|
| 25 |
+
"repetition_penalty": float(os.getenv("REP_PEN", "1.1")),
|
| 26 |
+
"max_new_tokens": int(os.getenv("MAX_NEW_TOKENS", "1500")),
|
| 27 |
+
}
|
| 28 |
|
| 29 |
+
HEALTHCARE_SETTINGS = {
|
| 30 |
+
"supported_file_types": [".csv", ".txt", ".md", ".pdf"],
|
| 31 |
+
"healthcare_keywords": [
|
| 32 |
+
"hospital", "clinic", "surgery", "wait time", "consult",
|
| 33 |
+
"beds", "icu", "zone", "health authority", "triage",
|
| 34 |
+
],
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
GENERAL_CONVERSATION_PROMPT = "You are a helpful assistant. Be concise, accurate, and friendly."
|
| 38 |
|
| 39 |
+
HEALTHCARE_SYSTEM_PROMPT = (
|
| 40 |
+
"You are a Canadian healthcare operations analysis copilot. "
|
| 41 |
+
"Read the entire scenario. Output only a structured JSON plan of tasks. "
|
| 42 |
+
"Each task must define dataset, filters, grouping, aggregations, joins, pivots, "
|
| 43 |
+
"and formatting exactly as the scenario requires. "
|
| 44 |
+
"Do not invent numbers; computations will be executed deterministically."
|
| 45 |
+
)
|
| 46 |
|
| 47 |
+
DATA_DIR = os.getenv("DATA_DIR", "./data")
|
| 48 |
+
RAG_INDEX_DIR = os.getenv("RAG_INDEX_DIR", "./rag_index")
|
| 49 |
+
SNAPSHOT_PATH = os.getenv("SNAPSHOT_PATH", "./snapshots")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|