Skip to content

Commit

Permalink
feat: allow users to configure models for openai and anthropic
Browse files Browse the repository at this point in the history
  • Loading branch information
oxSaturn committed Dec 12, 2024
1 parent d0c6c55 commit 8b5175b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ DISCORD_VOICE_CHANNEL_ID= # The ID of the voice channel the bot should join (opt

# AI Model API Keys
OPENAI_API_KEY= # OpenAI API key, starting with sk-
SMALL_OPENAI_MODEL= # Default: gpt-4o-mini
MEDIUM_OPENAI_MODEL= # Default: gpt-4o
LARGE_OPENAI_MODEL= # Default: gpt-4o
EMBEDDING_OPENAI_MODEL= # Default: text-embedding-3-small
IMAGE_OPENAI_MODEL= # Default: dall-e-3

# Eternal AI's Decentralized Inference API
ETERNALAI_URL=
Expand Down Expand Up @@ -107,6 +112,10 @@ LLAMALOCAL_PATH= # Default: "" which is the current directory in plugin-node/dis

# API Keys
ANTHROPIC_API_KEY= # For Claude
SMALL_ANTHROPIC_MODEL= # Default: claude-3-haiku-20240307
MEDIUM_ANTHROPIC_MODEL= # Default: claude-3-5-sonnet-20241022
LARGE_ANTHROPIC_MODEL= # Default: claude-3-5-sonnet-20241022

HEURIST_API_KEY= # Get from https://heurist.ai/dev-access

# Heurist Models
Expand Down
16 changes: 8 additions & 8 deletions packages/core/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export const models: Models = {
temperature: 0.6,
},
model: {
[ModelClass.SMALL]: "gpt-4o-mini",
[ModelClass.MEDIUM]: "gpt-4o",
[ModelClass.LARGE]: "gpt-4o",
[ModelClass.EMBEDDING]: "text-embedding-3-small",
[ModelClass.IMAGE]: "dall-e-3",
[ModelClass.SMALL]: settings.SMALL_OPENAI_MODEL || "gpt-4o-mini",
[ModelClass.MEDIUM]: settings.MEDIUM_OPENAI_MODEL || "gpt-4o",
[ModelClass.LARGE]: settings.LARGE_OPENAI_MODEL || "gpt-4o",
[ModelClass.EMBEDDING]: settings.EMBEDDING_OPENAI_MODEL || "text-embedding-3-small",
[ModelClass.IMAGE]: settings.IMAGE_OPENAI_MODEL || "dall-e-3",
},
},
[ModelProviderName.ETERNALAI]: {
Expand Down Expand Up @@ -55,9 +55,9 @@ export const models: Models = {
},
endpoint: "https://api.anthropic.com/v1",
model: {
[ModelClass.SMALL]: "claude-3-haiku-20240307",
[ModelClass.MEDIUM]: "claude-3-5-sonnet-20241022",
[ModelClass.LARGE]: "claude-3-5-sonnet-20241022",
[ModelClass.SMALL]: settings.SMALL_ANTHROPIC_MODEL || "claude-3-haiku-20240307",
[ModelClass.MEDIUM]: settings.MEDIUM_ANTHROPIC_MODEL || "claude-3-5-sonnet-20241022",
[ModelClass.LARGE]: settings.LARGE_ANTHROPIC_MODEL || "claude-3-5-sonnet-20241022",
},
},
[ModelProviderName.CLAUDE_VERTEX]: {
Expand Down

0 comments on commit 8b5175b

Please sign in to comment.