chromadb-client 0.4.9.dev0__tar.gz → 0.4.11.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. chromadb-client-0.4.11.dev0/.github/workflows/chroma-js-release.yml +42 -0
  2. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.github/workflows/chroma-release-python-client.yml +14 -1
  3. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.github/workflows/chroma-release.yml +47 -27
  4. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.gitignore +4 -0
  5. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/PKG-INFO +7 -1
  6. chromadb-client-0.4.11.dev0/bin/integration-test +46 -0
  7. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/__init__.py +1 -1
  8. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/api/fastapi.py +55 -8
  9. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/api/types.py +29 -5
  10. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/auth/token/__init__.py +4 -1
  11. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/config.py +1 -0
  12. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/segment/__init__.py +5 -0
  13. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/segment/impl/manager/local.py +3 -0
  14. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/segment/impl/metadata/sqlite.py +54 -10
  15. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/segment/impl/vector/local_hnsw.py +4 -0
  16. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/segment/impl/vector/local_persistent_hnsw.py +12 -2
  17. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/auth/test_token_auth.py +6 -2
  18. chromadb-client-0.4.11.dev0/chromadb/test/ef/test_default_ef.py +62 -0
  19. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/property/strategies.py +30 -1
  20. chromadb-client-0.4.11.dev0/chromadb/test/property/test_client_url.py +134 -0
  21. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/property/test_filtering.py +10 -3
  22. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/segment/test_vector.py +150 -0
  23. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/types.py +5 -1
  24. chromadb-client-0.4.11.dev0/chromadb/utils/distance_functions.py +22 -0
  25. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/utils/embedding_functions.py +34 -2
  26. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb_client.egg-info/PKG-INFO +7 -1
  27. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb_client.egg-info/SOURCES.txt +14 -1
  28. chromadb-client-0.4.11.dev0/clients/js/DEVELOP.md +67 -0
  29. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/package.json +38 -7
  30. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/ChromaClient.ts +18 -4
  31. chromadb-client-0.4.11.dev0/clients/js/src/auth.ts +228 -0
  32. chromadb-client-0.4.11.dev0/clients/js/src/embeddings/OpenAIEmbeddingFunction.ts +125 -0
  33. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/embeddings/TransformersEmbeddingFunction.ts +4 -5
  34. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/embeddings/WebAIEmbeddingFunction.ts +11 -8
  35. chromadb-client-0.4.11.dev0/clients/js/src/utils.ts +84 -0
  36. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/add.collections.test.ts +23 -1
  37. chromadb-client-0.4.11.dev0/clients/js/test/auth.basic.test.ts +33 -0
  38. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/client.test.ts +1 -1
  39. chromadb-client-0.4.11.dev0/clients/js/test/initClientWithAuth.ts +7 -0
  40. chromadb-client-0.4.11.dev0/clients/js/yarn.lock +4444 -0
  41. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/docker-compose.server.example.yml +5 -3
  42. chromadb-client-0.4.11.dev0/docker-compose.test-auth.yml +32 -0
  43. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/docker-compose.yml +3 -3
  44. chromadb-client-0.4.11.dev0/docs/CIP_4_In_Nin_Metadata_Filters.md +61 -0
  45. chromadb-client-0.4.11.dev0/docs/cip/CIP-1_Allow_Filtering_for_Collections.md +54 -0
  46. chromadb-client-0.4.11.dev0/examples/basic_functionality/in_not_in_filtering.ipynb +149 -0
  47. chromadb-client-0.4.11.dev0/examples/deployments/aws-terraform/README.md +155 -0
  48. chromadb-client-0.4.11.dev0/examples/deployments/aws-terraform/chroma.tf +161 -0
  49. chromadb-client-0.4.11.dev0/examples/deployments/aws-terraform/startup.sh +53 -0
  50. chromadb-client-0.4.11.dev0/examples/deployments/aws-terraform/variables.tf +94 -0
  51. chromadb-client-0.4.11.dev0/examples/deployments/google-cloud-compute/README.md +137 -0
  52. chromadb-client-0.4.11.dev0/examples/deployments/google-cloud-compute/chroma.tf +129 -0
  53. chromadb-client-0.4.11.dev0/examples/deployments/google-cloud-compute/main.tf +0 -0
  54. chromadb-client-0.4.11.dev0/examples/deployments/google-cloud-compute/startup.sh +53 -0
  55. chromadb-client-0.4.11.dev0/examples/deployments/google-cloud-compute/variables.tf +142 -0
  56. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/requirements.txt +3 -2
  57. chromadb-client-0.4.9.dev0/bin/build +0 -3
  58. chromadb-client-0.4.9.dev0/bin/integration-test +0 -26
  59. chromadb-client-0.4.9.dev0/chromadb/utils/distance_functions.py +0 -18
  60. chromadb-client-0.4.9.dev0/clients/js/DEVELOP.md +0 -29
  61. chromadb-client-0.4.9.dev0/clients/js/src/embeddings/OpenAIEmbeddingFunction.ts +0 -48
  62. chromadb-client-0.4.9.dev0/clients/js/src/utils.ts +0 -66
  63. chromadb-client-0.4.9.dev0/clients/js/yarn.lock +0 -3925
  64. chromadb-client-0.4.9.dev0/examples/deployments/google-cloud-compute/README.md +0 -45
  65. chromadb-client-0.4.9.dev0/examples/deployments/google-cloud-compute/chroma.tf +0 -50
  66. chromadb-client-0.4.9.dev0/examples/deployments/google-cloud-compute/main.tf +0 -8
  67. chromadb-client-0.4.9.dev0/examples/deployments/google-cloud-compute/startup.sh +0 -22
  68. chromadb-client-0.4.9.dev0/examples/deployments/google-cloud-compute/variables.tf +0 -18
  69. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.dockerignore +0 -0
  70. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
  71. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
  72. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.github/ISSUE_TEMPLATE/installation_trouble.yaml +0 -0
  73. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.github/workflows/chroma-client-integration-test.yml +0 -0
  74. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.github/workflows/chroma-integration-test.yml +0 -0
  75. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.github/workflows/chroma-test.yml +0 -0
  76. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.github/workflows/pr-review-checklist.yml +0 -0
  77. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.pre-commit-config.yaml +0 -0
  78. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/.vscode/settings.json +0 -0
  79. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/DEVELOP.md +0 -0
  80. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/Dockerfile +0 -0
  81. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/LICENSE +0 -0
  82. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/README.md +0 -0
  83. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/RELEASE_PROCESS.md +0 -0
  84. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/bin/docker_entrypoint.sh +0 -0
  85. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/bin/generate_cloudformation.py +0 -0
  86. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/bin/templates/docker-compose.yml +0 -0
  87. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/bin/test-package.sh +0 -0
  88. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/bin/test-remote +0 -0
  89. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/bin/test.py +0 -0
  90. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/bin/version +0 -0
  91. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/bin/windows_upgrade_sqlite.py +0 -0
  92. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/api/__init__.py +0 -0
  93. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/api/models/Collection.py +0 -0
  94. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/api/segment.py +0 -0
  95. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/app.py +0 -0
  96. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/auth/__init__.py +0 -0
  97. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/auth/basic/__init__.py +0 -0
  98. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/auth/fastapi.py +0 -0
  99. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/auth/providers.py +0 -0
  100. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/auth/registry.py +0 -0
  101. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/db/__init__.py +0 -0
  102. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/db/base.py +0 -0
  103. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/db/impl/__init__.py +0 -0
  104. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/db/impl/sqlite.py +0 -0
  105. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/db/impl/sqlite_pool.py +0 -0
  106. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/db/migrations.py +0 -0
  107. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/db/mixins/embeddings_queue.py +0 -0
  108. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/db/mixins/sysdb.py +0 -0
  109. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/db/system.py +0 -0
  110. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/errors.py +0 -0
  111. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/experimental/density_relevance.ipynb +0 -0
  112. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/ingest/__init__.py +0 -0
  113. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/is_thin_client.py +0 -0
  114. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/migrations/__init__.py +0 -0
  115. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/migrations/embeddings_queue/00001-embeddings.sqlite.sql +0 -0
  116. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/migrations/metadb/00001-embedding-metadata.sqlite.sql +0 -0
  117. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/migrations/metadb/00002-embedding-metadata.sqlite.sql +0 -0
  118. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/migrations/metadb/00003-full-text-tokenize.sqlite.sql +0 -0
  119. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/migrations/sysdb/00001-collections.sqlite.sql +0 -0
  120. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/migrations/sysdb/00002-segments.sqlite.sql +0 -0
  121. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/migrations/sysdb/00003-collection-dimension.sqlite.sql +0 -0
  122. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/py.typed +0 -0
  123. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/segment/impl/vector/batch.py +0 -0
  124. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/segment/impl/vector/brute_force_index.py +0 -0
  125. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/segment/impl/vector/hnsw_params.py +0 -0
  126. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/server/__init__.py +0 -0
  127. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/server/fastapi/__init__.py +0 -0
  128. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/server/fastapi/types.py +0 -0
  129. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/telemetry/__init__.py +0 -0
  130. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/telemetry/events.py +0 -0
  131. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/telemetry/posthog.py +0 -0
  132. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/auth/test_basic_auth.py +0 -0
  133. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/conftest.py +0 -0
  134. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/db/migrations/00001-migration-1.psql.sql +0 -0
  135. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/db/migrations/00001-migration-1.sqlite.sql +0 -0
  136. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/db/migrations/00002-migration-2.psql.sql +0 -0
  137. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/db/migrations/00002-migration-2.sqlite.sql +0 -0
  138. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/db/migrations/00003-migration-3.psql.sql +0 -0
  139. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/db/migrations/00003-migration-3.sqlite.sql +0 -0
  140. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/db/migrations/__init__.py +0 -0
  141. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/db/test_base.py +0 -0
  142. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/db/test_migrations.py +0 -0
  143. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/db/test_system.py +0 -0
  144. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/ingest/test_producer_consumer.py +0 -0
  145. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/property/invariants.py +0 -0
  146. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/property/test_add.py +0 -0
  147. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/property/test_collections.py +0 -0
  148. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/property/test_cross_version_persist.py +0 -0
  149. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/property/test_embeddings.py +0 -0
  150. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/property/test_persist.py +0 -0
  151. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/segment/test_metadata.py +0 -0
  152. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/stress/test_many_collections.py +0 -0
  153. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/test_api.py +0 -0
  154. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/test_chroma.py +0 -0
  155. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/test_client.py +0 -0
  156. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/test_config.py +0 -0
  157. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/test_multithreaded.py +0 -0
  158. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/test/utils/test_messagid.py +0 -0
  159. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/utils/__init__.py +0 -0
  160. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/utils/delete_file.py +0 -0
  161. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/utils/lru_cache.py +0 -0
  162. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/utils/messageid.py +0 -0
  163. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb/utils/read_write_lock.py +0 -0
  164. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb_client.egg-info/dependency_links.txt +0 -0
  165. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb_client.egg-info/requires.txt +0 -0
  166. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/chromadb_client.egg-info/top_level.txt +0 -0
  167. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/.gitignore +0 -0
  168. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/.prettierignore +0 -0
  169. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/.prettierrc.json +0 -0
  170. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/LICENSE +0 -0
  171. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/README.md +0 -0
  172. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/config.yml +0 -0
  173. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/examples/browser/README.md +0 -0
  174. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/examples/browser/app.ts +0 -0
  175. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/examples/browser/index.html +0 -0
  176. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/examples/browser/package.json +0 -0
  177. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/examples/browser/yarn.lock +0 -0
  178. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/examples/node/README.md +0 -0
  179. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/examples/node/app.js +0 -0
  180. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/examples/node/package.json +0 -0
  181. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/examples/node/yarn.lock +0 -0
  182. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/genapi.sh +0 -0
  183. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/jest.config.ts +0 -0
  184. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/openapitools.json +0 -0
  185. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/package-lock.json +0 -0
  186. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/Collection.ts +0 -0
  187. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/embeddings/CohereEmbeddingFunction.ts +0 -0
  188. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/embeddings/IEmbeddingFunction.ts +0 -0
  189. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/generated/README.md +0 -0
  190. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/generated/api.ts +0 -0
  191. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/generated/configuration.ts +0 -0
  192. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/generated/index.ts +0 -0
  193. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/generated/models.ts +0 -0
  194. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/generated/runtime.ts +0 -0
  195. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/index.ts +0 -0
  196. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/src/types.ts +0 -0
  197. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/collection.client.test.ts +0 -0
  198. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/collection.test.ts +0 -0
  199. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/data.ts +0 -0
  200. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/delete.collection.test.ts +0 -0
  201. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/get.collection.test.ts +0 -0
  202. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/initClient.ts +0 -0
  203. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/peek.collection.test.ts +0 -0
  204. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/query.collection.test.ts +0 -0
  205. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/update.collection.test.ts +0 -0
  206. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/test/upsert.collections.test.ts +0 -0
  207. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/tsconfig.json +0 -0
  208. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/js/tsconfig.module.json +0 -0
  209. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/python/README.md +0 -0
  210. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/python/build_python_thin_client.sh +0 -0
  211. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/python/integration-test.sh +0 -0
  212. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/python/is_thin_client.py +0 -0
  213. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/clients/python/pyproject.toml +0 -0
  214. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/docker-compose.test.yml +0 -0
  215. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/docs/CIP_2_Auth_Providers_Proposal.md +0 -0
  216. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/docs/CIP_Chroma_Improvment_Proposals.md +0 -0
  217. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/docs/assets/cip-2-arch.png +0 -0
  218. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/docs/assets/cip-2-client-side-wf.png +0 -0
  219. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/docs/assets/cip-2-seq.png +0 -0
  220. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/docs/assets/cip-2-server-side-wf.png +0 -0
  221. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/README.md +0 -0
  222. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/basic_functionality/alternative_embeddings.ipynb +0 -0
  223. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/basic_functionality/assets/auh-sequence.png +0 -0
  224. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/basic_functionality/assets/auth-architecture.png +0 -0
  225. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/basic_functionality/client_auth.ipynb +0 -0
  226. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/basic_functionality/local_persistence.ipynb +0 -0
  227. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/basic_functionality/start_here.ipynb +0 -0
  228. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/basic_functionality/where_filtering.ipynb +0 -0
  229. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/chat_with_your_documents/README.md +0 -0
  230. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/chat_with_your_documents/documents/state_of_the_union_2022.txt +0 -0
  231. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/chat_with_your_documents/documents/state_of_the_union_2023.txt +0 -0
  232. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/chat_with_your_documents/load_data.py +0 -0
  233. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/chat_with_your_documents/main.py +0 -0
  234. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/chat_with_your_documents/requirements.txt +0 -0
  235. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/use_with/cohere/cohere_js.js +0 -0
  236. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/use_with/cohere/cohere_python.ipynb +0 -0
  237. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/examples/use_with/cohere/package.json +0 -0
  238. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/log_config.yml +0 -0
  239. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/pull_request_template.md +0 -0
  240. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/pyproject.toml +0 -0
  241. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/requirements_dev.txt +0 -0
  242. {chromadb-client-0.4.9.dev0 → chromadb-client-0.4.11.dev0}/setup.cfg +0 -0
