fix: MCP server API URL patterns — path params not JSON body, stage name mapping
This commit is contained in:
parent
f27c18b555
commit
fd48435a84
1 changed files with 6 additions and 8 deletions
|
|
@ -167,8 +167,7 @@ def trigger_pipeline(video_id: str = "", filename: str = "") -> str:
|
|||
import httpx
|
||||
|
||||
resp = httpx.post(
|
||||
f"{API_URL}/api/v1/admin/pipeline/trigger",
|
||||
json={"video_id": video_id},
|
||||
f"{API_URL}/api/v1/admin/pipeline/trigger/{video_id}",
|
||||
timeout=10,
|
||||
)
|
||||
return _json({
|
||||
|
|
@ -214,8 +213,7 @@ def trigger_batch(
|
|||
for v in videos:
|
||||
try:
|
||||
resp = httpx.post(
|
||||
f"{API_URL}/api/v1/admin/pipeline/trigger",
|
||||
json={"video_id": str(v["id"])},
|
||||
f"{API_URL}/api/v1/admin/pipeline/trigger/{v['id']}",
|
||||
timeout=10,
|
||||
)
|
||||
results.append({
|
||||
|
|
@ -239,8 +237,7 @@ def revoke_pipeline(video_id: str) -> str:
|
|||
import httpx
|
||||
|
||||
resp = httpx.post(
|
||||
f"{API_URL}/api/v1/admin/pipeline/revoke",
|
||||
json={"video_id": video_id},
|
||||
f"{API_URL}/api/v1/admin/pipeline/revoke/{video_id}",
|
||||
timeout=10,
|
||||
)
|
||||
return _json({
|
||||
|
|
@ -258,9 +255,10 @@ def rerun_stage(video_id: str, stage: int) -> str:
|
|||
|
||||
import httpx
|
||||
|
||||
stage_name = {2: "stage2_segmentation", 3: "stage3_extraction", 4: "stage4_classification", 5: "stage5_synthesis", 6: "stage6_embed_and_index"}.get(stage, f"stage{stage}")
|
||||
|
||||
resp = httpx.post(
|
||||
f"{API_URL}/api/v1/admin/pipeline/rerun-stage",
|
||||
json={"video_id": video_id, "stage": stage},
|
||||
f"{API_URL}/api/v1/admin/pipeline/rerun-stage/{video_id}/{stage_name}",
|
||||
timeout=10,
|
||||
)
|
||||
return _json({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue