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:
Inputthat produces SQL strings at runtime.PromptBuilderor components that consume the JSON response.AnswerBuilderwhen you want to return the JSON response to clients.
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| sql_query | string | SQL statement that targets the workspace metadata tables. | |
| cursor | Optional[str] | None | Pagination cursor returned by the API. |
| fetch_size | Optional[int] | None | Number of rows to fetch per page. Overrides the init default. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| retrieved_information | Dict[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
| Parameter | Type | Default | Description |
|---|---|---|---|
| workspace | str | Workspace ID whose metadata tables you query. | |
| deepset_api_key | Secret | env var DEEPSET_API_KEY | API key used for the SQL endpoint. |
| timeout | float | 80.0 | HTTP timeout in seconds for the SQL request. |
| fetch_size | Optional[int] | None | Default number of rows fetched per page when run() does not override it. |
Run Method Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| sql_query | string | SQL statement to execute. You can provide raw SQL or a code block wrapped in ```sql fences. | |
| cursor | Optional[str] | None | Cursor token passed back to the endpoint when you resume pagination. |
| fetch_size | Optional[int] | None | Rows per page for this invocation. Fall back to the init value when omitted. |
Was this page helpful?