Skip to content

Commit f7840db

Browse files
upgrade chroma vector database api version
Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
1 parent fbec267 commit f7840db

File tree

12 files changed

+463
-713
lines changed

12 files changed

+463
-713
lines changed

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,22 +16,43 @@
1616

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

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

2323
/**
2424
* Configuration properties for Chroma Vector Store.
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;

0 commit comments

Comments
 (0)