Skip to content

Update to Chroma v2 API#82

Open
richlander wants to merge 5 commits intossone95:masterfrom
richlander:feature/api-v2-migration
Open

Update to Chroma v2 API#82
richlander wants to merge 5 commits intossone95:masterfrom
richlander:feature/api-v2-migration

Conversation

@richlander
Copy link

I wanted to use this library to try out ChromaDB. The server has moved on. I asked Copilot to upgrade the API to v2. It then tested it. I have my own chunking and embedding tool. I added this library as a provider to it. It works as expected. The changes seem quite targeted.

Copilot created a report before, during, and after. I retained those for completeness. We can delete them if desired.

I hope this drive-by PR is OK. Thanks for considering it!

BREAKING CHANGE: Update to ChromaDB API v2 endpoint structure

- Updated default URI from /api/v1/ to /api/v2/
- Modified all endpoints to use hierarchical path structure (tenant/database in path)
- Enhanced ChromaCollectionClient to track tenant and database context
- Updated ChromaClient endpoint paths for v2 API compatibility
- Bumped version to 2.0.0
- Updated all tests, samples, and documentation
- Added comprehensive migration guide for users
- Added technical assessment document

Changes:
- ClientConstants: Default URI now points to /api/v2/
- ChromaClient: All collection endpoints use new path structure
- ChromaCollectionClient: Stores tenant/database and includes in all requests
- README: Updated example to use v2 endpoint
- Sample: Updated to use v2 endpoint
- Tests: Updated base configuration to use v2 endpoint
- Package: Version bumped to 2.0.0 with release notes

Endpoints changed from query parameters to path parameters:
- Old: /api/v1/collections?tenant={t}&database={d}
- New: /api/v2/tenants/{t}/databases/{d}/collections

All request/response models remain unchanged.
…bility

- Made 'data' property optional in CollectionEntriesQueryResponse and CollectionEntriesGetResponse (v2 API doesn't include this field)
- Changed distances type from List<ReadOnlyMemory<float>> to List<List<float>> to match v2 API response structure
- Updated CollectionQueryEntryMapper to handle new distances format
- Fixed Heartbeat() to use 'heartbeat' endpoint instead of empty string
- Updated test project to target net9.0 for compatibility

All 13 integration tests now pass successfully against ChromaDB v2 API.
- Created v2-migration/ directory for all migration-related documentation
- Moved 4 migration documents into v2-migration/:
  * MIGRATION_GUIDE_V2.md - User migration guide
  * V2_API_RESPONSE_CHANGES.md - API response format changes
  * V2_MIGRATION_ASSESSMENT.md - Technical assessment
  * V2_MIGRATION_COMPLETE.md - Implementation summary
- Added v2-migration/README.md explaining the directory contents
- Makes it easy for maintainer to review and delete if not needed
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.

1 participant

Comments