Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .github/actions/integrationTests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ runs:
PINECONE_CLOUD: "aws"
PINECONE_REGION: "us-west-2"
run: npm run test
- name: "Report Coverage"
if: always() # Also generate the report if tests are failing
uses: davelosert/vitest-coverage-report-action@v2
125 changes: 10 additions & 115 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"clean": "rimraf ./build",
"build": "npm-run-all format lint && tsc",
"start": "node build/src",
"test": "vitest run --coverage --retry 5",
"test": "vitest run --retry 5",
"dev": "ts-node src",
"lint": "eslint src",
"format": "npx prettier --write src",
"format:check": "npx prettier --check src"
},
"dependencies": {
"@pinecone-database/pinecone": "^2.0.0",
"@pinecone-database/pinecone": "^6.1.3",
"@xenova/transformers": "2.0.1",
"cli-progress": "^3.12.0",
"dotenv": "^16.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const query = async (query: string, topK: number) => {

// Query the index using the query embedding
const results = await index.query({
vector: queryEmbedding.values,
vector: queryEmbedding.values || [],
topK,
includeMetadata: true,
includeValues: false,
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/semanticSearch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ describe(
const pinecone = new Pinecone();
const index = pinecone.index(indexName);
let stats = await index.describeIndexStats();
console.log(`Index stats: ${JSON.stringify(stats)}`);

// Records can take some time to become available in the index after upsert
// so we wait until the namespace is populated before moving on to asserts
while (
(stats.namespaces && !stats.namespaces[""]) ||
(stats.namespaces && stats.namespaces[""].recordCount === 0)
) {
console.log(`Index stats: ${JSON.stringify(stats)}`);
await new Promise((resolve) => setTimeout(resolve, 3000));
stats = await index.describeIndexStats();
}
Expand Down