This project compares Google Vertex AI SDK with LangChain's Vertex SDK using TypeScript and ES modules.
- Install dependencies:
npm install- Create a
.envfile in the root directory with your API keys:
GOOGLE_API_KEY=your-google-api-key-here
GOOGLE_LANGCHAIN_API_KEY=your-google-langchain-api-key-here
Both API keys are required.
- Add your prompts (optional):
- Edit
system-instructions.mdwith your system instructions - Edit
user-input.mdwith your user input/prompt
- Edit
Run the test suite with Vitest:
npm testOr run the test file directly:
npx vitest src/index.test.tsThe tests will:
- Run both SDK calls in parallel
- Save results to
results/genai.jsonandresults/langchain.json - Check that the duration difference is within 8 seconds