yourproject

package
v0.0.0-...-15e837a Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KnowledgeBaseService_CreateKnowledgeBase_FullMethodName = "/rag_service.KnowledgeBaseService/CreateKnowledgeBase"
	KnowledgeBaseService_ListKnowledgeBases_FullMethodName  = "/rag_service.KnowledgeBaseService/ListKnowledgeBases"
	KnowledgeBaseService_UploadDocument_FullMethodName      = "/rag_service.KnowledgeBaseService/UploadDocument"
	KnowledgeBaseService_RetrieveInfo_FullMethodName        = "/rag_service.KnowledgeBaseService/RetrieveInfo"
	KnowledgeBaseService_ListEmbeddingModels_FullMethodName = "/rag_service.KnowledgeBaseService/ListEmbeddingModels"
	KnowledgeBaseService_ListDocuments_FullMethodName       = "/rag_service.KnowledgeBaseService/ListDocuments"
	KnowledgeBaseService_DeleteKnowledgeBase_FullMethodName = "/rag_service.KnowledgeBaseService/DeleteKnowledgeBase"
	KnowledgeBaseService_DeleteDocument_FullMethodName      = "/rag_service.KnowledgeBaseService/DeleteDocument"
)

Variables

View Source
var File_rag_service_proto protoreflect.FileDescriptor
View Source
var KnowledgeBaseService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "rag_service.KnowledgeBaseService",
	HandlerType: (*KnowledgeBaseServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateKnowledgeBase",
			Handler:    _KnowledgeBaseService_CreateKnowledgeBase_Handler,
		},
		{
			MethodName: "ListKnowledgeBases",
			Handler:    _KnowledgeBaseService_ListKnowledgeBases_Handler,
		},
		{
			MethodName: "UploadDocument",
			Handler:    _KnowledgeBaseService_UploadDocument_Handler,
		},
		{
			MethodName: "RetrieveInfo",
			Handler:    _KnowledgeBaseService_RetrieveInfo_Handler,
		},
		{
			MethodName: "ListEmbeddingModels",
			Handler:    _KnowledgeBaseService_ListEmbeddingModels_Handler,
		},
		{
			MethodName: "ListDocuments",
			Handler:    _KnowledgeBaseService_ListDocuments_Handler,
		},
		{
			MethodName: "DeleteKnowledgeBase",
			Handler:    _KnowledgeBaseService_DeleteKnowledgeBase_Handler,
		},
		{
			MethodName: "DeleteDocument",
			Handler:    _KnowledgeBaseService_DeleteDocument_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "rag_service.proto",
}

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

Functions

func RegisterKnowledgeBaseServiceServer

func RegisterKnowledgeBaseServiceServer(s grpc.ServiceRegistrar, srv KnowledgeBaseServiceServer)

Types

type CreateKBRequest

