Fix/external api update (#9955)

This commit is contained in:
Jyong 2024-10-28 18:37:35 +08:00 committed by GitHub
parent adcd83f6a8
commit badf9baf9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,8 @@ from typing import Any, Optional, Union
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 @@ class ExternalDatasetService:
).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", "")