-
Notifications
You must be signed in to change notification settings - Fork 122
feat : add node function to generate images with gemini #339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds a new Node.js project at node/image-generation-with-gemini for generating images with Google Gemini and uploading them to Appwrite. Introduces package.json, .gitignore, .prettierrc.json, env.d.ts, README, and source files: src/utils.js (generation and upload), src/appwrite.js (Appwrite wrapper), src/main.js (CLI entry), and src/setup.js (bucket setup). Uses dotenv, @google/genai, and node-appwrite; outputs to ./output and manages a Generated_Images bucket. Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
🧹 Nitpick comments (4)
node/image-generation-with-gemini/package.json (1)
1-22: LGTM! Consider adding a.gitignore.The package structure, dependencies, and scripts are well-configured. The dependency versions align with current stable releases.
Consider adding a
.gitignorefile to exclude:node_modules/ output/ .env *.lognode/image-generation-with-gemini/src/main.js (2)
4-4: Consider validating the prompt input.The prompt from CLI args or the default is used directly without checking if it's empty or excessively long, which could lead to unexpected API behavior or costs.
Apply this diff to add basic validation:
const prompt = process.argv[2] || "A futuristic city at sunset"; + +if (!prompt.trim()) { + console.error("Error: Prompt cannot be empty"); + process.exit(1); +} + +if (prompt.length > 1000) { + console.warn("Warning: Very long prompt may result in unexpected behavior"); +}
6-16: LGTM! Consider more descriptive error messages.The async IIFE pattern and error handling are appropriate. However, the generic "Failed:" error message could be more descriptive to help users diagnose issues.
Optionally, enhance error context:
} catch (error) { - console.error("Failed:", error.message); + console.error("Failed to generate or upload image:", error.message); + process.exit(1); }node/image-generation-with-gemini/src/appwrite.js (1)
4-6: Clarify internal dependency comment.While this comment is technically accurate, it may confuse users since
node-fetch-native-with-agentis an internal dependency ofnode-appwrite. Consider rephrasing to make it clear this is handled automatically.Optionally revise the comment:
-// IMPORTANT: Storage.createFile looks for an instance of File from 'node-fetch-native-with-agent' -// (used internally by the Appwrite Node SDK). Passing a Blob will fail with `reading 'size'`. +// Note: The Appwrite SDK requires File instances from its internal dependencies. +// The createFile method below normalizes Blob/Buffer inputs to the correct File type. import { File } from 'node-fetch-native-with-agent';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
node/image-generation-with-gemini/output/gemini-image-1.pngis excluded by!**/*.pngnode/image-generation-with-gemini/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (9)
node/image-generation-with-gemini/.gitignore(1 hunks)node/image-generation-with-gemini/README.md(1 hunks)node/image-generation-with-gemini/env.d.ts(1 hunks)node/image-generation-with-gemini/package.json(1 hunks)node/image-generation-with-gemini/prettierrc.json(1 hunks)node/image-generation-with-gemini/src/appwrite.js(1 hunks)node/image-generation-with-gemini/src/main.js(1 hunks)node/image-generation-with-gemini/src/setup.js(1 hunks)node/image-generation-with-gemini/src/utils.js(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
node/image-generation-with-gemini/src/utils.js (2)
node/image-generation-with-gemini/src/main.js (2)
prompt(4-4)imagePath(8-8)node/image-generation-with-gemini/src/setup.js (2)
bucketId(6-6)appwrite(8-8)
node/image-generation-with-gemini/src/main.js (1)
node/image-generation-with-gemini/src/utils.js (2)
generateImage(35-60)uploadImageToAppwrite(62-88)
node/image-generation-with-gemini/src/appwrite.js (2)
node/image-generation-with-gemini/src/utils.js (3)
apiKey(65-65)bucketId(64-64)buffer(48-48)node/image-generation-with-gemini/src/setup.js (1)
bucketId(6-6)
node/image-generation-with-gemini/src/setup.js (1)
node/image-generation-with-gemini/src/utils.js (2)
bucketId(64-64)appwrite(71-71)
🪛 LanguageTool
node/image-generation-with-gemini/README.md
[grammar] ~5-~5: There might be a mistake here.
Context: ...an Appwrite Storage bucket. ## 🧰 Usage ### CLI - Generate and upload to Appwrite S...
(QB_NEW_EN)
[grammar] ~30-~30: There might be a mistake here.
Context: ... | Value | | ----------------- | ------------------...
(QB_NEW_EN)
[grammar] ~31-~31: There might be a mistake here.
Context: ...------- | ---------------------------- | | Runtime | Node (>=18) ...
(QB_NEW_EN)
[grammar] ~32-~32: There might be a mistake here.
Context: ... | Node (>=18) | | Entrypoint | src/main.js ...
(QB_NEW_EN)
[grammar] ~33-~33: There might be a mistake here.
Context: ... | src/main.js | | Output folder | output/ ...
(QB_NEW_EN)
[grammar] ~34-~34: There might be a mistake here.
Context: ...der | output/ | | Upload provider | Appwrite Storage ...
(QB_NEW_EN)
[grammar] ~35-~35: There might be a mistake here.
Context: ...vider | Appwrite Storage | | Bucket (default) | Generated_Images...
(QB_NEW_EN)
[grammar] ~40-~40: There might be a mistake here.
Context: ...te as well. ## 🔒 Environment Variables Set these in a local .env file (or inj...
(QB_NEW_EN)
[grammar] ~44-~44: There might be a mistake here.
Context: ... | | --------------------------------- | --...
(QB_NEW_EN)
[grammar] ~45-~45: There might be a mistake here.
Context: ...-------------------------------------- | | GEMINI_API_KEY | Ye...
(QB_NEW_EN)
[grammar] ~46-~46: There might be a mistake here.
Context: ... | | GEMINI_MODEL | No...
(QB_NEW_EN)
[grammar] ~49-~49: There might be a mistake here.
Context: ... | | APPWRITE_FUNCTION_PROJECT_ID | Ye...
(QB_NEW_EN)
[grammar] ~50-~50: There might be a mistake here.
Context: ... | | APPWRITE_FUNCTION_API_KEY | Ye...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...age permissions | | APPWRITE_BUCKET_ID | No...
(QB_NEW_EN)
[grammar] ~83-~83: There might be a mistake here.
Context: ...ID: <FILE_ID> ``` ## 🧯 Troubleshooting - "Cannot read properties of undefined (re...
(QB_NEW_EN)
[grammar] ~85-~85: There might be a mistake here.
Context: ...roperties of undefined (reading 'size')" - Ensure you have the correct File class p...
(QB_NEW_EN)
[grammar] ~96-~96: There might be a mistake here.
Context: ... has Storage permissions ## 📦 Install powershell npm install Optionally, format code: ```powershell ...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.18.1)
node/image-generation-with-gemini/README.md
49-49: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
75-75: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (7)
node/image-generation-with-gemini/src/utils.js (3)
1-22: LGTM! Directory setup is solid.The imports, dotenv configuration, and output directory creation are well-implemented.
25-33: LGTM! Filename numbering logic is correct.The
getNextImageNumberfunction properly handles incrementing image numbers with appropriate fallback.
62-88: LGTM! Upload logic is robust.The function properly validates the API key, ensures the bucket exists before uploading, and has good error handling.
node/image-generation-with-gemini/env.d.ts (1)
1-18: LGTM! Environment variable typings are correct.The ambient type declarations properly augment
NodeJS.ProcessEnvwith all required and optional environment variables. The distinction between required (GEMINI_API_KEY) and optional (Appwrite vars) aligns with the conditional upload functionality.node/image-generation-with-gemini/src/appwrite.js (3)
29-48: LGTM! File normalization logic is robust.The
createFilemethod properly handles different input types (File, Blob, Buffer) and normalizes them to the expected File type for the Appwrite SDK.
55-60: LGTM! File path upload is straightforward.The
createFileFromPathmethod correctly reads the file and uploads it with an appropriate MIME type.
66-74: LGTM! Bucket existence check is well-implemented.The method properly handles the 404 case and re-throws other errors.
| async setupGeneratedImageBucket(bucketId) { | ||
| try { | ||
| await this.storage.createBucket(bucketId, 'Image generated'); | ||
| } catch (err) { | ||
| if (err.code !== 409) throw err; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Add bucket permissions configuration.
The setupGeneratedImageBucket method creates a bucket without specifying permissions. By default, Appwrite buckets may have restrictive permissions that prevent file uploads or access. Consider adding appropriate permissions for the use case.
Apply this diff to add permissions:
+import { Permission, Role } from 'node-appwrite';
+
// ... in the class ...
async setupGeneratedImageBucket(bucketId) {
try {
- await this.storage.createBucket(bucketId, 'Image generated');
+ await this.storage.createBucket(
+ bucketId,
+ 'Generated Images',
+ [
+ Permission.read(Role.any()),
+ Permission.create(Role.any()),
+ Permission.update(Role.any()),
+ Permission.delete(Role.any()),
+ ]
+ );
} catch (err) {
if (err.code !== 409) throw err;
}Note: Adjust permissions based on your security requirements. Role.any() is permissive; consider using Role.users() or specific roles for production.
🤖 Prompt for AI Agents
In node/image-generation-with-gemini/src/appwrite.js around lines 76 to 82, the
bucket is created without any permission settings which may block uploads and
reads; modify the this.storage.createBucket call to include appropriate read and
write permission arrays (e.g., allow public reads/writes with Role.any() for
testing or use Role.users() / specific roles for production) and keep the
existing 409 error handling; ensure the permissions are passed as part of the
bucket creation options so uploads and access work as intended.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
@coderabbitai generate docstrings |
✅ Actions performedInitiated docstring generation; will generate only if new commits exist. |
|
Note Docstrings generation - SUCCESS |
Docstrings generation was requested by @imnb57. * #339 (comment) The following files were modified: * `node/image-generation-with-gemini/src/setup.js` * `node/image-generation-with-gemini/src/utils.js`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
node/image-generation-with-gemini/README.md (2)
50-50: Fix markdown emphasis formatting.The table row has a space inside the emphasis marker which prevents proper rendering.
Apply this diff:
-| `APPWRITE_FUNCTION_PROJECT_ID` | Yes* | `YOUR_PROJECT_ID` | Appwrite project ID | +| `APPWRITE_FUNCTION_PROJECT_ID` | Yes\* | `YOUR_PROJECT_ID` | Appwrite project ID |
75-81: Add language identifier to code block.The expected output code block should specify
textas the language identifier for proper syntax highlighting.Apply this diff:
-``` +```text Image saved as D:\...\output\gemini-image-10.png ✓ Image created at: D:\...\output\gemini-image-10.png 📤 Uploading to Appwrite... ✓ Image uploaded to Appwrite with file ID: <FILE_ID> ✓ Upload complete! File ID: <FILE_ID></blockquote></details> </blockquote></details> <details> <summary>🧹 Nitpick comments (1)</summary><blockquote> <details> <summary>node/image-generation-with-gemini/src/utils.js (1)</summary><blockquote> `1-1`: **Add space after comma in import statement.** The import statement is missing a space after the comma between `GoogleGenAI` and `Modality`. Apply this diff: ```diff -import { GoogleGenAI,Modality } from "@google/genai"; +import { GoogleGenAI, Modality } from "@google/genai";Note: This will be auto-fixed once the Prettier configuration file is corrected.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
node/image-generation-with-gemini/README.md(1 hunks)node/image-generation-with-gemini/prettierrc.json(1 hunks)node/image-generation-with-gemini/src/appwrite.js(1 hunks)node/image-generation-with-gemini/src/setup.js(1 hunks)node/image-generation-with-gemini/src/utils.js(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- node/image-generation-with-gemini/src/setup.js
- node/image-generation-with-gemini/src/appwrite.js
🧰 Additional context used
🧬 Code graph analysis (1)
node/image-generation-with-gemini/src/utils.js (2)
node/image-generation-with-gemini/src/main.js (2)
prompt(4-4)imagePath(8-8)node/image-generation-with-gemini/src/setup.js (3)
bucketId(13-13)apiKey(8-8)appwrite(15-15)
🪛 Biome (2.1.2)
node/image-generation-with-gemini/prettierrc.json
[error] 1-1: unexpected character .
(parse)
[error] 1-1: String values must be double quoted.
(parse)
[error] 1-1: unexpected character .
(parse)
[error] 1-1: String values must be double quoted.
(parse)
🪛 LanguageTool
node/image-generation-with-gemini/README.md
[grammar] ~5-~5: There might be a mistake here.
Context: ...an Appwrite Storage bucket. ## 🧰 Usage ### CLI - Generate and upload to Appwrite S...
(QB_NEW_EN)
[grammar] ~30-~30: There might be a mistake here.
Context: ... | Value | | ----------------- | ------------------...
(QB_NEW_EN)
[grammar] ~31-~31: There might be a mistake here.
Context: ...------- | ---------------------------- | | Runtime | Node (>=18) ...
(QB_NEW_EN)
[grammar] ~32-~32: There might be a mistake here.
Context: ... | Node (>=18) | | Entrypoint | src/main.js ...
(QB_NEW_EN)
[grammar] ~33-~33: There might be a mistake here.
Context: ... | src/main.js | | Output folder | output/ ...
(QB_NEW_EN)
[grammar] ~34-~34: There might be a mistake here.
Context: ...der | output/ | | Upload provider | Appwrite Storage ...
(QB_NEW_EN)
[grammar] ~35-~35: There might be a mistake here.
Context: ...vider | Appwrite Storage | | Bucket (default) | Generated_Images...
(QB_NEW_EN)
[grammar] ~40-~40: There might be a mistake here.
Context: ...te as well. ## 🔒 Environment Variables Set these in a local .env file (or inj...
(QB_NEW_EN)
[grammar] ~44-~44: There might be a mistake here.
Context: ... | | --------------------------------- | --...
(QB_NEW_EN)
[grammar] ~45-~45: There might be a mistake here.
Context: ...-------------------------------------- | | GEMINI_API_KEY | Ye...
(QB_NEW_EN)
[grammar] ~46-~46: There might be a mistake here.
Context: ... | | GEMINI_MODEL | No...
(QB_NEW_EN)
[grammar] ~49-~49: There might be a mistake here.
Context: ... | | APPWRITE_FUNCTION_PROJECT_ID | Ye...
(QB_NEW_EN)
[grammar] ~50-~50: There might be a mistake here.
Context: ... | | APPWRITE_FUNCTION_API_KEY | Ye...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...age permissions | | APPWRITE_BUCKET_ID | No...
(QB_NEW_EN)
[grammar] ~83-~83: There might be a mistake here.
Context: ...ID: <FILE_ID> ``` ## 🧯 Troubleshooting - "Cannot read properties of undefined (re...
(QB_NEW_EN)
[grammar] ~85-~85: There might be a mistake here.
Context: ...roperties of undefined (reading 'size')" - Run npm install to ensure dependencies...
(QB_NEW_EN)
[grammar] ~94-~94: There might be a mistake here.
Context: ... has Storage permissions ## 📦 Install powershell npm install Optionally, format code: ```powershell ...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.18.1)
node/image-generation-with-gemini/README.md
50-50: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
75-75: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (2)
node/image-generation-with-gemini/src/utils.js (2)
46-54: LGTM! Response validation is properly implemented.The validation checks ensure the API response has the expected structure before attempting to access nested properties, preventing cryptic runtime errors.
72-98: LGTM! Upload function handles errors gracefully.The function properly validates required environment variables, ensures bucket existence, and provides clear error messages for troubleshooting.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
node/image-generation-with-gemini/.prettierrc.json(1 hunks)node/image-generation-with-gemini/README.md(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- node/image-generation-with-gemini/.prettierrc.json
🧰 Additional context used
🪛 LanguageTool
node/image-generation-with-gemini/README.md
[grammar] ~5-~5: There might be a mistake here.
Context: ...an Appwrite Storage bucket. ## 🧰 Usage ### CLI - Generate and upload to Appwrite S...
(QB_NEW_EN)
[grammar] ~30-~30: There might be a mistake here.
Context: ... | Value | | ----------------- | ------------------...
(QB_NEW_EN)
[grammar] ~31-~31: There might be a mistake here.
Context: ...------- | ---------------------------- | | Runtime | Node (>=18) ...
(QB_NEW_EN)
[grammar] ~32-~32: There might be a mistake here.
Context: ... | Node (>=18) | | Entrypoint | src/main.js ...
(QB_NEW_EN)
[grammar] ~33-~33: There might be a mistake here.
Context: ... | src/main.js | | Output folder | output/ ...
(QB_NEW_EN)
[grammar] ~34-~34: There might be a mistake here.
Context: ...der | output/ | | Upload provider | Appwrite Storage ...
(QB_NEW_EN)
[grammar] ~35-~35: There might be a mistake here.
Context: ...vider | Appwrite Storage | | Bucket (default) | Generated_Images...
(QB_NEW_EN)
[grammar] ~40-~40: There might be a mistake here.
Context: ...te as well. ## 🔒 Environment Variables Set these in a local .env file (or inj...
(QB_NEW_EN)
[grammar] ~44-~44: There might be a mistake here.
Context: ... | | --------------------------------- | --...
(QB_NEW_EN)
[grammar] ~45-~45: There might be a mistake here.
Context: ...-------------------------------------- | | GEMINI_API_KEY | Ye...
(QB_NEW_EN)
[grammar] ~46-~46: There might be a mistake here.
Context: ... | | GEMINI_MODEL | No...
(QB_NEW_EN)
[grammar] ~49-~49: There might be a mistake here.
Context: ... | <<<<<<< HEAD | APPWRITE_FUNCTION_API_ENDPOINT | Ye...
(QB_NEW_EN)
[grammar] ~52-~52: There might be a mistake here.
Context: ... | >>>>>>> 930fe53...
(QB_NEW_EN)
[grammar] ~53-~53: There might be a mistake here.
Context: ...930fe53 | APPWRITE_FUNCTION_PROJECT_ID | Ye...
(QB_NEW_EN)
[grammar] ~54-~54: There might be a mistake here.
Context: ... | | APPWRITE_FUNCTION_API_KEY | Ye...
(QB_NEW_EN)
[grammar] ~55-~55: There might be a mistake here.
Context: ...age permissions | | APPWRITE_BUCKET_ID | No...
(QB_NEW_EN)
[grammar] ~87-~87: There might be a mistake here.
Context: ...te! File ID: <FILE_ID> ``` <<<<<<< HEAD ## 🧯 Troubleshooting "Cannot read prop...
(QB_NEW_EN)
[grammar] ~88-~88: There might be a mistake here.
Context: ... ``` <<<<<<< HEAD ## 🧯 Troubleshooting "Cannot read properties of undefined (re...
(QB_NEW_EN)
[grammar] ~90-~90: There might be a mistake here.
Context: ...roperties of undefined (reading 'size')" - Run npm install to ensure dependencies...
(QB_NEW_EN)
[grammar] ~92-~92: There might be a mistake here.
Context: ... ensure dependencies are present ======= - "Cannot read properties of undefined (re...
(QB_NEW_EN)
[grammar] ~93-~93: There might be a mistake here.
Context: ...roperties of undefined (reading 'size')" - Run npm install to ensure dependencies...
(QB_NEW_EN)
[grammar] ~95-~95: There might be a mistake here.
Context: ...930fe53 - Use Node 18+ (the SDK relies on fetch,...
(QB_NEW_EN)
[grammar] ~103-~103: There might be a mistake here.
Context: ... has Storage permissions ## 📦 Install powershell npm install Optionally, format code: ```powershell ...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.18.1)
node/image-generation-with-gemini/README.md
49-49: Heading style
Expected: atx; Actual: setext
(MD003, heading-style)
54-54: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
91-91: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
93-93: Inconsistent indentation for list items at the same level
Expected: 1; Actual: 0
(MD005, list-indent)
96-96: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
98-98: Inconsistent indentation for list items at the same level
Expected: 2; Actual: 0
(MD005, list-indent)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
node/image-generation-with-gemini/README.md (1)
50-51: Escape the*markers in the Required column.
Yes*is still parsed as emphasis and triggers MD037. Escape the trailing asterisk (e.g.,Yes\*) to stay consistent with the row above and satisfy the linter.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
node/image-generation-with-gemini/README.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
node/image-generation-with-gemini/README.md
[grammar] ~5-~5: There might be a mistake here.
Context: ...an Appwrite Storage bucket. ## 🧰 Usage ### CLI - Generate and upload to Appwrite S...
(QB_NEW_EN)
[grammar] ~30-~30: There might be a mistake here.
Context: ... | Value | | ----------------- | ------------------...
(QB_NEW_EN)
[grammar] ~31-~31: There might be a mistake here.
Context: ...------- | ---------------------------- | | Runtime | Node (>=18) ...
(QB_NEW_EN)
[grammar] ~32-~32: There might be a mistake here.
Context: ... | Node (>=18) | | Entrypoint | src/main.js ...
(QB_NEW_EN)
[grammar] ~33-~33: There might be a mistake here.
Context: ... | src/main.js | | Output folder | output/ ...
(QB_NEW_EN)
[grammar] ~34-~34: There might be a mistake here.
Context: ...der | output/ | | Upload provider | Appwrite Storage ...
(QB_NEW_EN)
[grammar] ~35-~35: There might be a mistake here.
Context: ...vider | Appwrite Storage | | Bucket (default) | Generated_Images...
(QB_NEW_EN)
[grammar] ~40-~40: There might be a mistake here.
Context: ...te as well. ## 🔒 Environment Variables Set these in a local .env file (or inj...
(QB_NEW_EN)
[grammar] ~44-~44: There might be a mistake here.
Context: ... | | --------------------------------- | --...
(QB_NEW_EN)
[grammar] ~45-~45: There might be a mistake here.
Context: ...-------------------------------------- | | GEMINI_API_KEY | Ye...
(QB_NEW_EN)
[grammar] ~46-~46: There might be a mistake here.
Context: ... | | GEMINI_MODEL | No...
(QB_NEW_EN)
[grammar] ~49-~49: There might be a mistake here.
Context: ... | | APPWRITE_FUNCTION_PROJECT_ID | Ye...
(QB_NEW_EN)
[grammar] ~50-~50: There might be a mistake here.
Context: ... | | APPWRITE_FUNCTION_API_KEY | Ye...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...age permissions | | APPWRITE_BUCKET_ID | No...
(QB_NEW_EN)
[grammar] ~84-~84: There might be a mistake here.
Context: ...D: <FILE_ID> ``` ## 🧯 Troubleshooting - "Cannot read properties of undefined (re...
(QB_NEW_EN)
[grammar] ~87-~87: There might be a mistake here.
Context: ...roperties of undefined (reading 'size')" - Run npm install to ensure dependencies...
(QB_NEW_EN)
[grammar] ~97-~97: There might be a mistake here.
Context: ... has Storage permissions ## 📦 Install powershell npm install Optionally, format code: ```powershell ...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.18.1)
node/image-generation-with-gemini/README.md
50-50: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
What does this PR do?
This is a template function in node that lets us generate images using Google gemini API. It also automatically uploads the media to appwrite storage if necessary credentials are provided and are correct.
Test Plan
There was no change in the existing code, i only added my feature in the node directory.
Related PRs and Issues
This PR is not related to other PR's , this is a completely new feature.
Have you read the Contributing Guidelines on issues?
Yes i have read the contributing guidelines. However this is my very first opensource PR, so please review and guide me if any mistakes found.
Summary by CodeRabbit
New Features
Documentation
Chores
Style