Spaces:
Running
Running
Commit ·
428aa76
1
Parent(s): 2abb07f
Prepare TeamHealix live copy: pin deps, current Haiku default, enable Gradio MCP
Browse filesLeave the MCP-1st-Birthday submission Space unchanged. This commit is only for the TeamHealix copy that should actually run.
- .env.example +3 -2
- LIVE_COPY_FIXES.md +14 -0
- app.py +2 -3
- requirements.txt +4 -4
- test_api.py +1 -1
.env.example
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
ANTHROPIC_API_KEY=your_api_key_here
|
| 2 |
-
# Optional: override the default Claude model (claude-
|
| 3 |
-
#
|
|
|
|
|
|
| 1 |
ANTHROPIC_API_KEY=your_api_key_here
|
| 2 |
+
# Optional: override the default Claude model (claude-haiku-5-5).
|
| 3 |
+
# The original default, claude-3-haiku-20240307, was retired on 20 April 2026.
|
| 4 |
+
# ANTHROPIC_MODEL=claude-haiku-5-5
|
LIVE_COPY_FIXES.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TeamHealix live-copy fixes (not for the original Space)
|
| 2 |
+
|
| 3 |
+
Do not push these to MCP-1st-Birthday/TeamHealix.
|
| 4 |
+
|
| 5 |
+
Changes vs the November 2025 submission:
|
| 6 |
+
- Pin Python deps so a fresh Space build is reproducible.
|
| 7 |
+
- Install `gradio[mcp]==5.49.1` and launch with `mcp_server=True` so the
|
| 8 |
+
MCP endpoint is `https://teamhealix-healixpath.hf.space/gradio_api/mcp/`.
|
| 9 |
+
- Default `ANTHROPIC_MODEL` is `claude-haiku-5-5` because
|
| 10 |
+
`claude-3-haiku-20240307` was retired on 20 April 2026.
|
| 11 |
+
- Remove an unused `subprocess` import.
|
| 12 |
+
|
| 13 |
+
The TypeScript MCP server under `src/` is a local demo (no official MCP
|
| 14 |
+
transport) and `dist/` is gitignored, so a Gradio Space never ran it.
|
app.py
CHANGED
|
@@ -6,7 +6,6 @@ A web interface for generating AI-powered persona-driven narratives.
|
|
| 6 |
|
| 7 |
import gradio as gr
|
| 8 |
import json
|
| 9 |
-
import subprocess
|
| 10 |
import os
|
| 11 |
from pathlib import Path
|
| 12 |
from dotenv import load_dotenv
|
|
@@ -543,7 +542,7 @@ default_persona_choice = persona_list[0] if persona_list else CUSTOM_PERSONA_LAB
|
|
| 543 |
|
| 544 |
# Initialize Anthropic client
|
| 545 |
api_key = os.getenv("ANTHROPIC_API_KEY")
|
| 546 |
-
model = os.getenv("ANTHROPIC_MODEL", "claude-
|
| 547 |
client = Anthropic(api_key=api_key) if api_key else None
|
| 548 |
|
| 549 |
def get_persona_context(persona_id: str, custom_persona: str = "") -> str:
|
|
@@ -1266,4 +1265,4 @@ with gr.Blocks(title="HealixPath - AI Persona Storytelling", css=CUSTOM_CSS) as
|
|
| 1266 |
"""
|
| 1267 |
)
|
| 1268 |
if __name__ == "__main__":
|
| 1269 |
-
demo.launch()
|
|
|
|
| 6 |
|
| 7 |
import gradio as gr
|
| 8 |
import json
|
|
|
|
| 9 |
import os
|
| 10 |
from pathlib import Path
|
| 11 |
from dotenv import load_dotenv
|
|
|
|
| 542 |
|
| 543 |
# Initialize Anthropic client
|
| 544 |
api_key = os.getenv("ANTHROPIC_API_KEY")
|
| 545 |
+
model = os.getenv("ANTHROPIC_MODEL", "claude-haiku-5-5")
|
| 546 |
client = Anthropic(api_key=api_key) if api_key else None
|
| 547 |
|
| 548 |
def get_persona_context(persona_id: str, custom_persona: str = "") -> str:
|
|
|
|
| 1265 |
"""
|
| 1266 |
)
|
| 1267 |
if __name__ == "__main__":
|
| 1268 |
+
demo.launch(mcp_server=True)
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
gradio==5.49.1
|
| 2 |
-
anthropic
|
| 3 |
-
pydantic
|
| 4 |
-
python-dotenv
|
|
|
|
| 1 |
+
gradio[mcp]==5.49.1
|
| 2 |
+
anthropic==2.8.0
|
| 3 |
+
pydantic==2.11.10
|
| 4 |
+
python-dotenv==1.2.4
|
test_api.py
CHANGED
|
@@ -5,7 +5,7 @@ from anthropic import Anthropic
|
|
| 5 |
|
| 6 |
load_dotenv()
|
| 7 |
api_key = os.getenv('ANTHROPIC_API_KEY')
|
| 8 |
-
model = os.getenv('ANTHROPIC_MODEL', 'claude-
|
| 9 |
|
| 10 |
print(f'API Key found: {bool(api_key)}')
|
| 11 |
print(f'API Key (first 20 chars): {api_key[:20] if api_key else "None"}')
|
|
|
|
| 5 |
|
| 6 |
load_dotenv()
|
| 7 |
api_key = os.getenv('ANTHROPIC_API_KEY')
|
| 8 |
+
model = os.getenv('ANTHROPIC_MODEL', 'claude-haiku-5-5')
|
| 9 |
|
| 10 |
print(f'API Key found: {bool(api_key)}')
|
| 11 |
print(f'API Key (first 20 chars): {api_key[:20] if api_key else "None"}')
|