wang16888 commited on
Commit
47de850
·
verified ·
1 Parent(s): 3160616

Update app/chains.py

Browse files
Files changed (1) hide show
  1. app/chains.py +5 -6
app/chains.py CHANGED
@@ -45,14 +45,13 @@ standalone_chain = standalone_prompt_formatted | llm
45
  generation_chain = rag_prompt_formatted | llm
46
 
47
  rag_chain = (
48
- RunnablePassthrough.assign(new_question=standalone_prompt_formatted | llm)
49
  | {
50
- 'context': lambda x: format_context(data_indexer.search(x['new_question'], hybrid_search=x['hybrid_search'])),
51
- 'standalone_question': lambda x: x['new_question'],
52
- 'test': lambda x : print(x)
53
  }
54
- | rag_prompt_formatted
55
- | llm
56
  ).with_types(input_type=schemas.RagInput)
57
 
58
 
 
45
  generation_chain = rag_prompt_formatted | llm
46
 
47
  rag_chain = (
48
+ RunnablePassthrough.assign(new_question=standalone_chain)
49
  | {
50
+ 'context': lambda x:
51
+ format_context(search(x['new_question'])),
52
+ 'standalone_question': lambda x: x['new_question']
53
  }
54
+ | generation_chain
 
55
  ).with_types(input_type=schemas.RagInput)
56
 
57