Fix async client update_project method (#2155)

This commit is contained in:
Deshraj Yadav
2025-01-18 19:35:59 -08:00
committed by GitHub
parent a9d1383909
commit 56351d1f8d
2 changed files with 8 additions and 3 deletions

View File

@@ -758,7 +758,7 @@ class AsyncMemoryClient:
if not (self.sync_client.org_id and self.sync_client.project_id):
raise ValueError("org_id and project_id must be set to access instructions or categories")
params = self._prepare_params({"fields": fields})
params = self.sync_client._prepare_params({"fields": fields})
response = await self.async_client.get(
f"/api/v1/orgs/organizations/{self.sync_client.org_id}/projects/{self.sync_client.project_id}/",
params=params,
@@ -769,11 +769,16 @@ class AsyncMemoryClient:
@api_error_handler
async def update_project(
self, custom_instructions: Optional[str], custom_categories: Optional[List[str]]
self, custom_instructions: Optional[str] = None, custom_categories: Optional[List[str]] = None
) -> Dict[str, Any]:
if not (self.sync_client.org_id and self.sync_client.project_id):
raise ValueError("org_id and project_id must be set to update instructions or categories")
if custom_instructions is None and custom_categories is None:
raise ValueError(
"Currently we only support updating custom_instructions or custom_categories, so you must provide at least one of them"
)
payload = self.sync_client._prepare_params(
{"custom_instructions": custom_instructions, "custom_categories": custom_categories}
)

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "mem0ai"
version = "0.1.44"
version = "0.1.45"
description = "Long-term memory for AI Agents"
authors = ["Mem0 <founders@mem0.ai>"]
exclude = [