feat(sdk): expose decay on project.update (Python + TypeScript) (#5062)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chaithanya Kumar
2026-05-06 15:33:32 +05:30
committed by GitHub
co-authored by Claude Opus 4.7
parent a734e057cf
commit 397f3414ee
3 changed files with 120 additions and 2 deletions
+16 -2
View File
@@ -398,6 +398,7 @@ class Project(BaseProject):
custom_categories: Optional[List[str]] = None,
retrieval_criteria: Optional[List[Dict[str, Any]]] = None,
multilingual: Optional[bool] = None,
decay: Optional[bool] = None,
) -> Dict[str, Any]:
"""
Update project settings.
@@ -407,6 +408,9 @@ class Project(BaseProject):
custom_categories: New categories for the project
retrieval_criteria: New retrieval criteria for the project
multilingual: Whether to use the input language for memory storage and retrieval
decay: Toggle Memory Decay for this project. When True, search-time
ranking boosts recently-used memories and gently dampens stale ones; when
False, ranking is restored to the pre-decay behaviour. Off by default.
Returns:
Dictionary containing the API response.
@@ -423,11 +427,12 @@ class Project(BaseProject):
and custom_categories is None
and retrieval_criteria is None
and multilingual is None
and decay is None
):
raise ValueError(
"At least one parameter must be provided for update: "
"custom_instructions, custom_categories, retrieval_criteria, "
"multilingual"
"multilingual, decay"
)
payload = self._prepare_params(
@@ -436,6 +441,7 @@ class Project(BaseProject):
"custom_categories": custom_categories,
"retrieval_criteria": retrieval_criteria,
"multilingual": multilingual,
"decay": decay,
}
)
response = self._client.patch(
@@ -451,6 +457,7 @@ class Project(BaseProject):
"custom_categories": custom_categories,
"retrieval_criteria": retrieval_criteria,
"multilingual": multilingual,
"decay": decay,
"sync_type": "sync",
},
)
@@ -715,6 +722,7 @@ class AsyncProject(BaseProject):
custom_categories: Optional[List[str]] = None,
retrieval_criteria: Optional[List[Dict[str, Any]]] = None,
multilingual: Optional[bool] = None,
decay: Optional[bool] = None,
) -> Dict[str, Any]:
"""
Update project settings.
@@ -724,6 +732,9 @@ class AsyncProject(BaseProject):
custom_categories: New categories for the project
retrieval_criteria: New retrieval criteria for the project
multilingual: Whether to use the input language for memory storage and retrieval
decay: Toggle Memory Decay for this project. When True, search-time
ranking boosts recently-used memories and gently dampens stale ones; when
False, ranking is restored to the pre-decay behaviour. Off by default.
Returns:
Dictionary containing the API response.
@@ -740,11 +751,12 @@ class AsyncProject(BaseProject):
and custom_categories is None
and retrieval_criteria is None
and multilingual is None
and decay is None
):
raise ValueError(
"At least one parameter must be provided for update: "
"custom_instructions, custom_categories, retrieval_criteria, "
"multilingual"
"multilingual, decay"
)
payload = self._prepare_params(
@@ -753,6 +765,7 @@ class AsyncProject(BaseProject):
"custom_categories": custom_categories,
"retrieval_criteria": retrieval_criteria,
"multilingual": multilingual,
"decay": decay,
}
)
response = await self._client.patch(
@@ -768,6 +781,7 @@ class AsyncProject(BaseProject):
"custom_categories": custom_categories,
"retrieval_criteria": retrieval_criteria,
"multilingual": multilingual,
"decay": decay,
"sync_type": "async",
},
)