mirror of
https://github.com/Tencent/WeKnora.git
synced 2025-11-25 03:15:00 +08:00
820 lines
25 KiB
Go
820 lines
25 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||
// versions:
|
||
// protoc-gen-go v1.36.6
|
||
// protoc v5.29.3
|
||
// source: docreader.proto
|
||
|
||
package proto
|
||
|
||
import (
|
||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||
reflect "reflect"
|
||
sync "sync"
|
||
unsafe "unsafe"
|
||
)
|
||
|
||
const (
|
||
// Verify that this generated code is sufficiently up-to-date.
|
||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||
)
|
||
|
||
// 对象存储提供方
|
||
type StorageProvider int32
|
||
|
||
const (
|
||
StorageProvider_STORAGE_PROVIDER_UNSPECIFIED StorageProvider = 0
|
||
StorageProvider_COS StorageProvider = 1 // 腾讯云 COS
|
||
StorageProvider_MINIO StorageProvider = 2 // MinIO/S3 兼容
|
||
)
|
||
|
||
// Enum value maps for StorageProvider.
|
||
var (
|
||
StorageProvider_name = map[int32]string{
|
||
0: "STORAGE_PROVIDER_UNSPECIFIED",
|
||
1: "COS",
|
||
2: "MINIO",
|
||
}
|
||
StorageProvider_value = map[string]int32{
|
||
"STORAGE_PROVIDER_UNSPECIFIED": 0,
|
||
"COS": 1,
|
||
"MINIO": 2,
|
||
}
|
||
)
|
||
|
||
func (x StorageProvider) Enum() *StorageProvider {
|
||
p := new(StorageProvider)
|
||
*p = x
|
||
return p
|
||
}
|
||
|
||
func (x StorageProvider) String() string {
|
||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||
}
|
||
|
||
func (StorageProvider) Descriptor() protoreflect.EnumDescriptor {
|
||
return file_docreader_proto_enumTypes[0].Descriptor()
|
||
}
|
||
|
||
func (StorageProvider) Type() protoreflect.EnumType {
|
||
return &file_docreader_proto_enumTypes[0]
|
||
}
|
||
|
||
func (x StorageProvider) Number() protoreflect.EnumNumber {
|
||
return protoreflect.EnumNumber(x)
|
||
}
|
||
|
||
// Deprecated: Use StorageProvider.Descriptor instead.
|
||
func (StorageProvider) EnumDescriptor() ([]byte, []int) {
|
||
return file_docreader_proto_rawDescGZIP(), []int{0}
|
||
}
|
||
|
||
// 通用对象存储配置,兼容 COS 与 MinIO
|
||
type StorageConfig struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Provider StorageProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=docreader.StorageProvider" json:"provider,omitempty"` // 存储提供方
|
||
Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` // 区域(COS 使用)
|
||
BucketName string `protobuf:"bytes,3,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` // 桶名
|
||
AccessKeyId string `protobuf:"bytes,4,opt,name=access_key_id,json=accessKeyId,proto3" json:"access_key_id,omitempty"` // 访问密钥 ID(MinIO/S3 使用)
|
||
SecretAccessKey string `protobuf:"bytes,5,opt,name=secret_access_key,json=secretAccessKey,proto3" json:"secret_access_key,omitempty"` // 访问密钥 Secret(MinIO/S3 使用)
|
||
AppId string `protobuf:"bytes,6,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` // 应用 ID(COS 使用)
|
||
PathPrefix string `protobuf:"bytes,7,opt,name=path_prefix,json=pathPrefix,proto3" json:"path_prefix,omitempty"` // 路径前缀
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *StorageConfig) Reset() {
|
||
*x = StorageConfig{}
|
||
mi := &file_docreader_proto_msgTypes[0]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *StorageConfig) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*StorageConfig) ProtoMessage() {}
|
||
|
||
func (x *StorageConfig) ProtoReflect() protoreflect.Message {
|
||
mi := &file_docreader_proto_msgTypes[0]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use StorageConfig.ProtoReflect.Descriptor instead.
|
||
func (*StorageConfig) Descriptor() ([]byte, []int) {
|
||
return file_docreader_proto_rawDescGZIP(), []int{0}
|
||
}
|
||
|
||
func (x *StorageConfig) GetProvider() StorageProvider {
|
||
if x != nil {
|
||
return x.Provider
|
||
}
|
||
return StorageProvider_STORAGE_PROVIDER_UNSPECIFIED
|
||
}
|
||
|
||
func (x *StorageConfig) GetRegion() string {
|
||
if x != nil {
|
||
return x.Region
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *StorageConfig) GetBucketName() string {
|
||
if x != nil {
|
||
return x.BucketName
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *StorageConfig) GetAccessKeyId() string {
|
||
if x != nil {
|
||
return x.AccessKeyId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *StorageConfig) GetSecretAccessKey() string {
|
||
if x != nil {
|
||
return x.SecretAccessKey
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *StorageConfig) GetAppId() string {
|
||
if x != nil {
|
||
return x.AppId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *StorageConfig) GetPathPrefix() string {
|
||
if x != nil {
|
||
return x.PathPrefix
|
||
}
|
||
return ""
|
||
}
|
||
|
||
// VLM 配置
|
||
type VLMConfig struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"` // VLM Model Name
|
||
BaseUrl string `protobuf:"bytes,2,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"` // VLM Base URL
|
||
ApiKey string `protobuf:"bytes,3,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` // VLM API Key
|
||
InterfaceType string `protobuf:"bytes,4,opt,name=interface_type,json=interfaceType,proto3" json:"interface_type,omitempty"` // VLM Interface Type: "ollama" or "openai"
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *VLMConfig) Reset() {
|
||
*x = VLMConfig{}
|
||
mi := &file_docreader_proto_msgTypes[1]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *VLMConfig) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*VLMConfig) ProtoMessage() {}
|
||
|
||
func (x *VLMConfig) ProtoReflect() protoreflect.Message {
|
||
mi := &file_docreader_proto_msgTypes[1]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use VLMConfig.ProtoReflect.Descriptor instead.
|
||
func (*VLMConfig) Descriptor() ([]byte, []int) {
|
||
return file_docreader_proto_rawDescGZIP(), []int{1}
|
||
}
|
||
|
||
func (x *VLMConfig) GetModelName() string {
|
||
if x != nil {
|
||
return x.ModelName
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *VLMConfig) GetBaseUrl() string {
|
||
if x != nil {
|
||
return x.BaseUrl
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *VLMConfig) GetApiKey() string {
|
||
if x != nil {
|
||
return x.ApiKey
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *VLMConfig) GetInterfaceType() string {
|
||
if x != nil {
|
||
return x.InterfaceType
|
||
}
|
||
return ""
|
||
}
|
||
|
||
type ReadConfig struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
ChunkSize int32 `protobuf:"varint,1,opt,name=chunk_size,json=chunkSize,proto3" json:"chunk_size,omitempty"` // 分块大小
|
||
ChunkOverlap int32 `protobuf:"varint,2,opt,name=chunk_overlap,json=chunkOverlap,proto3" json:"chunk_overlap,omitempty"` // 分块重叠
|
||
Separators []string `protobuf:"bytes,3,rep,name=separators,proto3" json:"separators,omitempty"` // 分隔符
|
||
EnableMultimodal bool `protobuf:"varint,4,opt,name=enable_multimodal,json=enableMultimodal,proto3" json:"enable_multimodal,omitempty"` // 多模态处理
|
||
StorageConfig *StorageConfig `protobuf:"bytes,5,opt,name=storage_config,json=storageConfig,proto3" json:"storage_config,omitempty"` // 对象存储配置(通用)
|
||
VlmConfig *VLMConfig `protobuf:"bytes,6,opt,name=vlm_config,json=vlmConfig,proto3" json:"vlm_config,omitempty"` // VLM 配置
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *ReadConfig) Reset() {
|
||
*x = ReadConfig{}
|
||
mi := &file_docreader_proto_msgTypes[2]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *ReadConfig) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*ReadConfig) ProtoMessage() {}
|
||
|
||
func (x *ReadConfig) ProtoReflect() protoreflect.Message {
|
||
mi := &file_docreader_proto_msgTypes[2]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use ReadConfig.ProtoReflect.Descriptor instead.
|
||
func (*ReadConfig) Descriptor() ([]byte, []int) {
|
||
return file_docreader_proto_rawDescGZIP(), []int{2}
|
||
}
|
||
|
||
func (x *ReadConfig) GetChunkSize() int32 {
|
||
if x != nil {
|
||
return x.ChunkSize
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *ReadConfig) GetChunkOverlap() int32 {
|
||
if x != nil {
|
||
return x.ChunkOverlap
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *ReadConfig) GetSeparators() []string {
|
||
if x != nil {
|
||
return x.Separators
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *ReadConfig) GetEnableMultimodal() bool {
|
||
if x != nil {
|
||
return x.EnableMultimodal
|
||
}
|
||
return false
|
||
}
|
||
|
||
func (x *ReadConfig) GetStorageConfig() *StorageConfig {
|
||
if x != nil {
|
||
return x.StorageConfig
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *ReadConfig) GetVlmConfig() *VLMConfig {
|
||
if x != nil {
|
||
return x.VlmConfig
|
||
}
|
||
return nil
|
||
}
|
||
|
||
// 从文件读取文档请求
|
||
type ReadFromFileRequest struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
FileContent []byte `protobuf:"bytes,1,opt,name=file_content,json=fileContent,proto3" json:"file_content,omitempty"` // 文件内容
|
||
FileName string `protobuf:"bytes,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` // 文件名
|
||
FileType string `protobuf:"bytes,3,opt,name=file_type,json=fileType,proto3" json:"file_type,omitempty"` // 文件类型
|
||
ReadConfig *ReadConfig `protobuf:"bytes,4,opt,name=read_config,json=readConfig,proto3" json:"read_config,omitempty"`
|
||
RequestId string `protobuf:"bytes,5,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *ReadFromFileRequest) Reset() {
|
||
*x = ReadFromFileRequest{}
|
||
mi := &file_docreader_proto_msgTypes[3]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *ReadFromFileRequest) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*ReadFromFileRequest) ProtoMessage() {}
|
||
|
||
func (x *ReadFromFileRequest) ProtoReflect() protoreflect.Message {
|
||
mi := &file_docreader_proto_msgTypes[3]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use ReadFromFileRequest.ProtoReflect.Descriptor instead.
|
||
func (*ReadFromFileRequest) Descriptor() ([]byte, []int) {
|
||
return file_docreader_proto_rawDescGZIP(), []int{3}
|
||
}
|
||
|
||
func (x *ReadFromFileRequest) GetFileContent() []byte {
|
||
if x != nil {
|
||
return x.FileContent
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *ReadFromFileRequest) GetFileName() string {
|
||
if x != nil {
|
||
return x.FileName
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *ReadFromFileRequest) GetFileType() string {
|
||
if x != nil {
|
||
return x.FileType
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *ReadFromFileRequest) GetReadConfig() *ReadConfig {
|
||
if x != nil {
|
||
return x.ReadConfig
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *ReadFromFileRequest) GetRequestId() string {
|
||
if x != nil {
|
||
return x.RequestId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
// 从URL读取文档请求
|
||
type ReadFromURLRequest struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // 文档URL
|
||
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` // 标题
|
||
ReadConfig *ReadConfig `protobuf:"bytes,3,opt,name=read_config,json=readConfig,proto3" json:"read_config,omitempty"`
|
||
RequestId string `protobuf:"bytes,4,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *ReadFromURLRequest) Reset() {
|
||
*x = ReadFromURLRequest{}
|
||
mi := &file_docreader_proto_msgTypes[4]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *ReadFromURLRequest) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*ReadFromURLRequest) ProtoMessage() {}
|
||
|
||
func (x *ReadFromURLRequest) ProtoReflect() protoreflect.Message {
|
||
mi := &file_docreader_proto_msgTypes[4]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use ReadFromURLRequest.ProtoReflect.Descriptor instead.
|
||
func (*ReadFromURLRequest) Descriptor() ([]byte, []int) {
|
||
return file_docreader_proto_rawDescGZIP(), []int{4}
|
||
}
|
||
|
||
func (x *ReadFromURLRequest) GetUrl() string {
|
||
if x != nil {
|
||
return x.Url
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *ReadFromURLRequest) GetTitle() string {
|
||
if x != nil {
|
||
return x.Title
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *ReadFromURLRequest) GetReadConfig() *ReadConfig {
|
||
if x != nil {
|
||
return x.ReadConfig
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *ReadFromURLRequest) GetRequestId() string {
|
||
if x != nil {
|
||
return x.RequestId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
// 图片信息
|
||
type Image struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // 图片URL
|
||
Caption string `protobuf:"bytes,2,opt,name=caption,proto3" json:"caption,omitempty"` // 图片描述
|
||
OcrText string `protobuf:"bytes,3,opt,name=ocr_text,json=ocrText,proto3" json:"ocr_text,omitempty"` // OCR提取的文本内容
|
||
OriginalUrl string `protobuf:"bytes,4,opt,name=original_url,json=originalUrl,proto3" json:"original_url,omitempty"` // 原始图片URL
|
||
Start int32 `protobuf:"varint,5,opt,name=start,proto3" json:"start,omitempty"` // 图片在文本中的开始位置
|
||
End int32 `protobuf:"varint,6,opt,name=end,proto3" json:"end,omitempty"` // 图片在文本中的结束位置
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *Image) Reset() {
|
||
*x = Image{}
|
||
mi := &file_docreader_proto_msgTypes[5]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *Image) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*Image) ProtoMessage() {}
|
||
|
||
func (x *Image) ProtoReflect() protoreflect.Message {
|
||
mi := &file_docreader_proto_msgTypes[5]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use Image.ProtoReflect.Descriptor instead.
|
||
func (*Image) Descriptor() ([]byte, []int) {
|
||
return file_docreader_proto_rawDescGZIP(), []int{5}
|
||
}
|
||
|
||
func (x *Image) GetUrl() string {
|
||
if x != nil {
|
||
return x.Url
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *Image) GetCaption() string {
|
||
if x != nil {
|
||
return x.Caption
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *Image) GetOcrText() string {
|
||
if x != nil {
|
||
return x.OcrText
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *Image) GetOriginalUrl() string {
|
||
if x != nil {
|
||
return x.OriginalUrl
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *Image) GetStart() int32 {
|
||
if x != nil {
|
||
return x.Start
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *Image) GetEnd() int32 {
|
||
if x != nil {
|
||
return x.End
|
||
}
|
||
return 0
|
||
}
|
||
|
||
type Chunk struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // 块内容
|
||
Seq int32 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"` // 块在文档中的次序
|
||
Start int32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` // 块在文档中的起始位置
|
||
End int32 `protobuf:"varint,4,opt,name=end,proto3" json:"end,omitempty"` // 块在文档中的结束位置
|
||
Images []*Image `protobuf:"bytes,5,rep,name=images,proto3" json:"images,omitempty"` // 块中包含的图片信息
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *Chunk) Reset() {
|
||
*x = Chunk{}
|
||
mi := &file_docreader_proto_msgTypes[6]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *Chunk) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*Chunk) ProtoMessage() {}
|
||
|
||
func (x *Chunk) ProtoReflect() protoreflect.Message {
|
||
mi := &file_docreader_proto_msgTypes[6]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use Chunk.ProtoReflect.Descriptor instead.
|
||
func (*Chunk) Descriptor() ([]byte, []int) {
|
||
return file_docreader_proto_rawDescGZIP(), []int{6}
|
||
}
|
||
|
||
func (x *Chunk) GetContent() string {
|
||
if x != nil {
|
||
return x.Content
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *Chunk) GetSeq() int32 {
|
||
if x != nil {
|
||
return x.Seq
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *Chunk) GetStart() int32 {
|
||
if x != nil {
|
||
return x.Start
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *Chunk) GetEnd() int32 {
|
||
if x != nil {
|
||
return x.End
|
||
}
|
||
return 0
|
||
}
|
||
|
||
func (x *Chunk) GetImages() []*Image {
|
||
if x != nil {
|
||
return x.Images
|
||
}
|
||
return nil
|
||
}
|
||
|
||
// 从URL读取文档响应
|
||
type ReadResponse struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Chunks []*Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"` // 文档分块
|
||
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // 错误信息
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *ReadResponse) Reset() {
|
||
*x = ReadResponse{}
|
||
mi := &file_docreader_proto_msgTypes[7]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *ReadResponse) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*ReadResponse) ProtoMessage() {}
|
||
|
||
func (x *ReadResponse) ProtoReflect() protoreflect.Message {
|
||
mi := &file_docreader_proto_msgTypes[7]
|
||
if x != nil {
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
if ms.LoadMessageInfo() == nil {
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
return ms
|
||
}
|
||
return mi.MessageOf(x)
|
||
}
|
||
|
||
// Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.
|
||
func (*ReadResponse) Descriptor() ([]byte, []int) {
|
||
return file_docreader_proto_rawDescGZIP(), []int{7}
|
||
}
|
||
|
||
func (x *ReadResponse) GetChunks() []*Chunk {
|
||
if x != nil {
|
||
return x.Chunks
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *ReadResponse) GetError() string {
|
||
if x != nil {
|
||
return x.Error
|
||
}
|
||
return ""
|
||
}
|
||
|
||
var File_docreader_proto protoreflect.FileDescriptor
|
||
|
||
const file_docreader_proto_rawDesc = "" +
|
||
"\n" +
|
||
"\x0fdocreader.proto\x12\tdocreader\"\x88\x02\n" +
|
||
"\rStorageConfig\x126\n" +
|
||
"\bprovider\x18\x01 \x01(\x0e2\x1a.docreader.StorageProviderR\bprovider\x12\x16\n" +
|
||
"\x06region\x18\x02 \x01(\tR\x06region\x12\x1f\n" +
|
||
"\vbucket_name\x18\x03 \x01(\tR\n" +
|
||
"bucketName\x12\"\n" +
|
||
"\raccess_key_id\x18\x04 \x01(\tR\vaccessKeyId\x12*\n" +
|
||
"\x11secret_access_key\x18\x05 \x01(\tR\x0fsecretAccessKey\x12\x15\n" +
|
||
"\x06app_id\x18\x06 \x01(\tR\x05appId\x12\x1f\n" +
|
||
"\vpath_prefix\x18\a \x01(\tR\n" +
|
||
"pathPrefix\"\x85\x01\n" +
|
||
"\tVLMConfig\x12\x1d\n" +
|
||
"\n" +
|
||
"model_name\x18\x01 \x01(\tR\tmodelName\x12\x19\n" +
|
||
"\bbase_url\x18\x02 \x01(\tR\abaseUrl\x12\x17\n" +
|
||
"\aapi_key\x18\x03 \x01(\tR\x06apiKey\x12%\n" +
|
||
"\x0einterface_type\x18\x04 \x01(\tR\rinterfaceType\"\x93\x02\n" +
|
||
"\n" +
|
||
"ReadConfig\x12\x1d\n" +
|
||
"\n" +
|
||
"chunk_size\x18\x01 \x01(\x05R\tchunkSize\x12#\n" +
|
||
"\rchunk_overlap\x18\x02 \x01(\x05R\fchunkOverlap\x12\x1e\n" +
|
||
"\n" +
|
||
"separators\x18\x03 \x03(\tR\n" +
|
||
"separators\x12+\n" +
|
||
"\x11enable_multimodal\x18\x04 \x01(\bR\x10enableMultimodal\x12?\n" +
|
||
"\x0estorage_config\x18\x05 \x01(\v2\x18.docreader.StorageConfigR\rstorageConfig\x123\n" +
|
||
"\n" +
|
||
"vlm_config\x18\x06 \x01(\v2\x14.docreader.VLMConfigR\tvlmConfig\"\xc9\x01\n" +
|
||
"\x13ReadFromFileRequest\x12!\n" +
|
||
"\ffile_content\x18\x01 \x01(\fR\vfileContent\x12\x1b\n" +
|
||
"\tfile_name\x18\x02 \x01(\tR\bfileName\x12\x1b\n" +
|
||
"\tfile_type\x18\x03 \x01(\tR\bfileType\x126\n" +
|
||
"\vread_config\x18\x04 \x01(\v2\x15.docreader.ReadConfigR\n" +
|
||
"readConfig\x12\x1d\n" +
|
||
"\n" +
|
||
"request_id\x18\x05 \x01(\tR\trequestId\"\x93\x01\n" +
|
||
"\x12ReadFromURLRequest\x12\x10\n" +
|
||
"\x03url\x18\x01 \x01(\tR\x03url\x12\x14\n" +
|
||
"\x05title\x18\x02 \x01(\tR\x05title\x126\n" +
|
||
"\vread_config\x18\x03 \x01(\v2\x15.docreader.ReadConfigR\n" +
|
||
"readConfig\x12\x1d\n" +
|
||
"\n" +
|
||
"request_id\x18\x04 \x01(\tR\trequestId\"\x99\x01\n" +
|
||
"\x05Image\x12\x10\n" +
|
||
"\x03url\x18\x01 \x01(\tR\x03url\x12\x18\n" +
|
||
"\acaption\x18\x02 \x01(\tR\acaption\x12\x19\n" +
|
||
"\bocr_text\x18\x03 \x01(\tR\aocrText\x12!\n" +
|
||
"\foriginal_url\x18\x04 \x01(\tR\voriginalUrl\x12\x14\n" +
|
||
"\x05start\x18\x05 \x01(\x05R\x05start\x12\x10\n" +
|
||
"\x03end\x18\x06 \x01(\x05R\x03end\"\x85\x01\n" +
|
||
"\x05Chunk\x12\x18\n" +
|
||
"\acontent\x18\x01 \x01(\tR\acontent\x12\x10\n" +
|
||
"\x03seq\x18\x02 \x01(\x05R\x03seq\x12\x14\n" +
|
||
"\x05start\x18\x03 \x01(\x05R\x05start\x12\x10\n" +
|
||
"\x03end\x18\x04 \x01(\x05R\x03end\x12(\n" +
|
||
"\x06images\x18\x05 \x03(\v2\x10.docreader.ImageR\x06images\"N\n" +
|
||
"\fReadResponse\x12(\n" +
|
||
"\x06chunks\x18\x01 \x03(\v2\x10.docreader.ChunkR\x06chunks\x12\x14\n" +
|
||
"\x05error\x18\x02 \x01(\tR\x05error*G\n" +
|
||
"\x0fStorageProvider\x12 \n" +
|
||
"\x1cSTORAGE_PROVIDER_UNSPECIFIED\x10\x00\x12\a\n" +
|
||
"\x03COS\x10\x01\x12\t\n" +
|
||
"\x05MINIO\x10\x022\x9f\x01\n" +
|
||
"\tDocReader\x12I\n" +
|
||
"\fReadFromFile\x12\x1e.docreader.ReadFromFileRequest\x1a\x17.docreader.ReadResponse\"\x00\x12G\n" +
|
||
"\vReadFromURL\x12\x1d.docreader.ReadFromURLRequest\x1a\x17.docreader.ReadResponse\"\x00B5Z3github.com/Tencent/WeKnora/internal/docreader/protob\x06proto3"
|
||
|
||
var (
|
||
file_docreader_proto_rawDescOnce sync.Once
|
||
file_docreader_proto_rawDescData []byte
|
||
)
|
||
|
||
func file_docreader_proto_rawDescGZIP() []byte {
|
||
file_docreader_proto_rawDescOnce.Do(func() {
|
||
file_docreader_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_docreader_proto_rawDesc), len(file_docreader_proto_rawDesc)))
|
||
})
|
||
return file_docreader_proto_rawDescData
|
||
}
|
||
|
||
var file_docreader_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||
var file_docreader_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||
var file_docreader_proto_goTypes = []any{
|
||
(StorageProvider)(0), // 0: docreader.StorageProvider
|
||
(*StorageConfig)(nil), // 1: docreader.StorageConfig
|
||
(*VLMConfig)(nil), // 2: docreader.VLMConfig
|
||
(*ReadConfig)(nil), // 3: docreader.ReadConfig
|
||
(*ReadFromFileRequest)(nil), // 4: docreader.ReadFromFileRequest
|
||
(*ReadFromURLRequest)(nil), // 5: docreader.ReadFromURLRequest
|
||
(*Image)(nil), // 6: docreader.Image
|
||
(*Chunk)(nil), // 7: docreader.Chunk
|
||
(*ReadResponse)(nil), // 8: docreader.ReadResponse
|
||
}
|
||
var file_docreader_proto_depIdxs = []int32{
|
||
0, // 0: docreader.StorageConfig.provider:type_name -> docreader.StorageProvider
|
||
1, // 1: docreader.ReadConfig.storage_config:type_name -> docreader.StorageConfig
|
||
2, // 2: docreader.ReadConfig.vlm_config:type_name -> docreader.VLMConfig
|
||
3, // 3: docreader.ReadFromFileRequest.read_config:type_name -> docreader.ReadConfig
|
||
3, // 4: docreader.ReadFromURLRequest.read_config:type_name -> docreader.ReadConfig
|
||
6, // 5: docreader.Chunk.images:type_name -> docreader.Image
|
||
7, // 6: docreader.ReadResponse.chunks:type_name -> docreader.Chunk
|
||
4, // 7: docreader.DocReader.ReadFromFile:input_type -> docreader.ReadFromFileRequest
|
||
5, // 8: docreader.DocReader.ReadFromURL:input_type -> docreader.ReadFromURLRequest
|
||
8, // 9: docreader.DocReader.ReadFromFile:output_type -> docreader.ReadResponse
|
||
8, // 10: docreader.DocReader.ReadFromURL:output_type -> docreader.ReadResponse
|
||
9, // [9:11] is the sub-list for method output_type
|
||
7, // [7:9] is the sub-list for method input_type
|
||
7, // [7:7] is the sub-list for extension type_name
|
||
7, // [7:7] is the sub-list for extension extendee
|
||
0, // [0:7] is the sub-list for field type_name
|
||
}
|
||
|
||
func init() { file_docreader_proto_init() }
|
||
func file_docreader_proto_init() {
|
||
if File_docreader_proto != nil {
|
||
return
|
||
}
|
||
type x struct{}
|
||
out := protoimpl.TypeBuilder{
|
||
File: protoimpl.DescBuilder{
|
||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_docreader_proto_rawDesc), len(file_docreader_proto_rawDesc)),
|
||
NumEnums: 1,
|
||
NumMessages: 8,
|
||
NumExtensions: 0,
|
||
NumServices: 1,
|
||
},
|
||
GoTypes: file_docreader_proto_goTypes,
|
||
DependencyIndexes: file_docreader_proto_depIdxs,
|
||
EnumInfos: file_docreader_proto_enumTypes,
|
||
MessageInfos: file_docreader_proto_msgTypes,
|
||
}.Build()
|
||
File_docreader_proto = out.File
|
||
file_docreader_proto_goTypes = nil
|
||
file_docreader_proto_depIdxs = nil
|
||
}
|