@@ -0,0 +1,42 @@
1
+ name: Chroma Release JS Client
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'js_release_*.*.*' # Match tags in the form js_release_X.Y.Z
7
+ - 'js_release_alpha_*.*.*' # Match tags in the form js_release_alpha_X.Y.Z
8
+
9
+ jobs:
10
+ build-and-release:
11
+ runs-on: ubuntu-latest
12
+ permissions: write-all
13
+ steps:
14
+ - name: Check if tag matches the pattern
15
+ run: |
16
+ if [[ "${{ github.ref }}" =~ ^refs/tags/js_release_alpha_[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
17
+ echo "Tag matches the pattern js_release_alpha_X.Y.Z"
18
+ echo "NPM_SCRIPT=release_alpha" >> "$GITHUB_ENV"
19
+ elif [[ "${{ github.ref }}" =~ ^refs/tags/js_release_[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
20
+ echo "Tag matches the pattern js_release_X.Y.Z"
21
+ echo "NPM_SCRIPT=release" >> "$GITHUB_ENV"
22
+ else
23
+ echo "Tag does not match the release tag pattern, exiting workflow"
24
+ exit 1
25
+ fi
26
+ - name: Checkout
27
+ uses: actions/checkout@v3
28
+ with:
29
+ fetch-depth: 0
30
+ - name: Set up JS
31
+ uses: actions/setup-node@v3
32
+ with:
33
+ node-version: '16.x'
34
+ registry-url: 'https://registry.npmjs.org'
35
+ - name: Install Client Dev Dependencies
36
+ run: npm install
37
+ working-directory: ./clients/js/
38
+ - name: npm Test & Publish
39
+ run: npm run db:run && PORT=8001 npm run $NPM_SCRIPT
40
+ working-directory: ./clients/js/
41
+ env:
42
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -3,14 +3,27 @@ name: Chroma Release Python Client
3
3
  on:
4
4
  push:
5
5
  tags:
6
- - '*'
6
+ - '[0-9]+.[0-9]+.[0-9]+' # Match tags in the form X.Y.Z
7
7
  branches:
8
8
  - main
9
9
  - hammad/thin_client
10
10
 
11
11
  jobs:
12
+ check_tag:
13
+ runs-on: ubuntu-latest
14
+ outputs:
15
+ tag_matches: ${{ steps.check-tag.outputs.tag_matches }}
16
+ steps:
17
+ - name: Check Tag
18
+ id: check-tag
19
+ run: |
20
+ if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
21
+ echo "tag_matches=true" >> $GITHUB_OUTPUT
22
+ fi
12
23
  build-and-release:
13
24
  runs-on: ubuntu-latest
25
+ needs: check_tag
26
+ if: needs.check_tag.outputs.tag_matches == 'true'
14
27
  permissions: write-all
15
28
  steps:
16
29
  - name: Checkout
@@ -8,24 +8,38 @@ on:
8
8
  - main
9
9
 
10
10
  env:
11
- REGISTRY: ghcr.io
12
- IMAGE_NAME: "ghcr.io/chroma-core/chroma"
11
+ GHCR_IMAGE_NAME: "ghcr.io/chroma-core/chroma"
12
+ DOCKERHUB_IMAGE_NAME: "chromadb/chroma"
13
+ PLATFORMS: linux/amd64,linux/arm64 #linux/riscv64, linux/arm/v7
13
14
 
14
15
  jobs:
16
+ check_tag:
17
+ runs-on: ubuntu-latest
18
+ outputs:
19
+ tag_matches: ${{ steps.check-tag.outputs.tag_matches }}
20
+ steps:
21
+ - name: Check Tag
22
+ id: check-tag
23
+ run: |
24
+ if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
25
+ echo "tag_matches=true" >> $GITHUB_OUTPUT
26
+ fi
15
27
  build-and-release:
16
28
  runs-on: ubuntu-latest
29
+ needs: check_tag
17
30
  permissions: write-all
18
- # id-token: write
19
- # contents: read
20
- # deployments: write
21
- # packages: write
22
- # pull-requests: read
23
- # statuses: write
24
31
  steps:
25
32
  - name: Checkout
26
33
  uses: actions/checkout@v3
27
34
  with:
28
35
  fetch-depth: 0
36
+ # https://github.com/docker/setup-qemu-action - for multiplatform builds
37
+ - name: Set up QEMU
38
+ uses: docker/setup-qemu-action@v2
39
+ # https://github.com/docker/setup-buildx-action - for multiplatform builds
40
+ - name: Set up Docker Buildx
41
+ id: buildx
42
+ uses: docker/setup-buildx-action@v2
29
43
  - name: Set up Python
30
44
  uses: actions/setup-python@v4
31
45
  with:
@@ -36,34 +50,38 @@ jobs:
36
50
  run: python -m build
37
51
  - name: Test Client Package
38
52
  run: bin/test-package.sh dist/*.tar.gz
39
- - name: Log in to the Container registry
53
+ - name: Log in to the Github Container registry
40
54
  uses: docker/login-action@v2.1.0
41
55
  with:
42
- registry: ${{ env.REGISTRY }}
56
+ registry: ghcr.io
43
57
  username: ${{ github.actor }}
44
58
  password: ${{ secrets.GITHUB_TOKEN }}
59
+ - name: Login to DockerHub
60
+ uses: docker/login-action@v2.1.0
61
+ with:
62
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
63
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
45
64
  - name: Install setuptools_scm
46
65
  run: python -m pip install setuptools_scm
47
- - name: Get Docker Tag
48
- id: tag
49
- run: echo "tag_name=$IMAGE_NAME:$(bin/version)" >> $GITHUB_OUTPUT
66
+ - name: Get Release Version
67
+ id: version
68
+ run: echo "version=$(python -m setuptools_scm)" >> $GITHUB_OUTPUT
50
69
  - name: Build and push prerelease Docker image
51
- if: "!startsWith(github.ref, 'refs/tags/')"
70
+ if: "needs.check_tag.outputs.tag_matches != 'true'"
52
71
  uses: docker/build-push-action@v3.2.0
53
72
  with:
54
73
  context: .
74
+ platforms: ${{ env.PLATFORMS }}
55
75
  push: true
56
- tags: ${{ steps.tag.outputs.tag_name}}
76
+ tags: "${{ env.GHCR_IMAGE_NAME }}:${{ steps.version.outputs.version }},${{ env.DOCKERHUB_IMAGE_NAME }}:${{ steps.version.outputs.version }}"
57
77
  - name: Build and push release Docker image
58
- if: "startsWith(github.ref, 'refs/tags/')"
78
+ if: "needs.check_tag.outputs.tag_matches == 'true'"
59
79
  uses: docker/build-push-action@v3.2.0
60
80
  with:
61
81
  context: .
82
+ platforms: ${{ env.PLATFORMS }}
62
83
  push: true
63
- tags: "${{ steps.tag.outputs.tag_name }},${{ env.IMAGE_NAME }}:latest"
64
- - name: Get Release Version
65
- id: version
66
- run: echo "version=$(python -m setuptools_scm)" >> $GITHUB_OUTPUT
84
+ tags: "${{ env.GHCR_IMAGE_NAME }}:${{ steps.version.outputs.version }},${{ env.DOCKERHUB_IMAGE_NAME }}:${{ steps.version.outputs.version }},${{ env.GHCR_IMAGE_NAME }}:latest,${{ env.DOCKERHUB_IMAGE_NAME }}:latest"
67
85
  - name: Get current date
68
86
  id: builddate
69
87
  run: echo "builddate=$(date +'%Y-%m-%dT%H:%M')" >> $GITHUB_OUTPUT
@@ -73,7 +91,7 @@ jobs:
73
91
  password: ${{ secrets.TEST_PYPI_API_TOKEN }}
74
92
  repository_url: https://test.pypi.org/legacy/
75
93
  - name: Publish to PyPI
76
- if: startsWith(github.ref, 'refs/tags')
94
+ if: "needs.check_tag.outputs.tag_matches == 'true'"
77
95
  uses: pypa/gh-action-pypi-publish@release/v1
78
96
  with:
79
97
  password: ${{ secrets.PYPI_API_TOKEN }}
@@ -84,31 +102,32 @@ jobs:
84
102
  aws-region: us-east-1
85
103
  - name: Generate CloudFormation template
86
104
  id: generate-cf
87
- if: "startsWith(github.ref, 'refs/tags/')"
105
+ if: "needs.check_tag.outputs.tag_matches == 'true'"
88
106
  run: "pip install boto3 && python bin/generate_cloudformation.py"
89
107
  - name: Release Tagged Version
90
108
  uses: ncipollo/release-action@v1.11.1
91
- if: "startsWith(github.ref, 'refs/tags/')"
109
+ if: "needs.check_tag.outputs.tag_matches == 'true'"
92
110
  with:
93
111
  body: |
94
112
  Version: `${{steps.version.outputs.version}}`
95
113
  Git ref: `${{github.ref}}`
96
114
  Build Date: `${{steps.builddate.outputs.builddate}}`
97
115
  PIP Package: `chroma-${{steps.version.outputs.version}}.tar.gz`
98
- Docker Image: `${{steps.tag.outputs.tag_name}}`
116
+ Github Container Registry Image: `${{ env.GHCR_IMAGE_NAME }}:${{ steps.version.outputs.version }}`
117
+ DockerHub Image: `${{ env.DOCKERHUB_IMAGE_NAME }}:${{ steps.version.outputs.version }}`
99
118
  artifacts: "dist/chroma-${{steps.version.outputs.version}}.tar.gz"
100
119
  prerelease: true
101
120
  generateReleaseNotes: true
102
121
  - name: Update Tag
103
122
  uses: richardsimko/update-tag@v1.0.5
104
- if: "!startsWith(github.ref, 'refs/tags/')"
123
+ if: "needs.check_tag.outputs.tag_matches != 'true'"
105
124
  with:
106
125
  tag_name: latest
107
126
  env:
108
127
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109
128
  - name: Release Latest
110
129
  uses: ncipollo/release-action@v1.11.1
111
- if: "!startsWith(github.ref, 'refs/tags/')"
130
+ if: "needs.check_tag.outputs.tag_matches != 'true'"
112
131
  with:
113
132
  tag: "latest"
114
133
  name: "Latest"
@@ -117,7 +136,8 @@ jobs:
117
136
  Git ref: `${{github.ref}}`
118
137
  Build Date: `${{steps.builddate.outputs.builddate}}`
119
138
  PIP Package: `chroma-${{steps.version.outputs.version}}.tar.gz`
120
- Docker Image: `${{steps.tag.outputs.tag_name}}`
139
+ Github Container Registry Image: `${{ env.GHCR_IMAGE_NAME }}:${{ steps.version.outputs.version }}`
140
+ DockerHub Image: `${{ env.DOCKERHUB_IMAGE_NAME }}:${{ steps.version.outputs.version }}`
121
141
  artifacts: "dist/chroma-${{steps.version.outputs.version}}.tar.gz"
122
142
  allowUpdates: true
123
143
  prerelease: true
@@ -11,6 +11,10 @@
11
11
 
12
12
  index_data
13
13
 
14
+ # Default configuration for persist_directory in chromadb/config.py
15
+ # Currently it's located in "./chroma/"
16
+ chroma/
17
+
14
18
  venv
15
19
  .env
16
20
  .chroma
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chromadb-client
3
- Version: 0.4.9.dev0
3
+ Version: 0.4.11.dev0
4
4
  Summary: Chroma Client.
5
5
  Author-email: Jeff Huber <jeff@trychroma.com>, Anton Troynikov <anton@trychroma.com>
6
6
  Project-URL: Homepage, https://github.com/chroma-core/chroma
@@ -11,6 +11,12 @@ Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.7
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
+ Requires-Dist: requests>=2.28
15
+ Requires-Dist: pydantic<2.0,>=1.9
16
+ Requires-Dist: numpy>=1.21.6
17
+ Requires-Dist: posthog>=2.4.0
18
+ Requires-Dist: typing_extensions>=4.5.0
19
+ Requires-Dist: overrides>=7.3.1
14
20
 
15
21
  <p align="center">
16
22
  <a href="https://trychroma.com"><img src="https://user-images.githubusercontent.com/891664/227103090-6624bf7d-9524-4e05-9d2c-c28d5d451481.png" alt="Chroma logo"></a>
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ export CHROMA_PORT=8000
6
+
7
+ function cleanup {
8
+ docker compose -f docker-compose.test.yml down --rmi local --volumes
9
+ rm server.htpasswd .chroma_env
10
+ }
11
+
12
+ function setup_basic_auth {
13
+ # Generate htpasswd file
14
+ docker run --rm --entrypoint htpasswd httpd:2 -Bbn admin admin > server.htpasswd
15
+ # Create .chroma_env file
16
+ cat <<EOF > .chroma_env
17
+ CHROMA_SERVER_AUTH_CREDENTIALS_FILE="/chroma/server.htpasswd"
18
+ CHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER='chromadb.auth.providers.HtpasswdFileServerAuthCredentialsProvider'
19
+ CHROMA_SERVER_AUTH_PROVIDER='chromadb.auth.basic.BasicAuthServerProvider'
20
+ EOF
21
+ }
22
+
23
+ trap cleanup EXIT
24
+
25
+ docker compose -f docker-compose.test.yml up --build -d
26
+
27
+ export CHROMA_INTEGRATION_TEST_ONLY=1
28
+ export CHROMA_API_IMPL=chromadb.api.fastapi.FastAPI
29
+ export CHROMA_SERVER_HOST=localhost
30
+ export CHROMA_SERVER_HTTP_PORT=8000
31
+
32
+ echo testing: python -m pytest "$@"
33
+ python -m pytest "$@"
34
+
35
+ cd clients/js
36
+ yarn
37
+ yarn test:run
38
+ docker compose down
39
+ cd ../..
40
+ echo "Testing auth"
41
+ setup_basic_auth #this is specific to the auth type, later on we'll have other auth types
42
+ cd clients/js
43
+ # Start docker compose - this should be auth agnostic
44
+ docker compose --env-file ../../.chroma_env -f ../../docker-compose.test-auth.yml up --build -d
45
+ yarn test:run-auth
46
+ cd ../..
@@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
44
44
 
45
45
  __settings = Settings()
46
46
 
47
- __version__ = "0.4.8"
47
+ __version__ = "0.4.10"
48
48
 
49
49
  # Workaround to deal with Colab's old sqlite3 version
50
50
  try:
@@ -1,4 +1,5 @@
1
1
  import json
2
+ import logging
2
3
  from typing import Optional, cast
3
4
  from typing import Sequence
4
5
  from uuid import UUID
@@ -30,27 +31,73 @@ from chromadb.auth.providers import RequestsClientAuthProtocolAdapter
30
31
  from chromadb.auth.registry import resolve_provider
31
32
  from chromadb.config import Settings, System
32
33
  from chromadb.telemetry import Telemetry
34
+ from urllib.parse import urlparse, urlunparse, quote
35
+
36
+ logger = logging.getLogger(__name__)
33
37
 
34
38
 
35
39
  class FastAPI(API):
36
40
  _settings: Settings
37
41
 
42
+ @staticmethod
43
+ def _validate_host(host: str) -> None:
44
+ parsed = urlparse(host)
45
+ if "/" in host and parsed.scheme not in {"http", "https"}:
46
+ raise ValueError(
47
+ "Invalid URL. " f"Unrecognized protocol - {parsed.scheme}."
48
+ )
49
+ if "/" in host and (not host.startswith("http")):
50
+ raise ValueError(
51
+ "Invalid URL. "
52
+ "Seems that you are trying to pass URL as a host but without specifying the protocol. "
53
+ "Please add http:// or https:// to the host."
54
+ )
55
+
56
+ @staticmethod
57
+ def resolve_url(
58
+ chroma_server_host: str,
59
+ chroma_server_ssl_enabled: Optional[bool] = False,
60
+ default_api_path: Optional[str] = "",
61
+ chroma_server_http_port: Optional[int] = 8000,
62
+ ) -> str:
63
+ _skip_port = False
64
+ _chroma_server_host = chroma_server_host
65
+ FastAPI._validate_host(_chroma_server_host)
66
+ if _chroma_server_host.startswith("http"):
67
+ logger.debug("Skipping port as the user is passing a full URL")
68
+ _skip_port = True
69
+ parsed = urlparse(_chroma_server_host)
70
+
71
+ scheme = "https" if chroma_server_ssl_enabled else parsed.scheme or "http"
72
+ net_loc = parsed.netloc or parsed.hostname or chroma_server_host
73
+ port = (
74
+ ":" + str(parsed.port or chroma_server_http_port) if not _skip_port else ""
75
+ )
76
+ path = parsed.path or default_api_path
77
+
78
+ if not path or path == net_loc:
79
+ path = default_api_path if default_api_path else ""
80
+ if not path.endswith(default_api_path or ""):
81
+ path = path + default_api_path if default_api_path else ""
82
+ full_url = urlunparse(
83
+ (scheme, f"{net_loc}{port}", quote(path.replace("//", "/")), "", "", "")
84
+ )
85
+
86
+ return full_url
87
+
38
88
  def __init__(self, system: System):
39
89
  super().__init__(system)
40
- url_prefix = "https" if system.settings.chroma_server_ssl_enabled else "http"
41
90
  system.settings.require("chroma_server_host")
42
91
  system.settings.require("chroma_server_http_port")
43
92
 
44
93
  self._telemetry_client = self.require(Telemetry)
45
94
  self._settings = system.settings
46
95
 
47
- port_suffix = (
48
- f":{system.settings.chroma_server_http_port}"
49
- if system.settings.chroma_server_http_port
50
- else ""
51
- )
52
- self._api_url = (
53
- f"{url_prefix}://{system.settings.chroma_server_host}{port_suffix}/api/v1"
96
+ self._api_url = FastAPI.resolve_url(
97
+ chroma_server_host=str(system.settings.chroma_server_host),
98
+ chroma_server_http_port=int(str(system.settings.chroma_server_http_port)),
99
+ chroma_server_ssl_enabled=system.settings.chroma_server_ssl_enabled,
100
+ default_api_path=system.settings.chroma_server_api_default_path,
54
101
  )
55
102
 
56
103
  self._header = system.settings.chroma_server_headers
@@ -207,6 +207,8 @@ def validate_where(where: Where) -> Where:
207
207
  if (
208
208
  key != "$and"
209
209
  and key != "$or"
210
+ and key != "$in"
211
+ and key != "$nin"
210
212
  and not isinstance(value, (str, int, float, dict))
211
213
  ):
212
214
  raise ValueError(
@@ -238,15 +240,37 @@ def validate_where(where: Where) -> Where:
238
240
  raise ValueError(
239
241
  f"Expected operand value to be an int or a float for operator {operator}, got {operand}"
240
242
  )
241
-
242
- if operator not in ["$gt", "$gte", "$lt", "$lte", "$ne", "$eq"]:
243
+ if operator in ["$in", "$nin"]:
244
+ if not isinstance(operand, list):
245
+ raise ValueError(
246
+ f"Expected operand value to be an list for operator {operator}, got {operand}"
247
+ )
248
+ if operator not in [
249
+ "$gt",
250
+ "$gte",
251
+ "$lt",
252
+ "$lte",
253
+ "$ne",
254
+ "$eq",
255
+ "$in",
256
+ "$nin",
257
+ ]:
243
258
  raise ValueError(
244
- f"Expected where operator to be one of $gt, $gte, $lt, $lte, $ne, $eq, got {operator}"
259
+ f"Expected where operator to be one of $gt, $gte, $lt, $lte, $ne, $eq, $in, $nin, "
260
+ f"got {operator}"
245
261
  )
246
262
 
247
- if not isinstance(operand, (str, int, float)):
263
+ if not isinstance(operand, (str, int, float, list)):
264
+ raise ValueError(
265
+ f"Expected where operand value to be a str, int, float, or list of those type, got {operand}"
266
+ )
267
+ if isinstance(operand, list) and (
268
+ len(operand) == 0
269
+ or not all(isinstance(x, type(operand[0])) for x in operand)
270
+ ):
248
271
  raise ValueError(
249
- f"Expected where operand value to be a str, int, or float, got {operand}"
272
+ f"Expected where operand value to be a non-empty list, and all values to obe of the same type "
273
+ f"got {operand}"
250
274
  )
251
275
  return where
252
276
 
@@ -68,7 +68,10 @@ class TokenAuthClientAuthResponse(ClientAuthResponse):
68
68
 
69
69
  def check_token(token: str) -> None:
70
70
  token_str = str(token)
71
- if not all(c in string.ascii_letters + string.digits for c in token_str):
71
+ if not all(
72
+ c in string.digits + string.ascii_letters + string.punctuation
73
+ for c in token_str
74
+ ):
72
75
  raise ValueError("Invalid token. Must contain only ASCII letters and digits.")
73
76
 
74
77
 
@@ -88,6 +88,7 @@ class Settings(BaseSettings): # type: ignore
88
88
  chroma_server_headers: Optional[Dict[str, str]] = None
89
89
  chroma_server_http_port: Optional[str] = None
90
90
  chroma_server_ssl_enabled: Optional[bool] = False
91
+ chroma_server_api_default_path: Optional[str] = "/api/v1"
91
92
  chroma_server_grpc_port: Optional[str] = None
92
93
  chroma_server_cors_allow_origins: List[str] = [] # eg ["http://localhost:3000"]
93
94
 
@@ -39,6 +39,11 @@ class SegmentImplementation(Component):
39
39
  segment. Validation errors will be reported to the user."""
40
40
  return None
41
41
 
42
+ @abstractmethod
43
+ def delete(self) -> None:
44
+ """Delete the segment and all its data"""
45
+ ...
46
+
42
47
 
43
48
  S = TypeVar("S", bound=SegmentImplementation)
44
49
 
@@ -112,6 +112,9 @@ class LocalSegmentManager(SegmentManager):
112
112
  segments = self._sysdb.get_segments(collection=collection_id)
113
113
  for segment in segments:
114
114
  if segment["id"] in self._instances:
115
+ if segment["type"] == SegmentType.HNSW_LOCAL_PERSISTED.value:
116
+ instance = self.get_segment(collection_id, VectorReader)
117
+ instance.delete()
115
118
  del self._instances[segment["id"]]
116
119
  if collection_id in self._segment_cache:
117
120
  if segment["scope"] in self._segment_cache[collection_id]:
@@ -1,8 +1,8 @@
1
- from typing import Optional, Sequence, Any, Tuple, cast, Generator, Union, Dict
1
+ from typing import Optional, Sequence, Any, Tuple, cast, Generator, Union, Dict, List
2
2
  from chromadb.segment import MetadataReader
3
3
  from chromadb.ingest import Consumer
4
4
  from chromadb.config import System
5
- from chromadb.types import Segment
5
+ from chromadb.types import Segment, InclusionExclusionOperator
6
6
  from chromadb.db.impl.sqlite import SqliteDB
7
7
  from overrides import override
8
8
  from chromadb.db.base import (
@@ -105,7 +105,6 @@ class SqliteMetadataSegment(MetadataReader):
105
105
  offset: Optional[int] = None,
106
106
  ) -> Sequence[MetadataEmbeddingRecord]:
107
107
  """Query for embedding metadata."""
108
-
109
108
  embeddings_t, metadata_t, fulltext_t = Tables(
110
109
  "embeddings", "embedding_metadata", "embedding_fulltext_search"
111
110
  )
@@ -135,7 +134,6 @@ class SqliteMetadataSegment(MetadataReader):
135
134
 
136
135
  if where:
137
136
  q = q.where(self._where_map_criterion(q, where, embeddings_t, metadata_t))
138
-
139
137
  if where_document:
140
138
  q = q.where(
141
139
  self._where_doc_criterion(q, where_document, embeddings_t, fulltext_t)
@@ -146,7 +144,6 @@ class SqliteMetadataSegment(MetadataReader):
146
144
 
147
145
  limit = limit or 2**63 - 1
148
146
  offset = offset or 0
149
-
150
147
  with self._db.tx() as cur:
151
148
  return list(islice(self._records(cur, q), offset, offset + limit))
152
149
 
@@ -405,7 +402,6 @@ class SqliteMetadataSegment(MetadataReader):
405
402
  self, q: QueryBuilder, where: Where, embeddings_t: Table, metadata_t: Table
406
403
  ) -> Criterion:
407
404
  clause: list[Criterion] = []
408
-
409
405
  for k, v in where.items():
410
406
  if k == "$and":
411
407
  criteria = [
@@ -466,6 +462,10 @@ class SqliteMetadataSegment(MetadataReader):
466
462
  raise ValueError(f"Unknown where_doc operator {k}")
467
463
  raise ValueError("Empty where_doc")
468
464
 
465
+ @override
466
+ def delete(self) -> None:
467
+ raise NotImplementedError()
468
+
469
469
 
470
470
  def _encode_seq_id(seq_id: SeqId) -> bytes:
471
471
  """Encode a SeqID into a byte array"""
@@ -488,24 +488,31 @@ def _decode_seq_id(seq_id_bytes: bytes) -> SeqId:
488
488
 
489
489
 
490
490
  def _where_clause(
491
- expr: Union[LiteralValue, Dict[WhereOperator, LiteralValue]],
491
+ expr: Union[
492
+ LiteralValue,
493
+ Dict[WhereOperator, LiteralValue],
494
+ Dict[InclusionExclusionOperator, List[LiteralValue]],
495
+ ],
492
496
  table: Table,
493
497
  ) -> Criterion:
494
498
  """Given a field name, an expression, and a table, construct a Pypika Criterion"""
495
499
 
496
500
  # Literal value case
497
501
  if isinstance(expr, (str, int, float, bool)):
498
- return _where_clause({"$eq": expr}, table)
502
+ return _where_clause({cast(WhereOperator, "$eq"): expr}, table)
499
503
 
500
504
  # Operator dict case
501
505
  operator, value = next(iter(expr.items()))
502
506
  return _value_criterion(value, operator, table)
503
507
 
504
508
 
505
- def _value_criterion(value: LiteralValue, op: WhereOperator, table: Table) -> Criterion:
509
+ def _value_criterion(
510
+ value: Union[LiteralValue, List[LiteralValue]],
511
+ op: Union[WhereOperator, InclusionExclusionOperator],
512
+ table: Table,
513
+ ) -> Criterion:
506
514
  """Return a criterion to compare a value with the appropriate columns given its type
507
515
  and the operation type."""
508
-
509
516
  if isinstance(value, str):
510
517
  cols = [table.string_value]
511
518
  # isinstance(True, int) evaluates to True, so we need to check for bools separately
@@ -515,6 +522,43 @@ def _value_criterion(value: LiteralValue, op: WhereOperator, table: Table) -> Cr
515
522
  cols = [table.int_value]
516
523
  elif isinstance(value, float) and op in ("$eq", "$ne"):
517
524
  cols = [table.float_value]
525
+ elif isinstance(value, list) and op in ("$in", "$nin"):
526
+ _v = value
527
+ if len(_v) == 0:
528
+ raise ValueError(f"Empty list for {op} operator")
529
+ if isinstance(value[0], str):
530
+ col_exprs = [
531
+ table.string_value.isin(ParameterValue(_v))
532
+ if op == "$in"
533
+ else table.str_value.notin(ParameterValue(_v))
534
+ ]
535
+ elif isinstance(value[0], bool):
536
+ col_exprs = [
537
+ table.bool_value.isin(ParameterValue(_v))
538
+ if op == "$in"
539
+ else table.bool_value.notin(ParameterValue(_v))
540
+ ]
541
+ elif isinstance(value[0], int):
542
+ col_exprs = [
543
+ table.int_value.isin(ParameterValue(_v))
544
+ if op == "$in"
545
+ else table.int_value.notin(ParameterValue(_v))
546
+ ]
547
+ elif isinstance(value[0], float):
548
+ col_exprs = [
549
+ table.float_value.isin(ParameterValue(_v))
550
+ if op == "$in"
551
+ else table.float_value.notin(ParameterValue(_v))
552
+ ]
553
+ elif isinstance(value, list) and op in ("$in", "$nin"):
554
+ col_exprs = [
555
+ table.int_value.isin(ParameterValue(value))
556
+ if op == "$in"
557
+ else table.int_value.notin(ParameterValue(value)),
558
+ table.float_value.isin(ParameterValue(value))
559
+ if op == "$in"
560
+ else table.float_value.notin(ParameterValue(value)),
561
+ ]
518
562
  else:
519
563
  cols = [table.int_value, table.float_value]
520
564
 
@@ -305,3 +305,7 @@ class LocalHnswSegment(VectorReader):
305
305
  batch.apply(record, label is not None)
306
306
 
307
307
  self._apply_batch(batch)
308
+
309
+ @override
310
+ def delete(self) -> None:
311
+ raise NotImplementedError()