Skip to content

Commit

Permalink
Rename backup model env
Browse files Browse the repository at this point in the history
  • Loading branch information
elie222 committed Dec 30, 2024
1 parent 65bf338 commit e7a7507
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions apps/web/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const env = createEnv({
NEXT_PUBLIC_BEDROCK_SONNET_MODEL: z
.string()
.default("us.anthropic.claude-3-5-sonnet-20241022-v2:0"),
NEXT_PUBLIC_BEDROCK_HAIKU_MODEL: z
NEXT_PUBLIC_BEDROCK_ANTHROPIC_BACKUP_MODEL: z
.string()
.default("us.anthropic.claude-3-5-haiku-20241022-v1:0"),
NEXT_PUBLIC_OLLAMA_MODEL: z.string().optional(),
Expand Down Expand Up @@ -185,8 +185,8 @@ export const env = createEnv({
NEXT_PUBLIC_AXIOM_TOKEN: process.env.NEXT_PUBLIC_AXIOM_TOKEN,
NEXT_PUBLIC_BEDROCK_SONNET_MODEL:
process.env.NEXT_PUBLIC_BEDROCK_SONNET_MODEL,
NEXT_PUBLIC_BEDROCK_HAIKU_MODEL:
process.env.NEXT_PUBLIC_BEDROCK_HAIKU_MODEL,
NEXT_PUBLIC_BEDROCK_ANTHROPIC_BACKUP_MODEL:
process.env.NEXT_PUBLIC_BEDROCK_ANTHROPIC_BACKUP_MODEL,
NEXT_PUBLIC_OLLAMA_MODEL: process.env.NEXT_PUBLIC_OLLAMA_MODEL,
},
});
3 changes: 2 additions & 1 deletion apps/web/utils/llms/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const Model = {
GPT_4O: "gpt-4o",
GPT_4O_MINI: "gpt-4o-mini",
CLAUDE_3_5_SONNET_BEDROCK: env.NEXT_PUBLIC_BEDROCK_SONNET_MODEL,
CLAUDE_3_5_HAIKU_BEDROCK: env.NEXT_PUBLIC_BEDROCK_HAIKU_MODEL,
// BEDROCK_ANTHROPIC_BACKUP_MODEL:
// env.NEXT_PUBLIC_BEDROCK_ANTHROPIC_BACKUP_MODEL,
CLAUDE_3_5_SONNET_ANTHROPIC: "claude-3-5-sonnet-20241022",
...(supportsOllama ? { OLLAMA: env.NEXT_PUBLIC_OLLAMA_MODEL } : {}),
};
Expand Down
2 changes: 1 addition & 1 deletion apps/web/utils/llms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ async function withBackupModel<T, Args extends { userAi: UserAIFields }>(
...args,
userAi: {
aiProvider: Provider.ANTHROPIC,
aiModel: env.NEXT_PUBLIC_BEDROCK_HAIKU_MODEL,
aiModel: env.NEXT_PUBLIC_BEDROCK_ANTHROPIC_BACKUP_MODEL,
aiApiKey: args.userAi.aiApiKey,
},
});
Expand Down
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"NEXT_PUBLIC_AXIOM_DATASET",
"NEXT_PUBLIC_AXIOM_TOKEN",
"NEXT_PUBLIC_BEDROCK_SONNET_MODEL",
"NEXT_PUBLIC_BEDROCK_ANTHROPIC_BACKUP_MODEL",
"NEXT_PUBLIC_OLLAMA_MODEL"
],
"outputs": [".next/**", "!.next/cache/**"]
Expand Down

0 comments on commit e7a7507

Please sign in to comment.