grpcapi

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2021 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BART_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "bart.grpcapi.BART",
	HandlerType: (*BARTServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Classify",
			Handler:    _BART_Classify_Handler,
		},
		{
			MethodName: "ClassifyNLI",
			Handler:    _BART_ClassifyNLI_Handler,
		},
		{
			MethodName: "Generate",
			Handler:    _BART_Generate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "bart.proto",
}

BART_ServiceDesc is the grpc.ServiceDesc for BART service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterBARTServer

func RegisterBARTServer(s grpc.ServiceRegistrar, srv BARTServer)

Types

type BARTClient

type BARTClient interface {
	// Sends a request to classify.
	Classify(ctx context.Context, in *ClassifyRequest, opts ...grpc.CallOption) (*ClassifyReply, error)
	// Sends a request to classify-nli.
	ClassifyNLI(ctx context.Context, in *ClassifyNLIRequest, opts ...grpc.CallOption) (*ClassifyReply, error)
	// Send a request to generate.
	Generate(ctx context.Context, in *GenerateRequest, opts ...grpc.CallOption) (*GenerateReply, error)
}

BARTClient is the client API for BART 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 NewBARTClient

func NewBARTClient(cc grpc.ClientConnInterface) BARTClient

type BARTServer

type BARTServer interface {
	// Sends a request to classify.
	Classify(context.Context, *ClassifyRequest) (*ClassifyReply, error)
	// Sends a request to classify-nli.
	ClassifyNLI(context.Context, *ClassifyNLIRequest) (*ClassifyReply, error)
	// Send a request to generate.
	Generate(context.Context, *GenerateRequest) (*GenerateReply, error)
	// contains filtered or unexported methods
}

BARTServer is the server API for BART service. All implementations must embed UnimplementedBARTServer for forward compatibility

type ClassConfidencePair

type ClassConfidencePair struct {
	Class      string  `protobuf:"bytes,1,opt,name=class,proto3" json:"class,omitempty"`
	Confidence float64 `protobuf:"fixed64,2,opt,name=confidence,proto3" json:"confidence,omitempty"`
	// contains filtered or unexported fields
}

The pair of class and confidence.

func (*ClassConfidencePair) Descriptor deprecated

func (*ClassConfidencePair) Descriptor() ([]byte, []int)

Deprecated: Use ClassConfidencePair.ProtoReflect.Descriptor instead.

func (*ClassConfidencePair) GetClass

func (x *ClassConfidencePair) GetClass() string

func (*ClassConfidencePair) GetConfidence

func (x *ClassConfidencePair) GetConfidence() float64

func (*ClassConfidencePair) ProtoMessage

func (*ClassConfidencePair) ProtoMessage()

func (*ClassConfidencePair) ProtoReflect

func (x *ClassConfidencePair) ProtoReflect() protoreflect.Message

func (*ClassConfidencePair) Reset

func (x *ClassConfidencePair) Reset()

func (*ClassConfidencePair) String

func (x *ClassConfidencePair) String() string

type ClassifyNLIRequest

