Files
open-gsio/packages/server/models/Message.ts
geoffsee 3d16bd94b4 **Refactor imports and improve type annotations**
- Adjusted import statements across the codebase to align with consistent use of `type`.
- Unified usage of `EventSource` initialization.
- Introduced `RootDeps` type for shared dependencies.
- Commented out unused VitePWA configuration.
- Updated proxy target URLs in Vite configuration.
2025-06-18 12:34:16 -04:00

19 lines
442 B
TypeScript

// Base Message
import { type Instance, 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;
},
}));
export type MessageType = Instance<typeof this>;