Phoenix21 commited on
Commit
6eca139
·
verified ·
1 Parent(s): 735d15e

Update cleaner_chain.py

Browse files
Files changed (1) hide show
  1. cleaner_chain.py +3 -8
cleaner_chain.py CHANGED
@@ -6,16 +6,11 @@ from prompts import cleaner_prompt
6
 
7
  class CleanerChain(LLMChain):
8
  def merge(self, kb: str, web: str) -> str:
9
- return self.run({"kb_answer": kb, "web_answer": web})
 
10
 
11
  def get_cleaner_chain() -> CleanerChain:
12
- """
13
- Builds the 'CleanerChain' that merges CSV answer + web result.
14
- """
15
- chat_groq_model = ChatGroq(
16
- model="Gemma2-9b-It",
17
- groq_api_key=os.environ["GROQ_API_KEY"]
18
- )
19
  chain = CleanerChain(
20
  llm=chat_groq_model,
21
  prompt=cleaner_prompt
 
6
 
7
  class CleanerChain(LLMChain):
8
  def merge(self, kb: str, web: str) -> str:
9
+ # Use invoke() instead of run() to comply with new LangChain practices
10
+ return self.invoke({"kb_answer": kb, "web_answer": web})
11
 
12
  def get_cleaner_chain() -> CleanerChain:
13
+ chat_groq_model = ChatGroq(model="Gemma2-9b-It", groq_api_key=os.environ["GROQ_API_KEY"])
 
 
 
 
 
 
14
  chain = CleanerChain(
15
  llm=chat_groq_model,
16
  prompt=cleaner_prompt