cocoindex 0.1.51__tar.gz → 0.1.52__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.
- {cocoindex-0.1.51 → cocoindex-0.1.52}/Cargo.lock +1 -1
- {cocoindex-0.1.51 → cocoindex-0.1.52}/Cargo.toml +1 -1
- {cocoindex-0.1.51 → cocoindex-0.1.52}/PKG-INFO +2 -2
- {cocoindex-0.1.51 → cocoindex-0.1.52}/README.md +1 -1
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/core/basics.md +7 -7
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/core/cli.mdx +1 -1
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/core/data_types.mdx +3 -3
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/core/flow_def.mdx +18 -18
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/core/flow_methods.mdx +6 -6
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/getting_started/quickstart.md +3 -3
- cocoindex-0.1.51/docs/docs/ops/storages.md → cocoindex-0.1.52/docs/docs/ops/targets.md +21 -21
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/query.mdx +2 -2
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docusaurus.config.ts +4 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/sidebars.ts +1 -1
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/__init__.py +4 -1
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/cli.py +1 -2
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/flow.py +2 -2
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/op.py +3 -3
- cocoindex-0.1.51/python/cocoindex/storages.py → cocoindex-0.1.52/python/cocoindex/targets.py +8 -8
- cocoindex-0.1.52/python/cocoindex/utils.py +20 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/mod.rs +1 -1
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/registration.rs +5 -5
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/setup/auth_registry.rs +1 -1
- cocoindex-0.1.51/python/cocoindex/utils.py +0 -17
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.cargo/config.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.env.lib_debug +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.github/ISSUE_TEMPLATE//360/237/220/233-bug-report.md" +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.github/ISSUE_TEMPLATE//360/237/222/241-feature-request.md" +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.github/scripts/update_version.sh +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.github/workflows/CI.yml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.github/workflows/_doc_release.yml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.github/workflows/_test.yml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.github/workflows/docs.yml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.github/workflows/release.yml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.gitignore +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/.vscode/settings.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/CODE_OF_CONDUCT.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/CONTRIBUTING.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/LICENSE +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/dev/neo4j.yaml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/dev/postgres.yaml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/.gitignore +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/about/community.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/about/contributing.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/ai/llm.mdx +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/core/custom_function.mdx +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/core/data_example.svg +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/core/flow_example.svg +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/core/settings.mdx +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/getting_started/installation.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/getting_started/markdown_files.zip +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/getting_started/overview.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/ops/functions.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/docs/ops/sources.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/package.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/src/components/HomepageFeatures/index.tsx +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/src/components/HomepageFeatures/styles.module.css +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/src/css/custom.css +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/src/theme/Root.js +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/static/.nojekyll +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/static/img/docusaurus.png +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/static/img/favicon.ico +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/static/img/icon.svg +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/static/img/incremental-etl.gif +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/static/robots.txt +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/tsconfig.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/docs/yarn.lock +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/amazon_s3_embedding/.env.example +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/amazon_s3_embedding/.gitignore +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/amazon_s3_embedding/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/amazon_s3_embedding/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/amazon_s3_embedding/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/code_embedding/.env +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/code_embedding/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/code_embedding/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/code_embedding/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/docs_to_knowledge_graph/.env +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/docs_to_knowledge_graph/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/docs_to_knowledge_graph/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/docs_to_knowledge_graph/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/fastapi_server_docker/.dockerignore +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/fastapi_server_docker/.env +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/fastapi_server_docker/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/fastapi_server_docker/compose.yaml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/fastapi_server_docker/dockerfile +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/fastapi_server_docker/files/1810.04805v2.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/fastapi_server_docker/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/fastapi_server_docker/requirements.txt +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/gdrive_text_embedding/.env.example +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/gdrive_text_embedding/.gitignore +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/gdrive_text_embedding/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/gdrive_text_embedding/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/gdrive_text_embedding/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/.env +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/frontend/.gitignore +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/frontend/index.html +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/frontend/package-lock.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/frontend/package.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/frontend/src/App.jsx +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/frontend/src/main.jsx +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/frontend/src/style.css +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/frontend/vite.config.js +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/img/cat1.jpeg +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/img/dog1.jpeg +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/img/elephant1.jpg +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/img/giraffe.jpg +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/image_search/requirements.txt +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/manuals_llm_extraction/.env +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/manuals_llm_extraction/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/manuals_llm_extraction/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/manuals_llm_extraction/manuals/array.pdf +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/manuals_llm_extraction/manuals/base64.pdf +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/manuals_llm_extraction/manuals/copy.pdf +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/manuals_llm_extraction/manuals/glob.pdf +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/manuals_llm_extraction/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/pdf_embedding/.env +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/pdf_embedding/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/pdf_embedding/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/pdf_embedding/pdf_files/1706.03762v7.pdf +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/pdf_embedding/pdf_files/1810.04805v2.pdf +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/pdf_embedding/pdf_files/rfc8259.pdf +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/pdf_embedding/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/.env +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/img/cocoinsight.png +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/img/neo4j.png +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/products/p1.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/products/p2.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/products/p3.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/products/p4.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/products/p5.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/products/p6.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/products/p7.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/products/p8.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/products/p9.json +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/product_recommendation/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding/.env +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding/Text_Embedding.ipynb +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding/markdown_files/1706.03762v7.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding/markdown_files/1810.04805v2.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding/markdown_files/rfc8259.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding_qdrant/.env +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding_qdrant/README.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding_qdrant/main.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding_qdrant/markdown_files/rfc8259.md +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/examples/text_embedding_qdrant/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/pyproject.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/auth_registry.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/convert.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/functions.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/index.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/lib.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/llm.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/py.typed +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/runtime.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/setting.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/setup.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/sources.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/tests/__init__.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/tests/test_convert.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/tests/test_optional_database.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/tests/test_typing.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/python/cocoindex/typing.py +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/ruff.toml +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/base/duration.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/base/field_attrs.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/base/json_schema.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/base/mod.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/base/schema.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/base/spec.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/base/value.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/builder/analyzed_flow.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/builder/analyzer.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/builder/flow_builder.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/builder/mod.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/builder/plan.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/db_tracking.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/db_tracking_setup.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/dumper.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/evaluator.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/indexing_status.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/live_updater.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/memoization.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/mod.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/row_indexer.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/source_indexer.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/execution/stats.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/lib.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/lib_context.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/llm/anthropic.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/llm/gemini.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/llm/mod.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/llm/ollama.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/llm/openai.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/factory_bases.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/functions/extract_by_llm.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/functions/mod.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/functions/parse_json.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/functions/split_recursively.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/interface.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/py_factory.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/registry.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/sdk.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/sources/amazon_s3.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/sources/google_drive.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/sources/local_file.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/ops/sources/mod.rs +0 -0
- {cocoindex-0.1.51/src/ops/storages → cocoindex-0.1.52/src/ops/targets}/kuzu.rs +0 -0
- {cocoindex-0.1.51/src/ops/storages → cocoindex-0.1.52/src/ops/targets}/mod.rs +0 -0
- {cocoindex-0.1.51/src/ops/storages → cocoindex-0.1.52/src/ops/targets}/neo4j.rs +0 -0
- {cocoindex-0.1.51/src/ops/storages → cocoindex-0.1.52/src/ops/targets}/postgres.rs +0 -0
- {cocoindex-0.1.51/src/ops/storages → cocoindex-0.1.52/src/ops/targets}/qdrant.rs +0 -0
- {cocoindex-0.1.51/src/ops/storages → cocoindex-0.1.52/src/ops/targets}/shared/mod.rs +0 -0
- {cocoindex-0.1.51/src/ops/storages → cocoindex-0.1.52/src/ops/targets}/shared/property_graph.rs +0 -0
- {cocoindex-0.1.51/src/ops/storages → cocoindex-0.1.52/src/ops/targets}/shared/table_columns.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/prelude.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/py/convert.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/py/mod.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/server.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/service/error.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/service/flows.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/service/mod.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/settings.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/setup/components.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/setup/db_metadata.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/setup/driver.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/setup/mod.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/setup/states.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/utils/db.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/utils/fingerprint.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/utils/immutable.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/utils/mod.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/utils/retryable.rs +0 -0
- {cocoindex-0.1.51 → cocoindex-0.1.52}/src/utils/yaml_ser.rs +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: cocoindex
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.52
|
4
4
|
Requires-Dist: sentence-transformers>=3.3.1
|
5
5
|
Requires-Dist: click>=8.1.8
|
6
6
|
Requires-Dist: rich>=14.0.0
|
@@ -130,7 +130,7 @@ def text_embedding_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoind
|
|
130
130
|
# Export collected data to a vector index.
|
131
131
|
doc_embeddings.export(
|
132
132
|
"doc_embeddings",
|
133
|
-
cocoindex.
|
133
|
+
cocoindex.targets.Postgres(),
|
134
134
|
primary_key_fields=["filename", "location"],
|
135
135
|
vector_indexes=[
|
136
136
|
cocoindex.VectorIndexDef(
|
@@ -111,7 +111,7 @@ def text_embedding_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoind
|
|
111
111
|
# Export collected data to a vector index.
|
112
112
|
doc_embeddings.export(
|
113
113
|
"doc_embeddings",
|
114
|
-
cocoindex.
|
114
|
+
cocoindex.targets.Postgres(),
|
115
115
|
primary_key_fields=["filename", "location"],
|
116
116
|
vector_indexes=[
|
117
117
|
cocoindex.VectorIndexDef(
|
@@ -9,7 +9,7 @@ An **index** is a collection of data stored in a way that is easy for retrieval.
|
|
9
9
|
|
10
10
|
CocoIndex is an ETL framework for building indexes from specified data sources, a.k.a. **indexing**. It also offers utilities for users to retrieve data from the indexes.
|
11
11
|
|
12
|
-
An **indexing flow** extracts data from specified data sources, upon specified transformations, and puts the transformed data into specified
|
12
|
+
An **indexing flow** extracts data from specified data sources, upon specified transformations, and puts the transformed data into specified target for later retrieval.
|
13
13
|
|
14
14
|
## Indexing flow elements
|
15
15
|
|
@@ -17,7 +17,7 @@ An indexing flow has two aspects: data and operations on data.
|
|
17
17
|
|
18
18
|
### Data
|
19
19
|
|
20
|
-
An indexing flow involves source data and transformed data (either as an intermediate result or the final result to be put into
|
20
|
+
An indexing flow involves source data and transformed data (either as an intermediate result or the final result to be put into targets). All data within the indexing flow has **schema** determined at flow definition time.
|
21
21
|
|
22
22
|
Each piece of data has a **data type**, falling into one of the following categories:
|
23
23
|
|
@@ -36,8 +36,8 @@ An **operation** in an indexing flow defines a step in the flow. An operation is
|
|
36
36
|
* **Action**, which defines the behavior of the operation, e.g. *import*, *transform*, *for each*, *collect* and *export*.
|
37
37
|
See [Flow Definition](flow_def) for more details for each action.
|
38
38
|
|
39
|
-
* Some actions (i.e. "import", "transform" and "export") require an **Operation Spec**, which describes the specific behavior of the operation, e.g. a source to import from, a function describing the transformation behavior, a target
|
40
|
-
* Each operation spec has a **operation type**, e.g. `LocalFile` (data source), `SplitRecursively` (function), `SentenceTransformerEmbed` (function), `Postgres` (
|
39
|
+
* Some actions (i.e. "import", "transform" and "export") require an **Operation Spec**, which describes the specific behavior of the operation, e.g. a source to import from, a function describing the transformation behavior, a target to export to (as an index).
|
40
|
+
* Each operation spec has a **operation type**, e.g. `LocalFile` (data source), `SplitRecursively` (function), `SentenceTransformerEmbed` (function), `Postgres` (target).
|
41
41
|
* CocoIndex framework maintains a set of supported operation types. Users can also implement their own.
|
42
42
|
|
43
43
|
"import" and "transform" operations produce output data, whose data type is determined based on the operation spec and data types of input data (for "transform" operation only).
|
@@ -62,11 +62,11 @@ This shows schema and example data for the indexing flow:
|
|
62
62
|
|
63
63
|
## Life cycle of an indexing flow
|
64
64
|
|
65
|
-
An indexing flow, once set up, maintains a long-lived relationship between data source and
|
65
|
+
An indexing flow, once set up, maintains a long-lived relationship between data source and target. This means:
|
66
66
|
|
67
|
-
1. The target
|
67
|
+
1. The target created by the flow remain available for querying at any time
|
68
68
|
|
69
|
-
2. As source data changes (new data added, existing data updated or deleted), data in the target
|
69
|
+
2. As source data changes (new data added, existing data updated or deleted), data in the target are updated to reflect those changes,
|
70
70
|
on certain pace, according to the update mode:
|
71
71
|
|
72
72
|
* **One time update**: Once triggered, CocoIndex updates the target data to reflect the version of source data up to the current moment.
|
@@ -61,7 +61,7 @@ The following subcommands are available:
|
|
61
61
|
| ---------- | ----------- |
|
62
62
|
| `ls` | List all flows present in the given file/module. Or list all persisted flows under the current app namespace if no file/module specified. |
|
63
63
|
| `show` | Show the spec and schema for a specific flow. |
|
64
|
-
| `setup` | Check and apply backend setup changes for flows, including the internal and target
|
64
|
+
| `setup` | Check and apply backend setup changes for flows, including the internal storage and target (to export). |
|
65
65
|
| `drop` | Drop the backend setup for specified flows. |
|
66
66
|
| `update` | Update the index defined by the flow. |
|
67
67
|
| `evaluate` | Evaluate the flow and dump flow outputs to files. Instead of updating the index, it dumps what should be indexed to files. Mainly used for evaluation purpose. |
|
@@ -13,7 +13,7 @@ This makes schema of data processed by CocoIndex clear, and easily determine the
|
|
13
13
|
|
14
14
|
You don't need to spell out data types in CocoIndex, when you define the flow using existing operations (source, function, etc).
|
15
15
|
These operations decide data types of fields produced by them based on the spec and input data types.
|
16
|
-
All you need to do is to make sure the data passed to functions and
|
16
|
+
All you need to do is to make sure the data passed to functions and targets are accepted by them.
|
17
17
|
|
18
18
|
When you define [custom functions](/docs/core/custom_function), you need to specify the data types of arguments and return values.
|
19
19
|
|
@@ -40,7 +40,7 @@ This is the list of all basic types supported by CocoIndex:
|
|
40
40
|
| Vector[*T*, *Dim*?] | *T* can be a basic type or a numeric type. *Dim* is a positive integer and optional. | `cocoindex.Vector[T]` or `cocoindex.Vector[T, Dim]` | `numpy.typing.NDArray[T]` or `list[T]` |
|
41
41
|
|
42
42
|
Values of all data types can be represented by values in Python's native types (as described under the Native Python Type column).
|
43
|
-
However, the underlying execution engine
|
43
|
+
However, the underlying execution engine has finer distinctions for some types, specifically:
|
44
44
|
|
45
45
|
* *Float32* and *Float64* for `float`, with different precision.
|
46
46
|
* *LocalDateTime* and *OffsetDateTime* for `datetime.datetime`, with different timezone awareness.
|
@@ -50,7 +50,7 @@ However, the underlying execution engine and some storage system (like Postgres)
|
|
50
50
|
|
51
51
|
The native Python type is always more permissive and can represent a superset of possible values.
|
52
52
|
* Only when you annotate the return type of a custom function, you should use the specific type,
|
53
|
-
so that CocoIndex will have information about the precise type to be used in the execution engine and
|
53
|
+
so that CocoIndex will have information about the precise type to be used in the execution engine and target.
|
54
54
|
* For all other purposes, e.g. to provide annotation for argument types of a custom function, or used internally in your custom function,
|
55
55
|
you can choose whatever to use.
|
56
56
|
The native Python type is usually simpler.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: Flow Definition
|
3
|
-
description: Define a CocoIndex flow, by specifying source, transformations and
|
3
|
+
description: Define a CocoIndex flow, by specifying source, transformations and targets, and connect input/output data of them.
|
4
4
|
---
|
5
5
|
|
6
6
|
import Tabs from '@theme/Tabs';
|
@@ -8,7 +8,7 @@ import TabItem from '@theme/TabItem';
|
|
8
8
|
|
9
9
|
# CocoIndex Flow Definition
|
10
10
|
|
11
|
-
In CocoIndex, to define an indexing flow, you provide a function to import source, transform data and put them into
|
11
|
+
In CocoIndex, to define an indexing flow, you provide a function to import source, transform data and put them into targets.
|
12
12
|
You connect input/output of these operations with fields of data scopes.
|
13
13
|
|
14
14
|
## Entry Point
|
@@ -246,14 +246,14 @@ and generates a `id` field with UUID and remains stable when `filename` and `sum
|
|
246
246
|
|
247
247
|
### Export
|
248
248
|
|
249
|
-
The `export()` method exports the collected data to an external
|
249
|
+
The `export()` method exports the collected data to an external target.
|
250
250
|
|
251
|
-
A *
|
251
|
+
A *target spec* needs to be provided for any export operation, to describe the target and parameters related to the target.
|
252
252
|
|
253
253
|
Export must happen at the top level of a flow, i.e. not within any child scopes created by "for each row". It takes the following arguments:
|
254
254
|
|
255
255
|
* `name`: the name to identify the export target.
|
256
|
-
* `target_spec`: the
|
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
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.
|
@@ -270,7 +270,7 @@ def demo_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataSco
|
|
270
270
|
demo_collector = data_scope.add_collector()
|
271
271
|
...
|
272
272
|
demo_collector.export(
|
273
|
-
"
|
273
|
+
"demo_target", DemoTargetSpec(...),
|
274
274
|
primary_key_fields=["field1"],
|
275
275
|
vector_indexes=[cocoindex.VectorIndexDef("field2", cocoindex.VectorSimilarityMetric.COSINE_SIMILARITY)])
|
276
276
|
```
|
@@ -278,14 +278,14 @@ def demo_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataSco
|
|
278
278
|
</TabItem>
|
279
279
|
</Tabs>
|
280
280
|
|
281
|
-
The target
|
282
|
-
The `name` for the same
|
283
|
-
If it changes, CocoIndex will treat it as an old
|
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.
|
282
|
+
The `name` for the same target should remain stable across different runs.
|
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
|
|
285
285
|
## Storage Indexes
|
286
286
|
|
287
|
-
Many storage
|
288
|
-
CocoIndex provides a common way to configure indexes for various
|
287
|
+
Many targets are storage systems supporting indexes, to boost efficiency in retrieving data.
|
288
|
+
CocoIndex provides a common way to configure indexes for various targets.
|
289
289
|
|
290
290
|
### Primary Key
|
291
291
|
|
@@ -330,7 +330,7 @@ For example,
|
|
330
330
|
```python
|
331
331
|
doc_embeddings.export(
|
332
332
|
"doc_embeddings",
|
333
|
-
cocoindex.
|
333
|
+
cocoindex.targets.Qdrant(
|
334
334
|
collection_name=cocoindex.get_app_namespace(trailing_delimiter='__') + "doc_embeddings",
|
335
335
|
...
|
336
336
|
),
|
@@ -345,8 +345,8 @@ It will use `Staging__doc_embeddings` as the collection name if the current app
|
|
345
345
|
|
346
346
|
### Target Declarations
|
347
347
|
|
348
|
-
Most time a target
|
349
|
-
Occasionally, you may need to specify some configurations for target
|
348
|
+
Most time a target is created by calling `export()` method on a collector, and this `export()` call comes with configurations needed for the target, e.g. options for storage indexes.
|
349
|
+
Occasionally, you may need to specify some configurations for the target out of the context of any specific data collector.
|
350
350
|
|
351
351
|
For example, for graph database targets like `Neo4j` and `Kuzu`, you may have a data collector to export data to relationships, which will create nodes referenced by various relationships in turn.
|
352
352
|
These nodes don't directly come from any specific data collector (consider relationships from different data collectors may share the same nodes).
|
@@ -359,7 +359,7 @@ To specify configurations for these nodes, you can *declare* spec for related no
|
|
359
359
|
|
360
360
|
```python
|
361
361
|
flow_builder.declare(
|
362
|
-
cocoindex.
|
362
|
+
cocoindex.targets.Neo4jDeclarations(...)
|
363
363
|
)
|
364
364
|
```
|
365
365
|
|
@@ -389,7 +389,7 @@ You can add an auth entry by `cocoindex.add_auth_entry()` function, which return
|
|
389
389
|
```python
|
390
390
|
my_graph_conn = cocoindex.add_auth_entry(
|
391
391
|
"my_graph_conn",
|
392
|
-
cocoindex.
|
392
|
+
cocoindex.targets.Neo4jConnectionSpec(
|
393
393
|
uri="bolt://localhost:7687",
|
394
394
|
user="neo4j",
|
395
395
|
password="cocoindex",
|
@@ -403,7 +403,7 @@ Then reference it when building a spec that takes an auth entry:
|
|
403
403
|
```python
|
404
404
|
demo_collector.export(
|
405
405
|
"MyGraph",
|
406
|
-
cocoindex.
|
406
|
+
cocoindex.targets.Neo4jRelationship(connection=my_graph_conn, ...)
|
407
407
|
)
|
408
408
|
```
|
409
409
|
|
@@ -412,7 +412,7 @@ Then reference it when building a spec that takes an auth entry:
|
|
412
412
|
```python
|
413
413
|
demo_collector.export(
|
414
414
|
"MyGraph",
|
415
|
-
cocoindex.
|
415
|
+
cocoindex.targets.Neo4jRelationship(connection=cocoindex.ref_auth_entry("my_graph_conn"), ...))
|
416
416
|
```
|
417
417
|
|
418
418
|
</TabItem>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
title: Run a Flow
|
3
3
|
toc_max_heading_level: 4
|
4
|
-
description: Run a CocoIndex Flow, including build / update data in the target
|
4
|
+
description: Run a CocoIndex Flow, including build / update data in the target and evaluate the flow without changing the target.
|
5
5
|
---
|
6
6
|
|
7
7
|
import Tabs from '@theme/Tabs';
|
@@ -37,7 +37,7 @@ It creates a `demo_flow` object in `cocoindex.Flow` type.
|
|
37
37
|
|
38
38
|
## Build / update target data
|
39
39
|
|
40
|
-
The major goal of a flow is to perform the transformations on source data and build / update data in the target
|
40
|
+
The major goal of a flow is to perform the transformations on source data and build / update data in the target.
|
41
41
|
This action has two modes:
|
42
42
|
|
43
43
|
* **One time update.**
|
@@ -53,7 +53,7 @@ This action has two modes:
|
|
53
53
|
:::info
|
54
54
|
|
55
55
|
For both modes, CocoIndex is performing *incremental processing*,
|
56
|
-
i.e. we only perform computations and
|
56
|
+
i.e. we only perform computations and target mutations on source data that are changed, or the flow has changed.
|
57
57
|
This is to achieve best efficiency.
|
58
58
|
|
59
59
|
:::
|
@@ -63,7 +63,7 @@ This is to achieve best efficiency.
|
|
63
63
|
|
64
64
|
#### CLI
|
65
65
|
|
66
|
-
The `cocoindex update` subcommand creates/updates data in the target
|
66
|
+
The `cocoindex update` subcommand creates/updates data in the target.
|
67
67
|
|
68
68
|
Once it's done, the target data is fresh up to the moment when the function is called.
|
69
69
|
|
@@ -76,7 +76,7 @@ cocoindex update main.py
|
|
76
76
|
<Tabs>
|
77
77
|
<TabItem value="python" label="Python">
|
78
78
|
|
79
|
-
The `update()` async method creates/updates data in the target
|
79
|
+
The `update()` async method creates/updates data in the target.
|
80
80
|
|
81
81
|
Once the function returns, the target data is fresh up to the moment when the function is called.
|
82
82
|
|
@@ -207,7 +207,7 @@ CocoIndex also provides asynchronous versions of APIs for blocking operations, i
|
|
207
207
|
|
208
208
|
## Evaluate the flow
|
209
209
|
|
210
|
-
CocoIndex allows you to run the transformations defined by the flow without updating the target
|
210
|
+
CocoIndex allows you to run the transformations defined by the flow without updating the target.
|
211
211
|
|
212
212
|
### CLI
|
213
213
|
|
@@ -87,7 +87,7 @@ def text_embedding_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoind
|
|
87
87
|
# Export collected data to a vector index.
|
88
88
|
doc_embeddings.export(
|
89
89
|
"doc_embeddings",
|
90
|
-
cocoindex.
|
90
|
+
cocoindex.targets.Postgres(),
|
91
91
|
primary_key_fields=["filename", "location"],
|
92
92
|
vector_indexes=[
|
93
93
|
cocoindex.VectorIndexDef(
|
@@ -214,7 +214,7 @@ from pgvector.psycopg import register_vector
|
|
214
214
|
|
215
215
|
def search(pool: ConnectionPool, query: str, top_k: int = 5):
|
216
216
|
# Get the table name, for the export target in the text_embedding_flow above.
|
217
|
-
table_name = cocoindex.utils.
|
217
|
+
table_name = cocoindex.utils.get_target_default_name(text_embedding_flow, "doc_embeddings")
|
218
218
|
# Evaluate the transform flow defined above with the input query, to get the embedding.
|
219
219
|
query_vector = text_to_embedding.eval(query)
|
220
220
|
# Run the query and get the results.
|
@@ -237,7 +237,7 @@ There're two CocoIndex-specific logic:
|
|
237
237
|
1. Get the table name from the export target in the `text_embedding_flow` above.
|
238
238
|
Since the table name for the `Postgres` target is not explicitly specified in the `export()` call,
|
239
239
|
CocoIndex uses a default name.
|
240
|
-
`cocoindex.utils.
|
240
|
+
`cocoindex.utils.get_target_default_name()` is a utility function to get the default table name for this case.
|
241
241
|
|
242
242
|
2. Evaluate the transform flow defined above with the input query, to get the embedding.
|
243
243
|
It's done by the `eval()` method of the transform flow `text_to_embedding`.
|
@@ -1,17 +1,17 @@
|
|
1
1
|
---
|
2
|
-
title:
|
3
|
-
description: CocoIndex Built-in
|
2
|
+
title: Targets
|
3
|
+
description: CocoIndex Built-in Targets
|
4
4
|
toc_max_heading_level: 4
|
5
5
|
---
|
6
6
|
|
7
|
-
# CocoIndex Built-in
|
7
|
+
# CocoIndex Built-in Targets
|
8
8
|
|
9
|
-
For each target
|
10
|
-
The way to map data from a data collector to a target
|
9
|
+
For each target, data are exported from a data collector, containing data of multiple entries, each with multiple fields.
|
10
|
+
The way to map data from a data collector to a target depends on data model of the target.
|
11
11
|
|
12
12
|
## Entry-Oriented Targets
|
13
13
|
|
14
|
-
|
14
|
+
An entry-oriented target organizes data into independent entries, such as rows, key-value pairs, or documents.
|
15
15
|
Each entry is self-contained and does not explicitly link to others.
|
16
16
|
There is usually a straightforward mapping from data collector rows to entries.
|
17
17
|
|
@@ -113,7 +113,7 @@ Here's how CocoIndex data elements map to nodes in the graph:
|
|
113
113
|
|
114
114
|
Note that the label used in different `Nodes`s should be unique.
|
115
115
|
|
116
|
-
`cocoindex.
|
116
|
+
`cocoindex.targets.Nodes` is to describe mapping to nodes. It has the following fields:
|
117
117
|
|
118
118
|
* `label` (type: `str`): The label of the node.
|
119
119
|
|
@@ -133,9 +133,9 @@ We can export them to nodes under label `Document` like this:
|
|
133
133
|
```python
|
134
134
|
document_collector.export(
|
135
135
|
...
|
136
|
-
cocoindex.
|
136
|
+
cocoindex.targets.Neo4j(
|
137
137
|
...
|
138
|
-
mapping=cocoindex.
|
138
|
+
mapping=cocoindex.targets.Nodes(label="Document"),
|
139
139
|
),
|
140
140
|
primary_key_fields=["filename"],
|
141
141
|
)
|
@@ -168,7 +168,7 @@ graph TD
|
|
168
168
|
|
169
169
|
If a node label needs to appear as source or target of a relationship, but not exported as a node, you need to [declare](../core/flow_def#target-declarations) the label with necessary configuration.
|
170
170
|
|
171
|
-
The dataclass to describe the declaration is specific to each target
|
171
|
+
The dataclass to describe the declaration is specific to each target (e.g. `cocoindex.targets.Neo4jDeclarations`),
|
172
172
|
while they share the following common fields:
|
173
173
|
|
174
174
|
* `nodes_label` (required): The label of the node.
|
@@ -181,7 +181,7 @@ Considering we want to extract relationships from `Document` to `Place` later (i
|
|
181
181
|
|
182
182
|
```python
|
183
183
|
flow_builder.declare(
|
184
|
-
cocoindex.
|
184
|
+
cocoindex.targets.Neo4jDeclarations(
|
185
185
|
connection = ...,
|
186
186
|
nodes_label="Place",
|
187
187
|
primary_key_fields=["name"],
|
@@ -201,12 +201,12 @@ Here's how CocoIndex data elements map to relationships in the graph:
|
|
201
201
|
|
202
202
|
Note that the type used in different `Relationships`s should be unique.
|
203
203
|
|
204
|
-
`cocoindex.
|
204
|
+
`cocoindex.targets.Relationships` is to describe mapping to relationships. It has the following fields:
|
205
205
|
|
206
206
|
* `rel_type` (type: `str`): The type of the relationship.
|
207
|
-
* `source`/`target` (type: `cocoindex.
|
207
|
+
* `source`/`target` (type: `cocoindex.targets.NodeFromFields`): Specify how to extract source/target node information from specific fields in the collected row. It has the following fields:
|
208
208
|
* `label` (type: `str`): The label of the node.
|
209
|
-
* `fields` (type: `Sequence[cocoindex.
|
209
|
+
* `fields` (type: `Sequence[cocoindex.targets.TargetFieldMapping]`): Specify field mappings from the collected rows to node properties, with the following fields:
|
210
210
|
* `source` (type: `str`): The name of the field in the collected row.
|
211
211
|
* `target` (type: `str`, optional): The name of the field to use as the node field. If unspecified, will use the same as `source`.
|
212
212
|
|
@@ -238,19 +238,19 @@ We can export them to relationships under type `MENTION` like this:
|
|
238
238
|
```python
|
239
239
|
doc_place_collector.export(
|
240
240
|
...
|
241
|
-
cocoindex.
|
241
|
+
cocoindex.targets.Neo4j(
|
242
242
|
...
|
243
|
-
mapping=cocoindex.
|
243
|
+
mapping=cocoindex.targets.Relationships(
|
244
244
|
rel_type="MENTION",
|
245
|
-
source=cocoindex.
|
245
|
+
source=cocoindex.targets.NodeFromFields(
|
246
246
|
label="Document",
|
247
|
-
fields=[cocoindex.
|
247
|
+
fields=[cocoindex.targets.TargetFieldMapping(source="doc_filename", target="filename")],
|
248
248
|
),
|
249
|
-
target=cocoindex.
|
249
|
+
target=cocoindex.targets.NodeFromFields(
|
250
250
|
label="Place",
|
251
251
|
fields=[
|
252
|
-
cocoindex.
|
253
|
-
cocoindex.
|
252
|
+
cocoindex.targets.TargetFieldMapping(source="place_name", target="name"),
|
253
|
+
cocoindex.targets.TargetFieldMapping(source="place_embedding", target="embedding"),
|
254
254
|
],
|
255
255
|
),
|
256
256
|
),
|
@@ -80,7 +80,7 @@ print(await text_to_embedding.eval_async("Hello, world!"))
|
|
80
80
|
|
81
81
|
In your indexing flow, when you export data to a target, you can specify the target name (e.g. a database table name, a collection name, the node label in property graph databases, etc.) explicitly,
|
82
82
|
or for some backends you can also omit it and let CocoIndex generate a default name for you.
|
83
|
-
For the latter case, CocoIndex provides a utility function `cocoindex.utils.
|
83
|
+
For the latter case, CocoIndex provides a utility function `cocoindex.utils.get_target_default_name()` to get the default name.
|
84
84
|
It takes the following arguments:
|
85
85
|
|
86
86
|
* `flow` (type: `cocoindex.Flow`): The flow to get the default name for.
|
@@ -92,7 +92,7 @@ For example:
|
|
92
92
|
<TabItem value="python" label="Python">
|
93
93
|
|
94
94
|
```python
|
95
|
-
table_name = cocoindex.utils.
|
95
|
+
table_name = cocoindex.utils.get_target_default_name(text_embedding_flow, "doc_embeddings")
|
96
96
|
query = f"SELECT filename, text FROM {table_name} ORDER BY embedding <=> %s DESC LIMIT 5"
|
97
97
|
...
|
98
98
|
```
|
@@ -2,7 +2,9 @@
|
|
2
2
|
Cocoindex is a framework for building and running indexing pipelines.
|
3
3
|
"""
|
4
4
|
|
5
|
-
from . import functions, sources,
|
5
|
+
from . import functions, sources, targets, cli, utils
|
6
|
+
|
7
|
+
from . import targets as storages # Deprecated: Use targets instead
|
6
8
|
|
7
9
|
from .auth_registry import AuthEntryReference, add_auth_entry, ref_auth_entry
|
8
10
|
from .flow import FlowBuilder, DataScope, DataSlice, Flow, transform_flow
|
@@ -21,6 +23,7 @@ __all__ = [
|
|
21
23
|
"_engine",
|
22
24
|
"functions",
|
23
25
|
"sources",
|
26
|
+
"targets",
|
24
27
|
"storages",
|
25
28
|
"cli",
|
26
29
|
"utils",
|
@@ -247,8 +247,7 @@ def show(app_flow_specifier: str, color: bool, verbose: bool) -> None:
|
|
247
247
|
)
|
248
248
|
def setup(app_target: str, force: bool) -> None:
|
249
249
|
"""
|
250
|
-
Check and apply backend setup changes for flows, including the internal and target
|
251
|
-
(to export).
|
250
|
+
Check and apply backend setup changes for flows, including the internal storage and target (to export to).
|
252
251
|
|
253
252
|
APP_TARGET: path/to/app.py or installed_module.
|
254
253
|
"""
|
@@ -327,7 +327,7 @@ class DataCollector:
|
|
327
327
|
def export(
|
328
328
|
self,
|
329
329
|
name: str,
|
330
|
-
target_spec: op.
|
330
|
+
target_spec: op.TargetSpec,
|
331
331
|
/,
|
332
332
|
*,
|
333
333
|
primary_key_fields: Sequence[str],
|
@@ -340,7 +340,7 @@ class DataCollector:
|
|
340
340
|
|
341
341
|
`vector_index` is for backward compatibility only. Please use `vector_indexes` instead.
|
342
342
|
"""
|
343
|
-
if not isinstance(target_spec, op.
|
343
|
+
if not isinstance(target_spec, op.TargetSpec):
|
344
344
|
raise ValueError(
|
345
345
|
"export() can only be called on a CocoIndex target storage"
|
346
346
|
)
|
@@ -19,7 +19,7 @@ class OpCategory(Enum):
|
|
19
19
|
|
20
20
|
FUNCTION = "function"
|
21
21
|
SOURCE = "source"
|
22
|
-
|
22
|
+
TARGET = "target"
|
23
23
|
DECLARATION = "declaration"
|
24
24
|
|
25
25
|
|
@@ -52,8 +52,8 @@ class FunctionSpec(metaclass=SpecMeta, category=OpCategory.FUNCTION): # pylint:
|
|
52
52
|
"""A function spec. All its subclass can be instantiated similar to a dataclass, i.e. ClassName(field1=value1, field2=value2, ...)"""
|
53
53
|
|
54
54
|
|
55
|
-
class
|
56
|
-
"""A
|
55
|
+
class TargetSpec(metaclass=SpecMeta, category=OpCategory.TARGET): # pylint: disable=too-few-public-methods
|
56
|
+
"""A target spec. All its subclass can be instantiated similar to a dataclass, i.e. ClassName(field1=value1, field2=value2, ...)"""
|
57
57
|
|
58
58
|
|
59
59
|
class DeclarationSpec(metaclass=SpecMeta, category=OpCategory.DECLARATION): # pylint: disable=too-few-public-methods
|
cocoindex-0.1.51/python/cocoindex/storages.py → cocoindex-0.1.52/python/cocoindex/targets.py
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
"""All builtin
|
1
|
+
"""All builtin targets."""
|
2
2
|
|
3
3
|
from dataclasses import dataclass
|
4
4
|
from typing import Sequence
|
@@ -9,8 +9,8 @@ from .auth_registry import AuthEntryReference
|
|
9
9
|
from .setting import DatabaseConnectionSpec
|
10
10
|
|
11
11
|
|
12
|
-
class Postgres(op.
|
13
|
-
"""
|
12
|
+
class Postgres(op.TargetSpec):
|
13
|
+
"""Target powered by Postgres and pgvector."""
|
14
14
|
|
15
15
|
database: AuthEntryReference[DatabaseConnectionSpec] | None = None
|
16
16
|
table_name: str | None = None
|
@@ -25,8 +25,8 @@ class QdrantConnection:
|
|
25
25
|
|
26
26
|
|
27
27
|
@dataclass
|
28
|
-
class Qdrant(op.
|
29
|
-
"""
|
28
|
+
class Qdrant(op.TargetSpec):
|
29
|
+
"""Target powered by Qdrant - https://qdrant.tech/."""
|
30
30
|
|
31
31
|
collection_name: str
|
32
32
|
connection: AuthEntryReference[QdrantConnection] | None = None
|
@@ -52,7 +52,7 @@ class NodeFromFields:
|
|
52
52
|
|
53
53
|
@dataclass
|
54
54
|
class ReferencedNode:
|
55
|
-
"""
|
55
|
+
"""Target spec for a graph node."""
|
56
56
|
|
57
57
|
label: str
|
58
58
|
primary_key_fields: Sequence[str]
|
@@ -95,7 +95,7 @@ class Neo4jConnection:
|
|
95
95
|
db: str | None = None
|
96
96
|
|
97
97
|
|
98
|
-
class Neo4j(op.
|
98
|
+
class Neo4j(op.TargetSpec):
|
99
99
|
"""Graph storage powered by Neo4j."""
|
100
100
|
|
101
101
|
connection: AuthEntryReference[Neo4jConnection]
|
@@ -119,7 +119,7 @@ class KuzuConnection:
|
|
119
119
|
api_server_url: str
|
120
120
|
|
121
121
|
|
122
|
-
class Kuzu(op.
|
122
|
+
class Kuzu(op.TargetSpec):
|
123
123
|
"""Graph storage powered by Kuzu."""
|
124
124
|
|
125
125
|
connection: AuthEntryReference[KuzuConnection]
|
@@ -0,0 +1,20 @@
|
|
1
|
+
from .flow import Flow
|
2
|
+
from .setting import get_app_namespace
|
3
|
+
|
4
|
+
|
5
|
+
def get_target_default_name(flow: Flow, target_name: str, delimiter: str = "__") -> str:
|
6
|
+
"""
|
7
|
+
Get the default name for a target.
|
8
|
+
It's used as the underlying target name (e.g. a table, a collection, etc.) followed by most targets, if not explicitly specified.
|
9
|
+
"""
|
10
|
+
return (
|
11
|
+
get_app_namespace(trailing_delimiter=delimiter)
|
12
|
+
+ flow.name
|
13
|
+
+ delimiter
|
14
|
+
+ target_name
|
15
|
+
)
|
16
|
+
|
17
|
+
|
18
|
+
get_target_storage_default_name = (
|
19
|
+
get_target_default_name # Deprecated: Use get_target_default_name instead
|
20
|
+
)
|