Files
prowler/ui/lib/lighthouse/tools/users.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

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({}),
},
);