|
@@ -24,6 +24,69 @@ const (
|
|
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
|
)
|
|
|
|
|
|
+type Question struct {
|
|
|
+ state protoimpl.MessageState
|
|
|
+ sizeCache protoimpl.SizeCache
|
|
|
+ unknownFields protoimpl.UnknownFields
|
|
|
+
|
|
|
+ XId string `protobuf:"bytes,1,opt,name=_id,json=Id,proto3" json:"_id,omitempty"`
|
|
|
+ Question string `protobuf:"bytes,2,opt,name=question,proto3" json:"question,omitempty"`
|
|
|
+ Answer string `protobuf:"bytes,3,opt,name=answer,proto3" json:"answer,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+func (x *Question) Reset() {
|
|
|
+ *x = Question{}
|
|
|
+ if protoimpl.UnsafeEnabled {
|
|
|
+ mi := &file_knowledge_proto_msgTypes[0]
|
|
|
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
+ ms.StoreMessageInfo(mi)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func (x *Question) String() string {
|
|
|
+ return protoimpl.X.MessageStringOf(x)
|
|
|
+}
|
|
|
+
|
|
|
+func (*Question) ProtoMessage() {}
|
|
|
+
|
|
|
+func (x *Question) ProtoReflect() protoreflect.Message {
|
|
|
+ mi := &file_knowledge_proto_msgTypes[0]
|
|
|
+ if protoimpl.UnsafeEnabled && x != nil {
|
|
|
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
+ if ms.LoadMessageInfo() == nil {
|
|
|
+ ms.StoreMessageInfo(mi)
|
|
|
+ }
|
|
|
+ return ms
|
|
|
+ }
|
|
|
+ return mi.MessageOf(x)
|
|
|
+}
|
|
|
+
|
|
|
+// Deprecated: Use Question.ProtoReflect.Descriptor instead.
|
|
|
+func (*Question) Descriptor() ([]byte, []int) {
|
|
|
+ return file_knowledge_proto_rawDescGZIP(), []int{0}
|
|
|
+}
|
|
|
+
|
|
|
+func (x *Question) GetXId() string {
|
|
|
+ if x != nil {
|
|
|
+ return x.XId
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func (x *Question) GetQuestion() string {
|
|
|
+ if x != nil {
|
|
|
+ return x.Question
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func (x *Question) GetAnswer() string {
|
|
|
+ if x != nil {
|
|
|
+ return x.Answer
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
type AddRequest struct {
|
|
|
state protoimpl.MessageState
|
|
|
sizeCache protoimpl.SizeCache
|
|
@@ -36,7 +99,7 @@ type AddRequest struct {
|
|
|
func (x *AddRequest) Reset() {
|
|
|
*x = AddRequest{}
|
|
|
if protoimpl.UnsafeEnabled {
|
|
|
- mi := &file_knowledge_proto_msgTypes[0]
|
|
|
+ mi := &file_knowledge_proto_msgTypes[1]
|
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
ms.StoreMessageInfo(mi)
|
|
|
}
|
|
@@ -49,7 +112,7 @@ func (x *AddRequest) String() string {
|
|
|
func (*AddRequest) ProtoMessage() {}
|
|
|
|
|
|
func (x *AddRequest) ProtoReflect() protoreflect.Message {
|
|
|
- mi := &file_knowledge_proto_msgTypes[0]
|
|
|
+ mi := &file_knowledge_proto_msgTypes[1]
|
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
if ms.LoadMessageInfo() == nil {
|
|
@@ -62,7 +125,7 @@ func (x *AddRequest) ProtoReflect() protoreflect.Message {
|
|
|
|
|
|
// Deprecated: Use AddRequest.ProtoReflect.Descriptor instead.
|
|
|
func (*AddRequest) Descriptor() ([]byte, []int) {
|
|
|
- return file_knowledge_proto_rawDescGZIP(), []int{0}
|
|
|
+ return file_knowledge_proto_rawDescGZIP(), []int{1}
|
|
|
}
|
|
|
|
|
|
func (x *AddRequest) GetQuestion() string {
|
|
@@ -92,7 +155,7 @@ type AddResponse struct {
|
|
|
func (x *AddResponse) Reset() {
|
|
|
*x = AddResponse{}
|
|
|
if protoimpl.UnsafeEnabled {
|
|
|
- mi := &file_knowledge_proto_msgTypes[1]
|
|
|
+ mi := &file_knowledge_proto_msgTypes[2]
|
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
ms.StoreMessageInfo(mi)
|
|
|
}
|
|
@@ -105,7 +168,7 @@ func (x *AddResponse) String() string {
|
|
|
func (*AddResponse) ProtoMessage() {}
|
|
|
|
|
|
func (x *AddResponse) ProtoReflect() protoreflect.Message {
|
|
|
- mi := &file_knowledge_proto_msgTypes[1]
|
|
|
+ mi := &file_knowledge_proto_msgTypes[2]
|
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
if ms.LoadMessageInfo() == nil {
|
|
@@ -118,7 +181,7 @@ func (x *AddResponse) ProtoReflect() protoreflect.Message {
|
|
|
|
|
|
// Deprecated: Use AddResponse.ProtoReflect.Descriptor instead.
|
|
|
func (*AddResponse) Descriptor() ([]byte, []int) {
|
|
|
- return file_knowledge_proto_rawDescGZIP(), []int{1}
|
|
|
+ return file_knowledge_proto_rawDescGZIP(), []int{2}
|
|
|
}
|
|
|
|
|
|
func (x *AddResponse) GetErrorCode() int64 {
|
|
@@ -142,27 +205,260 @@ func (x *AddResponse) GetData() string {
|
|
|
return ""
|
|
|
}
|
|
|
|
|
|
+type FindAnswerReq struct {
|
|
|
+ state protoimpl.MessageState
|
|
|
+ sizeCache protoimpl.SizeCache
|
|
|
+ unknownFields protoimpl.UnknownFields
|
|
|
+
|
|
|
+ Question string `protobuf:"bytes,1,opt,name=question,proto3" json:"question,omitempty"`
|
|
|
+ TenantId int64 `protobuf:"varint,2,opt,name=tenantId,proto3" json:"tenantId,omitempty"` //租户id
|
|
|
+ Type int64 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` // 1文字 2语音
|
|
|
+ AppId string `protobuf:"bytes,4,opt,name=appId,proto3" json:"appId,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerReq) Reset() {
|
|
|
+ *x = FindAnswerReq{}
|
|
|
+ if protoimpl.UnsafeEnabled {
|
|
|
+ mi := &file_knowledge_proto_msgTypes[3]
|
|
|
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
+ ms.StoreMessageInfo(mi)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerReq) String() string {
|
|
|
+ return protoimpl.X.MessageStringOf(x)
|
|
|
+}
|
|
|
+
|
|
|
+func (*FindAnswerReq) ProtoMessage() {}
|
|
|
+
|
|
|
+func (x *FindAnswerReq) ProtoReflect() protoreflect.Message {
|
|
|
+ mi := &file_knowledge_proto_msgTypes[3]
|
|
|
+ if protoimpl.UnsafeEnabled && x != nil {
|
|
|
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
+ if ms.LoadMessageInfo() == nil {
|
|
|
+ ms.StoreMessageInfo(mi)
|
|
|
+ }
|
|
|
+ return ms
|
|
|
+ }
|
|
|
+ return mi.MessageOf(x)
|
|
|
+}
|
|
|
+
|
|
|
+// Deprecated: Use FindAnswerReq.ProtoReflect.Descriptor instead.
|
|
|
+func (*FindAnswerReq) Descriptor() ([]byte, []int) {
|
|
|
+ return file_knowledge_proto_rawDescGZIP(), []int{3}
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerReq) GetQuestion() string {
|
|
|
+ if x != nil {
|
|
|
+ return x.Question
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerReq) GetTenantId() int64 {
|
|
|
+ if x != nil {
|
|
|
+ return x.TenantId
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerReq) GetType() int64 {
|
|
|
+ if x != nil {
|
|
|
+ return x.Type
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerReq) GetAppId() string {
|
|
|
+ if x != nil {
|
|
|
+ return x.AppId
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+type FindAnswerResp struct {
|
|
|
+ state protoimpl.MessageState
|
|
|
+ sizeCache protoimpl.SizeCache
|
|
|
+ unknownFields protoimpl.UnknownFields
|
|
|
+
|
|
|
+ ErrorCode int64 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` //响应代码
|
|
|
+ ErrorMsg string `protobuf:"bytes,2,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` //响应消息
|
|
|
+ Data *Question `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` //响应内容
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerResp) Reset() {
|
|
|
+ *x = FindAnswerResp{}
|
|
|
+ if protoimpl.UnsafeEnabled {
|
|
|
+ mi := &file_knowledge_proto_msgTypes[4]
|
|
|
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
+ ms.StoreMessageInfo(mi)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerResp) String() string {
|
|
|
+ return protoimpl.X.MessageStringOf(x)
|
|
|
+}
|
|
|
+
|
|
|
+func (*FindAnswerResp) ProtoMessage() {}
|
|
|
+
|
|
|
+func (x *FindAnswerResp) ProtoReflect() protoreflect.Message {
|
|
|
+ mi := &file_knowledge_proto_msgTypes[4]
|
|
|
+ if protoimpl.UnsafeEnabled && x != nil {
|
|
|
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
+ if ms.LoadMessageInfo() == nil {
|
|
|
+ ms.StoreMessageInfo(mi)
|
|
|
+ }
|
|
|
+ return ms
|
|
|
+ }
|
|
|
+ return mi.MessageOf(x)
|
|
|
+}
|
|
|
+
|
|
|
+// Deprecated: Use FindAnswerResp.ProtoReflect.Descriptor instead.
|
|
|
+func (*FindAnswerResp) Descriptor() ([]byte, []int) {
|
|
|
+ return file_knowledge_proto_rawDescGZIP(), []int{4}
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerResp) GetErrorCode() int64 {
|
|
|
+ if x != nil {
|
|
|
+ return x.ErrorCode
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerResp) GetErrorMsg() string {
|
|
|
+ if x != nil {
|
|
|
+ return x.ErrorMsg
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func (x *FindAnswerResp) GetData() *Question {
|
|
|
+ if x != nil {
|
|
|
+ return x.Data
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
+type RecommendAnswerResp struct {
|
|
|
+ state protoimpl.MessageState
|
|
|
+ sizeCache protoimpl.SizeCache
|
|
|
+ unknownFields protoimpl.UnknownFields
|
|
|
+
|
|
|
+ ErrorCode int64 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` //响应代码
|
|
|
+ ErrorMsg string `protobuf:"bytes,2,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` //响应消息
|
|
|
+ Data []*Question `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"` //响应内容
|
|
|
+}
|
|
|
+
|
|
|
+func (x *RecommendAnswerResp) Reset() {
|
|
|
+ *x = RecommendAnswerResp{}
|
|
|
+ if protoimpl.UnsafeEnabled {
|
|
|
+ mi := &file_knowledge_proto_msgTypes[5]
|
|
|
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
+ ms.StoreMessageInfo(mi)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func (x *RecommendAnswerResp) String() string {
|
|
|
+ return protoimpl.X.MessageStringOf(x)
|
|
|
+}
|
|
|
+
|
|
|
+func (*RecommendAnswerResp) ProtoMessage() {}
|
|
|
+
|
|
|
+func (x *RecommendAnswerResp) ProtoReflect() protoreflect.Message {
|
|
|
+ mi := &file_knowledge_proto_msgTypes[5]
|
|
|
+ if protoimpl.UnsafeEnabled && x != nil {
|
|
|
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
|
+ if ms.LoadMessageInfo() == nil {
|
|
|
+ ms.StoreMessageInfo(mi)
|
|
|
+ }
|
|
|
+ return ms
|
|
|
+ }
|
|
|
+ return mi.MessageOf(x)
|
|
|
+}
|
|
|
+
|
|
|
+// Deprecated: Use RecommendAnswerResp.ProtoReflect.Descriptor instead.
|
|
|
+func (*RecommendAnswerResp) Descriptor() ([]byte, []int) {
|
|
|
+ return file_knowledge_proto_rawDescGZIP(), []int{5}
|
|
|
+}
|
|
|
+
|
|
|
+func (x *RecommendAnswerResp) GetErrorCode() int64 {
|
|
|
+ if x != nil {
|
|
|
+ return x.ErrorCode
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+func (x *RecommendAnswerResp) GetErrorMsg() string {
|
|
|
+ if x != nil {
|
|
|
+ return x.ErrorMsg
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func (x *RecommendAnswerResp) GetData() []*Question {
|
|
|
+ if x != nil {
|
|
|
+ return x.Data
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
var File_knowledge_proto protoreflect.FileDescriptor
|
|
|
|
|
|
var file_knowledge_proto_rawDesc = []byte{
|
|
|
0x0a, 0x0f, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
|
|
- 0x6f, 0x12, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x40, 0x0a, 0x0a, 0x41,
|
|
|
- 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x65,
|
|
|
- 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x65,
|
|
|
- 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18,
|
|
|
- 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x22, 0x5d, 0x0a,
|
|
|
- 0x0b, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a,
|
|
|
- 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
|
|
|
- 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65,
|
|
|
- 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
|
|
|
- 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
|
|
|
- 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x45, 0x0a, 0x09,
|
|
|
- 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x6b, 0x6e, 0x6f,
|
|
|
- 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x12, 0x14, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
|
|
|
- 0x65, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x74,
|
|
|
- 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
|
|
- 0x6e, 0x73, 0x65, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64,
|
|
|
- 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
|
+ 0x6f, 0x12, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x4f, 0x0a, 0x08, 0x51,
|
|
|
+ 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x18, 0x01,
|
|
|
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x65, 0x73,
|
|
|
+ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x65, 0x73,
|
|
|
+ 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x03,
|
|
|
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x22, 0x40, 0x0a, 0x0a,
|
|
|
+ 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75,
|
|
|
+ 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75,
|
|
|
+ 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72,
|
|
|
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x22, 0x5d,
|
|
|
+ 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a,
|
|
|
+ 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
|
|
+ 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09,
|
|
|
+ 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
|
|
+ 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74,
|
|
|
+ 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x71, 0x0a,
|
|
|
+ 0x0d, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a,
|
|
|
+ 0x0a, 0x08, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
|
|
+ 0x52, 0x08, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65,
|
|
|
+ 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x65,
|
|
|
+ 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03,
|
|
|
+ 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70,
|
|
|
+ 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64,
|
|
|
+ 0x22, 0x74, 0x0a, 0x0e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65,
|
|
|
+ 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65,
|
|
|
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64,
|
|
|
+ 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02,
|
|
|
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x26,
|
|
|
+ 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74,
|
|
|
+ 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e,
|
|
|
+ 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x79, 0x0a, 0x13, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d,
|
|
|
+ 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a,
|
|
|
+ 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
|
|
+ 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09,
|
|
|
+ 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
|
|
+ 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x26, 0x0a, 0x04, 0x64, 0x61, 0x74,
|
|
|
+ 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
|
|
|
+ 0x74, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74,
|
|
|
+ 0x61, 0x32, 0xd1, 0x01, 0x0a, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x12,
|
|
|
+ 0x38, 0x0a, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x12, 0x14, 0x2e, 0x74,
|
|
|
+ 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
|
|
|
+ 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x64,
|
|
|
+ 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x46, 0x69, 0x6e,
|
|
|
+ 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
|
|
|
+ 0x74, 0x65, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71,
|
|
|
+ 0x1a, 0x18, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x46, 0x69, 0x6e, 0x64,
|
|
|
+ 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x0f, 0x52, 0x65,
|
|
|
+ 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x17, 0x2e,
|
|
|
+ 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x73,
|
|
|
+ 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
|
|
|
+ 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65,
|
|
|
+ 0x72, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6c,
|
|
|
+ 0x65, 0x64, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
|
}
|
|
|
|
|
|
var (
|
|
@@ -177,19 +473,29 @@ func file_knowledge_proto_rawDescGZIP() []byte {
|
|
|
return file_knowledge_proto_rawDescData
|
|
|
}
|
|
|
|
|
|
-var file_knowledge_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
|
|
+var file_knowledge_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
|
|
var file_knowledge_proto_goTypes = []interface{}{
|
|
|
- (*AddRequest)(nil), // 0: template.AddRequest
|
|
|
- (*AddResponse)(nil), // 1: template.AddResponse
|
|
|
+ (*Question)(nil), // 0: template.Question
|
|
|
+ (*AddRequest)(nil), // 1: template.AddRequest
|
|
|
+ (*AddResponse)(nil), // 2: template.AddResponse
|
|
|
+ (*FindAnswerReq)(nil), // 3: template.FindAnswerReq
|
|
|
+ (*FindAnswerResp)(nil), // 4: template.FindAnswerResp
|
|
|
+ (*RecommendAnswerResp)(nil), // 5: template.RecommendAnswerResp
|
|
|
}
|
|
|
var file_knowledge_proto_depIdxs = []int32{
|
|
|
- 0, // 0: template.knowledge.knowledge:input_type -> template.AddRequest
|
|
|
- 1, // 1: template.knowledge.knowledge:output_type -> template.AddResponse
|
|
|
- 1, // [1:2] is the sub-list for method output_type
|
|
|
- 0, // [0:1] is the sub-list for method input_type
|
|
|
- 0, // [0:0] is the sub-list for extension type_name
|
|
|
- 0, // [0:0] is the sub-list for extension extendee
|
|
|
- 0, // [0:0] is the sub-list for field type_name
|
|
|
+ 0, // 0: template.FindAnswerResp.data:type_name -> template.Question
|
|
|
+ 0, // 1: template.RecommendAnswerResp.data:type_name -> template.Question
|
|
|
+ 1, // 2: template.knowledge.knowledge:input_type -> template.AddRequest
|
|
|
+ 3, // 3: template.knowledge.FindAnswer:input_type -> template.FindAnswerReq
|
|
|
+ 3, // 4: template.knowledge.RecommendAnswer:input_type -> template.FindAnswerReq
|
|
|
+ 2, // 5: template.knowledge.knowledge:output_type -> template.AddResponse
|
|
|
+ 4, // 6: template.knowledge.FindAnswer:output_type -> template.FindAnswerResp
|
|
|
+ 5, // 7: template.knowledge.RecommendAnswer:output_type -> template.RecommendAnswerResp
|
|
|
+ 5, // [5:8] is the sub-list for method output_type
|
|
|
+ 2, // [2:5] is the sub-list for method input_type
|
|
|
+ 2, // [2:2] is the sub-list for extension type_name
|
|
|
+ 2, // [2:2] is the sub-list for extension extendee
|
|
|
+ 0, // [0:2] is the sub-list for field type_name
|
|
|
}
|
|
|
|
|
|
func init() { file_knowledge_proto_init() }
|
|
@@ -199,7 +505,7 @@ func file_knowledge_proto_init() {
|
|
|
}
|
|
|
if !protoimpl.UnsafeEnabled {
|
|
|
file_knowledge_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
|
- switch v := v.(*AddRequest); i {
|
|
|
+ switch v := v.(*Question); i {
|
|
|
case 0:
|
|
|
return &v.state
|
|
|
case 1:
|
|
@@ -211,6 +517,18 @@ func file_knowledge_proto_init() {
|
|
|
}
|
|
|
}
|
|
|
file_knowledge_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
|
|
+ switch v := v.(*AddRequest); i {
|
|
|
+ case 0:
|
|
|
+ return &v.state
|
|
|
+ case 1:
|
|
|
+ return &v.sizeCache
|
|
|
+ case 2:
|
|
|
+ return &v.unknownFields
|
|
|
+ default:
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ }
|
|
|
+ file_knowledge_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
|
|
switch v := v.(*AddResponse); i {
|
|
|
case 0:
|
|
|
return &v.state
|
|
@@ -222,6 +540,42 @@ func file_knowledge_proto_init() {
|
|
|
return nil
|
|
|
}
|
|
|
}
|
|
|
+ file_knowledge_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
|
|
+ switch v := v.(*FindAnswerReq); i {
|
|
|
+ case 0:
|
|
|
+ return &v.state
|
|
|
+ case 1:
|
|
|
+ return &v.sizeCache
|
|
|
+ case 2:
|
|
|
+ return &v.unknownFields
|
|
|
+ default:
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ }
|
|
|
+ file_knowledge_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
|
|
+ switch v := v.(*FindAnswerResp); i {
|
|
|
+ case 0:
|
|
|
+ return &v.state
|
|
|
+ case 1:
|
|
|
+ return &v.sizeCache
|
|
|
+ case 2:
|
|
|
+ return &v.unknownFields
|
|
|
+ default:
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ }
|
|
|
+ file_knowledge_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
|
|
+ switch v := v.(*RecommendAnswerResp); i {
|
|
|
+ case 0:
|
|
|
+ return &v.state
|
|
|
+ case 1:
|
|
|
+ return &v.sizeCache
|
|
|
+ case 2:
|
|
|
+ return &v.unknownFields
|
|
|
+ default:
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
type x struct{}
|
|
|
out := protoimpl.TypeBuilder{
|
|
@@ -229,7 +583,7 @@ func file_knowledge_proto_init() {
|
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
|
RawDescriptor: file_knowledge_proto_rawDesc,
|
|
|
NumEnums: 0,
|
|
|
- NumMessages: 2,
|
|
|
+ NumMessages: 6,
|
|
|
NumExtensions: 0,
|
|
|
NumServices: 1,
|
|
|
},
|
|
@@ -256,6 +610,8 @@ const _ = grpc.SupportPackageIsVersion6
|
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
|
type KnowledgeClient interface {
|
|
|
Knowledge(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error)
|
|
|
+ FindAnswer(ctx context.Context, in *FindAnswerReq, opts ...grpc.CallOption) (*FindAnswerResp, error)
|
|
|
+ RecommendAnswer(ctx context.Context, in *FindAnswerReq, opts ...grpc.CallOption) (*RecommendAnswerResp, error)
|
|
|
}
|
|
|
|
|
|
type knowledgeClient struct {
|
|
@@ -275,9 +631,29 @@ func (c *knowledgeClient) Knowledge(ctx context.Context, in *AddRequest, opts ..
|
|
|
return out, nil
|
|
|
}
|
|
|
|
|
|
+func (c *knowledgeClient) FindAnswer(ctx context.Context, in *FindAnswerReq, opts ...grpc.CallOption) (*FindAnswerResp, error) {
|
|
|
+ out := new(FindAnswerResp)
|
|
|
+ err := c.cc.Invoke(ctx, "/template.knowledge/FindAnswer", in, out, opts...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return out, nil
|
|
|
+}
|
|
|
+
|
|
|
+func (c *knowledgeClient) RecommendAnswer(ctx context.Context, in *FindAnswerReq, opts ...grpc.CallOption) (*RecommendAnswerResp, error) {
|
|
|
+ out := new(RecommendAnswerResp)
|
|
|
+ err := c.cc.Invoke(ctx, "/template.knowledge/RecommendAnswer", in, out, opts...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return out, nil
|
|
|
+}
|
|
|
+
|
|
|
// KnowledgeServer is the server API for Knowledge service.
|
|
|
type KnowledgeServer interface {
|
|
|
Knowledge(context.Context, *AddRequest) (*AddResponse, error)
|
|
|
+ FindAnswer(context.Context, *FindAnswerReq) (*FindAnswerResp, error)
|
|
|
+ RecommendAnswer(context.Context, *FindAnswerReq) (*RecommendAnswerResp, error)
|
|
|
}
|
|
|
|
|
|
// UnimplementedKnowledgeServer can be embedded to have forward compatible implementations.
|
|
@@ -287,6 +663,12 @@ type UnimplementedKnowledgeServer struct {
|
|
|
func (*UnimplementedKnowledgeServer) Knowledge(context.Context, *AddRequest) (*AddResponse, error) {
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Knowledge not implemented")
|
|
|
}
|
|
|
+func (*UnimplementedKnowledgeServer) FindAnswer(context.Context, *FindAnswerReq) (*FindAnswerResp, error) {
|
|
|
+ return nil, status.Errorf(codes.Unimplemented, "method FindAnswer not implemented")
|
|
|
+}
|
|
|
+func (*UnimplementedKnowledgeServer) RecommendAnswer(context.Context, *FindAnswerReq) (*RecommendAnswerResp, error) {
|
|
|
+ return nil, status.Errorf(codes.Unimplemented, "method RecommendAnswer not implemented")
|
|
|
+}
|
|
|
|
|
|
func RegisterKnowledgeServer(s *grpc.Server, srv KnowledgeServer) {
|
|
|
s.RegisterService(&_Knowledge_serviceDesc, srv)
|
|
@@ -310,6 +692,42 @@ func _Knowledge_Knowledge_Handler(srv interface{}, ctx context.Context, dec func
|
|
|
return interceptor(ctx, in, info, handler)
|
|
|
}
|
|
|
|
|
|
+func _Knowledge_FindAnswer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
+ in := new(FindAnswerReq)
|
|
|
+ if err := dec(in); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if interceptor == nil {
|
|
|
+ return srv.(KnowledgeServer).FindAnswer(ctx, in)
|
|
|
+ }
|
|
|
+ info := &grpc.UnaryServerInfo{
|
|
|
+ Server: srv,
|
|
|
+ FullMethod: "/template.knowledge/FindAnswer",
|
|
|
+ }
|
|
|
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
+ return srv.(KnowledgeServer).FindAnswer(ctx, req.(*FindAnswerReq))
|
|
|
+ }
|
|
|
+ return interceptor(ctx, in, info, handler)
|
|
|
+}
|
|
|
+
|
|
|
+func _Knowledge_RecommendAnswer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
+ in := new(FindAnswerReq)
|
|
|
+ if err := dec(in); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if interceptor == nil {
|
|
|
+ return srv.(KnowledgeServer).RecommendAnswer(ctx, in)
|
|
|
+ }
|
|
|
+ info := &grpc.UnaryServerInfo{
|
|
|
+ Server: srv,
|
|
|
+ FullMethod: "/template.knowledge/RecommendAnswer",
|
|
|
+ }
|
|
|
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
+ return srv.(KnowledgeServer).RecommendAnswer(ctx, req.(*FindAnswerReq))
|
|
|
+ }
|
|
|
+ return interceptor(ctx, in, info, handler)
|
|
|
+}
|
|
|
+
|
|
|
var _Knowledge_serviceDesc = grpc.ServiceDesc{
|
|
|
ServiceName: "template.knowledge",
|
|
|
HandlerType: (*KnowledgeServer)(nil),
|
|
@@ -318,6 +736,14 @@ var _Knowledge_serviceDesc = grpc.ServiceDesc{
|
|
|
MethodName: "knowledge",
|
|
|
Handler: _Knowledge_Knowledge_Handler,
|
|
|
},
|
|
|
+ {
|
|
|
+ MethodName: "FindAnswer",
|
|
|
+ Handler: _Knowledge_FindAnswer_Handler,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ MethodName: "RecommendAnswer",
|
|
|
+ Handler: _Knowledge_RecommendAnswer_Handler,
|
|
|
+ },
|
|
|
},
|
|
|
Streams: []grpc.StreamDesc{},
|
|
|
Metadata: "knowledge.proto",
|