type CreateKBRequest struct {
	Uid            string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`                                             // 用户ID
	KbName         string `protobuf:"bytes,2,opt,name=kb_name,json=kbName,proto3" json:"kb_name,omitempty"`                         // 知识库名称
	EmbeddingModel string `protobuf:"bytes,3,opt,name=embedding_model,json=embeddingModel,proto3" json:"embedding_model,omitempty"` // (可选) 指定Embedding模型, 留空则使用默认
	// contains filtered or unexported fields
}

创建知识库请求

func (*CreateKBRequest) Descriptor deprecated

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

Deprecated: Use CreateKBRequest.ProtoReflect.Descriptor instead.

func (*CreateKBRequest) GetEmbeddingModel

func (x *CreateKBRequest) GetEmbeddingModel() string

func (*CreateKBRequest) GetKbName

func (x *CreateKBRequest) GetKbName() string

func (*CreateKBRequest) GetUid

func (x *CreateKBRequest) GetUid() string

func (*CreateKBRequest) ProtoMessage

func (*CreateKBRequest) ProtoMessage()

func (*CreateKBRequest) ProtoReflect

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

func (*CreateKBRequest) Reset

func (x *CreateKBRequest) Reset()

func (*CreateKBRequest) String

func (x *CreateKBRequest) String() string

type CreateKBResponse

type CreateKBResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`      // 是否成功
	KbId    string `protobuf:"bytes,2,opt,name=kb_id,json=kbId,proto3" json:"kb_id,omitempty"` // 知识库ID
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`       // 响应消息
	// contains filtered or unexported fields
}

创建知识库响应

func (*CreateKBResponse) Descriptor deprecated

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

Deprecated: Use CreateKBResponse.ProtoReflect.Descriptor instead.

func (*CreateKBResponse) GetKbId

func (x *CreateKBResponse) GetKbId() string

func (*CreateKBResponse) GetMessage

func (x *CreateKBResponse) GetMessage() string

func (*CreateKBResponse) GetSuccess

func (x *CreateKBResponse) GetSuccess() bool

func (*CreateKBResponse) ProtoMessage

func (*CreateKBResponse) ProtoMessage()

func (*CreateKBResponse) ProtoReflect

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

func (*CreateKBResponse) Reset

func (x *CreateKBResponse) Reset()

func (*CreateKBResponse) String

func (x *CreateKBResponse) String() string

type DeleteDocRequest

type DeleteDocRequest struct {
	Uid   string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`                  // 用户ID
	KbId  string `protobuf:"bytes,2,opt,name=kb_id,json=kbId,proto3" json:"kb_id,omitempty"`    // 知识库ID
	DocId string `protobuf:"bytes,3,opt,name=doc_id,json=docId,proto3" json:"doc_id,omitempty"` // 文档ID
	// contains filtered or unexported fields
}

删除文档请求

func (*DeleteDocRequest) Descriptor deprecated

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

Deprecated: Use DeleteDocRequest.ProtoReflect.Descriptor instead.

func (*DeleteDocRequest) GetDocId

func (x *DeleteDocRequest) GetDocId() string

func (*DeleteDocRequest) GetKbId

func (x *DeleteDocRequest) GetKbId() string

func (*DeleteDocRequest) GetUid

func (x *DeleteDocRequest) GetUid() string

func (*DeleteDocRequest) ProtoMessage

func (*DeleteDocRequest) ProtoMessage()

func (*DeleteDocRequest) ProtoReflect

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

func (*DeleteDocRequest) Reset

func (x *DeleteDocRequest) Reset()

func (*DeleteDocRequest) String

func (x *DeleteDocRequest) String() string

type DeleteDocResponse

type DeleteDocResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // 是否成功
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`  // 响应消息
	// contains filtered or unexported fields
}

删除文档响应

func (*DeleteDocResponse) Descriptor deprecated

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

Deprecated: Use DeleteDocResponse.ProtoReflect.Descriptor instead.

func (*DeleteDocResponse) GetMessage

func (x *DeleteDocResponse) GetMessage() string

func (*DeleteDocResponse) GetSuccess

func (x *DeleteDocResponse) GetSuccess() bool

func (*DeleteDocResponse) ProtoMessage

func (*DeleteDocResponse) ProtoMessage()

func (*DeleteDocResponse) ProtoReflect

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

func (*DeleteDocResponse) Reset

func (x *DeleteDocResponse) Reset()

func (*DeleteDocResponse) String

func (x *DeleteDocResponse) String() string

type DeleteKBRequest

type DeleteKBRequest struct {
	Uid  string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`               // 用户ID
	KbId string `protobuf:"bytes,2,opt,name=kb_id,json=kbId,proto3" json:"kb_id,omitempty"` // 知识库ID
	// contains filtered or unexported fields
}

删除知识库请求

func (*DeleteKBRequest) Descriptor deprecated

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

Deprecated: Use DeleteKBRequest.ProtoReflect.Descriptor instead.

func (*DeleteKBRequest) GetKbId

func (x *DeleteKBRequest) GetKbId() string

func (*DeleteKBRequest) GetUid

func (x *DeleteKBRequest) GetUid() string

func (*DeleteKBRequest) ProtoMessage

func (*DeleteKBRequest) ProtoMessage()

func (*DeleteKBRequest) ProtoReflect

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

func (*DeleteKBRequest) Reset

func (x *DeleteKBRequest) Reset()

func (*DeleteKBRequest) String

