Skip to main content

llama-index readers alibabacloud_aisearch integration

Project description

LlamaIndex Readers Integration: Alibabacloud_Aisearch

Installation

pip install llama-index-readers-alibabacloud-aisearch

Usage

Supported file types: ppt/pptx, doc/docx, pdf, images and so on. For further details, please visit:

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

Read local files

from llama_index.readers.alibabacloud_aisearch import (
    AlibabaCloudAISearchDocumentReader,
    AlibabaCloudAISearchImageReader,
)
from llama_index.core import SimpleDirectoryReader

document_reader = AlibabaCloudAISearchDocumentReader()
image_reader = AlibabaCloudAISearchImageReader()

file_extractor = {}
for suffix in (".pdf", ".docx", ".doc", ".ppt", ".pptx"):
    file_extractor[suffix] = document_reader
for suffix in (".jpg", ".jpeg", ".png", ".bmp", ".tiff"):
    file_extractor[suffix] = image_reader

documents = SimpleDirectoryReader(
    "./data", file_extractor=file_extractor
).load_data(show_progress=True)
print(documents)

Read remote files

from llama_index.readers.alibabacloud_aisearch import (
    AlibabaCloudAISearchImageReader,
)

image_reader = AlibabaCloudAISearchImageReader(
    service_id="ops-image-analyze-ocr-001"
)
image_urls = [
    "https://img.alicdn.com/imgextra/i1/O1CN01WksnF41hlhBFsXDNB_!!6000000004318-0-tps-1000-1400.jpg",
]

# The file_type is automatically determined based on the file extension.
# If it cannot be identified, manual specification of the file_type is required.
documents = image_reader.load_data(file_path=image_urls, file_type="jpg")
print(documents)

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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_readers_alibabacloud_aisearch-0.3.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_alibabacloud_aisearch-0.3.1.tar.gz
Algorithm Hash digest
SHA256 77ad0363548e1507a6f00a0a5526016024833669e37016ed34be9bb3599d730b
MD5 fe92251afe0955f27882d8e2addd007a
BLAKE2b-256 311fc2b681616903b12cab33eef1932cba36914e83846c4c355d670c05fd71dd

See more details on using hashes here.

File details

Details for the file llama_index_readers_alibabacloud_aisearch-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_alibabacloud_aisearch-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc227cc7f7fefc98d7fdfa49ec6f9d2312e2998efac9c8e11afade2431bd72e8
MD5 dd8bdc147c70fbd282f3e05c4f23f975
BLAKE2b-256 28df735d27e6a33f704670214c55885da27c9ae80039961a4789cabdcf6ae65c

See more details on using hashes here.

Supported by

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