Skip to content

Commit

Permalink
fixed storage context update & service context issue (#11475)
Browse files Browse the repository at this point in the history
  • Loading branch information
knozdogan authored Mar 1, 2024
1 parent d3724db commit 7acf7f0
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,9 @@ def upsert_triplet(
self._graph_store.upsert_triplet(*triplet)
triplet_str = str(triplet)
if include_embeddings:
set_embedding = self._service_context.embed_model.get_text_embedding(
triplet_str
)
set_embedding = self._embed_model.get_text_embedding(triplet_str)
self._index_struct.add_to_embedding_dict(str(triplet), set_embedding)
self._storage_context.index_store.add_index_struct(self._index_struct)

def add_node(self, keywords: List[str], node: BaseNode) -> None:
"""Add node.
Expand Down Expand Up @@ -300,10 +299,9 @@ def upsert_triplet_and_node(
self.add_node([subj, obj], node)
triplet_str = str(triplet)
if include_embeddings:
set_embedding = self._service_context.embed_model.get_text_embedding(
triplet_str
)
set_embedding = self._embed_model.get_text_embedding(triplet_str)
self._index_struct.add_to_embedding_dict(str(triplet), set_embedding)
self._storage_context.index_store.add_index_struct(self._index_struct)

def _delete_node(self, node_id: str, **delete_kwargs: Any) -> None:
"""Delete a node."""
Expand Down

0 comments on commit 7acf7f0

Please sign in to comment.