Skip to content

Commit 41f12d7

Browse files
aadamgoughAdam Gough
andauthored
mem0 styling (#307)
Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
1 parent 24859de commit 41f12d7

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

sim/blocks/blocks/mem0.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ export const Mem0Block: BlockConfig<Mem0Response> = {
2525
placeholder: 'Select an operation',
2626
},
2727
{
28-
id: 'apiKey',
29-
title: 'API Key',
30-
type: 'short-input',
28+
id: 'limit',
29+
title: 'Result Limit',
30+
type: 'slider',
3131
layout: 'full',
32-
placeholder: 'Enter your Mem0 API key',
33-
password: true,
32+
min: 1,
33+
max: 50,
34+
condition: {
35+
field: 'operation',
36+
value: ['search', 'get'],
37+
},
3438
},
3539
{
3640
id: 'userId',
@@ -55,7 +59,7 @@ export const Mem0Block: BlockConfig<Mem0Response> = {
5559
title: 'Messages',
5660
type: 'code',
5761
layout: 'full',
58-
placeholder: 'Enter messages as JSON array with role and content',
62+
placeholder: 'JSON array, e.g. [{"role": "user", "content": "I love Sim Studio!"}]',
5963
language: 'json',
6064
condition: {
6165
field: 'operation',
@@ -107,16 +111,12 @@ export const Mem0Block: BlockConfig<Mem0Response> = {
107111
},
108112
},
109113
{
110-
id: 'limit',
111-
title: 'Result Limit',
112-
type: 'slider',
113-
layout: 'half',
114-
min: 1,
115-
max: 50,
116-
condition: {
117-
field: 'operation',
118-
value: ['search', 'get'],
119-
},
114+
id: 'apiKey',
115+
title: 'API Key',
116+
type: 'short-input',
117+
layout: 'full',
118+
placeholder: 'Enter your Mem0 API key',
119+
password: true,
120120
},
121121
],
122122
tools: {

sim/tools/mem0/add_memories.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export const mem0AddMemoriesTool: ToolConfig = {
3333
url: 'https://api.mem0.ai/v1/memories/',
3434
method: 'POST',
3535
headers: (params) => ({
36+
Authorization: `Token ${params.apiKey}`,
3637
'Content-Type': 'application/json',
37-
Authorization: `Token ${params.apiKey}`,
3838
}),
3939
body: (params) => {
4040
// First, ensure messages is an array
@@ -61,8 +61,8 @@ export const mem0AddMemoriesTool: ToolConfig = {
6161
// Prepare request body
6262
const body: Record<string, any> = {
6363
messages: messagesArray,
64-
user_id: params.userId,
65-
version: params.version || 'v2'
64+
version: params.version || 'v2',
65+
user_id: params.userId
6666
}
6767

6868
return body

0 commit comments

Comments
 (0)