Metadata-Version: 2.1
Name: llama-index-embeddings-alibabacloud-aisearch
Version: 0.2.0
Summary: llama-index embeddings alibabacloud_aisearch integration
License: MIT
Author: llama-index
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: alibabacloud-searchplat20240529 (>=1.1.0,<2.0.0)
Requires-Dist: llama-index-core (>=0.12.0,<0.13.0)
Description-Content-Type: text/markdown

# LlamaIndex Embeddings Integration: Alibabacloud_Aisearch

## Installation

```
pip install llama-index-embeddings-alibabacloud-aisearch
```

## Usage

For further details, please visit [text-embedding-api-details](`https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-embedding-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.embeddings.alibabacloud_aisearch import (
    AlibabaCloudAISearchEmbedding,
)

embed_model = AlibabaCloudAISearchEmbedding()
embedding = embed_model.get_query_embedding("llama-index")
print(len(embedding))

# embeddings = embed_model.get_text_embedding_batch(
#     ["科学技术是第一生产力", "opensearch产品文档"], show_progress=True
# )
```

