Skip to content

Commit

Permalink
fix: bedrock knowledge base validation logic (#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
statefb authored Dec 19, 2024
1 parent 087e263 commit 7d9c867
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/app/repositories/models/custom_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)


Expand Down

0 comments on commit 7d9c867

Please sign in to comment.