mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-08 18:57:52 +02:00
Support latest langchain master
This commit is contained in:
+3
-2
@@ -20,7 +20,8 @@ from typing import (
|
||||
from langchain.callbacks.manager import CallbackManager
|
||||
from langchain.load.dump import dumpd
|
||||
from langchain.load.serializable import Serializable
|
||||
from langchain.schema.runnable import Runnable, RunnableConfig, _patch_config
|
||||
from langchain.schema.runnable import Runnable, RunnableConfig
|
||||
from langchain.schema.runnable.base import patch_config
|
||||
|
||||
from permchain.connection import PubSubConnection
|
||||
from permchain.topic import INPUT_TOPIC, OUTPUT_TOPIC, RunnableSubscriber
|
||||
@@ -144,7 +145,7 @@ class PubSub(Serializable, Runnable[Any, Any], ABC):
|
||||
process.invoke,
|
||||
value,
|
||||
config={
|
||||
**_patch_config(
|
||||
**patch_config(
|
||||
config, run_manager.get_child(process.topic.name)
|
||||
),
|
||||
"send": send,
|
||||
|
||||
+2
-5
@@ -19,9 +19,8 @@ from langchain.schema.runnable import (
|
||||
RunnableConfig,
|
||||
RunnablePassthrough,
|
||||
RunnableSequence,
|
||||
Other,
|
||||
_coerce_to_runnable,
|
||||
)
|
||||
from langchain.schema.runnable.base import Other, coerce_to_runnable
|
||||
from pydantic import Field
|
||||
|
||||
T = TypeVar("T")
|
||||
@@ -81,9 +80,7 @@ class RunnableSubscriber(RunnableBinding[T, Any]):
|
||||
| Mapping[str, Runnable[Any, Other] | Callable[[Any], Other]],
|
||||
) -> RunnableSequence[T, Other]:
|
||||
if isinstance(self.bound, RunnablePassthrough):
|
||||
return RunnableSubscriber(
|
||||
topic=self.topic, bound=_coerce_to_runnable(other)
|
||||
)
|
||||
return RunnableSubscriber(topic=self.topic, bound=coerce_to_runnable(other))
|
||||
else:
|
||||
return RunnableSubscriber(topic=self.topic, bound=self.bound | other)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user