fix: update API endpoints to use /api/v1 prefix, fix blockchain node URL, resolve variable scoping issues, and accept multiple success status codes

- Change marketplace endpoints from /v1/* to /api/v1/* for consistency
- Update blockchain status node 1 URL from localhost:8082 to localhost:8003
- Fix blockchain health endpoint to use /health instead of /v1/health
- Generate unique workflow_id using uuid.uuid4() instead of undefined agent_id variable
- Accept both 200 and 202 status codes for agent
This commit is contained in:
oib
2026-03-05 10:00:21 +01:00
parent 140cc0aa4e
commit d82600a953
9 changed files with 1195 additions and 56 deletions

View File

@@ -35,7 +35,7 @@ def create(ctx, name: str, description: str, workflow_file, verification: str,
"name": name,
"description": description,
"verification_level": verification,
"workflow_id": agent_id,
"workflow_id": str(uuid.uuid4()),
"inputs": {},
"max_execution_time": max_execution_time,
"max_cost_budget": max_cost_budget
@@ -150,7 +150,7 @@ def execute(ctx, agent_id: str, inputs, verification: str, priority: str, timeou
json=execution_data
)
if response.status_code == 202:
if response.status_code in (200, 202):
execution = response.json()
success(f"Agent execution started: {execution['id']}")
output(execution, ctx.obj['output_format'])
@@ -344,7 +344,7 @@ def execute(ctx, network_id: str, task, priority: str):
json=execution_data
)
if response.status_code == 202:
if response.status_code in (200, 202):
execution = response.json()
success(f"Network execution started: {execution['id']}")
output(execution, ctx.obj['output_format'])
@@ -503,7 +503,7 @@ def train(ctx, agent_id: str, feedback, epochs: int):
json=training_data
)
if response.status_code == 202:
if response.status_code in (200, 202):
training = response.json()
success(f"Training started: {training['id']}")
output(training, ctx.obj['output_format'])