@@ -69,20 +69,15 @@ export class Memory extends APIResource {
6969 * content:
7070 * 'Customer asked about pricing for the Scale plan.',
7171 * metadata: { messageId: 'msg-1' },
72- * role: 'user',
73- * id: 'msg-1',
74- * createdAt: '2025-01-10T12:34:56.000Z',
7572 * },
7673 * {
7774 * content:
7875 * 'Explained the Scale plan pricing and shared the pricing page link.',
7976 * metadata: { messageId: 'msg-2' },
80- * role: 'assistant',
81- * id: 'msg-2',
82- * createdAt: '2025-01-10T12:35:30.000Z',
8377 * },
8478 * ],
8579 * memoryId: 'support-thread-TCK-1234',
80+ * metadata: { groupName: ['support', 'pricing'] },
8681 * });
8782 * ```
8883 */
@@ -177,42 +172,52 @@ export interface MemoryDeleteParams {
177172
178173export interface MemoryAddParams {
179174 /**
180- * Array of content objects with additional properties allowed
175+ * Array of content objects with metadata
181176 */
182177 contents : Array < MemoryAddParams . Content > ;
183178
184179 /**
185180 * The ID of the memory
186181 */
187182 memoryId : string ;
183+
184+ /**
185+ * Optional metadata with groupName defaulting to ["default"]
186+ */
187+ metadata ?: MemoryAddParams . Metadata ;
188188}
189189
190190export namespace MemoryAddParams {
191191 export interface Content {
192- /**
193- * Unique message ID
194- */
195- id ?: string ;
196-
197192 /**
198193 * The content of the memory message
199194 */
200- content ? : string ;
195+ content : string ;
201196
202- /**
203- * Creation timestamp
204- */
205- createdAt ?: string ;
197+ metadata : Content . Metadata ;
206198
207- /**
208- * Additional metadata for the message
209- */
210- metadata ?: { [ key : string ] : unknown } ;
199+ [ k : string ] : unknown ;
200+ }
201+
202+ export namespace Content {
203+ export interface Metadata {
204+ /**
205+ * Unique message ID
206+ */
207+ messageId : string ;
208+
209+ [ k : string ] : unknown ;
210+ }
211+ }
211212
213+ /**
214+ * Optional metadata with groupName defaulting to ["default"]
215+ */
216+ export interface Metadata {
212217 /**
213- * Role of the message sender (e.g., user, assistant)
218+ * Group names for the memory context
214219 */
215- role ?: string ;
220+ groupName ?: Array < string > ;
216221
217222 [ k : string ] : unknown ;
218223 }
0 commit comments