func (x *DeleteKBRequest) String() string

type DeleteKBResponse

type DeleteKBResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // 是否成功
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`  // 响应消息
	// contains filtered or unexported fields
}

删除知识库响应

func (*DeleteKBResponse) Descriptor deprecated

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

Deprecated: Use DeleteKBResponse.ProtoReflect.Descriptor instead.

func (*DeleteKBResponse) GetMessage

func (x *DeleteKBResponse) GetMessage() string

func (*DeleteKBResponse) GetSuccess

func (x *DeleteKBResponse) GetSuccess() bool

func (*DeleteKBResponse) ProtoMessage

func (*DeleteKBResponse) ProtoMessage()

func (*DeleteKBResponse) ProtoReflect

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

func (*DeleteKBResponse) Reset

func (x *DeleteKBResponse) Reset()

func (*DeleteKBResponse) String

func (x *DeleteKBResponse) String() string

type DocumentInfo

type DocumentInfo struct {
	DocId     string `protobuf:"bytes,1,opt,name=doc_id,json=docId,proto3" json:"doc_id,omitempty"`             // 文档ID
	KbId      string `protobuf:"bytes,2,opt,name=kb_id,json=kbId,proto3" json:"kb_id,omitempty"`                // 知识库ID
	DocName   string `protobuf:"bytes,3,opt,name=doc_name,json=docName,proto3" json:"doc_name,omitempty"`       // 文档名称
	FileType  string `protobuf:"bytes,4,opt,name=file_type,json=fileType,proto3" json:"file_type,omitempty"`    // 文件类型
	CreatedAt string `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // 创建时间
	// contains filtered or unexported fields
}

Document information

func (*DocumentInfo) Descriptor deprecated

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

Deprecated: Use DocumentInfo.ProtoReflect.Descriptor instead.

func (*DocumentInfo) GetCreatedAt

func (x *DocumentInfo) GetCreatedAt() string

func (*DocumentInfo) GetDocId

func (x *DocumentInfo) GetDocId() string

func (*DocumentInfo) GetDocName

func (x *DocumentInfo) GetDocName() string

func (*DocumentInfo) GetFileType

func (x *DocumentInfo) GetFileType() string

func (*DocumentInfo) GetKbId

func (x *DocumentInfo) GetKbId() string

func (*DocumentInfo) ProtoMessage

func (*DocumentInfo) ProtoMessage()

func (*DocumentInfo) ProtoReflect

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

func (*DocumentInfo) Reset

func (x *DocumentInfo) Reset()

func (*DocumentInfo) String

func (x *DocumentInfo) String() string

type KnowledgeBaseInfo

type KnowledgeBaseInfo struct {
	KbId           string `protobuf:"bytes,1,opt,name=kb_id,json=kbId,proto3" json:"kb_id,omitempty"`                               // 知识库ID
	KbName         string `protobuf:"bytes,2,opt,name=kb_name,json=kbName,proto3" json:"kb_name,omitempty"`                         // 知识库名称
	EmbeddingModel string `protobuf:"bytes,3,opt,name=embedding_model,json=embeddingModel,proto3" json:"embedding_model,omitempty"` // 使用的Embedding模型
	// contains filtered or unexported fields
}

知识库信息

func (*KnowledgeBaseInfo) Descriptor deprecated

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

Deprecated: Use KnowledgeBaseInfo.ProtoReflect.Descriptor instead.

func (*KnowledgeBaseInfo) GetEmbeddingModel

func (x *KnowledgeBaseInfo) GetEmbeddingModel() string

func (*KnowledgeBaseInfo) GetKbId

func (x *KnowledgeBaseInfo) GetKbId() string

func (*KnowledgeBaseInfo) GetKbName

func (x *KnowledgeBaseInfo) GetKbName() string

func (*KnowledgeBaseInfo) ProtoMessage

func (*KnowledgeBaseInfo) ProtoMessage()

func (*KnowledgeBaseInfo) ProtoReflect

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

func (*KnowledgeBaseInfo) Reset

func (x *KnowledgeBaseInfo) Reset()

func (*KnowledgeBaseInfo) String

