llama-index indices managed-dashscope integration
Project description
LlamaIndex Indices Integration: Managed-Dashscope
Installation
pip install llama-index-indices-managed-dashscope
Usage
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)
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_indices_managed_dashscope-0.3.0.tar.gz
.
File metadata
- Download URL: llama_index_indices_managed_dashscope-0.3.0.tar.gz
- Upload date:
- Size: 7.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 | 6ff104e4342ca2b89bdfda46c7ce0b3157638f09442535e2760ff9baced9182a |
|
MD5 | 66a3f0ddb6f58516091c6b69b740a1fd |
|
BLAKE2b-256 | 641873bec587d6b06c0fbbf762ac319f39c43810307b4e3cf3a7ae30a37f2d9c |
File details
Details for the file llama_index_indices_managed_dashscope-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_indices_managed_dashscope-0.3.0-py3-none-any.whl
- Upload date:
- Size: 10.1 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 | c88c72030b2274db0f055a999b554a1dbdcf8bb770e28b66f8da04f0bc48154d |
|
MD5 | b01866f5e51a6f0b4f749096b3c9a363 |
|
BLAKE2b-256 | 1b6dc08f730e548adb1e0f1a7040904d05b561e80a6dc7895d6fc4b81d602d85 |