From 3d5beb311a9143f7a6673c6080429caaeccd0c22 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Sat, 17 Feb 2024 18:35:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20Update=20dependencies=20and=20de?= =?UTF-8?q?faults?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/rag_with_deps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/rag_with_deps.py b/examples/rag_with_deps.py index a2dcd3e..8465108 100644 --- a/examples/rag_with_deps.py +++ b/examples/rag_with_deps.py @@ -3,8 +3,8 @@ from funcchain.syntax import chain, runnable from funcchain.syntax.params import Depends +from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.vectorstores.faiss import FAISS -from langchain_openai.embeddings import OpenAIEmbeddings retriever = FAISS.from_texts( [ @@ -21,7 +21,7 @@ @runnable def poem_with_retrieval( topic: str, - context: Annotated[str, Depends(itemgetter("topic") | retriever)] = "N/A", + context: Annotated[str, Depends(itemgetter("topic") | retriever)], ) -> str: """ Generate a poem about the topic with the given context.