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", + )