From a112cc3db270e56e2d7a10916c8841cc077f2333 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Thu, 18 Jan 2024 13:47:37 +0330 Subject: [PATCH 1/2] fix: interaction object creation! --- requirements.txt | 2 +- worker.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index ee5546f..a9a9f5f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,4 +19,4 @@ python-dotenv==1.0.0 tc-hivemind-backend==1.1.0 celery>=5.3.6, <6.0.0 guidance -tc-messageBroker>=1.6.4, <2.0.0 \ No newline at end of file +tc-messageBroker>=1.6.5, <2.0.0 \ No newline at end of file diff --git a/worker.py b/worker.py index a7bba2d..65cad25 100644 --- a/worker.py +++ b/worker.py @@ -1,4 +1,5 @@ import logging +import json from typing import Any from celery_app.tasks import ask_question_auto_search @@ -18,7 +19,8 @@ def query_llm(recieved_data: dict[str, Any]): """ logging.info(f"RECIEVED DATA: {recieved_data}") logging.info("CONVERTING RECIEVED DATA INTO ChatInputCommandInteraction!") - recieved_input = ChatInputCommandInteraction.from_dict(recieved_data) + interaction = json.loads(recieved_data["content"]["interaction"]) + recieved_input = ChatInputCommandInteraction.from_dict(interaction) # For now we just have one user input if len(recieved_input.options["_hoistedOptions"]) > 1: logging.warning( From 424d28134a909d6853de099ef9a9b3f6108fbf1f Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Thu, 18 Jan 2024 13:52:09 +0330 Subject: [PATCH 2/2] fix: isort linter issue! --- worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker.py b/worker.py index 65cad25..328a423 100644 --- a/worker.py +++ b/worker.py @@ -1,5 +1,5 @@ -import logging import json +import logging from typing import Any from celery_app.tasks import ask_question_auto_search