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 (str) – 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 (str) – 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 (bool) – Whether to load dimension values for every string dimension or not.

  • dimension_values_limit (int) – Maximum number of dimension values to load.

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

  • dimension_values_retry_delay (int) – Delay between retries to load dimension values.

Methods

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

alazy_load()

A lazy loader for Documents.

aload()

Load data into Document objects.

lazy_load()

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

load()

Load data into Document objects.

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]#
Parameters:
  • cube_api_url (str) –

  • cube_api_token (str) –

  • load_dimension_values (bool) –

  • dimension_values_limit (int) –

  • dimension_values_max_retries (int) –

  • dimension_values_retry_delay (int) –

async alazy_load() → AsyncIterator[Document]#

A lazy loader for Documents.

Return type:

AsyncIterator[Document]

async aload() → List[Document]#

Load data into Document objects.

Return type:

List[Document]

lazy_load() → Iterator[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() → List[Document]#

Load data into Document objects.

Return type:

List[Document]

load_and_split(text_splitter: TextSplitter | None = None) → List[Document]#

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

Do not override this method. It should be considered to be deprecated!

Parameters:

text_splitter (Optional[TextSplitter]) – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.

Returns:

List of Documents.

Return type:

List[Document]

Examples using CubeSemanticLoader