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
Release history Release notifications | RSS feed
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
- Download URL: llama_index_node_parser_alibabacloud_aisearch-0.2.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f54750cf0e9e7180124732b5ff8f3efbe759a41d0dd3e1de757426aecbdb418 |
|
MD5 | ff7e6842b12f8824be5217db2ff809ec |
|
BLAKE2b-256 | bd8f18d14e132ba74da69a88397618d412a444b511cd7a642c8e9603bde6190b |
File details
Details for the file llama_index_node_parser_alibabacloud_aisearch-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_node_parser_alibabacloud_aisearch-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6d55044fa9cdc5a8d03092aa0bcf058953519c757988193abe406e83bf49b8d |
|
MD5 | 8857036bd828dde6f236f15c59f4f6bf |
|
BLAKE2b-256 | 8113d18a9079fd8edff45ebc1a93df07071109aaed07e7cfaf9e82c7a6cca9e6 |