From 6e3d86f2796fb6cdeaed58e127cdb967146a9679 Mon Sep 17 00:00:00 2001 From: Kye Date: Wed, 5 Jul 2023 23:17:01 -0400 Subject: [PATCH] The root cause of this error is that the initialize_tools method in the Swarms class is passing an instance of OpenAI to the load_qa_with_sources_chain function, which then passes it to the LLMChain constructor. The LLMChain constructor expects a dictionary for the llm parameter, but it's receiving an instance of OpenAI instead. --- swarms/swarms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swarms/swarms.py b/swarms/swarms.py index 7496036d..8ba4689e 100644 --- a/swarms/swarms.py +++ b/swarms/swarms.py @@ -13,7 +13,8 @@ class Swarms: # Initialize language model return llm_class(openai_api_key=self.openai_api_key) - def initialize_tools(self, llm): + def initialize_tools(self, llm_class): + llm = self.initialize_llm(llm_class) # Initialize tools web_search = DuckDuckGoSearchRun() tools = [