Metadata-Version: 2.4
Name: llama-index-indices-managed-dashscope
Version: 0.4.0
Summary: llama-index indices managed-dashscope integration
Author-email: Ruixue Ding <ada.drx@alibaba-inc.com>
License-Expression: MIT
License-File: LICENSE
Requires-Python: <4.0,>=3.9
Requires-Dist: llama-index-core<0.14,>=0.13.0
Requires-Dist: llama-index-embeddings-dashscope<0.5,>=0.4.0
Requires-Dist: llama-index-node-parser-dashscope<0.6,>=0.5.0
Requires-Dist: llama-index-readers-dashscope<0.5,>=0.4.0
Description-Content-Type: text/markdown

# LlamaIndex Indices Integration: Managed-Dashscope

## Installation

```shell
pip install llama-index-indices-managed-dashscope
```

## Usage

```python
import os
from llama_index.core.schema import QueryBundle
from llama_index.readers.dashscope.base import DashScopeParse
from llama_index.readers.dashscope.utils import ResultType

os.environ["DASHSCOPE_API_KEY"] = "your_api_key_here"
os.environ["DASHSCOPE_WORKSPACE_ID"] = "your_workspace_here"

# init retriever from scratch
from llama_index.indices.managed.dashscope.retriever import (
    DashScopeCloudRetriever,
)


file_list = [
    # your files (accept doc, docx, pdf)
]

parse = DashScopeParse(result_type=ResultType.DASHCOPE_DOCMIND)
documents = parse.load_data(file_path=file_list)

# create a new index
index = DashScopeCloudIndex.from_documents(
    documents,
    "my_first_index",
    verbose=True,
)

# # connect to an existing index
# index = DashScopeCloudIndex("my_first_index")

retriever = index.as_retriever()
nodes = retriever.retrieve("test query")
print(nodes)
```
