File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 11"""Version information for openevolve package."""
22
3- __version__ = "0.2.21 "
3+ __version__ = "0.2.22 "
Original file line number Diff line number Diff line change @@ -40,7 +40,10 @@ def __init__(
4040
4141 def _get_client_model (self , model_name : str ) -> tuple [openai .OpenAI , str ]:
4242 if model_name in OPENAI_EMBEDDING_MODELS :
43- client = openai .OpenAI ()
43+ # Use OPENAI_EMBEDDING_API_KEY if set, otherwise fall back to OPENAI_API_KEY
44+ # This allows users to use OpenRouter for LLMs while using OpenAI for embeddings
45+ embedding_api_key = os .getenv ("OPENAI_EMBEDDING_API_KEY" ) or os .getenv ("OPENAI_API_KEY" )
46+ client = openai .OpenAI (api_key = embedding_api_key )
4447 model_to_use = model_name
4548 elif model_name in AZURE_EMBEDDING_MODELS :
4649 # get rid of the azure- prefix
You can’t perform that action at this time.
0 commit comments