Skip to content

Commit 5a93004

Browse files
refactor: rename demo to agent
1 parent 7542922 commit 5a93004

12 files changed

Lines changed: 34 additions & 34 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@ jobs:
119119
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
120120
run: |
121121
uv run modal deploy src/policyengine_api/modal_app.py
122-
uv run modal deploy src/policyengine_api/demo_sandbox.py
122+
uv run modal deploy src/policyengine_api/agent_sandbox.py

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
API_PORT: ${API_PORT:-8000}
1515
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
1616
POLICYENGINE_API_URL: http://localhost:${API_PORT:-8000}
17-
DEMO_USE_MODAL: "false"
17+
AGENT_USE_MODAL: "false"
1818
volumes:
1919
- ./src:/app/src
2020
- ./docs/out:/app/docs/out

docs/src/components/policy-chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function PolicyChat() {
9393
]);
9494

9595
try {
96-
const res = await fetch(`${baseUrl}/demo/stream`, {
96+
const res = await fetch(`${baseUrl}/agent/stream`, {
9797
method: "POST",
9898
headers: { "Content-Type": "application/json" },
9999
body: JSON.stringify({ question: userMessage }),

docs/src/components/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const navigation = [
1313
{ name: "Quick start", href: "/quickstart" },
1414
{ name: "Environment setup", href: "/setup" },
1515
{ name: "MCP integration", href: "/mcp" },
16-
{ name: "AI demo", href: "/demo" },
16+
{ name: "AI agent", href: "/agent" },
1717
],
1818
},
1919
{

src/policyengine_api/api/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from fastapi import APIRouter
44

55
from . import (
6+
agent,
67
analysis,
78
change_aggregates,
89
datasets,
9-
demo,
1010
dynamics,
1111
household,
1212
outputs,
@@ -34,6 +34,6 @@
3434
api_router.include_router(change_aggregates.router)
3535
api_router.include_router(household.router)
3636
api_router.include_router(analysis.router)
37-
api_router.include_router(demo.router)
37+
api_router.include_router(agent.router)
3838

3939
__all__ = ["api_router"]
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Demo endpoint for AI-powered policy analysis.
1+
"""Agent endpoint for AI-powered policy analysis.
22
33
This endpoint lets users ask natural language questions about tax/benefit policy
44
and get AI-generated reports using Claude Code connected to the PolicyEngine MCP server.
@@ -16,7 +16,7 @@
1616

1717
from policyengine_api.config import settings
1818

19-
router = APIRouter(prefix="/demo", tags=["demo"])
19+
router = APIRouter(prefix="/agent", tags=["agent"])
2020

2121

2222
class AskRequest(BaseModel):
@@ -33,7 +33,7 @@ class AskResponse(BaseModel):
3333

3434

3535
class JobStatusResponse(BaseModel):
36-
"""Status of a demo job."""
36+
"""Status of an agent job."""
3737

3838
job_id: str
3939
status: str
@@ -87,7 +87,7 @@ async def _stream_claude_code(question: str, api_base_url: str):
8787
async def _stream_modal_sandbox(question: str, api_base_url: str):
8888
"""Stream output from Claude Code running in Modal Sandbox."""
8989

90-
from policyengine_api.demo_sandbox import run_claude_code_in_sandbox
90+
from policyengine_api.agent_sandbox import run_claude_code_in_sandbox
9191

9292
sb, process = run_claude_code_in_sandbox(question, api_base_url)
9393

@@ -129,7 +129,7 @@ async def stream_analysis(request: AskRequest):
129129
"""
130130
api_base_url = settings.policyengine_api_url
131131

132-
if settings.demo_use_modal:
132+
if settings.agent_use_modal:
133133
return StreamingResponse(
134134
_stream_modal_sandbox(request.question, api_base_url),
135135
media_type="text/event-stream",
@@ -145,8 +145,8 @@ async def stream_analysis(request: AskRequest):
145145
async def ask_question(request: AskRequest) -> AskResponse:
146146
"""Ask a policy question (non-streaming).
147147
148-
Starts the analysis in the background. Poll GET /demo/status/{job_id} for results.
149-
For real-time streaming, use POST /demo/stream instead.
148+
Starts the analysis in the background. Poll GET /agent/status/{job_id} for results.
149+
For real-time streaming, use POST /agent/stream instead.
150150
"""
151151
job_id = str(uuid4())
152152
api_base_url = settings.policyengine_api_url
@@ -162,7 +162,7 @@ async def ask_question(request: AskRequest) -> AskResponse:
162162
async def run_job():
163163
_jobs[job_id]["status"] = "running"
164164
try:
165-
if settings.demo_use_modal:
165+
if settings.agent_use_modal:
166166
import modal
167167

168168
run_policy_analysis = modal.Function.lookup(
@@ -203,7 +203,7 @@ async def run_job():
203203

204204
@router.get("/status/{job_id}", response_model=JobStatusResponse)
205205
async def get_job_status(job_id: str) -> JobStatusResponse:
206-
"""Get the status of a demo job."""
206+
"""Get the status of an agent job."""
207207
if job_id not in _jobs:
208208
raise HTTPException(status_code=404, detail="Job not found")
209209

src/policyengine_api/api/analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def _trigger_economy_comparison(
522522
"""Trigger economy comparison analysis (local or Modal)."""
523523
from policyengine_api.config import settings
524524

525-
if not settings.demo_use_modal and session is not None:
525+
if not settings.agent_use_modal and session is not None:
526526
# Run locally
527527
if tax_benefit_model_name == "policyengine_uk":
528528
_run_local_economy_comparison_uk(job_id, session)

src/policyengine_api/api/household.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def _trigger_modal_household(
371371
"""Trigger household simulation - Modal or local based on settings."""
372372
from policyengine_api.config import settings
373373

374-
if not settings.demo_use_modal and session is not None:
374+
if not settings.agent_use_modal and session is not None:
375375
# Run locally
376376
if request.tax_benefit_model_name == "policyengine_uk":
377377
_run_local_household_uk(

0 commit comments

Comments
 (0)