langgraph-executor 0.0.1a2__tar.gz → 0.0.1a3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/PKG-INFO +1 -1
- langgraph_executor-0.0.1a3/langgraph_executor/__init__.py +1 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/executor_base.py +27 -3
- langgraph_executor-0.0.1a2/langgraph_executor/__init__.py +0 -1
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/.gitignore +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/README.md +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/common.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/example.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/execute_task.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/executor.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/extract_graph.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/info_logger.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/__init__.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/executor_pb2.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/executor_pb2.pyi +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/executor_pb2_grpc.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/executor_pb2_grpc.pyi +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/graph_pb2.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/graph_pb2.pyi +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/graph_pb2_grpc.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/graph_pb2_grpc.pyi +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/runtime_pb2.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/runtime_pb2.pyi +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/runtime_pb2_grpc.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/runtime_pb2_grpc.pyi +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/types_pb2.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/types_pb2.pyi +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/types_pb2_grpc.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/types_pb2_grpc.pyi +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/py.typed +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/server.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/setup.sh +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/stream_utils.py +0 -0
- {langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/pyproject.toml +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.0.1a3"
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/executor_base.py
RENAMED
@@ -65,6 +65,15 @@ class LangGraphExecutorServicer(executor_pb2_grpc.LangGraphExecutorServicer):
|
|
65
65
|
subgraph_map: dict[str, str],
|
66
66
|
get_graph: GetGraph,
|
67
67
|
logger: Logger | None = None,
|
68
|
+
on_message: Callable[
|
69
|
+
[
|
70
|
+
BaseMessageChunk,
|
71
|
+
dict[str, Any],
|
72
|
+
],
|
73
|
+
None,
|
74
|
+
]
|
75
|
+
| None = None,
|
76
|
+
on_custom: Callable[[Any], None] | None = None,
|
68
77
|
):
|
69
78
|
"""Initialize the servicer with compiled graphs.
|
70
79
|
|
@@ -82,6 +91,8 @@ class LangGraphExecutorServicer(executor_pb2_grpc.LangGraphExecutorServicer):
|
|
82
91
|
self.get_graph = get_graph
|
83
92
|
_patch_base_message_with_ids()
|
84
93
|
self._graph_definition_cache: dict[str, executor_pb2.GetGraphResponse] = {}
|
94
|
+
self.on_message = on_message
|
95
|
+
self.on_custom = on_custom
|
85
96
|
|
86
97
|
async def ListGraphs(
|
87
98
|
self, request: Any, context: grpc.aio.ServicerContext
|
@@ -181,7 +192,9 @@ class LangGraphExecutorServicer(executor_pb2_grpc.LangGraphExecutorServicer):
|
|
181
192
|
stream_queue = asyncio.Queue()
|
182
193
|
|
183
194
|
custom_stream_writer = (
|
184
|
-
_create_custom_stream_writer(
|
195
|
+
_create_custom_stream_writer(
|
196
|
+
stream_queue, self.logger, on_custom=self.on_custom
|
197
|
+
)
|
185
198
|
if stream_custom
|
186
199
|
else None
|
187
200
|
)
|
@@ -196,6 +209,7 @@ class LangGraphExecutorServicer(executor_pb2_grpc.LangGraphExecutorServicer):
|
|
196
209
|
stream_callback,
|
197
210
|
logger=self.logger,
|
198
211
|
stream_queue=stream_queue,
|
212
|
+
on_message=self.on_message,
|
199
213
|
),
|
200
214
|
task.id,
|
201
215
|
)
|
@@ -362,13 +376,16 @@ async def _run_task(
|
|
362
376
|
|
363
377
|
def stream_callback(
|
364
378
|
message: BaseMessageChunk,
|
365
|
-
metadata: dict,
|
379
|
+
metadata: dict[str, Any],
|
366
380
|
*,
|
367
381
|
logger: Logger,
|
368
382
|
stream_queue: asyncio.Queue[executor_pb2.ExecuteTaskResponse],
|
383
|
+
on_message: Callable[[BaseMessageChunk, dict[str, Any]], None] | None = None,
|
369
384
|
):
|
370
385
|
"""Callback to capture stream chunks and queue them."""
|
371
386
|
try:
|
387
|
+
if on_message is not None:
|
388
|
+
on_message(message, metadata)
|
372
389
|
stream_queue.put_nowait(
|
373
390
|
executor_pb2.ExecuteTaskResponse(
|
374
391
|
message_or_message_chunk=_extract_output_message(message)
|
@@ -378,12 +395,19 @@ def stream_callback(
|
|
378
395
|
logger.warning(f"Failed to create stream chunk: {e}", exc_info=True)
|
379
396
|
|
380
397
|
|
381
|
-
def _create_custom_stream_writer(
|
398
|
+
def _create_custom_stream_writer(
|
399
|
+
stream_queue: asyncio.Queue[Any],
|
400
|
+
logger: Logger,
|
401
|
+
*,
|
402
|
+
on_custom: Callable[[Any], None] | None = None,
|
403
|
+
):
|
382
404
|
"""Create a proper stream_writer function for custom mode (like langgraph does)."""
|
383
405
|
|
384
406
|
def stream_writer(content):
|
385
407
|
"""Custom stream writer that creates CustomStreamEvent messages."""
|
386
408
|
try:
|
409
|
+
if on_custom is not None:
|
410
|
+
on_custom(content)
|
387
411
|
# Create payload struct (like langgraph does)
|
388
412
|
payload = Struct()
|
389
413
|
if isinstance(content, str):
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.0.1a2"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/execute_task.py
RENAMED
File without changes
|
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/extract_graph.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/executor_pb2.py
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/executor_pb2.pyi
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/executor_pb2_grpc.py
RENAMED
File without changes
|
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/graph_pb2.py
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/graph_pb2.pyi
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/graph_pb2_grpc.py
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/graph_pb2_grpc.pyi
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/runtime_pb2.py
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/runtime_pb2.pyi
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/runtime_pb2_grpc.py
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/runtime_pb2_grpc.pyi
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/types_pb2.py
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/types_pb2.pyi
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/types_pb2_grpc.py
RENAMED
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/pb/types_pb2_grpc.pyi
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langgraph_executor-0.0.1a2 → langgraph_executor-0.0.1a3}/langgraph_executor/stream_utils.py
RENAMED
File without changes
|
File without changes
|