Skip to main content

OpenAPIConnector

Use OpenAPIConnector as an interface between deepset and OpenAPI services.

Basic Information

  • Type: haystack_integrations.connectors.openapi.OpenAPIConnector
  • Components it can connect with:

Inputs

ParameterTypeDefaultDescription
operation_idstrThe operation ID to invoke. You can find the operation ID in the OpenAPI specification.
argumentsOptional[Dict[str, Any]]NoneOptional parameters for the endpoint (query, path, or body parameters).

Outputs

ParameterTypeDefaultDescription
responseDict[str, Any]Dictionary containing the service response.

Overview

Use OpenAPIConnector to invoke REST endpoints defined in an OpenAPI specification. The OpenAPIConnector serves as a bridge between deepset pipelines and any REST API that follows the OpenAPI(formerly Swagger) specification. It dynamically interprets the API specification and provides an interface for executing API operations. It is usually invoked when it receives input arguments from a deepset pipeline run() method or by other components in a pipeline that pass input arguments to this component.

Usage Example

components:
OpenAPIConnector:
type: components.connectors.openapi.OpenAPIConnector
init_parameters:

Parameters

Init Parameters

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
openapi_specstrURL, file path, or raw string of the OpenAPI specification.
credentialsOptional[Secret]NoneOptional API key or credentials for the service wrapped in a Secret
service_kwargsOptional[Dict[str, Any]]NoneAdditional keyword arguments passed to OpenAPIClient.from_spec(). For example, you can pass a custom config_factory or other configuration options.

Run Method Parameters

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
operation_idstrThe operation ID from the OpenAPI specification to invoke.
argumentsOptional[Dict[str, Any]]NoneOptional parameters for the endpoint (query, path, or body parameters).