Documentation
¶
Index ¶
- type Chunk
- type Credentials
- type DeleteQueryCond
- type DeleteReq
- type DeleteRes
- type DocumentSetInfo
- type DocumentSplitterPreprocess
- type GetChunksReq
- type GetChunksRes
- type GetReq
- type GetRes
- type QueryCond
- type QueryDocumentSet
- type QueryReq
- type QueryRes
- type RerankOption
- type SearchCond
- type SearchData
- type SearchDocument
- type SearchDocumentSet
- type SearchOption
- type SearchOptionWeight
- type SearchParams
- type SearchReq
- type SearchRes
- type UpdateQueryCond
- type UpdateReq
- type UpdateRes
- type UploadCondition
- type UploadUrlReq
- type UploadUrlRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type DeleteQueryCond ¶
type DeleteReq ¶
type DeleteReq struct { api.Meta `path:"/ai/documentSet/delete" tags:"Document" method:"Post"` Database string `json:"database"` CollectionView string `json:"collectionView"` Query *DeleteQueryCond `json:"query"` }
DeleteReq delete document request
type DocumentSetInfo ¶
type DocumentSetInfo struct { TextLength *uint64 `json:"textLength,omitempty"` ByteLength *uint64 `json:"byteLength,omitempty"` IndexedProgress *uint64 `json:"indexedProgress,omitempty"` IndexedStatus *string `json:"indexedStatus,omitempty"` // Ready | New | Loading | Failure CreateTime *string `json:"createTime,omitempty"` LastUpdateTime *string `json:"lastUpdateTime,omitempty"` IndexedErrorMsg *string `json:"indexedErrorMsg,omitempty"` Keywords *string `json:"keywords,omitempty"` }
type DocumentSplitterPreprocess ¶ added in v1.2.0
type DocumentSplitterPreprocess struct { AppendTitleToChunk *bool `json:"appendTitleToChunk,omitempty"` AppendKeywordsToChunk *bool `json:"appendKeywordsToChunk,omitempty"` ChunkSplitter *string `json:"chunkSplitter,omitempty"` }
DocumentSplitterPreprocess holds the parameters for splitting document chunks.
Fields:
- AppendTitleToChunk: (Optional) Whether to append the title to the splitting chunks (default to false).
- AppendKeywordsToChunk: (Optional) Whether to append the keywords to the splitting chunks, which are extracted from the full text (default to true).
- ChunkSplitter: The regular expression used to configure the document splitting method. For example, "\n{2,}" can be used in QA contents.
type GetChunksReq ¶ added in v1.2.0
type GetChunksReq struct { api.Meta `path:"/ai/documentSet/getChunks" tags:"Document" method:"Post""` Database string `json:"database"` CollectionView string `json:"collectionView"` DocumentSetName string `json:"documentSetName"` DocumentSetId string `json:"documentSetId"` Limit *int64 `json:"limit"` Offset int64 `json:"offset"` }
type GetChunksRes ¶ added in v1.2.0
type GetRes ¶
type GetRes struct { api.CommonRes Count uint64 `json:"count"` DocumentSets QueryDocumentSet `json:"documentSet"` }
type QueryDocumentSet ¶
type QueryDocumentSet struct { DocumentSetId string `json:"documentSetId"` DocumentSetName string `json:"documentSetName"` Text *string `json:"text,omitempty"` TextPrefix *string `json:"textPrefix,omitempty"` DocumentSetInfo *DocumentSetInfo `json:"documentSetInfo,omitempty"` ScalarFields map[string]interface{} `json:"-"` SplitterPreprocess *DocumentSplitterPreprocess `json:"splitterPreprocess,omitempty"` ParsingProcess *api.ParsingProcess `json:"parsingProcess,omitempty"` }
Document document struct for document api
func (QueryDocumentSet) MarshalJSON ¶
func (d QueryDocumentSet) MarshalJSON() ([]byte, error)
func (*QueryDocumentSet) UnmarshalJSON ¶
func (d *QueryDocumentSet) UnmarshalJSON(data []byte) error
type QueryReq ¶
type QueryReq struct { api.Meta `path:"/ai/documentSet/query" tags:"Document" method:"Post"` Database string `json:"database"` CollectionView string `json:"collectionView"` Query *QueryCond `json:"query"` }
QueryReq query document request
type QueryRes ¶
type QueryRes struct { api.CommonRes Count uint64 `json:"count"` DocumentSets []QueryDocumentSet `json:"documentSets"` }
QueryRes query document response
type RerankOption ¶
type RerankOption struct { Enable *bool `json:"enable,omitempty"` ExpectRecallMultiples float32 `json:"expectRecallMultiples,omitempty"` }
RerankOption holds the parameters for reranking.
Fields:
- Enable: (Optional) Whether to enable word vector reranking (default to false).
- ExpectRecallMultiples: (Optional) The recall amplification factor for word vector reordering (default to 5). The maximum number of elements to be recalled is 256.
type SearchCond ¶
type SearchCond struct { Content string `json:"content"` DocumentSetName []string `json:"documentSetName"` Options SearchOption `json:"options"` Filter string `json:"filter"` Limit int64 `json:"limit,omitempty"` // 结果数量 }
SearchCond search filter condition
type SearchData ¶
type SearchDocument ¶
type SearchDocument struct { Score float64 `json:"score"` Data SearchData `json:"data"` DocumentSet SearchDocumentSet `json:"documentSet"` }
type SearchDocumentSet ¶
type SearchDocumentSet struct { DocumentSetId string `json:"documentSetId"` DocumentSetName string `json:"documentSetName"` ScalarFields map[string]interface{} `json:"-"` }
func (SearchDocumentSet) MarshalJSON ¶
func (s SearchDocumentSet) MarshalJSON() ([]byte, error)
func (*SearchDocumentSet) UnmarshalJSON ¶
func (s *SearchDocumentSet) UnmarshalJSON(data []byte) error
type SearchOption ¶
type SearchOption struct { // ResultType string `json:"resultType"` // chunks|paragraphs|file ChunkExpand []int `json:"chunkExpand"` // 搜索结果中,向前、向后补齐几个chunk的上下文 RerankOption *RerankOption `json:"rerank,omitempty"` // 多路召回 }
type SearchOptionWeight ¶
type SearchParams ¶
type SearchReq ¶
type SearchReq struct { api.Meta `path:"/ai/documentSet/search" tags:"Document" method:"Post"` Database string `json:"database"` CollectionView string `json:"collectionView"` ReadConsistency string `json:"readConsistency"` Search *SearchCond `json:"search"` }
SearchReq search documents request
type SearchRes ¶
type SearchRes struct { api.CommonRes Documents []SearchDocument `json:"documents"` }
SearchRes search documents response
type UpdateQueryCond ¶
type UploadCondition ¶
type UploadCondition struct {
MaxSupportContentLength int64 `json:"maxSupportContentLength"`
}
type UploadUrlReq ¶
type UploadUrlReq struct { api.Meta `path:"/ai/documentSet/uploadUrl" tags:"Document" method:"Post" summary:"获取cos上传签名"` Database string `json:"database"` CollectionView string `json:"collectionView"` DocumentSetName string `json:"documentSetName"` ByteLength *uint64 `json:"byteLength,omitempty"` ParsingProcess *api.ParsingProcess `json:"parsingProcess,omitempty"` }
type UploadUrlRes ¶
type UploadUrlRes struct { api.CommonRes DocumentSetId string `json:"documentSetId"` CosEndpoint string `json:"cosEndpoint"` CosRegion string `json:"cosRegion"` CosBucket string `json:"cosBucket"` UploadPath string `json:"uploadPath"` Credentials *Credentials `json:"credentials"` UploadCondition *UploadCondition `json:"uploadCondition"` }
Click to show internal directories.
Click to hide internal directories.