feat: add dynamic advisor asset allocation

This commit is contained in:
Windows
2026-09-11 14:44:29 +08:00
parent 8ffd08b4ce
commit ff71a1a724
15 changed files with 652 additions and 22 deletions
+22
View File
@@ -0,0 +1,22 @@
"""Analysis-only dynamic asset allocation endpoint."""
from fastapi import APIRouter, Depends
from app.api.dependencies.auth import build_request_context
from app.api.dependencies.rate_limit import enforce_rate_limit
from app.api.schemas.asset_allocation import AssetAllocationQuery
from app.core.contracts import RequestContext
from app.service.asset_allocation_service import AssetAllocationService
router = APIRouter(
prefix="/api/v1/advisor", tags=["advisor-asset-allocation"],
dependencies=[Depends(enforce_rate_limit)],
)
@router.post("/asset-allocation")
async def generate_asset_allocation(
payload: AssetAllocationQuery,
context: RequestContext = Depends(build_request_context), # noqa: B008
) -> dict[str, object]:
return await AssetAllocationService().generate_for_agent(payload, context)
+3
View File
@@ -0,0 +1,3 @@
from app.core.advisor_allocation_contracts import AssetAllocationQuery
__all__ = ["AssetAllocationQuery"]