From 72fe081a2820f0fd24a2cfd4c70408b889b2d85f Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 3 Nov 2025 15:38:42 +0800 Subject: [PATCH] Add api_key mapping in VectorStoreConfig conversion - Introduced mapping for the api_key field in the toVectorStoreConfig method to enhance configuration handling. - This addition allows for the inclusion of the api_key in the extraParams, improving the flexibility of the configuration process. --- kb/types/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kb/types/config.go b/kb/types/config.go index 9a2e3dfe..aa50a81c 100644 --- a/kb/types/config.go +++ b/kb/types/config.go @@ -139,6 +139,11 @@ func (c *Config) toVectorStoreConfig() (types.VectorStoreConfig, error) { extraParams["port"] = port } + // Map api_key field + if apiKey, exists := configCopy["api_key"]; exists { + extraParams["api_key"] = apiKey + } + // Convert config to types.VectorStoreConfig via JSON jsonData, err := json.Marshal(configCopy) if err != nil {