-
Notifications
You must be signed in to change notification settings - Fork 231
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
feat: Implemented aget_routes async method for pinecone index #397
feat: Implemented aget_routes async method for pinecone index #397
Conversation
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
semantic_router/index/pinecone.py
Outdated
@@ -584,5 +596,101 @@ async def _async_describe_index(self, name: str): | |||
async with self.async_client.get(f"{self.base_url}/indexes/{name}") as response: | |||
return await response.json(content_type=None) | |||
|
|||
async def _async_get_all( | |||
self, prefix: str | None = None, include_metadata: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't use these type annotations as we need to remain backwards compatible with python 3.9, should instead use Optional[str] = None
in this case
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #397 +/- ##
==========================================
- Coverage 64.45% 63.60% -0.85%
==========================================
Files 46 46
Lines 3376 3432 +56
==========================================
+ Hits 2176 2183 +7
- Misses 1200 1249 +49 ☔ View full report in Codecov by Sentry. |
User description
Fixes issue #396
PR Type
enhancement
Description
aget_routes
method in the base index class to be implemented by subclasses.aget_routes
method in the Pinecone index to asynchronously retrieve route and utterance objects.aget_routes
method in LocalIndex, PostgresIndex, and QdrantIndex to indicate it is not implemented.Changes walkthrough 📝
base.py
Introduce abstract `aget_routes` method in base index class
semantic_router/index/base.py
aget_routes
method as an abstract method to be implemented bysubclasses.
local.py
Add `aget_routes` method with error logging in LocalIndex
semantic_router/index/local.py
aget_routes
method with a logger error message indicatingit's not implemented.
pinecone.py
Implement asynchronous `aget_routes` method in PineconeIndex
semantic_router/index/pinecone.py
aget_routes
method to asynchronously retrieve routes andutterances.
_async_get_all
and_async_fetch_metadata
forfetching data.
postgres.py
Add `aget_routes` method with error logging in PostgresIndex
semantic_router/index/postgres.py
aget_routes
method with a logger error message indicating it'snot implemented.
qdrant.py
Add `aget_routes` method with error logging in QdrantIndex
semantic_router/index/qdrant.py
aget_routes
method with a logger error message indicating it'snot implemented.