mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-29 00:48:51 +00:00
298 lines
12 KiB
Python
298 lines
12 KiB
Python
|
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
||
|
"""Client and server classes corresponding to protobuf-defined services."""
|
||
|
import grpc
|
||
|
|
||
|
import backend_pb2 as backend__pb2
|
||
|
|
||
|
|
||
|
class BackendStub(object):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
|
||
|
def __init__(self, channel):
|
||
|
"""Constructor.
|
||
|
|
||
|
Args:
|
||
|
channel: A grpc.Channel.
|
||
|
"""
|
||
|
self.Health = channel.unary_unary(
|
||
|
'/backend.Backend/Health',
|
||
|
request_serializer=backend__pb2.HealthMessage.SerializeToString,
|
||
|
response_deserializer=backend__pb2.Reply.FromString,
|
||
|
)
|
||
|
self.Predict = channel.unary_unary(
|
||
|
'/backend.Backend/Predict',
|
||
|
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
||
|
response_deserializer=backend__pb2.Reply.FromString,
|
||
|
)
|
||
|
self.LoadModel = channel.unary_unary(
|
||
|
'/backend.Backend/LoadModel',
|
||
|
request_serializer=backend__pb2.ModelOptions.SerializeToString,
|
||
|
response_deserializer=backend__pb2.Result.FromString,
|
||
|
)
|
||
|
self.PredictStream = channel.unary_stream(
|
||
|
'/backend.Backend/PredictStream',
|
||
|
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
||
|
response_deserializer=backend__pb2.Reply.FromString,
|
||
|
)
|
||
|
self.Embedding = channel.unary_unary(
|
||
|
'/backend.Backend/Embedding',
|
||
|
request_serializer=backend__pb2.PredictOptions.SerializeToString,
|
||
|
response_deserializer=backend__pb2.EmbeddingResult.FromString,
|
||
|
)
|
||
|
self.GenerateImage = channel.unary_unary(
|
||
|
'/backend.Backend/GenerateImage',
|
||
|
request_serializer=backend__pb2.GenerateImageRequest.SerializeToString,
|
||
|
response_deserializer=backend__pb2.Result.FromString,
|
||
|
)
|
||
|
self.AudioTranscription = channel.unary_unary(
|
||
|
'/backend.Backend/AudioTranscription',
|
||
|
request_serializer=backend__pb2.TranscriptRequest.SerializeToString,
|
||
|
response_deserializer=backend__pb2.TranscriptResult.FromString,
|
||
|
)
|
||
|
self.TTS = channel.unary_unary(
|
||
|
'/backend.Backend/TTS',
|
||
|
request_serializer=backend__pb2.TTSRequest.SerializeToString,
|
||
|
response_deserializer=backend__pb2.Result.FromString,
|
||
|
)
|
||
|
|
||
|
|
||
|
class BackendServicer(object):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
|
||
|
def Health(self, request, context):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||
|
context.set_details('Method not implemented!')
|
||
|
raise NotImplementedError('Method not implemented!')
|
||
|
|
||
|
def Predict(self, request, context):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||
|
context.set_details('Method not implemented!')
|
||
|
raise NotImplementedError('Method not implemented!')
|
||
|
|
||
|
def LoadModel(self, request, context):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||
|
context.set_details('Method not implemented!')
|
||
|
raise NotImplementedError('Method not implemented!')
|
||
|
|
||
|
def PredictStream(self, request, context):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||
|
context.set_details('Method not implemented!')
|
||
|
raise NotImplementedError('Method not implemented!')
|
||
|
|
||
|
def Embedding(self, request, context):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||
|
context.set_details('Method not implemented!')
|
||
|
raise NotImplementedError('Method not implemented!')
|
||
|
|
||
|
def GenerateImage(self, request, context):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||
|
context.set_details('Method not implemented!')
|
||
|
raise NotImplementedError('Method not implemented!')
|
||
|
|
||
|
def AudioTranscription(self, request, context):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||
|
context.set_details('Method not implemented!')
|
||
|
raise NotImplementedError('Method not implemented!')
|
||
|
|
||
|
def TTS(self, request, context):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||
|
context.set_details('Method not implemented!')
|
||
|
raise NotImplementedError('Method not implemented!')
|
||
|
|
||
|
|
||
|
def add_BackendServicer_to_server(servicer, server):
|
||
|
rpc_method_handlers = {
|
||
|
'Health': grpc.unary_unary_rpc_method_handler(
|
||
|
servicer.Health,
|
||
|
request_deserializer=backend__pb2.HealthMessage.FromString,
|
||
|
response_serializer=backend__pb2.Reply.SerializeToString,
|
||
|
),
|
||
|
'Predict': grpc.unary_unary_rpc_method_handler(
|
||
|
servicer.Predict,
|
||
|
request_deserializer=backend__pb2.PredictOptions.FromString,
|
||
|
response_serializer=backend__pb2.Reply.SerializeToString,
|
||
|
),
|
||
|
'LoadModel': grpc.unary_unary_rpc_method_handler(
|
||
|
servicer.LoadModel,
|
||
|
request_deserializer=backend__pb2.ModelOptions.FromString,
|
||
|
response_serializer=backend__pb2.Result.SerializeToString,
|
||
|
),
|
||
|
'PredictStream': grpc.unary_stream_rpc_method_handler(
|
||
|
servicer.PredictStream,
|
||
|
request_deserializer=backend__pb2.PredictOptions.FromString,
|
||
|
response_serializer=backend__pb2.Reply.SerializeToString,
|
||
|
),
|
||
|
'Embedding': grpc.unary_unary_rpc_method_handler(
|
||
|
servicer.Embedding,
|
||
|
request_deserializer=backend__pb2.PredictOptions.FromString,
|
||
|
response_serializer=backend__pb2.EmbeddingResult.SerializeToString,
|
||
|
),
|
||
|
'GenerateImage': grpc.unary_unary_rpc_method_handler(
|
||
|
servicer.GenerateImage,
|
||
|
request_deserializer=backend__pb2.GenerateImageRequest.FromString,
|
||
|
response_serializer=backend__pb2.Result.SerializeToString,
|
||
|
),
|
||
|
'AudioTranscription': grpc.unary_unary_rpc_method_handler(
|
||
|
servicer.AudioTranscription,
|
||
|
request_deserializer=backend__pb2.TranscriptRequest.FromString,
|
||
|
response_serializer=backend__pb2.TranscriptResult.SerializeToString,
|
||
|
),
|
||
|
'TTS': grpc.unary_unary_rpc_method_handler(
|
||
|
servicer.TTS,
|
||
|
request_deserializer=backend__pb2.TTSRequest.FromString,
|
||
|
response_serializer=backend__pb2.Result.SerializeToString,
|
||
|
),
|
||
|
}
|
||
|
generic_handler = grpc.method_handlers_generic_handler(
|
||
|
'backend.Backend', rpc_method_handlers)
|
||
|
server.add_generic_rpc_handlers((generic_handler,))
|
||
|
|
||
|
|
||
|
# This class is part of an EXPERIMENTAL API.
|
||
|
class Backend(object):
|
||
|
"""Missing associated documentation comment in .proto file."""
|
||
|
|
||
|
@staticmethod
|
||
|
def Health(request,
|
||
|
target,
|
||
|
options=(),
|
||
|
channel_credentials=None,
|
||
|
call_credentials=None,
|
||
|
insecure=False,
|
||
|
compression=None,
|
||
|
wait_for_ready=None,
|
||
|
timeout=None,
|
||
|
metadata=None):
|
||
|
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Health',
|
||
|
backend__pb2.HealthMessage.SerializeToString,
|
||
|
backend__pb2.Reply.FromString,
|
||
|
options, channel_credentials,
|
||
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||
|
|
||
|
@staticmethod
|
||
|
def Predict(request,
|
||
|
target,
|
||
|
options=(),
|
||
|
channel_credentials=None,
|
||
|
call_credentials=None,
|
||
|
insecure=False,
|
||
|
compression=None,
|
||
|
wait_for_ready=None,
|
||
|
timeout=None,
|
||
|
metadata=None):
|
||
|
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Predict',
|
||
|
backend__pb2.PredictOptions.SerializeToString,
|
||
|
backend__pb2.Reply.FromString,
|
||
|
options, channel_credentials,
|
||
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||
|
|
||
|
@staticmethod
|
||
|
def LoadModel(request,
|
||
|
target,
|
||
|
options=(),
|
||
|
channel_credentials=None,
|
||
|
call_credentials=None,
|
||
|
insecure=False,
|
||
|
compression=None,
|
||
|
wait_for_ready=None,
|
||
|
timeout=None,
|
||
|
metadata=None):
|
||
|
return grpc.experimental.unary_unary(request, target, '/backend.Backend/LoadModel',
|
||
|
backend__pb2.ModelOptions.SerializeToString,
|
||
|
backend__pb2.Result.FromString,
|
||
|
options, channel_credentials,
|
||
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||
|
|
||
|
@staticmethod
|
||
|
def PredictStream(request,
|
||
|
target,
|
||
|
options=(),
|
||
|
channel_credentials=None,
|
||
|
call_credentials=None,
|
||
|
insecure=False,
|
||
|
compression=None,
|
||
|
wait_for_ready=None,
|
||
|
timeout=None,
|
||
|
metadata=None):
|
||
|
return grpc.experimental.unary_stream(request, target, '/backend.Backend/PredictStream',
|
||
|
backend__pb2.PredictOptions.SerializeToString,
|
||
|
backend__pb2.Reply.FromString,
|
||
|
options, channel_credentials,
|
||
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||
|
|
||
|
@staticmethod
|
||
|
def Embedding(request,
|
||
|
target,
|
||
|
options=(),
|
||
|
channel_credentials=None,
|
||
|
call_credentials=None,
|
||
|
insecure=False,
|
||
|
compression=None,
|
||
|
wait_for_ready=None,
|
||
|
timeout=None,
|
||
|
metadata=None):
|
||
|
return grpc.experimental.unary_unary(request, target, '/backend.Backend/Embedding',
|
||
|
backend__pb2.PredictOptions.SerializeToString,
|
||
|
backend__pb2.EmbeddingResult.FromString,
|
||
|
options, channel_credentials,
|
||
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||
|
|
||
|
@staticmethod
|
||
|
def GenerateImage(request,
|
||
|
target,
|
||
|
options=(),
|
||
|
channel_credentials=None,
|
||
|
call_credentials=None,
|
||
|
insecure=False,
|
||
|
compression=None,
|
||
|
wait_for_ready=None,
|
||
|
timeout=None,
|
||
|
metadata=None):
|
||
|
return grpc.experimental.unary_unary(request, target, '/backend.Backend/GenerateImage',
|
||
|
backend__pb2.GenerateImageRequest.SerializeToString,
|
||
|
backend__pb2.Result.FromString,
|
||
|
options, channel_credentials,
|
||
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||
|
|
||
|
@staticmethod
|
||
|
def AudioTranscription(request,
|
||
|
target,
|
||
|
options=(),
|
||
|
channel_credentials=None,
|
||
|
call_credentials=None,
|
||
|
insecure=False,
|
||
|
compression=None,
|
||
|
wait_for_ready=None,
|
||
|
timeout=None,
|
||
|
metadata=None):
|
||
|
return grpc.experimental.unary_unary(request, target, '/backend.Backend/AudioTranscription',
|
||
|
backend__pb2.TranscriptRequest.SerializeToString,
|
||
|
backend__pb2.TranscriptResult.FromString,
|
||
|
options, channel_credentials,
|
||
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||
|
|
||
|
@staticmethod
|
||
|
def TTS(request,
|
||
|
target,
|
||
|
options=(),
|
||
|
channel_credentials=None,
|
||
|
call_credentials=None,
|
||
|
insecure=False,
|
||
|
compression=None,
|
||
|
wait_for_ready=None,
|
||
|
timeout=None,
|
||
|
metadata=None):
|
||
|
return grpc.experimental.unary_unary(request, target, '/backend.Backend/TTS',
|
||
|
backend__pb2.TTSRequest.SerializeToString,
|
||
|
backend__pb2.Result.FromString,
|
||
|
options, channel_credentials,
|
||
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|