From 5f334046fe9159d57697099824fdbe7899ad37b0 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Mon, 20 May 2024 13:11:41 -0400 Subject: [PATCH] ci: Updated the langchain vectorstore test to reference the correct version of `@langchain/core` getting tested --- test/versioned/langchain/vectorstore.tap.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/versioned/langchain/vectorstore.tap.js b/test/versioned/langchain/vectorstore.tap.js index 07511626a1..9d0a3520fb 100644 --- a/test/versioned/langchain/vectorstore.tap.js +++ b/test/versioned/langchain/vectorstore.tap.js @@ -10,7 +10,17 @@ const helper = require('../../lib/agent_helper') const { removeModules } = require('../../lib/cache-buster') // load the assertSegments assertion require('../../lib/metrics_helper') -const { version: pkgVersion } = require('@langchain/core/package.json') +const fs = require('fs') +let pkgVersion +try { + ;({ version: pkgVersion } = JSON.parse( + fs.readFileSync( + `${__dirname}/node_modules/@langchain/community/node_modules/@langchain/core/package.json` + ) + )) +} catch { + ;({ version: pkgVersion } = require('@langchain/core/package.json')) +} const createOpenAIMockServer = require('../openai/mock-server') const { filterLangchainEvents, filterLangchainEventsByType } = require('./common') const { DESTINATIONS } = require('../../../lib/config/attribute-filter')