Skip to content

Commit 3d73abd

Browse files
committed
📦 NEW: Select embedding model when create memory
1 parent 5dd8226 commit 3d73abd

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

examples/nodejs/examples/memory/memory.create.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const memory = new Memory({
77

88
async function main() {
99
const response = await memory.create({
10-
name: 'sdk-memory',
10+
name: 'sdk-memory-2',
11+
embedding_model: 'cohere:embed-multilingual-v3.0'
1112
});
1213

1314
console.log(response);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"clean": "turbo clean",
1717
"clean-all": "turbo clean && rm -rf node_modules",
1818
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
19-
"release": "turbo clean && pnpm install && turbo build && changeset publish",
19+
"release": "turbo clean && pnpm install && turbo run build --filter=./packages/* && changeset publish",
2020
"releaseDocs": "turbo build --filter=docs^... && changeset publish",
2121
"releasex": "turbo build && changeset publish",
2222
"prettier-check": "prettier --check \"**/*.{js,ts,tsx,md,mdx}\"",

packages/langbase/src/memory/memory.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ interface MemoryBaseResponse {
1414
export interface MemoryCreateOptions {
1515
name: string;
1616
description?: string;
17+
embedding_model?:
18+
| 'openai:text-embedding-3-large'
19+
| 'cohere:embed-multilingual-v3.0'
20+
| 'cohere:embed-multilingual-light-v3.0';
1721
}
1822

1923
export interface MemoryDeleteOptions {
@@ -54,7 +58,12 @@ export interface MemoryRetryDocEmbedOptions {
5458
documentName: string;
5559
}
5660

57-
export interface MemoryCreateResponse extends MemoryBaseResponse {}
61+
export interface MemoryCreateResponse extends MemoryBaseResponse {
62+
embedding_model:
63+
| 'openai:text-embedding-3-large'
64+
| 'cohere:embed-multilingual-v3.0'
65+
| 'cohere:embed-multilingual-light-v3.0';
66+
}
5867
export interface MemoryListResponse extends MemoryBaseResponse {}
5968
export interface BaseDeleteResponse {
6069
success: boolean;

0 commit comments

Comments
 (0)