Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.4.1"
".": "2.5.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/turbopuffer-benesch/turbopuffer-c47147eabda459ce775ffbab42a531bb3f2778c4cce15f88e05a4eed97013a21.yml
openapi_spec_hash: a981d1b889452ec8c0108ee0ec69dc6d
config_hash: 068c4c3b2277de182691cc65c1e50a7c
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/turbopuffer-benesch/turbopuffer-45f4429a37dcc469269006f05ea38ee3973087f22456b1cdb60b682902997372.yml
openapi_spec_hash: a606206d2ac6886fe31c3392a1f590ea
config_hash: d3fc3b93270f7ee8ae68224dafcfeb6d
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 2.5.0 (2026-07-03)

Full Changelog: [v2.4.1...v2.5.0](https://github.com/turbopuffer/turbopuffer-java/compare/v2.4.1...v2.5.0)

### Features

* spec: add sharding config to the openapi spec ([80ab39d](https://github.com/turbopuffer/turbopuffer-java/commit/80ab39dc6139b94e054f2863f610a7a13aa58b8e))
* support late_interaction parameter in sdks ([3ad0e51](https://github.com/turbopuffer/turbopuffer-java/commit/3ad0e51302ae70de600465b800ac9398bb055b62))


### Chores

* fix import ordering in generated tests ([#247](https://github.com/turbopuffer/turbopuffer-java/issues/247)) ([1e75734](https://github.com/turbopuffer/turbopuffer-java/commit/1e75734881ca2b8042608ace48450880a5dd03fd))

## 2.4.1 (2026-06-25)

Full Changelog: [v2.4.0...v2.4.1](https://github.com/turbopuffer/turbopuffer-java/compare/v2.4.0...v2.4.1)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.turbopuffer/turbopuffer-java)](https://central.sonatype.com/artifact/com.turbopuffer/turbopuffer-java/2.4.1)
[![javadoc](https://javadoc.io/badge2/com.turbopuffer/turbopuffer-java/2.4.1/javadoc.svg)](https://javadoc.io/doc/com.turbopuffer/turbopuffer-java/2.4.1)
[![Maven Central](https://img.shields.io/maven-central/v/com.turbopuffer/turbopuffer-java)](https://central.sonatype.com/artifact/com.turbopuffer/turbopuffer-java/2.5.0)
[![javadoc](https://javadoc.io/badge2/com.turbopuffer/turbopuffer-java/2.5.0/javadoc.svg)](https://javadoc.io/doc/com.turbopuffer/turbopuffer-java/2.5.0)

<!-- x-release-please-end -->

Expand All @@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/).

<!-- x-release-please-start-version -->

The HTTP API documentation can be found at [turbopuffer.com/docs/api-overview](https://turbopuffer.com/docs/api-overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.turbopuffer/turbopuffer-java/2.4.1).
The HTTP API documentation can be found at [turbopuffer.com/docs/api-overview](https://turbopuffer.com/docs/api-overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.turbopuffer/turbopuffer-java/2.5.0).

<!-- x-release-please-end -->

Expand All @@ -24,7 +24,7 @@ The HTTP API documentation can be found at [turbopuffer.com/docs/api-overview](h
### Gradle

```kotlin
implementation("com.turbopuffer:turbopuffer-java:2.4.1")
implementation("com.turbopuffer:turbopuffer-java:2.5.0")
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation("com.turbopuffer:turbopuffer-java:2.4.1")
<dependency>
<groupId>com.turbopuffer</groupId>
<artifactId>turbopuffer-java</artifactId>
<version>2.4.1</version>
<version>2.5.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.turbopuffer"
version = "2.4.1" // x-release-please-version
version = "2.5.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -729,15 +729,19 @@ private constructor(
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val distanceMetric: JsonField<DistanceMetric>,
private val lateInteraction: JsonField<Boolean>,
private val additionalProperties: MutableMap<String, JsonValue>,
) {

@JsonCreator
private constructor(
@JsonProperty("distance_metric")
@ExcludeMissing
distanceMetric: JsonField<DistanceMetric> = JsonMissing.of()
) : this(distanceMetric, mutableMapOf())
distanceMetric: JsonField<DistanceMetric> = JsonMissing.of(),
@JsonProperty("late_interaction")
@ExcludeMissing
lateInteraction: JsonField<Boolean> = JsonMissing.of(),
) : this(distanceMetric, lateInteraction, mutableMapOf())

/**
* A function used to calculate vector similarity.
Expand All @@ -748,6 +752,17 @@ private constructor(
fun distanceMetric(): Optional<DistanceMetric> =
distanceMetric.getOptional("distance_metric")

/**
* Opt in to late-interaction (MUVERA) indexing. Only valid on fixed-dim `[][N]f32`
* vector array attributes, and is required to enable an ANN index on such attributes.
* Defaults to `false`.
*
* @throws TurbopufferInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
*/
fun lateInteraction(): Optional<Boolean> =
lateInteraction.getOptional("late_interaction")

/**
* Returns the raw JSON value of [distanceMetric].
*
Expand All @@ -758,6 +773,16 @@ private constructor(
@ExcludeMissing
fun _distanceMetric(): JsonField<DistanceMetric> = distanceMetric

/**
* Returns the raw JSON value of [lateInteraction].
*
* Unlike [lateInteraction], this method doesn't throw if the JSON field has an
* unexpected type.
*/
@JsonProperty("late_interaction")
@ExcludeMissing
fun _lateInteraction(): JsonField<Boolean> = lateInteraction

@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
Expand All @@ -780,11 +805,13 @@ private constructor(
class Builder internal constructor() {

private var distanceMetric: JsonField<DistanceMetric> = JsonMissing.of()
private var lateInteraction: JsonField<Boolean> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(annConfig: AnnConfig) = apply {
distanceMetric = annConfig.distanceMetric
lateInteraction = annConfig.lateInteraction
additionalProperties = annConfig.additionalProperties.toMutableMap()
}

Expand All @@ -803,6 +830,25 @@ private constructor(
this.distanceMetric = distanceMetric
}

/**
* Opt in to late-interaction (MUVERA) indexing. Only valid on fixed-dim `[][N]f32`
* vector array attributes, and is required to enable an ANN index on such
* attributes. Defaults to `false`.
*/
fun lateInteraction(lateInteraction: Boolean) =
lateInteraction(JsonField.of(lateInteraction))

/**
* Sets [Builder.lateInteraction] to an arbitrary JSON value.
*
* You should usually call [Builder.lateInteraction] with a well-typed [Boolean]
* value instead. This method is primarily for setting the field to an undocumented
* or not yet supported value.
*/
fun lateInteraction(lateInteraction: JsonField<Boolean>) = apply {
this.lateInteraction = lateInteraction
}

fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
Expand Down Expand Up @@ -831,7 +877,7 @@ private constructor(
* Further updates to this [Builder] will not mutate the returned instance.
*/
fun build(): AnnConfig =
AnnConfig(distanceMetric, additionalProperties.toMutableMap())
AnnConfig(distanceMetric, lateInteraction, additionalProperties.toMutableMap())
}

private var validated: Boolean = false
Expand All @@ -852,6 +898,7 @@ private constructor(
}

distanceMetric().ifPresent { it.validate() }
lateInteraction()
validated = true
}

Expand All @@ -870,7 +917,9 @@ private constructor(
* Used for best match union deserialization.
*/
@JvmSynthetic
internal fun validity(): Int = (distanceMetric.asKnown().getOrNull()?.validity() ?: 0)
internal fun validity(): Int =
(distanceMetric.asKnown().getOrNull()?.validity() ?: 0) +
(if (lateInteraction.asKnown().isPresent) 1 else 0)

override fun equals(other: Any?): Boolean {
if (this === other) {
Expand All @@ -879,15 +928,18 @@ private constructor(

return other is AnnConfig &&
distanceMetric == other.distanceMetric &&
lateInteraction == other.lateInteraction &&
additionalProperties == other.additionalProperties
}

private val hashCode: Int by lazy { Objects.hash(distanceMetric, additionalProperties) }
private val hashCode: Int by lazy {
Objects.hash(distanceMetric, lateInteraction, additionalProperties)
}

override fun hashCode(): Int = hashCode

override fun toString() =
"AnnConfig{distanceMetric=$distanceMetric, additionalProperties=$additionalProperties}"
"AnnConfig{distanceMetric=$distanceMetric, lateInteraction=$lateInteraction, additionalProperties=$additionalProperties}"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,10 @@ sealed class RankBy() {
@JvmStatic
public fun knn(attr: String, value: List<Float>): RankByKnn = RankByKnn.create(attr, value)

@JvmStatic
public fun knn(attr: String, value: List<List<Float>>): RankByKnnMulti =
RankByKnnMulti.create(attr, value)

@JvmStatic
public fun knn(attr: String, expr: Expr): RankByKnnExpr = RankByKnnExpr.create(attr, expr)

Expand Down Expand Up @@ -1264,6 +1268,25 @@ class RankByKnnExpr private constructor(attr: String, expr: Expr) : RankBy() {
}
}

@JsonAutoDetect(fieldVisibility = Visibility.ANY)
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder("attr", "f0", "value")
class RankByKnnMulti private constructor(attr: String, value: List<List<Float>>) : RankBy() {
private val attr: String = attr
private val f0: String = "kNN"
private val value: List<List<Float>> = value

override fun toString(): String {
return jsonMapper.writeValueAsString(this)
}

companion object {
@JvmSynthetic
internal fun create(attr: String, value: List<List<Float>>): RankByKnnMulti =
RankByKnnMulti(attr, value)
}
}

@JsonAutoDetect(fieldVisibility = Visibility.ANY)
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder("attr", "f0", "value")
Expand Down
Loading
Loading