Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev' into add_defaults_test
Browse files Browse the repository at this point in the history
  • Loading branch information
igiloh-pinecone authored Oct 24, 2023
2 parents 0acbb2b + e91dde9 commit 81cfb8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pinecone-client = "^2.2.2"
python-dotenv = "^1.0.0"
openai = "^0.27.5"
tiktoken = "^0.3.3"
pinecone-datasets = "^0.6.1"
pinecone-datasets = "^0.6.2"
pydantic = "^1.10.7"
pinecone-text = { version = "^0.6.0", extras = ["openai"] }
pandas-stubs = "^2.0.3.230814"
Expand Down
8 changes: 6 additions & 2 deletions src/resin/knowledge_base/knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ def _query_index(self,
def upsert(self,
documents: List[Document],
namespace: str = "",
batch_size: int = 100):
batch_size: int = 100,
show_progress_bar: bool = False):
"""
Upsert documents into the knowledge base.
Upsert operation stands for "update or insert".
Expand All @@ -486,6 +487,8 @@ def upsert(self,
namespace: The namespace in the underlying index to upsert documents into.
batch_size: Refers only to the actual upsert operation to the underlying index.
The number of chunks (multiple piecies of text per document) to upsert in each batch.
Defaults to 100.
show_progress_bar: Whether to show a progress bar while upserting the documents.
Returns:
None
Expand Down Expand Up @@ -551,7 +554,8 @@ def upsert(self,
dataset.to_pinecone_index(self._index_name,
namespace=namespace,
should_create_index=False,
batch_size=batch_size)
batch_size=batch_size,
show_progress=show_progress_bar)

def delete(self,
document_ids: List[str],
Expand Down

0 comments on commit 81cfb8f

Please sign in to comment.