---
title: "更新知识库配置"
method: PUT
path: "/initialization/config/{kbId}"
tags: ["初始化"]
---

# 更新知识库配置

`PUT /initialization/config/{kbId}`

根据知识库ID更新模型和分块配置

## Path parameters

- `kbId` string, required

## Request body

- InternalHandlerKBModelConfigRequest
  - `asr_config` GithubComTencentWeKnoraInternalTypesASRConfig
    - `enabled` boolean
    - `language` string — optional: language hint for transcription
    - `model_id` string
  - `documentSplitting` object — 文档分块配置
    - `childChunkSize` integer
    - `chunkOverlap` integer
    - `chunkSize` integer
    - `enableParentChild` boolean
    - `languages` string[]
    - `parentChunkSize` integer
    - `parserEngineRules` GithubComTencentWeKnoraInternalTypesParserEngineRule[]
      - `engine` string
      - `file_types` string[]
      - `xlsx_first_row_as_header` boolean — XLSXFirstRowAsHeader restores row-1 column context for flat XLSX tables. nil preserves the parser default; an explicit false disables the mode.
    - `separators` string[]
    - `strategy` string — Strategy / TokenLimit / Languages use pointer types so the handler can distinguish "field absent in payload" (no change) from "field present with empty/zero value" (clear / disable). Without that distinction, users could set strategy="auto" once but never reset it back to legacy / unset.
    - `tableMetadataInstructions` string
    - `tokenLimit` integer
  - `embeddingModelId` string — optional when RAG indexing is disabled
  - `llmModelId` string, required
  - `multimodal` object — 多模态配置（仅模型相关；存储引擎在 storageProvider 中配置）
    - `enabled` boolean
  - `nodeExtract` object — 知识图谱配置
    - `customInstructions` string
    - `enabled` boolean
    - `nodes` GithubComTencentWeKnoraInternalTypesGraphNode[]
      - `attributes` string[]
      - `chunks` string[]
      - `name` string
    - `relations` GithubComTencentWeKnoraInternalTypesGraphRelation[]
      - `node1` string
      - `node2` string
      - `type` string
    - `tags` string[]
    - `text` string
  - `questionGeneration` object — 问题生成配置
    - `customInstructions` string
    - `enabled` boolean
    - `questionCount` integer
  - `storageBackendId` string
  - `storageProvider` string — 存储引擎选择（"local" | "minio" | "cos"），影响文档上传与文档内图片存储，参数从全局设置读取
  - `vlm_config` GithubComTencentWeKnoraInternalTypesVLMConfig
    - `api_key` string — API Key
    - `base_url` string — Base URL
    - `custom_instructions` string — CustomInstructions adds KB-specific image interpretation guidance without replacing the system-owned OCR and Markdown output contract.
    - `description_language` string — DescriptionLanguage controls the language used for generated image captions. Empty means follow the document/request language.
    - `enabled` boolean
    - `interface_type` string — Interface Type: "ollama" or "openai"
    - `model_id` string
    - `model_name` string — 兼容老版本 Model Name

## Response `200`

更新成功

- object

## Other responses

- `400` — 请求参数错误
- `404` — 知识库不存在

---

[API](https://skmtc.net/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.net/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/versions/d6921ae22ce0/schema)
