Skip to content

Commit

Permalink
fix(ci): Fix esbuild tests (langchain-ai#6739)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 authored and FilipZmijewski committed Sep 27, 2024
1 parent 6af2be9 commit 3c06e03
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 33 deletions.
1 change: 0 additions & 1 deletion environment_tests/test-exports-esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@langchain/core": "workspace:*",
"@langchain/openai": "workspace:*",
"@tsconfig/recommended": "^1.0.2",
"d3-dsv": "2",
"esbuild": "^0.17.18",
"hnswlib-node": "^3.0.0",
"langchain": "workspace:*",
Expand Down
8 changes: 0 additions & 8 deletions environment_tests/test-exports-esbuild/src/import.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ async function test() {
const { HNSWLib } = await import("@langchain/community/vectorstores/hnswlib");
const { OpenAIEmbeddings } = await import("@langchain/openai");
const { Document } = await import("@langchain/core/documents");
const { CSVLoader } = await import("@langchain/community/document_loaders/fs/csv");

// Test exports
assert(typeof OpenAI === "function");
Expand Down Expand Up @@ -39,13 +38,6 @@ async function test() {
);

assert((await vs.similaritySearchVectorWithScore([0, 0, 1], 1)).length === 1);

// Test CSVLoader
const loader = new CSVLoader(new Blob(["a,b,c\n1,2,3\n4,5,6"]));

const docs = await loader.load();

assert(docs.length === 2);
}

test()
Expand Down
8 changes: 0 additions & 8 deletions environment_tests/test-exports-esbuild/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ChatPromptTemplate } from "@langchain/core/prompts";
import { HNSWLib } from "@langchain/community/vectorstores/hnswlib";
import { OpenAIEmbeddings } from "@langchain/openai";
import { Document } from "@langchain/core/documents";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";
import { CallbackManager } from "@langchain/core/callbacks/manager";

// Test exports
Expand Down Expand Up @@ -41,10 +40,3 @@ await vs.addVectors(
);

assert((await vs.similaritySearchVectorWithScore([0, 0, 1], 1)).length === 1);

// Test CSVLoader
const loader = new CSVLoader(new Blob(["a,b,c\n1,2,3\n4,5,6"]));

const docs = await loader.load();

assert(docs.length === 2);
8 changes: 0 additions & 8 deletions environment_tests/test-exports-esbuild/src/require.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const { ChatPromptTemplate } = require("@langchain/core/prompts");
const { HNSWLib } = require("@langchain/community/vectorstores/hnswlib");
const { OpenAIEmbeddings } = require("@langchain/openai");
const { Document } = require("@langchain/core/documents");
const { CSVLoader } = require("@langchain/community/document_loaders/fs/csv");

async function test() {
// Test exports
Expand Down Expand Up @@ -39,13 +38,6 @@ async function test() {
);

assert((await vs.similaritySearchVectorWithScore([0, 0, 1], 1)).length === 1);

// Test CSVLoader
const loader = new CSVLoader(new Blob(["a,b,c\n1,2,3\n4,5,6"]));

const docs = await loader.load();

assert(docs.length === 2);
}

test()
Expand Down
8 changes: 0 additions & 8 deletions environment_tests/test-exports-esbuild/src/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ChatPromptTemplate } from "@langchain/core/prompts";
import { HNSWLib } from "@langchain/community/vectorstores/hnswlib";
import { OpenAIEmbeddings } from "@langchain/openai";
import { Document } from "@langchain/core/documents";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";

async function test(useAzure: boolean = false) {
// Test exports
Expand Down Expand Up @@ -49,13 +48,6 @@ async function test(useAzure: boolean = false) {
);

assert((await vs.similaritySearchVectorWithScore([0, 0, 1], 1)).length === 1);

// Test CSVLoader
const loader = new CSVLoader(new Blob(["a,b,c\n1,2,3\n4,5,6"]));

const docs = await loader.load();

assert(docs.length === 2);
}

test(false)
Expand Down

0 comments on commit 3c06e03

Please sign in to comment.