From 7d9c867ded1666c1519643bb68ba754dd7491265 Mon Sep 17 00:00:00 2001 From: Takehiro Suzuki Date: Thu, 19 Dec 2024 09:47:15 +0900 Subject: [PATCH] fix: bedrock knowledge base validation logic (#655) --- backend/app/repositories/models/custom_bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/app/repositories/models/custom_bot.py b/backend/app/repositories/models/custom_bot.py index 002f62f2..a0892c4d 100644 --- a/backend/app/repositories/models/custom_bot.py +++ b/backend/app/repositories/models/custom_bot.py @@ -101,16 +101,16 @@ def has_knowledge(self) -> bool: or len(self.knowledge.sitemap_urls) > 0 or len(self.knowledge.filenames) > 0 or len(self.knowledge.s3_urls) > 0 - or self.bedrock_knowledge_base is not None + or self.has_bedrock_knowledge_base() ) def is_agent_enabled(self) -> bool: return len(self.agent.tools) > 0 def has_bedrock_knowledge_base(self) -> bool: - return ( - self.bedrock_knowledge_base is not None - and self.bedrock_knowledge_base.knowledge_base_id is not None + return self.bedrock_knowledge_base is not None and ( + self.bedrock_knowledge_base.knowledge_base_id is not None + or self.bedrock_knowledge_base.exist_knowledge_base_id is not None )