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.

pull/160/head
Kye 2 years ago
parent a68c53c55d
commit 6e3d86f279

@ -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 = [

Loading…
Cancel
Save