Integrate the retrieval-augmented generation (RAG) service from Alibaba Cloud Model Studio with LlamaIndex.
Get started
Prerequisites
- You have obtained an API key and configured it as an environment variable. This configuration method is scheduled for deprecation and will be incorporated into the main API key configuration process.
- You have enabled the knowledge base service in the Model Studio console. When you open the knowledge base page for the first time, follow the on-screen prompts to enable the service.
- If you want to specify a workspace, obtain its ID.
- In your terminal, execute the following command to install the DashScopeCloudIndex package. This package requires a Python version from 3.9 to 3.12.
File parsing
Prepare your knowledge base files:
- You can use one or more individual files.
- You can place all files in a single folder.
The DashScopeParse parser supports online parsing of .doc, .docx, and .pdf files. Each file must be smaller than 100 MB and have fewer than 1,000 pages.
Create a knowledge base
You can use the documents object to create a knowledge base.