Skip to main content

DeepsetSQLMetadataRetriever

Run SQL queries against metadata stored in deepset AI Platform.

Basic Information

  • Type: deepset_cloud_custom_nodes.retrievers.deepset_sql_metadata_retriever.DeepsetSQLMetadataRetriever
  • Components it can connect with:
    • Input that produces SQL strings at runtime.
    • PromptBuilder or components that consume the JSON response.
    • AnswerBuilder when you want to return the JSON response to clients.

Inputs

ParameterTypeDefaultDescription
sql_querystringSQL statement that targets the workspace metadata tables.
cursorOptional[str]NonePagination cursor returned by the API.
fetch_sizeOptional[int]NoneNumber of rows to fetch per page. Overrides the init default.

Outputs

ParameterTypeDefaultDescription
retrieved_informationDict[str, Any]JSON decoded response returned by the deepset metadata SQL endpoint.

Overview

Use DeepsetSQLMetadataRetriever to aggregate metadata values, join metadata tables, or to paginate through large result sets by forwarding the cursor returned in the response. The component strips Markdown style fences from the query so you can pass SQL prompts without extra parsing.

Usage Example

Initializing the Component

components:
DeepsetSQLMetadataRetriever:
type: deepset_cloud_custom_nodes.retrievers.deepset_sql_metadata_retriever.DeepsetSQLMetadataRetriever
init_parameters:
workspace: ${DEEPSET_WORKSPACE_ID}
timeout: 120
fetch_size: 200

Using the Component in a Pipeline

Coming soon

Bear with us while we're working on a pipeline template with DeepsetSQLMetadataRetriever.

Parameters

Init Parameters

ParameterTypeDefaultDescription
workspacestrWorkspace ID whose metadata tables you query.
deepset_api_keySecretenv var DEEPSET_API_KEYAPI key used for the SQL endpoint.
timeoutfloat80.0HTTP timeout in seconds for the SQL request.
fetch_sizeOptional[int]NoneDefault number of rows fetched per page when run() does not override it.

Run Method Parameters

ParameterTypeDefaultDescription
sql_querystringSQL statement to execute. You can provide raw SQL or a code block wrapped in ```sql fences.
cursorOptional[str]NoneCursor token passed back to the endpoint when you resume pagination.
fetch_sizeOptional[int]NoneRows per page for this invocation. Fall back to the init value when omitted.