Skip to content

Conversation

@tanujnay112
Copy link
Contributor

@tanujnay112 tanujnay112 commented Dec 5, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • As titled, changed this EF parameter to be less confusing. store_tokens doesn't make sense as a parameter for an EF whose job is to get things.
  • New functionality
    • ...

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Migration plan

Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?

Observability plan

What is the plan to instrument and monitor this change?

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor Author

tanujnay112 commented Dec 5, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@tanujnay112 tanujnay112 marked this pull request as ready for review December 5, 2025 04:06
@tanujnay112 tanujnay112 requested a review from rescrv as a code owner December 5, 2025 04:06
@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented Dec 5, 2025

Rename sparse EF token flag from store_tokens to include_tokens

Renames the token-label retention flag across BM25 and Chroma Cloud Splade sparse embedding functions from store_tokens to include_tokens, covering Python, Rust, and JSON schema definitions. The implementation updates constructor arguments, configuration serialization/deserialization, internal label handling, and validation logic, including additional safeguards when labels may be absent.

Key Changes

• Replace store_tokens with include_tokens in ChromaBm25EmbeddingFunction constructor, config handling, and sparse vector encoding logic, ensuring labels are only appended when requested and present.
• Update ChromaCloudSpladeEmbeddingFunction to use include_tokens, propagate the flag through API payloads and response normalization, and adjust immutable-config validation accordingly.
• Rename the corresponding store_tokens schema properties to include_tokens for BM25 and Chroma Cloud Splade embedding function JSON schemas.
• Adjust Rust BM25SparseEmbeddingFunction struct and default configuration to expose include_tokens instead of store_tokens.

Affected Areas

chromadb/utils/embedding_functions/chroma_bm25_embedding_function.py
chromadb/utils/embedding_functions/chroma_cloud_splade_embedding_function.py
rust/chroma/src/embed/bm25.rs
schemas/embedding_functions/chroma_bm25.json
schemas/embedding_functions/chroma-cloud-splade.json

This summary was automatically generated by @propel-code-bot

@blacksmith-sh

This comment has been minimized.

Copy link
Contributor

kylediaz commented Dec 5, 2025

What about include_tokens?

@tanujnay112 tanujnay112 changed the title [CHORE]: Change store_tokens to get_tokens [CHORE]: Change store_tokens to include_tokens Dec 5, 2025
@tanujnay112 tanujnay112 changed the base branch from detach_change to graphite-base/5959 December 5, 2025 22:34
@tanujnay112 tanujnay112 changed the base branch from graphite-base/5959 to detach_change December 8, 2025 19:56
@tanujnay112 tanujnay112 changed the base branch from detach_change to graphite-base/5959 December 8, 2025 21:47
@graphite-app graphite-app bot changed the base branch from graphite-base/5959 to main December 8, 2025 21:48
@tanujnay112 tanujnay112 merged commit 69961d8 into main Dec 9, 2025
240 of 246 checks passed
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.

3 participants