Add embed to Index configure calls#515
Conversation
…igure method, and building in the request factory
…how we're building the configure index request call to be a bit more flexible
…s ConfigureIndexRequestEmbed as the class to the generated core
… interface and asyncio interface to support the embed parameter on configure
| "RestoreJobList": ("pinecone.db_control.models", "RestoreJobList"), | ||
| "BackupModel": ("pinecone.db_control.models", "BackupModel"), | ||
| "BackupList": ("pinecone.db_control.models", "BackupList"), | ||
| "ConfigureIndexEmbed": ("pinecone.db_control.types", "ConfigureIndexEmbed"), |
There was a problem hiding this comment.
what's the reason for adding ConfigureIndexEmbed and CreateIndexForModelEmbedTypedDict here?
There was a problem hiding this comment.
Adding the classes to _db_control_lazy_imports, which we seem to do for all of our custom models and types. It seemed like CreateIndexForModelEmbedTypedDict was also not included here, so I added it.
This is to allow lazy loaded imports to be exported from the top level of the package here:
pinecone-python-client/pinecone/__init__.py
Line 145 in dfd0125
There was a problem hiding this comment.
yeah I was wondering why we added types here but here's the reason why:
#507 (comment)
rohanshah18
left a comment
There was a problem hiding this comment.
LGTM! Nice work. Also it makes sense to follow CreateIndexForModelEmbed approach.
Problem
embedwas never exposed as an argument for callingconfigureonIndexResource.Solution
ConfigureIndexEmbed(TypedDict)class for representing the argument dictionary shape. I went with this because it aligned with the existingCreateIndexForModelEmbedTypedDict, but I'm not sure if this is best practice in the repo at this point. Maybe a class would be better.embedonconfigurecalls.Pinecone.configure_indexmethod to supportembed.configureorconfigure_index.Type of Change
Test Plan
New integration tests added. You can pull this branch down and use poetry to run a repl and quickly evaluate things yourself: