Files
prowler/ui/lib/lighthouse/tools/roles.ts
Chandrapal Badshah 74f7a86c2b feat(lighthouse): Add chat interface (#7878)
Co-authored-by: Chandrapal Badshah <12944530+Chan9390@users.noreply.github.com>
2025-06-12 15:19:41 +02:00

27 lines
623 B
TypeScript

import { tool } from "@langchain/core/tools";
import { getRoleInfoById, getRoles } from "@/actions/roles";
import { getRoleSchema, getRolesSchema } from "@/types/lighthouse";
export const getRolesTool = tool(
async ({ page, query, sort, filters }) => {
return await getRoles({ page, query, sort, filters });
},
{
name: "getRoles",
description: "Get a list of roles.",
schema: getRolesSchema,
},
);
export const getRoleTool = tool(
async ({ id }) => {
return await getRoleInfoById(id);
},
{
name: "getRole",
description: "Get a role by UUID.",
schema: getRoleSchema,
},
);