diff --git a/llama-index-core/llama_index/core/indices/knowledge_graph/base.py b/llama-index-core/llama_index/core/indices/knowledge_graph/base.py index 86f29a5de8303..b3f9f0013dc3a 100644 --- a/llama-index-core/llama_index/core/indices/knowledge_graph/base.py +++ b/llama-index-core/llama_index/core/indices/knowledge_graph/base.py @@ -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. @@ -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.""" diff --git a/llama-index-core/llama_index/core/query_engine/jsonalyze_query_engine.py b/llama-index-core/llama_index/core/query_engine/jsonalyze_query_engine.py index e6edc6f8670bc..c2b81afbf9e1e 100644 --- a/llama-index-core/llama_index/core/query_engine/jsonalyze_query_engine.py +++ b/llama-index-core/llama_index/core/query_engine/jsonalyze_query_engine.py @@ -80,7 +80,7 @@ def default_jsonalyzer( try: # Load list of dictionaries into SQLite database db[table_name].insert_all(list_of_dict) - except sqlite_utils.db_exceptions.IntegrityError as exc: + except sqlite_utils.utils.sqlite3.IntegrityError as exc: print_text(f"Error inserting into table {table_name}, expected format:") print_text("[{col1: val1, col2: val2, ...}, ...]") raise ValueError("Invalid list_of_dict") from exc @@ -105,7 +105,7 @@ def default_jsonalyzer( try: # Execute the SQL query results = list(db.query(sql_query)) - except sqlite_utils.db_exceptions.OperationalError as exc: + except sqlite_utils.utils.sqlite3.OperationalError as exc: print_text(f"Error executing query: {sql_query}") raise ValueError("Invalid query") from exc @@ -148,7 +148,7 @@ async def async_default_jsonalyzer( try: # Load list of dictionaries into SQLite database db[table_name].insert_all(list_of_dict) - except sqlite_utils.db_exceptions.IntegrityError as exc: + except sqlite_utils.utils.sqlite3.IntegrityError as exc: print_text(f"Error inserting into table {table_name}, expected format:") print_text("[{col1: val1, col2: val2, ...}, ...]") raise ValueError("Invalid list_of_dict") from exc @@ -173,7 +173,7 @@ async def async_default_jsonalyzer( try: # Execute the SQL query results = list(db.query(sql_query)) - except sqlite_utils.db_exceptions.OperationalError as exc: + except sqlite_utils.utils.sqlite3.OperationalError as exc: print_text(f"Error executing query: {sql_query}") raise ValueError("Invalid query") from exc diff --git a/llama-index-core/pyproject.toml b/llama-index-core/pyproject.toml index ffa6a94e30e90..c95f5551d1af4 100644 --- a/llama-index-core/pyproject.toml +++ b/llama-index-core/pyproject.toml @@ -43,7 +43,7 @@ name = "llama-index-core" packages = [{include = "llama_index"}] readme = "README.md" repository = "https://github.com/run-llama/llama_index" -version = "0.10.14" +version = "0.10.14.post1" [tool.poetry.dependencies] SQLAlchemy = {extras = ["asyncio"], version = ">=1.4.49"}