Skip to content

Conversation

@sobychacko
Copy link
Contributor

…zation control

Fixes: #1240

Issue: #1240

The change addresses initialization issues when ChromaVectorStore is used outside Spring context, particularly in scenarios where collections are created manually before store instantiation. Previously, collection ID wasn't properly populated when afterPropertiesSet() wasn't called by Spring container.

  • Add builder pattern to ChromaVectorStore for better initialization control
  • Add initialization flag to prevent multiple collection creation calls
  • Add integration tests for builder pattern usage scenarios
  • Add spring-ai-transformers dependency for testing
  • Remove unused constants (SIMILARITY_THRESHOLD_ALL, DEFAULT_TOP_K)

Collection ID is now properly set regardless of whether the store is managed by Spring or created manually, solving the 404 Not Found errors during document insertion.

…better initialization control

Fixes: spring-projects#1240

Issue: spring-projects#1240

The change addresses initialization issues when ChromaVectorStore is used outside
Spring context, particularly in scenarios where collections are created manually
before store instantiation. Previously, collection ID wasn't properly populated
when afterPropertiesSet() wasn't called by Spring container.

- Add builder pattern to ChromaVectorStore for better initialization control
- Add initialization flag to prevent multiple collection creation calls
- Add integration tests for builder pattern usage scenarios
- Add spring-ai-transformers dependency for testing
- Remove unused constants (SIMILARITY_THRESHOLD_ALL, DEFAULT_TOP_K)

Collection ID is now properly set regardless of whether the store is managed by
Spring or created manually, solving the 404 Not Found errors during document
insertion.
@markpollack markpollack self-assigned this Nov 12, 2024
this.objectMapper = JsonMapper.builder().addModules(JacksonUtils.instantiateAvailableModules()).build();
}

private ChromaVectorStore(Builder builder) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is yet another variation of the builder pattern in our docs, any reason not to have this code inside the builder's build method?

@markpollack
Copy link
Member

merged in c8a9b16

@markpollack markpollack added this to the 1.0.0-M4 milestone Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Newly created ChromaDB collection is missing collectionId and failing on insert

2 participants