Download python/user_packages/Python313/site-packages/chromadb/api/functions.py from codekingpro/portable-devtools: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/datasets/codekingpro/portable-devtools/resolve/df58e70f9edde36aaca2d2aacc2440dd6c2f807d/python/user_packages/Python313/site-packages/chromadb/api/functions.py
- Command line
-
hf download hf://datasets/codekingpro/portable-devtools@df58e70f9edde36aaca2d2aacc2440dd6c2f807d/python/user_packages/Python313/site-packages/chromadb/api/functions.py
-
curl -L -o functions.py https://huggingface.co/datasets/codekingpro/portable-devtools/resolve/df58e70f9edde36aaca2d2aacc2440dd6c2f807d/python/user_packages/Python313/site-packages/chromadb/api/functions.py
1.02 kB
| """Attachable function definitions for ChromaDB collections. | |
| This module provides function constants that can be attached to collections | |
| to perform automatic computations on collection data. | |
| Example: | |
| >>> from chromadb.api.functions import STATISTICS_FUNCTION | |
| >>> attached_fn = collection.attach_function( | |
| ... function=STATISTICS_FUNCTION, | |
| ... name="my_stats", | |
| ... output_collection="my_stats_output" | |
| ... ) | |
| """ | |
| from enum import Enum | |
| class Function(str, Enum): | |
| """Available functions that can be attached to collections.""" | |
| STATISTICS = "statistics" | |
| """Computes metadata value frequencies for a collection.""" | |
| RECORD_COUNTER = "record_counter" | |
| """Counts records in a collection.""" | |
| # Used only for failure testing - not a real function | |
| _NONEXISTENT_TEST_ONLY = "nonexistent_function" | |
| # Convenience aliases for cleaner imports | |
| STATISTICS_FUNCTION = Function.STATISTICS | |
| RECORD_COUNTER_FUNCTION = Function.RECORD_COUNTER | |