Refactor store exports and cleanup unused code.

Removed the centralized store export file to streamline dependencies and replaced indirect imports with direct ones for better maintainability. Additionally, eliminated unused views in `ClientChatStore` and commented out redundant code in the assistant SDK.
This commit is contained in:
geoffsee
2025-05-27 13:39:46 -04:00
committed by Geoff Seemueller
parent afd539a245
commit d519534c7d
3 changed files with 13 additions and 32 deletions

View File

@@ -2,7 +2,7 @@ import { applySnapshot, flow, Instance, types } from "mobx-state-tree";
import Message from "../models/Message";
import Attachment from "../models/Attachment";
import IntermediateStep from "../models/IntermediateStep";
import { UserOptionsStore } from "./index";
import UserOptionsStore from "./UserOptionsStore";
const ClientChatStore = types
.model("ClientChatStore", {
@@ -15,11 +15,6 @@ const ClientChatStore = types
tools: types.optional(types.array(types.string), []),
intermediateSteps: types.array(IntermediateStep),
})
.views((self) => ({
get getModel() {
return self.model;
},
}))
.actions((self) => ({
cleanup() {
if (self.eventSource) {
@@ -321,6 +316,7 @@ const ClientChatStore = types
}));
export type IMessage = Instance<typeof Message>;
export type IClientChatStore = Instance<typeof this>;
export default ClientChatStore.create();

View File

@@ -1,15 +0,0 @@
import AppMenuStore from "./AppMenuStore";
import ClientChatStore from "./ClientChatStore";
import ClientFeedbackStore from "./ClientFeedbackStore";
import ClientTransactionStore from "./ClientTransactionStore";
import FileUploadStore from "./FileUploadStore";
import UserOptionsStore from "./UserOptionsStore";
export {
AppMenuStore,
ClientChatStore,
ClientFeedbackStore,
ClientTransactionStore,
FileUploadStore,
UserOptionsStore,
};

View File

@@ -23,17 +23,17 @@ export class AssistantSdk {
const now = new Date();
const formattedMinutes = String(now.getMinutes()).padStart(2, "0");
const currentTime = `${now.getHours()}:${formattedMinutes} ${now.getSeconds()}s`;
const toolsInfo =
tools
.map((tool) => {
switch (tool) {
// case "user-attachments": return "### Attachments\nUser supplied attachments are normalized to text and will have this header (# Attachment:...) in the message.";
// case "web-search": return "### Web Search\nResults are optionally available in 'Live Search'.";
default:
return `- ${tool}`;
}
})
.join("\n\n") || "- No additional tools selected.";
// const toolsInfo =
// tools
// .map((tool) => {
// switch (tool) {
// // case "user-attachments": return "### Attachments\nUser supplied attachments are normalized to text and will have this header (# Attachment:...) in the message.";
// // case "web-search": return "### Web Search\nResults are optionally available in 'Live Search'.";
// default:
// return `- ${tool}`;
// }
// })
// .join("\n\n") || "- No additional tools selected.";
return `# Assistant Knowledge
## Current Context