feat(sdk): add delete_linked option to MemoryClient.delete (Python + TS) (#5270)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chaithanya Kumar
2026-05-27 22:38:16 +05:30
committed by GitHub
co-authored by Claude Opus 4.7
parent 88934304c6
commit 75a37ec93d
8 changed files with 113 additions and 14 deletions
+10 -3
View File
@@ -9,6 +9,7 @@ import {
SearchMemoryOptions,
GetAllMemoryOptions,
DeleteAllMemoryOptions,
DeleteMemoryOptions,
MemoryUpdateBody,
ProjectResponse,
PromptUpdatePayload,
@@ -377,11 +378,17 @@ export default class MemoryClient {
return response;
}
async delete(memoryId: string): Promise<{ message: string }> {
async delete(
memoryId: string,
options: DeleteMemoryOptions = {},
): Promise<{ message: string }> {
if (this.telemetryId === "") await this.ping();
this._captureEvent("delete", []);
this._captureEvent("delete", [Object.keys(options || {})]);
const snakeOptions = camelToSnakeKeys(this._prepareParams(options));
// @ts-ignore
const query = new URLSearchParams(snakeOptions).toString();
return this._fetchWithErrorHandling(
`${this.host}/v1/memories/${memoryId}/`,
`${this.host}/v1/memories/${memoryId}/${query ? `?${query}` : ""}`,
{
method: "DELETE",
headers: this.headers,