From 97e18dc33c55548c726af7342f5a7c3f4fa12f69 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Wed, 18 Jun 2025 15:09:37 +0330 Subject: [PATCH] feat: separate agent payload from hivemind payload! --- tasks/agent.py | 3 ++- tasks/schema.py | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tasks/schema.py diff --git a/tasks/agent.py b/tasks/agent.py index 4258a44..4257008 100644 --- a/tasks/agent.py +++ b/tasks/agent.py @@ -10,11 +10,12 @@ from tasks.redis_memory import RedisMemory from tasks.mongo_persistence import MongoPersistence from tc_temporal_backend.schema.hivemind import HivemindQueryPayload + from tasks.schema import AgentQueryPayload @activity.defn async def run_hivemind_agent_activity( - payload: HivemindQueryPayload, + payload: AgentQueryPayload, ) -> str | None: """ Activity that instantiates and runs the Crew.ai Flow (AgenticHivemindFlow). diff --git a/tasks/schema.py b/tasks/schema.py new file mode 100644 index 0000000..a864ed3 --- /dev/null +++ b/tasks/schema.py @@ -0,0 +1,19 @@ +from pydantic import BaseModel, Field + + +class AgentQueryPayload(BaseModel): + community_id: str = Field( + ..., description="the community id data to use for answering" + ) + query: str = Field(..., description="the user query to ask llm") + enable_answer_skipping: bool = Field( + False, + description=( + "skip answering questions with non-relevant retrieved information" + "having this, it could provide `None` for response and source_nodes" + ), + ) + chat_id: str = Field( + default="", + description="the chat id to use for answering", + )