Skip to content

Commit 2d3c26c

Browse files
upgrade chroma vector database api version
Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
1 parent 6c52c99 commit 2d3c26c

File tree

17 files changed

+424
-716
lines changed

17 files changed

+424
-716
lines changed

auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-chroma/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
<dependency>
9595
<groupId>org.testcontainers</groupId>
9696
<artifactId>chromadb</artifactId>
97+
<version>1.21.0</version>
9798
<scope>test</scope>
9899
</dependency>
99100
<dependency>

auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-chroma/src/main/java/org/springframework/ai/vectorstore/chroma/autoconfigure/ChromaVectorStoreAutoConfiguration.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -65,8 +65,11 @@ public ChromaApi chromaApi(ChromaApiProperties apiProperties,
6565

6666
String chromaUrl = String.format("%s:%s", connectionDetails.getHost(), connectionDetails.getPort());
6767

68-
var chromaApi = new ChromaApi(chromaUrl, restClientBuilderProvider.getIfAvailable(RestClient::builder),
69-
objectMapper);
68+
var chromaApi = ChromaApi.builder()
69+
.baseUrl(chromaUrl)
70+
.restClientBuilder(restClientBuilderProvider.getIfAvailable(RestClient::builder))
71+
.objectMapper(objectMapper)
72+
.build();
7073

7174
if (StringUtils.hasText(connectionDetails.getKeyToken())) {
7275
chromaApi.withKeyToken(connectionDetails.getKeyToken());

auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-chroma/src/main/java/org/springframework/ai/vectorstore/chroma/autoconfigure/ChromaVectorStoreProperties.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.ai.vectorstore.chroma.autoconfigure;
1818

19-
import org.springframework.ai.chroma.vectorstore.ChromaVectorStore;
19+
import org.springframework.ai.chroma.vectorstore.common.ChromaApiConstants;
2020
import org.springframework.ai.vectorstore.properties.CommonVectorStoreProperties;
2121
import org.springframework.boot.context.properties.ConfigurationProperties;
2222

@@ -25,13 +25,34 @@
2525
*
2626
* @author Christian Tzolov
2727
* @author Soby Chacko
28+
* @author Jonghoon Park
2829
*/
2930
@ConfigurationProperties(ChromaVectorStoreProperties.CONFIG_PREFIX)
3031
public class ChromaVectorStoreProperties extends CommonVectorStoreProperties {
3132

3233
public static final String CONFIG_PREFIX = "spring.ai.vectorstore.chroma";
3334

34-
private String collectionName = ChromaVectorStore.DEFAULT_COLLECTION_NAME;
35+
private String tenantName = ChromaApiConstants.DEFAULT_TENANT_NAME;
36+
37+
private String databaseName = ChromaApiConstants.DEFAULT_DATABASE_NAME;
38+
39+
private String collectionName = ChromaApiConstants.DEFAULT_COLLECTION_NAME;
40+
41+
public String getTenantName() {
42+
return tenantName;
43+
}
44+
45+
public void setTenantName(String tenantName) {
46+
this.tenantName = tenantName;
47+
}
48+
49+
public String getDatabaseName() {
50+
return databaseName;
51+
}
52+
53+
public void setDatabaseName(String databaseName) {
54+
this.databaseName = databaseName;
55+
}
3556

3657
public String getCollectionName() {
3758
return this.collectionName;

auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-chroma/src/test/java/org/springframework/ai/vectorstore/chroma/autoconfigure/ChromaVectorStoreAutoConfigurationIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
public class ChromaVectorStoreAutoConfigurationIT {
5959

6060
@Container
61-
static ChromaDBContainer chroma = new ChromaDBContainer("ghcr.io/chroma-core/chroma:0.5.20");
61+
static ChromaDBContainer chroma = new ChromaDBContainer("ghcr.io/chroma-core/chroma:1.0.0");
6262

6363
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
6464
.withConfiguration(AutoConfigurations
@@ -69,7 +69,7 @@ public class ChromaVectorStoreAutoConfigurationIT {
6969
"spring.ai.vectorstore.chroma.collectionName=TestCollection");
7070

7171
@Test
72-
@Disabled("This throws an Invalid HTTP request exception - will investigate")
72+
// @Disabled("This throws an Invalid HTTP request exception - will investigate")
7373
public void addAndSearchWithFilters() {
7474

7575
this.contextRunner.withPropertyValues("spring.ai.vectorstore.chroma.initializeSchema=true").run(context -> {

spring-ai-spring-boot-testcontainers/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@
295295
<dependency>
296296
<groupId>org.testcontainers</groupId>
297297
<artifactId>chromadb</artifactId>
298+
<version>1.21.0</version>
298299
<optional>true</optional>
299300
</dependency>
300301

spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/chroma/ChromaImage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
public final class ChromaImage {
2525

26-
public static final DockerImageName DEFAULT_IMAGE = DockerImageName.parse("ghcr.io/chroma-core/chroma:0.5.20");
26+
public static final DockerImageName DEFAULT_IMAGE = DockerImageName.parse("ghcr.io/chroma-core/chroma:1.0.0");
2727

2828
private ChromaImage() {
2929

vector-stores/spring-ai-chroma-store/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
<dependency>
6767
<groupId>org.testcontainers</groupId>
6868
<artifactId>chromadb</artifactId>
69+
<version>1.21.0</version>
6970
<scope>test</scope>
7071
</dependency>
7172

0 commit comments

Comments
 (0)