Documentation
¶
Index ¶
- Constants
- func BatchRagDocMeta(ctx context.Context, batchRagDocTagParams *BatchRagDocMetaParams) error
- 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 RagAddReport(ctx context.Context, ragAddReportParams *RagAddReportParams) error
- func RagBatchDeleteMeta(ctx context.Context, ragDeleteParams *RagBatchDeleteMetaParams) error
- func RagBatchUpdateMeta(ctx context.Context, ragUpdateParams *RagBatchUpdateMetaKeyParams) error
- func RagBuildKnowledgeGraph(ctx context.Context, ragImportDocParams *RagImportDocParams) error
- func RagCreateDocChildSegment(ctx context.Context, ...) error
- func RagCreateDocSegment(ctx context.Context, ragCreateDocSegmentParams *RagCreateDocSegmentParams) error
- func RagCreateKnowledgeReport(ctx context.Context, ragImportDocParams *RagImportDocParams) error
- func RagDeleteDoc(ctx context.Context, ragDeleteDocParams *RagDeleteDocParams) error
- func RagDeleteDocChildSegment(ctx context.Context, ...) error
- func RagDeleteDocSegment(ctx context.Context, ragDeleteDocSegmentParams *RagDeleteDocSegmentParams) error
- func RagDeleteReport(ctx context.Context, ragDeleteReportParams *RagDeleteReportParams) 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 RagUpdateDocChildSegment(ctx context.Context, ...) error
- func RagUpdateDocSegment(ctx context.Context, ragUpdateDocSegmentParams *RagUpdateDocSegmentParams) error
- func RagUpdateReport(ctx context.Context, ragUpdateReportParams *RagUpdateReportParams) error
- func RebuildFileName(docId, docType, docName string) string
- func RebuildSegmentType(segmentType string, segmentMethod string) string
- func RebuildSplitType(segmentMethod 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 BatchRagDocMetaParams
- type ChildChunk
- type ChildChunkConfig
- type ChildContent
- type ChildContentListResp
- type ChildContentMeta
- type ChildFileSplitContent
- type ChunkSearchList
- type ContentListResp
- type ContentMetaData
- type DocMetaData
- type DocMetaInfo
- 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 RagAddReportItem
- type RagAddReportParams
- type RagBatchDeleteMetaParams
- type RagBatchReportCount
- type RagBatchReportResp
- type RagBatchUpdateMetaKeyParams
- type RagChunkConfig
- type RagCommonResp
- type RagCreateDocChildSegmentParams
- type RagCreateDocSegmentParams
- type RagCreateParams
- type RagDeleteDocChildSegmentParams
- type RagDeleteDocParams
- type RagDeleteDocSegmentParams
- type RagDeleteParams
- type RagDeleteReportParams
- type RagDocMetaParams
- type RagDocSegmentLabelsParams
- type RagDocSegmentResp
- type RagGetDocChildSegmentParams
- type RagGetDocChildSegmentResp
- type RagGetDocSegmentParams
- type RagGetDocSegmentResp
- type RagGetReportParams
- type RagGetReportResp
- type RagImportDocParams
- type RagImportUrlDocParams
- type RagKnowledgeGraphParams
- type RagKnowledgeGraphResp
- type RagKnowledgeHitResp
- type RagKnowledgeInfo
- type RagMetaDataParams
- type RagMetaMapKeys
- type RagOperateKeywordsParams
- type RagOperationParams
- type RagReportInfo
- type RagReportListResp
- type RagUpdateDocChildSegmentParams
- type RagUpdateDocSegmentParams
- type RagUpdateParams
- type RagUpdateReportItem
- type RagUpdateReportParams
- type SegmentResult
- type UpdateChunkItem
- type WeightParams
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func BatchRagDocMeta ¶ added in v0.2.3
func BatchRagDocMeta(ctx context.Context, batchRagDocTagParams *BatchRagDocMetaParams) error
BatchRagDocMeta 更新文档元数据
func DownloadFileObject ¶ added in v0.2.1
func DownloadFileToLocal ¶
func RagAddReport ¶ added in v0.2.7
func RagAddReport(ctx context.Context, ragAddReportParams *RagAddReportParams) error
RagAddReport rag更新社区报告
func RagBatchDeleteMeta ¶ added in v0.2.3
func RagBatchDeleteMeta(ctx context.Context, ragDeleteParams *RagBatchDeleteMetaParams) error
func RagBatchUpdateMeta ¶ added in v0.2.3
func RagBatchUpdateMeta(ctx context.Context, ragUpdateParams *RagBatchUpdateMetaKeyParams) error
func RagBuildKnowledgeGraph ¶ added in v0.2.7
func RagBuildKnowledgeGraph(ctx context.Context, ragImportDocParams *RagImportDocParams) error
RagBuildKnowledgeGraph 构建知识库图谱
func RagCreateDocChildSegment ¶ added in v0.2.4
func RagCreateDocChildSegment(ctx context.Context, ragCreateDocChildSegmentParams *RagCreateDocChildSegmentParams) error
RagCreateDocChildSegment 新增文档子切片
func RagCreateDocSegment ¶ added in v0.2.0
func RagCreateDocSegment(ctx context.Context, ragCreateDocSegmentParams *RagCreateDocSegmentParams) error
RagCreateDocSegment 新增文档切片
func RagCreateKnowledgeReport ¶ added in v0.2.7
func RagCreateKnowledgeReport(ctx context.Context, ragImportDocParams *RagImportDocParams) error
RagCreateKnowledgeReport 创建知识库社区报告
func RagDeleteDoc ¶
func RagDeleteDoc(ctx context.Context, ragDeleteDocParams *RagDeleteDocParams) error
RagDeleteDoc 删除具体文档
func RagDeleteDocChildSegment ¶ added in v0.2.4
func RagDeleteDocChildSegment(ctx context.Context, ragDeleteDocChildSegmentParams *RagDeleteDocChildSegmentParams) error
RagDeleteDocChildSegment 删除文档子切片
func RagDeleteDocSegment ¶ added in v0.2.1
func RagDeleteDocSegment(ctx context.Context, ragDeleteDocSegmentParams *RagDeleteDocSegmentParams) error
RagDeleteDocSegment 删除文档切片
func RagDeleteReport ¶ added in v0.2.7
func RagDeleteReport(ctx context.Context, ragDeleteReportParams *RagDeleteReportParams) error
RagDeleteReport rag删除社区报告
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 RagUpdateDocChildSegment ¶ added in v0.2.4
func RagUpdateDocChildSegment(ctx context.Context, ragUpdateDocChildSegmentParams *RagUpdateDocChildSegmentParams) error
RagUpdateDocChildSegment 更新文档子切片
func RagUpdateDocSegment ¶ added in v0.2.1
func RagUpdateDocSegment(ctx context.Context, ragUpdateDocSegmentParams *RagUpdateDocSegmentParams) error
RagUpdateDocSegment 更新文档切片
func RagUpdateReport ¶ added in v0.2.7
func RagUpdateReport(ctx context.Context, ragUpdateReportParams *RagUpdateReportParams) error
RagUpdateReport rag更新社区报告
func RebuildFileName ¶
func RebuildSegmentType ¶
RebuildSegmentType 转换分段类型
func RebuildSplitType ¶ added in v0.2.3
RebuildSplitType 转换分段方法
func SplitFilePath ¶
func UploadFile ¶
Types ¶
type BatchRagDocMetaParams ¶ added in v0.2.3
type BatchRagDocMetaParams struct {
UserId string `json:"userId"`
KnowledgeBase string `json:"knowledgeBase"`
KnowledgeId string `json:"kb_id"`
MetaList []*DocMetaInfo `json:"metas"`
}
type ChildChunk ¶ added in v0.2.4
type ChildChunkConfig ¶ added in v0.2.4
type ChildChunkConfig struct {
Separators []string `json:"separators"` // 分隔符
ChunkSize int32 `json:"chunk_size"` // 子分段大小
}
func RebuildChildChunkConfig ¶ added in v0.2.4
func RebuildChildChunkConfig(segmentMethod string, subMaxSplitter int, subSplitter []string) *ChildChunkConfig
type ChildContent ¶ added in v0.2.3
type ChildContentListResp ¶ added in v0.2.3
type ChildContentListResp struct {
ParentChunkId string `json:"parent_chunk_id"`
ChildChunkTotalNum int `json:"child_chunk_total_num"` // 以这个字段为准
ChildContentList []ChildFileSplitContent `json:"child_content_list"`
}
func RagGetDocChildSegmentList ¶ added in v0.2.3
func RagGetDocChildSegmentList(ctx context.Context, ragGetDocChildSegmentParams *RagGetDocChildSegmentParams) (*ChildContentListResp, error)
type ChildContentMeta ¶ added in v0.2.3
type ChildContentMeta struct {
FileName string `json:"file_name"`
ChildChunkCurrentNum int `json:"child_chunk_current_num"`
ChildChunkTotalNum int `json:"child_chunk_total_num"`
DownloadLink string `json:"download_link"`
BucketName string `json:"bucket_name"`
ObjectName string `json:"object_name"`
DocMeta []*DocMetaData `json:"doc_meta"`
}
type ChildFileSplitContent ¶ added in v0.2.3
type ChildFileSplitContent struct {
Content string `json:"content"`
ChunkId string `json:"chunk_id"` // 尽量不用
FileName string `json:"file_name"`
OssPath string `json:"oss_path"`
MetaData ChildContentMeta `json:"meta_data"`
Status bool `json:"status"`
ContentId string `json:"content_id"`
ParentContentId string `json:"parent_content_id"`
KnowledgeName string `json:"kb_name"`
IsParent bool `json:"is_parent"` // false是子分段
}
type ChunkSearchList ¶ added in v0.1.3
type ChunkSearchList struct {
Title string `json:"title"`
Snippet string `json:"snippet"`
KbName string `json:"kb_name"`
MetaData interface{} `json:"meta_data"`
ChildContentList []*ChildContent `json:"child_content_list"`
ChildScore []float64 `json:"child_score"`
ContentType string `json:"content_type"` // graph:知识图谱(文本), text:文档分段(文本), community_report:社区报告(markdown)
}
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 ContentMetaData struct {
FileName string `json:"file_name"`
ChunkCurrentNum int `json:"chunk_current_num"`
ChunkTotalNum int `json:"chunk_total_num"`
DownloadLink string `json:"download_link"`
BucketName string `json:"bucket_name"`
ObjectName string `json:"object_name"`
DocMeta []*DocMetaData `json:"doc_meta"`
}
type DocMetaData ¶ added in v0.2.3
type DocMetaInfo ¶ added in v0.2.3
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"`
ChunkId string `json:"chunk_id"`
OssPath string `json:"oss_path"`
IsParent bool `json:"is_parent"` // 区分是否是父分段,true是父分段,false是子分段,不存在这个key时说明文档分段模式不是父子分段
ChildChunkTotalNum int `json:"child_chunk_total_num"` // 父分段对应子分段数量
}
type KnowledgeHitData ¶ added in v0.1.3
type KnowledgeHitData struct {
Prompt string `json:"prompt"`
SearchList []*ChunkSearchList `json:"searchList"`
Score []float64 `json:"score"`
UseGraph bool `json:"use_graph"`
}
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"`
KnowledgeIdList []string `json:"knowledgeIdList" 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"` // 元数据过滤条件
UseGraph bool `json:"use_graph"` // 是否使用知识图谱
}
type MetadataFilterItem ¶ added in v0.2.2
type NewChunkItem ¶ added in v0.2.1
type RagAddReportItem ¶ added in v0.2.7
type RagAddReportParams ¶ added in v0.2.7
type RagAddReportParams struct {
UserId string `json:"userId"`
KnowledgeBaseName string `json:"knowledgeBase"`
KnowledgeId string `json:"kb_id"`
ReportItem []*RagAddReportItem `json:"reports"`
}
type RagBatchDeleteMetaParams ¶ added in v0.2.3
type RagBatchReportCount ¶ added in v0.2.7
type RagBatchReportCount struct {
SuccessCount int `json:"success_count"` // 成功的社区报告数量
}
type RagBatchReportResp ¶ added in v0.2.7
type RagBatchReportResp struct {
RagCommonResp
Data *RagBatchReportCount `json:"data"`
}
type RagBatchUpdateMetaKeyParams ¶ added in v0.2.3
type RagBatchUpdateMetaKeyParams struct {
UserId string `json:"userId"` // 用户id
KnowledgeBase string `json:"knowledgeBase"` // 知识库名称
KnowledgeId string `json:"kb_id"` // 知识库id
Mappings []*RagMetaMapKeys `json:"mappings"` // 元数据key映射列表
}
type RagChunkConfig ¶ added in v0.2.3
type RagCommonResp ¶
type RagCreateDocChildSegmentParams ¶ added in v0.2.4
type RagCreateDocChildSegmentParams struct {
UserId string `json:"userId"` // 发起请求的用户ID
KnowledgeBase string `json:"knowledgeBase"` // 知识库的名称
KnowledgeId string `json:"kb_id"` // 知识库的唯一ID
FileName string `json:"fileName"` // 与chunk关联的文件名
ChunkId string `json:"chunk_id"` // 父分段id
ChildContents []string `json:"child_contents"` // 子分段内容
}
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"` // 分段数据列表
SplitType string `json:"split_type"` // 分段类型 //parent_child|common
ChildChunkConfig *ChildChunkConfig `json:"child_chunk_config"` //子分段配置
}
type RagCreateParams ¶
type RagDeleteDocChildSegmentParams ¶ added in v0.2.4
type RagDeleteDocChildSegmentParams struct {
UserId string `json:"userId"` // 发起请求的用户ID
KnowledgeBase string `json:"knowledgeBase"` // 知识库的名称
KnowledgeId string `json:"kb_id"` // 知识库的唯一ID
FileName string `json:"fileName"` // 与chunk关联的文件名
ChunkId string `json:"chunk_id"` // 父分段id
ChunkCurrentNum int32 `json:"chunk_current_num"` // 父分段序列号
ChildChunkCurrentNums []int32 `json:"child_chunk_current_nums"` // 子分段序列号列表
}
type RagDeleteDocParams ¶
type RagDeleteDocSegmentParams ¶ added in v0.2.1
type RagDeleteParams ¶
type RagDeleteReportParams ¶ added in v0.2.7
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 RagGetDocChildSegmentParams ¶ added in v0.2.3
type RagGetDocChildSegmentResp ¶ added in v0.2.3
type RagGetDocChildSegmentResp struct {
RagCommonResp
Data *ChildContentListResp `json:"data"`
}
type RagGetDocSegmentParams ¶
type RagGetDocSegmentResp ¶
type RagGetDocSegmentResp struct {
RagCommonResp
Data *ContentListResp `json:"data"`
}
type RagGetReportParams ¶ added in v0.2.7
type RagGetReportResp ¶ added in v0.2.7
type RagGetReportResp struct {
RagCommonResp
Data *RagReportListResp `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"`
SplitType string `json:"split_type"` //parent_child|common
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"`
RagChildChunkConfig *RagChunkConfig `json:"child_chunk_config"`
KnowledgeGraphSwitch bool `json:"enable_knowledge_graph"`
GraphModelId string `json:"graph_model_id"`
GraphSchemaObjectName string `json:"graph_schema_objectname"`
GraphSchemaFileName string `json:"graph_schema_filename"`
MessageType string `json:"message_type,omitempty"`
}
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"`
SplitType string `json:"split_type"` //parent_child|common
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 RagKnowledgeGraphParams ¶ added in v0.2.7
type RagKnowledgeGraphResp ¶ added in v0.2.7
type RagKnowledgeGraphResp struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data"`
}
func RagKnowledgeGraph ¶ added in v0.2.7
func RagKnowledgeGraph(ctx context.Context, knowledgeGraphParams *RagKnowledgeGraphParams) (*RagKnowledgeGraphResp, error)
RagKnowledgeGraph rag知识图谱
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 RagKnowledgeInfo ¶ added in v0.2.5
type RagMetaDataParams ¶ added in v0.1.7
type RagMetaMapKeys ¶ added in v0.2.3
type RagOperateKeywordsParams ¶ added in v0.1.6
type RagOperateKeywordsParams struct {
Id uint32 `json:"id"`
UserId string `json:"user_id"`
Action string `json:"action"`
Name string `json:"name"`
Alias []string `json:"alias"`
KnowledgeBaseIds []string `json:"knowledge_base_list"`
RagKnowledgeInfo map[string][]*RagKnowledgeInfo `json:"knowledge_base_info"`
}
type RagOperationParams ¶
type RagOperationParams struct {
Operation string `json:"operation"`
Type string `json:"type"`
Doc *RagImportDocParams `json:"doc"`
}
type RagReportInfo ¶ added in v0.2.7
type RagReportInfo struct {
ReportTitle string `json:"report_title"` // 社区报告标题
Content string `json:"content"` // 社区报告内容
ChunkId string `json:"chunk_id"` // 社区报告id
MetaData interface{} `json:"meta_data"` // 元数据
Status bool `json:"status"` // 社区报告状态
ContentId string `json:"content_id"` // 社区报告id
KbName string `json:"kb_name"` // 知识库名称
CreateTime string `json:"create_time"` // 生成时间
}
type RagReportListResp ¶ added in v0.2.7
type RagReportListResp struct {
List []RagReportInfo `json:"content_list"`
ChunkTotalNum int `json:"chunk_total_num"` // 社区报告数量
}
func RagGetReport ¶ added in v0.2.7
func RagGetReport(ctx context.Context, ragGetReportParams *RagGetReportParams) (*RagReportListResp, error)
RagGetReport rag获取社区报告
type RagUpdateDocChildSegmentParams ¶ added in v0.2.4
type RagUpdateDocChildSegmentParams struct {
UserId string `json:"userId"` // 发起请求的用户ID
KnowledgeBase string `json:"knowledgeBase"` // 知识库的名称
KnowledgeId string `json:"kb_id"` // 知识库的唯一ID
FileName string `json:"fileName"` // 与chunk关联的文件名
ChunkId string `json:"chunk_id"` // 父分段id
ChunkCurrentNum int32 `json:"chunk_current_num"` // 父分段序列号
ChildChunk *ChildChunk `json:"child_chunk"` // 子分段内容
}
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"` // 分段数据列表
SplitType string `json:"split_type"` // 分段类型 //parent_child|common
ChildChunkConfig *ChildChunkConfig `json:"child_chunk_config"` //子分段配置
}
type RagUpdateParams ¶
type RagUpdateReportItem ¶ added in v0.2.7
type RagUpdateReportParams ¶ added in v0.2.7
type RagUpdateReportParams struct {
UserId string `json:"userId"`
KnowledgeBaseName string `json:"knowledgeBase"`
KnowledgeId string `json:"kb_id"`
ReportItem *RagUpdateReportItem `json:"reports"`
}
type SegmentResult ¶ added in v0.2.0
type SegmentResult struct {
SuccessCount int `json:"success_count"` // 分段成功导入数量
}