Skip to content

Commit 0abfedf

Browse files
philipithomasilayaperumalg
authored andcommitted
[BUG] fix chroma api auth
refactor: Use constant for x-chroma-token header in ChromaApi Signed-off-by: Philip I. Thomas <[email protected]>
1 parent 7529a21 commit 0abfedf

File tree

1 file changed

+3
-1
lines changed
  • vector-stores/spring-ai-chroma-store/src/main/java/org/springframework/ai/chroma/vectorstore

1 file changed

+3
-1
lines changed

vector-stores/spring-ai-chroma-store/src/main/java/org/springframework/ai/chroma/vectorstore/ChromaApi.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public static Builder builder() {
6262
// Regular expression pattern that looks for a message.
6363
private static final Pattern MESSAGE_ERROR_PATTERN = Pattern.compile("\"message\":\"(.*?)\"");
6464

65+
private static final String X_CHROMA_TOKEN_NAME = "x-chroma-token";
66+
6567
private final ObjectMapper objectMapper;
6668

6769
private RestClient restClient;
@@ -320,7 +322,7 @@ public Map<String, Object> where(String text) {
320322

321323
private void httpHeaders(HttpHeaders headers) {
322324
if (StringUtils.hasText(this.keyToken)) {
323-
headers.setBearerAuth(this.keyToken);
325+
headers.set(X_CHROMA_TOKEN_NAME, this.keyToken);
324326
}
325327
}
326328

0 commit comments

Comments
 (0)