Support GEMINI_MODEL environment variable for model configuration
Summary
Adds support for configuring the Gemini model via the GEMINI_MODEL environment variable in the A2A server, allowing users to override the default model without code changes. Falls back to DEFAULT_GEMINI_MODEL when not specified.
Details
This change enables to specify which Gemini model to use when starting the A2A server. The implementation follows the existing pattern used for other environment variables in the config file (e.g., DEBUG, GEMINI_YOLO_MODE, GEMINI_API_KEY).
Changes:
- Modified
packages/a2a-server/src/config/config.tsto readprocess.env['GEMINI_MODEL']with fallback toDEFAULT_GEMINI_MODEL - Maintains backward compatibility - if
GEMINI_MODELis not set, the default model (gemini-2.5-pro) is used
Use case:
In the environment one can now set GEMINI_MODEL=gemini-2.0-flash when starting the server, allowing easy model switching for different environments or testing scenarios.
Related Issues
How to Validate
- Start the server without
GEMINI_MODELset - should use default model (gemini-2.5-pro) - Start the server with
GEMINI_MODEL=gemini-2.0-flash- should use the specified model
Pre-Merge Checklist
- [x] Updated relevant documentation and README (if needed)
- [x] Added/updated tests (No tests failing)
- [x] Noted breaking changes (No breaking changes)
- [x] Validated on required platforms/methods:
- [x] MacOS
- [x] npm run
- [x] MacOS
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
Done 👌