Documentation ¶
Overview ¶
Package textgenerationv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterTextGenerationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTextGenerationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TextGenerationServiceClient) error
- func RegisterTextGenerationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTextGenerationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TextGenerationServiceServer) error
- func RegisterTextGenerationServiceServer(s grpc.ServiceRegistrar, srv TextGenerationServiceServer)
- type GenerateRequest
- func (*GenerateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GenerateRequest) GetInput() string
- func (x *GenerateRequest) GetParameters() *TextGenerationParameters
- func (*GenerateRequest) ProtoMessage()
- func (x *GenerateRequest) ProtoReflect() protoreflect.Message
- func (x *GenerateRequest) Reset()
- func (x *GenerateRequest) String() string
- type GenerateResponse
- func (*GenerateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GenerateResponse) GetScores() []float64
- func (x *GenerateResponse) GetTexts() []string
- func (*GenerateResponse) ProtoMessage()
- func (x *GenerateResponse) ProtoReflect() protoreflect.Message
- func (x *GenerateResponse) Reset()
- func (x *GenerateResponse) String() string
- type TextGenerationParameters
- func (*TextGenerationParameters) Descriptor() ([]byte, []int)deprecated
- func (x *TextGenerationParameters) GetDoSample() bool
- func (x *TextGenerationParameters) GetTemperature() float64
- func (x *TextGenerationParameters) GetTopK() int64
- func (x *TextGenerationParameters) GetTopP() float64
- func (*TextGenerationParameters) ProtoMessage()
- func (x *TextGenerationParameters) ProtoReflect() protoreflect.Message
- func (x *TextGenerationParameters) Reset()
- func (x *TextGenerationParameters) String() string
- type TextGenerationServiceClient
- type TextGenerationServiceServer
- type UnimplementedTextGenerationServiceServer
- type UnsafeTextGenerationServiceServer
Constants ¶
const (
TextGenerationService_Generate_FullMethodName = "/textgeneration.v1.TextGenerationService/Generate"
)
Variables ¶
var File_textgeneration_v1_texgeneration_proto protoreflect.FileDescriptor
var TextGenerationService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "textgeneration.v1.TextGenerationService", HandlerType: (*TextGenerationServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Generate", Handler: _TextGenerationService_Generate_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "textgeneration/v1/texgeneration.proto", }
TextGenerationService_ServiceDesc is the grpc.ServiceDesc for TextGenerationService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTextGenerationServiceHandler ¶
func RegisterTextGenerationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTextGenerationServiceHandler registers the http handlers for service TextGenerationService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTextGenerationServiceHandlerClient ¶
func RegisterTextGenerationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TextGenerationServiceClient) error
RegisterTextGenerationServiceHandlerClient registers the http handlers for service TextGenerationService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TextGenerationServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TextGenerationServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TextGenerationServiceClient" to call the correct interceptors.
func RegisterTextGenerationServiceHandlerFromEndpoint ¶
func RegisterTextGenerationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTextGenerationServiceHandlerFromEndpoint is same as RegisterTextGenerationServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTextGenerationServiceHandlerServer ¶
func RegisterTextGenerationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TextGenerationServiceServer) error
RegisterTextGenerationServiceHandlerServer registers the http handlers for service TextGenerationService to "mux". UnaryRPC :call TextGenerationServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTextGenerationServiceHandlerFromEndpoint instead.
func RegisterTextGenerationServiceServer ¶
func RegisterTextGenerationServiceServer(s grpc.ServiceRegistrar, srv TextGenerationServiceServer)
Types ¶
type GenerateRequest ¶
type GenerateRequest struct { Input string `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"` Parameters *TextGenerationParameters `protobuf:"bytes,2,opt,name=parameters,proto3,oneof" json:"parameters,omitempty"` // contains filtered or unexported fields }
func (*GenerateRequest) Descriptor
deprecated
func (*GenerateRequest) Descriptor() ([]byte, []int)
Deprecated: Use GenerateRequest.ProtoReflect.Descriptor instead.
func (*GenerateRequest) GetInput ¶
func (x *GenerateRequest) GetInput() string
func (*GenerateRequest) GetParameters ¶
func (x *GenerateRequest) GetParameters() *TextGenerationParameters
func (*GenerateRequest) ProtoMessage ¶
func (*GenerateRequest) ProtoMessage()
func (*GenerateRequest) ProtoReflect ¶
func (x *GenerateRequest) ProtoReflect() protoreflect.Message
func (*GenerateRequest) Reset ¶
func (x *GenerateRequest) Reset()
func (*GenerateRequest) String ¶
func (x *GenerateRequest) String() string
type GenerateResponse ¶
type GenerateResponse struct { Texts []string `protobuf:"bytes,1,rep,name=texts,proto3" json:"texts,omitempty"` Scores []float64 `protobuf:"fixed64,2,rep,packed,name=scores,proto3" json:"scores,omitempty"` // contains filtered or unexported fields }
func (*GenerateResponse) Descriptor
deprecated
func (*GenerateResponse) Descriptor() ([]byte, []int)
Deprecated: Use GenerateResponse.ProtoReflect.Descriptor instead.
func (*GenerateResponse) GetScores ¶
func (x *GenerateResponse) GetScores() []float64
func (*GenerateResponse) GetTexts ¶
func (x *GenerateResponse) GetTexts() []string
func (*GenerateResponse) ProtoMessage ¶
func (*GenerateResponse) ProtoMessage()
func (*GenerateResponse) ProtoReflect ¶
func (x *GenerateResponse) ProtoReflect() protoreflect.Message
func (*GenerateResponse) Reset ¶
func (x *GenerateResponse) Reset()
func (*GenerateResponse) String ¶
func (x *GenerateResponse) String() string
type TextGenerationParameters ¶
type TextGenerationParameters struct { TopK *int64 `protobuf:"varint,1,opt,name=top_k,json=topK,proto3,oneof" json:"top_k,omitempty"` TopP *float64 `protobuf:"fixed64,2,opt,name=top_p,json=topP,proto3,oneof" json:"top_p,omitempty"` Temperature *float64 `protobuf:"fixed64,3,opt,name=temperature,proto3,oneof" json:"temperature,omitempty"` DoSample *bool `protobuf:"varint,4,opt,name=do_sample,json=doSample,proto3,oneof" json:"do_sample,omitempty"` // contains filtered or unexported fields }
func (*TextGenerationParameters) Descriptor
deprecated
func (*TextGenerationParameters) Descriptor() ([]byte, []int)
Deprecated: Use TextGenerationParameters.ProtoReflect.Descriptor instead.
func (*TextGenerationParameters) GetDoSample ¶
func (x *TextGenerationParameters) GetDoSample() bool
func (*TextGenerationParameters) GetTemperature ¶
func (x *TextGenerationParameters) GetTemperature() float64
func (*TextGenerationParameters) GetTopK ¶
func (x *TextGenerationParameters) GetTopK() int64
func (*TextGenerationParameters) GetTopP ¶
func (x *TextGenerationParameters) GetTopP() float64
func (*TextGenerationParameters) ProtoMessage ¶
func (*TextGenerationParameters) ProtoMessage()
func (*TextGenerationParameters) ProtoReflect ¶
func (x *TextGenerationParameters) ProtoReflect() protoreflect.Message
func (*TextGenerationParameters) Reset ¶
func (x *TextGenerationParameters) Reset()
func (*TextGenerationParameters) String ¶
func (x *TextGenerationParameters) String() string
type TextGenerationServiceClient ¶
type TextGenerationServiceClient interface {
Generate(ctx context.Context, in *GenerateRequest, opts ...grpc.CallOption) (*GenerateResponse, error)
}
TextGenerationServiceClient is the client API for TextGenerationService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewTextGenerationServiceClient ¶
func NewTextGenerationServiceClient(cc grpc.ClientConnInterface) TextGenerationServiceClient
type TextGenerationServiceServer ¶
type TextGenerationServiceServer interface { Generate(context.Context, *GenerateRequest) (*GenerateResponse, error) // contains filtered or unexported methods }
TextGenerationServiceServer is the server API for TextGenerationService service. All implementations must embed UnimplementedTextGenerationServiceServer for forward compatibility
type UnimplementedTextGenerationServiceServer ¶
type UnimplementedTextGenerationServiceServer struct { }
UnimplementedTextGenerationServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedTextGenerationServiceServer) Generate ¶
func (UnimplementedTextGenerationServiceServer) Generate(context.Context, *GenerateRequest) (*GenerateResponse, error)
type UnsafeTextGenerationServiceServer ¶
type UnsafeTextGenerationServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTextGenerationServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TextGenerationServiceServer will result in compilation errors.