fix: adopt new v3 memory endpoints in Python + TS clients (#4856)

This commit is contained in:
Saket Aryan
2026-04-16 05:28:49 +05:30
committed by GitHub
parent c8e20a9bb5
commit 8827553576
7 changed files with 49 additions and 50 deletions
+4 -4
View File
@@ -1,6 +1,7 @@
import axios from "axios";
import {
AllUsers,
PaginatedMemories,
ProjectOptions,
Memory,
MemoryHistory,
@@ -221,7 +222,7 @@ export default class MemoryClient {
this._captureEvent("add", [payloadKeys]);
const response = await this._fetchWithErrorHandling(
`${this.host}/v3/memories/`,
`${this.host}/v3/memories/add/`,
{
method: "POST",
headers: this.headers,
@@ -284,7 +285,7 @@ export default class MemoryClient {
);
}
async getAll(options?: GetAllMemoryOptions): Promise<Array<Memory>> {
async getAll(options?: GetAllMemoryOptions): Promise<PaginatedMemories> {
// Reject top-level entity params - must use filters instead
rejectTopLevelEntityParams(options as Record<string, any>, "getAll");
@@ -293,12 +294,11 @@ export default class MemoryClient {
this._captureEvent("get_all", [payloadKeys]);
const { page, pageSize, filters, ...rest } = options ?? {};
const body: Record<string, any> = {
output_format: "v1.1",
...camelToSnakeKeys(rest),
...(filters && { filters }),
};
let url = `${this.host}/v2/memories/`;
let url = `${this.host}/v3/memories/`;
if (page && pageSize) {
url += `?page=${page}&page_size=${pageSize}`;
}