Documentation
¶
Index ¶
- Constants
- func CopyFile(ctx context.Context, srcFilePath string, destObjectNamePre string) (string, string, int64, error)
- func DeleteFile(ctx context.Context, minioFilePath string) error
- func DownloadFile(ctx context.Context, minioFilePath string) ([]byte, error)
- func DownloadFileObject(ctx context.Context, minioFilePath string) (*minio.Object, error)
- func DownloadFileToLocal(ctx context.Context, minioFilePath string, localPath string) error
- func RagCreateDocSegment(ctx context.Context, ragCreateDocSegmentParams *RagCreateDocSegmentParams) error
- func RagDeleteDoc(ctx context.Context, ragDeleteDocParams *RagDeleteDocParams) error
- func RagDeleteDocSegment(ctx context.Context, ragDeleteDocSegmentParams *RagDeleteDocSegmentParams) error
- func RagDocMeta(ctx context.Context, ragDocTagParams *RagDocMetaParams) error
- func RagDocSegmentLabels(ctx context.Context, ragDocSegLabelsParams *RagDocSegmentLabelsParams) error
- func RagDocUpdateDocSegmentStatus(ctx context.Context, docSegmentStatusUpdateParams interface{}) error
- func RagImportDoc(ctx context.Context, ragImportDocParams *RagImportDocParams) error
- func RagImportUrlDoc(ctx context.Context, ragImportDocParams *RagImportUrlDocParams) error
- func RagKnowledgeCreate(ctx context.Context, ragCreateParams *RagCreateParams) error
- func RagKnowledgeDelete(ctx context.Context, ragDeleteParams *RagDeleteParams) error
- func RagKnowledgeUpdate(ctx context.Context, ragUpdateParams *RagUpdateParams) error
- func RagOperateKeywords(ctx context.Context, ragOperateKeywordsParams *RagOperateKeywordsParams) error
- func RagUpdateDocSegment(ctx context.Context, ragUpdateDocSegmentParams *RagUpdateDocSegmentParams) error
- func RebuildFileName(docId, docType, docName string) string
- func RebuildSegmentType(segmentType string) string
- func SplitFilePath(filePath string) (bucketName string, objectName string, fileName string)
- func UploadFile(ctx context.Context, dir string, fileName string, reader io.Reader, ...) (string, int64, error)
- func UploadLocalFile(ctx context.Context, minioDir string, minioFileName string, srcFilePath string) (string, string, int64, error)
- type ChunkSearchList
- type ContentListResp
- type ContentMetaData
- type DocSegmentStatusUpdateAllParams
- type DocSegmentStatusUpdateParams
- type DocUrlParams
- type DocUrlResp
- type DocUrlRespSafeArray
- type FileSplitContent
- type KnowledgeHitData
- type KnowledgeHitParams
- type MetaData
- type MetaItem
- type MetadataFilterItem
- type NewChunkItem
- type RagCommonResp
- type RagCreateDocSegmentParams
- type RagCreateParams
- type RagDeleteDocParams
- type RagDeleteDocSegmentParams
- type RagDeleteParams
- type RagDocMetaParams
- type RagDocSegmentLabelsParams
- type RagDocSegmentResp
- type RagGetDocSegmentParams
- type RagGetDocSegmentResp
- type RagImportDocParams
- type RagImportUrlDocParams
- type RagKnowledgeHitResp
- type RagMetaDataParams
- type RagOperateKeywordsParams
- type RagOperationParams
- type RagUpdateDocSegmentParams
- type RagUpdateParams
- type SegmentResult
- type UpdateChunkItem
- type WeightParams
Constants ¶
View Source
const ( SplitByDesign string = "split_by_design" SplitByDefault string = "split_by_default" )
Variables ¶
This section is empty.
Functions ¶
func DownloadFileObject ¶ added in v0.2.1
func DownloadFileToLocal ¶
func RagCreateDocSegment ¶ added in v0.2.0
func RagCreateDocSegment(ctx context.Context, ragCreateDocSegmentParams *RagCreateDocSegmentParams) error
RagCreateDocSegment 新增文档切片
func RagDeleteDoc ¶
func RagDeleteDoc(ctx context.Context, ragDeleteDocParams *RagDeleteDocParams) error
RagDeleteDoc 删除具体文档
func RagDeleteDocSegment ¶ added in v0.2.1
func RagDeleteDocSegment(ctx context.Context, ragDeleteDocSegmentParams *RagDeleteDocSegmentParams) error
RagDeleteDocSegment 删除文档切片
func RagDocMeta ¶ added in v0.1.6
func RagDocMeta(ctx context.Context, ragDocTagParams *RagDocMetaParams) error
RagDocMeta 更新文档元数据
func RagDocSegmentLabels ¶ added in v0.1.8
func RagDocSegmentLabels(ctx context.Context, ragDocSegLabelsParams *RagDocSegmentLabelsParams) error
RagDocSegmentLabels 更新文档切片标签
func RagDocUpdateDocSegmentStatus ¶
func RagDocUpdateDocSegmentStatus(ctx context.Context, docSegmentStatusUpdateParams interface{}) error
RagDocUpdateDocSegmentStatus 更新文档切片状态
func RagImportDoc ¶
func RagImportDoc(ctx context.Context, ragImportDocParams *RagImportDocParams) error
RagImportDoc 导入具体文档
func RagImportUrlDoc ¶
func RagImportUrlDoc(ctx context.Context, ragImportDocParams *RagImportUrlDocParams) error
RagImportUrlDoc 导入url文档
func RagKnowledgeCreate ¶
func RagKnowledgeCreate(ctx context.Context, ragCreateParams *RagCreateParams) error
RagKnowledgeCreate rag创建知识库
func RagKnowledgeDelete ¶
func RagKnowledgeDelete(ctx context.Context, ragDeleteParams *RagDeleteParams) error
RagKnowledgeDelete rag更新知识库删除
func RagKnowledgeUpdate ¶
func RagKnowledgeUpdate(ctx context.Context, ragUpdateParams *RagUpdateParams) error
RagKnowledgeUpdate rag更新知识库
func RagOperateKeywords ¶ added in v0.1.6
func RagOperateKeywords(ctx context.Context, ragOperateKeywordsParams *RagOperateKeywordsParams) error
RagOperateKeywords rag添加关键词
func RagUpdateDocSegment ¶ added in v0.2.1
func RagUpdateDocSegment(ctx context.Context, ragUpdateDocSegmentParams *RagUpdateDocSegmentParams) error
RagUpdateDocSegment 更新文档切片
func RebuildFileName ¶
func RebuildSegmentType ¶
RebuildSegmentType 转换分段类型
func SplitFilePath ¶
func UploadFile ¶
Types ¶
type ChunkSearchList ¶ added in v0.1.3
type ContentListResp ¶
type ContentListResp struct {
List []FileSplitContent `json:"content_list"`
ChunkTotalNum int `json:"chunk_total_num"`
}
func RagGetDocSegmentList ¶
func RagGetDocSegmentList(ctx context.Context, ragGetDocSegmentParams *RagGetDocSegmentParams) (*ContentListResp, error)
RagGetDocSegmentList rag获取知识库文档分片
type ContentMetaData ¶
type DocSegmentStatusUpdateAllParams ¶
type DocSegmentStatusUpdateAllParams struct {
DocSegmentStatusUpdateParams
All bool `json:"on_off_switch"`
}
type DocUrlParams ¶
type DocUrlParams struct {
Url string `json:"url"`
}
type DocUrlResp ¶
type DocUrlResp struct {
Url string `json:"url"`
OldName string `json:"old_name"`
FileName string `json:"file_name"`
FileSize float64 `json:"file_size"`
ResponseInfo RagCommonResp `json:"response_info"`
}
func BatchRagDocUrlAnalysis ¶
func BatchRagDocUrlAnalysis(ctx context.Context, urlList []string) ([]*DocUrlResp, error)
func RagDocUrlAnalysis ¶
func RagDocUrlAnalysis(ctx context.Context, docUrlParams *DocUrlParams) (*DocUrlResp, error)
RagDocUrlAnalysis 文档url解析
type DocUrlRespSafeArray ¶
type DocUrlRespSafeArray struct {
// contains filtered or unexported fields
}
func (*DocUrlRespSafeArray) Append ¶
func (sa *DocUrlRespSafeArray) Append(value *DocUrlResp)
func (*DocUrlRespSafeArray) Get ¶
func (sa *DocUrlRespSafeArray) Get(index int) interface{}
func (*DocUrlRespSafeArray) Len ¶
func (sa *DocUrlRespSafeArray) Len() int
type FileSplitContent ¶
type FileSplitContent struct {
Content string `json:"content"`
Order int `json:"order"`
Status bool `json:"status"`
MetaData ContentMetaData `json:"meta_data"`
ContentId string `json:"content_id"`
UserId string `json:"userId"`
KbName string `json:"kb_name"`
FileName string `json:"file_name"`
Labels []string `json:"labels"`
}
type KnowledgeHitData ¶ added in v0.1.3
type KnowledgeHitData struct {
Prompt string `json:"prompt"`
SearchList []*ChunkSearchList `json:"searchList"`
Score []float64 `json:"score"`
}
type KnowledgeHitParams ¶ added in v0.1.3
type KnowledgeHitParams struct {
UserId string `json:"userId"`
Question string `json:"question" validate:"required"`
KnowledgeBase []string `json:"knowledgeBase" validate:"required"`
Threshold float64 `json:"threshold"`
TopK int32 `json:"topK"`
RerankModelId string `json:"rerank_model_id"` // rerankId
RerankMod string `json:"rerank_mod"` // rerank_model:重排序模式,weighted_score:权重搜索
RetrieveMethod string `json:"retrieve_method"` // hybrid_search:混合搜索, semantic_search:向量搜索, full_text_search:文本搜索
Weight *WeightParams `json:"weights"` // 权重搜索下的权重配置
TermWeight float32 `json:"term_weight_coefficient"` // 关键词系数
MetaFilter bool `json:"metadata_filtering"` // 元数据过滤开关
MetaFilterConditions []*MetadataFilterItem `json:"metadata_filtering_conditions"` // 元数据过滤条件
}
type MetadataFilterItem ¶ added in v0.2.2
type NewChunkItem ¶ added in v0.2.1
type RagCommonResp ¶
type RagCreateDocSegmentParams ¶ added in v0.2.0
type RagCreateDocSegmentParams struct {
UserId string `json:"userId"` // 发起请求的用户ID
KnowledgeBase string `json:"knowledgeBase"` // 知识库的名称
KnowledgeId string `json:"kb_id"` // 知识库的唯一ID
FileName string `json:"fileName"` // 与chunk关联的文件名
MaxSentenceSize int `json:"max_sentence_size"` // 最大分段长度限制
Chunks []*NewChunkItem `json:"chunks"` // 分段数据列表
}
type RagCreateParams ¶
type RagDeleteDocParams ¶
type RagDeleteDocSegmentParams ¶ added in v0.2.1
type RagDeleteParams ¶
type RagDocMetaParams ¶ added in v0.1.6
type RagDocSegmentLabelsParams ¶ added in v0.1.8
type RagDocSegmentLabelsParams struct {
UserId string `json:"userId"` // 发起请求的用户ID
KnowledgeBase string `json:"knowledgeBase"` // 知识库的名称
KnowledgeId string `json:"kb_id"` // 知识库的唯一ID
FileName string `json:"fileName"` // 与chunk关联的文件名
ContentId string `json:"chunk_id"` // 要更新标签的chunk的唯一ID
Labels []string `json:"labels"` // 需要为该chunk关联的标签列表
}
type RagDocSegmentResp ¶ added in v0.2.1
type RagDocSegmentResp struct {
Code int `json:"code"`
Message string `json:"message"`
Data SegmentResult `json:"data"`
}
type RagGetDocSegmentParams ¶
type RagGetDocSegmentResp ¶
type RagGetDocSegmentResp struct {
RagCommonResp
Data *ContentListResp `json:"data"`
}
type RagImportDocParams ¶
type RagImportDocParams struct {
DocId string `json:"id"` //文档id
KnowledgeName string `json:"categoryId"` //知识库名称
CategoryId string `json:"kb_id"` //知识库id
IsEnhanced string `json:"is_enhanced"`
UserId string `json:"userId"`
Overlap float32 `json:"overlap" `
ObjectName string `json:"objectName"`
SegmentSize int `json:"chunk_size"`
OriginalName string `json:"originalName"`
SegmentType string `json:"chunk_type"`
Separators []string `json:"separators"`
ParserChoices []string `json:"parser_choices"`
OcrModelId string `json:"ocr_model_id"`
PreProcess []string `json:"pre_process"`
RagMetaDataParams []*RagMetaDataParams `json:"meta_data"`
}
type RagImportUrlDocParams ¶
type RagImportUrlDocParams struct {
Url string `json:"url"`
FileName string `json:"file_name"`
Overlap float32 `json:"overlap_size" `
SegmentSize int `json:"sentence_size"`
SegmentType string `json:"chunk_type"`
UserId string `json:"userId"`
KnowledgeBaseName string `json:"knowledgeBase"`
IsEnhanced bool `json:"is_enhanced"`
Separators []string `json:"separators"`
TaskId string `json:"task_id"`
OcrModelId string `json:"ocr_model_id"`
PreProcess []string `json:"pre_process"`
RagMetaDataParams []*RagMetaDataParams `json:"meta_data"`
}
type RagKnowledgeHitResp ¶ added in v0.1.3
type RagKnowledgeHitResp struct {
Code int `json:"code"`
Message string `json:"message"`
Data *KnowledgeHitData `json:"data"`
}
func RagKnowledgeHit ¶ added in v0.1.3
func RagKnowledgeHit(ctx context.Context, knowledgeHitParams *KnowledgeHitParams) (*RagKnowledgeHitResp, error)
RagKnowledgeHit rag命中测试
type RagMetaDataParams ¶ added in v0.1.7
type RagOperateKeywordsParams ¶ added in v0.1.6
type RagOperationParams ¶
type RagOperationParams struct {
Operation string `json:"operation"`
Type string `json:"type"`
Doc *RagImportDocParams `json:"doc"`
}
type RagUpdateDocSegmentParams ¶ added in v0.2.1
type RagUpdateDocSegmentParams struct {
UserId string `json:"userId"` // 发起请求的用户ID
KnowledgeBase string `json:"knowledgeBase"` // 知识库的名称
KnowledgeId string `json:"kb_id"` // 知识库的唯一ID
FileName string `json:"fileName"` // 与chunk关联的文件名
MaxSentenceSize int `json:"max_sentence_size"` // 最大分段长度限制
Chunk *UpdateChunkItem `json:"chunk"` // 分段数据列表
}
type RagUpdateParams ¶
type SegmentResult ¶ added in v0.2.0
type SegmentResult struct {
SuccessCount int `json:"success_count"` // 分段成功导入数量
}
type UpdateChunkItem ¶ added in v0.2.1
type WeightParams ¶ added in v0.1.5
Click to show internal directories.
Click to hide internal directories.