mirror of
https://github.com/geoffsee/open-gsio.git
synced 2025-09-08 22:56:46 +00:00
wip
This commit is contained in:

committed by
Geoff Seemueller

parent
21d6c8604e
commit
554096abb2
20
packages/schema/src/models/O1Message.ts
Normal file
20
packages/schema/src/models/O1Message.ts
Normal 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 });
|
||||
},
|
||||
}));
|
Reference in New Issue
Block a user