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:
co-authored by
Claude Opus 4.7
parent
88934304c6
commit
75a37ec93d
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user