Skip to main content

UpdateLibrary

Updates a document library. You can update the library name, description, and index configuration.

Operation description

Prerequisites
  • Alibaba Cloud Model Studio and Tongyi Dianjin are activated.
  • You have obtained the workspaceId: Obtain the workspace identifier.

Debugging

You can run this API directly in OpenAPI Explorer, which saves you the trouble of calculating signatures. After the operation succeeds, OpenAPI Explorer can automatically generate SDK code examples. Try it now

RAM authorization

The following table describes the authorization information for this API. You can use the Action element in RAM permission policy statements to grant RAM users or RAM roles the permission to call this API. Details are as follows:
  • Action: refers to the specific permission point.
  • Access level: refers to the access level of each operation. Valid values: Write, Read, or List.
  • Resource type: refers to the resource types that support authorization in the operation. Details are as follows:
    • Required resource types are marked with a leading asterisk (*).
    • For operations that do not support resource-level authorization, All Resources is used.
  • Condition key: refers to the condition keys defined by the cloud service itself.
  • Dependent action: refers to other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions before the operation can succeed.
ActionAccess levelResource typeCondition keyDependent action
dianjin:UpdateLibraryupdate
*All Resources
*
    None
None

Request syntax

PUT /{workspaceId}/api/library/update HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample
workspaceIdstringYes

Workspace ID

llm-xxxxx
bodyobjectNo

Request body parameters.

descriptionstringNo

Document library description

Document library description
indexSettingobjectNo

Document library index configuration

chunkStrategyobjectNo

Chunking strategy

docTreeSplitbooleanNo

Layout-based chunking

true
docTreeSplitSizeintegerNo

Layout-based chunking size

160
enhanceGraphbooleanNo

Whether to enhance images

true
enhanceTablebooleanNo

Whether to enhance tables

true
overlapintegerNo

Chunk overlap length

20
sentenceSplitbooleanNo

Whether to split by sentence: default is true

true
sentenceSplitSizeintegerNo

Average length for sentence-based splitting

160
sizeintegerNo

Fixed-length chunk size

256
splitbooleanNo

Whether to perform chunking

true
modelConfigobjectNo

Model configuration

temperaturedoubleNo

Temperature

0.8
topPdoubleNo

topP

0.8
promptRoleStylestringNo

Prompt role style

You are a document analysis expert, skilled at finding key points from given knowledge and answering questions clearly, like a teacher lecturing to students. Your answers are logical, and when facing complex problems, you are good at thinking step by step.
queryEnhancerobjectNo

Query enhancement

enableFollowUpbooleanNo

Multi-turn enhancement

true
enableMultiQuerybooleanNo

Whether to use large language model (LLM) knowledge to decompose questions

true
enableOpenQabooleanNo

Whether to use large language model (LLM) knowledge to answer questions

true
enableQueryRewritebooleanNo

Whether to rewrite questions based on domain knowledge

true
enableSessionbooleanNo

Record session

true
localKnowledgeIdstringNo

Document library ID used for knowledge rewriting

sjdhgfc
withDocumentReferencebooleanNo

Whether to include document references

true
recallStrategyobjectNo

Retrieval strategy

documentRankTypestringNo

Merge and sort strategy

Valid values:
  • model: Sort using BGE.
  • llm: Sort using LLMs.
model
limitintegerNo

Number of results after two-way merge and summarization

10
textIndexSettingobjectNo

Text index settings

categorystringNo

Text index type

ElasticSearch
enablebooleanNo

Whether text indexing is enabled

true
indexAnalyzerstringNo

Index analyzer for the text index: (Standard, IkMaxWord, IkSmart)

Standard
rankThresholddoubleNo

Text index ranking threshold

0.5
searchAnalyzerstringNo

Search analyzer for the text index: (Standard, IkMaxWord, IkSmart)

Standard
topKintegerNo

Number of final summarized results for the text index

50
vectorIndexSettingobjectNo

Vector index settings

categorystringNo

Vector index source: ADB is recommended

ADB
embeddingTypestringNo

Text embedding model for the vector index

DashScope
enablebooleanNo

Whether to enable

true
rankThresholddoubleNo

Vector index ranking threshold

0.5
topKintegerNo

Number of final summarized results for the vector index

10
libraryIdstringYes

Document library ID

dsfbashdbb
libraryNamestringNo

Document library name

Test document library

Response parameters

NameTypeDescriptionExample
object

ResultCode

costlong

Time consumed

null
datastring

Response data

null
dataTypestring

Data type

null
errCodestring

Error code

0
messagestring

Error message

ok
requestIdstring

Request ID

eb2b6139-ddf1-91a0-a47f-df7617ae9032
successboolean

Whether the operation succeeded

true
timestring

Timestamp

2024-04-24 11:54:34

Examples

Success response JSON format
{
  "cost": 0,
  "data": null,
  "dataType": null,
  "errCode": 0,
  "message": "ok",
  "requestId": "eb2b6139-ddf1-91a0-a47f-df7617ae9032",
  "success": true,
  "time": "2024-04-24 11:54:34"
}

Error codes

Visit the Error Center to view more error codes.