graphiti-core 0.7.4__tar.gz → 0.7.6__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.7.4 → graphiti_core-0.7.6}/PKG-INFO +1 -1
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/extract_nodes.py +8 -3
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/node_operations.py +14 -8
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/pyproject.toml +1 -1
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/LICENSE +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/README.md +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/cross_encoder/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/cross_encoder/bge_reranker_client.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/cross_encoder/client.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/cross_encoder/openai_reranker_client.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/edges.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/embedder/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/embedder/client.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/embedder/openai.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/embedder/voyage.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/errors.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/graphiti.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/helpers.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/llm_client/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/llm_client/anthropic_client.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/llm_client/client.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/llm_client/config.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/llm_client/errors.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/llm_client/groq_client.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/llm_client/openai_client.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/llm_client/openai_generic_client.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/llm_client/utils.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/models/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/models/edges/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/models/edges/edge_db_queries.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/models/nodes/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/models/nodes/node_db_queries.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/nodes.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/dedupe_edges.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/dedupe_nodes.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/eval.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/extract_edge_dates.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/extract_edges.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/invalidate_edges.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/lib.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/models.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/prompt_helpers.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/prompts/summarize_nodes.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/py.typed +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/search/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/search/search.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/search/search_config.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/search/search_config_recipes.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/search/search_filters.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/search/search_utils.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/bulk_utils.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/datetime_utils.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/__init__.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/community_operations.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/edge_operations.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/graph_data_operations.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/temporal_operations.py +0 -0
- {graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/utils.py +0 -0
|
@@ -31,9 +31,13 @@ class MissedEntities(BaseModel):
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
class EntityClassification(BaseModel):
|
|
34
|
-
|
|
34
|
+
entities: list[str] = Field(
|
|
35
35
|
...,
|
|
36
|
-
description='
|
|
36
|
+
description='List of entities',
|
|
37
|
+
)
|
|
38
|
+
entity_classifications: list[str | None] = Field(
|
|
39
|
+
...,
|
|
40
|
+
description='List of entities classifications. The index of the classification should match the index of the entity it corresponds to.',
|
|
37
41
|
)
|
|
38
42
|
|
|
39
43
|
|
|
@@ -180,7 +184,8 @@ def classify_nodes(context: dict[str, Any]) -> list[Message]:
|
|
|
180
184
|
|
|
181
185
|
Guidelines:
|
|
182
186
|
1. Each entity must have exactly one type
|
|
183
|
-
2.
|
|
187
|
+
2. Only use the provided ENTITY TYPES as types, do not use additional types to classify entities.
|
|
188
|
+
3. If none of the provided entity types accurately classify an extracted node, the type should be set to None
|
|
184
189
|
"""
|
|
185
190
|
return [
|
|
186
191
|
Message(role='system', content=sys_prompt),
|
{graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/node_operations.py
RENAMED
|
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
|
-
import ast
|
|
18
17
|
import logging
|
|
19
18
|
from time import time
|
|
20
19
|
|
|
@@ -159,12 +158,17 @@ async def extract_nodes(
|
|
|
159
158
|
node_classifications: dict[str, str | None] = {}
|
|
160
159
|
|
|
161
160
|
if entity_types is not None:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
try:
|
|
162
|
+
llm_response = await llm_client.generate_response(
|
|
163
|
+
prompt_library.extract_nodes.classify_nodes(node_classification_context),
|
|
164
|
+
response_model=EntityClassification,
|
|
165
|
+
)
|
|
166
|
+
entities = llm_response.get('entities', [])
|
|
167
|
+
entity_classifications = llm_response.get('entity_classifications', [])
|
|
168
|
+
node_classifications.update(dict(zip(entities, entity_classifications)))
|
|
169
|
+
# catch classification errors and continue if we can't classify
|
|
170
|
+
except Exception as e:
|
|
171
|
+
logger.exception(e)
|
|
168
172
|
|
|
169
173
|
end = time()
|
|
170
174
|
logger.debug(f'Extracted new nodes: {extracted_node_names} in {(end - start) * 1000} ms')
|
|
@@ -173,7 +177,9 @@ async def extract_nodes(
|
|
|
173
177
|
for name in extracted_node_names:
|
|
174
178
|
entity_type = node_classifications.get(name)
|
|
175
179
|
labels = (
|
|
176
|
-
['Entity']
|
|
180
|
+
['Entity']
|
|
181
|
+
if entity_type is None or entity_type == 'None' or entity_type == 'null'
|
|
182
|
+
else ['Entity', entity_type]
|
|
177
183
|
)
|
|
178
184
|
|
|
179
185
|
new_node = EntityNode(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/cross_encoder/bge_reranker_client.py
RENAMED
|
File without changes
|
|
File without changes
|
{graphiti_core-0.7.4 → graphiti_core-0.7.6}/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
|
{graphiti_core-0.7.4 → graphiti_core-0.7.6}/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
|
{graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/community_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/edge_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/graph_data_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.7.4 → graphiti_core-0.7.6}/graphiti_core/utils/maintenance/temporal_operations.py
RENAMED
|
File without changes
|
|
File without changes
|