Skip to content

Allow embed as a parameter to configureIndex #338

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

Merged
merged 6 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/control/__tests__/configureIndex.validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('configureIndex argument validations', () => {

await expect(toThrowSpec).rejects.toThrowError(PineconeArgumentError);
await expect(toThrowSpec).rejects.toThrowError(
'You must pass either `spec`, `deletionProtection` or `tags` to configureIndex in order to update.'
'You must pass either `spec`, `deletionProtection`, `tags`, or `embed` to configureIndex in order to update.'
);
});

Expand Down
10 changes: 8 additions & 2 deletions src/control/configureIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const ConfigureIndexRequestProperties: ConfigureIndexRequestType[] = [
'deletionProtection',
'spec',
'tags',
'embed',
];

export const configureIndex = (api: ManageIndexesApi) => {
Expand All @@ -29,9 +30,14 @@ export const configureIndex = (api: ManageIndexesApi) => {
}
// !options.deletionProtection evaluates to false if options.deletionProtection is undefined, empty string, or
// not provided
if (!options.spec && !options.deletionProtection && !options.tags) {
if (
!options.spec &&
!options.deletionProtection &&
!options.tags &&
!options.embed
) {
throw new PineconeArgumentError(
'You must pass either `spec`, `deletionProtection` or `tags` to configureIndex in order to update.'
'You must pass either `spec`, `deletionProtection`, `tags`, or `embed` to configureIndex in order to update.'
);
}
if (options.spec) {
Expand Down
Loading