Skip to main content

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


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.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_indices_managed_dashscope-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2e21e002422a3ebccdbcb59e99298216bb4af8ba4e3f05be7d4155e9961c96b0
MD5 c23fde648a7d5d8e67108733bdfa0e9d
BLAKE2b-256 5e94fc252556968a314b8963a3e3a1b530ddb2c6b86e16ce9166b2dc8d47d1b6

See more details on using hashes here.

File details

Details for the file llama_index_indices_managed_dashscope-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_indices_managed_dashscope-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 171a71165c695bc542027258e9742e7e9df653b2c142e7e9c3cf655fc9c63d22
MD5 364f637d5fbb4bf45739b93ad442d045
BLAKE2b-256 6cbddf95f5bea829bae19a7ae9cc33f2ae3c4f7613f7df3d8c7b7fe1c7504df2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page