Skip to content

Commit

Permalink
Update model selection logic in read_model_config method ✨
Browse files Browse the repository at this point in the history
Refactor `read_model_config` to set default model names based on the provider. If the provider is OpenAI, set the model name to chatgpt-4o-latest. If the provider is Anthropic, set it to claude-3-5-sonnet-20240620. Otherwise, fall back to the environment variable or config file.
  • Loading branch information
TechNickAI committed Aug 28, 2024
1 parent 5ae15d2 commit ba44ff8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion aicodebot/lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ def read_model_config(self):
or (os.getenv("OPENAI_API_KEY") and self.OPENAI)
or os.getenv("AICODEBOT_MODEL_PROVIDER", config.get("language_model_provider", self.DEFAULT_PROVIDER))
)
self.model_name = os.getenv("AICODEBOT_MODEL", config.get("language_model", self.DEFAULT_MODEL))

if self.provider == self.OPENAI:
self.model_name = "chatgpt-4o-latest"
elif self.provider == self.ANTHROPIC:
self.model_name = "claude-3-5-sonnet-20240620"
else:
self.model_name = os.getenv("AICODEBOT_MODEL", config.get("language_model", self.DEFAULT_MODEL))

# --------------------------- API key verification --------------------------- #
if self.provider == self.OPENAI:
Expand Down

0 comments on commit ba44ff8

Please sign in to comment.