mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-19 02:21:52 +00:00
74f7a86c2b
Co-authored-by: Chandrapal Badshah <12944530+Chan9390@users.noreply.github.com>
27 lines
623 B
TypeScript
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,
|
|
},
|
|
);
|