Skip to content

ChromaApi have a bug: when metadata param equal hnsw:M and value equal 1024 ,chroma's rest api is success ,but spring-ai-chroma-store is error #1548

@CodingNowPls

Description

@CodingNowPls

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")));
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions