Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed storage context update & service context issue #11475

Merged
merged 7 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion llama-index-core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
Loading