Files
prowler/ui/lib/lighthouse/tools/resources.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
811 B
TypeScript

import { tool } from "@langchain/core/tools";
import {
getLighthouseResourceById,
getLighthouseResources,
} from "@/actions/lighthouse/resources";
import { getResourceSchema, getResourcesSchema } from "@/types/lighthouse";
export const getResourcesTool = tool(
async ({ page, query, sort, filters, fields }) => {
return await getLighthouseResources(page, query, sort, filters, fields);
},
{
name: "getResources",
description: "Fetches all resource information",
schema: getResourcesSchema,
},
);
export const getResourceTool = tool(
async ({ id, fields, include }) => {
return await getLighthouseResourceById(id, fields, include);
},
{
name: "getResource",
description: "Fetches information about a resource by its UUID.",
schema: getResourceSchema,
},
);