Feature/distinction role (#165)
* [feature]A set of information for role recognition writing * [feature]A set of information for role recognition writing * [fix]Fix the code after rebasing. * [feature]A set of information for role recognition writing * [fix]Fix the code after rebasing. * [fix]Based on the AI review to fix the code * [changes]Disable the function of batch writing multiple groups of conversations in a cumulative manner * [fix]Addressing vulnerability risks
This commit is contained in:
@@ -472,13 +472,19 @@ def read_message_task(self, group_id: str, message: str, history: List[Dict[str,
|
||||
|
||||
|
||||
@celery_app.task(name="app.core.memory.agent.write_message", bind=True)
|
||||
def write_message_task(self, group_id: str, message: str, config_id: str,storage_type:str,user_rag_memory_id:str) -> Dict[str, Any]:
|
||||
def write_message_task(self, group_id: str, message, config_id: str, storage_type: str, user_rag_memory_id: str) -> Dict[str, Any]:
|
||||
"""Celery task to process a write message via MemoryAgentService.
|
||||
|
||||
支持两种消息格式:
|
||||
1. 字符串格式(向后兼容):message="user: xxx\nassistant: yyy"
|
||||
2. 结构化消息列表(推荐):message=[{"role": "user", "content": "xxx"}, {"role": "assistant", "content": "yyy"}]
|
||||
|
||||
Args:
|
||||
group_id: Group ID for the memory agent (also used as end_user_id)
|
||||
message: Message to write
|
||||
message: Message to write (str or list[dict])
|
||||
config_id: Optional configuration ID
|
||||
storage_type: Storage type (neo4j/rag)
|
||||
user_rag_memory_id: RAG memory ID
|
||||
|
||||
Returns:
|
||||
Dict containing the result and metadata
|
||||
|
||||
Reference in New Issue
Block a user