Skip to content

Commit d093926

Browse files
committed
ack PR comments
1 parent 71354f2 commit d093926

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

apps/sim/tools/memory/add.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ export const memoryAddTool: ToolConfig<any, MemoryResponse> = {
4747
}
4848

4949
const conversationId = params.conversationId || params.id
50-
const key = conversationId as string
50+
if (!conversationId) {
51+
throw new Error('conversationId or id is required')
52+
}
53+
const key = conversationId
5154

5255
const body: Record<string, any> = {
5356
key,

apps/sim/tools/memory/delete.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export const memoryDeleteTool: ToolConfig<any, MemoryResponse> = {
3030
}
3131

3232
const conversationId = params.conversationId || params.id
33+
if (!conversationId) {
34+
throw new Error('conversationId or id is required')
35+
}
3336

3437
const url = new URL('/api/memory', 'http://dummy')
3538
url.searchParams.set('workspaceId', workspaceId)

apps/sim/tools/memory/get.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ export const memoryGetTool: ToolConfig<any, MemoryResponse> = {
3030
}
3131

3232
const conversationId = params.conversationId || params.id
33-
const query = conversationId as string
33+
if (!conversationId) {
34+
throw new Error('conversationId or id is required')
35+
}
36+
const query = conversationId
3437

3538
const url = new URL('/api/memory', 'http://dummy')
3639
url.searchParams.set('workspaceId', workspaceId)

0 commit comments

Comments
 (0)