mirror of
https://github.com/geoffsee/open-gsio.git
synced 2025-09-08 22:56:46 +00:00
init
This commit is contained in:
16
workers/site/models/OpenAiMessage.ts
Normal file
16
workers/site/models/OpenAiMessage.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// Models
|
||||
import { types } from "mobx-state-tree";
|
||||
|
||||
export default types
|
||||
.model("Message", {
|
||||
content: types.string,
|
||||
role: types.enumeration(["user", "assistant", "system"]),
|
||||
})
|
||||
.actions((self) => ({
|
||||
setContent(newContent: string) {
|
||||
self.content = newContent;
|
||||
},
|
||||
append(newContent: string) {
|
||||
self.content += newContent;
|
||||
},
|
||||
}));
|
Reference in New Issue
Block a user