{"_id":"@dakshp1234/langchain-google-genai","_rev":"5-b91d3c7bc9fb39b2e4fd6321aee0a183","name":"@dakshp1234/langchain-google-genai","dist-tags":{"latest":"2.1.30"},"versions":{"2.1.26":{"name":"@dakshp1234/langchain-google-genai","version":"2.1.26","author":{"name":"LangChain"},"license":"MIT","_id":"@dakshp1234/langchain-google-genai@2.1.26","maintainers":[{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"}],"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-google-genai/","bugs":{"url":"https://github.com/langchain-ai/langchainjs/issues"},"dist":{"shasum":"be9d347e90b24d372f6b44392057b5c9f80c3721","tarball":"https://registry.npmjs.org/@dakshp1234/langchain-google-genai/-/langchain-google-genai-2.1.26.tgz","fileCount":4,"integrity":"sha512-1JJfKsvFUT1VoDZVIKCrnGBG5yO2T/qxyxsHW2+KgyhnRmFbBVIYgwP0JothaZE3YWujakhWhTp0Hz+DGzMrZg==","signatures":[{"sig":"MEUCIC1P4xM3+9nSILJcC0V+7LNauANNZiWvVgSk8FWqvLpvAiEAvf0fFvhVocPHROrSsquUxxJIep1ILHRIGCEyz3kZQMQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26093},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.cts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"input":"./src/index.ts","import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"2301260ae90ead5c5f725c8dae1487b6722607e2","scripts":{"test":"vitest run","build":"turbo build:compile --filter @langchain/google-genai --output-logs new-only","clean":"rm -rf .turbo dist/","typegen":"pnpm run typegen:profiles","test:int":"vitest run --mode int","test:watch":"vitest","test:single":"vitest run","build:compile":"tsdown","test:standard":"pnpm test:standard:unit && pnpm test:standard:int","typegen:profiles":"pnpm --filter @langchain/model-profiles make --config profiles.toml","test:standard:int":"vitest run --mode standard-int","test:standard:unit":"vitest run --mode standard-unit"},"_npmUser":{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"},"repository":{"url":"git+ssh://git@github.com/langchain-ai/langchainjs.git","type":"git"},"_npmVersion":"11.6.2","description":"Google Generative AI integration for LangChain.js","directories":{},"_nodeVersion":"24.12.0","dependencies":{"uuid":"^11.1.0","@google/generative-ai":"^0.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.76","dpdm":"^3.14.0","dotenv":"^17.4.0","vitest":"^4.1.2","typescript":"~5.8.3","hnswlib-node":"^3.0.0","@langchain/core":"workspace:^","@langchain/tsconfig":"workspace:*","@tsconfig/recommended":"^1.0.3","@langchain/standard-tests":"workspace:*"},"peerDependencies":{"@langchain/core":"workspace:^"},"_npmOperationalInternal":{"tmp":"tmp/langchain-google-genai_2.1.26_1775789065702_0.6222164596288373","host":"s3://npm-registry-packages-npm-production"}},"2.1.27":{"name":"@dakshp1234/langchain-google-genai","version":"2.1.27","author":{"name":"LangChain"},"license":"MIT","_id":"@dakshp1234/langchain-google-genai@2.1.27","maintainers":[{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"}],"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-google-genai/","bugs":{"url":"https://github.com/langchain-ai/langchainjs/issues"},"dist":{"shasum":"4a0722d12abbd1037c2e45b6f0cfc5e65f13dd27","tarball":"https://registry.npmjs.org/@dakshp1234/langchain-google-genai/-/langchain-google-genai-2.1.27.tgz","fileCount":52,"integrity":"sha512-RH6MblNDtthqQ1G8EjFA+3cJELO4Jfk9kgV5hwXWF3/AJe1NMt8QkHpuZu6031HN1XIEoQqwpsPxTH21mwmk7Q==","signatures":[{"sig":"MEUCIQCRQnQpf8gsuQHPRWJ0Osav3oo2WT9n1nqzkDOMtYf67gIgCu3gsiVT1vSoR3d8Kr0ZuCgBpWC+KWrh01EUiEfBYmI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":461448},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.cts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"input":"./src/index.ts","import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"2301260ae90ead5c5f725c8dae1487b6722607e2","scripts":{"test":"vitest run","build":"turbo build:compile --filter @dakshp1234/langchain-google-genai --output-logs new-only","clean":"rm -rf .turbo dist/","typegen":"pnpm run typegen:profiles","test:int":"vitest run --mode int","test:watch":"vitest","test:single":"vitest run","build:compile":"tsdown","test:standard":"pnpm test:standard:unit && pnpm test:standard:int","typegen:profiles":"pnpm --filter @langchain/model-profiles make --config profiles.toml","test:standard:int":"vitest run --mode standard-int","test:standard:unit":"vitest run --mode standard-unit"},"_npmUser":{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"},"repository":{"url":"git+ssh://git@github.com/langchain-ai/langchainjs.git","type":"git"},"_npmVersion":"11.6.2","description":"Google Generative AI integration for LangChain.js","directories":{},"_nodeVersion":"24.12.0","dependencies":{"uuid":"^11.1.0","@google/generative-ai":"^0.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.76","dpdm":"^3.14.0","dotenv":"^17.4.0","vitest":"^4.1.2","typescript":"~5.8.3","hnswlib-node":"^3.0.0","@langchain/core":"workspace:^","@langchain/tsconfig":"workspace:*","@tsconfig/recommended":"^1.0.3","@langchain/standard-tests":"workspace:*"},"peerDependencies":{"@langchain/core":"workspace:^"},"_npmOperationalInternal":{"tmp":"tmp/langchain-google-genai_2.1.27_1775789842984_0.4692558697601126","host":"s3://npm-registry-packages-npm-production"}},"2.1.28":{"name":"@dakshp1234/langchain-google-genai","version":"2.1.28","author":{"name":"LangChain"},"license":"MIT","_id":"@dakshp1234/langchain-google-genai@2.1.28","maintainers":[{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"}],"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-google-genai/","bugs":{"url":"https://github.com/langchain-ai/langchainjs/issues"},"dist":{"shasum":"6c488c3acf25f30b6b449d9a70c8afa1cda0615c","tarball":"https://registry.npmjs.org/@dakshp1234/langchain-google-genai/-/langchain-google-genai-2.1.28.tgz","fileCount":52,"integrity":"sha512-vYNset2433Jc9oG6aZLsJCxfT44qhde6RQcRxmZHQUNrYx73HkUW1KbaaCE0c4kg49fN+RnB6JvNAT9TMqTdxA==","signatures":[{"sig":"MEYCIQCyK+kMYulZXhf/GmGstHA9E3hT+sh6TcqF0vAfMIOq/QIhAOmjYdaHhp/W0TDBuLsZ/l80f2qgLtHPed5YbLwi5QnD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":461347},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.cts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"input":"./src/index.ts","import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"2301260ae90ead5c5f725c8dae1487b6722607e2","scripts":{"test":"vitest run","build":"turbo build:compile --filter @dakshp1234/langchain-google-genai --output-logs new-only","clean":"rm -rf .turbo dist/","typegen":"pnpm run typegen:profiles","test:int":"vitest run --mode int","test:watch":"vitest","test:single":"vitest run","build:compile":"tsdown","test:standard":"pnpm test:standard:unit && pnpm test:standard:int","typegen:profiles":"pnpm --filter @langchain/model-profiles make --config profiles.toml","test:standard:int":"vitest run --mode standard-int","test:standard:unit":"vitest run --mode standard-unit"},"_npmUser":{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"},"repository":{"url":"git+ssh://git@github.com/langchain-ai/langchainjs.git","type":"git"},"_npmVersion":"11.6.2","description":"Google Generative AI integration for LangChain.js","directories":{},"_nodeVersion":"24.12.0","dependencies":{"uuid":"^11.1.0","@google/generative-ai":"^0.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.76","dpdm":"^3.14.0","dotenv":"^17.4.0","vitest":"^4.1.2","typescript":"~5.8.3","hnswlib-node":"^3.0.0","@langchain/core":"1.1.0","@tsconfig/recommended":"^1.0.3"},"peerDependencies":{"@langchain/core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/langchain-google-genai_2.1.28_1775806061150_0.4189572358164255","host":"s3://npm-registry-packages-npm-production"}},"2.1.29":{"name":"@dakshp1234/langchain-google-genai","version":"2.1.29","author":{"name":"LangChain"},"license":"MIT","_id":"@dakshp1234/langchain-google-genai@2.1.29","maintainers":[{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"}],"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-google-genai/","bugs":{"url":"https://github.com/langchain-ai/langchainjs/issues"},"dist":{"shasum":"d752957d427ad1928c7f1244dbc6963e78ae0fef","tarball":"https://registry.npmjs.org/@dakshp1234/langchain-google-genai/-/langchain-google-genai-2.1.29.tgz","fileCount":52,"integrity":"sha512-symhd8em9l55zNzlwFkJDVByeQPLaXNGG9TkCIR5XyvdPRMg79SB/8BEXT6ECnxOb+BaDYIsK2Q2AwVpNrlIUg==","signatures":[{"sig":"MEYCIQD/B9hNl8wqvL+Ys1XQADqBVRVX+5VttmbWzcmjmwanpQIhAPLsItYLq1bz5BqGeFI9a+wuEKwAEO32RNzaW+iG03Dy","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":462542},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.cts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"input":"./src/index.ts","import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"e57c7c902fddcefa294fd5c8087744cb29b7451d","scripts":{"test":"vitest run","build":"turbo build:compile --filter @dakshp1234/langchain-google-genai --output-logs new-only","clean":"rm -rf .turbo dist/","typegen":"pnpm run typegen:profiles","test:int":"vitest run --mode int","test:watch":"vitest","test:single":"vitest run","build:compile":"tsdown","test:standard":"pnpm test:standard:unit && pnpm test:standard:int","typegen:profiles":"pnpm --filter @langchain/model-profiles make --config profiles.toml","test:standard:int":"vitest run --mode standard-int","test:standard:unit":"vitest run --mode standard-unit"},"_npmUser":{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"},"repository":{"url":"git+ssh://git@github.com/langchain-ai/langchainjs.git","type":"git"},"_npmVersion":"11.6.2","description":"Google Generative AI integration for LangChain.js","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@google/generative-ai":"^0.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.76","dpdm":"^3.14.0","dotenv":"^17.4.0","vitest":"^4.1.2","typescript":"~5.8.3","hnswlib-node":"^3.0.0","@langchain/core":"workspace:^","@langchain/tsconfig":"workspace:*","@tsconfig/recommended":"^1.0.3","@langchain/standard-tests":"workspace:*"},"peerDependencies":{"@langchain/core":"workspace:^"},"_npmOperationalInternal":{"tmp":"tmp/langchain-google-genai_2.1.29_1777468451627_0.11326253657278929","host":"s3://npm-registry-packages-npm-production"}},"2.1.30":{"name":"@dakshp1234/langchain-google-genai","version":"2.1.30","description":"Google Generative AI integration for LangChain.js","author":{"name":"LangChain"},"license":"MIT","type":"module","engines":{"node":">=20"},"repository":{"type":"git","url":"git+ssh://git@github.com/langchain-ai/langchainjs.git"},"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-google-genai/","scripts":{"build":"turbo build:compile --filter @dakshp1234/langchain-google-genai --output-logs new-only","build:compile":"tsdown","clean":"rm -rf .turbo dist/","test":"vitest run","test:watch":"vitest","test:single":"vitest run","test:int":"vitest run --mode int","test:standard:unit":"vitest run --mode standard-unit","test:standard:int":"vitest run --mode standard-int","test:standard":"pnpm test:standard:unit && pnpm test:standard:int","typegen":"pnpm run typegen:profiles","typegen:profiles":"pnpm --filter @langchain/model-profiles make --config profiles.toml"},"dependencies":{"@google/generative-ai":"^0.24.0"},"peerDependencies":{"@langchain/core":"^1.1.42"},"devDependencies":{"@langchain/core":"^1.1.42","@langchain/standard-tests":"0.0.23","@langchain/tsconfig":"0.0.1","@tsconfig/recommended":"^1.0.3","dotenv":"^17.4.0","dpdm":"^3.14.0","hnswlib-node":"^3.0.0","typescript":"~5.8.3","vitest":"^4.1.2","zod":"^3.25.76"},"publishConfig":{"access":"public"},"main":"./dist/index.cjs","types":"./dist/index.d.cts","exports":{".":{"input":"./src/index.ts","require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./package.json":"./package.json"},"module":"./dist/index.js","gitHead":"e57c7c902fddcefa294fd5c8087744cb29b7451d","_id":"@dakshp1234/langchain-google-genai@2.1.30","bugs":{"url":"https://github.com/langchain-ai/langchainjs/issues"},"_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-yl6VjIZjc3H11mJ5chBtEObOaudQ8NEYP3CYYpZAOmOCMgnPpSGipWFFILpBhG9Wb+ETSKiORYG/7m0Ul4IG6g==","shasum":"8fa6d17bc8b9c55f8a2dbdd0c06afbae0ab44812","tarball":"https://registry.npmjs.org/@dakshp1234/langchain-google-genai/-/langchain-google-genai-2.1.30.tgz","fileCount":52,"unpackedSize":462523,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBepDf1GsxbmesS1Z/HOEk/FXWy+Z4Qq6mdAi65k+j5ZAiBc6qCsX9nlBGTJvZZHvuhoz0rWGwLZZkqnHgffCopSSw=="}]},"_npmUser":{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"},"directories":{},"maintainers":[{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/langchain-google-genai_2.1.30_1777896116472_0.5165704099176214"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-10T02:44:25.589Z","modified":"2026-05-04T12:01:56.876Z","2.1.26":"2026-04-10T02:44:25.870Z","2.1.27":"2026-04-10T02:57:23.120Z","2.1.28":"2026-04-10T07:27:41.295Z","2.1.29":"2026-04-29T13:14:11.764Z","2.1.30":"2026-05-04T12:01:56.748Z"},"bugs":{"url":"https://github.com/langchain-ai/langchainjs/issues"},"author":{"name":"LangChain"},"license":"MIT","homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-google-genai/","repository":{"type":"git","url":"git+ssh://git@github.com/langchain-ai/langchainjs.git"},"description":"Google Generative AI integration for LangChain.js","maintainers":[{"name":"dakshpurohit","email":"dakshpurohit2005@gmail.com"}],"readme":"# @langchain/google-genai\n\nThis package contains the LangChain.js integrations for Gemini through their generative-ai SDK.\n\n## Installation\n\n```bash npm2yarn\nnpm install @langchain/google-genai @langchain/core\n```\n\nThis package, along with the main LangChain package, depends on [`@langchain/core`](https://npmjs.com/package/@langchain/core/).\nIf you are using this package with other LangChain packages, you should make sure that all of the packages depend on the same instance of @langchain/core.\nYou can do so by adding appropriate field to your project's `package.json` like this:\n\n```json\n{\n  \"name\": \"your-project\",\n  \"version\": \"0.0.0\",\n  \"dependencies\": {\n    \"@langchain/core\": \"^0.3.0\",\n    \"@langchain/google-genai\": \"^0.0.0\"\n  },\n  \"resolutions\": {\n    \"@langchain/core\": \"^0.3.0\"\n  },\n  \"overrides\": {\n    \"@langchain/core\": \"^0.3.0\"\n  },\n  \"pnpm\": {\n    \"overrides\": {\n      \"@langchain/core\": \"^0.3.0\"\n    }\n  }\n}\n```\n\nThe field you need depends on the package manager you're using, but we recommend adding a field for the common `yarn`, `npm`, and `pnpm` to maximize compatibility.\n\n## Chat Models\n\nThis package contains the `ChatGoogleGenerativeAI` class, which is the recommended way to interface with the Google Gemini series of models.\n\nTo use, install the requirements, and configure your environment.\n\n```bash\nexport GOOGLE_API_KEY=your-api-key\n```\n\nThen initialize\n\n```typescript\nimport { ChatGoogleGenerativeAI } from \"@langchain/google-genai\";\nimport { HumanMessage } from \"@langchain/core/messages\";\n\nconst model = new ChatGoogleGenerativeAI({\n  model: \"gemini-pro\",\n  maxOutputTokens: 2048,\n});\nconst response = await model.invoke(new HumanMessage(\"Hello world!\"));\n```\n\n#### Multimodal inputs\n\nGemini vision model supports image inputs when providing a single chat message. Example:\n\n```bash npm2yarn\npnpm install @langchain/core\n```\n\n```typescript\nimport fs from \"fs\";\nimport { ChatGoogleGenerativeAI } from \"@langchain/google-genai\";\nimport { HumanMessage } from \"@langchain/core/messages\";\n\nconst vision = new ChatGoogleGenerativeAI({\n  model: \"gemini-pro-vision\",\n  maxOutputTokens: 2048,\n});\nconst image = fs.readFileSync(\"./hotdog.jpg\").toString(\"base64\");\nconst input = [\n  new HumanMessage({\n    content: [\n      {\n        type: \"text\",\n        text: \"Describe the following image.\",\n      },\n      {\n        type: \"image_url\",\n        image_url: `data:image/png;base64,${image}`,\n      },\n    ],\n  }),\n];\n\nconst res = await vision.invoke(input);\n```\n\nThe value of `image_url` can be any of the following:\n\n- A public image URL\n- An accessible gcs file (e.g., \"gcs://path/to/file.png\")\n- A base64 encoded image (e.g., `data:image/png;base64,abcd124`)\n- A PIL image\n\n## Embeddings\n\nThis package also adds support for google's embeddings models.\n\n```typescript\nimport { GoogleGenerativeAIEmbeddings } from \"@langchain/google-genai\";\nimport { TaskType } from \"@google/generative-ai\";\n\nconst embeddings = new GoogleGenerativeAIEmbeddings({\n  modelName: \"embedding-001\", // 768 dimensions\n  taskType: TaskType.RETRIEVAL_DOCUMENT,\n  title: \"Document title\",\n});\n\nconst res = await embeddings.embedQuery(\"OK Google\");\n```\n\n## Development\n\nTo develop the Google GenAI package, you'll need to follow these instructions:\n\n### Install dependencies\n\n```bash\npnpm install\n```\n\n### Build the package\n\n```bash\npnpm build\n```\n\nOr from the repo root:\n\n```bash\npnpm build --filter @langchain/google-genai\n```\n\n### Run tests\n\nTest files should live within a `tests/` file in the `src/` folder. Unit tests should end in `.test.ts` and integration tests should\nend in `.int.test.ts`:\n\n```bash\n$ pnpm test\n$ pnpm test:int\n```\n\n### Lint & Format\n\nRun the linter & formatter to ensure your code is up to standard:\n\n```bash\npnpm lint && pnpm format\n```\n\n### Adding new entrypoints\n\nIf you add a new file to be exported, either import & re-export from `src/index.ts`, or add it to the `exports` field in the `package.json` file and run `pnpm build` to generate the new entrypoint.\n","readmeFilename":"README.md"}