cocoindex 0.1.22__tar.gz → 0.1.23__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.22 → cocoindex-0.1.23}/Cargo.lock +5 -6
- {cocoindex-0.1.22 → cocoindex-0.1.23}/Cargo.toml +1 -1
- {cocoindex-0.1.22 → cocoindex-0.1.23}/PKG-INFO +1 -1
- cocoindex-0.1.23/dev/neo4j.yaml +25 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/docs_to_kg/main.py +14 -14
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/functions.py +3 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/storages.py +10 -10
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/typing.py +1 -5
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/builder/analyzer.rs +5 -5
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/db_tracking_setup.rs +9 -6
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/functions/mod.rs +1 -0
- cocoindex-0.1.23/src/ops/functions/parse_json.rs +104 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/registration.rs +1 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/storages/neo4j.rs +89 -64
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/setup/driver.rs +9 -7
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/setup/states.rs +12 -11
- cocoindex-0.1.22/dev/neo4j.yaml +0 -16
- {cocoindex-0.1.22 → cocoindex-0.1.23}/.cargo/config.toml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/.env.lib_debug +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/.github/ISSUE_TEMPLATE//360/237/220/233-bug-report.md" +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/.github/ISSUE_TEMPLATE//360/237/222/241-feature-request.md" +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/.github/scripts/update_version.sh +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/.github/workflows/CI.yml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/.github/workflows/docs.yml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/.github/workflows/release.yml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/.gitignore +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/CODE_OF_CONDUCT.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/CONTRIBUTING.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/LICENSE +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/README.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/dev/postgres.yaml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/.gitignore +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/README.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/about/community.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/about/contributing.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/ai/llm.mdx +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/core/basics.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/core/cli.mdx +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/core/custom_function.mdx +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/core/data_example.svg +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/core/data_types.mdx +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/core/flow_def.mdx +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/core/flow_example.svg +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/core/flow_methods.mdx +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/core/initialization.mdx +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/getting_started/installation.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/getting_started/markdown_files.zip +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/getting_started/overview.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/getting_started/quickstart.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/ops/functions.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/ops/sources.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docs/ops/storages.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/docusaurus.config.ts +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/package.json +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/sidebars.ts +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/src/components/HomepageFeatures/index.tsx +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/src/components/HomepageFeatures/styles.module.css +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/src/css/custom.css +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/src/theme/Root.js +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/static/.nojekyll +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/static/img/docusaurus.png +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/static/img/favicon.ico +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/static/img/icon.svg +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/static/robots.txt +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/tsconfig.json +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/docs/yarn.lock +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/code_embedding/.env +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/code_embedding/README.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/code_embedding/main.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/code_embedding/pyproject.toml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/docs_to_kg/.env +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/docs_to_kg/README.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/docs_to_kg/markdown_files/1706.03762v7.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/docs_to_kg/markdown_files/1810.04805v2.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/docs_to_kg/markdown_files/rfc8259.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/docs_to_kg/pyproject.toml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/gdrive_text_embedding/.env.example +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/gdrive_text_embedding/.gitignore +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/gdrive_text_embedding/README.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/gdrive_text_embedding/data/1706.03762v7.docx +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/gdrive_text_embedding/data/1810.04805v2.docx +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/gdrive_text_embedding/main.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/gdrive_text_embedding/pyproject.toml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/manuals_llm_extraction/.env +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/manuals_llm_extraction/README.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/manuals_llm_extraction/main.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/manuals_llm_extraction/manuals/array.pdf +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/manuals_llm_extraction/manuals/base64.pdf +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/manuals_llm_extraction/manuals/copy.pdf +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/manuals_llm_extraction/manuals/glob.pdf +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/manuals_llm_extraction/pyproject.toml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/pdf_embedding/.env +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/pdf_embedding/README.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/pdf_embedding/main.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/pdf_embedding/pdf_files/1706.03762v7.pdf +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/pdf_embedding/pdf_files/1810.04805v2.pdf +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/pdf_embedding/pdf_files/rfc8259.pdf +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/pdf_embedding/pyproject.toml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding/.env +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding/README.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding/main.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding/markdown_files/1706.03762v7.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding/markdown_files/1810.04805v2.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding/markdown_files/rfc8259.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding/pyproject.toml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding_qdrant/.env +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding_qdrant/README.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding_qdrant/main.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding_qdrant/markdown_files/rfc8259.md +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/examples/text_embedding_qdrant/pyproject.toml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/pyproject.toml +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/__init__.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/auth_registry.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/cli.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/convert.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/flow.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/index.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/lib.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/llm.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/op.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/py.typed +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/query.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/setup.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/sources.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/tests/__init__.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/python/cocoindex/tests/test_convert.py +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/base/field_attrs.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/base/json_schema.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/base/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/base/schema.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/base/spec.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/base/value.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/builder/analyzed_flow.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/builder/flow_builder.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/builder/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/builder/plan.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/db_tracking.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/dumper.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/evaluator.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/live_updater.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/memoization.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/query.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/row_indexer.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/source_indexer.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/execution/stats.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/lib.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/lib_context.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/llm/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/llm/ollama.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/llm/openai.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/factory_bases.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/functions/extract_by_llm.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/functions/split_recursively.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/interface.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/py_factory.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/registry.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/sdk.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/sources/google_drive.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/sources/local_file.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/sources/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/storages/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/storages/postgres.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/ops/storages/qdrant.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/prelude.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/py/convert.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/py/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/server.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/service/error.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/service/flows.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/service/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/service/search.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/settings.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/setup/auth_registry.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/setup/components.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/setup/db_metadata.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/setup/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/utils/db.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/utils/fingerprint.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/utils/immutable.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/utils/mod.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/utils/retriable.rs +0 -0
- {cocoindex-0.1.22 → cocoindex-0.1.23}/src/utils/yaml_ser.rs +0 -0
@@ -533,7 +533,7 @@ dependencies = [
|
|
533
533
|
|
534
534
|
[[package]]
|
535
535
|
name = "cocoindex"
|
536
|
-
version = "0.1.
|
536
|
+
version = "0.1.23"
|
537
537
|
dependencies = [
|
538
538
|
"anyhow",
|
539
539
|
"async-openai",
|
@@ -568,7 +568,7 @@ dependencies = [
|
|
568
568
|
"pyo3-async-runtimes",
|
569
569
|
"pythonize",
|
570
570
|
"qdrant-client",
|
571
|
-
"rand 0.9.
|
571
|
+
"rand 0.9.1",
|
572
572
|
"regex",
|
573
573
|
"reqwest",
|
574
574
|
"rustls",
|
@@ -2697,7 +2697,7 @@ checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc"
|
|
2697
2697
|
dependencies = [
|
2698
2698
|
"bytes",
|
2699
2699
|
"getrandom 0.3.2",
|
2700
|
-
"rand 0.9.
|
2700
|
+
"rand 0.9.1",
|
2701
2701
|
"ring",
|
2702
2702
|
"rustc-hash 2.1.1",
|
2703
2703
|
"rustls",
|
@@ -2751,13 +2751,12 @@ dependencies = [
|
|
2751
2751
|
|
2752
2752
|
[[package]]
|
2753
2753
|
name = "rand"
|
2754
|
-
version = "0.9.
|
2754
|
+
version = "0.9.1"
|
2755
2755
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2756
|
-
checksum = "
|
2756
|
+
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
|
2757
2757
|
dependencies = [
|
2758
2758
|
"rand_chacha 0.9.0",
|
2759
2759
|
"rand_core 0.9.3",
|
2760
|
-
"zerocopy 0.8.24",
|
2761
2760
|
]
|
2762
2761
|
|
2763
2762
|
[[package]]
|
@@ -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.
|
5
|
+
version = "0.1.23"
|
6
6
|
edition = "2021"
|
7
7
|
|
8
8
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: cocoindex-neo4j
|
2
|
+
services:
|
3
|
+
neo4j:
|
4
|
+
image: neo4j:5-enterprise
|
5
|
+
volumes:
|
6
|
+
- /$HOME/neo4j/logs:/logs
|
7
|
+
- /$HOME/neo4j/config:/config
|
8
|
+
- /$HOME/neo4j/data:/data
|
9
|
+
- /$HOME/neo4j/plugins:/plugins
|
10
|
+
environment:
|
11
|
+
- NEO4J_AUTH=neo4j/cocoindex
|
12
|
+
- NEO4J_PLUGINS='["graph-data-science"]'
|
13
|
+
- NEO4J_ACCEPT_LICENSE_AGREEMENT=eval
|
14
|
+
|
15
|
+
# Uncomment to enable query logging
|
16
|
+
# - NEO4J_db_logs_query_enabled=VERBOSE
|
17
|
+
# - NEO4J_db_logs_query_transaction_enabled=VERBOSE
|
18
|
+
# - NEO4J_db_logs_query_parameter__logging__enabled=true
|
19
|
+
# - NEO4J_dbms_logs_http_enabled=true
|
20
|
+
# - NEO4J_server_logs_debug_enabled=true
|
21
|
+
|
22
|
+
ports:
|
23
|
+
- "7474:7474"
|
24
|
+
- "7687:7687"
|
25
|
+
restart: always
|
@@ -96,35 +96,35 @@ def docs_to_kg_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.D
|
|
96
96
|
"document_node",
|
97
97
|
cocoindex.storages.Neo4j(
|
98
98
|
connection=conn_spec,
|
99
|
-
mapping=cocoindex.storages.
|
99
|
+
mapping=cocoindex.storages.GraphNode(label="Document")),
|
100
100
|
primary_key_fields=["filename"],
|
101
101
|
)
|
102
102
|
entity_relationship.export(
|
103
103
|
"entity_relationship",
|
104
104
|
cocoindex.storages.Neo4j(
|
105
105
|
connection=conn_spec,
|
106
|
-
mapping=cocoindex.storages.
|
106
|
+
mapping=cocoindex.storages.GraphRelationship(
|
107
107
|
rel_type="RELATIONSHIP",
|
108
|
-
source=cocoindex.storages.
|
108
|
+
source=cocoindex.storages.GraphRelationshipEnd(
|
109
109
|
label="Entity",
|
110
110
|
fields=[
|
111
|
-
cocoindex.storages.
|
111
|
+
cocoindex.storages.GraphFieldMapping(
|
112
112
|
field_name="subject", node_field_name="value"),
|
113
|
-
cocoindex.storages.
|
113
|
+
cocoindex.storages.GraphFieldMapping(
|
114
114
|
field_name="subject_embedding", node_field_name="embedding"),
|
115
115
|
]
|
116
116
|
),
|
117
|
-
target=cocoindex.storages.
|
117
|
+
target=cocoindex.storages.GraphRelationshipEnd(
|
118
118
|
label="Entity",
|
119
119
|
fields=[
|
120
|
-
cocoindex.storages.
|
120
|
+
cocoindex.storages.GraphFieldMapping(
|
121
121
|
field_name="object", node_field_name="value"),
|
122
|
-
cocoindex.storages.
|
122
|
+
cocoindex.storages.GraphFieldMapping(
|
123
123
|
field_name="object_embedding", node_field_name="embedding"),
|
124
124
|
]
|
125
125
|
),
|
126
126
|
nodes={
|
127
|
-
"Entity": cocoindex.storages.
|
127
|
+
"Entity": cocoindex.storages.GraphRelationshipNode(
|
128
128
|
primary_key_fields=["value"],
|
129
129
|
vector_indexes=[
|
130
130
|
cocoindex.VectorIndexDef(
|
@@ -142,15 +142,15 @@ def docs_to_kg_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.D
|
|
142
142
|
"entity_mention",
|
143
143
|
cocoindex.storages.Neo4j(
|
144
144
|
connection=conn_spec,
|
145
|
-
mapping=cocoindex.storages.
|
145
|
+
mapping=cocoindex.storages.GraphRelationship(
|
146
146
|
rel_type="MENTION",
|
147
|
-
source=cocoindex.storages.
|
147
|
+
source=cocoindex.storages.GraphRelationshipEnd(
|
148
148
|
label="Document",
|
149
|
-
fields=[cocoindex.storages.
|
149
|
+
fields=[cocoindex.storages.GraphFieldMapping("filename")],
|
150
150
|
),
|
151
|
-
target=cocoindex.storages.
|
151
|
+
target=cocoindex.storages.GraphRelationshipEnd(
|
152
152
|
label="Entity",
|
153
|
-
fields=[cocoindex.storages.
|
153
|
+
fields=[cocoindex.storages.GraphFieldMapping(
|
154
154
|
field_name="entity", node_field_name="value")],
|
155
155
|
),
|
156
156
|
),
|
@@ -5,6 +5,9 @@ import sentence_transformers
|
|
5
5
|
from .typing import Float32, Vector, TypeAttr
|
6
6
|
from . import op, llm
|
7
7
|
|
8
|
+
class ParseJson(op.FunctionSpec):
|
9
|
+
"""Parse a text into a JSON object."""
|
10
|
+
|
8
11
|
class SplitRecursively(op.FunctionSpec):
|
9
12
|
"""Split a document (in string) recursively."""
|
10
13
|
|
@@ -29,7 +29,7 @@ class Neo4jConnection:
|
|
29
29
|
db: str | None = None
|
30
30
|
|
31
31
|
@dataclass
|
32
|
-
class
|
32
|
+
class GraphFieldMapping:
|
33
33
|
"""Mapping for a Neo4j field."""
|
34
34
|
field_name: str
|
35
35
|
# Field name for the node in the Knowledge Graph.
|
@@ -37,36 +37,36 @@ class Neo4jFieldMapping:
|
|
37
37
|
node_field_name: str | None = None
|
38
38
|
|
39
39
|
@dataclass
|
40
|
-
class
|
40
|
+
class GraphRelationshipEnd:
|
41
41
|
"""Spec for a Neo4j node type."""
|
42
42
|
label: str
|
43
|
-
fields: list[
|
43
|
+
fields: list[GraphFieldMapping]
|
44
44
|
|
45
45
|
@dataclass
|
46
|
-
class
|
46
|
+
class GraphRelationshipNode:
|
47
47
|
"""Spec for a Neo4j node type."""
|
48
48
|
primary_key_fields: Sequence[str]
|
49
49
|
vector_indexes: Sequence[index.VectorIndexDef] = ()
|
50
50
|
|
51
51
|
@dataclass
|
52
|
-
class
|
52
|
+
class GraphNode:
|
53
53
|
"""Spec for a Neo4j node type."""
|
54
54
|
kind = "Node"
|
55
55
|
|
56
56
|
label: str
|
57
57
|
|
58
58
|
@dataclass
|
59
|
-
class
|
59
|
+
class GraphRelationship:
|
60
60
|
"""Spec for a Neo4j relationship."""
|
61
61
|
kind = "Relationship"
|
62
62
|
|
63
63
|
rel_type: str
|
64
|
-
source:
|
65
|
-
target:
|
66
|
-
nodes: dict[str,
|
64
|
+
source: GraphRelationshipEnd
|
65
|
+
target: GraphRelationshipEnd
|
66
|
+
nodes: dict[str, GraphRelationshipNode] | None = None
|
67
67
|
|
68
68
|
class Neo4j(op.StorageSpec):
|
69
69
|
"""Graph storage powered by Neo4j."""
|
70
70
|
|
71
71
|
connection: AuthEntryReference
|
72
|
-
mapping:
|
72
|
+
mapping: GraphNode | GraphRelationship
|
@@ -183,11 +183,7 @@ def _encode_type(type_info: AnalyzedTypeInfo) -> dict[str, Any]:
|
|
183
183
|
if type_info.elem_type is None:
|
184
184
|
raise ValueError(f"{type_info.kind} type must have an element type")
|
185
185
|
row_type_info = analyze_type_info(type_info.elem_type)
|
186
|
-
|
187
|
-
raise ValueError(f"{type_info.kind} type must have a dataclass type")
|
188
|
-
encoded_type['row'] = {
|
189
|
-
'fields': _encode_fields_schema(row_type_info.dataclass_type),
|
190
|
-
}
|
186
|
+
encoded_type['row'] = _encode_type(row_type_info)
|
191
187
|
|
192
188
|
return encoded_type
|
193
189
|
|
@@ -714,6 +714,9 @@ impl AnalyzerContext<'_> {
|
|
714
714
|
.data
|
715
715
|
.add_field(reactive_op.name.clone(), &output_type)?;
|
716
716
|
let reactive_op = reactive_op.clone();
|
717
|
+
let logic_fingerprinter = Fingerprinter::default()
|
718
|
+
.with(&op.op)?
|
719
|
+
.with(&output_type.without_attrs())?;
|
717
720
|
async move {
|
718
721
|
trace!("Start building executor for transform op `{}`", reactive_op.name);
|
719
722
|
let executor = executor.await.with_context(|| {
|
@@ -725,11 +728,8 @@ impl AnalyzerContext<'_> {
|
|
725
728
|
let function_exec_info = AnalyzedFunctionExecInfo {
|
726
729
|
enable_cache,
|
727
730
|
behavior_version,
|
728
|
-
fingerprinter:
|
729
|
-
.with(&
|
730
|
-
.with(&reactive_op.spec)?
|
731
|
-
.with(&behavior_version)?
|
732
|
-
.with(&output_type.without_attrs())?,
|
731
|
+
fingerprinter: logic_fingerprinter
|
732
|
+
.with(&behavior_version)?,
|
733
733
|
output_type: output_type.typ.clone(),
|
734
734
|
};
|
735
735
|
if function_exec_info.enable_cache
|
@@ -58,7 +58,7 @@ pub struct TrackingTableSetupStatusCheck {
|
|
58
58
|
|
59
59
|
pub legacy_table_names: Vec<String>,
|
60
60
|
|
61
|
-
pub
|
61
|
+
pub min_existing_version_id: Option<i32>,
|
62
62
|
pub source_ids_to_delete: Vec<i32>,
|
63
63
|
}
|
64
64
|
|
@@ -75,7 +75,10 @@ impl TrackingTableSetupStatusCheck {
|
|
75
75
|
.into_iter()
|
76
76
|
.cloned()
|
77
77
|
.collect(),
|
78
|
-
|
78
|
+
min_existing_version_id: existing
|
79
|
+
.always_exists()
|
80
|
+
.then(|| existing.possible_versions().map(|v| v.version_id).min())
|
81
|
+
.flatten(),
|
79
82
|
source_ids_to_delete,
|
80
83
|
}
|
81
84
|
}
|
@@ -102,7 +105,7 @@ impl ResourceSetupStatusCheck for TrackingTableSetupStatusCheck {
|
|
102
105
|
self.legacy_table_names.join(", ")
|
103
106
|
));
|
104
107
|
}
|
105
|
-
match (self.
|
108
|
+
match (self.min_existing_version_id, &self.desired_state) {
|
106
109
|
(None, Some(state)) => {
|
107
110
|
changes.push(format!("Create the tracking table: {}. ", state.table_name))
|
108
111
|
}
|
@@ -131,7 +134,7 @@ impl ResourceSetupStatusCheck for TrackingTableSetupStatusCheck {
|
|
131
134
|
}
|
132
135
|
|
133
136
|
fn change_type(&self) -> SetupChangeType {
|
134
|
-
match (self.
|
137
|
+
match (self.min_existing_version_id, &self.desired_state) {
|
135
138
|
(None, Some(_)) => SetupChangeType::Create,
|
136
139
|
(Some(min_version_id), Some(desired)) => {
|
137
140
|
if min_version_id == desired.version_id && self.legacy_table_names.is_empty() {
|
@@ -158,11 +161,11 @@ impl ResourceSetupStatusCheck for TrackingTableSetupStatusCheck {
|
|
158
161
|
sqlx::query(&query).execute(pool).await?;
|
159
162
|
}
|
160
163
|
|
161
|
-
if self.
|
164
|
+
if self.min_existing_version_id != Some(desired.version_id) {
|
162
165
|
upgrade_tracking_table(
|
163
166
|
pool,
|
164
167
|
&desired.table_name,
|
165
|
-
self.
|
168
|
+
self.min_existing_version_id.unwrap_or(0),
|
166
169
|
desired.version_id,
|
167
170
|
)
|
168
171
|
.await?;
|
@@ -0,0 +1,104 @@
|
|
1
|
+
use crate::ops::sdk::*;
|
2
|
+
use anyhow::Result;
|
3
|
+
use std::collections::HashMap;
|
4
|
+
use std::sync::{Arc, LazyLock};
|
5
|
+
use unicase::UniCase;
|
6
|
+
|
7
|
+
pub struct Args {
|
8
|
+
text: ResolvedOpArg,
|
9
|
+
language: Option<ResolvedOpArg>,
|
10
|
+
}
|
11
|
+
|
12
|
+
type ParseFn = fn(&str) -> Result<serde_json::Value>;
|
13
|
+
struct LanguageConfig {
|
14
|
+
parse_fn: ParseFn,
|
15
|
+
}
|
16
|
+
|
17
|
+
fn add_language<'a>(
|
18
|
+
output: &'a mut HashMap<UniCase<&'static str>, Arc<LanguageConfig>>,
|
19
|
+
name: &'static str,
|
20
|
+
aliases: impl IntoIterator<Item = &'static str>,
|
21
|
+
parse_fn: ParseFn,
|
22
|
+
) {
|
23
|
+
let lang_config = Arc::new(LanguageConfig { parse_fn });
|
24
|
+
for name in std::iter::once(name).chain(aliases.into_iter()) {
|
25
|
+
if output.insert(name.into(), lang_config.clone()).is_some() {
|
26
|
+
panic!("Language `{name}` already exists");
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
fn parse_json(text: &str) -> Result<serde_json::Value> {
|
32
|
+
Ok(serde_json::from_str(text)?)
|
33
|
+
}
|
34
|
+
|
35
|
+
static PARSE_FN_BY_LANG: LazyLock<HashMap<UniCase<&'static str>, Arc<LanguageConfig>>> =
|
36
|
+
LazyLock::new(|| {
|
37
|
+
let mut map = HashMap::new();
|
38
|
+
add_language(&mut map, "json", [".json"], parse_json);
|
39
|
+
map
|
40
|
+
});
|
41
|
+
|
42
|
+
struct Executor {
|
43
|
+
args: Args,
|
44
|
+
}
|
45
|
+
|
46
|
+
#[async_trait]
|
47
|
+
impl SimpleFunctionExecutor for Executor {
|
48
|
+
async fn evaluate(&self, input: Vec<value::Value>) -> Result<value::Value> {
|
49
|
+
let text = self.args.text.value(&input)?.as_str()?;
|
50
|
+
let lang_config = {
|
51
|
+
let language = self.args.language.value(&input)?;
|
52
|
+
language
|
53
|
+
.optional()
|
54
|
+
.map(|v| anyhow::Ok(v.as_str()?.as_ref()))
|
55
|
+
.transpose()?
|
56
|
+
.and_then(|lang| PARSE_FN_BY_LANG.get(&UniCase::new(lang)))
|
57
|
+
};
|
58
|
+
let parse_fn = lang_config.map(|c| c.parse_fn).unwrap_or(parse_json);
|
59
|
+
let parsed_value = parse_fn(text)?;
|
60
|
+
Ok(value::Value::Basic(value::BasicValue::Json(Arc::new(
|
61
|
+
parsed_value,
|
62
|
+
))))
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
pub struct Factory;
|
67
|
+
|
68
|
+
#[async_trait]
|
69
|
+
impl SimpleFunctionFactoryBase for Factory {
|
70
|
+
type Spec = EmptySpec;
|
71
|
+
type ResolvedArgs = Args;
|
72
|
+
|
73
|
+
fn name(&self) -> &str {
|
74
|
+
"ParseJson"
|
75
|
+
}
|
76
|
+
|
77
|
+
fn resolve_schema(
|
78
|
+
&self,
|
79
|
+
_spec: &EmptySpec,
|
80
|
+
args_resolver: &mut OpArgsResolver<'_>,
|
81
|
+
_context: &FlowInstanceContext,
|
82
|
+
) -> Result<(Args, EnrichedValueType)> {
|
83
|
+
let args = Args {
|
84
|
+
text: args_resolver
|
85
|
+
.next_arg("text")?
|
86
|
+
.expect_type(&ValueType::Basic(BasicValueType::Str))?,
|
87
|
+
language: args_resolver
|
88
|
+
.next_optional_arg("language")?
|
89
|
+
.expect_type(&ValueType::Basic(BasicValueType::Str))?,
|
90
|
+
};
|
91
|
+
|
92
|
+
let output_schema = make_output_type(BasicValueType::Json);
|
93
|
+
Ok((args, output_schema))
|
94
|
+
}
|
95
|
+
|
96
|
+
async fn build_executor(
|
97
|
+
self: Arc<Self>,
|
98
|
+
_spec: EmptySpec,
|
99
|
+
args: Args,
|
100
|
+
_context: Arc<FlowInstanceContext>,
|
101
|
+
) -> Result<Box<dyn SimpleFunctionExecutor>> {
|
102
|
+
Ok(Box::new(Executor { args }))
|
103
|
+
}
|
104
|
+
}
|
@@ -9,6 +9,7 @@ fn register_executor_factories(registry: &mut ExecutorFactoryRegistry) -> Result
|
|
9
9
|
sources::local_file::Factory.register(registry)?;
|
10
10
|
sources::google_drive::Factory.register(registry)?;
|
11
11
|
|
12
|
+
functions::parse_json::Factory.register(registry)?;
|
12
13
|
functions::split_recursively::Factory.register(registry)?;
|
13
14
|
functions::extract_by_llm::Factory.register(registry)?;
|
14
15
|
|