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
Close
Hashes for llama_index_indices_managed_dashscope-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b0b03640ed73a43689383257c494b4ddd9ea307a70e1eb47ec185c99aac178a |
|
MD5 | 06bdc93256486bda28f7475edaffcc66 |
|
BLAKE2b-256 | e62687805d768be1cb54d6b81d54af3945490e67f12e1ce74c14e08de49df014 |
Close
Hashes for llama_index_indices_managed_dashscope-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96934ae05527c75985aba883d6cd9f3926bd202f9fb170aa74cfc00e4cec068d |
|
MD5 | 8b9fa571a5e1f6e578b9b22dae416ad8 |
|
BLAKE2b-256 | 045d8df92a2eab29c3a4d519ee025414836a5cb4f5cf70232b36d27087e34462 |