From 7a79661e470bbfa1ae7061d786b9a377149128c4 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Fri, 29 Nov 2024 12:32:41 -0600 Subject: [PATCH] added Prettier and formatted files --- .eslintrc.js | 12 +- README.md | 25 +- node_modules/.pnpm/lock.yaml | 10 + package.json | 41 +-- pnpm-lock.yaml | 483 ++++++++++++++++++++++------------- src/envConfig.ts | 10 +- src/index.ts | 22 +- tsconfig.json | 47 ++-- 8 files changed, 396 insertions(+), 254 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 3237c3f..c6f5cfd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,8 +1,8 @@ module.exports = { - parserOptions: { - project: 'tsconfig.json', - tsconfigRootDir: __dirname, - sourceType: 'module', - }, - // ... rest + parserOptions: { + project: "tsconfig.json", + tsconfigRootDir: __dirname, + sourceType: "module", + }, + // ... rest }; diff --git a/README.md b/README.md index 33374f9..82dbc08 100644 --- a/README.md +++ b/README.md @@ -3,34 +3,41 @@ This project contains a collection of queries and scripts to interact with Google Gemini. ## Table of Contents + - [Introduction](#introduction) - [Installation](#installation) - [Usage](#usage) - [License](#license) ## Introduction + Google Gemini Queries is a project aimed at simplifying the process of querying and interacting with Google Gemini. It provides a set of pre-defined queries and scripts to help users get started quickly. ## Installation + To install the necessary dependencies, run: + ```bash pnpm install ``` ## Usage + To use the queries and scripts, follow these steps: + 1. Clone the repository: - ```bash - git clone https://github.com/yourusername/google-gemini-queries.git - ``` + ```bash + git clone https://github.com/yourusername/google-gemini-queries.git + ``` 2. Navigate to the project directory: - ```bash - cd google-gemini-queries - ``` + ```bash + cd google-gemini-queries + ``` 3. Run the desired query or script: - ```bash - node script_name.js - ``` + ```bash + node script_name.js + ``` ## License + This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information. diff --git a/node_modules/.pnpm/lock.yaml b/node_modules/.pnpm/lock.yaml index 75c722b..67cd48d 100644 --- a/node_modules/.pnpm/lock.yaml +++ b/node_modules/.pnpm/lock.yaml @@ -24,6 +24,9 @@ importers: i: specifier: ^0.3.7 version: 0.3.7 + prettier: + specifier: 3.4.1 + version: 3.4.1 typescript: specifier: ^5.7.2 version: 5.7.2 @@ -174,6 +177,11 @@ packages: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} + prettier@3.4.1: + resolution: {integrity: sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==} + engines: {node: '>=14'} + hasBin: true + safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -369,6 +377,8 @@ snapshots: os-tmpdir@1.0.2: {} + prettier@3.4.1: {} + safer-buffer@2.1.2: {} signal-exit@4.1.0: {} diff --git a/package.json b/package.json index 1da44ec..0b12fb3 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,23 @@ { - "devDependencies": { - "@types/node": "^22.10.1", - "i": "^0.3.7", - "typescript": "^5.7.2" - }, - "packageManager": "pnpm@9.2.0+sha1.886364ebd6dae009284bebc56ed4296bb6dd557a", - "dependencies": { - "@google/generative-ai": "^0.21.0", - "@inquirer/prompts": "^7.1.0", - "dotenv": "^16.4.5" - }, - "type": "module", - "scripts": { - "transpile": "tsc", - "build": "tsc --build && node dist/index.js" - }, - "engines": { - "pnpm": "^9.2.0", - "node": "22" - } + "devDependencies": { + "@types/node": "^22.10.1", + "i": "^0.3.7", + "prettier": "3.4.1", + "typescript": "^5.7.2" + }, + "packageManager": "pnpm@9.2.0+sha1.886364ebd6dae009284bebc56ed4296bb6dd557a", + "dependencies": { + "@google/generative-ai": "^0.21.0", + "@inquirer/prompts": "^7.1.0", + "dotenv": "^16.4.5" + }, + "type": "module", + "scripts": { + "transpile": "tsc", + "build": "tsc --build && node dist/index.js" + }, + "engines": { + "pnpm": "^9.2.0", + "node": "22" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 75c722b..99d43f5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,241 +1,372 @@ -lockfileVersion: '9.0' +lockfileVersion: "9.0" settings: autoInstallPeers: true excludeLinksFromLockfile: false importers: - .: dependencies: - '@google/generative-ai': + "@google/generative-ai": specifier: ^0.21.0 version: 0.21.0 - '@inquirer/prompts': + "@inquirer/prompts": specifier: ^7.1.0 version: 7.1.0(@types/node@22.10.1) dotenv: specifier: ^16.4.5 version: 16.4.5 devDependencies: - '@types/node': + "@types/node": specifier: ^22.10.1 version: 22.10.1 i: specifier: ^0.3.7 version: 0.3.7 + prettier: + specifier: 3.4.1 + version: 3.4.1 typescript: specifier: ^5.7.2 version: 5.7.2 packages: + "@google/generative-ai@0.21.0": + resolution: + { + integrity: sha512-7XhUbtnlkSEZK15kN3t+tzIMxsbKm/dSkKBFalj+20NvPKe1kBY7mR2P7vuijEn+f06z5+A8bVGKO0v39cr6Wg==, + } + engines: { node: ">=18.0.0" } - '@google/generative-ai@0.21.0': - resolution: {integrity: sha512-7XhUbtnlkSEZK15kN3t+tzIMxsbKm/dSkKBFalj+20NvPKe1kBY7mR2P7vuijEn+f06z5+A8bVGKO0v39cr6Wg==} - engines: {node: '>=18.0.0'} - - '@inquirer/checkbox@4.0.2': - resolution: {integrity: sha512-+gznPl8ip8P8HYHYecDtUtdsh1t2jvb+sWCD72GAiZ9m45RqwrLmReDaqdC0umQfamtFXVRoMVJ2/qINKGm9Tg==} - engines: {node: '>=18'} + "@inquirer/checkbox@4.0.2": + resolution: + { + integrity: sha512-+gznPl8ip8P8HYHYecDtUtdsh1t2jvb+sWCD72GAiZ9m45RqwrLmReDaqdC0umQfamtFXVRoMVJ2/qINKGm9Tg==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/confirm@5.0.2': - resolution: {integrity: sha512-KJLUHOaKnNCYzwVbryj3TNBxyZIrr56fR5N45v6K9IPrbT6B7DcudBMfylkV1A8PUdJE15mybkEQyp2/ZUpxUA==} - engines: {node: '>=18'} + "@inquirer/confirm@5.0.2": + resolution: + { + integrity: sha512-KJLUHOaKnNCYzwVbryj3TNBxyZIrr56fR5N45v6K9IPrbT6B7DcudBMfylkV1A8PUdJE15mybkEQyp2/ZUpxUA==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/core@10.1.0': - resolution: {integrity: sha512-I+ETk2AL+yAVbvuKx5AJpQmoaWhpiTFOg/UJb7ZkMAK4blmtG8ATh5ct+T/8xNld0CZG/2UhtkdMwpgvld92XQ==} - engines: {node: '>=18'} + "@inquirer/core@10.1.0": + resolution: + { + integrity: sha512-I+ETk2AL+yAVbvuKx5AJpQmoaWhpiTFOg/UJb7ZkMAK4blmtG8ATh5ct+T/8xNld0CZG/2UhtkdMwpgvld92XQ==, + } + engines: { node: ">=18" } - '@inquirer/editor@4.1.0': - resolution: {integrity: sha512-K1gGWsxEqO23tVdp5MT3H799OZ4ER1za7Dlc8F4um0W7lwSv0KGR/YyrUEyimj0g7dXZd8XknM/5QA2/Uy+TbA==} - engines: {node: '>=18'} + "@inquirer/editor@4.1.0": + resolution: + { + integrity: sha512-K1gGWsxEqO23tVdp5MT3H799OZ4ER1za7Dlc8F4um0W7lwSv0KGR/YyrUEyimj0g7dXZd8XknM/5QA2/Uy+TbA==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/expand@4.0.2': - resolution: {integrity: sha512-WdgCX1cUtinz+syKyZdJomovULYlKUWZbVYZzhf+ZeeYf4htAQ3jLymoNs3koIAKfZZl3HUBb819ClCBfyznaw==} - engines: {node: '>=18'} + "@inquirer/expand@4.0.2": + resolution: + { + integrity: sha512-WdgCX1cUtinz+syKyZdJomovULYlKUWZbVYZzhf+ZeeYf4htAQ3jLymoNs3koIAKfZZl3HUBb819ClCBfyznaw==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/figures@1.0.8': - resolution: {integrity: sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==} - engines: {node: '>=18'} + "@inquirer/figures@1.0.8": + resolution: + { + integrity: sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==, + } + engines: { node: ">=18" } - '@inquirer/input@4.0.2': - resolution: {integrity: sha512-yCLCraigU085EcdpIVEDgyfGv4vBiE4I+k1qRkc9C5dMjWF42ADMGy1RFU94+eZlz4YlkmFsiyHZy0W1wdhaNg==} - engines: {node: '>=18'} + "@inquirer/input@4.0.2": + resolution: + { + integrity: sha512-yCLCraigU085EcdpIVEDgyfGv4vBiE4I+k1qRkc9C5dMjWF42ADMGy1RFU94+eZlz4YlkmFsiyHZy0W1wdhaNg==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/number@3.0.2': - resolution: {integrity: sha512-MKQhYofdUNk7eqJtz52KvM1dH6R93OMrqHduXCvuefKrsiMjHiMwjc3NZw5Imm2nqY7gWd9xdhYrtcHMJQZUxA==} - engines: {node: '>=18'} + "@inquirer/number@3.0.2": + resolution: + { + integrity: sha512-MKQhYofdUNk7eqJtz52KvM1dH6R93OMrqHduXCvuefKrsiMjHiMwjc3NZw5Imm2nqY7gWd9xdhYrtcHMJQZUxA==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/password@4.0.2': - resolution: {integrity: sha512-tQXGSu7IO07gsYlGy3VgXRVsbOWqFBMbqAUrJSc1PDTQQ5Qdm+QVwkP0OC0jnUZ62D19iPgXOMO+tnWG+HhjNQ==} - engines: {node: '>=18'} + "@inquirer/password@4.0.2": + resolution: + { + integrity: sha512-tQXGSu7IO07gsYlGy3VgXRVsbOWqFBMbqAUrJSc1PDTQQ5Qdm+QVwkP0OC0jnUZ62D19iPgXOMO+tnWG+HhjNQ==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/prompts@7.1.0': - resolution: {integrity: sha512-5U/XiVRH2pp1X6gpNAjWOglMf38/Ys522ncEHIKT1voRUvSj/DQnR22OVxHnwu5S+rCFaUiPQ57JOtMFQayqYA==} - engines: {node: '>=18'} + "@inquirer/prompts@7.1.0": + resolution: + { + integrity: sha512-5U/XiVRH2pp1X6gpNAjWOglMf38/Ys522ncEHIKT1voRUvSj/DQnR22OVxHnwu5S+rCFaUiPQ57JOtMFQayqYA==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/rawlist@4.0.2': - resolution: {integrity: sha512-3XGcskMoVF8H0Dl1S5TSZ3rMPPBWXRcM0VeNVsS4ByWeWjSeb0lPqfnBg6N7T0608I1B2bSVnbi2cwCrmOD1Yw==} - engines: {node: '>=18'} + "@inquirer/rawlist@4.0.2": + resolution: + { + integrity: sha512-3XGcskMoVF8H0Dl1S5TSZ3rMPPBWXRcM0VeNVsS4ByWeWjSeb0lPqfnBg6N7T0608I1B2bSVnbi2cwCrmOD1Yw==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/search@3.0.2': - resolution: {integrity: sha512-Zv4FC7w4dJ13BOJfKRQCICQfShinGjb1bCEIHxTSnjj2telu3+3RHwHubPG9HyD4aix5s+lyAMEK/wSFD75HLA==} - engines: {node: '>=18'} + "@inquirer/search@3.0.2": + resolution: + { + integrity: sha512-Zv4FC7w4dJ13BOJfKRQCICQfShinGjb1bCEIHxTSnjj2telu3+3RHwHubPG9HyD4aix5s+lyAMEK/wSFD75HLA==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/select@4.0.2': - resolution: {integrity: sha512-uSWUzaSYAEj0hlzxa1mUB6VqrKaYx0QxGBLZzU4xWFxaSyGaXxsSE4OSOwdU24j0xl8OajgayqFXW0l2bkl2kg==} - engines: {node: '>=18'} + "@inquirer/select@4.0.2": + resolution: + { + integrity: sha512-uSWUzaSYAEj0hlzxa1mUB6VqrKaYx0QxGBLZzU4xWFxaSyGaXxsSE4OSOwdU24j0xl8OajgayqFXW0l2bkl2kg==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@inquirer/type@3.0.1': - resolution: {integrity: sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==} - engines: {node: '>=18'} + "@inquirer/type@3.0.1": + resolution: + { + integrity: sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==, + } + engines: { node: ">=18" } peerDependencies: - '@types/node': '>=18' + "@types/node": ">=18" - '@types/node@22.10.1': - resolution: {integrity: sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==} + "@types/node@22.10.1": + resolution: + { + integrity: sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==, + } ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==, + } + engines: { node: ">=8" } ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==, + } + engines: { node: ">=8" } ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==, + } + engines: { node: ">=8" } chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + resolution: + { + integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==, + } cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} + resolution: + { + integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==, + } + engines: { node: ">= 12" } color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} + resolution: + { + integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==, + } + engines: { node: ">=7.0.0" } color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + resolution: + { + integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==, + } dotenv@16.4.5: - resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} - engines: {node: '>=12'} + resolution: + { + integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==, + } + engines: { node: ">=12" } emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + resolution: + { + integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==, + } external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} + resolution: + { + integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==, + } + engines: { node: ">=4" } i@0.3.7: - resolution: {integrity: sha512-FYz4wlXgkQwIPqhzC5TdNMLSE5+GS1IIDJZY/1ZiEPCT2S3COUVZeT5OW4BmW4r5LHLQuOosSwsvnroG9GR59Q==} - engines: {node: '>=0.4'} + resolution: + { + integrity: sha512-FYz4wlXgkQwIPqhzC5TdNMLSE5+GS1IIDJZY/1ZiEPCT2S3COUVZeT5OW4BmW4r5LHLQuOosSwsvnroG9GR59Q==, + } + engines: { node: ">=0.4" } iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==, + } + engines: { node: ">=0.10.0" } is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==, + } + engines: { node: ">=8" } mute-stream@2.0.0: - resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} - engines: {node: ^18.17.0 || >=20.5.0} + resolution: + { + integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==, + } + engines: { node: ^18.17.0 || >=20.5.0 } os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==, + } + engines: { node: ">=0.10.0" } + + prettier@3.4.1: + resolution: + { + integrity: sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==, + } + engines: { node: ">=14" } + hasBin: true safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + resolution: + { + integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==, + } signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} + resolution: + { + integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==, + } + engines: { node: ">=14" } string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==, + } + engines: { node: ">=8" } strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==, + } + engines: { node: ">=8" } tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} + resolution: + { + integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==, + } + engines: { node: ">=0.6.0" } type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==, + } + engines: { node: ">=10" } typescript@5.7.2: - resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} - engines: {node: '>=14.17'} + resolution: + { + integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==, + } + engines: { node: ">=14.17" } hasBin: true undici-types@6.20.0: - resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + resolution: + { + integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==, + } wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==, + } + engines: { node: ">=8" } yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} + resolution: + { + integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==, + } + engines: { node: ">=18" } snapshots: + "@google/generative-ai@0.21.0": {} - '@google/generative-ai@0.21.0': {} - - '@inquirer/checkbox@4.0.2(@types/node@22.10.1)': + "@inquirer/checkbox@4.0.2(@types/node@22.10.1)": dependencies: - '@inquirer/core': 10.1.0(@types/node@22.10.1) - '@inquirer/figures': 1.0.8 - '@inquirer/type': 3.0.1(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/core": 10.1.0(@types/node@22.10.1) + "@inquirer/figures": 1.0.8 + "@inquirer/type": 3.0.1(@types/node@22.10.1) + "@types/node": 22.10.1 ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 - '@inquirer/confirm@5.0.2(@types/node@22.10.1)': + "@inquirer/confirm@5.0.2(@types/node@22.10.1)": dependencies: - '@inquirer/core': 10.1.0(@types/node@22.10.1) - '@inquirer/type': 3.0.1(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/core": 10.1.0(@types/node@22.10.1) + "@inquirer/type": 3.0.1(@types/node@22.10.1) + "@types/node": 22.10.1 - '@inquirer/core@10.1.0(@types/node@22.10.1)': + "@inquirer/core@10.1.0(@types/node@22.10.1)": dependencies: - '@inquirer/figures': 1.0.8 - '@inquirer/type': 3.0.1(@types/node@22.10.1) + "@inquirer/figures": 1.0.8 + "@inquirer/type": 3.0.1(@types/node@22.10.1) ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 @@ -244,86 +375,86 @@ snapshots: wrap-ansi: 6.2.0 yoctocolors-cjs: 2.1.2 transitivePeerDependencies: - - '@types/node' + - "@types/node" - '@inquirer/editor@4.1.0(@types/node@22.10.1)': + "@inquirer/editor@4.1.0(@types/node@22.10.1)": dependencies: - '@inquirer/core': 10.1.0(@types/node@22.10.1) - '@inquirer/type': 3.0.1(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/core": 10.1.0(@types/node@22.10.1) + "@inquirer/type": 3.0.1(@types/node@22.10.1) + "@types/node": 22.10.1 external-editor: 3.1.0 - '@inquirer/expand@4.0.2(@types/node@22.10.1)': + "@inquirer/expand@4.0.2(@types/node@22.10.1)": dependencies: - '@inquirer/core': 10.1.0(@types/node@22.10.1) - '@inquirer/type': 3.0.1(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/core": 10.1.0(@types/node@22.10.1) + "@inquirer/type": 3.0.1(@types/node@22.10.1) + "@types/node": 22.10.1 yoctocolors-cjs: 2.1.2 - '@inquirer/figures@1.0.8': {} + "@inquirer/figures@1.0.8": {} - '@inquirer/input@4.0.2(@types/node@22.10.1)': + "@inquirer/input@4.0.2(@types/node@22.10.1)": dependencies: - '@inquirer/core': 10.1.0(@types/node@22.10.1) - '@inquirer/type': 3.0.1(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/core": 10.1.0(@types/node@22.10.1) + "@inquirer/type": 3.0.1(@types/node@22.10.1) + "@types/node": 22.10.1 - '@inquirer/number@3.0.2(@types/node@22.10.1)': + "@inquirer/number@3.0.2(@types/node@22.10.1)": dependencies: - '@inquirer/core': 10.1.0(@types/node@22.10.1) - '@inquirer/type': 3.0.1(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/core": 10.1.0(@types/node@22.10.1) + "@inquirer/type": 3.0.1(@types/node@22.10.1) + "@types/node": 22.10.1 - '@inquirer/password@4.0.2(@types/node@22.10.1)': + "@inquirer/password@4.0.2(@types/node@22.10.1)": dependencies: - '@inquirer/core': 10.1.0(@types/node@22.10.1) - '@inquirer/type': 3.0.1(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/core": 10.1.0(@types/node@22.10.1) + "@inquirer/type": 3.0.1(@types/node@22.10.1) + "@types/node": 22.10.1 ansi-escapes: 4.3.2 - '@inquirer/prompts@7.1.0(@types/node@22.10.1)': + "@inquirer/prompts@7.1.0(@types/node@22.10.1)": dependencies: - '@inquirer/checkbox': 4.0.2(@types/node@22.10.1) - '@inquirer/confirm': 5.0.2(@types/node@22.10.1) - '@inquirer/editor': 4.1.0(@types/node@22.10.1) - '@inquirer/expand': 4.0.2(@types/node@22.10.1) - '@inquirer/input': 4.0.2(@types/node@22.10.1) - '@inquirer/number': 3.0.2(@types/node@22.10.1) - '@inquirer/password': 4.0.2(@types/node@22.10.1) - '@inquirer/rawlist': 4.0.2(@types/node@22.10.1) - '@inquirer/search': 3.0.2(@types/node@22.10.1) - '@inquirer/select': 4.0.2(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/checkbox": 4.0.2(@types/node@22.10.1) + "@inquirer/confirm": 5.0.2(@types/node@22.10.1) + "@inquirer/editor": 4.1.0(@types/node@22.10.1) + "@inquirer/expand": 4.0.2(@types/node@22.10.1) + "@inquirer/input": 4.0.2(@types/node@22.10.1) + "@inquirer/number": 3.0.2(@types/node@22.10.1) + "@inquirer/password": 4.0.2(@types/node@22.10.1) + "@inquirer/rawlist": 4.0.2(@types/node@22.10.1) + "@inquirer/search": 3.0.2(@types/node@22.10.1) + "@inquirer/select": 4.0.2(@types/node@22.10.1) + "@types/node": 22.10.1 - '@inquirer/rawlist@4.0.2(@types/node@22.10.1)': + "@inquirer/rawlist@4.0.2(@types/node@22.10.1)": dependencies: - '@inquirer/core': 10.1.0(@types/node@22.10.1) - '@inquirer/type': 3.0.1(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/core": 10.1.0(@types/node@22.10.1) + "@inquirer/type": 3.0.1(@types/node@22.10.1) + "@types/node": 22.10.1 yoctocolors-cjs: 2.1.2 - '@inquirer/search@3.0.2(@types/node@22.10.1)': + "@inquirer/search@3.0.2(@types/node@22.10.1)": dependencies: - '@inquirer/core': 10.1.0(@types/node@22.10.1) - '@inquirer/figures': 1.0.8 - '@inquirer/type': 3.0.1(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/core": 10.1.0(@types/node@22.10.1) + "@inquirer/figures": 1.0.8 + "@inquirer/type": 3.0.1(@types/node@22.10.1) + "@types/node": 22.10.1 yoctocolors-cjs: 2.1.2 - '@inquirer/select@4.0.2(@types/node@22.10.1)': + "@inquirer/select@4.0.2(@types/node@22.10.1)": dependencies: - '@inquirer/core': 10.1.0(@types/node@22.10.1) - '@inquirer/figures': 1.0.8 - '@inquirer/type': 3.0.1(@types/node@22.10.1) - '@types/node': 22.10.1 + "@inquirer/core": 10.1.0(@types/node@22.10.1) + "@inquirer/figures": 1.0.8 + "@inquirer/type": 3.0.1(@types/node@22.10.1) + "@types/node": 22.10.1 ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 - '@inquirer/type@3.0.1(@types/node@22.10.1)': + "@inquirer/type@3.0.1(@types/node@22.10.1)": dependencies: - '@types/node': 22.10.1 + "@types/node": 22.10.1 - '@types/node@22.10.1': + "@types/node@22.10.1": dependencies: undici-types: 6.20.0 @@ -369,6 +500,8 @@ snapshots: os-tmpdir@1.0.2: {} + prettier@3.4.1: {} + safer-buffer@2.1.2: {} signal-exit@4.1.0: {} diff --git a/src/envConfig.ts b/src/envConfig.ts index b3d93db..6519a67 100644 --- a/src/envConfig.ts +++ b/src/envConfig.ts @@ -1,7 +1,7 @@ -import { config } from 'dotenv'; +import { config } from "dotenv"; export function envConfig() { - // Load environment variables from multiple .env files - config({ path: '.env.local' }); - config({ path: '.env' }); -} \ No newline at end of file + // Load environment variables from multiple .env files + config({ path: ".env.local" }); + config({ path: ".env" }); +} diff --git a/src/index.ts b/src/index.ts index cd2a7d4..8a103ab 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,21 +1,21 @@ import { GoogleGenerativeAI } from "@google/generative-ai"; -import { input } from '@inquirer/prompts'; -import { envConfig } from './envConfig.js'; +import { input } from "@inquirer/prompts"; +import { envConfig } from "./envConfig.js"; export async function geminiClient() { - envConfig(); + envConfig(); - const genAI = new GoogleGenerativeAI(process.env.API_KEY as string); + const genAI = new GoogleGenerativeAI(process.env.API_KEY as string); - const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro" }); + const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro" }); - const prompt = await input({ message: "Enter your prompt", required: true }); + const prompt = await input({ message: "Enter your prompt", required: true }); - const result = await model.generateContent(prompt); + const result = await model.generateContent(prompt); - const modelResponse = result.response.text(); - return modelResponse; + const modelResponse = result.response.text(); + return modelResponse; } -const query = await geminiClient() -console.log(query); \ No newline at end of file +const query = await geminiClient(); +console.log(query); diff --git a/tsconfig.json b/tsconfig.json index ccb465e..065475b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,29 +1,20 @@ { - // https://www.typescriptlang.org/tsconfig#compilerOptions - "compilerOptions": { - "noFallthroughCasesInSwitch": true, - "allowUnreachableCode": false, - "alwaysStrict": true, - "esModuleInterop": true, - "lib": [ - "es2022" - ], - "module": "NodeNext", - "preserveConstEnums": true, - "moduleResolution": "nodenext", - "strict": true, - "sourceMap": true, - "target": "es2022", - "types": [ - "node" - ], - "outDir": "dist" - }, - "exclude": [ - "node_modules" - ], - "include": [ - "src" - ] - -} \ No newline at end of file + // https://www.typescriptlang.org/tsconfig#compilerOptions + "compilerOptions": { + "noFallthroughCasesInSwitch": true, + "allowUnreachableCode": false, + "alwaysStrict": true, + "esModuleInterop": true, + "lib": ["es2022"], + "module": "NodeNext", + "preserveConstEnums": true, + "moduleResolution": "nodenext", + "strict": true, + "sourceMap": true, + "target": "es2022", + "types": ["node"], + "outDir": "dist" + }, + "exclude": ["node_modules"], + "include": ["src"] +}