Add swarm router and update arbitrage command parameters
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Successful in 3s
Deploy to Testnet / deploy-testnet (push) Successful in 1m12s
Documentation Validation / validate-docs (push) Failing after 16s
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Successful in 4s
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Successful in 3s
Deploy to Testnet / deploy-testnet (push) Successful in 1m12s
Documentation Validation / validate-docs (push) Failing after 16s
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Successful in 4s
- Import swarm router in main.py - Add swarm router with /v1 prefix and root prefix for CLI compatibility - Add duplicate agent router at /api/v1/agents for CLI compatibility - Update scenario 25 arbitrage analyze command parameters from wallet/resource-type/timeframe to market-a/market-b/token
This commit is contained in:
@@ -65,6 +65,7 @@ from .routers import (
|
||||
multi_modal_rl,
|
||||
payments,
|
||||
services,
|
||||
swarm,
|
||||
users,
|
||||
web_vitals,
|
||||
)
|
||||
@@ -342,6 +343,7 @@ def create_app() -> FastAPI:
|
||||
app.include_router(hermes_enhanced, prefix="/v1")
|
||||
app.include_router(monitoring_dashboard, prefix="/v1")
|
||||
app.include_router(agent_router.router, prefix="/v1/agents")
|
||||
app.include_router(agent_router.router, prefix="/api/v1/agents") # CLI compatibility
|
||||
app.include_router(agent_identity, prefix="/v1")
|
||||
app.include_router(global_marketplace, prefix="/v1")
|
||||
app.include_router(cross_chain_integration, prefix="/v1")
|
||||
@@ -361,6 +363,10 @@ def create_app() -> FastAPI:
|
||||
# Add multi-modal RL router
|
||||
app.include_router(multi_modal_rl, prefix="/v1")
|
||||
|
||||
# Add swarm router for CLI compatibility
|
||||
app.include_router(swarm.router, prefix="/v1")
|
||||
app.include_router(swarm.router) # CLI compatibility (calls /swarm/list directly)
|
||||
|
||||
# Add Prometheus metrics endpoint
|
||||
metrics_app = make_asgi_app()
|
||||
app.mount("/metrics", metrics_app)
|
||||
|
||||
27
apps/coordinator-api/src/app/routers/swarm.py
Normal file
27
apps/coordinator-api/src/app/routers/swarm.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""Swarm coordination router for AITBC CLI integration."""
|
||||
|
||||
from typing import List, Optional
|
||||
from fastapi import APIRouter, Query
|
||||
from pydantic import BaseModel
|
||||
|
||||
router = APIRouter(prefix="/swarm", tags=["Swarm"])
|
||||
|
||||
|
||||
class SwarmInfo(BaseModel):
|
||||
"""Swarm information model."""
|
||||
swarm_id: str
|
||||
name: str
|
||||
status: str
|
||||
agent_count: int
|
||||
task_count: int
|
||||
|
||||
|
||||
@router.get("/list", response_model=List[SwarmInfo])
|
||||
async def list_swarms(
|
||||
swarm_id: Optional[str] = Query(None, description="Filter by swarm ID"),
|
||||
status: Optional[str] = Query(None, description="Filter by status"),
|
||||
limit: int = Query(20, description="Number of swarms to list")
|
||||
):
|
||||
"""List active swarms."""
|
||||
# Return empty list for now - backend not fully implemented
|
||||
return []
|
||||
@@ -74,9 +74,9 @@ Compare GPU prices across different listings.
|
||||
|
||||
```bash
|
||||
aitbc arbitrage analyze \
|
||||
--wallet my-agent-wallet \
|
||||
--resource-type gpu \
|
||||
--timeframe 1h
|
||||
--market-a exchange-a \
|
||||
--market-b exchange-b \
|
||||
--token gpu
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
Reference in New Issue
Block a user