cocoindex 0.1.56__tar.gz → 0.1.58__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 (248) hide show
  1. {cocoindex-0.1.56 → cocoindex-0.1.58}/Cargo.lock +1 -1
  2. {cocoindex-0.1.56 → cocoindex-0.1.58}/Cargo.toml +1 -1
  3. {cocoindex-0.1.56 → cocoindex-0.1.58}/PKG-INFO +4 -2
  4. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/core/basics.md +1 -1
  5. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/core/flow_def.mdx +6 -6
  6. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/core/flow_methods.mdx +85 -1
  7. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/getting_started/quickstart.md +6 -17
  8. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/ops/functions.md +9 -0
  9. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/amazon_s3_embedding/README.md +0 -6
  10. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/amazon_s3_embedding/main.py +6 -3
  11. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/amazon_s3_embedding/pyproject.toml +1 -1
  12. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/code_embedding/main.py +12 -3
  13. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/code_embedding/pyproject.toml +1 -1
  14. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/fastapi_server_docker/requirements.txt +1 -1
  15. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/gdrive_text_embedding/pyproject.toml +1 -1
  16. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/README.md +0 -1
  17. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/main.py +3 -1
  18. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/pyproject.toml +1 -1
  19. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/pdf_embedding/pyproject.toml +1 -1
  20. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding/main.py +3 -1
  21. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding/pyproject.toml +1 -1
  22. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding_qdrant/README.md +1 -0
  23. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding_qdrant/pyproject.toml +1 -1
  24. {cocoindex-0.1.56 → cocoindex-0.1.58}/pyproject.toml +3 -1
  25. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/__init__.py +5 -2
  26. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/cli.py +126 -72
  27. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/flow.py +131 -29
  28. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/functions.py +24 -7
  29. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/op.py +3 -4
  30. cocoindex-0.1.58/python/cocoindex/setup.py +92 -0
  31. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/base/duration.rs +136 -35
  32. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/builder/flow_builder.rs +12 -14
  33. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/live_updater.rs +76 -85
  34. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/source_indexer.rs +43 -15
  35. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/stats.rs +19 -7
  36. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/lib_context.rs +72 -40
  37. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/py/mod.rs +74 -72
  38. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/setup/db_metadata.rs +7 -7
  39. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/setup/driver.rs +327 -172
  40. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/setup/states.rs +57 -24
  41. cocoindex-0.1.56/python/cocoindex/setup.py +0 -26
  42. {cocoindex-0.1.56 → cocoindex-0.1.58}/.cargo/config.toml +0 -0
  43. {cocoindex-0.1.56 → cocoindex-0.1.58}/.env.lib_debug +0 -0
  44. {cocoindex-0.1.56 → cocoindex-0.1.58}/.github/ISSUE_TEMPLATE//360/237/220/233-bug-report.md" +0 -0
  45. {cocoindex-0.1.56 → cocoindex-0.1.58}/.github/ISSUE_TEMPLATE//360/237/222/241-feature-request.md" +0 -0
  46. {cocoindex-0.1.56 → cocoindex-0.1.58}/.github/scripts/update_version.sh +0 -0
  47. {cocoindex-0.1.56 → cocoindex-0.1.58}/.github/workflows/CI.yml +0 -0
  48. {cocoindex-0.1.56 → cocoindex-0.1.58}/.github/workflows/_doc_release.yml +0 -0
  49. {cocoindex-0.1.56 → cocoindex-0.1.58}/.github/workflows/_test.yml +0 -0
  50. {cocoindex-0.1.56 → cocoindex-0.1.58}/.github/workflows/docs.yml +0 -0
  51. {cocoindex-0.1.56 → cocoindex-0.1.58}/.github/workflows/release.yml +0 -0
  52. {cocoindex-0.1.56 → cocoindex-0.1.58}/.gitignore +0 -0
  53. {cocoindex-0.1.56 → cocoindex-0.1.58}/.pre-commit-config.yaml +0 -0
  54. {cocoindex-0.1.56 → cocoindex-0.1.58}/.vscode/settings.json +0 -0
  55. {cocoindex-0.1.56 → cocoindex-0.1.58}/CODE_OF_CONDUCT.md +0 -0
  56. {cocoindex-0.1.56 → cocoindex-0.1.58}/CONTRIBUTING.md +0 -0
  57. {cocoindex-0.1.56 → cocoindex-0.1.58}/LICENSE +0 -0
  58. {cocoindex-0.1.56 → cocoindex-0.1.58}/README.md +0 -0
  59. {cocoindex-0.1.56 → cocoindex-0.1.58}/dev/neo4j.yaml +0 -0
  60. {cocoindex-0.1.56 → cocoindex-0.1.58}/dev/postgres.yaml +0 -0
  61. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/.gitignore +0 -0
  62. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/README.md +0 -0
  63. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/about/community.md +0 -0
  64. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/about/contributing.md +0 -0
  65. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/ai/llm.mdx +0 -0
  66. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/core/cli.mdx +0 -0
  67. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/core/custom_function.mdx +0 -0
  68. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/core/data_example.svg +0 -0
  69. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/core/data_types.mdx +0 -0
  70. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/core/flow_example.svg +0 -0
  71. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/core/settings.mdx +0 -0
  72. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/getting_started/installation.md +0 -0
  73. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/getting_started/markdown_files.zip +0 -0
  74. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/getting_started/overview.md +0 -0
  75. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/ops/sources.md +0 -0
  76. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/ops/targets.md +0 -0
  77. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docs/query.mdx +0 -0
  78. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/docusaurus.config.ts +0 -0
  79. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/package.json +0 -0
  80. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/sidebars.ts +0 -0
  81. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/src/components/HomepageFeatures/index.tsx +0 -0
  82. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/src/components/HomepageFeatures/styles.module.css +0 -0
  83. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/src/css/custom.css +0 -0
  84. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/src/theme/Root.js +0 -0
  85. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/static/.nojekyll +0 -0
  86. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/static/img/docusaurus.png +0 -0
  87. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/static/img/favicon.ico +0 -0
  88. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/static/img/icon.svg +0 -0
  89. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/static/img/incremental-etl.gif +0 -0
  90. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/static/robots.txt +0 -0
  91. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/tsconfig.json +0 -0
  92. {cocoindex-0.1.56 → cocoindex-0.1.58}/docs/yarn.lock +0 -0
  93. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/amazon_s3_embedding/.env.example +0 -0
  94. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/amazon_s3_embedding/.gitignore +0 -0
  95. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/code_embedding/.env +0 -0
  96. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/code_embedding/README.md +0 -0
  97. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/docs_to_knowledge_graph/.env +0 -0
  98. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/docs_to_knowledge_graph/README.md +0 -0
  99. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/docs_to_knowledge_graph/main.py +0 -0
  100. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/docs_to_knowledge_graph/pyproject.toml +0 -0
  101. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/fastapi_server_docker/.dockerignore +0 -0
  102. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/fastapi_server_docker/.env +0 -0
  103. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/fastapi_server_docker/README.md +0 -0
  104. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/fastapi_server_docker/compose.yaml +0 -0
  105. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/fastapi_server_docker/dockerfile +0 -0
  106. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/fastapi_server_docker/files/1810.04805v2.md +0 -0
  107. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/fastapi_server_docker/main.py +0 -0
  108. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/gdrive_text_embedding/.env.example +0 -0
  109. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/gdrive_text_embedding/.gitignore +0 -0
  110. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/gdrive_text_embedding/README.md +0 -0
  111. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/gdrive_text_embedding/main.py +0 -0
  112. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/.env +0 -0
  113. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/frontend/.gitignore +0 -0
  114. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/frontend/index.html +0 -0
  115. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/frontend/package-lock.json +0 -0
  116. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/frontend/package.json +0 -0
  117. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/frontend/src/App.jsx +0 -0
  118. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/frontend/src/main.jsx +0 -0
  119. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/frontend/src/style.css +0 -0
  120. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/frontend/vite.config.js +0 -0
  121. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/img/cat1.jpeg +0 -0
  122. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/img/dog1.jpeg +0 -0
  123. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/img/elephant1.jpg +0 -0
  124. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/img/giraffe.jpg +0 -0
  125. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/image_search/requirements.txt +0 -0
  126. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/manuals_llm_extraction/.env +0 -0
  127. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/manuals_llm_extraction/README.md +0 -0
  128. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/manuals_llm_extraction/main.py +0 -0
  129. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/manuals_llm_extraction/manuals/array.pdf +0 -0
  130. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/manuals_llm_extraction/manuals/base64.pdf +0 -0
  131. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/manuals_llm_extraction/manuals/copy.pdf +0 -0
  132. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/manuals_llm_extraction/manuals/glob.pdf +0 -0
  133. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/manuals_llm_extraction/pyproject.toml +0 -0
  134. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/pdf_embedding/.env +0 -0
  135. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/pdf_embedding/README.md +0 -0
  136. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/pdf_embedding/main.py +0 -0
  137. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/pdf_embedding/pdf_files/1706.03762v7.pdf +0 -0
  138. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/pdf_embedding/pdf_files/1810.04805v2.pdf +0 -0
  139. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/pdf_embedding/pdf_files/rfc8259.pdf +0 -0
  140. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/.env +0 -0
  141. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/README.md +0 -0
  142. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/img/cocoinsight.png +0 -0
  143. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/img/neo4j.png +0 -0
  144. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/main.py +0 -0
  145. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/products/p1.json +0 -0
  146. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/products/p2.json +0 -0
  147. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/products/p3.json +0 -0
  148. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/products/p4.json +0 -0
  149. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/products/p5.json +0 -0
  150. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/products/p6.json +0 -0
  151. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/products/p7.json +0 -0
  152. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/products/p8.json +0 -0
  153. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/products/p9.json +0 -0
  154. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/product_recommendation/pyproject.toml +0 -0
  155. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding/.env +0 -0
  156. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding/README.md +0 -0
  157. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding/Text_Embedding.ipynb +0 -0
  158. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding/markdown_files/1706.03762v7.md +0 -0
  159. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding/markdown_files/1810.04805v2.md +0 -0
  160. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding/markdown_files/rfc8259.md +0 -0
  161. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding_qdrant/.env +0 -0
  162. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding_qdrant/main.py +0 -0
  163. {cocoindex-0.1.56 → cocoindex-0.1.58}/examples/text_embedding_qdrant/markdown_files/rfc8259.md +0 -0
  164. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/auth_registry.py +0 -0
  165. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/convert.py +0 -0
  166. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/index.py +0 -0
  167. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/lib.py +0 -0
  168. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/llm.py +0 -0
  169. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/py.typed +0 -0
  170. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/runtime.py +0 -0
  171. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/setting.py +0 -0
  172. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/sources.py +0 -0
  173. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/targets.py +0 -0
  174. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/tests/__init__.py +0 -0
  175. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/tests/test_convert.py +0 -0
  176. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/tests/test_optional_database.py +0 -0
  177. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/tests/test_typing.py +0 -0
  178. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/typing.py +0 -0
  179. {cocoindex-0.1.56 → cocoindex-0.1.58}/python/cocoindex/utils.py +0 -0
  180. {cocoindex-0.1.56 → cocoindex-0.1.58}/ruff.toml +0 -0
  181. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/base/field_attrs.rs +0 -0
  182. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/base/json_schema.rs +0 -0
  183. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/base/mod.rs +0 -0
  184. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/base/schema.rs +0 -0
  185. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/base/spec.rs +0 -0
  186. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/base/value.rs +0 -0
  187. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/builder/analyzed_flow.rs +0 -0
  188. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/builder/analyzer.rs +0 -0
  189. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/builder/exec_ctx.rs +0 -0
  190. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/builder/mod.rs +0 -0
  191. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/builder/plan.rs +0 -0
  192. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/db_tracking.rs +0 -0
  193. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/db_tracking_setup.rs +0 -0
  194. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/dumper.rs +0 -0
  195. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/evaluator.rs +0 -0
  196. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/indexing_status.rs +0 -0
  197. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/memoization.rs +0 -0
  198. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/mod.rs +0 -0
  199. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/execution/row_indexer.rs +0 -0
  200. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/lib.rs +0 -0
  201. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/llm/anthropic.rs +0 -0
  202. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/llm/gemini.rs +0 -0
  203. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/llm/litellm.rs +0 -0
  204. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/llm/mod.rs +0 -0
  205. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/llm/ollama.rs +0 -0
  206. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/llm/openai.rs +0 -0
  207. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/llm/openrouter.rs +0 -0
  208. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/llm/voyage.rs +0 -0
  209. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/factory_bases.rs +0 -0
  210. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/functions/embed_text.rs +0 -0
  211. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/functions/extract_by_llm.rs +0 -0
  212. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/functions/mod.rs +0 -0
  213. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/functions/parse_json.rs +0 -0
  214. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/functions/split_recursively.rs +0 -0
  215. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/interface.rs +0 -0
  216. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/mod.rs +0 -0
  217. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/py_factory.rs +0 -0
  218. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/registration.rs +0 -0
  219. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/registry.rs +0 -0
  220. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/sdk.rs +0 -0
  221. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/sources/amazon_s3.rs +0 -0
  222. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/sources/google_drive.rs +0 -0
  223. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/sources/local_file.rs +0 -0
  224. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/sources/mod.rs +0 -0
  225. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/targets/kuzu.rs +0 -0
  226. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/targets/mod.rs +0 -0
  227. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/targets/neo4j.rs +0 -0
  228. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/targets/postgres.rs +0 -0
  229. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/targets/qdrant.rs +0 -0
  230. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/targets/shared/mod.rs +0 -0
  231. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/targets/shared/property_graph.rs +0 -0
  232. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/ops/targets/shared/table_columns.rs +0 -0
  233. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/prelude.rs +0 -0
  234. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/py/convert.rs +0 -0
  235. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/server.rs +0 -0
  236. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/service/error.rs +0 -0
  237. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/service/flows.rs +0 -0
  238. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/service/mod.rs +0 -0
  239. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/settings.rs +0 -0
  240. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/setup/auth_registry.rs +0 -0
  241. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/setup/components.rs +0 -0
  242. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/setup/mod.rs +0 -0
  243. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/utils/db.rs +0 -0
  244. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/utils/fingerprint.rs +0 -0
  245. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/utils/immutable.rs +0 -0
  246. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/utils/mod.rs +0 -0
  247. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/utils/retryable.rs +0 -0
  248. {cocoindex-0.1.56 → cocoindex-0.1.58}/src/utils/yaml_ser.rs +0 -0
