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

Add show_progress_bar flag and set to false #97

Merged
merged 4 commits into from
Oct 24, 2023
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
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):
miararoy marked this conversation as resolved.
Show resolved Hide resolved
"""
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