langchain.js
    Preparing search index...

    A service for working with Connery Actions.

    Index

    Constructors

    • Creates a ConneryService instance.

      Parameters

      • Optionalparams: ConneryServiceParams

        A ConneryServiceParams object. If not provided, the values are retrieved from the CONNERY_RUNNER_URL and CONNERY_RUNNER_API_KEY environment variables.

      Returns ConneryService

      A ConneryService instance.

    Properties

    apiKey: string
    asyncCaller: AsyncCaller
    runnerUrl: string

    Methods

    • Returns the specified action available in the Connery runner.

      Parameters

      • actionId: string

        The ID of the action to return.

      Returns Promise<Action>

      A promise that resolves to an Action object.

      An error if the action with the specified ID is not found.

    • Returns a standard set of HTTP headers to be used in API calls to the Connery runner.

      Returns Record<string, string>

      An object containing the standard set of HTTP headers.

    • Shared error handler for API calls to the Connery runner. If the response is not ok, an error is thrown containing the error message returned by the Connery runner. Otherwise, the promise resolves to void.

      Parameters

      • response: Response

        The response object returned by the Connery runner.

      • errorMessage: string

        The error message to be used in the error thrown if the response is not ok.

      Returns Promise<void>

      A promise that resolves to void.

      An error containing the error message returned by the Connery runner.

    • Returns the list of actions available in the Connery runner.

      Returns Promise<Action[]>

      A promise that resolves to an array of Action objects.

    • Runs the specified Connery action with the provided input.

      Parameters

      • actionId: string

        The ID of the action to run.

      • input: Input = {}

        The input object expected by the action.

      Returns Promise<Output>

      A promise that resolves to a RunActionResult object.

    • Returns the specified Connery action wrapped as a LangChain StructuredTool object.

      Parameters

      • actionId: string

        The ID of the action to return.

      Returns Promise<ConneryAction>

      A promise that resolves to a ConneryAction object.

    • Returns the list of Connery Actions wrapped as a LangChain StructuredTool objects.

      Returns Promise<ConneryAction[]>

      A promise that resolves to an array of ConneryAction objects.

    • Runs the specified Connery action with the provided input.

      Parameters

      • actionId: string

        The ID of the action to run.

      • input: Input = {}

        The input object expected by the action.

      Returns Promise<string>

      A promise that resolves to a JSON string containing the output of the action.