func (x *KnowledgeBaseInfo) String() string

type KnowledgeBaseServiceClient

type KnowledgeBaseServiceClient interface {
	// 创建知识库
	CreateKnowledgeBase(ctx context.Context, in *CreateKBRequest, opts ...grpc.CallOption) (*CreateKBResponse, error)
	// 获取用户的所有知识库
	ListKnowledgeBases(ctx context.Context, in *ListKBsRequest, opts ...grpc.CallOption) (*ListKBsResponse, error)
	// 上传并处理文档
	UploadDocument(ctx context.Context, in *UploadDocRequest, opts ...grpc.CallOption) (*UploadDocResponse, error)
	// 从知识库检索信息
	RetrieveInfo(ctx context.Context, in *RetrieveRequest, opts ...grpc.CallOption) (*RetrieveResponse, error)
	// 获取支持的Embedding模型列表
	ListEmbeddingModels(ctx context.Context, in *ListEmbeddingModelsRequest, opts ...grpc.CallOption) (*ListEmbeddingModelsResponse, error)
	// 获取知识库中的文档列表
	ListDocuments(ctx context.Context, in *ListDocsRequest, opts ...grpc.CallOption) (*ListDocsResponse, error)
	// 删除知识库
	DeleteKnowledgeBase(ctx context.Context, in *DeleteKBRequest, opts ...grpc.CallOption) (*DeleteKBResponse, error)
	// 删除文档
	DeleteDocument(ctx context.Context, in *DeleteDocRequest, opts ...grpc.CallOption) (*DeleteDocResponse, error)
}

KnowledgeBaseServiceClient is the client API for KnowledgeBaseService 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.

type KnowledgeBaseServiceServer

type KnowledgeBaseServiceServer interface {
	// 创建知识库
	CreateKnowledgeBase(context.Context, *CreateKBRequest) (*CreateKBResponse, error)
	// 获取用户的所有知识库
	ListKnowledgeBases(context.Context, *ListKBsRequest) (*ListKBsResponse, error)
	// 上传并处理文档
	UploadDocument(context.Context, *UploadDocRequest) (*UploadDocResponse, error)
	// 从知识库检索信息
	RetrieveInfo(context.Context, *RetrieveRequest) (*RetrieveResponse, error)
	// 获取支持的Embedding模型列表
	ListEmbeddingModels(context.Context, *ListEmbeddingModelsRequest) (*ListEmbeddingModelsResponse, error)
	// 获取知识库中的文档列表
	ListDocuments(context.Context, *ListDocsRequest) (*ListDocsResponse, error)
	// 删除知识库
	DeleteKnowledgeBase(context.Context, *DeleteKBRequest) (*DeleteKBResponse, error)
	// 删除文档
	DeleteDocument(context.Context, *DeleteDocRequest) (*DeleteDocResponse, error)
	// contains filtered or unexported methods
}

KnowledgeBaseServiceServer is the server API for KnowledgeBaseService service. All implementations must embed UnimplementedKnowledgeBaseServiceServer for forward compatibility

type ListDocsRequest

type ListDocsRequest struct {
	KbId string `protobuf:"bytes,1,opt,name=kb_id,json=kbId,proto3" json:"kb_id,omitempty"` // 知识库ID
	// contains filtered or unexported fields
}

获取知识库文档列表请求

func (*ListDocsRequest) Descriptor deprecated

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

Deprecated: Use ListDocsRequest.ProtoReflect.Descriptor instead.

func (*ListDocsRequest) GetKbId

func (x *ListDocsRequest) GetKbId() string

func (*ListDocsRequest) ProtoMessage

func (*ListDocsRequest) ProtoMessage()

func (*ListDocsRequest) ProtoReflect

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

func (*ListDocsRequest) Reset

func (x *ListDocsRequest) Reset()

func (*ListDocsRequest) String

func (x *ListDocsRequest) String() string

type ListDocsResponse

