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
811 B
TypeScript
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,
|
|
},
|
|
);
|