Added New Param, output_format (#2639)
This commit is contained in:
@@ -209,6 +209,12 @@ mode: "wide"
|
|||||||
|
|
||||||
<Tab title="TypeScript">
|
<Tab title="TypeScript">
|
||||||
|
|
||||||
|
<Update label="2025-05-06" description="v2.1.24">
|
||||||
|
**New Features:**
|
||||||
|
- **Client:** Added new param `output_format` to match Python SDK.
|
||||||
|
- **Client:** Added new enum `OutputFormat` for `v1.0` and `v1.1`
|
||||||
|
</Update>
|
||||||
|
|
||||||
<Update label="2025-05-05" description="v2.1.23">
|
<Update label="2025-05-05" description="v2.1.23">
|
||||||
**New Features:**
|
**New Features:**
|
||||||
- **Client:** Updated `deleteUsers` to use `v2` API.
|
- **Client:** Updated `deleteUsers` to use `v2` API.
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ import { MemoryClient } from "mem0";
|
|||||||
|
|
||||||
const client = new MemoryClient({
|
const client = new MemoryClient({
|
||||||
apiKey: "your-api-key",
|
apiKey: "your-api-key",
|
||||||
orgId: "your-org-id",
|
org_id: "your-org-id",
|
||||||
projectId: "your-project-id"
|
project_id: "your-project-id"
|
||||||
});
|
});
|
||||||
|
|
||||||
const messages = [
|
const messages = [
|
||||||
@@ -74,10 +74,10 @@ const messages = [
|
|||||||
// Enable graph memory when adding
|
// Enable graph memory when adding
|
||||||
await client.add({
|
await client.add({
|
||||||
messages,
|
messages,
|
||||||
userId: "joseph",
|
user_id: "joseph",
|
||||||
version: "v1",
|
version: "v1",
|
||||||
enableGraph: true,
|
enable_graph: true,
|
||||||
outputFormat: "v1.1"
|
output_format: "v1.1"
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -142,9 +142,9 @@ print(results)
|
|||||||
// Search with graph memory enabled
|
// Search with graph memory enabled
|
||||||
const results = await client.search({
|
const results = await client.search({
|
||||||
query: "what is my name?",
|
query: "what is my name?",
|
||||||
userId: "joseph",
|
user_id: "joseph",
|
||||||
enableGraph: true,
|
enable_graph: true,
|
||||||
outputFormat: "v1.1"
|
output_format: "v1.1"
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(results);
|
console.log(results);
|
||||||
@@ -211,9 +211,9 @@ print(memories)
|
|||||||
```javascript JavaScript
|
```javascript JavaScript
|
||||||
// Get all memories with graph context
|
// Get all memories with graph context
|
||||||
const memories = await client.getAll({
|
const memories = await client.getAll({
|
||||||
userId: "joseph",
|
user_id: "joseph",
|
||||||
enableGraph: true,
|
enable_graph: true,
|
||||||
outputFormat: "v1.1"
|
output_format: "v1.1"
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(memories);
|
console.log(memories);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mem0ai",
|
"name": "mem0ai",
|
||||||
"version": "2.1.23",
|
"version": "2.1.24",
|
||||||
"description": "The Memory Layer For Your AI Apps",
|
"description": "The Memory Layer For Your AI Apps",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
|
|||||||
@@ -22,12 +22,18 @@ export interface MemoryOptions {
|
|||||||
custom_categories?: custom_categories[];
|
custom_categories?: custom_categories[];
|
||||||
custom_instructions?: string;
|
custom_instructions?: string;
|
||||||
timestamp?: number;
|
timestamp?: number;
|
||||||
|
output_format?: string | OutputFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProjectOptions {
|
export interface ProjectOptions {
|
||||||
fields?: string[];
|
fields?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum OutputFormat {
|
||||||
|
V1 = "v1.0",
|
||||||
|
V1_1 = "v1.1",
|
||||||
|
}
|
||||||
|
|
||||||
export enum API_VERSION {
|
export enum API_VERSION {
|
||||||
V1 = "v1",
|
V1 = "v1",
|
||||||
V2 = "v2",
|
V2 = "v2",
|
||||||
|
|||||||
Reference in New Issue
Block a user