Skip to main content

GetLibrary

Retrieves the detailed configuration of a document library, including its name, description, and index settings.

Operation description

Prerequisites
  • Activate the Alibaba Cloud Model Studio and Tongyi Dianjin services.
  • Obtain the workspaceId: obtain a workspace identifier.

Try it now

You can call this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful call, OpenAPI Explorer can automatically generate SDK code examples. Debug

RAM authorization

The following table describes the authorization information of this API. You can use the Action element in a RAM policy statement to grant RAM users or RAM roles the permission to call this API. For more information, see:
  • Operation: the specific permission point.
  • Access level: the access level of each operation. Valid values: Write, Read, and List.
  • Resource type: the resource types that you can authorize for the operation. For more information, see:
    • Resource types marked with an asterisk (*) are required.
    • If an operation does not support resource-level authorization, 全部资源 is used.
  • Condition keyword: the condition keys that are defined by the cloud service.
  • Related operation: other permissions that are required to successfully perform the operation. The caller must have the permissions of the related operations to succeed.
OperationAccess levelResource typeCondition keywordRelated operation
dianjin:GetLibraryget
*All resources
*
    N/A
N/A

Request syntax

GET /{workspaceId}/api/library/get HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
workspaceIdstringNo

Path parameter. The workspace ID.

llm-xxxxx
libraryIdstringYes

The document library ID.

cjshcxxxx

Response elements

ElementTypeDescriptionExample
object

The response data.

costlong

The response time.

null
dataobject

The response data.

descriptionstring

The document library description.

Document library description
documentCountlong

The number of documents.

10
gmtCreatestring

The creation time.

2024-01-01 00:00:00
gmtModifiedstring

The last modification time.

2024-01-01 00:00:00
idstring

The document library ID.

19386728376
indexSettingobject

The document library index settings.

chunkStrategyobject

The chunking strategy.

docTreeSplitboolean

Layout-based splitting.

true
docTreeSplitSizeinteger

The layout-based splitting size.

160
enhanceGraphboolean

Whether to enhance images.

true
enhanceTableboolean

Whether to enhance tables.

true
overlapinteger

The chunk overlap length.

40
sentenceSplitboolean

Split by sentence.

true
sentenceSplitSizeinteger

The sentence-based splitting size.

160
sizeinteger

The chunk size.

256
splitboolean

Whether to enable chunking.

true
modelConfigobject

The model configuration.

temperaturedouble

The temperature.

0.8
topPdouble

topP

0.8
promptRoleStylestring

The prompt role style.

You are an information processing expert.
queryEnhancerobject

Query enhancement.

enableFollowUpboolean

Multi-turn enhancement.

true
enableMultiQueryboolean

Whether to use LLM knowledge to decompose questions.

true
enableOpenQaboolean

Whether to use LLM knowledge to answer questions.

true
enableQueryRewriteboolean

Whether to rewrite questions based on domain knowledge.

true
enableSessionboolean

Whether to record the session.

true
localKnowledgeIdstring

The document library ID used for knowledge rewriting.

2836482634
withDocumentReferenceboolean

Whether to include document references.

true
recallStrategyobject

The recall strategy.

documentRankTypestring

The merge and sort policy.

model
limitinteger

The number of results returned after two recall paths are merged and summarized.

10
textIndexSettingobject

The text index settings.

categorystring

The text index type.

ElasticSearch
enableboolean

Whether to enable text indexing.

true
indexAnalyzerstring

The index analyzer of the text index: (Standard, IkMaxWord, IkSmart)

IkMaxWord
rankThresholddouble

The ranking threshold for text indexing.

null
searchAnalyzerstring

The search analyzer of the text index: (Standard, IkMaxWord, IkSmart)

Standard
topKinteger

The number of final summary results of text indexing.

10
vectorIndexSettingobject

The vector index settings.

categorystring

The vector index source: we recommend that you set it to ADB.

ADB
embeddingTypestring

The text embedding model for the vector index.

DashScope
enableboolean

Whether to enable it.

true
rankThresholddouble

The ranking threshold for vector indexing.

null
topKinteger

The number of final summary results of vector indexing.

10
libraryNamestring

The document library name.

Test document library
dataTypestring

The data type.

null
errCodestring

The error code.

0
messagestring

The error type.

ok
requestIdstring

The request ID.

44BD277A-87F9-5310-8D63-3E6645F1DA85
successboolean

Whether the request is successful.

true
timestring

The timestamp.

2024-01-01 00:00:00

Examples

Success response JSON format
{
  "cost": 0,
  "data": {
    "description": "文档库的描述",
    "documentCount": 10,
    "gmtCreate": "2024-01-01 00:00:00",
    "gmtModified": "2024-01-01 00:00:00\n",
    "id": 19386728376,
    "indexSetting": {
      "chunkStrategy": {
        "docTreeSplit": true,
        "docTreeSplitSize": 160,
        "enhanceGraph": true,
        "enhanceTable": true,
        "overlap": 40,
        "sentenceSplit": true,
        "sentenceSplitSize": 160,
        "size": 256,
        "split": true
      },
      "modelConfig": {
        "temperature": 0.8,
        "topP": 0.8
      },
      "promptRoleStyle": "你是一个信息处理专家。",
      "queryEnhancer": {
        "enableFollowUp": true,
        "enableMultiQuery": true,
        "enableOpenQa": true,
        "enableQueryRewrite": true,
        "enableSession": true,
        "localKnowledgeId": 2836482634,
        "withDocumentReference": true
      },
      "recallStrategy": {
        "documentRankType": "model",
        "limit": 10
      },
      "textIndexSetting": {
        "category": "ElasticSearch",
        "enable": true,
        "indexAnalyzer": "IkMaxWord",
        "rankThreshold": 0,
        "searchAnalyzer": "Standard",
        "topK": 10
      },
      "vectorIndexSetting": {
        "category": "ADB",
        "embeddingType": "DashScope",
        "enable": true,
        "rankThreshold": 0,
        "topK": 10
      }
    },
    "libraryName": "测试文档库"
  },
  "dataType": null,
  "errCode": 0,
  "message": "ok",
  "requestId": "44BD277A-87F9-5310-8D63-3E6645F1DA85",
  "success": true,
  "time": "2024-01-01 00:00:00"
}

Error codes

Visit the Error Center to view more error codes.