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.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_node_parser_alibabacloud_aisearch-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4f54750cf0e9e7180124732b5ff8f3efbe759a41d0dd3e1de757426aecbdb418
MD5 ff7e6842b12f8824be5217db2ff809ec
BLAKE2b-256 bd8f18d14e132ba74da69a88397618d412a444b511cd7a642c8e9603bde6190b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_node_parser_alibabacloud_aisearch-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6d55044fa9cdc5a8d03092aa0bcf058953519c757988193abe406e83bf49b8d
MD5 8857036bd828dde6f236f15c59f4f6bf
BLAKE2b-256 8113d18a9079fd8edff45ebc1a93df07071109aaed07e7cfaf9e82c7a6cca9e6

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