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

feature/add-progress-to-di #982

Merged
merged 8 commits into from
Aug 14, 2024
Merged
Changes from 1 commit
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
14 changes: 14 additions & 0 deletions src/intelligence_layer/connectors/document_index/document_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,20 @@ def delete_index_from_collection(
response = requests.delete(url, headers=self.headers)
self._raise_for_status(response)

def progress(
self, collection_path: CollectionPath
) -> int:
"""Get the number of unembedded documents in a collection.
Args:
collection_path: Path to the collection of interest.
Returns:
The number of unembedded documents in a collection.
"""
url = f"{self._base_document_index_url}/collections/{collection_path.namespace}/{collection_path.collection}/progress"
response = requests.get(url, headers=self.headers)
self._raise_for_status(response)
return int(response.text)

def list_assigned_index_names(
self, collection_path: CollectionPath
) -> Sequence[str]:
Expand Down
Loading