From 38f1762565beb9af736b52cab900fd2b35847f59 Mon Sep 17 00:00:00 2001 From: Jyong <76649700+JohnJyong@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:37:35 +0800 Subject: [PATCH] Fix/external api update (#9955) --- api/services/external_knowledge_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/services/external_knowledge_service.py b/api/services/external_knowledge_service.py index 4efdf8d7dbe75..094772d674671 100644 --- a/api/services/external_knowledge_service.py +++ b/api/services/external_knowledge_service.py @@ -6,6 +6,8 @@ import httpx import validators +from constants import HIDDEN_VALUE + # from tasks.external_document_indexing_task import external_document_indexing_task from core.helper import ssrf_proxy from extensions.ext_database import db @@ -92,6 +94,8 @@ def update_external_knowledge_api(tenant_id, user_id, external_knowledge_api_id, ).first() if external_knowledge_api is None: raise ValueError("api template not found") + if args.get("settings") and args.get("settings").get("api_key") == HIDDEN_VALUE: + args.get("settings")["api_key"] = external_knowledge_api.settings_dict.get("api_key") external_knowledge_api.name = args.get("name") external_knowledge_api.description = args.get("description", "")