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>
36 lines
911 B
TypeScript
36 lines
911 B
TypeScript
import { tool } from "@langchain/core/tools";
|
|
|
|
import { getProvider, getProviders } from "@/actions/providers";
|
|
import { getProviderSchema, getProvidersSchema } from "@/types/lighthouse";
|
|
|
|
export const getProvidersTool = tool(
|
|
async ({ page, query, sort, filters }) => {
|
|
return await getProviders({
|
|
page: page,
|
|
query: query,
|
|
sort: sort,
|
|
filters: filters,
|
|
});
|
|
},
|
|
{
|
|
name: "getProviders",
|
|
description:
|
|
"Retrieves a list of all providers with options for filtering by various criteria.",
|
|
schema: getProvidersSchema,
|
|
},
|
|
);
|
|
|
|
export const getProviderTool = tool(
|
|
async ({ id }) => {
|
|
const formData = new FormData();
|
|
formData.append("id", id);
|
|
return await getProvider(formData);
|
|
},
|
|
{
|
|
name: "getProvider",
|
|
description:
|
|
"Fetches detailed information about a specific provider by their ID.",
|
|
schema: getProviderSchema,
|
|
},
|
|
);
|