feat: support session_id in current chat search
This commit is contained in:
@ -502,6 +502,7 @@ class MemoryGatewayService:
|
||||
user_id: str,
|
||||
agent_id: str | None,
|
||||
query: str,
|
||||
session_id: str | None,
|
||||
conversation_id: str | None,
|
||||
scope: list[str],
|
||||
method: str,
|
||||
@ -515,8 +516,11 @@ class MemoryGatewayService:
|
||||
) -> dict[str, Any]:
|
||||
results: list[dict[str, Any]] = []
|
||||
session_resource_map: dict[str, dict[str, Any]] = {}
|
||||
current_chat_session_id = session_id
|
||||
if current_chat_session_id is None and conversation_id:
|
||||
current_chat_session_id = f"chat:{conversation_id}"
|
||||
|
||||
if "current_chat" in scope and conversation_id:
|
||||
if "current_chat" in scope and current_chat_session_id:
|
||||
payload = self._search_payload(
|
||||
user_id=user_id,
|
||||
agent_id=agent_id,
|
||||
@ -530,7 +534,7 @@ class MemoryGatewayService:
|
||||
project_id=project_id,
|
||||
filters=_combine_filters(
|
||||
filters,
|
||||
{"session_id": f"chat:{conversation_id}"},
|
||||
{"session_id": current_chat_session_id},
|
||||
),
|
||||
)
|
||||
results.extend(
|
||||
|
||||
Reference in New Issue
Block a user