Skip to content

Commit

Permalink
fix bug where empty string is used as apikey #1415
Browse files Browse the repository at this point in the history
  • Loading branch information
victordibia committed Jan 26, 2024
1 parent b1201b6 commit bdfd75e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion samples/apps/autogen-studio/autogenstudio/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
VERSION = "0.0.35a"
VERSION = "0.0.37a"
__version__ = VERSION
__db_version__ = "0.0.1"

APP_NAME = "autogenstudio"
6 changes: 4 additions & 2 deletions samples/apps/autogen-studio/autogenstudio/workflowmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ def sanitize_agent_spec(self, agent_spec: AgentFlowSpec) -> AgentFlowSpec:
valid_keys = ["model", "base_url",
"api_key", "api_type", "api_version"]
# only add key if value is not None
config_list.append(
{k: v for k, v in llm.items() if v is not None and k in valid_keys})
sanitized_llm = {k: v for k, v in llm.items() if (
v is not None and v != "") and k in valid_keys}
config_list.append(sanitized_llm)
print(" >> llm config", sanitized_llm)
agent_spec.config.llm_config.config_list = config_list
if agent_spec.config.code_execution_config is not False:
code_execution_config = agent_spec.config.code_execution_config or {}
Expand Down

0 comments on commit bdfd75e

Please sign in to comment.