Skip to content

Commit d492df2

Browse files
committed
refactor: only check for claude- prefix in model name
1 parent f07e92d commit d492df2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

openevolve/config.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,14 @@ def __post_init__(self):
4040
"""Set up API key from environment if not provided"""
4141
if not self.api_key:
4242
# Try to get API key from environment
43-
if self.primary_model.startswith("claude-") or self.primary_model.startswith(
44-
"anthropic/"
45-
):
43+
if self.primary_model.startswith("claude-"):
4644
self.api_key = os.environ.get("ANTHROPIC_API_KEY")
4745
else:
4846
self.api_key = os.environ.get("OPENAI_API_KEY")
4947

5048
# Set default API base based on model type
5149
if self.api_base == "https://api.openai.com/v1":
52-
if self.primary_model.startswith("claude-") or self.primary_model.startswith(
53-
"anthropic/"
54-
):
50+
if self.primary_model.startswith("claude-"):
5551
self.api_base = "https://api.anthropic.com/v1"
5652

5753

0 commit comments

Comments
 (0)