@@ -1040,7 +1040,7 @@ dependencies = [
1040
1040
 
1041
1041
  [[package]]
1042
1042
  name = "cocoindex"
1043
- version = "0.1.56"
1043
+ version = "0.1.58"
1044
1044
  dependencies = [
1045
1045
  "anyhow",
1046
1046
  "async-openai",
@@ -2,7 +2,7 @@
2
2
  name = "cocoindex"
3
3
  # Version used for local development is always higher than others to take precedence.
4
4
  # Will be overridden for specific release versions.
5
- version = "0.1.56"
5
+ version = "0.1.58"
6
6
  edition = "2024"
7
7
  rust-version = "1.86"
8
8
 
@@ -1,16 +1,18 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.1.56
4
- Requires-Dist: sentence-transformers>=3.3.1
3
+ Version: 0.1.58
5
4
  Requires-Dist: click>=8.1.8
6
5
  Requires-Dist: rich>=14.0.0
7
6
  Requires-Dist: python-dotenv>=1.1.0
8
7
  Requires-Dist: watchfiles>=1.1.0
8
+ Requires-Dist: numpy>=1.23.2
9
9
  Requires-Dist: pytest ; extra == 'test'
10
10
  Requires-Dist: ruff ; extra == 'dev'
11
11
  Requires-Dist: pre-commit ; extra == 'dev'
12
+ Requires-Dist: sentence-transformers>=3.3.1 ; extra == 'embeddings'
12
13
  Provides-Extra: test
13
14
  Provides-Extra: dev
15
+ Provides-Extra: embeddings
14
16
  License-File: LICENSE
15
17
  Summary: With CocoIndex, users declare the transformation, CocoIndex creates & maintains an index, and keeps the derived index up to date based on source update, with minimal computation and changes.
16
18
  Author-email: CocoIndex <cocoindex.io@gmail.com>
@@ -101,4 +101,4 @@ As an indexing flow is long-lived, it needs to store intermediate data to keep t
101
101
  CocoIndex uses internal storage for this purpose.
102
102
 
103
103
  Currently, CocoIndex uses Postgres database as the internal storage.
104
- See [Settings](settings#databaseconnectionspec) for configuring its location, and `cocoindex setup` CLI command (see [CocoIndex CLI](cli)) creates tables for the internal storage.
104
+ See [Settings](settings#databaseconnectionspec) for configuring its location. The internal storage is managed by CocoIndex, see [Setup / drop flow](/docs/core/flow_methods#setup--drop-flow) for more details.
@@ -256,7 +256,7 @@ Export must happen at the top level of a flow, i.e. not within any child scopes
256
256
  * `target_spec`: the target spec as the export target.
257
257
  * `setup_by_user` (optional):
258
258
  whether the export target is setup by user.
259
- By default, CocoIndex is managing the target setup (surfaced by the `cocoindex setup` CLI subcommand), e.g. create related tables/collections/etc. with compatible schema, and update them upon change.
259
+ By default, CocoIndex is managing the target setup (see [Setup / drop flow](/docs/core/flow_methods#setup--drop-flow)), e.g. create related tables/collections/etc. with compatible schema, and update them upon change.
260
260
  If `True`, the export target will be managed by users, and users are responsible for creating the target and updating it upon change.
261
261
  * Fields to configure [storage indexes](#storage-indexes). `primary_key_fields` is required, and all others are optional.
262
262
 
@@ -278,7 +278,7 @@ def demo_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataSco
278
278
  </TabItem>
279
279
  </Tabs>
280
280
 
281
- The target is managed by CocoIndex, i.e. it'll be created by [CocoIndex CLI](/docs/core/cli) when you run `cocoindex setup`, and the data will be automatically updated (including stale data removal) when updating the index.
281
+ The target is managed by CocoIndex, i.e. it'll be created or dropped when [setup / drop flow](/docs/core/flow_methods#setup--drop-flow), and the data will be automatically updated (including stale data removal) when updating the index.
282
282
  The `name` for the same target should remain stable across different runs.
283
283
  If it changes, CocoIndex will treat it as an old target removed and a new one created, and perform setup changes and reindexing accordingly.
284
284
 
@@ -370,11 +370,11 @@ flow_builder.declare(
370
370
 
371
371
  CocoIndex manages an auth registry. It's an in-memory key-value store, mainly to store authentication information for a backend.
372
372
 
373
- Operation spec is the default way to configure a backend. But it has the following limitations:
373
+ Operation spec is the default way to configure a persistent backend. But it has the following limitations:
374
374
 
375
375
  * The spec isn't supposed to contain secret information, and it's frequently shown in various places, e.g. `cocoindex show`.
376
376
  * Once an operation is removed after flow definition code change, the spec is also gone.
377
- But we still need to be able to drop the backend (e.g. a table) by `cocoindex setup` or `cocoindex drop`.
377
+ But we still need to be able to drop the backend (e.g. a table) when [setup / drop flow](/docs/core/flow_methods#setup--drop-flow).
378
378
 
379
379
  Auth registry is introduced to solve the problems above. It works as follows:
380
380
 
@@ -423,5 +423,5 @@ Note that CocoIndex backends use the key of an auth entry to identify the backen
423
423
  * Keep the key stable.
424
424
  If the key doesn't change, it's considered to be the same backend (even if the underlying way to connect/authenticate change).
425
425
 
426
- * If a key is no longer referenced in any operation spec, keep it until the next `cocoindex setup` or `cocoindex drop`,
427
- so that when cocoindex will be able to perform cleanups.
426
+ * If a key is no longer referenced in any operation spec, keep it until the next flow setup / drop action,
427
+ so that cocoindex will be able to clean up the backends.
@@ -34,6 +34,71 @@ It creates a `demo_flow` object in `cocoindex.Flow` type.
34
34
  </TabItem>
35
35
  </Tabs>
36
36
 
37
+ ## Setup / drop flow
38
+
39
+ For a flow, its persistent backends need to be ready before it can run, including:
40
+
41
+ * [Internal storage](/docs/core/basics#internal-storage) for CocoIndex.
42
+ * Backend entities for targets exported by the flow, e.g. a table (in relational databases), a collection (in some vector databases), etc.
43
+
44
+ The desired state of the backends for a flow is derived based on the flow definition itself.
45
+ CocoIndex supports two types of actions to manage the persistent backends automatically:
46
+
47
+ * *Setup* a flow, which will change the backends owned by the flow to a state to the desired state, e.g. create new tables for new flow, drop an existing table if the corresponding target is gone, add new column to a target table if a new field is collected, etc. It's no-op if the backend states are already in the desired state.
48
+
49
+ * *Drop* a flow, which will drop all backends owned by the flow. It's no-op if there's no existing backends owned by the flow (e.g. never setup or already dropped).
50
+
51
+ ### CLI
52
+
53
+ `cocoindex setup` subcommand will setup all flows.
54
+ `cocoindex update` and `cocoindex server` also provide a `--setup` option to setup the flow if needed before performing the main action of updating or starting the server.
55
+
56
+ `cocoindex drop` subcommand will drop all flows.
57
+
58
+ ### Library API
59
+
60
+ <Tabs>
61
+ <TabItem value="python" label="Python">
62
+
63
+ `Flow` provides the following APIs to setup / drop individual flows:
64
+
65
+ * `setup(report_to_stdout: bool = False)`: Setup the flow.
66
+ * `drop(report_to_stdout: bool = False)`: Drop the flow.
67
+
68
+ For example:
69
+
70
+ ```python
71
+ demo_flow.setup(report_to_stdout=True)
72
+ demo_flow.drop(report_to_stdout=True)
73
+ ```
74
+
75
+ We also provide the following asynchronous versions of the APIs:
76
+
77
+ * `setup_async(report_to_stdout: bool = False)`: Setup the flow asynchronously.
78
+ * `drop_async(report_to_stdout: bool = False)`: Drop the flow asynchronously.
79
+
80
+ For example:
81
+
82
+ ```python
83
+ await demo_flow.setup_async(report_to_stdout=True)
84
+ await demo_flow.drop_async(report_to_stdout=True)
85
+ ```
86
+
87
+
88
+ Besides, CocoIndex also provides APIs to setup / drop all flows at once:
89
+
90
+ * `setup_all_flows(report_to_stdout: bool = False)`: Setup all flows.
91
+ * `drop_all_flows(report_to_stdout: bool = False)`: Drop all flows.
92
+
93
+ For example:
94
+
95
+ ```python
96
+ cocoindex.setup_all_flows(report_to_stdout=True)
97
+ cocoindex.drop_all_flows(report_to_stdout=True)
98
+ ```
99
+
100
+ </TabItem>
101
+ </Tabs>
37
102
 
38
103
  ## Build / update target data
39
104
 
@@ -71,12 +136,18 @@ Once it's done, the target data is fresh up to the moment when the function is c
71
136
  cocoindex update main.py
72
137
  ```
73
138
 
139
+ With a `--setup` option, it will also setup the flow first if needed.
140
+
141
+ ```sh
142
+ cocoindex update --setup main.py
143
+ ```
144
+
74
145
  #### Library API
75
146
 
76
147
  <Tabs>
77
148
  <TabItem value="python" label="Python">
78
149
 
79
- The `update()` async method creates/updates data in the target.
150
+ The `Flow.update()` method creates/updates data in the target.
80
151
 
81
152
  Once the function returns, the target data is fresh up to the moment when the function is called.
82
153
 
@@ -85,6 +156,13 @@ stats = demo_flow.update()
85
156
  print(stats)
86
157
  ```
87
158
 
159
+ `update_async()` is the asynchronous version of `update()`.
160
+
161
+ ```python
162
+ stats = await demo_flow.update_async()
163
+ print(stats)
164
+ ```
165
+
88
166
  </TabItem>
89
167
  </Tabs>
90
168
 
@@ -111,6 +189,12 @@ cocoindex update main.py -L
111
189
  If there's at least one data source with change capture mechanism enabled, it will keep running until the aborted (e.g. by `Ctrl-C`).
112
190
  Otherwise, it falls back to the same behavior as one time update, and will finish after a one-time update is done.
113
191
 
192
+ With a `--setup` option, it will also setup the flow first if needed.
193
+
194
+ ```sh
195
+ cocoindex update main.py -L --setup
196
+ ```
197
+
114
198
  #### Library API
115
199
 
116
200
  <Tabs>
@@ -21,7 +21,7 @@ We'll need to install a bunch of dependencies for this project.
21
21
  1. Install CocoIndex:
22
22
 
23
23
  ```bash
24
- pip install -U cocoindex
24
+ pip install -U 'cocoindex[embeddings]'
25
25
  ```
26
26
 
27
27
  2. You can skip this step if you already have a Postgres database with pgvector extension installed.
@@ -121,27 +121,16 @@ Specify the database URL by environment variable:
121
121
  export COCOINDEX_DATABASE_URL="postgresql://cocoindex:cocoindex@localhost:5432/cocoindex"
122
122
  ```
123
123
 
124
- ### Step 3.1: Setup the index pipeline
125
-
126
- We need to setup the index:
127
-
128
- ```bash
129
- cocoindex setup quickstart.py
130
- ```
131
-
132
- Enter `yes` and it will automatically create a few tables in the database.
133
-
134
- Now we have tables needed by this CocoIndex flow.
135
-
136
- ### Step 3.2: Build the index
137
-
138
124
  Now we're ready to build the index:
139
125
 
140
126
  ```bash
141
- cocoindex update quickstart.py
127
+ cocoindex update --setup quickstart.py
142
128
  ```
143
129
 
144
- It will run for a few seconds and output the following statistics:
130
+ If you run it the first time for this flow, CocoIndex will automatically create its persistent backends (tables in the database).
131
+ CocoIndex will ask you to confirm the action, enter `yes` to proceed.
132
+
133
+ CocoIndex will run for a few seconds and populate the target table with data as declared by the flow. It will output the following statistics:
145
134
 
146
135
  ```
147
136
  documents: 3 added, 0 removed, 0 updated
@@ -77,6 +77,15 @@ Return: [*KTable*](/docs/core/data_types#ktable), each row represents a chunk, w
77
77
 
78
78
  `SentenceTransformerEmbed` embeds a text into a vector space using the [SentenceTransformer](https://huggingface.co/sentence-transformers) library.
79
79
 
80
+ :::note Optional Dependency Required
81
+
82
+ This function requires the 'sentence-transformers' library, which is an optional dependency. Install CocoIndex with:
83
+
84
+ ```bash
85
+ pip install 'cocoindex[embeddings]'
86
+ ```
87
+ :::
88
+
80
89
  The spec takes the following fields:
81
90
 
82
91
  * `model` (`str`): The name of the SentenceTransformer model to use.
@@ -37,12 +37,6 @@ Install dependencies:
37
37
  pip install -e .
38
38
  ```
39
39
 
40
- Setup:
41
-
42
- ```sh
43
- cocoindex setup main.py
44
- ```
45
-
46
40
  Run:
47
41
 
48
42
  ```sh
@@ -2,6 +2,7 @@ from dotenv import load_dotenv
2
2
  from psycopg_pool import ConnectionPool
3
3
  import cocoindex
4
4
  import os
5
+ from typing import Any
5
6
 
6
7
 
7
8
  @cocoindex.transform_flow()
@@ -22,7 +23,7 @@ def text_to_embedding(
22
23
  @cocoindex.flow_def(name="AmazonS3TextEmbedding")
23
24
  def amazon_s3_text_embedding_flow(
24
25
  flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataScope
25
- ):
26
+ ) -> None:
26
27
  """
27
28
  Define an example flow that embeds text from Amazon S3 into a vector database.
28
29
  """
@@ -72,7 +73,7 @@ def amazon_s3_text_embedding_flow(
72
73
  )
73
74
 
74
75
 
75
- def search(pool: ConnectionPool, query: str, top_k: int = 5):
76
+ def search(pool: ConnectionPool, query: str, top_k: int = 5) -> list[dict[str, Any]]:
76
77
  # Get the table name, for the export target in the amazon_s3_text_embedding_flow above.
77
78
  table_name = cocoindex.utils.get_target_default_name(
78
79
  amazon_s3_text_embedding_flow, "doc_embeddings"
@@ -95,9 +96,11 @@ def search(pool: ConnectionPool, query: str, top_k: int = 5):
95
96
  ]
96
97
 
97
98
 
98
- def _main():
99
+ def _main() -> None:
99
100
  # Initialize the database connection pool.
100
101
  pool = ConnectionPool(os.getenv("COCOINDEX_DATABASE_URL"))
102
+
103
+ amazon_s3_text_embedding_flow.setup()
101
104
  with cocoindex.FlowLiveUpdater(amazon_s3_text_embedding_flow):
102
105
  # Run queries in a loop to demonstrate the query capabilities.
103
106
  while True:
@@ -3,7 +3,7 @@ name = "amazon-s3-text-embedding"
3
3
  version = "0.1.0"
4
4
  description = "Simple example for cocoindex: build embedding index based on Amazon S3 files."
5
5
  requires-python = ">=3.11"
6
- dependencies = ["cocoindex>=0.1.52", "python-dotenv>=1.0.1"]
6
+ dependencies = ["cocoindex[embeddings]>=0.1.57", "python-dotenv>=1.0.1"]
7
7
 
8
8
  [tool.setuptools]
9
9
  packages = []
@@ -68,6 +68,7 @@ def code_embedding_flow(
68
68
  code=chunk["text"],
69
69
  embedding=chunk["embedding"],
70
70
  start=chunk["start"],
71
+ end=chunk["end"],
71
72
  )
72
73
 
73
74
  code_embeddings.export(
@@ -96,13 +97,19 @@ def search(pool: ConnectionPool, query: str, top_k: int = 5) -> list[dict[str, A
96
97
  with conn.cursor() as cur:
97
98
  cur.execute(
98
99
  f"""
99
- SELECT filename, code, embedding <=> %s AS distance
100
+ SELECT filename, code, embedding <=> %s AS distance, start, "end"
100
101
  FROM {table_name} ORDER BY distance LIMIT %s
101
102
  """,
102
103
  (query_vector, top_k),
103
104
  )
104
105
  return [
105
- {"filename": row[0], "code": row[1], "score": 1.0 - row[2]}
106
+ {
107
+ "filename": row[0],
108
+ "code": row[1],
109
+ "score": 1.0 - row[2],
110
+ "start": row[3],
111
+ "end": row[4],
112
+ }
106
113
  for row in cur.fetchall()
107
114
  ]
108
115
 
@@ -123,7 +130,9 @@ def _main() -> None:
123
130
  results = search(pool, query)
124
131
  print("\nSearch results:")
125
132
  for result in results:
126
- print(f"[{result['score']:.3f}] {result['filename']}")
133
+ print(
134
+ f"[{result['score']:.3f}] {result['filename']} (L{result['start']['line']}-L{result['end']['line']})"
135
+ )
127
136
  print(f" {result['code']}")
128
137
  print("---")
129
138
  print()
@@ -3,7 +3,7 @@ name = "code-embedding"
3
3
  version = "0.1.0"
4
4
  description = "Simple example for cocoindex: build embedding index based on source code."
5
5
  requires-python = ">=3.11"
6
- dependencies = ["cocoindex>=0.1.52", "python-dotenv>=1.0.1"]
6
+ dependencies = ["cocoindex[embeddings]>=0.1.56", "python-dotenv>=1.0.1"]
7
7
 
8
8
  [tool.setuptools]
9
9
  packages = []
@@ -1,4 +1,4 @@
1
- cocoindex>=0.1.52
1
+ cocoindex[embeddings]>=0.1.52
2
2
  python-dotenv>=1.0.1
3
3
  fastapi==0.115.12
4
4
  fastapi-cli==0.0.7
@@ -3,7 +3,7 @@ name = "gdrive-text-embedding"
3
3
  version = "0.1.0"
4
4
  description = "Simple example for cocoindex: build embedding index based on Google Drive files."
5
5
  requires-python = ">=3.11"
6
- dependencies = ["cocoindex>=0.1.52", "python-dotenv>=1.0.1"]
6
+ dependencies = ["cocoindex[embeddings]>=0.1.52", "python-dotenv>=1.0.1"]
7
7
 
8
8
  [tool.setuptools]
9
9
  packages = []
@@ -29,7 +29,6 @@ We appreciate a star ⭐ at [CocoIndex Github](https://github.com/cocoindex-io/c
29
29
 
30
30
  - Run Backend
31
31
  ```
32
- cocoindex setup main.py
33
32
  uvicorn main:app --reload --host 0.0.0.0 --port 8000
34
33
  ```
35
34
 
@@ -84,9 +84,11 @@ def image_object_embedding_flow(
84
84
 
85
85
 
86
86
  @asynccontextmanager
87
- async def lifespan(app: FastAPI):
87
+ async def lifespan(app: FastAPI) -> None:
88
88
  load_dotenv()
89
89
  cocoindex.init()
90
+ image_object_embedding_flow.setup(report_to_stdout=True)
91
+
90
92
  app.state.qdrant_client = QdrantClient(url=QDRANT_URL, prefer_grpc=True)
91
93
 
92
94
  # Start updater
@@ -4,7 +4,7 @@ version = "0.1.0"
4
4
  description = "Simple example for cocoindex: build embedding index based on images."
5
5
  requires-python = ">=3.11"
6
6
  dependencies = [
7
- "cocoindex>=0.1.52",
7
+ "cocoindex>=0.1.57",
8
8
  "python-dotenv>=1.0.1",
9
9
  "fastapi>=0.100.0",
10
10
  "torch>=2.0.0",
@@ -4,7 +4,7 @@ version = "0.1.0"
4
4
  description = "Simple example for cocoindex: build embedding index based on local PDF files."
5
5
  requires-python = ">=3.11"
6
6
  dependencies = [
7
- "cocoindex>=0.1.52",
7
+ "cocoindex[embeddings]>=0.1.52",
8
8
  "python-dotenv>=1.0.1",
9
9
  "marker-pdf>=1.5.2",
10
10
  ]
@@ -6,6 +6,7 @@ import cocoindex
6
6
  import os
7
7
  from numpy.typing import NDArray
8
8
  import numpy as np
9
+ from datetime import timedelta
9
10
 
10
11
 
11
12
  @cocoindex.transform_flow()
@@ -38,7 +39,8 @@ def text_embedding_flow(
38
39
  Define an example flow that embeds text into a vector database.
39
40
  """
40
41
  data_scope["documents"] = flow_builder.add_source(
41
- cocoindex.sources.LocalFile(path="markdown_files")
42
+ cocoindex.sources.LocalFile(path="markdown_files"),
43
+ refresh_interval=timedelta(seconds=5),
42
44
  )
43
45
 
44
46
  doc_embeddings = data_scope.add_collector()
@@ -4,7 +4,7 @@ version = "0.1.0"
4
4
  description = "Simple example for cocoindex: build embedding index based on local text files."
5
5
  requires-python = ">=3.11"
6
6
  dependencies = [
7
- "cocoindex>=0.1.52",
7
+ "cocoindex[embeddings]>=0.1.52",
8
8
  "python-dotenv>=1.0.1",
9
9
  "pgvector>=0.4.1",
10
10
  "psycopg[binary,pool]",
@@ -37,6 +37,7 @@ We use Qdrant client to query the index, and reuse the embedding operation in th
37
37
  pip install -e .
38
38
  ```
39
39
 
40
+
40
41
  - Setup:
41
42
 
42
43
  ```bash
@@ -4,7 +4,7 @@ version = "0.1.0"
4
4
  description = "Simple example for cocoindex: build embedding index based on local text files."
5
5
  requires-python = ">=3.11"
6
6
  dependencies = [
7
- "cocoindex>=0.1.52",
7
+ "cocoindex[embeddings]>=0.1.52",
8
8
  "python-dotenv>=1.0.1",
9
9
  "qdrant-client>=1.6.0",
10
10
  ]
@@ -10,11 +10,11 @@ authors = [{ name = "CocoIndex", email = "cocoindex.io@gmail.com" }]
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.11"
12
12
  dependencies = [
13
- "sentence-transformers>=3.3.1",
14
13
  "click>=8.1.8",
15
14
  "rich>=14.0.0",
16
15
  "python-dotenv>=1.1.0",
17
16
  "watchfiles>=1.1.0",
17
+ "numpy>=1.23.2",
18
18
  ]
19
19
  license = "Apache-2.0"
20
20
  urls = { Homepage = "https://cocoindex.io/" }
@@ -31,9 +31,11 @@ features = ["pyo3/extension-module"]
31
31
  [project.optional-dependencies]
32
32
  test = ["pytest"]
33
33
  dev = ["ruff", "pre-commit"]
34
+ embeddings = ["sentence-transformers>=3.3.1"]
34
35
 
35
36
  [tool.mypy]
36
37
  python_version = "3.11"
37
38
  strict = true
38
39
  files = "python/cocoindex"
39
40
  exclude = "(\\.venv|site-packages)"
41
+ disable_error_code = ["unused-ignore"]
@@ -10,7 +10,8 @@ from .auth_registry import AuthEntryReference, add_auth_entry, ref_auth_entry
10
10
  from .flow import FlowBuilder, DataScope, DataSlice, Flow, transform_flow
11
11
  from .flow import flow_def
12
12
  from .flow import EvaluateAndDumpOptions, GeneratedField
13
- from .flow import update_all_flows_async, FlowLiveUpdater, FlowLiveUpdaterOptions
13
+ from .flow import FlowLiveUpdater, FlowLiveUpdaterOptions
14
+ from .flow import update_all_flows_async, setup_all_flows, drop_all_flows
14
15
  from .lib import init, start_server, stop, main_fn
15
16
  from .llm import LlmSpec, LlmApiType
16
17
  from .index import VectorSimilarityMetric, VectorIndexDef, IndexOptions
@@ -40,9 +41,11 @@ __all__ = [
40
41
  "flow_def",
41
42
  "EvaluateAndDumpOptions",
42
43
  "GeneratedField",
43
- "update_all_flows_async",
44
44
  "FlowLiveUpdater",
45
45
  "FlowLiveUpdaterOptions",
46
+ "update_all_flows_async",
47
+ "setup_all_flows",
48
+ "drop_all_flows",
46
49
  # Lib
47
50
  "init",
48
51
  "start_server",