Skip to content

Commit

Permalink
Fix/external api update (langgenius#9955)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnJyong authored and JunXu01 committed Nov 9, 2024
1 parent ddc5b02 commit 38f1762
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/services/external_knowledge_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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", "")
Expand Down

0 comments on commit 38f1762

Please sign in to comment.