{"_id":"@bytebitlabs/nest-google-genai","_rev":"7-5f0a46d02fb17e813eb16c0bdd0aefa8","name":"@bytebitlabs/nest-google-genai","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"@bytebitlabs/nest-google-genai","version":"0.1.0","license":"MIT","_id":"@bytebitlabs/nest-google-genai@0.1.0","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"ee56d0d9ae7e7441a903ddea49907af8183f5bc5","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-google-genai/-/nest-google-genai-0.1.0.tgz","fileCount":20,"integrity":"sha512-hOPdX5gDSYuAkPuXza9B6kTE2fhl7Lp6P0S+W9XEKEIh8iHOtODC3zfDSPWYdbiV7/vZ3yf0eYDyPqKjpVzJrA==","signatures":[{"sig":"MEUCIQCXL+nPbReRAmsxYUQ1y/hHr6corD78xYWT55HBG1BkMAIgc415h8jE6PJvftZjl15FkwSqUAFjIvdUhQ4TYx+dYlo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11812},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"7ef6f8df4e9fdc0b5484ffb606791b86197af767","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-google-genai_0.1.0_1723730103157_0.013920898718999597","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@bytebitlabs/nest-google-genai","version":"0.1.1","license":"MIT","_id":"@bytebitlabs/nest-google-genai@0.1.1","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"209ab152b0202a5d89f4764df50baa1a18df7bdd","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-google-genai/-/nest-google-genai-0.1.1.tgz","fileCount":20,"integrity":"sha512-mAA57dcjHCSyt0xHBZxMWVyy5o6gorXnf7xj4g75IC5NixqhNdPTWPvD/DVv9EKENMhU6ZwiN6/dp/y96eI5Bw==","signatures":[{"sig":"MEUCIQClPqk1QNcvM6RQPz44i8j40VViqRjwrgsfP7x3iES28QIgGBpT5UK3BoCl04dJeTq+8O222xSDC+JoeEOn4htROfo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11812},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"9ac581ff68f03d00df4a88865f2f1744a9ed2656","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-google-genai_0.1.1_1723745041177_0.32843200088621183","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@bytebitlabs/nest-google-genai","version":"0.1.3","license":"MIT","_id":"@bytebitlabs/nest-google-genai@0.1.3","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"1c01dd35c0c111f206b7675116021684851453a5","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-google-genai/-/nest-google-genai-0.1.3.tgz","fileCount":20,"integrity":"sha512-5bjbuMdbQQPJB/sCVOaOTe9G9wjQxbx56RxY1/Inwt39wTziEN65YFcSLAIhPxSp+bEfiswU2APYkbSzpAyOSg==","signatures":[{"sig":"MEYCIQDJeydVTaVAAQZJ0JqewmdVLT/hUfgrX/nf/IAC5V5XPQIhANX5EuoZqPS1dNvRS6mz6mkcQPY5rvu/v1dTIYbx1tUv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11812},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"bd1b5bf77c1e81013bb06d56f6d802aea7440d43","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-google-genai_0.1.3_1727159150426_0.6603463859109389","host":"s3://npm-registry-packages"}},"1.0.0-0":{"name":"@bytebitlabs/nest-google-genai","version":"1.0.0-0","license":"MIT","_id":"@bytebitlabs/nest-google-genai@1.0.0-0","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"7f4ed4c5ca204198284fca5d8bc49fccfd7f342b","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-google-genai/-/nest-google-genai-1.0.0-0.tgz","fileCount":20,"integrity":"sha512-Jw0YCdDMB74lnFiMGZJ+bRmDjI68IZfgyljtgho0U11w0CmoaCfJicQ8dAvidsTEohq8Qd2CzYXoUu6E/jg2kA==","signatures":[{"sig":"MEYCIQD/AiU1PlmZT/UIHyJvCEprHTBTOnW0f5VWTMfIg+Qo4QIhALHBgtmiQAVbR95NqaKCN268nLT7VHv4d7LE26+uVjgH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11814},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"ba9fcdf8beb2775837215e03b516a4157388989a","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-google-genai_1.0.0-0_1731382848030_0.15926456126719213","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@bytebitlabs/nest-google-genai","version":"1.0.0","license":"MIT","_id":"@bytebitlabs/nest-google-genai@1.0.0","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"aeda75a144c53d0a8c6c43e4710aa3f6eda83b9a","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-google-genai/-/nest-google-genai-1.0.0.tgz","fileCount":20,"integrity":"sha512-32gySO53llK+6gXEB3+seqH5VwKeaaNAQmO5M7mA/vxWTXsV3u+LrVQDd8ide96i6fxyqEyzAiIT4mEmoS2x4g==","signatures":[{"sig":"MEUCIFm4wq2l5Lvl74WxB8xtSybQ6hyO4Yj9/+RvQtNk+hXTAiEAuYhGUkQ5tfgApd24cLa8c4vZexWihEkLvIn3hLuR9ps=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11812},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"b2be2b59aa13ee02489dfa1745f08fe31fe3b14f","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-google-genai_1.0.0_1735549387062_0.36962711722285957","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bytebitlabs/nest-google-genai","version":"1.0.1","license":"MIT","_id":"@bytebitlabs/nest-google-genai@1.0.1","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"5c0539b184a0fef9abed1024adfcf4e9bcf33d5f","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-google-genai/-/nest-google-genai-1.0.1.tgz","fileCount":20,"integrity":"sha512-V3tNBHMUuyQ0UQQvJQKXZ0Czy1kZj803mnXRHSENO3hTgp7RfutiJpRCD00M9isKNwBH6OGsVmYBvyxpxKubPA==","signatures":[{"sig":"MEYCIQCz4NhFutJ2Vawo/2bEqYHfYO8Ch+er9As4D7+xIW/z4AIhAI3/c+ihWD0OxoSXdQLB58QvlayksmIHtDVZjR+Oovbq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11812},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"e3e3e03a508e6b132b6a366cd0bd02e9d01594cb","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-google-genai_1.0.1_1737347961774_0.5478898875323179","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@bytebitlabs/nest-google-genai","version":"1.1.0","license":"MIT","dependencies":{"tslib":"^2.3.0"},"type":"commonjs","main":"./src/index.js","typings":"./src/index.d.ts","publishConfig":{"access":"public"},"types":"./src/index.d.ts","_id":"@bytebitlabs/nest-google-genai@1.1.0","gitHead":"e82f08bce74eb7b91dfd7fd7ffc0423f08ccaec5","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-V2e4naWA1N0vijCPdqWsGmxce9228jibfZE909002C1io8Pwg9gMR5Yp5onuR5paHW12uBx0CE9nLzbNkjbYUw==","shasum":"3195c9ae2a4bd2a85fda72703f9b4eaa998855bd","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-google-genai/-/nest-google-genai-1.1.0.tgz","fileCount":20,"unpackedSize":11812,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCWntYnrJwS9pceLcxhVPFpofa7zdjALiC/MfafXeJ1UwIhAP9W7BkblE8z5WISGwSeEjEniQZFf/2BFGVemJD0GYRa"}]},"_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"directories":{},"maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nest-google-genai_1.1.0_1741581823440_0.9995088064576745"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-15T13:55:03.056Z","modified":"2025-03-10T04:43:44.075Z","0.1.0":"2024-08-15T13:55:03.340Z","0.1.1":"2024-08-15T18:04:01.378Z","0.1.3":"2024-09-24T06:25:50.639Z","1.0.0-0":"2024-11-12T03:40:48.183Z","1.0.0":"2024-12-30T09:03:07.218Z","1.0.1":"2025-01-20T04:39:21.965Z","1.1.0":"2025-03-10T04:43:43.615Z"},"license":"MIT","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"readme":"# nest-google-genai\n\n<p align=\"center\">\n  <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a>\n</p>\n\n<p align=\"center\">Google Generative AI module for nestjs</p>\n    <p align=\"center\">\n<a href=\"https://www.npmjs.com/package/@bytebitlabs/nest-google-genai\"><img src=\"https://img.shields.io/npm/v/@bytebitlabs/nest-google-genai\" alt=\"NPM Version\" /></a>\n<a href=\"https://www.npmjs.com/package/@bytebitlabs/nest-google-genai\"><img src=\"https://img.shields.io/npm/l/@bytebitlabs/nest-google-genai\" alt=\"Package License\" /></a>\n<a href=\"https://www.npmjs.com/package/@bytebitlabs/nest-google-genai\"><img src=\"https://img.shields.io/npm/dm/@bytebitlabs/nest-google-genai\" alt=\"NPM Downloads\" /></a>\n</p>\n\n## Description\n\nGoogle Generative AI module for [Nest](https://github.com/nestjs/nest) based on the official [@google/generative-ai](https://www.npmjs.com/package/@google/generative-ai) package.\n\n## Installation\n\n```bash\n$ npm i --save @bytebitlabs/nest-google-genai @google/generative-ai\n```\n\n## Usage\n\nImport `GoogleGenAiModule`:\n\n```typescript\n@Module({\n  imports: [GoogleGenAiModule.register({\n    apiKey: 'Abc...',\n  })],\n  providers: [...],\n})\nexport class AiModule {}\n```\n\nInject `GoogleGenAiService`:\n\n```typescript\n@Injectable()\nexport class AiService {\n  constructor(private readonly googleGenAiService: GoogleGenAiService) {}\n}\n```\n\n## Async options\n\nQuite often you might want to asynchronously pass your module options instead of passing them beforehand. In such case, use `registerAsync()` method, that provides a couple of various ways to deal with async data.\n\n**1. Use factory**\n\n```typescript\nGoogleGenAiModule.registerAsync({\n  useFactory: () => ({\n    apiKey: 'Abc...'\n  })\n});\n```\n\nObviously, our factory behaves like every other one (might be `async` and is able to inject dependencies through `inject`).\n\n```typescript\nGoogleGenAiModule.registerAsync({\n  imports: [ConfigModule],\n  useFactory: async (configService: ConfigService) => ({\n    apiKey: configService.get('GOOGLE_GEN_AI_API_KEY'),\n  }),\n  inject: [ConfigService],\n}),\n```\n\n**2. Use class**\n\n```typescript\nGoogleGenAiModule.registerAsync({\n  useClass: GoogleGenAiConfigService\n});\n```\n\nAbove construction will instantiate `GoogleGenAiConfigService` inside `GoogleGenAiModule` and will leverage it to create options object.\n\n```typescript\nclass GoogleGenAiConfigService implements OpenaiOptionsFactory {\n  createOpenaiOptions(): GoogleGenAiModuleOptions {\n    return {\n      apiKey: 'Abc...'\n    };\n  }\n}\n```\n\n**3. Use existing**\n\n```typescript\nGoogleGenAiModule.registerAsync({\n  imports: [ConfigModule],\n  useExisting: ConfigService,\n}),\n```\n\nIt works the same as `useClass` with one critical difference - `GoogleGenAiModule` will lookup imported modules to reuse already created `ConfigService`, instead of instantiating it on its own.\n\n## API Spec\n\nThe `GoogleGenAiService` wraps the `GoogleGenerativeAI` from the official [@google/generative-ai\n](https://www.npmjs.com/package/@google/generative-ai) methods. The `GoogleGenAiModule.register()` takes `options` object as an argument, [read more](https://ai.google.dev/gemini-api/docs/quickstart?lang=node).\n","readmeFilename":"README.md"}