langgraph-executor 0.0.1a0__py3-none-any.whl
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/__init__.py +1 -0
- langgraph_executor/common.py +395 -0
- langgraph_executor/example.py +29 -0
- langgraph_executor/execute_task.py +239 -0
- langgraph_executor/executor.py +341 -0
- langgraph_executor/extract_graph.py +178 -0
- langgraph_executor/info_logger.py +111 -0
- langgraph_executor/pb/__init__.py +0 -0
- langgraph_executor/pb/executor_pb2.py +79 -0
- langgraph_executor/pb/executor_pb2.pyi +415 -0
- langgraph_executor/pb/executor_pb2_grpc.py +321 -0
- langgraph_executor/pb/executor_pb2_grpc.pyi +150 -0
- langgraph_executor/pb/graph_pb2.py +55 -0
- langgraph_executor/pb/graph_pb2.pyi +230 -0
- langgraph_executor/pb/graph_pb2_grpc.py +24 -0
- langgraph_executor/pb/graph_pb2_grpc.pyi +17 -0
- langgraph_executor/pb/runtime_pb2.py +68 -0
- langgraph_executor/pb/runtime_pb2.pyi +364 -0
- langgraph_executor/pb/runtime_pb2_grpc.py +322 -0
- langgraph_executor/pb/runtime_pb2_grpc.pyi +151 -0
- langgraph_executor/pb/types_pb2.py +144 -0
- langgraph_executor/pb/types_pb2.pyi +1044 -0
- langgraph_executor/pb/types_pb2_grpc.py +24 -0
- langgraph_executor/pb/types_pb2_grpc.pyi +17 -0
- langgraph_executor/py.typed +0 -0
- langgraph_executor/server.py +186 -0
- langgraph_executor/setup.sh +29 -0
- langgraph_executor/stream_utils.py +96 -0
- langgraph_executor-0.0.1a0.dist-info/METADATA +14 -0
- langgraph_executor-0.0.1a0.dist-info/RECORD +31 -0
- langgraph_executor-0.0.1a0.dist-info/WHEEL +4 -0
@@ -0,0 +1,364 @@
|
|
1
|
+
"""
|
2
|
+
@generated by mypy-protobuf. Do not edit manually!
|
3
|
+
isort:skip_file
|
4
|
+
"""
|
5
|
+
|
6
|
+
import builtins
|
7
|
+
import collections.abc
|
8
|
+
import google.protobuf.descriptor
|
9
|
+
import google.protobuf.internal.containers
|
10
|
+
import google.protobuf.message
|
11
|
+
import google.protobuf.struct_pb2
|
12
|
+
import types_pb2
|
13
|
+
import typing
|
14
|
+
|
15
|
+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
16
|
+
|
17
|
+
@typing.final
|
18
|
+
class AddExecutorRequest(google.protobuf.message.Message):
|
19
|
+
"""Add executor request"""
|
20
|
+
|
21
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
22
|
+
|
23
|
+
ADDRESS_FIELD_NUMBER: builtins.int
|
24
|
+
address: builtins.str
|
25
|
+
def __init__(
|
26
|
+
self,
|
27
|
+
*,
|
28
|
+
address: builtins.str = ...,
|
29
|
+
) -> None: ...
|
30
|
+
def ClearField(self, field_name: typing.Literal["address", b"address"]) -> None: ...
|
31
|
+
|
32
|
+
global___AddExecutorRequest = AddExecutorRequest
|
33
|
+
|
34
|
+
@typing.final
|
35
|
+
class AddGraphRequest(google.protobuf.message.Message):
|
36
|
+
"""Add graph request"""
|
37
|
+
|
38
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
39
|
+
|
40
|
+
NAME_FIELD_NUMBER: builtins.int
|
41
|
+
CHECKPOINTER_FIELD_NUMBER: builtins.int
|
42
|
+
name: builtins.str
|
43
|
+
@property
|
44
|
+
def checkpointer(self) -> global___Checkpointer: ...
|
45
|
+
def __init__(
|
46
|
+
self,
|
47
|
+
*,
|
48
|
+
name: builtins.str = ...,
|
49
|
+
checkpointer: global___Checkpointer | None = ...,
|
50
|
+
) -> None: ...
|
51
|
+
def HasField(self, field_name: typing.Literal["checkpointer", b"checkpointer"]) -> builtins.bool: ...
|
52
|
+
def ClearField(self, field_name: typing.Literal["checkpointer", b"checkpointer", "name", b"name"]) -> None: ...
|
53
|
+
|
54
|
+
global___AddGraphRequest = AddGraphRequest
|
55
|
+
|
56
|
+
@typing.final
|
57
|
+
class Checkpointer(google.protobuf.message.Message):
|
58
|
+
"""Set checkpointer request"""
|
59
|
+
|
60
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
61
|
+
|
62
|
+
MEMORY_FIELD_NUMBER: builtins.int
|
63
|
+
POSTGRES_FIELD_NUMBER: builtins.int
|
64
|
+
@property
|
65
|
+
def memory(self) -> global___InMemoryCheckpointer: ...
|
66
|
+
@property
|
67
|
+
def postgres(self) -> global___PostgresCheckpointer: ...
|
68
|
+
def __init__(
|
69
|
+
self,
|
70
|
+
*,
|
71
|
+
memory: global___InMemoryCheckpointer | None = ...,
|
72
|
+
postgres: global___PostgresCheckpointer | None = ...,
|
73
|
+
) -> None: ...
|
74
|
+
def HasField(self, field_name: typing.Literal["memory", b"memory", "message", b"message", "postgres", b"postgres"]) -> builtins.bool: ...
|
75
|
+
def ClearField(self, field_name: typing.Literal["memory", b"memory", "message", b"message", "postgres", b"postgres"]) -> None: ...
|
76
|
+
def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["memory", "postgres"] | None: ...
|
77
|
+
|
78
|
+
global___Checkpointer = Checkpointer
|
79
|
+
|
80
|
+
@typing.final
|
81
|
+
class InMemoryCheckpointer(google.protobuf.message.Message):
|
82
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
83
|
+
|
84
|
+
def __init__(
|
85
|
+
self,
|
86
|
+
) -> None: ...
|
87
|
+
|
88
|
+
global___InMemoryCheckpointer = InMemoryCheckpointer
|
89
|
+
|
90
|
+
@typing.final
|
91
|
+
class PostgresCheckpointer(google.protobuf.message.Message):
|
92
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
93
|
+
|
94
|
+
CONNECTION_STRING_FIELD_NUMBER: builtins.int
|
95
|
+
connection_string: builtins.str
|
96
|
+
def __init__(
|
97
|
+
self,
|
98
|
+
*,
|
99
|
+
connection_string: builtins.str = ...,
|
100
|
+
) -> None: ...
|
101
|
+
def ClearField(self, field_name: typing.Literal["connection_string", b"connection_string"]) -> None: ...
|
102
|
+
|
103
|
+
global___PostgresCheckpointer = PostgresCheckpointer
|
104
|
+
|
105
|
+
@typing.final
|
106
|
+
class InvokeRequest(google.protobuf.message.Message):
|
107
|
+
"""Invoke request"""
|
108
|
+
|
109
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
110
|
+
|
111
|
+
GRAPH_NAME_FIELD_NUMBER: builtins.int
|
112
|
+
INPUT_FIELD_NUMBER: builtins.int
|
113
|
+
CONFIG_FIELD_NUMBER: builtins.int
|
114
|
+
RUN_OPTS_FIELD_NUMBER: builtins.int
|
115
|
+
CONTEXT_FIELD_NUMBER: builtins.int
|
116
|
+
graph_name: builtins.str
|
117
|
+
@property
|
118
|
+
def input(self) -> types_pb2.Value:
|
119
|
+
"""JSON-encoded input"""
|
120
|
+
|
121
|
+
@property
|
122
|
+
def config(self) -> types_pb2.RunnableConfig: ...
|
123
|
+
@property
|
124
|
+
def run_opts(self) -> global___RunOpts: ...
|
125
|
+
@property
|
126
|
+
def context(self) -> types_pb2.Context: ...
|
127
|
+
def __init__(
|
128
|
+
self,
|
129
|
+
*,
|
130
|
+
graph_name: builtins.str = ...,
|
131
|
+
input: types_pb2.Value | None = ...,
|
132
|
+
config: types_pb2.RunnableConfig | None = ...,
|
133
|
+
run_opts: global___RunOpts | None = ...,
|
134
|
+
context: types_pb2.Context | None = ...,
|
135
|
+
) -> None: ...
|
136
|
+
def HasField(self, field_name: typing.Literal["_context", b"_context", "_run_opts", b"_run_opts", "config", b"config", "context", b"context", "input", b"input", "run_opts", b"run_opts"]) -> builtins.bool: ...
|
137
|
+
def ClearField(self, field_name: typing.Literal["_context", b"_context", "_run_opts", b"_run_opts", "config", b"config", "context", b"context", "graph_name", b"graph_name", "input", b"input", "run_opts", b"run_opts"]) -> None: ...
|
138
|
+
@typing.overload
|
139
|
+
def WhichOneof(self, oneof_group: typing.Literal["_context", b"_context"]) -> typing.Literal["context"] | None: ...
|
140
|
+
@typing.overload
|
141
|
+
def WhichOneof(self, oneof_group: typing.Literal["_run_opts", b"_run_opts"]) -> typing.Literal["run_opts"] | None: ...
|
142
|
+
|
143
|
+
global___InvokeRequest = InvokeRequest
|
144
|
+
|
145
|
+
@typing.final
|
146
|
+
class StreamRequest(google.protobuf.message.Message):
|
147
|
+
"""Stream request"""
|
148
|
+
|
149
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
150
|
+
|
151
|
+
GRAPH_NAME_FIELD_NUMBER: builtins.int
|
152
|
+
INPUT_FIELD_NUMBER: builtins.int
|
153
|
+
CONFIG_FIELD_NUMBER: builtins.int
|
154
|
+
RUN_OPTS_FIELD_NUMBER: builtins.int
|
155
|
+
CONTEXT_FIELD_NUMBER: builtins.int
|
156
|
+
graph_name: builtins.str
|
157
|
+
@property
|
158
|
+
def input(self) -> types_pb2.Value:
|
159
|
+
"""JSON-encoded input"""
|
160
|
+
|
161
|
+
@property
|
162
|
+
def config(self) -> types_pb2.RunnableConfig: ...
|
163
|
+
@property
|
164
|
+
def run_opts(self) -> global___RunOpts: ...
|
165
|
+
@property
|
166
|
+
def context(self) -> types_pb2.Context: ...
|
167
|
+
def __init__(
|
168
|
+
self,
|
169
|
+
*,
|
170
|
+
graph_name: builtins.str = ...,
|
171
|
+
input: types_pb2.Value | None = ...,
|
172
|
+
config: types_pb2.RunnableConfig | None = ...,
|
173
|
+
run_opts: global___RunOpts | None = ...,
|
174
|
+
context: types_pb2.Context | None = ...,
|
175
|
+
) -> None: ...
|
176
|
+
def HasField(self, field_name: typing.Literal["_context", b"_context", "_run_opts", b"_run_opts", "config", b"config", "context", b"context", "input", b"input", "run_opts", b"run_opts"]) -> builtins.bool: ...
|
177
|
+
def ClearField(self, field_name: typing.Literal["_context", b"_context", "_run_opts", b"_run_opts", "config", b"config", "context", b"context", "graph_name", b"graph_name", "input", b"input", "run_opts", b"run_opts"]) -> None: ...
|
178
|
+
@typing.overload
|
179
|
+
def WhichOneof(self, oneof_group: typing.Literal["_context", b"_context"]) -> typing.Literal["context"] | None: ...
|
180
|
+
@typing.overload
|
181
|
+
def WhichOneof(self, oneof_group: typing.Literal["_run_opts", b"_run_opts"]) -> typing.Literal["run_opts"] | None: ...
|
182
|
+
|
183
|
+
global___StreamRequest = StreamRequest
|
184
|
+
|
185
|
+
@typing.final
|
186
|
+
class RunOpts(google.protobuf.message.Message):
|
187
|
+
"""Run options"""
|
188
|
+
|
189
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
190
|
+
|
191
|
+
OUTPUT_KEYS_FIELD_NUMBER: builtins.int
|
192
|
+
INTERRUPT_BEFORE_FIELD_NUMBER: builtins.int
|
193
|
+
INTERRUPT_AFTER_FIELD_NUMBER: builtins.int
|
194
|
+
DURABILITY_FIELD_NUMBER: builtins.int
|
195
|
+
DEBUG_FIELD_NUMBER: builtins.int
|
196
|
+
SUBGRAPHS_FIELD_NUMBER: builtins.int
|
197
|
+
STREAM_MODE_FIELD_NUMBER: builtins.int
|
198
|
+
durability: builtins.str
|
199
|
+
debug: builtins.bool
|
200
|
+
subgraphs: builtins.bool
|
201
|
+
@property
|
202
|
+
def output_keys(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
203
|
+
@property
|
204
|
+
def interrupt_before(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
205
|
+
@property
|
206
|
+
def interrupt_after(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
207
|
+
@property
|
208
|
+
def stream_mode(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
209
|
+
def __init__(
|
210
|
+
self,
|
211
|
+
*,
|
212
|
+
output_keys: collections.abc.Iterable[builtins.str] | None = ...,
|
213
|
+
interrupt_before: collections.abc.Iterable[builtins.str] | None = ...,
|
214
|
+
interrupt_after: collections.abc.Iterable[builtins.str] | None = ...,
|
215
|
+
durability: builtins.str | None = ...,
|
216
|
+
debug: builtins.bool | None = ...,
|
217
|
+
subgraphs: builtins.bool | None = ...,
|
218
|
+
stream_mode: collections.abc.Iterable[builtins.str] | None = ...,
|
219
|
+
) -> None: ...
|
220
|
+
def HasField(self, field_name: typing.Literal["_debug", b"_debug", "_durability", b"_durability", "_subgraphs", b"_subgraphs", "debug", b"debug", "durability", b"durability", "subgraphs", b"subgraphs"]) -> builtins.bool: ...
|
221
|
+
def ClearField(self, field_name: typing.Literal["_debug", b"_debug", "_durability", b"_durability", "_subgraphs", b"_subgraphs", "debug", b"debug", "durability", b"durability", "interrupt_after", b"interrupt_after", "interrupt_before", b"interrupt_before", "output_keys", b"output_keys", "stream_mode", b"stream_mode", "subgraphs", b"subgraphs"]) -> None: ...
|
222
|
+
@typing.overload
|
223
|
+
def WhichOneof(self, oneof_group: typing.Literal["_debug", b"_debug"]) -> typing.Literal["debug"] | None: ...
|
224
|
+
@typing.overload
|
225
|
+
def WhichOneof(self, oneof_group: typing.Literal["_durability", b"_durability"]) -> typing.Literal["durability"] | None: ...
|
226
|
+
@typing.overload
|
227
|
+
def WhichOneof(self, oneof_group: typing.Literal["_subgraphs", b"_subgraphs"]) -> typing.Literal["subgraphs"] | None: ...
|
228
|
+
|
229
|
+
global___RunOpts = RunOpts
|
230
|
+
|
231
|
+
@typing.final
|
232
|
+
class ChunkList(google.protobuf.message.Message):
|
233
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
234
|
+
|
235
|
+
CHUNKS_FIELD_NUMBER: builtins.int
|
236
|
+
@property
|
237
|
+
def chunks(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___OutputChunk]: ...
|
238
|
+
def __init__(
|
239
|
+
self,
|
240
|
+
*,
|
241
|
+
chunks: collections.abc.Iterable[global___OutputChunk] | None = ...,
|
242
|
+
) -> None: ...
|
243
|
+
def ClearField(self, field_name: typing.Literal["chunks", b"chunks"]) -> None: ...
|
244
|
+
|
245
|
+
global___ChunkList = ChunkList
|
246
|
+
|
247
|
+
@typing.final
|
248
|
+
class OutputChunk(google.protobuf.message.Message):
|
249
|
+
"""Output chunk"""
|
250
|
+
|
251
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
252
|
+
|
253
|
+
CHUNK_FIELD_NUMBER: builtins.int
|
254
|
+
ERROR_FIELD_NUMBER: builtins.int
|
255
|
+
CHUNK_LIST_FIELD_NUMBER: builtins.int
|
256
|
+
@property
|
257
|
+
def chunk(self) -> types_pb2.StreamChunk: ...
|
258
|
+
@property
|
259
|
+
def error(self) -> types_pb2.Value: ...
|
260
|
+
@property
|
261
|
+
def chunk_list(self) -> global___ChunkList: ...
|
262
|
+
def __init__(
|
263
|
+
self,
|
264
|
+
*,
|
265
|
+
chunk: types_pb2.StreamChunk | None = ...,
|
266
|
+
error: types_pb2.Value | None = ...,
|
267
|
+
chunk_list: global___ChunkList | None = ...,
|
268
|
+
) -> None: ...
|
269
|
+
def HasField(self, field_name: typing.Literal["chunk", b"chunk", "chunk_list", b"chunk_list", "error", b"error", "message", b"message"]) -> builtins.bool: ...
|
270
|
+
def ClearField(self, field_name: typing.Literal["chunk", b"chunk", "chunk_list", b"chunk_list", "error", b"error", "message", b"message"]) -> None: ...
|
271
|
+
def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["chunk", "error", "chunk_list"] | None: ...
|
272
|
+
|
273
|
+
global___OutputChunk = OutputChunk
|
274
|
+
|
275
|
+
@typing.final
|
276
|
+
class GetStateRequest(google.protobuf.message.Message):
|
277
|
+
"""get state"""
|
278
|
+
|
279
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
280
|
+
|
281
|
+
GRAPH_NAME_FIELD_NUMBER: builtins.int
|
282
|
+
CONFIG_FIELD_NUMBER: builtins.int
|
283
|
+
SUBGRAPHS_FIELD_NUMBER: builtins.int
|
284
|
+
graph_name: builtins.str
|
285
|
+
subgraphs: builtins.bool
|
286
|
+
@property
|
287
|
+
def config(self) -> types_pb2.RunnableConfig: ...
|
288
|
+
def __init__(
|
289
|
+
self,
|
290
|
+
*,
|
291
|
+
graph_name: builtins.str = ...,
|
292
|
+
config: types_pb2.RunnableConfig | None = ...,
|
293
|
+
subgraphs: builtins.bool = ...,
|
294
|
+
) -> None: ...
|
295
|
+
def HasField(self, field_name: typing.Literal["config", b"config"]) -> builtins.bool: ...
|
296
|
+
def ClearField(self, field_name: typing.Literal["config", b"config", "graph_name", b"graph_name", "subgraphs", b"subgraphs"]) -> None: ...
|
297
|
+
|
298
|
+
global___GetStateRequest = GetStateRequest
|
299
|
+
|
300
|
+
@typing.final
|
301
|
+
class GetStateResponse(google.protobuf.message.Message):
|
302
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
303
|
+
|
304
|
+
STATE_FIELD_NUMBER: builtins.int
|
305
|
+
@property
|
306
|
+
def state(self) -> types_pb2.StateSnapshot: ...
|
307
|
+
def __init__(
|
308
|
+
self,
|
309
|
+
*,
|
310
|
+
state: types_pb2.StateSnapshot | None = ...,
|
311
|
+
) -> None: ...
|
312
|
+
def HasField(self, field_name: typing.Literal["state", b"state"]) -> builtins.bool: ...
|
313
|
+
def ClearField(self, field_name: typing.Literal["state", b"state"]) -> None: ...
|
314
|
+
|
315
|
+
global___GetStateResponse = GetStateResponse
|
316
|
+
|
317
|
+
@typing.final
|
318
|
+
class GetStateHistoryRequest(google.protobuf.message.Message):
|
319
|
+
"""get state history"""
|
320
|
+
|
321
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
322
|
+
|
323
|
+
GRAPH_NAME_FIELD_NUMBER: builtins.int
|
324
|
+
CONFIG_FIELD_NUMBER: builtins.int
|
325
|
+
FILTER_FIELD_NUMBER: builtins.int
|
326
|
+
BEFORE_FIELD_NUMBER: builtins.int
|
327
|
+
LIMIT_FIELD_NUMBER: builtins.int
|
328
|
+
graph_name: builtins.str
|
329
|
+
limit: builtins.int
|
330
|
+
@property
|
331
|
+
def config(self) -> types_pb2.RunnableConfig: ...
|
332
|
+
@property
|
333
|
+
def filter(self) -> google.protobuf.struct_pb2.Struct: ...
|
334
|
+
@property
|
335
|
+
def before(self) -> types_pb2.RunnableConfig: ...
|
336
|
+
def __init__(
|
337
|
+
self,
|
338
|
+
*,
|
339
|
+
graph_name: builtins.str = ...,
|
340
|
+
config: types_pb2.RunnableConfig | None = ...,
|
341
|
+
filter: google.protobuf.struct_pb2.Struct | None = ...,
|
342
|
+
before: types_pb2.RunnableConfig | None = ...,
|
343
|
+
limit: builtins.int = ...,
|
344
|
+
) -> None: ...
|
345
|
+
def HasField(self, field_name: typing.Literal["before", b"before", "config", b"config", "filter", b"filter"]) -> builtins.bool: ...
|
346
|
+
def ClearField(self, field_name: typing.Literal["before", b"before", "config", b"config", "filter", b"filter", "graph_name", b"graph_name", "limit", b"limit"]) -> None: ...
|
347
|
+
|
348
|
+
global___GetStateHistoryRequest = GetStateHistoryRequest
|
349
|
+
|
350
|
+
@typing.final
|
351
|
+
class GetStateHistoryResponse(google.protobuf.message.Message):
|
352
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
353
|
+
|
354
|
+
HISTORY_FIELD_NUMBER: builtins.int
|
355
|
+
@property
|
356
|
+
def history(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[types_pb2.StateSnapshot]: ...
|
357
|
+
def __init__(
|
358
|
+
self,
|
359
|
+
*,
|
360
|
+
history: collections.abc.Iterable[types_pb2.StateSnapshot] | None = ...,
|
361
|
+
) -> None: ...
|
362
|
+
def ClearField(self, field_name: typing.Literal["history", b"history"]) -> None: ...
|
363
|
+
|
364
|
+
global___GetStateHistoryResponse = GetStateHistoryResponse
|
@@ -0,0 +1,322 @@
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
3
|
+
import grpc
|
4
|
+
import warnings
|
5
|
+
|
6
|
+
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
|
7
|
+
from . import runtime_pb2 as runtime__pb2
|
8
|
+
|
9
|
+
GRPC_GENERATED_VERSION = '1.74.0'
|
10
|
+
GRPC_VERSION = grpc.__version__
|
11
|
+
_version_not_supported = False
|
12
|
+
|
13
|
+
try:
|
14
|
+
from grpc._utilities import first_version_is_lower
|
15
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
16
|
+
except ImportError:
|
17
|
+
_version_not_supported = True
|
18
|
+
|
19
|
+
if _version_not_supported:
|
20
|
+
raise RuntimeError(
|
21
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
22
|
+
+ f' but the generated code in runtime_pb2_grpc.py depends on'
|
23
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
24
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
25
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
26
|
+
)
|
27
|
+
|
28
|
+
|
29
|
+
class LangGraphRuntimeStub(object):
|
30
|
+
"""Runtime service for executing graphs
|
31
|
+
"""
|
32
|
+
|
33
|
+
def __init__(self, channel):
|
34
|
+
"""Constructor.
|
35
|
+
|
36
|
+
Args:
|
37
|
+
channel: A grpc.Channel.
|
38
|
+
"""
|
39
|
+
self.AddExecutor = channel.unary_unary(
|
40
|
+
'/runtime.LangGraphRuntime/AddExecutor',
|
41
|
+
request_serializer=runtime__pb2.AddExecutorRequest.SerializeToString,
|
42
|
+
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
|
43
|
+
_registered_method=True)
|
44
|
+
self.AddGraph = channel.unary_unary(
|
45
|
+
'/runtime.LangGraphRuntime/AddGraph',
|
46
|
+
request_serializer=runtime__pb2.AddGraphRequest.SerializeToString,
|
47
|
+
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
|
48
|
+
_registered_method=True)
|
49
|
+
self.Invoke = channel.unary_unary(
|
50
|
+
'/runtime.LangGraphRuntime/Invoke',
|
51
|
+
request_serializer=runtime__pb2.InvokeRequest.SerializeToString,
|
52
|
+
response_deserializer=runtime__pb2.OutputChunk.FromString,
|
53
|
+
_registered_method=True)
|
54
|
+
self.Stream = channel.unary_stream(
|
55
|
+
'/runtime.LangGraphRuntime/Stream',
|
56
|
+
request_serializer=runtime__pb2.StreamRequest.SerializeToString,
|
57
|
+
response_deserializer=runtime__pb2.OutputChunk.FromString,
|
58
|
+
_registered_method=True)
|
59
|
+
self.GetState = channel.unary_unary(
|
60
|
+
'/runtime.LangGraphRuntime/GetState',
|
61
|
+
request_serializer=runtime__pb2.GetStateRequest.SerializeToString,
|
62
|
+
response_deserializer=runtime__pb2.GetStateResponse.FromString,
|
63
|
+
_registered_method=True)
|
64
|
+
self.GetStateHistory = channel.unary_unary(
|
65
|
+
'/runtime.LangGraphRuntime/GetStateHistory',
|
66
|
+
request_serializer=runtime__pb2.GetStateHistoryRequest.SerializeToString,
|
67
|
+
response_deserializer=runtime__pb2.GetStateHistoryResponse.FromString,
|
68
|
+
_registered_method=True)
|
69
|
+
|
70
|
+
|
71
|
+
class LangGraphRuntimeServicer(object):
|
72
|
+
"""Runtime service for executing graphs
|
73
|
+
"""
|
74
|
+
|
75
|
+
def AddExecutor(self, request, context):
|
76
|
+
"""Add executors to pool
|
77
|
+
"""
|
78
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
79
|
+
context.set_details('Method not implemented!')
|
80
|
+
raise NotImplementedError('Method not implemented!')
|
81
|
+
|
82
|
+
def AddGraph(self, request, context):
|
83
|
+
"""Add graph to runtime
|
84
|
+
"""
|
85
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
86
|
+
context.set_details('Method not implemented!')
|
87
|
+
raise NotImplementedError('Method not implemented!')
|
88
|
+
|
89
|
+
def Invoke(self, request, context):
|
90
|
+
"""Invoke a graph synchronously
|
91
|
+
"""
|
92
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
93
|
+
context.set_details('Method not implemented!')
|
94
|
+
raise NotImplementedError('Method not implemented!')
|
95
|
+
|
96
|
+
def Stream(self, request, context):
|
97
|
+
"""Stream graph execution
|
98
|
+
"""
|
99
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
100
|
+
context.set_details('Method not implemented!')
|
101
|
+
raise NotImplementedError('Method not implemented!')
|
102
|
+
|
103
|
+
def GetState(self, request, context):
|
104
|
+
"""State
|
105
|
+
"""
|
106
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
107
|
+
context.set_details('Method not implemented!')
|
108
|
+
raise NotImplementedError('Method not implemented!')
|
109
|
+
|
110
|
+
def GetStateHistory(self, request, context):
|
111
|
+
"""State history
|
112
|
+
"""
|
113
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
114
|
+
context.set_details('Method not implemented!')
|
115
|
+
raise NotImplementedError('Method not implemented!')
|
116
|
+
|
117
|
+
|
118
|
+
def add_LangGraphRuntimeServicer_to_server(servicer, server):
|
119
|
+
rpc_method_handlers = {
|
120
|
+
'AddExecutor': grpc.unary_unary_rpc_method_handler(
|
121
|
+
servicer.AddExecutor,
|
122
|
+
request_deserializer=runtime__pb2.AddExecutorRequest.FromString,
|
123
|
+
response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
|
124
|
+
),
|
125
|
+
'AddGraph': grpc.unary_unary_rpc_method_handler(
|
126
|
+
servicer.AddGraph,
|
127
|
+
request_deserializer=runtime__pb2.AddGraphRequest.FromString,
|
128
|
+
response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
|
129
|
+
),
|
130
|
+
'Invoke': grpc.unary_unary_rpc_method_handler(
|
131
|
+
servicer.Invoke,
|
132
|
+
request_deserializer=runtime__pb2.InvokeRequest.FromString,
|
133
|
+
response_serializer=runtime__pb2.OutputChunk.SerializeToString,
|
134
|
+
),
|
135
|
+
'Stream': grpc.unary_stream_rpc_method_handler(
|
136
|
+
servicer.Stream,
|
137
|
+
request_deserializer=runtime__pb2.StreamRequest.FromString,
|
138
|
+
response_serializer=runtime__pb2.OutputChunk.SerializeToString,
|
139
|
+
),
|
140
|
+
'GetState': grpc.unary_unary_rpc_method_handler(
|
141
|
+
servicer.GetState,
|
142
|
+
request_deserializer=runtime__pb2.GetStateRequest.FromString,
|
143
|
+
response_serializer=runtime__pb2.GetStateResponse.SerializeToString,
|
144
|
+
),
|
145
|
+
'GetStateHistory': grpc.unary_unary_rpc_method_handler(
|
146
|
+
servicer.GetStateHistory,
|
147
|
+
request_deserializer=runtime__pb2.GetStateHistoryRequest.FromString,
|
148
|
+
response_serializer=runtime__pb2.GetStateHistoryResponse.SerializeToString,
|
149
|
+
),
|
150
|
+
}
|
151
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
152
|
+
'runtime.LangGraphRuntime', rpc_method_handlers)
|
153
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
154
|
+
server.add_registered_method_handlers('runtime.LangGraphRuntime', rpc_method_handlers)
|
155
|
+
|
156
|
+
|
157
|
+
# This class is part of an EXPERIMENTAL API.
|
158
|
+
class LangGraphRuntime(object):
|
159
|
+
"""Runtime service for executing graphs
|
160
|
+
"""
|
161
|
+
|
162
|
+
@staticmethod
|
163
|
+
def AddExecutor(request,
|
164
|
+
target,
|
165
|
+
options=(),
|
166
|
+
channel_credentials=None,
|
167
|
+
call_credentials=None,
|
168
|
+
insecure=False,
|
169
|
+
compression=None,
|
170
|
+
wait_for_ready=None,
|
171
|
+
timeout=None,
|
172
|
+
metadata=None):
|
173
|
+
return grpc.experimental.unary_unary(
|
174
|
+
request,
|
175
|
+
target,
|
176
|
+
'/runtime.LangGraphRuntime/AddExecutor',
|
177
|
+
runtime__pb2.AddExecutorRequest.SerializeToString,
|
178
|
+
google_dot_protobuf_dot_empty__pb2.Empty.FromString,
|
179
|
+
options,
|
180
|
+
channel_credentials,
|
181
|
+
insecure,
|
182
|
+
call_credentials,
|
183
|
+
compression,
|
184
|
+
wait_for_ready,
|
185
|
+
timeout,
|
186
|
+
metadata,
|
187
|
+
_registered_method=True)
|
188
|
+
|
189
|
+
@staticmethod
|
190
|
+
def AddGraph(request,
|
191
|
+
target,
|
192
|
+
options=(),
|
193
|
+
channel_credentials=None,
|
194
|
+
call_credentials=None,
|
195
|
+
insecure=False,
|
196
|
+
compression=None,
|
197
|
+
wait_for_ready=None,
|
198
|
+
timeout=None,
|
199
|
+
metadata=None):
|
200
|
+
return grpc.experimental.unary_unary(
|
201
|
+
request,
|
202
|
+
target,
|
203
|
+
'/runtime.LangGraphRuntime/AddGraph',
|
204
|
+
runtime__pb2.AddGraphRequest.SerializeToString,
|
205
|
+
google_dot_protobuf_dot_empty__pb2.Empty.FromString,
|
206
|
+
options,
|
207
|
+
channel_credentials,
|
208
|
+
insecure,
|
209
|
+
call_credentials,
|
210
|
+
compression,
|
211
|
+
wait_for_ready,
|
212
|
+
timeout,
|
213
|
+
metadata,
|
214
|
+
_registered_method=True)
|
215
|
+
|
216
|
+
@staticmethod
|
217
|
+
def Invoke(request,
|
218
|
+
target,
|
219
|
+
options=(),
|
220
|
+
channel_credentials=None,
|
221
|
+
call_credentials=None,
|
222
|
+
insecure=False,
|
223
|
+
compression=None,
|
224
|
+
wait_for_ready=None,
|
225
|
+
timeout=None,
|
226
|
+
metadata=None):
|
227
|
+
return grpc.experimental.unary_unary(
|
228
|
+
request,
|
229
|
+
target,
|
230
|
+
'/runtime.LangGraphRuntime/Invoke',
|
231
|
+
runtime__pb2.InvokeRequest.SerializeToString,
|
232
|
+
runtime__pb2.OutputChunk.FromString,
|
233
|
+
options,
|
234
|
+
channel_credentials,
|
235
|
+
insecure,
|
236
|
+
call_credentials,
|
237
|
+
compression,
|
238
|
+
wait_for_ready,
|
239
|
+
timeout,
|
240
|
+
metadata,
|
241
|
+
_registered_method=True)
|
242
|
+
|
243
|
+
@staticmethod
|
244
|
+
def Stream(request,
|
245
|
+
target,
|
246
|
+
options=(),
|
247
|
+
channel_credentials=None,
|
248
|
+
call_credentials=None,
|
249
|
+
insecure=False,
|
250
|
+
compression=None,
|
251
|
+
wait_for_ready=None,
|
252
|
+
timeout=None,
|
253
|
+
metadata=None):
|
254
|
+
return grpc.experimental.unary_stream(
|
255
|
+
request,
|
256
|
+
target,
|
257
|
+
'/runtime.LangGraphRuntime/Stream',
|
258
|
+
runtime__pb2.StreamRequest.SerializeToString,
|
259
|
+
runtime__pb2.OutputChunk.FromString,
|
260
|
+
options,
|
261
|
+
channel_credentials,
|
262
|
+
insecure,
|
263
|
+
call_credentials,
|
264
|
+
compression,
|
265
|
+
wait_for_ready,
|
266
|
+
timeout,
|
267
|
+
metadata,
|
268
|
+
_registered_method=True)
|
269
|
+
|
270
|
+
@staticmethod
|
271
|
+
def GetState(request,
|
272
|
+
target,
|
273
|
+
options=(),
|
274
|
+
channel_credentials=None,
|
275
|
+
call_credentials=None,
|
276
|
+
insecure=False,
|
277
|
+
compression=None,
|
278
|
+
wait_for_ready=None,
|
279
|
+
timeout=None,
|
280
|
+
metadata=None):
|
281
|
+
return grpc.experimental.unary_unary(
|
282
|
+
request,
|
283
|
+
target,
|
284
|
+
'/runtime.LangGraphRuntime/GetState',
|
285
|
+
runtime__pb2.GetStateRequest.SerializeToString,
|
286
|
+
runtime__pb2.GetStateResponse.FromString,
|
287
|
+
options,
|
288
|
+
channel_credentials,
|
289
|
+
insecure,
|
290
|
+
call_credentials,
|
291
|
+
compression,
|
292
|
+
wait_for_ready,
|
293
|
+
timeout,
|
294
|
+
metadata,
|
295
|
+
_registered_method=True)
|
296
|
+
|
297
|
+
@staticmethod
|
298
|
+
def GetStateHistory(request,
|
299
|
+
target,
|
300
|
+
options=(),
|
301
|
+
channel_credentials=None,
|
302
|
+
call_credentials=None,
|
303
|
+
insecure=False,
|
304
|
+
compression=None,
|
305
|
+
wait_for_ready=None,
|
306
|
+
timeout=None,
|
307
|
+
metadata=None):
|
308
|
+
return grpc.experimental.unary_unary(
|
309
|
+
request,
|
310
|
+
target,
|
311
|
+
'/runtime.LangGraphRuntime/GetStateHistory',
|
312
|
+
runtime__pb2.GetStateHistoryRequest.SerializeToString,
|
313
|
+
runtime__pb2.GetStateHistoryResponse.FromString,
|
314
|
+
options,
|
315
|
+
channel_credentials,
|
316
|
+
insecure,
|
317
|
+
call_credentials,
|
318
|
+
compression,
|
319
|
+
wait_for_ready,
|
320
|
+
timeout,
|
321
|
+
metadata,
|
322
|
+
_registered_method=True)
|