LiamKhoaLe commited on
Commit
9ffd75b
Β·
1 Parent(s): 1034c81

Simplify MCP arch #5

Browse files
Files changed (2) hide show
  1. README.md +10 -0
  2. agent.py +2 -2
README.md CHANGED
@@ -63,6 +63,7 @@ tags:
63
  - Increased max tokens to prevent early stopping
64
  - Custom EOS handling for medical models
65
  - Dynamic system prompts based on RAG status
 
66
 
67
  ## πŸš€ Usage
68
 
@@ -71,6 +72,7 @@ tags:
71
  - Enable/disable Document RAG
72
  - Enable/disable Web Search (MCP)
73
  - Select medical model (MedSwin SFT/KD/TA)
 
74
  3. **Ask Questions**: Type your medical question in any language
75
  4. **Get Answers**: Receive comprehensive answers based on:
76
  - Your uploaded documents (if RAG enabled)
@@ -101,6 +103,14 @@ See `requirements.txt` for full dependency list. Key dependencies:
101
  - **Utilities**: `langdetect`, `gradio`, `spaces`, `soundfile`
102
  - **TTS**: Optional - `TTS` package (voice features work with MCP fallback if unavailable)
103
 
 
 
 
 
 
 
 
 
104
  ### πŸ”Œ MCP Configuration
105
 
106
  The application uses a bundled Gemini MCP server (agent.py) for translation, document parsing, transcription, and summarization. Configure via environment variables:
 
63
  - Increased max tokens to prevent early stopping
64
  - Custom EOS handling for medical models
65
  - Dynamic system prompts based on RAG status
66
+ - One-click agentic toggle to run MedSwin alone (no RAG/web search) for deterministic, offline-safe answers
67
 
68
  ## πŸš€ Usage
69
 
 
72
  - Enable/disable Document RAG
73
  - Enable/disable Web Search (MCP)
74
  - Select medical model (MedSwin SFT/KD/TA)
75
+ - Toggle agentic reasoning on/off for MedSwin-only responses
76
  3. **Ask Questions**: Type your medical question in any language
77
  4. **Get Answers**: Receive comprehensive answers based on:
78
  - Your uploaded documents (if RAG enabled)
 
103
  - **Utilities**: `langdetect`, `gradio`, `spaces`, `soundfile`
104
  - **TTS**: Optional - `TTS` package (voice features work with MCP fallback if unavailable)
105
 
106
+ ### πŸ”‘ Access Tokens
107
+
108
+ - **Hugging Face**: Set `HF_TOKEN` so Transformers can download the MedSwin checkpoints. Generate a read-only token at [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) and export it:
109
+ ```bash
110
+ export HF_TOKEN="hf_your_token"
111
+ ```
112
+ - **Gemini**: `GEMINI_API_KEY` remains required for MCP translation, parsing, transcription, and summarization (see MCP configuration below).
113
+
114
  ### πŸ”Œ MCP Configuration
115
 
116
  The application uses a bundled Gemini MCP server (agent.py) for translation, document parsing, transcription, and summarization. Configure via environment variables:
agent.py CHANGED
@@ -215,8 +215,8 @@ async def call_tool(name: str, arguments: dict) -> Sequence[TextContent | ImageC
215
 
216
  # Generate content using Gemini API
217
  try:
218
- # Get the model instance
219
- gemini_model = gemini_client.models.get(model)
220
 
221
  # Prepare generation config
222
  generation_config = {
 
215
 
216
  # Generate content using Gemini API
217
  try:
218
+ # Get the model instance (requires keyword argument)
219
+ gemini_model = gemini_client.models.get(model=model)
220
 
221
  # Prepare generation config
222
  generation_config = {