langchain_community.document_loaders.cube_semantic.CubeSemanticLoader¶

class langchain_community.document_loaders.cube_semantic.CubeSemanticLoader(cube_api_url: str, cube_api_token: str, load_dimension_values: bool = True, dimension_values_limit: int = 10000, dimension_values_max_retries: int = 10, dimension_values_retry_delay: int = 3)[source]¶

Load Cube semantic layer metadata.

Parameters
  • cube_api_url – REST API endpoint. Use the REST API of your Cube’s deployment. Please find out more information here: https://cube.dev/docs/http-api/rest#configuration-base-path

  • cube_api_token – Cube API token. Authentication tokens are generated based on your Cube’s API secret. Please find out more information here: https://cube.dev/docs/security#generating-json-web-tokens-jwt

  • load_dimension_values – Whether to load dimension values for every string dimension or not.

  • dimension_values_limit – Maximum number of dimension values to load.

  • dimension_values_max_retries – Maximum number of retries to load dimension values.

  • dimension_values_retry_delay – Delay between retries to load dimension values.

Methods

__init__(cube_api_url, cube_api_token[, ...])

lazy_load()

A lazy loader for Documents.

load()

Makes a call to Cube's REST API metadata endpoint.

load_and_split([text_splitter])

Load Documents and split into chunks.

__init__(cube_api_url: str, cube_api_token: str, load_dimension_values: bool = True, dimension_values_limit: int = 10000, dimension_values_max_retries: int = 10, dimension_values_retry_delay: int = 3)[source]¶
lazy_load() Iterator[Document]¶

A lazy loader for Documents.

load() List[Document][source]¶

Makes a call to Cube’s REST API metadata endpoint.

Returns

  • page_content=column_title + column_description

  • metadata
    • table_name

    • column_name

    • column_data_type

    • column_member_type

    • column_title

    • column_description

    • column_values

    • cube_data_obj_type

Return type

A list of documents with attributes

load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]¶

Load Documents and split into chunks. Chunks are returned as Documents.

Parameters

text_splitter – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.

Returns

List of Documents.

Examples using CubeSemanticLoader¶