Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
RubuJam committed Apr 11, 2024
2 parents 5dc5bfb + 55a93e7 commit 0cffaf8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
19 changes: 19 additions & 0 deletions app/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export const GEMINI_SUMMARIZE_MODEL = "gemini-pro";

export const KnowledgeCutOffDate: Record<string, string> = {
default: "2021-09",
"gpt-4-turbo": "2023-12",
"gpt-4-turbo-preview": "2023-12",
"gpt-4-1106-preview": "2023-04",
"gpt-4-0125-preview": "2023-12",
Expand Down Expand Up @@ -190,6 +191,24 @@ export const DEFAULT_MODELS = [
providerType: "openai",
},
},
{
name: "gpt-4-turbo",
available: true,
provider: {
id: "openai",
providerName: "OpenAI",
providerType: "openai",
},
},
{
name: "gpt-4-turbo-2024-04-09",
available: true,
provider: {
id: "openai",
providerName: "OpenAI",
providerType: "openai",
},
},
{
name: "gpt-4-turbo-preview",
available: true,
Expand Down
5 changes: 4 additions & 1 deletion app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ export function getMessageImages(message: RequestMessage): string[] {
}

export function isVisionModel(model: string) {

// Note: This is a better way using the TypeScript feature instead of `&&` or `||` (ts v5.5.0-dev.20240314 I've been using)

const visionKeywords = [
Expand All @@ -298,5 +299,7 @@ export function isVisionModel(model: string) {
"gemini-1.5-pro",
];

return visionKeywords.some((keyword) => model.includes(keyword));
const isGpt4Turbo = model.includes("gpt-4-turbo") && !model.includes("preview");

return visionKeywords.some((keyword) => model.includes(keyword)) || isGpt4Turbo;
}

0 comments on commit 0cffaf8

Please sign in to comment.