@@ -31,7 +31,7 @@ export const MemoryBlock: BlockConfig = {
3131 value : ( ) => 'add' ,
3232 } ,
3333 {
34- id : 'conversationId ' ,
34+ id : 'id ' ,
3535 title : 'Conversation ID' ,
3636 type : 'short-input' ,
3737 placeholder : 'Enter conversation ID (e.g., user-123)' ,
@@ -53,7 +53,7 @@ export const MemoryBlock: BlockConfig = {
5353 required : false ,
5454 } ,
5555 {
56- id : 'conversationId ' ,
56+ id : 'id ' ,
5757 title : 'Conversation ID' ,
5858 type : 'short-input' ,
5959 placeholder : 'Enter conversation ID (e.g., user-123)' ,
@@ -86,7 +86,7 @@ export const MemoryBlock: BlockConfig = {
8686 required : false ,
8787 } ,
8888 {
89- id : 'conversationId ' ,
89+ id : 'id ' ,
9090 title : 'Conversation ID' ,
9191 type : 'short-input' ,
9292 placeholder : 'Enter conversation ID (e.g., user-123)' ,
@@ -171,8 +171,10 @@ export const MemoryBlock: BlockConfig = {
171171 errors . push ( 'Operation is required' )
172172 }
173173
174+ const conversationId = params . id || params . conversationId
175+
174176 if ( params . operation === 'add' ) {
175- if ( ! params . conversationId ) {
177+ if ( ! conversationId ) {
176178 errors . push ( 'Conversation ID is required for add operation' )
177179 }
178180 if ( ! params . role ) {
@@ -184,9 +186,9 @@ export const MemoryBlock: BlockConfig = {
184186 }
185187
186188 if ( params . operation === 'get' || params . operation === 'delete' ) {
187- if ( ! params . conversationId && ! params . blockId && ! params . blockName ) {
189+ if ( ! conversationId && ! params . blockId && ! params . blockName ) {
188190 errors . push (
189- `At least one of conversationId , blockId, or blockName is required for ${ params . operation } operation`
191+ `At least one of ID , blockId, or blockName is required for ${ params . operation } operation`
190192 )
191193 }
192194 }
@@ -200,7 +202,7 @@ export const MemoryBlock: BlockConfig = {
200202 if ( params . operation === 'add' ) {
201203 const result : Record < string , any > = {
202204 ...baseResult ,
203- conversationId : params . conversationId ,
205+ conversationId : conversationId ,
204206 role : params . role ,
205207 content : params . content ,
206208 }
@@ -213,15 +215,15 @@ export const MemoryBlock: BlockConfig = {
213215
214216 if ( params . operation === 'get' ) {
215217 const result : Record < string , any > = { ...baseResult }
216- if ( params . conversationId ) result . conversationId = params . conversationId
218+ if ( conversationId ) result . conversationId = conversationId
217219 if ( params . blockId ) result . blockId = params . blockId
218220 if ( params . blockName ) result . blockName = params . blockName
219221 return result
220222 }
221223
222224 if ( params . operation === 'delete' ) {
223225 const result : Record < string , any > = { ...baseResult }
224- if ( params . conversationId ) result . conversationId = params . conversationId
226+ if ( conversationId ) result . conversationId = conversationId
225227 if ( params . blockId ) result . blockId = params . blockId
226228 if ( params . blockName ) result . blockName = params . blockName
227229 return result
0 commit comments