there is code:
//hnsw:M, 1024
Map<String, ? extends Serializable> metadata = Map.of("hnsw:space", "cosine","hnsw:M","1024");
ChromaApi.CreateCollectionRequest createCollectionRequest = new https://github.com/spring-projects/spring-aiChromaApi.CreateCollectionRequest(collectionName, (Map<String, String>) metadata);
chromaApi.createCollection(createCollectionRequest);
i resolve this problem, in ChromaApi.java this class :
public record Collection(String id, String name, Map<String, Object> metadata) {
}
public record CreateCollectionRequest(String name, Map<String, Object> metadata) {
public CreateCollectionRequest(String name) {
this(name, new HashMap<>(Map.of("hnsw:space", "cosine")));
}
}
Comment From: CodingNowPls
this is my pull request : https://github.com/spring-projects/spring-ai/pull/1549