Files
adk-python/tests
Calvin Giles ffe2bdbe4c feat: Add support for vertex gemini model optimizer
Merge https://github.com/google/adk-python/pull/1130

This enables the use of the `model-optimizer-*` family of models in vertex, as per the [documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/vertex-ai-model-optimizer#using-vertex-ai-model-optimizer).

To use this, ensure your location is set to `global` and pass a model optimizer model to an agent:

```python
root_agent = Agent(
    model="model-optimizer-exp-04-09",
    name="fast_and_slow_agent",
    instruction="Answer any question the user gives you - easy or hard.",
    generate_content_config=types.GenerateContentConfig(
        temperature=0.01,
        model_selection_config=ModelSelectionConfig(
            feature_selection_preference=FeatureSelectionPreference.BALANCED
            # Options: PRIORITIZE_QUALITY, BALANCED, PRIORITIZE_COST
        )
    ),
)
```
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/1130 from calvingiles:feat-model-optimizer 1a76bfa22420edb07d83415dcea6dd0114084e8e
PiperOrigin-RevId: 784921913
2025-07-19 09:05:17 -07:00
..