Files
open-gsio/packages/schema/src/models/O1Message.ts
geoffsee 554096abb2 wip
2025-06-25 14:00:16 -04:00

21 lines
576 B
TypeScript

import { types } from 'mobx-state-tree';
export default types
.model('O1Message', {
role: types.enumeration(['user', 'assistant', 'system']),
content: types.array(
types.model({
type: types.string,
text: types.string,
}),
),
})
.actions(self => ({
setContent(newContent: string, contentType: string = 'text') {
self.content = [{ type: contentType, text: newContent }];
},
append(newContent: string, contentType: string = 'text') {
self.content.push({ type: contentType, text: newContent });
},
}));