Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Googlefan committed May 24, 2024
1 parent f9209bb commit a9b474f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { client } from ".";
const channelSpecificHistory = new Collection<string, Chat[]>();
const chatQueue = new Collection<
string,
{ queue: (Chat & { id: string })[]; processing: boolean; model?: string }
{ queue: (Chat & { id: string })[]; processing: boolean; model: string }
>();

function addHistory(channelId: string, chat: Chat) {
Expand All @@ -20,6 +20,7 @@ export function clearHistory(channelId: string) {
chatQueue.set(channelId, {
queue: [],
processing: false,
model: "gemini-1.5-flash",
});
}

Expand All @@ -31,6 +32,7 @@ setInterval(() => {
chatQueue.set(channelId, {
queue,
processing: true,
model: modelId,
});
const model = models.find((x) => x.id === modelId || "gemini-1.5-flash")!;
model
Expand Down Expand Up @@ -81,6 +83,7 @@ setInterval(() => {
chatQueue.set(channelId, {
queue,
processing: false,
model: modelId,
});
});
}
Expand All @@ -89,7 +92,7 @@ setInterval(() => {
export function addChatQueue(
channelId: string,
chat: Chat & { id: string },
model?: string,
model: string,
) {
if (!chatQueue.has(channelId)) {
chatQueue.set(channelId, {
Expand Down

0 comments on commit a9b474f

Please sign in to comment.