type ListDocsResponse struct {
	Success bool            `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // 是否成功
	Docs    []*DocumentInfo `protobuf:"bytes,2,rep,name=docs,proto3" json:"docs,omitempty"`        // 文档信息列表
	Message string          `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`  // 响应消息
	// contains filtered or unexported fields
}

获取知识库文档列表响应

func (*ListDocsResponse) Descriptor deprecated

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

Deprecated: Use ListDocsResponse.ProtoReflect.Descriptor instead.

func (*ListDocsResponse) GetDocs

func (x *ListDocsResponse) GetDocs() []*DocumentInfo

func (*ListDocsResponse) GetMessage

func (x *ListDocsResponse) GetMessage() string

func (*ListDocsResponse) GetSuccess

func (x *ListDocsResponse) GetSuccess() bool

func (*ListDocsResponse) ProtoMessage

func (*ListDocsResponse) ProtoMessage()

func (*ListDocsResponse) ProtoReflect

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

func (*ListDocsResponse) Reset

func (x *ListDocsResponse) Reset()

func (*ListDocsResponse) String

func (x *ListDocsResponse) String() string

type ListEmbeddingModelsRequest

type ListEmbeddingModelsRequest struct {
	// contains filtered or unexported fields
}

获取支持的Embedding模型列表请求 (空)

func (*ListEmbeddingModelsRequest) Descriptor deprecated

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

Deprecated: Use ListEmbeddingModelsRequest.ProtoReflect.Descriptor instead.

func (*ListEmbeddingModelsRequest) ProtoMessage

func (*ListEmbeddingModelsRequest) ProtoMessage()

func (*ListEmbeddingModelsRequest) ProtoReflect

func (*ListEmbeddingModelsRequest) Reset

func (x *ListEmbeddingModelsRequest) Reset()

func (*ListEmbeddingModelsRequest) String

func (x *ListEmbeddingModelsRequest) String() string

type ListEmbeddingModelsResponse

type ListEmbeddingModelsResponse struct {
	Success bool     `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // 是否成功
	Models  []string `protobuf:"bytes,2,rep,name=models,proto3" json:"models,omitempty"`    // 支持的模型名称列表
	Message string   `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`  // 响应消息
	// contains filtered or unexported fields
}

获取支持的Embedding模型列表响应

func (*ListEmbeddingModelsResponse) Descriptor deprecated

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

Deprecated: Use ListEmbeddingModelsResponse.ProtoReflect.Descriptor instead.

func (*ListEmbeddingModelsResponse) GetMessage

func (x *ListEmbeddingModelsResponse) GetMessage() string

func (*ListEmbeddingModelsResponse) GetModels

func (x *ListEmbeddingModelsResponse) GetModels() []string

func (*ListEmbeddingModelsResponse) GetSuccess

func (x *ListEmbeddingModelsResponse) GetSuccess() bool

func (*ListEmbeddingModelsResponse) ProtoMessage

func (*ListEmbeddingModelsResponse) ProtoMessage()

func (*ListEmbeddingModelsResponse) ProtoReflect

func (*ListEmbeddingModelsResponse) Reset

func (x *ListEmbeddingModelsResponse) Reset()

func (*ListEmbeddingModelsResponse) String

func (x *ListEmbeddingModelsResponse) String() string

type ListKBsRequest

type ListKBsRequest struct {
	Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID
	// contains filtered or unexported fields
}

获取用户知识库列表请求

func (*ListKBsRequest) Descriptor deprecated

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

Deprecated: Use ListKBsRequest.ProtoReflect.Descriptor instead.

func (*ListKBsRequest) GetUid

func (x *ListKBsRequest) GetUid() string

func (*ListKBsRequest) ProtoMessage

func (*ListKBsRequest) ProtoMessage()

func (*ListKBsRequest) ProtoReflect

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

func (*ListKBsRequest) Reset

func (x *ListKBsRequest) Reset()

func (*ListKBsRequest) String

func (x *ListKBsRequest) String() string

type ListKBsResponse

