feat: add Super Alpha research, management and MCP workflows
Deploy production / deploy (push) Successful in 56s
Deploy production / deploy (push) Successful in 56s
This commit is contained in:
@@ -117,13 +117,14 @@ async def runs(
|
||||
source: str | None = Query(None, max_length=100),
|
||||
reference: str | None = Query(None, max_length=200),
|
||||
research_id: str | None = Query(None, max_length=200),
|
||||
alpha_type: Literal["REGULAR", "SUPER"] | None = None,
|
||||
q: str = Query("", max_length=200),
|
||||
sort: Literal["name", "created_at"] = "created_at",
|
||||
direction: Literal["asc", "desc"] = "desc",
|
||||
):
|
||||
async with request.app.state.sessions() as db:
|
||||
return await Business(db).backtests.runs(
|
||||
limit, offset, source, reference, research_id, q, sort, direction
|
||||
limit, offset, source, reference, research_id, q, sort, direction, alpha_type
|
||||
)
|
||||
|
||||
|
||||
@@ -195,3 +196,17 @@ async def attach_reference(attempt_id: str, body: ReferenceInput, request: Reque
|
||||
async def subset(preview_id: str, body: SubsetInput, request: Request):
|
||||
async with request.app.state.sessions.begin() as db:
|
||||
return await Business(db).backtests.subset(preview_id, body)
|
||||
|
||||
|
||||
@router.get("/items/{item_id}/artifact")
|
||||
async def artifact(item_id: str, request: Request, kind: Literal["snapshot", "components", "pnl"], limit: int = Query(25, ge=1, le=100), offset: int = Query(0, ge=0)):
|
||||
from fastapi import HTTPException
|
||||
|
||||
from ..research_access.contracts import Artifact
|
||||
from ..research_access.queries import EvidenceQueries
|
||||
from ..research_access.service import ResearchError
|
||||
async with request.app.state.sessions() as db:
|
||||
try:
|
||||
return await EvidenceQueries(db).artifact(Artifact(item_id=item_id, kind=kind, limit=limit, offset=offset))
|
||||
except ResearchError as exc:
|
||||
raise HTTPException(404, str(exc)) from None
|
||||
|
||||
Reference in New Issue
Block a user