graphiti-core 0.30.0rc2__tar.gz → 0.30.0rc4__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.
Potentially problematic release.
This version of graphiti-core might be problematic. Click here for more details.
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/PKG-INFO +1 -1
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/dedupe_nodes.py +42 -26
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/maintenance/edge_operations.py +20 -5
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/pyproject.toml +1 -1
- graphiti_core-0.30.0rc4/tests/utils/maintenance/test_edge_operations.py +291 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/uv.lock +1 -1
- graphiti_core-0.30.0rc2/poetry.lock +0 -5627
- graphiti_core-0.30.0rc2/tests/utils/maintenance/test_edge_operations.py +0 -144
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.env.example +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/dependabot.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/pull_request_template.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/secret_scanning.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/workflows/ai-moderator.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/workflows/cla.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/workflows/claude-code-review.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/workflows/claude.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/workflows/codeql.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/workflows/lint.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/workflows/mcp-server-docker.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/workflows/release-graphiti-core.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/workflows/typecheck.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.github/workflows/unit_tests.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/.gitignore +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/AGENTS.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/CLAUDE.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/CODE_OF_CONDUCT.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/CONTRIBUTING.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/Dockerfile +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/LICENSE +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/Makefile +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/README.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/SECURITY.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/Zep-CLA.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/conftest.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/depot.json +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/docker-compose.test.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/docker-compose.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/ellipsis.yaml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/data/manybirds_products.json +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/ecommerce/runner.ipynb +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/ecommerce/runner.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/langgraph-agent/agent.ipynb +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/langgraph-agent/tinybirds-jess.png +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/podcast/podcast_runner.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/podcast/podcast_transcript.txt +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/podcast/transcript_parser.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/quickstart/README.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/quickstart/quickstart_falkordb.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/quickstart/quickstart_neo4j.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/quickstart/quickstart_neptune.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/quickstart/requirements.txt +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/wizard_of_oz/parser.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/wizard_of_oz/runner.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/examples/wizard_of_oz/woo.txt +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/cross_encoder/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/cross_encoder/bge_reranker_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/cross_encoder/client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/cross_encoder/gemini_reranker_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/cross_encoder/openai_reranker_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/driver/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/driver/driver.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/driver/falkordb_driver.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/driver/kuzu_driver.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/driver/neo4j_driver.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/driver/neptune_driver.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/edges.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/embedder/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/embedder/azure_openai.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/embedder/client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/embedder/gemini.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/embedder/openai.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/embedder/voyage.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/errors.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/graph_queries.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/graphiti.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/graphiti_types.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/helpers.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/anthropic_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/azure_openai_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/config.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/errors.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/gemini_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/groq_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/openai_base_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/openai_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/openai_generic_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/llm_client/utils.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/migrations/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/models/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/models/edges/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/models/edges/edge_db_queries.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/models/nodes/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/models/nodes/node_db_queries.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/nodes.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/dedupe_edges.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/eval.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/extract_edge_dates.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/extract_edges.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/extract_nodes.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/invalidate_edges.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/lib.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/models.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/prompt_helpers.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/prompts/summarize_nodes.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/py.typed +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/search/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/search/search.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/search/search_config.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/search/search_config_recipes.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/search/search_filters.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/search/search_helpers.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/search/search_utils.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/telemetry/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/telemetry/telemetry.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/bulk_utils.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/datetime_utils.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/maintenance/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/maintenance/community_operations.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/maintenance/dedup_helpers.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/maintenance/graph_data_operations.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/maintenance/node_operations.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/maintenance/temporal_operations.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/maintenance/utils.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/graphiti_core/utils/ontology_utils/entity_types_utils.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/images/arxiv-screenshot.png +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/images/graphiti-graph-intro.gif +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/images/graphiti-intro-slides-stock-2.gif +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/images/simple_graph.svg +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/.env.example +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/.python-version +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/Dockerfile +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/README.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/cursor_rules.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/docker-compose.yml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/graphiti_mcp_server.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/mcp_config_sse_example.json +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/mcp_config_stdio_example.json +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/pyproject.toml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/mcp_server/uv.lock +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/py.typed +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/pytest.ini +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/.env.example +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/Makefile +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/README.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/config.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/dto/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/dto/common.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/dto/ingest.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/dto/retrieve.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/main.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/routers/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/routers/ingest.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/routers/retrieve.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/graph_service/zep_graphiti.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/pyproject.toml +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/server/uv.lock +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/signatures/version1/cla.json +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/cross_encoder/test_bge_reranker_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/cross_encoder/test_gemini_reranker_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/driver/__init__.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/driver/test_falkordb_driver.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/embedder/embedder_fixtures.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/embedder/test_gemini.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/embedder/test_openai.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/embedder/test_voyage.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/evals/data/longmemeval_data/README.md +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/evals/data/longmemeval_data/longmemeval_oracle.json +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/evals/eval_cli.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/evals/eval_e2e_graph_building.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/evals/pytest.ini +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/evals/utils.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/helpers_test.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/llm_client/test_anthropic_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/llm_client/test_anthropic_client_int.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/llm_client/test_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/llm_client/test_errors.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/llm_client/test_gemini_client.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/test_edge_int.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/test_entity_exclusion_int.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/test_graphiti_int.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/test_graphiti_mock.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/test_node_int.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/utils/maintenance/test_bulk_utils.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/utils/maintenance/test_node_operations.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/utils/maintenance/test_temporal_operations_int.py +0 -0
- {graphiti_core-0.30.0rc2 → graphiti_core-0.30.0rc4}/tests/utils/search/search_utils_test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graphiti-core
|
|
3
|
-
Version: 0.30.
|
|
3
|
+
Version: 0.30.0rc4
|
|
4
4
|
Summary: A temporal graph building library
|
|
5
5
|
Project-URL: Homepage, https://help.getzep.com/graphiti/graphiti/overview
|
|
6
6
|
Project-URL: Repository, https://github.com/getzep/graphiti
|
|
@@ -92,12 +92,23 @@ def node(context: dict[str, Any]) -> list[Message]:
|
|
|
92
92
|
|
|
93
93
|
TASK:
|
|
94
94
|
1. Compare `new_entity` against each item in `existing_entities`.
|
|
95
|
-
2. If it refers to the same real
|
|
96
|
-
3. Let `duplicate_idx` = the
|
|
97
|
-
4. Let `duplicates` = the list of
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
2. If it refers to the same real-world object or concept, collect its index.
|
|
96
|
+
3. Let `duplicate_idx` = the smallest collected index, or -1 if none.
|
|
97
|
+
4. Let `duplicates` = the sorted list of all collected indices (empty list if none).
|
|
98
|
+
|
|
99
|
+
Respond with a JSON object containing an "entity_resolutions" array with a single entry:
|
|
100
|
+
{{
|
|
101
|
+
"entity_resolutions": [
|
|
102
|
+
{{
|
|
103
|
+
"id": integer id from NEW ENTITY,
|
|
104
|
+
"name": the best full name for the entity,
|
|
105
|
+
"duplicate_idx": integer index of the best duplicate in EXISTING ENTITIES, or -1 if none,
|
|
106
|
+
"duplicates": sorted list of all duplicate indices you collected (deduplicate the list, use [] when none)
|
|
107
|
+
}}
|
|
108
|
+
]
|
|
109
|
+
}}
|
|
110
|
+
|
|
111
|
+
Only reference indices that appear in EXISTING ENTITIES, and return [] / -1 when unsure.
|
|
101
112
|
""",
|
|
102
113
|
),
|
|
103
114
|
]
|
|
@@ -126,26 +137,26 @@ def nodes(context: dict[str, Any]) -> list[Message]:
|
|
|
126
137
|
{{
|
|
127
138
|
id: integer id of the entity,
|
|
128
139
|
name: "name of the entity",
|
|
129
|
-
entity_type: "
|
|
130
|
-
entity_type_description: "Description of what the entity type represents"
|
|
131
|
-
duplication_candidates: [
|
|
132
|
-
{{
|
|
133
|
-
idx: integer index of the candidate entity,
|
|
134
|
-
name: "name of the candidate entity",
|
|
135
|
-
entity_type: "ontological classification of the candidate entity",
|
|
136
|
-
...<additional attributes>
|
|
137
|
-
}}
|
|
138
|
-
]
|
|
140
|
+
entity_type: ["Entity", "<optional additional label>", ...],
|
|
141
|
+
entity_type_description: "Description of what the entity type represents"
|
|
139
142
|
}}
|
|
140
|
-
|
|
143
|
+
|
|
141
144
|
<ENTITIES>
|
|
142
145
|
{to_prompt_json(context['extracted_nodes'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
|
|
143
146
|
</ENTITIES>
|
|
144
|
-
|
|
147
|
+
|
|
145
148
|
<EXISTING ENTITIES>
|
|
146
149
|
{to_prompt_json(context['existing_nodes'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
|
|
147
150
|
</EXISTING ENTITIES>
|
|
148
151
|
|
|
152
|
+
Each entry in EXISTING ENTITIES is an object with the following structure:
|
|
153
|
+
{{
|
|
154
|
+
idx: integer index of the candidate entity (use this when referencing a duplicate),
|
|
155
|
+
name: "name of the candidate entity",
|
|
156
|
+
entity_types: ["Entity", "<optional additional label>", ...],
|
|
157
|
+
...<additional attributes such as summaries or metadata>
|
|
158
|
+
}}
|
|
159
|
+
|
|
149
160
|
For each of the above ENTITIES, determine if the entity is a duplicate of any of the EXISTING ENTITIES.
|
|
150
161
|
|
|
151
162
|
Entities should only be considered duplicates if they refer to the *same real-world object or concept*.
|
|
@@ -155,14 +166,19 @@ def nodes(context: dict[str, Any]) -> list[Message]:
|
|
|
155
166
|
- They have similar names or purposes but refer to separate instances or concepts.
|
|
156
167
|
|
|
157
168
|
Task:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
For
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
169
|
+
Respond with a JSON object that contains an "entity_resolutions" array with one entry for each entity in ENTITIES, ordered by the entity id.
|
|
170
|
+
|
|
171
|
+
For every entity, return an object with the following keys:
|
|
172
|
+
{{
|
|
173
|
+
"id": integer id from ENTITIES,
|
|
174
|
+
"name": the best full name for the entity (preserve the original name unless a duplicate has a more complete name),
|
|
175
|
+
"duplicate_idx": the idx of the EXISTING ENTITY that is the best duplicate match, or -1 if there is no duplicate,
|
|
176
|
+
"duplicates": a sorted list of all idx values from EXISTING ENTITIES that refer to duplicates (deduplicate the list, use [] when none or unsure)
|
|
177
|
+
}}
|
|
178
|
+
|
|
179
|
+
- Only use idx values that appear in EXISTING ENTITIES.
|
|
180
|
+
- Set duplicate_idx to the smallest idx you collected for that entity, or -1 if duplicates is empty.
|
|
181
|
+
- Never fabricate entities or indices.
|
|
166
182
|
""",
|
|
167
183
|
),
|
|
168
184
|
]
|
|
@@ -43,6 +43,8 @@ from graphiti_core.search.search_filters import SearchFilters
|
|
|
43
43
|
from graphiti_core.utils.datetime_utils import ensure_utc, utc_now
|
|
44
44
|
from graphiti_core.utils.maintenance.dedup_helpers import _normalize_string_exact
|
|
45
45
|
|
|
46
|
+
DEFAULT_EDGE_NAME = 'RELATES_TO'
|
|
47
|
+
|
|
46
48
|
logger = logging.getLogger(__name__)
|
|
47
49
|
|
|
48
50
|
|
|
@@ -310,6 +312,15 @@ async def resolve_extracted_edges(
|
|
|
310
312
|
|
|
311
313
|
edge_types_lst.append(extracted_edge_types)
|
|
312
314
|
|
|
315
|
+
for extracted_edge, extracted_edge_types in zip(extracted_edges, edge_types_lst, strict=True):
|
|
316
|
+
allowed_type_names = set(extracted_edge_types)
|
|
317
|
+
if not allowed_type_names:
|
|
318
|
+
if extracted_edge.name != DEFAULT_EDGE_NAME:
|
|
319
|
+
extracted_edge.name = DEFAULT_EDGE_NAME
|
|
320
|
+
continue
|
|
321
|
+
if extracted_edge.name not in allowed_type_names:
|
|
322
|
+
extracted_edge.name = DEFAULT_EDGE_NAME
|
|
323
|
+
|
|
313
324
|
# resolve edges with related edges in the graph and find invalidation candidates
|
|
314
325
|
results: list[tuple[EntityEdge, list[EntityEdge], list[EntityEdge]]] = list(
|
|
315
326
|
await semaphore_gather(
|
|
@@ -392,7 +403,7 @@ async def resolve_extracted_edge(
|
|
|
392
403
|
related_edges: list[EntityEdge],
|
|
393
404
|
existing_edges: list[EntityEdge],
|
|
394
405
|
episode: EpisodicNode,
|
|
395
|
-
|
|
406
|
+
edge_type_candidates: dict[str, type[BaseModel]] | None = None,
|
|
396
407
|
ensure_ascii: bool = True,
|
|
397
408
|
) -> tuple[EntityEdge, list[EntityEdge], list[EntityEdge]]:
|
|
398
409
|
if len(related_edges) == 0 and len(existing_edges) == 0:
|
|
@@ -429,9 +440,9 @@ async def resolve_extracted_edge(
|
|
|
429
440
|
'fact_type_name': type_name,
|
|
430
441
|
'fact_type_description': type_model.__doc__,
|
|
431
442
|
}
|
|
432
|
-
for i, (type_name, type_model) in enumerate(
|
|
443
|
+
for i, (type_name, type_model) in enumerate(edge_type_candidates.items())
|
|
433
444
|
]
|
|
434
|
-
if
|
|
445
|
+
if edge_type_candidates is not None
|
|
435
446
|
else []
|
|
436
447
|
)
|
|
437
448
|
|
|
@@ -468,7 +479,8 @@ async def resolve_extracted_edge(
|
|
|
468
479
|
]
|
|
469
480
|
|
|
470
481
|
fact_type: str = response_object.fact_type
|
|
471
|
-
|
|
482
|
+
candidate_type_names = set(edge_type_candidates or {})
|
|
483
|
+
if candidate_type_names and fact_type in candidate_type_names:
|
|
472
484
|
resolved_edge.name = fact_type
|
|
473
485
|
|
|
474
486
|
edge_attributes_context = {
|
|
@@ -478,7 +490,7 @@ async def resolve_extracted_edge(
|
|
|
478
490
|
'ensure_ascii': ensure_ascii,
|
|
479
491
|
}
|
|
480
492
|
|
|
481
|
-
edge_model =
|
|
493
|
+
edge_model = edge_type_candidates.get(fact_type) if edge_type_candidates else None
|
|
482
494
|
if edge_model is not None and len(edge_model.model_fields) != 0:
|
|
483
495
|
edge_attributes_response = await llm_client.generate_response(
|
|
484
496
|
prompt_library.extract_edges.extract_attributes(edge_attributes_context),
|
|
@@ -487,6 +499,9 @@ async def resolve_extracted_edge(
|
|
|
487
499
|
)
|
|
488
500
|
|
|
489
501
|
resolved_edge.attributes = edge_attributes_response
|
|
502
|
+
elif fact_type.upper() != 'DEFAULT':
|
|
503
|
+
resolved_edge.name = DEFAULT_EDGE_NAME
|
|
504
|
+
resolved_edge.attributes = {}
|
|
490
505
|
|
|
491
506
|
end = time()
|
|
492
507
|
logger.debug(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "graphiti-core"
|
|
3
3
|
description = "A temporal graph building library"
|
|
4
|
-
version = "0.30.
|
|
4
|
+
version = "0.30.0pre4"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Paul Paliychuk", email = "paul@getzep.com" },
|
|
7
7
|
{ name = "Preston Rasmussen", email = "preston@getzep.com" },
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
from datetime import datetime, timedelta, timezone
|
|
2
|
+
from unittest.mock import AsyncMock, MagicMock
|
|
3
|
+
|
|
4
|
+
import pytest
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
from graphiti_core.edges import EntityEdge
|
|
8
|
+
from graphiti_core.graphiti_types import GraphitiClients
|
|
9
|
+
from graphiti_core.nodes import EntityNode, EpisodicNode
|
|
10
|
+
from graphiti_core.search.search_config import SearchResults
|
|
11
|
+
from graphiti_core.utils.maintenance.edge_operations import (
|
|
12
|
+
DEFAULT_EDGE_NAME,
|
|
13
|
+
resolve_extracted_edge,
|
|
14
|
+
resolve_extracted_edges,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@pytest.fixture
|
|
19
|
+
def mock_llm_client():
|
|
20
|
+
client = MagicMock()
|
|
21
|
+
client.generate_response = AsyncMock()
|
|
22
|
+
return client
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@pytest.fixture
|
|
26
|
+
def mock_extracted_edge():
|
|
27
|
+
return EntityEdge(
|
|
28
|
+
source_node_uuid='source_uuid',
|
|
29
|
+
target_node_uuid='target_uuid',
|
|
30
|
+
name='test_edge',
|
|
31
|
+
group_id='group_1',
|
|
32
|
+
fact='Test fact',
|
|
33
|
+
episodes=['episode_1'],
|
|
34
|
+
created_at=datetime.now(timezone.utc),
|
|
35
|
+
valid_at=None,
|
|
36
|
+
invalid_at=None,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@pytest.fixture
|
|
41
|
+
def mock_related_edges():
|
|
42
|
+
return [
|
|
43
|
+
EntityEdge(
|
|
44
|
+
source_node_uuid='source_uuid_2',
|
|
45
|
+
target_node_uuid='target_uuid_2',
|
|
46
|
+
name='related_edge',
|
|
47
|
+
group_id='group_1',
|
|
48
|
+
fact='Related fact',
|
|
49
|
+
episodes=['episode_2'],
|
|
50
|
+
created_at=datetime.now(timezone.utc) - timedelta(days=1),
|
|
51
|
+
valid_at=datetime.now(timezone.utc) - timedelta(days=1),
|
|
52
|
+
invalid_at=None,
|
|
53
|
+
)
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@pytest.fixture
|
|
58
|
+
def mock_existing_edges():
|
|
59
|
+
return [
|
|
60
|
+
EntityEdge(
|
|
61
|
+
source_node_uuid='source_uuid_3',
|
|
62
|
+
target_node_uuid='target_uuid_3',
|
|
63
|
+
name='existing_edge',
|
|
64
|
+
group_id='group_1',
|
|
65
|
+
fact='Existing fact',
|
|
66
|
+
episodes=['episode_3'],
|
|
67
|
+
created_at=datetime.now(timezone.utc) - timedelta(days=2),
|
|
68
|
+
valid_at=datetime.now(timezone.utc) - timedelta(days=2),
|
|
69
|
+
invalid_at=None,
|
|
70
|
+
)
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@pytest.fixture
|
|
75
|
+
def mock_current_episode():
|
|
76
|
+
return EpisodicNode(
|
|
77
|
+
uuid='episode_1',
|
|
78
|
+
content='Current episode content',
|
|
79
|
+
valid_at=datetime.now(timezone.utc),
|
|
80
|
+
name='Current Episode',
|
|
81
|
+
group_id='group_1',
|
|
82
|
+
source='message',
|
|
83
|
+
source_description='Test source description',
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@pytest.fixture
|
|
88
|
+
def mock_previous_episodes():
|
|
89
|
+
return [
|
|
90
|
+
EpisodicNode(
|
|
91
|
+
uuid='episode_2',
|
|
92
|
+
content='Previous episode content',
|
|
93
|
+
valid_at=datetime.now(timezone.utc) - timedelta(days=1),
|
|
94
|
+
name='Previous Episode',
|
|
95
|
+
group_id='group_1',
|
|
96
|
+
source='message',
|
|
97
|
+
source_description='Test source description',
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# Run the tests
|
|
103
|
+
if __name__ == '__main__':
|
|
104
|
+
pytest.main([__file__])
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@pytest.mark.asyncio
|
|
108
|
+
async def test_resolve_extracted_edge_exact_fact_short_circuit(
|
|
109
|
+
mock_llm_client,
|
|
110
|
+
mock_existing_edges,
|
|
111
|
+
mock_current_episode,
|
|
112
|
+
):
|
|
113
|
+
extracted = EntityEdge(
|
|
114
|
+
source_node_uuid='source_uuid',
|
|
115
|
+
target_node_uuid='target_uuid',
|
|
116
|
+
name='test_edge',
|
|
117
|
+
group_id='group_1',
|
|
118
|
+
fact='Related fact',
|
|
119
|
+
episodes=['episode_1'],
|
|
120
|
+
created_at=datetime.now(timezone.utc),
|
|
121
|
+
valid_at=None,
|
|
122
|
+
invalid_at=None,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
related_edges = [
|
|
126
|
+
EntityEdge(
|
|
127
|
+
source_node_uuid='source_uuid',
|
|
128
|
+
target_node_uuid='target_uuid',
|
|
129
|
+
name='related_edge',
|
|
130
|
+
group_id='group_1',
|
|
131
|
+
fact=' related FACT ',
|
|
132
|
+
episodes=['episode_2'],
|
|
133
|
+
created_at=datetime.now(timezone.utc) - timedelta(days=1),
|
|
134
|
+
valid_at=None,
|
|
135
|
+
invalid_at=None,
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
|
|
139
|
+
resolved_edge, duplicate_edges, invalidated = await resolve_extracted_edge(
|
|
140
|
+
mock_llm_client,
|
|
141
|
+
extracted,
|
|
142
|
+
related_edges,
|
|
143
|
+
mock_existing_edges,
|
|
144
|
+
mock_current_episode,
|
|
145
|
+
edge_type_candidates=None,
|
|
146
|
+
ensure_ascii=True,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
assert resolved_edge is related_edges[0]
|
|
150
|
+
assert resolved_edge.episodes.count(mock_current_episode.uuid) == 1
|
|
151
|
+
assert duplicate_edges == []
|
|
152
|
+
assert invalidated == []
|
|
153
|
+
mock_llm_client.generate_response.assert_not_called()
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
class OccurredAtEdge(BaseModel):
|
|
157
|
+
"""Edge model stub for OCCURRED_AT."""
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
@pytest.mark.asyncio
|
|
161
|
+
async def test_resolve_extracted_edges_resets_unmapped_names(monkeypatch):
|
|
162
|
+
from graphiti_core.utils.maintenance import edge_operations as edge_ops
|
|
163
|
+
|
|
164
|
+
monkeypatch.setattr(edge_ops, 'create_entity_edge_embeddings', AsyncMock(return_value=None))
|
|
165
|
+
monkeypatch.setattr(EntityEdge, 'get_between_nodes', AsyncMock(return_value=[]))
|
|
166
|
+
|
|
167
|
+
async def immediate_gather(*aws, max_coroutines=None):
|
|
168
|
+
return [await aw for aw in aws]
|
|
169
|
+
|
|
170
|
+
monkeypatch.setattr(edge_ops, 'semaphore_gather', immediate_gather)
|
|
171
|
+
monkeypatch.setattr(edge_ops, 'search', AsyncMock(return_value=SearchResults()))
|
|
172
|
+
|
|
173
|
+
llm_client = MagicMock()
|
|
174
|
+
llm_client.generate_response = AsyncMock(
|
|
175
|
+
return_value={'duplicate_facts': [], 'contradicted_facts': [], 'fact_type': 'DEFAULT'}
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
clients = GraphitiClients.model_construct(
|
|
179
|
+
driver=MagicMock(),
|
|
180
|
+
llm_client=llm_client,
|
|
181
|
+
embedder=MagicMock(),
|
|
182
|
+
cross_encoder=MagicMock(),
|
|
183
|
+
ensure_ascii=True,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
source_node = EntityNode(
|
|
187
|
+
uuid='source_uuid',
|
|
188
|
+
name='Document Node',
|
|
189
|
+
group_id='group_1',
|
|
190
|
+
labels=['Document'],
|
|
191
|
+
)
|
|
192
|
+
target_node = EntityNode(
|
|
193
|
+
uuid='target_uuid',
|
|
194
|
+
name='Topic Node',
|
|
195
|
+
group_id='group_1',
|
|
196
|
+
labels=['Topic'],
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
extracted_edge = EntityEdge(
|
|
200
|
+
source_node_uuid=source_node.uuid,
|
|
201
|
+
target_node_uuid=target_node.uuid,
|
|
202
|
+
name='OCCURRED_AT',
|
|
203
|
+
group_id='group_1',
|
|
204
|
+
fact='Document occurred at somewhere',
|
|
205
|
+
episodes=[],
|
|
206
|
+
created_at=datetime.now(timezone.utc),
|
|
207
|
+
valid_at=None,
|
|
208
|
+
invalid_at=None,
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
episode = EpisodicNode(
|
|
212
|
+
uuid='episode_uuid',
|
|
213
|
+
name='Episode',
|
|
214
|
+
group_id='group_1',
|
|
215
|
+
source='message',
|
|
216
|
+
source_description='desc',
|
|
217
|
+
content='Episode content',
|
|
218
|
+
valid_at=datetime.now(timezone.utc),
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
edge_types = {'OCCURRED_AT': OccurredAtEdge}
|
|
222
|
+
edge_type_map = {('Event', 'Entity'): ['OCCURRED_AT']}
|
|
223
|
+
|
|
224
|
+
resolved_edges, invalidated_edges = await resolve_extracted_edges(
|
|
225
|
+
clients,
|
|
226
|
+
[extracted_edge],
|
|
227
|
+
episode,
|
|
228
|
+
[source_node, target_node],
|
|
229
|
+
edge_types,
|
|
230
|
+
edge_type_map,
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
assert resolved_edges[0].name == DEFAULT_EDGE_NAME
|
|
234
|
+
assert invalidated_edges == []
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
@pytest.mark.asyncio
|
|
238
|
+
async def test_resolve_extracted_edge_rejects_unmapped_fact_type(mock_llm_client):
|
|
239
|
+
mock_llm_client.generate_response.return_value = {
|
|
240
|
+
'duplicate_facts': [],
|
|
241
|
+
'contradicted_facts': [],
|
|
242
|
+
'fact_type': 'OCCURRED_AT',
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
extracted_edge = EntityEdge(
|
|
246
|
+
source_node_uuid='source_uuid',
|
|
247
|
+
target_node_uuid='target_uuid',
|
|
248
|
+
name='OCCURRED_AT',
|
|
249
|
+
group_id='group_1',
|
|
250
|
+
fact='Document occurred at somewhere',
|
|
251
|
+
episodes=[],
|
|
252
|
+
created_at=datetime.now(timezone.utc),
|
|
253
|
+
valid_at=None,
|
|
254
|
+
invalid_at=None,
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
episode = EpisodicNode(
|
|
258
|
+
uuid='episode_uuid',
|
|
259
|
+
name='Episode',
|
|
260
|
+
group_id='group_1',
|
|
261
|
+
source='message',
|
|
262
|
+
source_description='desc',
|
|
263
|
+
content='Episode content',
|
|
264
|
+
valid_at=datetime.now(timezone.utc),
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
related_edge = EntityEdge(
|
|
268
|
+
source_node_uuid='alt_source',
|
|
269
|
+
target_node_uuid='alt_target',
|
|
270
|
+
name='OTHER',
|
|
271
|
+
group_id='group_1',
|
|
272
|
+
fact='Different fact',
|
|
273
|
+
episodes=[],
|
|
274
|
+
created_at=datetime.now(timezone.utc),
|
|
275
|
+
valid_at=None,
|
|
276
|
+
invalid_at=None,
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
resolved_edge, duplicates, invalidated = await resolve_extracted_edge(
|
|
280
|
+
mock_llm_client,
|
|
281
|
+
extracted_edge,
|
|
282
|
+
[related_edge],
|
|
283
|
+
[],
|
|
284
|
+
episode,
|
|
285
|
+
edge_type_candidates={},
|
|
286
|
+
ensure_ascii=True,
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
assert resolved_edge.name == DEFAULT_EDGE_NAME
|
|
290
|
+
assert duplicates == []
|
|
291
|
+
assert invalidated == []
|