()
| 20 | } |
| 21 | |
| 22 | func init() { |
| 23 | err := GetCollection(common.GlobalObject.Qdrant.CollectionName) |
| 24 | if err == nil { |
| 25 | return |
| 26 | } |
| 27 | createCollectionRequest := CreateCollectionRequest{Vectors: Vectors{ |
| 28 | Size: 1536, |
| 29 | Distance: "Cosine", |
| 30 | }} |
| 31 | err = CreateCollection(common.GlobalObject.Qdrant.CollectionName, createCollectionRequest) |
| 32 | if err != nil { |
| 33 | panic("init error:" + err.Error()) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // CreateCollection creates a collection in qdrant |
| 38 | func CreateCollection(name string, createCollectionRequest CreateCollectionRequest) (err error) { |
nothing calls this directly
no test coverage detected