Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Googlefan committed Aug 2, 2024
1 parent 52630ea commit 4f74232
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/chat/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function* generateGeminiContent(
let isText = false;
let text = "";
let iscandidatesTokenCount = false;
for await (const chunk of parserStream.iterator()) {
for await (const chunk of parserStream) {
if (chunk.name === "keyValue" && chunk.value === "text") {
isText = true;
}
Expand Down
10 changes: 2 additions & 8 deletions src/chat/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { request } from "undici";
import {
gemini15Flash,
gemini15Pro,
} from "./gemini";
import { gemini15Flash, gemini15Pro } from "./gemini";

export interface Chat {
role: "user" | "assistant" | "system";
Expand All @@ -27,10 +24,7 @@ export interface ChatModel {
id: string;
}

export const models = [
gemini15Flash,
gemini15Pro,
];
export const models = [gemini15Flash, gemini15Pro];

export async function getAttachmentBase64(url: string) {
const res = await request(url);
Expand Down
8 changes: 6 additions & 2 deletions src/queue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { BaseGuildTextChannel, Collection, MessageEditOptions } from "discord.js";
import {
BaseGuildTextChannel,
Collection,
MessageEditOptions,
} from "discord.js";
import { Chat, models } from "./chat";
import { client } from ".";

Expand Down Expand Up @@ -88,7 +92,7 @@ setInterval(() => {
if (msg) {
try {
await msg.edit("Failed to generate message");
} catch { }
} catch {}
}
}
chatQueue.set(channelId, {
Expand Down

0 comments on commit 4f74232

Please sign in to comment.