From 1d06b6e50103419db7ab07416c937cf722bb3f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20H=C3=B6tter?= Date: Mon, 26 Feb 2024 00:31:05 +0100 Subject: [PATCH 1/2] tmp johannes graphbased retrieval --- cognition_objects/message.py | 3 +++ enums.py | 1 + models.py | 1 + 3 files changed, 5 insertions(+) diff --git a/cognition_objects/message.py b/cognition_objects/message.py index 5bde633f..bc44c10c 100644 --- a/cognition_objects/message.py +++ b/cognition_objects/message.py @@ -97,6 +97,7 @@ def update( message_id: str, answer: Optional[str] = None, facts: Optional[List[Dict[str, Any]]] = None, + relations: Optional[List[Dict[str, Any]]] = None, selection_widget: Optional[List[Dict[str, Any]]] = None, feedback_value: Optional[str] = None, feedback_category: Optional[str] = None, @@ -108,6 +109,8 @@ def update( message.answer = answer if facts is not None: message.facts = facts + if relations is not None: + message.relations = relations if selection_widget is not None: message.selection_widget = selection_widget if feedback_value is not None: diff --git a/enums.py b/enums.py index dd3e47af..11bc7ad3 100644 --- a/enums.py +++ b/enums.py @@ -587,6 +587,7 @@ class CognitionInterfaceType(Enum): class EmitType(Enum): ANSWER = "ANSWER" RETRIEVAL_RESULTS = "RETRIEVAL_RESULTS" + RETRIEVAL_RELATIONS = "RETRIEVAL_RELATIONS" FOLLOW_UPS = "FOLLOW_UPS" SELECTION = "SELECTION" QUERY_REPHRASING = "QUERY_REPHRASING" diff --git a/models.py b/models.py index 0744b744..b6665083 100644 --- a/models.py +++ b/models.py @@ -1151,6 +1151,7 @@ class CognitionMessage(Base): created_at = Column(DateTime, default=sql.func.now()) question = Column(String) facts = Column(ARRAY(JSON)) + relations = Column(ARRAY(JSON)) selection_widget = Column(ARRAY(JSON)) answer = Column(String) From f15253b11e3671008fd68b3e5690b627e694477e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20H=C3=B6tter?= Date: Mon, 26 Feb 2024 00:31:52 +0100 Subject: [PATCH 2/2] tmp johannes graphbased retrieval --- models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/models.py b/models.py index 0744b744..b6665083 100644 --- a/models.py +++ b/models.py @@ -1151,6 +1151,7 @@ class CognitionMessage(Base): created_at = Column(DateTime, default=sql.func.now()) question = Column(String) facts = Column(ARRAY(JSON)) + relations = Column(ARRAY(JSON)) selection_widget = Column(ARRAY(JSON)) answer = Column(String)