type ClassifyNLIRequest struct {
	Text               string   `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	HypothesisTemplate string   `protobuf:"bytes,2,opt,name=hypothesis_template,json=hypothesisTemplate,proto3" json:"hypothesis_template,omitempty"`
	PossibleLabels     []string `protobuf:"bytes,3,rep,name=possible_labels,json=possibleLabels,proto3" json:"possible_labels,omitempty"`
	MultiClass         bool     `protobuf:"varint,4,opt,name=multi_class,json=multiClass,proto3" json:"multi_class,omitempty"`
	// contains filtered or unexported fields
}

The classify-nli request message containing the text to classify using natural language inference

func (*ClassifyNLIRequest) Descriptor deprecated

func (*ClassifyNLIRequest) Descriptor() ([]byte, []int)

Deprecated: Use ClassifyNLIRequest.ProtoReflect.Descriptor instead.

func (*ClassifyNLIRequest) GetHypothesisTemplate

func (x *ClassifyNLIRequest) GetHypothesisTemplate() string

func (*ClassifyNLIRequest) GetMultiClass

func (x *ClassifyNLIRequest) GetMultiClass() bool

func (*ClassifyNLIRequest) GetPossibleLabels

func (x *ClassifyNLIRequest) GetPossibleLabels() []string

func (*ClassifyNLIRequest) GetText

func (x *ClassifyNLIRequest) GetText() string

func (*ClassifyNLIRequest) ProtoMessage

func (*ClassifyNLIRequest) ProtoMessage()

func (*ClassifyNLIRequest) ProtoReflect

func (x *ClassifyNLIRequest) ProtoReflect() protoreflect.Message

func (*ClassifyNLIRequest) Reset

func (x *ClassifyNLIRequest) Reset()

func (*ClassifyNLIRequest) String

func (x *ClassifyNLIRequest) String() string

type ClassifyReply

type ClassifyReply struct {
	Class        string                 `protobuf:"bytes,1,opt,name=class,proto3" json:"class,omitempty"`
	Confidence   float64                `protobuf:"fixed64,2,opt,name=confidence,proto3" json:"confidence,omitempty"`
	Distribution []*ClassConfidencePair `protobuf:"bytes,3,rep,name=distribution,proto3" json:"distribution,omitempty"`
	// Took is the number of milliseconds it took the server to execute the request.
	Took int64 `protobuf:"varint,4,opt,name=took,proto3" json:"took,omitempty"`
	// contains filtered or unexported fields
}

The response message containing the classification.

func (*ClassifyReply) Descriptor deprecated

func (*ClassifyReply) Descriptor() ([]byte, []int)

Deprecated: Use ClassifyReply.ProtoReflect.Descriptor instead.

func (*ClassifyReply) GetClass

func (x *ClassifyReply) GetClass() string

func (*ClassifyReply) GetConfidence

func (x *ClassifyReply) GetConfidence() float64

func (*ClassifyReply) GetDistribution

func (x *ClassifyReply) GetDistribution() []*ClassConfidencePair

func (*ClassifyReply) GetTook

func (x *ClassifyReply) GetTook() int64

func (*ClassifyReply) ProtoMessage

func (*ClassifyReply) ProtoMessage()

func (*ClassifyReply) ProtoReflect

func (x *ClassifyReply) ProtoReflect() protoreflect.Message

func (*ClassifyReply) Reset

func (x *ClassifyReply) Reset()

func (*ClassifyReply) String

func (x *ClassifyReply) String() string

type ClassifyRequest

type ClassifyRequest struct {
	HasText2 bool   `protobuf:"varint,1,opt,name=has_text2,json=hasText2,proto3" json:"has_text2,omitempty"` // always set this to "true" when using text2
	Text     string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	Text2    string `protobuf:"bytes,3,opt,name=text2,proto3" json:"text2,omitempty"`
	// contains filtered or unexported fields
}

The classify request message containing the text to classify

func (*ClassifyRequest) Descriptor deprecated

func (*ClassifyRequest) Descriptor() ([]byte, []int)

Deprecated: Use ClassifyRequest.ProtoReflect.Descriptor instead.

func (*ClassifyRequest) GetHasText2

func (x *ClassifyRequest) GetHasText2() bool

func (*ClassifyRequest) GetText

func (x *ClassifyRequest) GetText() string

func (*ClassifyRequest) GetText2

func (x *ClassifyRequest) GetText2() string

func (*ClassifyRequest) ProtoMessage

func (*ClassifyRequest) ProtoMessage()

func (*ClassifyRequest) ProtoReflect

func (x *ClassifyRequest) ProtoReflect() protoreflect.Message

func (*ClassifyRequest) Reset

func (x *ClassifyRequest) Reset()

func (*ClassifyRequest) String

func (x *ClassifyRequest) String() string

type GenerateReply

type GenerateReply struct {
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	// Took is the number of milliseconds it took the server to execute the request.
	Took int64 `protobuf:"varint,4,opt,name=took,proto3" json:"took,omitempty"`
	// contains filtered or unexported fields
}

The response message containing the generated text.

func (*GenerateReply) Descriptor deprecated

func (*GenerateReply) Descriptor() ([]byte, []int)

Deprecated: Use GenerateReply.ProtoReflect.Descriptor instead.

func (*GenerateReply) GetText

func (x *GenerateReply) GetText() string

func (*GenerateReply) GetTook

func (x *GenerateReply) GetTook() int64

func (*GenerateReply) ProtoMessage

func (*GenerateReply) ProtoMessage()

func (*GenerateReply) ProtoReflect

func (x *GenerateReply) ProtoReflect() protoreflect.Message

func (*GenerateReply) Reset

func (x *GenerateReply) Reset()

func (*GenerateReply) String

func (x *GenerateReply) String() string

type GenerateRequest

type GenerateRequest struct {
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

The generate request message containing the text from which to start the conditional generation

func (*GenerateRequest) Descriptor deprecated

func (*GenerateRequest) Descriptor() ([]byte, []int)

Deprecated: Use GenerateRequest.ProtoReflect.Descriptor instead.

func (*GenerateRequest) GetText

func (x *GenerateRequest) GetText() string

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 UnimplementedBARTServer

type UnimplementedBARTServer struct {
}

UnimplementedBARTServer must be embedded to have forward compatible implementations.

func (UnimplementedBARTServer) Classify

func (UnimplementedBARTServer) ClassifyNLI

func (UnimplementedBARTServer) Generate

type UnsafeBARTServer

type UnsafeBARTServer interface {
	// contains filtered or unexported methods
}

UnsafeBARTServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BARTServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL