From ae7ed31386c10cee1683419a4ab45562830bf8eb Mon Sep 17 00:00:00 2001 From: Amir Karimi <35371206+AMK9978@users.noreply.github.com> Date: Tue, 18 Apr 2023 07:35:48 +0330 Subject: [PATCH] Fix redundancy check about config_type in AGENT_TO_CLASS (#2934) Fix of issue #2874 --- langchain/agents/loading.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/langchain/agents/loading.py b/langchain/agents/loading.py index fffe4997..e071b783 100644 --- a/langchain/agents/loading.py +++ b/langchain/agents/loading.py @@ -37,8 +37,6 @@ def _load_agent_from_tools( if config_type not in AGENT_TO_CLASS: raise ValueError(f"Loading {config_type} agent not supported") - if config_type not in AGENT_TO_CLASS: - raise ValueError(f"Loading {config_type} agent not supported") agent_cls = AGENT_TO_CLASS[config_type] combined_config = {**config, **kwargs} return agent_cls.from_llm_and_tools(llm, tools, **combined_config)