Skip to content
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

fix(ci): Fix esbuild tests #6739

Merged
merged 1 commit into from
Sep 11, 2024
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
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
Loading