Skip to content

Commit

Permalink
add claude35haiku not vision
Browse files Browse the repository at this point in the history
  • Loading branch information
OPChips committed Nov 6, 2024
1 parent 0dc4071 commit 3086a2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ const anthropicModels = [
"claude-3-sonnet-20240229",
"claude-3-opus-20240229",
"claude-3-haiku-20240307",
"claude-3-5-haiku-20241022",
"claude-3-5-sonnet-20240620",
"claude-3-5-sonnet-20241022",
"claude-3-5-sonnet-latest",
Expand Down
8 changes: 5 additions & 3 deletions app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,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 excludeKeywords = ["claude-3-5-haiku-20241022"];
const visionKeywords = [
"vision",
"claude-3",
Expand All @@ -266,9 +267,10 @@ export function isVisionModel(model: string) {
model.includes("gpt-4-turbo") && !model.includes("preview");

return (
visionKeywords.some((keyword) => model.includes(keyword)) ||
isGpt4Turbo ||
isDalle3(model)
!excludeKeywords.some((keyword) => model.includes(keyword)) &&
(visionKeywords.some((keyword) => model.includes(keyword)) ||
isGpt4Turbo ||
isDalle3(model))
);
}

Expand Down

0 comments on commit 3086a2f

Please sign in to comment.