Skip to content

Commit

Permalink
Merge pull request #13 from TogetherCrew/fix/hivemind-received-intera…
Browse files Browse the repository at this point in the history
…ction

fix: interaction object creation!
  • Loading branch information
cyri113 authored Jan 18, 2024
2 parents ef28333 + 424d281 commit d49023b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
tc-messageBroker>=1.6.5, <2.0.0
4 changes: 3 additions & 1 deletion worker.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import logging
from typing import Any

Expand All @@ -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(
Expand Down

0 comments on commit d49023b

Please sign in to comment.