MCPcopy Create free account
hub / github.com/53AI/53AIHub / GetLibraryByID

Function GetLibraryByID

api/model/library.go:140–152  ·  view source on GitHub ↗

GetLibraryByID 根据ID获取知识库

(eid int64, id int64)

Source from the content-addressed store, hash-verified

138
139// GetLibraryByID 根据ID获取知识库
140func GetLibraryByID(eid int64, id int64) (*Library, error) {
141 libraries, err := GetLibrariesByEidCached(eid)
142 if err != nil {
143 return nil, err
144 }
145 for i := range libraries {
146 if libraries[i].ID == id {
147 library := libraries[i]
148 return &library, nil
149 }
150 }
151 return nil, gorm.ErrRecordNotFound
152}
153
154// GetLibrariesByIDs 根据ID列表批量获取知识库
155func GetLibrariesByIDs(eid int64, ids []int64) ([]Library, error) {

Callers 3

SaveMethod · 0.85
deleteVectorsFromDBFunction · 0.85
DeleteLibraryFunction · 0.85

Calls 1

GetLibrariesByEidCachedFunction · 0.85

Tested by

no test coverage detected