mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 23:17:59 -05:00
improvement(memory): consolidated expected return value
This commit is contained in:
@@ -118,7 +118,6 @@ export const MemoryBlock: BlockConfig = {
|
||||
outputs: {
|
||||
response: {
|
||||
type: {
|
||||
memory: 'any',
|
||||
memories: 'any',
|
||||
id: 'string',
|
||||
},
|
||||
|
||||
@@ -142,7 +142,7 @@ export const memoryAddTool: ToolConfig<any, MemoryResponse> = {
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
memory: data.data,
|
||||
memories: data.data,
|
||||
message: isNewMemory ? 'Memory created successfully' : 'Memory appended successfully'
|
||||
},
|
||||
}
|
||||
@@ -150,7 +150,7 @@ export const memoryAddTool: ToolConfig<any, MemoryResponse> = {
|
||||
return {
|
||||
success: false,
|
||||
output: {
|
||||
memory: undefined,
|
||||
memories: undefined,
|
||||
message: `Failed to add memory: ${error.message || 'Unknown error occurred'}`
|
||||
},
|
||||
}
|
||||
@@ -161,7 +161,7 @@ export const memoryAddTool: ToolConfig<any, MemoryResponse> = {
|
||||
return {
|
||||
success: false,
|
||||
output: {
|
||||
memory: undefined,
|
||||
memories: undefined,
|
||||
message: `Memory operation failed: ${error.message || 'Unknown error occurred'}`
|
||||
},
|
||||
error: errorMessage
|
||||
|
||||
@@ -56,7 +56,7 @@ export const memoryGetTool: ToolConfig<any, MemoryResponse> = {
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
memory: data.data,
|
||||
memories: data.data,
|
||||
message: 'Memory retrieved successfully'
|
||||
},
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export const memoryGetTool: ToolConfig<any, MemoryResponse> = {
|
||||
return {
|
||||
success: false,
|
||||
output: {
|
||||
memory: undefined,
|
||||
memories: undefined,
|
||||
message: `Failed to retrieve memory: ${error.message || 'Unknown error'}`
|
||||
},
|
||||
error: `Failed to retrieve memory: ${error.message || 'Unknown error'}`
|
||||
@@ -76,7 +76,7 @@ export const memoryGetTool: ToolConfig<any, MemoryResponse> = {
|
||||
return {
|
||||
success: false,
|
||||
output: {
|
||||
memory: undefined,
|
||||
memories: undefined,
|
||||
message: errorMessage
|
||||
},
|
||||
error: errorMessage
|
||||
|
||||
Reference in New Issue
Block a user