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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module.exports = {
testPathIgnorePatterns: ['src/integration', 'dist/'],
testTimeout: 150000,
verbose: true,
detectOpenHandles: false,
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!**/src/pinecone-generated-ts-fetch/**',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"format": "prettier --write .",
"lint": "eslint src/ --ext .ts",
"repl": "npm run build && node utils/replInit.ts",
"test:integration:node": "TEST_ENV=node jest src/integration/ -c jest.config.integration-node.js --runInBand --bail",
"test:integration:node": "TEST_ENV=node jest src/integration/ -c jest.config.integration-node.js --detectOpenHandles --runInBand --bail",
"test:integration-local:node": "TEST_ENV=node node src/integration/integrationRunner.js",
"test:integration:edge": "TEST_ENV=edge jest src/integration/ -c jest.config.integration-edge.js --runInBand --bail",
"test:integration:edge": "TEST_ENV=edge jest src/integration/ -c jest.config.integration-edge.js --detectOpenHandles --runInBand --bail",
"test:integration-local:edge": "TEST_ENV=edge node src/integration/integrationRunner.js",
"test:integration:cleanup": "npm run build && node utils/cleanupResources.ts",
"test:external-app-local": "chmod +x ts-external-app-test/local-external-app.sh && ts-external-app-test/local-external-app.sh",
Expand Down
4 changes: 2 additions & 2 deletions src/control/__tests__/configureIndex.validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('configureIndex argument validations', () => {

await expect(toThrow).rejects.toThrowError(PineconeArgumentError);
await expect(toThrow).rejects.toThrowError(
'Object contained invalid properties: speculoos. Valid properties include deletionProtection, spec, tags.'
'Object contained invalid properties: speculoos. Valid properties include deletionProtection, spec, tags, embed.'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

speculoos? lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's the invalid object key which ends up in the error message.

);
});

Expand All @@ -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
2 changes: 1 addition & 1 deletion src/integration/integrationRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ try {
// Step 2: Run Jest tests
console.log(`Executing integration tests in Jest environment: "${TEST_ENV}"`);
execSync(
`SERVERLESS_INDEX_NAME=${SERVERLESS_INDEX_NAME} ASSISTANT_NAME=${ASSISTANT_NAME} TEST_FILE=${TEST_FILE} TEST_ENV=${TEST_ENV} jest src/integration -c jest.config.integration-node.js --runInBand --bail`,
`SERVERLESS_INDEX_NAME=${SERVERLESS_INDEX_NAME} ASSISTANT_NAME=${ASSISTANT_NAME} TEST_FILE=${TEST_FILE} TEST_ENV=${TEST_ENV} jest src/integration -c jest.config.integration-node.js --detectOpenHandles --runInBand --bail`,
{ stdio: 'inherit' }
);
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion src/integration/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async function createAssistant(client: Pinecone) {
metadata: { key: 'valueOne', keyTwo: 'valueTwo' },
region: 'us',
});
await sleep(2000);
await sleep(5000);

try {
await client.describeAssistant(assistantName);
Expand Down
Loading