Fix PostgreSQL get_by_mode_and_id bugs

This commit is contained in:
yangdx
2025-04-22 00:26:16 +08:00
parent 9acf981042
commit 8938d11718

View File

@@ -345,7 +345,7 @@ class PGKVStorage(BaseKVStorage):
async def get_by_mode_and_id(self, mode: str, id: str) -> Union[dict, None]: async def get_by_mode_and_id(self, mode: str, id: str) -> Union[dict, None]:
"""Specifically for llm_response_cache.""" """Specifically for llm_response_cache."""
sql = SQL_TEMPLATES["get_by_mode_id_" + self.namespace] sql = SQL_TEMPLATES["get_by_mode_id_" + self.namespace]
params = {"workspace": self.db.workspace, mode: mode, "id": id} params = {"workspace": self.db.workspace, "mode": mode, "id": id}
if is_namespace(self.namespace, NameSpace.KV_STORE_LLM_RESPONSE_CACHE): if is_namespace(self.namespace, NameSpace.KV_STORE_LLM_RESPONSE_CACHE):
array_res = await self.db.query(sql, params, multirows=True) array_res = await self.db.query(sql, params, multirows=True)
res = {} res = {}