refactor: unify AI capabilities and workspace integration
This commit is contained in:
@@ -6,7 +6,8 @@ import pytest
|
||||
from fastapi import HTTPException
|
||||
from sqlalchemy import func, select
|
||||
|
||||
from app.ai.tools import CATALOG, read_tool
|
||||
from app.ai.capabilities import ToolContext
|
||||
from app.ai.tools import CAPABILITIES
|
||||
from app.alphas import upsert_alpha
|
||||
from app.backtests.contracts import PreviewInput, RerunInput, SubsetInput
|
||||
from app.business import Business
|
||||
@@ -137,7 +138,7 @@ async def test_invalid_construction_has_no_partial_preview(logged_in, app, fixed
|
||||
async def test_input_pagination_old_types_and_explicit_exclusions(app, logged_in, catalog, fixed_input):
|
||||
async def tool(name, args):
|
||||
async with app.state.sessions.begin() as db:
|
||||
return await read_tool(Business(db), name, CATALOG[name][0].model_validate(args))
|
||||
return await CAPABILITIES[name].invoke(ToolContext(Business(db)), args)
|
||||
|
||||
page = await tool("get_research_input", {"input_id": fixed_input["id"], "offset": 100, "limit": 25})
|
||||
assert page["field_count"] == page["total"] == 123 and len(page["items"]) == 23
|
||||
|
||||
Reference in New Issue
Block a user