Skip to content

Commit

Permalink
Improved formatting [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Jan 16, 2025
1 parent 3b4bb2f commit 0b7b16d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions ent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,26 @@ func TestEnt(t *testing.T) {
halfEmbedding := pgvector.NewHalfVector([]float32{1, 1, 1})
binaryEmbedding := "000"
sparseEmbedding := pgvector.NewSparseVector([]float32{1, 1, 1})
_, err = client.Item.Create().SetEmbedding(embedding).SetHalfEmbedding(halfEmbedding).SetBinaryEmbedding(binaryEmbedding).SetSparseEmbedding(sparseEmbedding).Save(ctx)
_, err = client.Item.Create().
SetEmbedding(embedding).
SetHalfEmbedding(halfEmbedding).
SetBinaryEmbedding(binaryEmbedding).
SetSparseEmbedding(sparseEmbedding).Save(ctx)
if err != nil {
panic(err)
}

_, err = client.Item.CreateBulk(
client.Item.Create().SetEmbedding(pgvector.NewVector([]float32{2, 2, 2})).SetHalfEmbedding(pgvector.NewHalfVector([]float32{2, 2, 2})).SetBinaryEmbedding("101").SetSparseEmbedding(pgvector.NewSparseVector([]float32{2, 2, 2})),
client.Item.Create().SetEmbedding(pgvector.NewVector([]float32{1, 1, 2})).SetHalfEmbedding(pgvector.NewHalfVector([]float32{1, 1, 2})).SetBinaryEmbedding("111").SetSparseEmbedding(pgvector.NewSparseVector([]float32{1, 1, 2})),
client.Item.Create().
SetEmbedding(pgvector.NewVector([]float32{2, 2, 2})).
SetHalfEmbedding(pgvector.NewHalfVector([]float32{2, 2, 2})).
SetBinaryEmbedding("101").
SetSparseEmbedding(pgvector.NewSparseVector([]float32{2, 2, 2})),
client.Item.Create().
SetEmbedding(pgvector.NewVector([]float32{1, 1, 2})).
SetHalfEmbedding(pgvector.NewHalfVector([]float32{1, 1, 2})).
SetBinaryEmbedding("111").
SetSparseEmbedding(pgvector.NewSparseVector([]float32{1, 1, 2})),
).Save(ctx)
if err != nil {
panic(err)
Expand Down

0 comments on commit 0b7b16d

Please sign in to comment.