Update app/chains.py
Browse files- 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=
|
| 49 |
| {
|
| 50 |
-
'context': lambda x:
|
| 51 |
-
|
| 52 |
-
'
|
| 53 |
}
|
| 54 |
-
|
|
| 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 |
|