Documentation ¶
Overview ¶
Package questionansweringv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterQuestionAnsweringServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQuestionAnsweringServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterQuestionAnsweringServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQuestionAnsweringServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterQuestionAnsweringServiceServer(s grpc.ServiceRegistrar, srv QuestionAnsweringServiceServer)
- type Answer
- func (*Answer) Descriptor() ([]byte, []int)deprecated
- func (x *Answer) GetEnd() int64
- func (x *Answer) GetScore() float64
- func (x *Answer) GetStart() int64
- func (x *Answer) GetText() string
- func (*Answer) ProtoMessage()
- func (x *Answer) ProtoReflect() protoreflect.Message
- func (x *Answer) Reset()
- func (x *Answer) String() string
- type AnswerRequest
- func (*AnswerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AnswerRequest) GetOptions() *QuestionAnsweringOptions
- func (x *AnswerRequest) GetPassage() string
- func (x *AnswerRequest) GetQuestion() string
- func (*AnswerRequest) ProtoMessage()
- func (x *AnswerRequest) ProtoReflect() protoreflect.Message
- func (x *AnswerRequest) Reset()
- func (x *AnswerRequest) String() string
- type AnswerResponse
- type QuestionAnsweringOptions
- func (*QuestionAnsweringOptions) Descriptor() ([]byte, []int)deprecated
- func (x *QuestionAnsweringOptions) GetMaxAnswers() int64
- func (x *QuestionAnsweringOptions) GetMaxAnswersLen() int64
- func (x *QuestionAnsweringOptions) GetMaxCandidates() int64
- func (x *QuestionAnsweringOptions) GetMinScore() float64
- func (*QuestionAnsweringOptions) ProtoMessage()
- func (x *QuestionAnsweringOptions) ProtoReflect() protoreflect.Message
- func (x *QuestionAnsweringOptions) Reset()
- func (x *QuestionAnsweringOptions) String() string
- type QuestionAnsweringServiceClient
- type QuestionAnsweringServiceServer
- type UnimplementedQuestionAnsweringServiceServer
- type UnsafeQuestionAnsweringServiceServer
Constants ¶
const (
QuestionAnsweringService_Answer_FullMethodName = "/questionanswering.v1.QuestionAnsweringService/Answer"
)
Variables ¶
var File_questionanswering_v1_questionanswering_proto protoreflect.FileDescriptor
var QuestionAnsweringService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "questionanswering.v1.QuestionAnsweringService", HandlerType: (*QuestionAnsweringServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Answer", Handler: _QuestionAnsweringService_Answer_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "questionanswering/v1/questionanswering.proto", }
QuestionAnsweringService_ServiceDesc is the grpc.ServiceDesc for QuestionAnsweringService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterQuestionAnsweringServiceHandler ¶
func RegisterQuestionAnsweringServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterQuestionAnsweringServiceHandler registers the http handlers for service QuestionAnsweringService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQuestionAnsweringServiceHandlerClient ¶
func RegisterQuestionAnsweringServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QuestionAnsweringServiceClient) error
RegisterQuestionAnsweringServiceHandlerClient registers the http handlers for service QuestionAnsweringService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QuestionAnsweringServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QuestionAnsweringServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QuestionAnsweringServiceClient" to call the correct interceptors.
func RegisterQuestionAnsweringServiceHandlerFromEndpoint ¶
func RegisterQuestionAnsweringServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQuestionAnsweringServiceHandlerFromEndpoint is same as RegisterQuestionAnsweringServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQuestionAnsweringServiceHandlerServer ¶
func RegisterQuestionAnsweringServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QuestionAnsweringServiceServer) error
RegisterQuestionAnsweringServiceHandlerServer registers the http handlers for service QuestionAnsweringService to "mux". UnaryRPC :call QuestionAnsweringServiceServer 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 RegisterQuestionAnsweringServiceHandlerFromEndpoint instead.
func RegisterQuestionAnsweringServiceServer ¶
func RegisterQuestionAnsweringServiceServer(s grpc.ServiceRegistrar, srv QuestionAnsweringServiceServer)
Types ¶
type Answer ¶
type Answer struct { Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` Start int64 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` End int64 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"` Score float64 `protobuf:"fixed64,4,opt,name=score,proto3" json:"score,omitempty"` // contains filtered or unexported fields }
func (*Answer) Descriptor
deprecated
func (*Answer) ProtoMessage ¶
func (*Answer) ProtoMessage()
func (*Answer) ProtoReflect ¶
func (x *Answer) ProtoReflect() protoreflect.Message
type AnswerRequest ¶
type AnswerRequest struct { Question string `protobuf:"bytes,1,opt,name=question,proto3" json:"question,omitempty"` Passage string `protobuf:"bytes,2,opt,name=passage,proto3" json:"passage,omitempty"` Options *QuestionAnsweringOptions `protobuf:"bytes,3,opt,name=options,proto3,oneof" json:"options,omitempty"` // contains filtered or unexported fields }
func (*AnswerRequest) Descriptor
deprecated
func (*AnswerRequest) Descriptor() ([]byte, []int)
Deprecated: Use AnswerRequest.ProtoReflect.Descriptor instead.
func (*AnswerRequest) GetOptions ¶
func (x *AnswerRequest) GetOptions() *QuestionAnsweringOptions
func (*AnswerRequest) GetPassage ¶
func (x *AnswerRequest) GetPassage() string
func (*AnswerRequest) GetQuestion ¶
func (x *AnswerRequest) GetQuestion() string
func (*AnswerRequest) ProtoMessage ¶
func (*AnswerRequest) ProtoMessage()
func (*AnswerRequest) ProtoReflect ¶
func (x *AnswerRequest) ProtoReflect() protoreflect.Message
func (*AnswerRequest) Reset ¶
func (x *AnswerRequest) Reset()
func (*AnswerRequest) String ¶
func (x *AnswerRequest) String() string
type AnswerResponse ¶
type AnswerResponse struct { Answers []*Answer `protobuf:"bytes,1,rep,name=answers,proto3" json:"answers,omitempty"` // contains filtered or unexported fields }
func (*AnswerResponse) Descriptor
deprecated
func (*AnswerResponse) Descriptor() ([]byte, []int)
Deprecated: Use AnswerResponse.ProtoReflect.Descriptor instead.
func (*AnswerResponse) GetAnswers ¶
func (x *AnswerResponse) GetAnswers() []*Answer
func (*AnswerResponse) ProtoMessage ¶
func (*AnswerResponse) ProtoMessage()
func (*AnswerResponse) ProtoReflect ¶
func (x *AnswerResponse) ProtoReflect() protoreflect.Message
func (*AnswerResponse) Reset ¶
func (x *AnswerResponse) Reset()
func (*AnswerResponse) String ¶
func (x *AnswerResponse) String() string
type QuestionAnsweringOptions ¶
type QuestionAnsweringOptions struct { MaxAnswers *int64 `protobuf:"varint,1,opt,name=max_answers,json=maxAnswers,proto3,oneof" json:"max_answers,omitempty"` MaxAnswersLen *int64 `protobuf:"varint,2,opt,name=max_answers_len,json=maxAnswersLen,proto3,oneof" json:"max_answers_len,omitempty"` MaxCandidates *int64 `protobuf:"varint,3,opt,name=max_candidates,json=maxCandidates,proto3,oneof" json:"max_candidates,omitempty"` MinScore *float64 `protobuf:"fixed64,4,opt,name=min_score,json=minScore,proto3,oneof" json:"min_score,omitempty"` // contains filtered or unexported fields }
func (*QuestionAnsweringOptions) Descriptor
deprecated
func (*QuestionAnsweringOptions) Descriptor() ([]byte, []int)
Deprecated: Use QuestionAnsweringOptions.ProtoReflect.Descriptor instead.
func (*QuestionAnsweringOptions) GetMaxAnswers ¶
func (x *QuestionAnsweringOptions) GetMaxAnswers() int64
func (*QuestionAnsweringOptions) GetMaxAnswersLen ¶
func (x *QuestionAnsweringOptions) GetMaxAnswersLen() int64
func (*QuestionAnsweringOptions) GetMaxCandidates ¶
func (x *QuestionAnsweringOptions) GetMaxCandidates() int64
func (*QuestionAnsweringOptions) GetMinScore ¶
func (x *QuestionAnsweringOptions) GetMinScore() float64
func (*QuestionAnsweringOptions) ProtoMessage ¶
func (*QuestionAnsweringOptions) ProtoMessage()
func (*QuestionAnsweringOptions) ProtoReflect ¶
func (x *QuestionAnsweringOptions) ProtoReflect() protoreflect.Message
func (*QuestionAnsweringOptions) Reset ¶
func (x *QuestionAnsweringOptions) Reset()
func (*QuestionAnsweringOptions) String ¶
func (x *QuestionAnsweringOptions) String() string
type QuestionAnsweringServiceClient ¶
type QuestionAnsweringServiceClient interface {
Answer(ctx context.Context, in *AnswerRequest, opts ...grpc.CallOption) (*AnswerResponse, error)
}
QuestionAnsweringServiceClient is the client API for QuestionAnsweringService 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 NewQuestionAnsweringServiceClient ¶
func NewQuestionAnsweringServiceClient(cc grpc.ClientConnInterface) QuestionAnsweringServiceClient
type QuestionAnsweringServiceServer ¶
type QuestionAnsweringServiceServer interface { Answer(context.Context, *AnswerRequest) (*AnswerResponse, error) // contains filtered or unexported methods }
QuestionAnsweringServiceServer is the server API for QuestionAnsweringService service. All implementations must embed UnimplementedQuestionAnsweringServiceServer for forward compatibility
type UnimplementedQuestionAnsweringServiceServer ¶
type UnimplementedQuestionAnsweringServiceServer struct { }
UnimplementedQuestionAnsweringServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedQuestionAnsweringServiceServer) Answer ¶
func (UnimplementedQuestionAnsweringServiceServer) Answer(context.Context, *AnswerRequest) (*AnswerResponse, error)
type UnsafeQuestionAnsweringServiceServer ¶
type UnsafeQuestionAnsweringServiceServer interface {
// contains filtered or unexported methods
}
UnsafeQuestionAnsweringServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to QuestionAnsweringServiceServer will result in compilation errors.