You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***`code_executor` (Optional):** Provide a `BaseCodeExecutor` instance to allow the agent to execute code blocks found in the LLM's response. ([See Tools/Built-in tools](../tools/built-in-tools.md)).
455
-
456
448
Example for using built-in-planner:
449
+
457
450
```python
458
451
from dotenv import load_dotenv
459
452
@@ -572,6 +565,26 @@ call_agent("If it's raining in New York right now, what is the current temperatu
-**`code_executor` (Optional):** Provide a `BaseCodeExecutor` instance to allow the agent to execute code blocks found in the LLM's response. ([See Tools/Built-in tools](../tools/built-in-tools.md)).
Copy file name to clipboardExpand all lines: docs/agents/models.md
+47-22Lines changed: 47 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -322,7 +322,7 @@ public class DirectAnthropicAgent {
322
322
## Using Apigee gateway for AI models
323
323
324
324
<div class="language-support-tag">
325
-
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v1.18.0</span>
325
+
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v1.18.0</span><span class="lst-java">Java v0.4.0</span>
326
326
</div>
327
327
328
328
[Apigee](https://docs.cloud.google.com/apigee/docs/api-platform/get-started/what-apigee) acts as a powerful [AI Gateway](https://cloud.google.com/solutions/apigee-ai), transforming how you manage and govern your generative AI model traffic. By exposing your AI model endpoint (like Vertex AI or the Gemini API) through an Apigee proxy, you immediately gain enterprise-grade capabilities:
@@ -341,30 +341,55 @@ public class DirectAnthropicAgent {
341
341
342
342
**Example:**
343
343
344
-
```python
344
+
=== "Python"
345
345
346
-
from google.adk.agents import LlmAgent
347
-
from google.adk.models.apigee_llm import ApigeeLlm
348
-
349
-
# Instantiate the ApigeeLlm wrapper
350
-
model = ApigeeLlm(
351
-
# Specify the Apigee route to your model. For more info, check out the ApigeeLlm documentation (https://github.com/google/adk-python/tree/main/contributing/samples/hello_world_apigeellm).
352
-
model="apigee/gemini-2.5-flash",
353
-
# The proxy URL of your deployed Apigee proxy including the base path
354
-
proxy_url=f"https://{APIGEE_PROXY_URL}",
355
-
# Pass necessary authentication/authorization headers (like an API key)
356
-
custom_headers={"foo": "bar"}
357
-
)
346
+
```python
358
347
359
-
# Pass the configured model wrapper to your LlmAgent
360
-
agent = LlmAgent(
361
-
model=model,
362
-
name="my_governed_agent",
363
-
instruction="You are a helpful assistant powered by Gemini and governed by Apigee.",
364
-
# ... other agent parameters
365
-
)
348
+
from google.adk.agents import LlmAgent
349
+
from google.adk.models.apigee_llm import ApigeeLlm
350
+
351
+
# Instantiate the ApigeeLlm wrapper
352
+
model = ApigeeLlm(
353
+
# Specify the Apigee route to your model. For more info, check out the ApigeeLlm documentation (https://github.com/google/adk-python/tree/main/contributing/samples/hello_world_apigeellm).
354
+
model="apigee/gemini-2.5-flash",
355
+
# The proxy URL of your deployed Apigee proxy including the base path
356
+
proxy_url=f"https://{APIGEE_PROXY_URL}",
357
+
# Pass necessary authentication/authorization headers (like an API key)
358
+
custom_headers={"foo": "bar"}
359
+
)
366
360
367
-
```
361
+
# Pass the configured model wrapper to your LlmAgent
362
+
agent = LlmAgent(
363
+
model=model,
364
+
name="my_governed_agent",
365
+
instruction="You are a helpful assistant powered by Gemini and governed by Apigee.",
366
+
# ... other agent parameters
367
+
)
368
+
369
+
```
370
+
371
+
=== "Java"
372
+
373
+
```java
374
+
import com.google.adk.agents.LlmAgent;
375
+
import com.google.adk.models.ApigeeLlm;
376
+
import com.google.common.collect.ImmutableMap;
377
+
378
+
ApigeeLlm apigeeLlm =
379
+
ApigeeLlm.builder()
380
+
.modelName("apigee/gemini-2.5-flash") // Specify the Apigee route to your model. For more info, check out the ApigeeLlm documentation
381
+
.proxyUrl(APIGEE_PROXY_URL) //The proxy URL of your deployed Apigee proxy including the base path
382
+
.customHeaders(ImmutableMap.of("foo", "bar")) //Pass necessary authentication/authorization headers (like an API key)
383
+
.build();
384
+
LlmAgent agent =
385
+
LlmAgent.builder()
386
+
.model(apigeeLlm)
387
+
.name("my_governed_agent")
388
+
.description("my_governed_agent")
389
+
.instruction("You are a helpful assistant powered by Gemini and governed by Apigee.")
390
+
// tools will be added next
391
+
.build();
392
+
```
368
393
369
394
With this configuration, every API call from your agent will be routed through Apigee first, where all necessary policies (security, rate limiting, logging) are executed before the request is securely forwarded to the underlying AI model endpoint.
Copy file name to clipboardExpand all lines: docs/deploy/cloud-run.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ To deploy your agent, you can use either the `adk deploy cloud_run` command _(re
11
11
12
12
## Agent sample
13
13
14
-
For each of the commands, we will reference a the `Capital Agent` sample defined on the [LLM agent](../agents/llm-agents.md) page. We will assume it's in a directory (eg: `capital_agent`).
14
+
For each of the commands, we will reference the `Capital Agent` sample defined on the [LLM agent](../agents/llm-agents.md) page. We will assume it's in a directory (eg: `capital_agent`).
15
15
16
16
To proceed, confirm that your agent code is configured as follows:
0 commit comments