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

File metadata

File hashes

Hashes for llama_index_indices_managed_dashscope-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6ff104e4342ca2b89bdfda46c7ce0b3157638f09442535e2760ff9baced9182a
MD5 66a3f0ddb6f58516091c6b69b740a1fd
BLAKE2b-256 641873bec587d6b06c0fbbf762ac319f39c43810307b4e3cf3a7ae30a37f2d9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_indices_managed_dashscope-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c88c72030b2274db0f055a999b554a1dbdcf8bb770e28b66f8da04f0bc48154d
MD5 b01866f5e51a6f0b4f749096b3c9a363
BLAKE2b-256 1b6dc08f730e548adb1e0f1a7040904d05b561e80a6dc7895d6fc4b81d602d85

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