node_service_pb2_grpc.py 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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. from . import node_service_pb2 as node__service__pb2
  6. GRPC_GENERATED_VERSION = '1.68.0'
  7. GRPC_VERSION = grpc.__version__
  8. _version_not_supported = False
  9. try:
  10. from grpc._utilities import first_version_is_lower
  11. _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
  12. except ImportError:
  13. _version_not_supported = True
  14. if _version_not_supported:
  15. raise RuntimeError(
  16. f'The grpc package installed is at version {GRPC_VERSION},'
  17. + f' but the generated code in node_service_pb2_grpc.py depends on'
  18. + f' grpcio>={GRPC_GENERATED_VERSION}.'
  19. + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
  20. + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
  21. )
  22. class NodeServiceStub(object):
  23. """Missing associated documentation comment in .proto file."""
  24. def __init__(self, channel):
  25. """Constructor.
  26. Args:
  27. channel: A grpc.Channel.
  28. """
  29. self.SendPrompt = channel.unary_unary(
  30. '/node_service.NodeService/SendPrompt',
  31. request_serializer=node__service__pb2.PromptRequest.SerializeToString,
  32. response_deserializer=node__service__pb2.Tensor.FromString,
  33. _registered_method=True)
  34. self.SendTensor = channel.unary_unary(
  35. '/node_service.NodeService/SendTensor',
  36. request_serializer=node__service__pb2.TensorRequest.SerializeToString,
  37. response_deserializer=node__service__pb2.Tensor.FromString,
  38. _registered_method=True)
  39. self.SendExample = channel.unary_unary(
  40. '/node_service.NodeService/SendExample',
  41. request_serializer=node__service__pb2.ExampleRequest.SerializeToString,
  42. response_deserializer=node__service__pb2.Loss.FromString,
  43. _registered_method=True)
  44. self.CollectTopology = channel.unary_unary(
  45. '/node_service.NodeService/CollectTopology',
  46. request_serializer=node__service__pb2.CollectTopologyRequest.SerializeToString,
  47. response_deserializer=node__service__pb2.Topology.FromString,
  48. _registered_method=True)
  49. self.SendNewToken = channel.unary_unary(
  50. '/node_service.NodeService/SendNewToken',
  51. request_serializer=node__service__pb2.SendNewTokenRequest.SerializeToString,
  52. response_deserializer=node__service__pb2.Empty.FromString,
  53. _registered_method=True)
  54. self.SendOpaqueStatus = channel.unary_unary(
  55. '/node_service.NodeService/SendOpaqueStatus',
  56. request_serializer=node__service__pb2.SendOpaqueStatusRequest.SerializeToString,
  57. response_deserializer=node__service__pb2.Empty.FromString,
  58. _registered_method=True)
  59. self.HealthCheck = channel.unary_unary(
  60. '/node_service.NodeService/HealthCheck',
  61. request_serializer=node__service__pb2.HealthCheckRequest.SerializeToString,
  62. response_deserializer=node__service__pb2.HealthCheckResponse.FromString,
  63. _registered_method=True)
  64. class NodeServiceServicer(object):
  65. """Missing associated documentation comment in .proto file."""
  66. def SendPrompt(self, request, context):
  67. """Missing associated documentation comment in .proto file."""
  68. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  69. context.set_details('Method not implemented!')
  70. raise NotImplementedError('Method not implemented!')
  71. def SendTensor(self, request, context):
  72. """Missing associated documentation comment in .proto file."""
  73. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  74. context.set_details('Method not implemented!')
  75. raise NotImplementedError('Method not implemented!')
  76. def SendExample(self, request, context):
  77. """Missing associated documentation comment in .proto file."""
  78. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  79. context.set_details('Method not implemented!')
  80. raise NotImplementedError('Method not implemented!')
  81. def CollectTopology(self, request, context):
  82. """Missing associated documentation comment in .proto file."""
  83. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  84. context.set_details('Method not implemented!')
  85. raise NotImplementedError('Method not implemented!')
  86. def SendNewToken(self, request, context):
  87. """Missing associated documentation comment in .proto file."""
  88. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  89. context.set_details('Method not implemented!')
  90. raise NotImplementedError('Method not implemented!')
  91. def SendOpaqueStatus(self, request, context):
  92. """Missing associated documentation comment in .proto file."""
  93. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  94. context.set_details('Method not implemented!')
  95. raise NotImplementedError('Method not implemented!')
  96. def HealthCheck(self, request, context):
  97. """Missing associated documentation comment in .proto file."""
  98. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  99. context.set_details('Method not implemented!')
  100. raise NotImplementedError('Method not implemented!')
  101. def add_NodeServiceServicer_to_server(servicer, server):
  102. rpc_method_handlers = {
  103. 'SendPrompt': grpc.unary_unary_rpc_method_handler(
  104. servicer.SendPrompt,
  105. request_deserializer=node__service__pb2.PromptRequest.FromString,
  106. response_serializer=node__service__pb2.Tensor.SerializeToString,
  107. ),
  108. 'SendTensor': grpc.unary_unary_rpc_method_handler(
  109. servicer.SendTensor,
  110. request_deserializer=node__service__pb2.TensorRequest.FromString,
  111. response_serializer=node__service__pb2.Tensor.SerializeToString,
  112. ),
  113. 'SendExample': grpc.unary_unary_rpc_method_handler(
  114. servicer.SendExample,
  115. request_deserializer=node__service__pb2.ExampleRequest.FromString,
  116. response_serializer=node__service__pb2.Loss.SerializeToString,
  117. ),
  118. 'CollectTopology': grpc.unary_unary_rpc_method_handler(
  119. servicer.CollectTopology,
  120. request_deserializer=node__service__pb2.CollectTopologyRequest.FromString,
  121. response_serializer=node__service__pb2.Topology.SerializeToString,
  122. ),
  123. 'SendNewToken': grpc.unary_unary_rpc_method_handler(
  124. servicer.SendNewToken,
  125. request_deserializer=node__service__pb2.SendNewTokenRequest.FromString,
  126. response_serializer=node__service__pb2.Empty.SerializeToString,
  127. ),
  128. 'SendOpaqueStatus': grpc.unary_unary_rpc_method_handler(
  129. servicer.SendOpaqueStatus,
  130. request_deserializer=node__service__pb2.SendOpaqueStatusRequest.FromString,
  131. response_serializer=node__service__pb2.Empty.SerializeToString,
  132. ),
  133. 'HealthCheck': grpc.unary_unary_rpc_method_handler(
  134. servicer.HealthCheck,
  135. request_deserializer=node__service__pb2.HealthCheckRequest.FromString,
  136. response_serializer=node__service__pb2.HealthCheckResponse.SerializeToString,
  137. ),
  138. }
  139. generic_handler = grpc.method_handlers_generic_handler(
  140. 'node_service.NodeService', rpc_method_handlers)
  141. server.add_generic_rpc_handlers((generic_handler,))
  142. server.add_registered_method_handlers('node_service.NodeService', rpc_method_handlers)
  143. # This class is part of an EXPERIMENTAL API.
  144. class NodeService(object):
  145. """Missing associated documentation comment in .proto file."""
  146. @staticmethod
  147. def SendPrompt(request,
  148. target,
  149. options=(),
  150. channel_credentials=None,
  151. call_credentials=None,
  152. insecure=False,
  153. compression=None,
  154. wait_for_ready=None,
  155. timeout=None,
  156. metadata=None):
  157. return grpc.experimental.unary_unary(
  158. request,
  159. target,
  160. '/node_service.NodeService/SendPrompt',
  161. node__service__pb2.PromptRequest.SerializeToString,
  162. node__service__pb2.Tensor.FromString,
  163. options,
  164. channel_credentials,
  165. insecure,
  166. call_credentials,
  167. compression,
  168. wait_for_ready,
  169. timeout,
  170. metadata,
  171. _registered_method=True)
  172. @staticmethod
  173. def SendTensor(request,
  174. target,
  175. options=(),
  176. channel_credentials=None,
  177. call_credentials=None,
  178. insecure=False,
  179. compression=None,
  180. wait_for_ready=None,
  181. timeout=None,
  182. metadata=None):
  183. return grpc.experimental.unary_unary(
  184. request,
  185. target,
  186. '/node_service.NodeService/SendTensor',
  187. node__service__pb2.TensorRequest.SerializeToString,
  188. node__service__pb2.Tensor.FromString,
  189. options,
  190. channel_credentials,
  191. insecure,
  192. call_credentials,
  193. compression,
  194. wait_for_ready,
  195. timeout,
  196. metadata,
  197. _registered_method=True)
  198. @staticmethod
  199. def SendExample(request,
  200. target,
  201. options=(),
  202. channel_credentials=None,
  203. call_credentials=None,
  204. insecure=False,
  205. compression=None,
  206. wait_for_ready=None,
  207. timeout=None,
  208. metadata=None):
  209. return grpc.experimental.unary_unary(
  210. request,
  211. target,
  212. '/node_service.NodeService/SendExample',
  213. node__service__pb2.ExampleRequest.SerializeToString,
  214. node__service__pb2.Loss.FromString,
  215. options,
  216. channel_credentials,
  217. insecure,
  218. call_credentials,
  219. compression,
  220. wait_for_ready,
  221. timeout,
  222. metadata,
  223. _registered_method=True)
  224. @staticmethod
  225. def CollectTopology(request,
  226. target,
  227. options=(),
  228. channel_credentials=None,
  229. call_credentials=None,
  230. insecure=False,
  231. compression=None,
  232. wait_for_ready=None,
  233. timeout=None,
  234. metadata=None):
  235. return grpc.experimental.unary_unary(
  236. request,
  237. target,
  238. '/node_service.NodeService/CollectTopology',
  239. node__service__pb2.CollectTopologyRequest.SerializeToString,
  240. node__service__pb2.Topology.FromString,
  241. options,
  242. channel_credentials,
  243. insecure,
  244. call_credentials,
  245. compression,
  246. wait_for_ready,
  247. timeout,
  248. metadata,
  249. _registered_method=True)
  250. @staticmethod
  251. def SendNewToken(request,
  252. target,
  253. options=(),
  254. channel_credentials=None,
  255. call_credentials=None,
  256. insecure=False,
  257. compression=None,
  258. wait_for_ready=None,
  259. timeout=None,
  260. metadata=None):
  261. return grpc.experimental.unary_unary(
  262. request,
  263. target,
  264. '/node_service.NodeService/SendNewToken',
  265. node__service__pb2.SendNewTokenRequest.SerializeToString,
  266. node__service__pb2.Empty.FromString,
  267. options,
  268. channel_credentials,
  269. insecure,
  270. call_credentials,
  271. compression,
  272. wait_for_ready,
  273. timeout,
  274. metadata,
  275. _registered_method=True)
  276. @staticmethod
  277. def SendOpaqueStatus(request,
  278. target,
  279. options=(),
  280. channel_credentials=None,
  281. call_credentials=None,
  282. insecure=False,
  283. compression=None,
  284. wait_for_ready=None,
  285. timeout=None,
  286. metadata=None):
  287. return grpc.experimental.unary_unary(
  288. request,
  289. target,
  290. '/node_service.NodeService/SendOpaqueStatus',
  291. node__service__pb2.SendOpaqueStatusRequest.SerializeToString,
  292. node__service__pb2.Empty.FromString,
  293. options,
  294. channel_credentials,
  295. insecure,
  296. call_credentials,
  297. compression,
  298. wait_for_ready,
  299. timeout,
  300. metadata,
  301. _registered_method=True)
  302. @staticmethod
  303. def HealthCheck(request,
  304. target,
  305. options=(),
  306. channel_credentials=None,
  307. call_credentials=None,
  308. insecure=False,
  309. compression=None,
  310. wait_for_ready=None,
  311. timeout=None,
  312. metadata=None):
  313. return grpc.experimental.unary_unary(
  314. request,
  315. target,
  316. '/node_service.NodeService/HealthCheck',
  317. node__service__pb2.HealthCheckRequest.SerializeToString,
  318. node__service__pb2.HealthCheckResponse.FromString,
  319. options,
  320. channel_credentials,
  321. insecure,
  322. call_credentials,
  323. compression,
  324. wait_for_ready,
  325. timeout,
  326. metadata,
  327. _registered_method=True)