type ListKBsResponse struct {
	Success bool                 `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // 是否成功
	Kbs     []*KnowledgeBaseInfo `protobuf:"bytes,2,rep,name=kbs,proto3" json:"kbs,omitempty"`          // 知识库信息列表
	Message string               `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`  // 响应消息
	// contains filtered or unexported fields
}

获取用户知识库列表响应

func (*ListKBsResponse) Descriptor deprecated

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

Deprecated: Use ListKBsResponse.ProtoReflect.Descriptor instead.

func (*ListKBsResponse) GetKbs

func (x *ListKBsResponse) GetKbs() []*KnowledgeBaseInfo

func (*ListKBsResponse) GetMessage

func (x *ListKBsResponse) GetMessage() string

func (*ListKBsResponse) GetSuccess

func (x *ListKBsResponse) GetSuccess() bool

func (*ListKBsResponse) ProtoMessage

func (*ListKBsResponse) ProtoMessage()

func (*ListKBsResponse) ProtoReflect

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

func (*ListKBsResponse) Reset

func (x *ListKBsResponse) Reset()

func (*ListKBsResponse) String

func (x *ListKBsResponse) String() string

type RetrieveRequest

type RetrieveRequest struct {
	KbId  string `protobuf:"bytes,1,opt,name=kb_id,json=kbId,proto3" json:"kb_id,omitempty"`  // 知识库ID
	Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`            // 查询问题
	TopK  int32  `protobuf:"varint,3,opt,name=top_k,json=topK,proto3" json:"top_k,omitempty"` // 返回结果数量
	// contains filtered or unexported fields
}

检索请求

func (*RetrieveRequest) Descriptor deprecated

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

Deprecated: Use RetrieveRequest.ProtoReflect.Descriptor instead.

func (*RetrieveRequest) GetKbId

func (x *RetrieveRequest) GetKbId() string

func (*RetrieveRequest) GetQuery

func (x *RetrieveRequest) GetQuery() string

func (*RetrieveRequest) GetTopK

func (x *RetrieveRequest) GetTopK() int32

func (*RetrieveRequest) ProtoMessage

func (*RetrieveRequest) ProtoMessage()

func (*RetrieveRequest) ProtoReflect

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

func (*RetrieveRequest) Reset

func (x *RetrieveRequest) Reset()

func (*RetrieveRequest) String

func (x *RetrieveRequest) String() string

type RetrieveResponse

type RetrieveResponse struct {
	Success bool              `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // 是否成功
	Results []*RetrieveResult `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"`  // 检索结果列表
	Message string            `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`  // 响应消息
	// contains filtered or unexported fields
}

检索响应

func (*RetrieveResponse) Descriptor deprecated

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

Deprecated: Use RetrieveResponse.ProtoReflect.Descriptor instead.

func (*RetrieveResponse) GetMessage

func (x *RetrieveResponse) GetMessage() string

func (*RetrieveResponse) GetResults

func (x *RetrieveResponse) GetResults() []*RetrieveResult

func (*RetrieveResponse) GetSuccess

func (x *RetrieveResponse) GetSuccess() bool

func (*RetrieveResponse) ProtoMessage

func (*RetrieveResponse) ProtoMessage()

func (*RetrieveResponse) ProtoReflect

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

func (*RetrieveResponse) Reset

func (x *RetrieveResponse) Reset()

func (*RetrieveResponse) String

func (x *RetrieveResponse) String() string

type RetrieveResult

type RetrieveResult struct {
	Content string  `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`                // 检索到的内容
	Score   float32 `protobuf:"fixed32,2,opt,name=score,proto3" json:"score,omitempty"`                  // 相关性分数
	DocId   string  `protobuf:"bytes,3,opt,name=doc_id,json=docId,proto3" json:"doc_id,omitempty"`       // 文档ID
	DocName string  `protobuf:"bytes,4,opt,name=doc_name,json=docName,proto3" json:"doc_name,omitempty"` // 文档名称
	// contains filtered or unexported fields
}

检索结果

func (*RetrieveResult) Descriptor deprecated

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

Deprecated: Use RetrieveResult.ProtoReflect.Descriptor instead.

func (*RetrieveResult) GetContent

func (x *RetrieveResult) GetContent() string

func (*RetrieveResult) GetDocId

func (x *RetrieveResult) GetDocId() string

func (*RetrieveResult) GetDocName

func (x *RetrieveResult) GetDocName() string

func (*RetrieveResult) GetScore

