refactor(api): extract assistant chat orchestration
This commit is contained in:
@@ -45,5 +45,25 @@ describe("assistant tool selection", () => {
|
||||
expect(selectedNames).toContain("get_resource_holidays");
|
||||
expect(selectedNames).toContain("list_holidays_by_region");
|
||||
expect(selectedNames).toContain("list_holiday_calendars");
|
||||
expect(selectedNames).toContain("get_vacation_balance");
|
||||
expect(selectedNames).toContain("get_entitlement_summary");
|
||||
expect(selectedNames).toContain("list_vacations_upcoming");
|
||||
});
|
||||
|
||||
it("prioritizes report and dashboard tools for reporting requests", () => {
|
||||
const allPermissions = Object.values(PermissionKey);
|
||||
const selectedNames = getSelectedToolNames(
|
||||
allPermissions,
|
||||
[{ role: "user", content: "Build me a dashboard report for monthly SAH, budget forecast and project health." }],
|
||||
SystemRole.ADMIN,
|
||||
"/dashboard",
|
||||
);
|
||||
|
||||
expect(selectedNames.length).toBeLessThanOrEqual(128);
|
||||
expect(selectedNames).toContain("get_dashboard_detail");
|
||||
expect(selectedNames).toContain("get_budget_forecast");
|
||||
expect(selectedNames).toContain("get_project_health");
|
||||
expect(selectedNames).toContain("run_report");
|
||||
expect(selectedNames).toContain("get_statistics");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user