@langchain/community
Version:
Third-party integrations for LangChain.js
1 lines • 7.44 kB
Source Map (JSON)
{"version":3,"file":"connery.d.cts","names":["AsyncCaller","AsyncCallerParams","StructuredTool","InferInteropZodOutput","z","ConneryServiceParams","Parameter","Action","Input","Record","Output","ConneryActionSchema","ZodString","ZodOptional","ZodObject","ConneryAction","ConneryService","Promise","Response"],"sources":["../../src/tools/connery.d.ts"],"sourcesContent":["import { AsyncCaller, AsyncCallerParams } from \"@langchain/core/utils/async_caller\";\nimport { StructuredTool } from \"@langchain/core/tools\";\nimport { InferInteropZodOutput } from \"@langchain/core/utils/types\";\nimport { z } from \"zod/v3\";\n/**\n * An object containing configuration parameters for the ConneryService class.\n * @extends AsyncCallerParams\n */\nexport interface ConneryServiceParams extends AsyncCallerParams {\n runnerUrl: string;\n apiKey: string;\n}\ntype Parameter = {\n key: string;\n title: string;\n description: string;\n type: string;\n validation?: {\n required?: boolean;\n };\n};\ntype Action = {\n id: string;\n key: string;\n title: string;\n description: string;\n type: string;\n inputParameters: Parameter[];\n outputParameters: Parameter[];\n pluginId: string;\n};\ntype Input = Record<string, string | undefined>;\ntype Output = Record<string, string>;\ntype ConneryActionSchema = z.ZodObject<Record<string, z.ZodString | z.ZodOptional<z.ZodString>>>;\n/**\n * A LangChain Tool object wrapping a Connery action.\n * ConneryAction is a structured tool that can be used only in the agents supporting structured tools.\n * @extends StructuredTool\n */\nexport declare class ConneryAction extends StructuredTool {\n protected _action: Action;\n protected _service: ConneryService;\n name: string;\n description: string;\n schema: ConneryActionSchema;\n /**\n * Creates a ConneryAction instance based on the provided Connery Action.\n * @param _action The Connery Action.\n * @param _service The ConneryService instance.\n * @returns A ConneryAction instance.\n */\n constructor(_action: Action, _service: ConneryService);\n /**\n * Runs the Connery Action with the provided input.\n * @param arg The input object expected by the action.\n * @returns A promise that resolves to a JSON string containing the output of the action.\n */\n protected _call(arg: InferInteropZodOutput<ConneryActionSchema>): Promise<string>;\n /**\n * Creates a Zod schema for the input object expected by the Connery action.\n * @returns A Zod schema for the input object expected by the Connery action.\n */\n protected createInputSchema(): z.ZodObject<Record<string, z.ZodString | z.ZodOptional<z.ZodString>>>;\n}\n/**\n * A service for working with Connery Actions.\n */\nexport declare class ConneryService {\n protected runnerUrl: string;\n protected apiKey: string;\n protected asyncCaller: AsyncCaller;\n /**\n * Creates a ConneryService instance.\n * @param params A ConneryServiceParams object.\n * If not provided, the values are retrieved from the CONNERY_RUNNER_URL\n * and CONNERY_RUNNER_API_KEY environment variables.\n * @returns A ConneryService instance.\n */\n constructor(params?: ConneryServiceParams);\n /**\n * Returns the list of Connery Actions wrapped as a LangChain StructuredTool objects.\n * @returns A promise that resolves to an array of ConneryAction objects.\n */\n listActions(): Promise<ConneryAction[]>;\n /**\n * Returns the specified Connery action wrapped as a LangChain StructuredTool object.\n * @param actionId The ID of the action to return.\n * @returns A promise that resolves to a ConneryAction object.\n */\n getAction(actionId: string): Promise<ConneryAction>;\n /**\n * Runs the specified Connery action with the provided input.\n * @param actionId The ID of the action to run.\n * @param input The input object expected by the action.\n * @returns A promise that resolves to a JSON string containing the output of the action.\n */\n runAction(actionId: string, input?: Input): Promise<string>;\n /**\n * Returns the list of actions available in the Connery runner.\n * @returns A promise that resolves to an array of Action objects.\n */\n protected _listActions(): Promise<Action[]>;\n /**\n * Returns the specified action available in the Connery runner.\n * @param actionId The ID of the action to return.\n * @returns A promise that resolves to an Action object.\n * @throws An error if the action with the specified ID is not found.\n */\n protected _getAction(actionId: string): Promise<Action>;\n /**\n * Runs the specified Connery action with the provided input.\n * @param actionId The ID of the action to run.\n * @param input The input object expected by the action.\n * @returns A promise that resolves to a RunActionResult object.\n */\n protected _runAction(actionId: string, input?: Input): Promise<Output>;\n /**\n * Returns a standard set of HTTP headers to be used in API calls to the Connery runner.\n * @returns An object containing the standard set of HTTP headers.\n */\n protected _getHeaders(): Record<string, string>;\n /**\n * Shared error handler for API calls to the Connery runner.\n * If the response is not ok, an error is thrown containing the error message returned by the Connery runner.\n * Otherwise, the promise resolves to void.\n * @param response The response object returned by the Connery runner.\n * @param errorMessage The error message to be used in the error thrown if the response is not ok.\n * @returns A promise that resolves to void.\n * @throws An error containing the error message returned by the Connery runner.\n */\n protected _handleError(response: Response, errorMessage: string): Promise<void>;\n}\nexport {};\n//# sourceMappingURL=connery.d.ts.map"],"mappings":";;;;;;;;;AAQA;AAGC;AAUIO,UAbYF,oBAAAA,SAA6BJ,iBAoBf,CAAA;EAG1BO,SAAK,EAAA,MAAA;EACLE,MAAAA,EAAAA,MAAM;AAAS;KApBfJ,SAAAA,GAqBmDM;EAA4BA,GAAAA,EAAAA,MAAAA;EAAdC,KAAAA,EAAAA,MAAAA;EAA/BJ,WAAAA,EAAAA,MAAAA;EAAVK,IAAAA,EAAAA,MAAAA;EAAS,UAAA,CAAA,EAAA;IAMjBC,QAAAA,CAAAA,EAAAA,OAAa;EACXR,CAAAA;CACCS;KApBnBT,MAAAA,GAuBOI;EAOaJ,EAAAA,EAAAA,MAAAA;EAAkBS,GAAAA,EAAAA,MAAAA;EAMIL,KAAAA,EAAAA,MAAAA;EAAtBR,WAAAA,EAAAA,MAAAA;EAA6Cc,IAAAA,EAAAA,MAAAA;EAKNL,eAAAA,EAnC3CN,SAmC2CM,EAAAA;EAA4BA,gBAAAA,EAlCtEN,SAkCsEM,EAAAA;EAAdC,QAAAA,EAAAA,MAAAA;CAA/BJ;KA/B1CD,KAAAA,GAAQC,MA+BwBK,CAAAA,MAAAA,EAAAA,MAAAA,GAAAA,SAAAA,CAAAA;KA9BhCJ,MAAAA,GAASD,MAO6BP,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;AAAc,KANpDS,mBAAAA,GAAsBP,CAAAA,CAAEU,SAM4B,CANlBL,MAMkB,CAAA,MAAA,EANHL,CAAAA,CAAEQ,SAMC,GANWR,CAAAA,CAAES,WAMb,CANyBT,CAAAA,CAAEQ,SAM3B,CAAA,CAAA,CAAA;AA4BzD;;;;;AAsByCG,cAlDpBA,aAAAA,SAAsBb,cAA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