Skip to main content

llama-index node_parser alibabacloud_aisearch integration

Project description

LlamaIndex Node_Parser Integration: Alibabacloud_Aisearch

Installation

pip install llama-index-node-parser-alibabacloud-aisearch

Optional Installation

For automatic parsing of image slices, you can optionally install llama-index-readers-alibabacloud-aisearch.

pip install llama-index-readers-alibabacloud-aisearch

Usage

For further details, please visit document-split-api-details.

You can specify the endpoint and aisearch_api_key in the constructor, or set the environment variables AISEARCH_ENDPOINT and AISEARCH_API_KEY.

from llama_index.node_parser.alibabacloud_aisearch import (
    AlibabaCloudAISearchNodeParser,
)
from llama_index.core import Document

try:
    from llama_index.readers.alibabacloud_aisearch import (
        AlibabaCloudAISearchImageReader,
    )

    image_reader = AlibabaCloudAISearchImageReader(
        service_id="ops-image-analyze-vlm-001"
    )
except ImportError:
    image_reader = None
node_parser = AlibabaCloudAISearchNodeParser(
    chunk_size=1024, image_reader=image_reader
)
nodes = node_parser(
    [
        Document(text="content1", mimetype="text/markdown"),
        Document(
            text="content2 ![IMAGE](https://img.alicdn.com/imgextra/i1/O1CN01WksnF41hlhBFsXDNB_!!6000000004318-0-tps-1000-1400.jpg)",
            mimetype="text/markdown",
        ),
    ],
    show_progress=True,
)
for i, node in enumerate(nodes):
    print(f"[SPLIT#{i}]:\n{node.get_content()}")
    print("-" * 80)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file llama_index_node_parser_alibabacloud_aisearch-0.1.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_node_parser_alibabacloud_aisearch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 985528f73bd24f1562c67ae08908a597b512638d9edfcbbbe4c08e63650d844f
MD5 d2e74118bc64f1efb07e968acc0d20da
BLAKE2b-256 0a222483aadc6898207ce4f75651cd20d471bdeb1310c78e36f3aad67858c4e1

See more details on using hashes here.

File details

Details for the file llama_index_node_parser_alibabacloud_aisearch-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_node_parser_alibabacloud_aisearch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e8af6a4b623af51045d58aee54ae0c15e13ad8e1f76c92697261d6516ab48ed
MD5 6aa31f907018056a2550c73e031eebf4
BLAKE2b-256 2a6e95f9cc1b5f63f697188fe8008f3e7a9d774c1fb6bb675b7f6eee7f329b0a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page