This commit is contained in:
geoffsee
2025-06-25 13:20:59 -04:00
committed by Geoff Seemueller
parent 21d6c8604e
commit 554096abb2
86 changed files with 556 additions and 508 deletions

View File

@@ -0,0 +1,20 @@
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 });
},
}));