Skip to content

Commit

Permalink
feat: new models
Browse files Browse the repository at this point in the history
  • Loading branch information
Googlefan committed Aug 27, 2024
1 parent 8460769 commit 202bb9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions src/chat/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,16 @@ export const gemini15Pro: ChatModel = {

export const gemini15Flash: ChatModel = {
name: "Gemini 1.5 Flash",
id: "gemini-1.5-flash",
id: "gemini-1.5-flash-exp-0827",
async generate(chat, system) {
return generateGeminiContent(chat, "gemini-1.5-flash-latest", system);
return generateGeminiContent(chat, "gemini-1.5-flash-exp-0827", system);
},
};

export const gemini15FlashSmall: ChatModel = {
name: "Gemini 1.5 Flash",
id: "gemini-1.5-flash-8b-exp-0827",
async generate(chat, system) {
return generateGeminiContent(chat, "gemini-1.5-flash-8b-exp-0827", system);
},
};
4 changes: 2 additions & 2 deletions src/chat/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { request } from "undici";
import { gemini15Flash, gemini15Pro } from "./gemini";
import { gemini15Flash, gemini15FlashSmall, gemini15Pro } from "./gemini";

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

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

export async function getAttachmentBase64(url: string) {
const res = await request(url);
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ client.on(Events.MessageCreate, async (message) => {
return;
if (!message.channel.topic?.includes("aichat")) return;
if (message.content.startsWith("#")) return;
let model = "gemini-1.5-flash";
let model = "gemini-1.5-flash-small";
addChatQueue(
message.channel.id,
{
Expand Down

0 comments on commit 202bb9a

Please sign in to comment.