Skip to content

Commit

Permalink
Make confidenceInterval a float
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippus committed Jul 13, 2024
1 parent 32c3749 commit 7db21fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ case object DotProduct extends Similarity { val name = "dot_product" }
case object Cosine extends Similarity { val name = "cosine" }
case object MaxInnerProduct extends Similarity { val name = "max_inner_product" }

case class DenseVectorIndexOptions(`type`: DenseVectorField.KnnType, m: Option[Int] = None, efConstruction: Option[Int] = None, confidenceInterval: Option[Double] = None)
case class DenseVectorIndexOptions(`type`: DenseVectorField.KnnType, m: Option[Int] = None, efConstruction: Option[Int] = None, confidenceInterval: Option[Float] = None) {

}

case class DenseVectorField(name: String,
elementType: Option[String] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object DenseVectorFieldBuilderFn {
DenseVectorField.Int8Hnsw,
values.get("m").map(_.asInstanceOf[Int]),
values.get("ef_construction").map(_.asInstanceOf[Int]),
values.get("confidence_interval").map(_.asInstanceOf[Double])
values.get("confidence_interval").map(d => d.asInstanceOf[Double].toFloat)
)
case "flat" => DenseVectorIndexOptions(
DenseVectorField.Flat
Expand All @@ -32,7 +32,7 @@ object DenseVectorFieldBuilderFn {
DenseVectorField.Int8Flat,
None,
None,
values.get("confidence_interval").map(_.asInstanceOf[Double])
values.get("confidence_interval").map(d => d.asInstanceOf[Double].toFloat)
)
}

Expand Down

0 comments on commit 7db21fd

Please sign in to comment.