Skip to content

Commit

Permalink
Merge pull request #46 from ag2ai/captain1
Browse files Browse the repository at this point in the history
Captain Agent PR part 2.
  • Loading branch information
qingyun-wu authored Nov 20, 2024
2 parents 6ea6d28 + 041824c commit 6abff18
Show file tree
Hide file tree
Showing 5 changed files with 1,068 additions and 6 deletions.
8 changes: 4 additions & 4 deletions autogen/agentchat/contrib/agent_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def _create_agent(
description = agent_config["description"]

# Path to the customize **ConversableAgent** class.
model_path = agent_config.get("model_path", None)
agent_path = agent_config.get("agent_path", None)
filter_dict = {}
if len(model_name_or_hf_repo) > 0:
filter_dict.update({"model": model_name_or_hf_repo})
Expand Down Expand Up @@ -304,8 +304,8 @@ def _create_agent(
)

model_class = autogen.AssistantAgent
if model_path:
module_path, model_class_name = model_path.replace("/", ".").rsplit(".", 1)
if agent_path:
module_path, model_class_name = agent_path.replace("/", ".").rsplit(".", 1)
module = importlib.import_module(module_path)
model_class = getattr(module, model_class_name)
if not issubclass(model_class, autogen.ConversableAgent):
Expand All @@ -315,7 +315,7 @@ def _create_agent(
additional_config = {
k: v
for k, v in agent_config.items()
if k not in ["model", "name", "system_message", "description", "model_path", "tags"]
if k not in ["model", "name", "system_message", "description", "agent_path", "tags"]
}
agent = model_class(
name=agent_name, llm_config=current_config.copy(), description=description, **additional_config
Expand Down
Loading

0 comments on commit 6abff18

Please sign in to comment.