This topic provides best practices for the MiaoDu writing pipeline API to help you get started and develop your applications.
Prerequisites
- You have activated the service.
- To obtain the Workspace ID, see Obtain Workspace ID.
- Import the AiMiaoBi SDK and obtain the latest SDK version.
Procedure
Step 1: Upload a document to the document library
Call the UploadDoc API to upload a document to the MiaoDu document library. The following code provides an example:
Step 2: Get the uploaded document information
After uploading the document, call the GetDocInfo API to check if the document was uploaded successfully.
Step 3: Use assisted reading features (introduction, mind map, and Q&A)
You can use assisted reading features for a specified document. MiaoDu provides features such as document introduction, mind map, and document Q&A. The following code provides examples for these features.
- RunDocIntroduction - Document Introduction
- Generates an introduction for an article, video, or URL. The introduction includes a full-text summary, key points, and a chapter overview (segmentation, summary of each segment, and abstracts for each paragraph). It also supports multilingual input and output.
- If you only need a full-text summary of the article, use the RunDocSummary API. For more information, see RunDocSummary.
- Generates a three-level mind map for an article or book. It supports multiple languages. You can control the number of second-level nodes and the word count of leaf nodes.
- RunDocQa (Document Q&A/Multimodal file Q&A)
- This feature answers natural language queries about specified documents and displays the source information for each answer. For articles, it provides a text answer and includes images if available. For multimodal files, the answer can include relevant images, video clips, or text.