func (x *RetrieveResult) GetScore() float32

func (*RetrieveResult) ProtoMessage

func (*RetrieveResult) ProtoMessage()

func (*RetrieveResult) ProtoReflect

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

func (*RetrieveResult) Reset

func (x *RetrieveResult) Reset()

func (*RetrieveResult) String

func (x *RetrieveResult) String() string

type UnimplementedKnowledgeBaseServiceServer

type UnimplementedKnowledgeBaseServiceServer struct {
}

UnimplementedKnowledgeBaseServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedKnowledgeBaseServiceServer) CreateKnowledgeBase

func (UnimplementedKnowledgeBaseServiceServer) DeleteDocument

func (UnimplementedKnowledgeBaseServiceServer) DeleteKnowledgeBase

func (UnimplementedKnowledgeBaseServiceServer) ListDocuments

func (UnimplementedKnowledgeBaseServiceServer) ListEmbeddingModels

func (UnimplementedKnowledgeBaseServiceServer) ListKnowledgeBases

func (UnimplementedKnowledgeBaseServiceServer) RetrieveInfo

func (UnimplementedKnowledgeBaseServiceServer) UploadDocument

type UnsafeKnowledgeBaseServiceServer

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

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

type UploadDocRequest

type UploadDocRequest struct {
	Uid         string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`                                    // 用户ID (用于权限检查)
	KbId        string `protobuf:"bytes,2,opt,name=kb_id,json=kbId,proto3" json:"kb_id,omitempty"`                      // 知识库ID
	DocName     string `protobuf:"bytes,3,opt,name=doc_name,json=docName,proto3" json:"doc_name,omitempty"`             // 文档名称
	FileContent []byte `protobuf:"bytes,4,opt,name=file_content,json=fileContent,proto3" json:"file_content,omitempty"` // 文件内容
	FileType    string `protobuf:"bytes,5,opt,name=file_type,json=fileType,proto3" json:"file_type,omitempty"`          // 文件类型 (txt, docx)
	// contains filtered or unexported fields
}

上传文档请求

func (*UploadDocRequest) Descriptor deprecated

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

Deprecated: Use UploadDocRequest.ProtoReflect.Descriptor instead.

func (*UploadDocRequest) GetDocName

func (x *UploadDocRequest) GetDocName() string

func (*UploadDocRequest) GetFileContent

func (x *UploadDocRequest) GetFileContent() []byte

func (*UploadDocRequest) GetFileType

func (x *UploadDocRequest) GetFileType() string

func (*UploadDocRequest) GetKbId

func (x *UploadDocRequest) GetKbId() string

func (*UploadDocRequest) GetUid

func (x *UploadDocRequest) GetUid() string

func (*UploadDocRequest) ProtoMessage

func (*UploadDocRequest) ProtoMessage()

func (*UploadDocRequest) ProtoReflect

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

func (*UploadDocRequest) Reset

func (x *UploadDocRequest) Reset()

func (*UploadDocRequest) String

func (x *UploadDocRequest) String() string

type UploadDocResponse

type UploadDocResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`         // 是否成功
	DocId   string `protobuf:"bytes,2,opt,name=doc_id,json=docId,proto3" json:"doc_id,omitempty"` // 文档ID
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`          // 响应消息
	// contains filtered or unexported fields
}

上传文档响应

func (*UploadDocResponse) Descriptor deprecated

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

Deprecated: Use UploadDocResponse.ProtoReflect.Descriptor instead.

func (*UploadDocResponse) GetDocId

func (x *UploadDocResponse) GetDocId() string

func (*UploadDocResponse) GetMessage

func (x *UploadDocResponse) GetMessage() string

func (*UploadDocResponse) GetSuccess

func (x *UploadDocResponse) GetSuccess() bool

func (*UploadDocResponse) ProtoMessage

func (*UploadDocResponse) ProtoMessage()

func (*UploadDocResponse) ProtoReflect

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

func (*UploadDocResponse) Reset

func (x *UploadDocResponse) Reset()

func (*UploadDocResponse) String

func (x *UploadDocResponse) String() string

Jump to

Keyboard shortcuts

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