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_custom-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 659e1144871226f7e13017200845e35b179a6c2179e5b99f87798646402f4333 |
|
MD5 | 17c40b0969ba79e81bc25e217b8c7eca |
|
BLAKE2b-256 | b21501505b88239d219f9c8532e51fc1f3fc87acc3b4c209f22db8cbf1c817be |
Close
Hashes for llama_index_indices_managed_dashscope_custom-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e7fa656a7a4c24d407a8ef6dd941ca595f99be06dee917b111cbd8fa0d02de5 |
|
MD5 | d59a1390cf8a38bc0fbaaa2594a3b28d |
|
BLAKE2b-256 | ab00bea254d0ea462f0ec515719f0d484d7286af210d75b5ace21565180d20c7 |