llama-index indices managed-dashscope integration
Project description
LlamaIndex Indices Integration: 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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d7fb433171e63ec96ec471bd69ebf768e3543d7825707739d4334467bfc951b |
|
MD5 | bc72dcf76fbdb2c71f8efa3332d1e9ae |
|
BLAKE2b-256 | 9af3175474d3c6fd50ef443dd0da9d6e99a2d632c17ad91b64972aca1979658f |
Close
Hashes for llama_index_indices_managed_dashscope_custom-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2a7f5fc68e67fbd6fc40348215b369b5281c5847ebebc63424794f2d2002c8e |
|
MD5 | f9a35b22e56b1f95a91204ba9d106472 |
|
BLAKE2b-256 | 4c6f8f370caa64ee4d669bfd62a811b48449bff05da3e0bb17c9dd3ba77efef1 |