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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_indices_managed_dashscope-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_indices_managed_dashscope-0.4.1.tar.gz
Algorithm Hash digest
SHA256 059eb077d79d3849b235aee889773a5f5abadf837309501831bd5b972cc386af
MD5 b027fe4694f58f17970a6d20303a4062
BLAKE2b-256 8eba5f78e678d773e81d020ed0f90379b3657d4f2daa487d25218c22a1fcfc1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_indices_managed_dashscope-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a878ca27558ac188324beb7fc6b8adb7d5d87722e7eb36ee3c1def095046538
MD5 48d404f80ac3e846b77781ffc769a72f
BLAKE2b-256 e53e74b96a05aba829fbaa1c490a211e4535533797a31296d6c82f7d013e8aff

See more details on using hashes here.

Supported by

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