llama-index-node-parser-alibabacloud-aisearch


Namellama-index-node-parser-alibabacloud-aisearch JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
Summaryllama-index node_parser alibabacloud_aisearch integration
upload_time2024-09-11 04:15:13
maintainerNone
docs_urlNone
authorllama-index
requires_python<4.0,>=3.8.1
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://help.aliyun.com/zh/open-search/search-platform/developer-reference/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`.

```python
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)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-node-parser-alibabacloud-aisearch",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": null,
    "author": "llama-index",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/0a/22/2483aadc6898207ce4f75651cd20d471bdeb1310c78e36f3aad67858c4e1/llama_index_node_parser_alibabacloud_aisearch-0.1.0.tar.gz",
    "platform": null,
    "description": "# LlamaIndex Node_Parser Integration: Alibabacloud_Aisearch\n\n## Installation\n\n```\npip install llama-index-node-parser-alibabacloud-aisearch\n```\n\n## Optional Installation\n\nFor automatic parsing of image slices, you can optionally install `llama-index-readers-alibabacloud-aisearch`.\n\n```\npip install llama-index-readers-alibabacloud-aisearch\n```\n\n## Usage\n\nFor further details, please visit [document-split-api-details](https://help.aliyun.com/zh/open-search/search-platform/developer-reference/document-split-api-details).\n\nYou can specify the `endpoint` and `aisearch_api_key` in the constructor, or set the environment variables `AISEARCH_ENDPOINT` and `AISEARCH_API_KEY`.\n\n```python\nfrom llama_index.node_parser.alibabacloud_aisearch import (\n    AlibabaCloudAISearchNodeParser,\n)\nfrom llama_index.core import Document\n\ntry:\n    from llama_index.readers.alibabacloud_aisearch import (\n        AlibabaCloudAISearchImageReader,\n    )\n\n    image_reader = AlibabaCloudAISearchImageReader(\n        service_id=\"ops-image-analyze-vlm-001\"\n    )\nexcept ImportError:\n    image_reader = None\nnode_parser = AlibabaCloudAISearchNodeParser(\n    chunk_size=1024, image_reader=image_reader\n)\nnodes = node_parser(\n    [\n        Document(text=\"content1\", mimetype=\"text/markdown\"),\n        Document(\n            text=\"content2 ![IMAGE](https://img.alicdn.com/imgextra/i1/O1CN01WksnF41hlhBFsXDNB_!!6000000004318-0-tps-1000-1400.jpg)\",\n            mimetype=\"text/markdown\",\n        ),\n    ],\n    show_progress=True,\n)\nfor i, node in enumerate(nodes):\n    print(f\"[SPLIT#{i}]:\\n{node.get_content()}\")\n    print(\"-\" * 80)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index node_parser alibabacloud_aisearch integration",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2a6e95f9cc1b5f63f697188fe8008f3e7a9d774c1fb6bb675b7f6eee7f329b0a",
                "md5": "6aa31f907018056a2550c73e031eebf4",
                "sha256": "1e8af6a4b623af51045d58aee54ae0c15e13ad8e1f76c92697261d6516ab48ed"
            },
            "downloads": -1,
            "filename": "llama_index_node_parser_alibabacloud_aisearch-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6aa31f907018056a2550c73e031eebf4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 4472,
            "upload_time": "2024-09-11T04:15:12",
            "upload_time_iso_8601": "2024-09-11T04:15:12.807934Z",
            "url": "https://files.pythonhosted.org/packages/2a/6e/95f9cc1b5f63f697188fe8008f3e7a9d774c1fb6bb675b7f6eee7f329b0a/llama_index_node_parser_alibabacloud_aisearch-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0a222483aadc6898207ce4f75651cd20d471bdeb1310c78e36f3aad67858c4e1",
                "md5": "d2e74118bc64f1efb07e968acc0d20da",
                "sha256": "985528f73bd24f1562c67ae08908a597b512638d9edfcbbbe4c08e63650d844f"
            },
            "downloads": -1,
            "filename": "llama_index_node_parser_alibabacloud_aisearch-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d2e74118bc64f1efb07e968acc0d20da",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 3865,
            "upload_time": "2024-09-11T04:15:13",
            "upload_time_iso_8601": "2024-09-11T04:15:13.944346Z",
            "url": "https://files.pythonhosted.org/packages/0a/22/2483aadc6898207ce4f75651cd20d471bdeb1310c78e36f3aad67858c4e1/llama_index_node_parser_alibabacloud_aisearch-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-11 04:15:13",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-node-parser-alibabacloud-aisearch"
}
        
Elapsed time: 0.41221s