-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
013e255
commit e619b21
Showing
3 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
# agi | ||
langchain based agi | ||
|
||
## RAG | ||
- history_chain = RunnableLambda(self._enter_history, self._aenter_history).with_config(run_name="load_history") | ||
- history_chain = RunnablePassthrough.assign(**{"chat_history": history_chain}).with_config(run_name="insert_history") | ||
- retrieval_docs = (lambda x: x["input"]) | retriever | ||
- retriever = (lambda x: x["input"]) | retriever or prompt | llm | StrOutputParser() | retriever, run_name="chat_retriever_chain" | ||
- context=retrieval_docs.with_config(run_name="retrieve_documents") | ||
- "context": format_docs run_name="format_inputs" | ||
- answer = "context" | prompt | llm | _output_parser run_name="stuff_documents_chain" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters