graphiti-core 0.17.2__tar.gz → 0.17.3__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.17.2 → graphiti_core-0.17.3}/PKG-INFO +1 -1
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/embedder/gemini.py +25 -19
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/client.py +5 -5
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/gemini_client.py +13 -7
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/models/edges/edge_db_queries.py +3 -3
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/pyproject.toml +1 -1
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/embedder/test_gemini.py +3 -3
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/llm_client/test_gemini_client.py +3 -6
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/uv.lock +1 -1
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.env.example +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/dependabot.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/pull_request_template.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/secret_scanning.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/workflows/cla.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/workflows/claude-code-review.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/workflows/claude.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/workflows/codeql.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/workflows/lint.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/workflows/mcp-server-docker.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/workflows/release-graphiti-core.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/workflows/typecheck.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.github/workflows/unit_tests.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/.gitignore +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/CLAUDE.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/CODE_OF_CONDUCT.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/CONTRIBUTING.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/Dockerfile +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/LICENSE +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/Makefile +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/README.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/SECURITY.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/Zep-CLA.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/conftest.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/depot.json +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/docker-compose.test.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/docker-compose.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/ellipsis.yaml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/data/manybirds_products.json +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/ecommerce/runner.ipynb +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/ecommerce/runner.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/langgraph-agent/agent.ipynb +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/langgraph-agent/tinybirds-jess.png +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/podcast/podcast_runner.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/podcast/podcast_transcript.txt +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/podcast/transcript_parser.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/quickstart/README.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/quickstart/quickstart_falkordb.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/quickstart/quickstart_neo4j.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/quickstart/requirements.txt +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/wizard_of_oz/parser.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/wizard_of_oz/runner.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/examples/wizard_of_oz/woo.txt +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/cross_encoder/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/cross_encoder/bge_reranker_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/cross_encoder/client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/cross_encoder/gemini_reranker_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/cross_encoder/openai_reranker_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/driver/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/driver/driver.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/driver/falkordb_driver.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/driver/neo4j_driver.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/edges.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/embedder/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/embedder/azure_openai.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/embedder/client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/embedder/openai.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/embedder/voyage.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/errors.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/graph_queries.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/graphiti.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/graphiti_types.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/helpers.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/anthropic_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/azure_openai_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/config.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/errors.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/groq_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/openai_base_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/openai_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/openai_generic_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/utils.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/models/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/models/edges/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/models/nodes/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/models/nodes/node_db_queries.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/nodes.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/dedupe_edges.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/dedupe_nodes.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/eval.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/extract_edge_dates.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/extract_edges.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/extract_nodes.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/invalidate_edges.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/lib.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/models.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/prompt_helpers.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/prompts/summarize_nodes.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/py.typed +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/search/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/search/search.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/search/search_config.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/search/search_config_recipes.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/search/search_filters.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/search/search_helpers.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/search/search_utils.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/telemetry/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/telemetry/telemetry.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/bulk_utils.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/datetime_utils.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/maintenance/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/maintenance/community_operations.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/maintenance/edge_operations.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/maintenance/graph_data_operations.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/maintenance/node_operations.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/maintenance/temporal_operations.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/maintenance/utils.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/ontology_utils/entity_types_utils.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/images/arxiv-screenshot.png +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/images/graphiti-graph-intro.gif +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/images/graphiti-intro-slides-stock-2.gif +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/images/simple_graph.svg +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/.env.example +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/.python-version +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/Dockerfile +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/README.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/cursor_rules.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/docker-compose.yml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/graphiti_mcp_server.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/mcp_config_sse_example.json +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/mcp_config_stdio_example.json +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/pyproject.toml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/mcp_server/uv.lock +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/poetry.lock +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/py.typed +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/pytest.ini +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/.env.example +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/Makefile +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/README.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/config.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/dto/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/dto/common.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/dto/ingest.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/dto/retrieve.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/main.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/routers/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/routers/ingest.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/routers/retrieve.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/graph_service/zep_graphiti.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/pyproject.toml +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/server/uv.lock +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/signatures/version1/cla.json +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/cross_encoder/test_bge_reranker_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/cross_encoder/test_gemini_reranker_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/driver/__init__.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/driver/test_falkordb_driver.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/embedder/embedder_fixtures.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/embedder/test_openai.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/embedder/test_voyage.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/evals/data/longmemeval_data/README.md +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/evals/data/longmemeval_data/longmemeval_oracle.json +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/evals/eval_cli.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/evals/eval_e2e_graph_building.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/evals/pytest.ini +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/evals/utils.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/helpers_test.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/llm_client/test_anthropic_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/llm_client/test_anthropic_client_int.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/llm_client/test_client.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/llm_client/test_errors.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/test_entity_exclusion_int.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/test_graphiti_falkordb_int.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/test_graphiti_int.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/test_node_falkordb_int.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/test_node_int.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/utils/maintenance/test_edge_operations.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/utils/maintenance/test_temporal_operations_int.py +0 -0
- {graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/utils/search/search_utils_test.py +0 -0
|
@@ -37,7 +37,7 @@ from .client import EmbedderClient, EmbedderConfig
|
|
|
37
37
|
|
|
38
38
|
logger = logging.getLogger(__name__)
|
|
39
39
|
|
|
40
|
-
DEFAULT_EMBEDDING_MODEL = 'text-embedding-001'
|
|
40
|
+
DEFAULT_EMBEDDING_MODEL = 'text-embedding-001' # gemini-embedding-001 or text-embedding-005
|
|
41
41
|
|
|
42
42
|
DEFAULT_BATCH_SIZE = 100
|
|
43
43
|
|
|
@@ -78,7 +78,7 @@ class GeminiEmbedder(EmbedderClient):
|
|
|
78
78
|
|
|
79
79
|
if batch_size is None and self.config.embedding_model == 'gemini-embedding-001':
|
|
80
80
|
# Gemini API has a limit on the number of instances per request
|
|
81
|
-
#https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api
|
|
81
|
+
# https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api
|
|
82
82
|
self.batch_size = 1
|
|
83
83
|
elif batch_size is None:
|
|
84
84
|
self.batch_size = DEFAULT_BATCH_SIZE
|
|
@@ -113,32 +113,34 @@ class GeminiEmbedder(EmbedderClient):
|
|
|
113
113
|
async def create_batch(self, input_data_list: list[str]) -> list[list[float]]:
|
|
114
114
|
"""
|
|
115
115
|
Create embeddings for a batch of input data using Google's Gemini embedding model.
|
|
116
|
-
|
|
116
|
+
|
|
117
117
|
This method handles batching to respect the Gemini API's limits on the number
|
|
118
118
|
of instances that can be processed in a single request.
|
|
119
|
-
|
|
119
|
+
|
|
120
120
|
Args:
|
|
121
121
|
input_data_list: A list of strings to create embeddings for.
|
|
122
|
-
|
|
122
|
+
|
|
123
123
|
Returns:
|
|
124
124
|
A list of embedding vectors (each vector is a list of floats).
|
|
125
125
|
"""
|
|
126
126
|
if not input_data_list:
|
|
127
127
|
return []
|
|
128
|
-
|
|
128
|
+
|
|
129
129
|
batch_size = self.batch_size
|
|
130
130
|
all_embeddings = []
|
|
131
|
-
|
|
131
|
+
|
|
132
132
|
# Process inputs in batches
|
|
133
133
|
for i in range(0, len(input_data_list), batch_size):
|
|
134
|
-
batch = input_data_list[i:i + batch_size]
|
|
135
|
-
|
|
134
|
+
batch = input_data_list[i : i + batch_size]
|
|
135
|
+
|
|
136
136
|
try:
|
|
137
137
|
# Generate embeddings for this batch
|
|
138
138
|
result = await self.client.aio.models.embed_content(
|
|
139
139
|
model=self.config.embedding_model or DEFAULT_EMBEDDING_MODEL,
|
|
140
140
|
contents=batch, # type: ignore[arg-type] # mypy fails on broad union type
|
|
141
|
-
config=types.EmbedContentConfig(
|
|
141
|
+
config=types.EmbedContentConfig(
|
|
142
|
+
output_dimensionality=self.config.embedding_dim
|
|
143
|
+
),
|
|
142
144
|
)
|
|
143
145
|
|
|
144
146
|
if not result.embeddings or len(result.embeddings) == 0:
|
|
@@ -149,29 +151,33 @@ class GeminiEmbedder(EmbedderClient):
|
|
|
149
151
|
if not embedding.values:
|
|
150
152
|
raise ValueError('Empty embedding values returned')
|
|
151
153
|
all_embeddings.append(embedding.values)
|
|
152
|
-
|
|
154
|
+
|
|
153
155
|
except Exception as e:
|
|
154
156
|
# If batch processing fails, fall back to individual processing
|
|
155
|
-
logger.warning(
|
|
156
|
-
|
|
157
|
+
logger.warning(
|
|
158
|
+
f'Batch embedding failed for batch {i // batch_size + 1}, falling back to individual processing: {e}'
|
|
159
|
+
)
|
|
160
|
+
|
|
157
161
|
for item in batch:
|
|
158
162
|
try:
|
|
159
163
|
# Process each item individually
|
|
160
164
|
result = await self.client.aio.models.embed_content(
|
|
161
165
|
model=self.config.embedding_model or DEFAULT_EMBEDDING_MODEL,
|
|
162
166
|
contents=[item], # type: ignore[arg-type] # mypy fails on broad union type
|
|
163
|
-
config=types.EmbedContentConfig(
|
|
167
|
+
config=types.EmbedContentConfig(
|
|
168
|
+
output_dimensionality=self.config.embedding_dim
|
|
169
|
+
),
|
|
164
170
|
)
|
|
165
|
-
|
|
171
|
+
|
|
166
172
|
if not result.embeddings or len(result.embeddings) == 0:
|
|
167
173
|
raise ValueError('No embeddings returned from Gemini API')
|
|
168
174
|
if not result.embeddings[0].values:
|
|
169
175
|
raise ValueError('Empty embedding values returned')
|
|
170
|
-
|
|
176
|
+
|
|
171
177
|
all_embeddings.append(result.embeddings[0].values)
|
|
172
|
-
|
|
178
|
+
|
|
173
179
|
except Exception as individual_error:
|
|
174
|
-
logger.error(f
|
|
180
|
+
logger.error(f'Failed to embed individual item: {individual_error}')
|
|
175
181
|
raise individual_error
|
|
176
|
-
|
|
182
|
+
|
|
177
183
|
return all_embeddings
|
|
@@ -172,13 +172,13 @@ class LLMClient(ABC):
|
|
|
172
172
|
"""
|
|
173
173
|
Log the full input messages, the raw output (if any), and the exception for debugging failed generations.
|
|
174
174
|
"""
|
|
175
|
-
log =
|
|
176
|
-
log += f
|
|
175
|
+
log = ''
|
|
176
|
+
log += f'Input messages: {json.dumps([m.model_dump() for m in messages], indent=2)}\n'
|
|
177
177
|
if output is not None:
|
|
178
178
|
if len(output) > 4000:
|
|
179
|
-
log += f
|
|
179
|
+
log += f'Raw output: {output[:2000]}... (truncated) ...{output[-2000:]}\n'
|
|
180
180
|
else:
|
|
181
|
-
log += f
|
|
181
|
+
log += f'Raw output: {output}\n'
|
|
182
182
|
else:
|
|
183
|
-
log +=
|
|
183
|
+
log += 'No raw output available'
|
|
184
184
|
return log
|
|
@@ -219,14 +219,14 @@ class GeminiClient(LLMClient):
|
|
|
219
219
|
array_match = re.search(r'\]\s*$', raw_output)
|
|
220
220
|
if array_match:
|
|
221
221
|
try:
|
|
222
|
-
return json.loads(raw_output[:array_match.end()])
|
|
222
|
+
return json.loads(raw_output[: array_match.end()])
|
|
223
223
|
except Exception:
|
|
224
224
|
pass
|
|
225
225
|
# Try to salvage a JSON object
|
|
226
226
|
obj_match = re.search(r'\}\s*$', raw_output)
|
|
227
227
|
if obj_match:
|
|
228
228
|
try:
|
|
229
|
-
return json.loads(raw_output[:obj_match.end()])
|
|
229
|
+
return json.loads(raw_output[: obj_match.end()])
|
|
230
230
|
except Exception:
|
|
231
231
|
pass
|
|
232
232
|
return None
|
|
@@ -323,12 +323,14 @@ class GeminiClient(LLMClient):
|
|
|
323
323
|
return validated_model.model_dump()
|
|
324
324
|
except Exception as e:
|
|
325
325
|
if raw_output:
|
|
326
|
-
logger.error(
|
|
326
|
+
logger.error(
|
|
327
|
+
'🦀 LLM generation failed parsing as JSON, will try to salvage.'
|
|
328
|
+
)
|
|
327
329
|
logger.error(self._get_failed_generation_log(gemini_messages, raw_output))
|
|
328
330
|
# Try to salvage
|
|
329
331
|
salvaged = self.salvage_json(raw_output)
|
|
330
332
|
if salvaged is not None:
|
|
331
|
-
logger.warning(
|
|
333
|
+
logger.warning('Salvaged partial JSON from truncated/malformed output.')
|
|
332
334
|
return salvaged
|
|
333
335
|
raise Exception(f'Failed to parse structured response: {e}') from e
|
|
334
336
|
|
|
@@ -384,7 +386,11 @@ class GeminiClient(LLMClient):
|
|
|
384
386
|
max_tokens=max_tokens,
|
|
385
387
|
model_size=model_size,
|
|
386
388
|
)
|
|
387
|
-
last_output =
|
|
389
|
+
last_output = (
|
|
390
|
+
response.get('content')
|
|
391
|
+
if isinstance(response, dict) and 'content' in response
|
|
392
|
+
else None
|
|
393
|
+
)
|
|
388
394
|
return response
|
|
389
395
|
except RateLimitError as e:
|
|
390
396
|
# Rate limit errors should not trigger retries (fail fast)
|
|
@@ -416,7 +422,7 @@ class GeminiClient(LLMClient):
|
|
|
416
422
|
)
|
|
417
423
|
|
|
418
424
|
# If we exit the loop without returning, all retries are exhausted
|
|
419
|
-
logger.error(
|
|
425
|
+
logger.error('🦀 LLM generation failed and retries are exhausted.')
|
|
420
426
|
logger.error(self._get_failed_generation_log(messages, last_output))
|
|
421
427
|
logger.error(f'Max retries ({self.MAX_RETRIES}) exceeded. Last error: {last_error}')
|
|
422
|
-
raise last_error or Exception(
|
|
428
|
+
raise last_error or Exception('Max retries exceeded')
|
|
@@ -31,9 +31,9 @@ EPISODIC_EDGE_SAVE_BULK = """
|
|
|
31
31
|
"""
|
|
32
32
|
|
|
33
33
|
ENTITY_EDGE_SAVE = """
|
|
34
|
-
MATCH (source:Entity {uuid: $source_uuid})
|
|
35
|
-
MATCH (target:Entity {uuid: $target_uuid})
|
|
36
|
-
MERGE (source)-[r:RELATES_TO {uuid: $uuid}]->(target)
|
|
34
|
+
MATCH (source:Entity {uuid: $edge_data.source_uuid})
|
|
35
|
+
MATCH (target:Entity {uuid: $edge_data.target_uuid})
|
|
36
|
+
MERGE (source)-[r:RELATES_TO {uuid: $edge_data.uuid}]->(target)
|
|
37
37
|
SET r = $edge_data
|
|
38
38
|
WITH r CALL db.create.setRelationshipVectorProperty(r, "fact_embedding", $edge_data.fact_embedding)
|
|
39
39
|
RETURN r.uuid AS uuid"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "graphiti-core"
|
|
3
3
|
description = "A temporal graph building library"
|
|
4
|
-
version = "0.17.
|
|
4
|
+
version = "0.17.3"
|
|
5
5
|
authors = [
|
|
6
6
|
{ "name" = "Paul Paliychuk", "email" = "paul@getzep.com" },
|
|
7
7
|
{ "name" = "Preston Rasmussen", "email" = "preston@getzep.com" },
|
|
@@ -345,9 +345,9 @@ class TestGeminiEmbedderCreateBatch:
|
|
|
345
345
|
|
|
346
346
|
# Set side_effect for embed_content to control return values for each call
|
|
347
347
|
mock_gemini_client.aio.models.embed_content.side_effect = [
|
|
348
|
-
mock_batch_response,
|
|
349
|
-
mock_individual_response_1,
|
|
350
|
-
mock_individual_response_2
|
|
348
|
+
mock_batch_response, # First call for the batch
|
|
349
|
+
mock_individual_response_1, # Second call for individual item 1
|
|
350
|
+
mock_individual_response_2, # Third call for individual item 2
|
|
351
351
|
]
|
|
352
352
|
|
|
353
353
|
input_batch = ['Input 1', 'Input 2']
|
|
@@ -273,7 +273,7 @@ class TestGeminiClientGenerateResponse:
|
|
|
273
273
|
messages = [Message(role='user', content='Test message')]
|
|
274
274
|
with pytest.raises(Exception): # noqa: B017
|
|
275
275
|
await gemini_client.generate_response(messages, response_model=ResponseModel)
|
|
276
|
-
|
|
276
|
+
|
|
277
277
|
# Should have called generate_content MAX_RETRIES times (2 attempts total)
|
|
278
278
|
assert mock_gemini_client.aio.models.generate_content.call_count == GeminiClient.MAX_RETRIES
|
|
279
279
|
|
|
@@ -344,10 +344,7 @@ class TestGeminiClientGenerateResponse:
|
|
|
344
344
|
await gemini_client.generate_response(messages, response_model=ResponseModel)
|
|
345
345
|
|
|
346
346
|
# Should have called generate_content MAX_RETRIES times (2 attempts total)
|
|
347
|
-
assert
|
|
348
|
-
mock_gemini_client.aio.models.generate_content.call_count
|
|
349
|
-
== GeminiClient.MAX_RETRIES
|
|
350
|
-
)
|
|
347
|
+
assert mock_gemini_client.aio.models.generate_content.call_count == GeminiClient.MAX_RETRIES
|
|
351
348
|
|
|
352
349
|
@pytest.mark.asyncio
|
|
353
350
|
async def test_empty_response_handling(self, gemini_client, mock_gemini_client):
|
|
@@ -363,7 +360,7 @@ class TestGeminiClientGenerateResponse:
|
|
|
363
360
|
messages = [Message(role='user', content='Test message')]
|
|
364
361
|
with pytest.raises(Exception): # noqa: B017
|
|
365
362
|
await gemini_client.generate_response(messages, response_model=ResponseModel)
|
|
366
|
-
|
|
363
|
+
|
|
367
364
|
# Should have exhausted retries due to empty response (2 attempts total)
|
|
368
365
|
assert mock_gemini_client.aio.models.generate_content.call_count == GeminiClient.MAX_RETRIES
|
|
369
366
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/cross_encoder/bge_reranker_client.py
RENAMED
|
File without changes
|
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/cross_encoder/gemini_reranker_client.py
RENAMED
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/cross_encoder/openai_reranker_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/azure_openai_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/openai_base_client.py
RENAMED
|
File without changes
|
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/llm_client/openai_generic_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/maintenance/edge_operations.py
RENAMED
|
File without changes
|
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/maintenance/node_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/graphiti_core/utils/maintenance/temporal_operations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/cross_encoder/test_bge_reranker_client.py
RENAMED
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/cross_encoder/test_gemini_reranker_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphiti_core-0.17.2 → graphiti_core-0.17.3}/tests/utils/maintenance/test_edge_operations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|