mirror of
https://github.com/LibreChat-AI/librechat.ai.git
synced 2026-03-27 02:38:32 +07:00
docs: update dotenv and Gemini image generation documentation for clarity
- Revised notes on the `GEMINI_VERTEX_ENABLED` option to clarify fallback behavior when no API key is set. - Updated instructions for configuring the service account JSON file, specifying default paths and fallback mechanisms. - Enhanced descriptions of image generation and storage integration for better user understanding.
This commit is contained in:
@@ -426,12 +426,11 @@ Gemini Image Generation is a tool for Agents that supports both the Gemini API a
|
||||
<OptionTable
|
||||
options={[
|
||||
['GEMINI_API_KEY', 'string', 'Dedicated Gemini API key for image generation. Falls back to GOOGLE_KEY if not set.', '# GEMINI_API_KEY=your_gemini_api_key'],
|
||||
['GEMINI_VERTEX_ENABLED', 'boolean', 'Enable Vertex AI for Gemini image generation. Uses service account authentication.', '# GEMINI_VERTEX_ENABLED=true'],
|
||||
['GEMINI_IMAGE_MODEL', 'string', 'Gemini model for image generation. Default: gemini-2.5-flash-image.', '# GEMINI_IMAGE_MODEL=gemini-2.5-flash-image'],
|
||||
]}
|
||||
/>
|
||||
|
||||
> **Note:** When using Vertex AI (`GEMINI_VERTEX_ENABLED=true`), you must also configure `GOOGLE_SERVICE_KEY_FILE` with a service account that has the `Vertex AI User` role. No API key is required.
|
||||
> **Note:** When no API key is configured, the tool automatically falls back to Vertex AI using the service account from `GOOGLE_SERVICE_KEY_FILE`. The service account must have the `Vertex AI User` role.
|
||||
|
||||
### OpenAI
|
||||
|
||||
|
||||
@@ -23,16 +23,18 @@ GEMINI_API_KEY=your_api_key_here
|
||||
|
||||
1. Create a service account in Google Cloud Console with Vertex AI permissions
|
||||
2. Download the service account JSON key file
|
||||
3. Configure the environment variables:
|
||||
3. Place the JSON file in the project (e.g., `api/data/auth.json`) or set the path:
|
||||
|
||||
```bash
|
||||
# Path to your service account JSON file
|
||||
# Path to your service account JSON file (default: api/data/auth.json)
|
||||
GOOGLE_SERVICE_KEY_FILE=/path/to/service-account.json
|
||||
|
||||
# Optional: Set the location (default: global)
|
||||
GOOGLE_CLOUD_LOCATION=us-central1
|
||||
```
|
||||
|
||||
When no `GEMINI_API_KEY` or `GOOGLE_KEY` is configured, the tool automatically falls back to Vertex AI using the service account file.
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Model Selection
|
||||
@@ -62,7 +64,6 @@ GEMINI_IMAGE_MODEL=gemini-3-pro-image-preview
|
||||
- **Image Context Support**: Use existing images as context/inspiration for new generations
|
||||
- **Image Editing**: Generate new images based on modifications to existing ones
|
||||
- **Safety Filtering**: Built-in content safety with user-friendly error messages
|
||||
- **Multi-Storage Support**: Compatible with local, S3, Azure, and Firebase storage strategies
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -137,14 +138,11 @@ Gemini includes built-in safety filters. If your image is blocked:
|
||||
|
||||
### Storage Integration
|
||||
|
||||
Generated images are automatically saved using your configured file strategy:
|
||||
|
||||
- **Local**: Saved to `client/public/images/{userId}/`
|
||||
- **S3/Azure/Firebase**: Uploaded to your configured cloud storage
|
||||
Generated images are automatically saved using your configured file strategy (local, S3, Azure, or Firebase). This is handled by the framework — the tool returns image data and the agent callback system persists it as a message attachment.
|
||||
|
||||
### Image Format
|
||||
|
||||
- Output format: PNG
|
||||
- Output format defaults to PNG, configurable via the app's `imageOutputType` setting
|
||||
- Images include unique identifiers for reference in subsequent requests
|
||||
|
||||
## Rate Limits
|
||||
|
||||
Reference in New Issue
Block a user