Simplify api of context mngr channel

This commit is contained in:
Nuno Campos
2023-10-19 12:13:18 +01:00
parent 73a5ff0044
commit b07f8d87e5
4 changed files with 50 additions and 26 deletions
+1 -4
View File
@@ -6,7 +6,6 @@ from langchain.schema.runnable import RunnableLambda, RunnablePassthrough
from langchain.utils.html import extract_sub_links
from permchain import Pregel, channels
from permchain.pregel import PregelRead
# Load url with sync httpx client
@@ -107,9 +106,7 @@ def recursive_web_loader(
"next_urls": channels.UniqueInbox(str),
"documents": channels.Stream(Document),
"visited": channels.Set(str),
"client": channels.ContextManager(
httpx.Client | httpx.AsyncClient, httpx.Client, httpx.AsyncClient
),
"client": channels.ContextManager(httpx.Client, httpx.AsyncClient),
},
# this will accept a string as input
input="base_url",