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>
30 lines
756 B
TypeScript
30 lines
756 B
TypeScript
import { tool } from "@langchain/core/tools";
|
|
import { z } from "zod";
|
|
|
|
import { getUserInfo, getUsers } from "@/actions/users/users";
|
|
import { getUsersSchema } from "@/types/lighthouse";
|
|
|
|
export const getUsersTool = tool(
|
|
async ({ page, query, sort, filters }) => {
|
|
return await getUsers({ page, query, sort, filters });
|
|
},
|
|
{
|
|
name: "getUsers",
|
|
description:
|
|
"Retrieves a list of all users with options for filtering by various criteria.",
|
|
schema: getUsersSchema,
|
|
},
|
|
);
|
|
|
|
export const getMyProfileInfoTool = tool(
|
|
async () => {
|
|
return await getUserInfo();
|
|
},
|
|
{
|
|
name: "getMyProfileInfo",
|
|
description:
|
|
"Fetches detailed information about the current authenticated user.",
|
|
schema: z.object({}),
|
|
},
|
|
);
|