This commit is contained in:
geoffsee
2025-05-22 23:14:01 -04:00
commit 33679583af
242 changed files with 15090 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import { types } from "mobx-state-tree";
export default types.model("ContactRecord", {
message: types.string,
timestamp: types.string,
email: types.string,
firstname: types.string,
lastname: types.string,
});

View File

@@ -0,0 +1,10 @@
// FeedbackRecord.ts
import { types } from "mobx-state-tree";
const FeedbackRecord = types.model("FeedbackRecord", {
feedback: types.string,
timestamp: types.string,
user: types.optional(types.string, "Anonymous"),
});
export default FeedbackRecord;

View File

@@ -0,0 +1,18 @@
// Base Message
import { 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>;

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 });
},
}));

View 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;
},
}));