Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
1588fbf
Added google_search snippet
ivanmkc-google Oct 1, 2025
b6b43d3
Fix: Address Go style guide issues in google_search.go
ivanmkc-google Oct 1, 2025
fe62321
Migrated to new API
ivanmkc-google Oct 10, 2025
de0e165
Fixed tool info in md file
ivanmkc-google Oct 10, 2025
e1bc449
Added partial check
ivanmkc-google Oct 10, 2025
13cb835
Added function-tools sample
ivanmkc-google Sep 30, 2025
38d5e33
Migrated to new API
ivanmkc-google Oct 10, 2025
8ce06d1
Added partial check
ivanmkc-google Oct 10, 2025
7647d91
Ran linter
ivanmkc-google Oct 10, 2025
dfa0138
feat: add go fmt check
ivanmkc-google Oct 23, 2025
630a782
Run go fmt only on changed files
ivanmkc-google Oct 23, 2025
c0c058f
Added google_search snippet
ivanmkc-google Oct 1, 2025
1864dcd
Fix: Address Go style guide issues in google_search.go
ivanmkc-google Oct 1, 2025
3297579
Migrated to new API
ivanmkc-google Oct 10, 2025
12be4c6
Added partial check
ivanmkc-google Oct 10, 2025
f5cddab
Added function-tools sample
ivanmkc-google Sep 30, 2025
7ccad9e
Migrated to new API
ivanmkc-google Oct 10, 2025
2eb726d
Added partial check
ivanmkc-google Oct 10, 2025
6419a76
Ran linter
ivanmkc-google Oct 10, 2025
259a9c1
feat: add go fmt check
ivanmkc-google Oct 23, 2025
18342d6
Run go fmt only on changed files
ivanmkc-google Oct 23, 2025
646eb46
Feat: Add Golang example for LLM agents
ivanmkc-google Oct 2, 2025
9ec4bba
Added schema agent
ivanmkc-google Oct 2, 2025
5aa9de0
Added session support
ivanmkc-google Oct 2, 2025
62cd58c
Migrated to new API
ivanmkc-google Oct 10, 2025
eb4a3aa
Added back OutputKey
ivanmkc-google Oct 14, 2025
084cd46
Added missing snippets
ivanmkc-google Oct 14, 2025
72a229a
Moved snipped to its own package
ivanmkc-google Oct 14, 2025
46672f2
Minor cleanup
ivanmkc-google Oct 14, 2025
e01aafe
Reverted llm-agents.md
ivanmkc-google Oct 24, 2025
2d2e439
Added back correct changes to llm-agents.md
ivanmkc-google Oct 24, 2025
7621fdf
Updated to newest API
ivanmkc-google Oct 24, 2025
9361c0f
Ran linter
ivanmkc-google Oct 24, 2025
1f59a6d
WIP
ivanmkc-google Oct 1, 2025
ca3075a
WIP: Added the rest of the agents
ivanmkc-google Oct 2, 2025
92b2625
Added sequential agent
ivanmkc-google Oct 9, 2025
a54b5ff
Migrated agents to new API
ivanmkc-google Oct 9, 2025
f32ef3f
Fixed snippet tags
ivanmkc-google Oct 9, 2025
430bfff
Updated parallel and sequential with OutputKey
ivanmkc-google Oct 11, 2025
c401233
Updated loop agent
ivanmkc-google Oct 11, 2025
a8a94a6
Cleanup
ivanmkc-google Oct 11, 2025
cae9698
Fixed and ran linter
ivanmkc-google Oct 24, 2025
d12c1ab
Removed comment
ivanmkc-google Oct 24, 2025
f95ae70
Ran linter
ivanmkc-google Oct 29, 2025
2d67e41
Added custom agent snippets
ivanmkc-google Oct 4, 2025
08c4058
Migrated to new API
ivanmkc-google Oct 9, 2025
1d8bad0
Fixed incorrect info about channels since run returns an Iterator, no…
ivanmkc-google Oct 9, 2025
2ec04ec
Cleanup and renaming
ivanmkc-google Oct 11, 2025
deacff2
Ran linter
ivanmkc-google Oct 24, 2025
b551d9f
Fixed md
ivanmkc-google Oct 24, 2025
61ca974
Added multi-agent docs
ivanmkc-google Oct 4, 2025
e7c4716
Updated to use AgentTool
ivanmkc-google Oct 14, 2025
4ee59b8
Split snippets
ivanmkc-google Oct 15, 2025
75aef1c
Added missing file
ivanmkc-google Oct 15, 2025
b408098
Ran linter and fixed API
ivanmkc-google Oct 24, 2025
86d531f
Added Models snippets
ivanmkc-google Oct 4, 2025
96de477
Migrated to new API
ivanmkc-google Oct 9, 2025
17c1577
Embedded imports
ivanmkc-google Oct 20, 2025
0a27444
Ran linter
ivanmkc-google Oct 24, 2025
e7e2a8b
Added long running tool
ivanmkc-google Oct 10, 2025
059c66e
Ran linter and fixed API
ivanmkc-google Oct 23, 2025
0d0b756
Switched to two-turn style
ivanmkc-google Oct 23, 2025
cfd9dcb
Ran linter
ivanmkc-google Oct 24, 2025
8203e1c
Added callback snippets
ivanmkc-google Oct 11, 2025
2a1ebcd
Added back imports
ivanmkc-google Oct 11, 2025
b74619b
Added types of callbacks snippets
ivanmkc-google Oct 11, 2025
a1d58f3
feat(go): align callback snippets with other languages
ivanmkc-google Oct 12, 2025
dd9cc7d
Ran linter and updated API
ivanmkc-google Oct 24, 2025
ee7486f
Added tool callbacks
ivanmkc-google Oct 28, 2025
3d2620d
Added artifact snippets
ivanmkc-google Oct 8, 2025
aa6521d
Use story.pdf instead of random bytes
ivanmkc-google Oct 9, 2025
4d53bc4
Fixed issue with artifact loading
ivanmkc-google Oct 9, 2025
6f6179e
Cleanup unneeded fixes
ivanmkc-google Oct 9, 2025
fe80d3b
Added back inadvertently removed GCS section
ivanmkc-google Oct 9, 2025
7119315
Addressed PR comments
ivanmkc-google Oct 24, 2025
ac776f1
Ran linter
ivanmkc-google Oct 29, 2025
857bd2b
feat: Added context snippets
ivanmkc-google Oct 15, 2025
b21077c
Fixed callback signature
ivanmkc-google Oct 16, 2025
3144cf4
Fixed additional callbacks
ivanmkc-google Oct 16, 2025
21c7896
Added remaining snippets
ivanmkc-google Oct 16, 2025
758c7d9
Added conceptual runner example
ivanmkc-google Oct 16, 2025
3449794
Removed duplicate code
ivanmkc-google Oct 16, 2025
bbeacae
Clean up tags and imports
ivanmkc-google Oct 16, 2025
755d85f
Updated API
ivanmkc-google Oct 24, 2025
7f05ee5
Twaked text
ivanmkc-google Oct 24, 2025
ac8bee7
Ran linter
ivanmkc-google Oct 29, 2025
8751885
Fixed broken API issues
ivanmkc-google Oct 31, 2025
9d14bde
Updated to latest Go ADK API
ivanmkc-google Nov 3, 2025
9ce514b
Added func param info
ivanmkc-google Oct 23, 2025
df9f83f
Interleaved Py and Go
ivanmkc-google Oct 23, 2025
07df4ea
Revert mistakes
ivanmkc-google Nov 5, 2025
95785f5
Removed extra newline
ivanmkc-google Nov 5, 2025
aedf4d5
Added example cloud run code and update md with Go (#41)
ivanmkc Nov 5, 2025
b371046
adding go snippets to runconfig docs
ToniCorinne Nov 4, 2025
c11472d
realigning runconfig go examples with current state of adk-go.
ToniCorinne Nov 5, 2025
3f0fd79
adding language support tags to individual runtime config fields
ToniCorinne Nov 5, 2025
5dcb277
removing unsupported supportcfc go examples
ToniCorinne Nov 5, 2025
ba8e54c
removing unsupported streamingmode.bidi go snippets
ToniCorinne Nov 5, 2025
c5c82e6
Added AgentTool examples (#31)
ivanmkc Nov 5, 2025
fde0493
adding initial go sessions.sessions snippets
ToniCorinne Oct 16, 2025
f2ae8b8
updating go session docs + session examples
ToniCorinne Nov 4, 2025
1b38e40
update go session snippets
ToniCorinne Nov 5, 2025
f8cc678
updating DatabaseSessionService language support tag
ToniCorinne Nov 5, 2025
7a18c1f
cleaning up go vertex ai comments
ToniCorinne Nov 5, 2025
1e201dd
removing go.mod for session_management_example
ToniCorinne Nov 5, 2025
40eae7b
docs: add language support tags for Go
joefernandez Nov 4, 2025
7530e92
initial go runtime sample updates
ToniCorinne Oct 10, 2025
de36d0f
fixing runtime go snippet formatting
ToniCorinne Oct 13, 2025
060312a
formatting updates to runtime go snippets
ToniCorinne Oct 20, 2025
d0aaa0a
updating runtime go examples to streamline to newer go features
ToniCorinne Nov 6, 2025
994b87e
adding go snippets for events
ToniCorinne Oct 20, 2025
02a4781
updating go snippets for events
ToniCorinne Oct 23, 2025
5e6a8e3
adding artifactdelta snippet for go
ToniCorinne Nov 3, 2025
efbfc57
minor java fixes, cleaning up go event.content
ToniCorinne Nov 6, 2025
154a9f6
Custom tools: Merging again (#44)
ivanmkc Nov 6, 2025
a0d8bb8
Fixed tab issue with cloud-run md (#45)
ivanmkc Nov 6, 2025
4a67c15
adding initial go snippets for memory services
ToniCorinne Oct 15, 2025
de31b72
updating go memory sample, adding python formatting in docs to clarif…
ToniCorinne Nov 3, 2025
2b40d97
removing go replace for memory example
ToniCorinne Nov 3, 2025
52b3447
removing go.sum from memory_example
ToniCorinne Nov 3, 2025
6eea1a6
fixing go formatting for memory example
ToniCorinne Nov 3, 2025
6f8db0c
fixing go memory snippets to streamline examples in docs
ToniCorinne Nov 5, 2025
99c694d
removing unnecessary go.mod for memory_example.go and snippet cleanup
ToniCorinne Nov 6, 2025
2285813
Merge pull request #34 from ivanmkc/tk-session-memory
ToniCorinne Nov 6, 2025
0886799
docs: Add MCP Toolbox for databases Go SDK Documentation
dishaprakash Nov 4, 2025
64b2294
minor fix
dishaprakash Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/go-fmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Go Fmt

on:
pull_request:
paths:
- '**.go'

jobs:
gofmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Run gofmt on changed files
run: |
# List changed Go files in the pull request.
# The `|| true` is to prevent the command from failing if no go files are found
changed_files=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | grep '\.go$' || true)

if [ -z "$changed_files" ]; then
echo "No Go files changed in this PR."
exit 0
fi

echo "Checking formatting for the following files:"
echo "$changed_files"

# Check formatting of changed files
unformatted_files=$(gofmt -l $changed_files)

if [ -n "$unformatted_files" ]; then
echo "Unformatted Go files found:"
echo "$unformatted_files"
exit 1
else
echo "All changed Go files are formatted correctly."
fi
92 changes: 91 additions & 1 deletion docs/agents/custom-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Custom agents

<div class="language-support-tag">
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v0.1.0</span><span class="lst-java">Java v0.2.0</span>
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v0.1.0</span><span class="lst-java">Java v0.2.0</span><span class="lst-go">Go v0.1.0</span>
</div>

Custom agents provide the ultimate flexibility in ADK, allowing you to define **arbitrary orchestration logic** by inheriting directly from `BaseAgent` and implementing your own control flow. This goes beyond the predefined patterns of `SequentialAgent`, `LoopAgent`, and `ParallelAgent`, enabling you to build highly specific and complex agentic workflows.
Expand Down Expand Up @@ -53,6 +53,15 @@ The core of any custom agent is the method where you define its unique asynchron
* **Reactive Stream (`Flowable`):** It must return an `io.reactivex.rxjava3.core.Flowable<Event>`. This `Flowable` represents a stream of events that will be produced by the custom agent's logic, often by combining or transforming multiple `Flowable` from sub-agents.
* **`ctx` (InvocationContext):** Provides access to crucial runtime information, most importantly `ctx.session().state()`, which is a `java.util.concurrent.ConcurrentMap<String, Object>`. This is the primary way to share data between steps orchestrated by your custom agent.

=== "Go"

In Go, you implement the `Run` method as part of a struct that satisfies the `agent.Agent` interface. The actual logic is typically a method on your custom agent struct.

* **Signature:** `Run(ctx agent.InvocationContext) iter.Seq2[*session.Event, error]`
* **Iterator:** The `Run` method returns an iterator (`iter.Seq2`) that yields events and errors. This is the standard way to handle streaming results from an agent's execution.
* **`ctx` (InvocationContext):** The `agent.InvocationContext` provides access to the session, including state, and other crucial runtime information.
* **Session State:** You can access the session state through `ctx.Session().State()`.

**Key Capabilities within the Core Asynchronous Method:**

=== "Python"
Expand Down Expand Up @@ -127,6 +136,46 @@ The core of any custom agent is the method where you define its unique asynchron
* **Conditional:** `Flowable.defer()` to choose which `Flowable` to subscribe to based on a condition, or `filter()` if you're filtering events within a stream.
* **Iterative:** Operators like `repeat()`, `retry()`, or by structuring your `Flowable` chain to recursively call parts of itself based on conditions (often managed with `flatMapPublisher` or `concatMap`).

=== "Go"

1. **Calling Sub-Agents:** You invoke sub-agents by calling their `Run` method.

```go
// Example: Running one sub-agent and yielding its events
for event, err := range someSubAgent.Run(ctx) {
if err != nil {
// Handle or propagate the error
return
}
// Yield the event up to the caller
yield(event, nil)
}
```

2. **Managing State:** Read from and write to the session state to pass data between sub-agent calls or make decisions.
```go
// The `ctx` (`agent.InvocationContext`) is passed directly to your agent's `Run` function.
// Read data set by a previous agent
previousResult, err := ctx.Session().State().Get("some_key")
if err != nil {
// Handle cases where the key might not exist yet
}

// Make a decision based on state
if val, ok := previousResult.(string); ok && val == "some_value" {
// ... call a specific sub-agent ...
} else {
// ... call another sub-agent ...
}

// Store a result for a later step
if err := ctx.Session().State().Set("my_custom_result", "calculated_value"); err != nil {
// Handle error
}
```

3. **Implementing Control Flow:** Use standard Go constructs (`if`/`else`, `for`/`switch` loops, goroutines, channels) to create sophisticated, conditional, or iterative workflows involving your sub-agents.

## Managing Sub-Agents and State

Typically, a custom agent orchestrates other agents (like `LlmAgent`, `LoopAgent`, etc.).
Expand Down Expand Up @@ -162,6 +211,14 @@ Let's illustrate the power of custom agents with an example pattern: a multi-sta
```java
--8<-- "examples/java/snippets/src/main/java/agents/StoryFlowAgentExample.java:init"
```

=== "Go"

We define the `StoryFlowAgent` struct and a constructor. In the constructor, we store the necessary sub-agents and tell the `BaseAgent` framework about the top-level agents this custom agent will directly orchestrate.

```go
--8<-- "examples/go/snippets/agents/custom-agent/storyflow_agent.go:init"
```
---

### Part 2: Defining the Custom Execution Logic { #part-2-defining-the-custom-execution-logic }
Expand Down Expand Up @@ -195,6 +252,20 @@ Let's illustrate the power of custom agents with an example pattern: a multi-sta
3. Then, the `sequentialAgent's` Flowable executes. It calls the `grammar_check` then `tone_check`, reading `current_story` and writing `grammar_suggestions` and `tone_check_result` to the state.
4. **Custom Part:** After the sequentialAgent completes, logic within a `Flowable.defer` checks the "tone_check_result" from `invocationContext.session().state()`. If it's "negative", the `storyGenerator` Flowable is *conditionally concatenated* and executed again, overwriting "current_story". Otherwise, an empty Flowable is used, and the overall workflow proceeds to completion.

=== "Go"

The `Run` method orchestrates the sub-agents by calling their respective `Run` methods in a loop and yielding their events.

```go
--8<-- "examples/go/snippets/agents/custom-agent/storyflow_agent.go:executionlogic"
```
**Explanation of Logic:**

1. The initial `storyGenerator` runs. Its output is expected to be in the session state under the key `"current_story"`.
2. The `revisionLoopAgent` runs, which internally calls the `critic` and `reviser` sequentially for `max_iterations` times. They read/write `current_story` and `criticism` from/to the state.
3. The `postProcessorAgent` runs, calling `grammar_check` then `tone_check`, reading `current_story` and writing `grammar_suggestions` and `tone_check_result` to the state.
4. **Custom Part:** The code checks the `tone_check_result` from the state. If it's "negative", the `story_generator` is called *again*, overwriting the `current_story` in the state. Otherwise, the flow ends.

---

### Part 3: Defining the LLM Sub-Agents { #part-3-defining-the-llm-sub-agents }
Expand All @@ -216,6 +287,12 @@ These are standard `LlmAgent` definitions, responsible for specific tasks. Their
--8<-- "examples/java/snippets/src/main/java/agents/StoryFlowAgentExample.java:llmagents"
```

=== "Go"

```go
--8<-- "examples/go/snippets/agents/custom-agent/storyflow_agent.go:llmagents"
```

---

### Part 4: Instantiating and Running the custom agent { #part-4-instantiating-and-running-the-custom-agent }
Expand All @@ -234,6 +311,12 @@ Finally, you instantiate your `StoryFlowAgent` and use the `Runner` as usual.
--8<-- "examples/java/snippets/src/main/java/agents/StoryFlowAgentExample.java:story_flow_agent"
```

=== "Go"

```go
--8<-- "examples/go/snippets/agents/custom-agent/storyflow_agent.go:story_flow_agent"
```

*(Note: The full runnable code, including imports and execution logic, can be found linked below.)*

---
Expand All @@ -255,3 +338,10 @@ Finally, you instantiate your `StoryFlowAgent` and use the `Runner` as usual.
# Full runnable code for the StoryFlowAgent example
--8<-- "examples/java/snippets/src/main/java/agents/StoryFlowAgentExample.java:full_code"
```

=== "Go"

```go
# Full runnable code for the StoryFlowAgent example
--8<-- "examples/go/snippets/agents/custom-agent/storyflow_agent.go:full_code"
```
2 changes: 1 addition & 1 deletion docs/agents/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Agents

<div class="language-support-tag">
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python</span><span class="lst-java">Java</span>
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python</span><span class="lst-java">Java</span><span class="lst-go">Go</span>
</div>

In the Agent Development Kit (ADK), an **Agent** is a self-contained execution unit designed to act autonomously to achieve specific goals. Agents can perform tasks, interact with users, utilize external tools, and coordinate with other agents.
Expand Down
53 changes: 52 additions & 1 deletion docs/agents/llm-agents.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# LLM Agent

<div class="language-support-tag">
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v0.1.0</span><span class="lst-java">Java v0.1.0</span>
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v0.1.0</span><span class="lst-java">Java v0.1.0</span><span class="lst-go">Go v0.1.0</span>
</div>

The `LlmAgent` (often aliased simply as `Agent`) is a core component in ADK,
Expand Down Expand Up @@ -66,6 +66,13 @@ First, you need to establish what the agent *is* and what it's *for*.
.build();
```

=== "Golang"

```go
// Example: Defining the basic identity
--8<-- "examples/go/snippets/agents/llm-agents/snippets/main.go:identity"
```


## Guiding the Agent: Instructions (`instruction`)

Expand Down Expand Up @@ -136,6 +143,13 @@ tells the agent:
.build();
```

=== "Golang"

```go
// Example: Adding instructions
--8<-- "examples/go/snippets/agents/llm-agents/snippets/main.go:instruction"
```

*(Note: For instructions that apply to *all* agents in a system, consider using
`global_instruction` on the root agent, detailed further in the
[Multi-Agents](multi-agents.md) section.)*
Expand Down Expand Up @@ -208,6 +222,12 @@ on the conversation and its instructions.
.build();
```

=== "Golang"

```go
--8<-- "examples/go/snippets/agents/llm-agents/snippets/main.go:tool_example"
```

Learn more about Tools in the [Tools](../tools/index.md) section.

## Advanced Configuration & Control
Expand Down Expand Up @@ -255,6 +275,14 @@ You can adjust how the underlying LLM generates responses using `generate_conten
.build();
```

=== "Golang"

```go
import "google.golang.org/genai"

--8<-- "examples/go/snippets/agents/llm-agents/snippets/main.go:gen_config"
```

### Structuring Data (`input_schema`, `output_schema`, `output_key`)

For scenarios requiring structured data exchange with an `LLM Agent`, the ADK provides mechanisms to define expected input and desired output formats using schema definitions.
Expand All @@ -266,6 +294,7 @@ For scenarios requiring structured data exchange with an `LLM Agent`, the ADK pr
* **`output_key` (Optional):** Provide a string key. If set, the text content of the agent's *final* response will be automatically saved to the session's state dictionary under this key. This is useful for passing results between agents or steps in a workflow.
* In Python, this might look like: `session.state[output_key] = agent_response_text`
* In Java: `session.state().put(outputKey, agentResponseText)`
* In Golang, within a callback handler: `ctx.State().Set(output_key, agentResponseText)`

=== "Python"

Expand Down Expand Up @@ -315,6 +344,14 @@ For scenarios requiring structured data exchange with an `LLM Agent`, the ADK pr
.build();
```

=== "Golang"

The input and output schema is a `google.genai.types.Schema` object.

```go
--8<-- "examples/go/snippets/agents/llm-agents/snippets/main.go:schema_example"
```

### Managing Context (`include_contents`)

Control whether the agent receives the prior conversation history.
Expand Down Expand Up @@ -344,6 +381,14 @@ Control whether the agent receives the prior conversation history.
.build();
```

=== "Golang"

```go
import "google.golang.org/adk/agent/llmagent"

--8<-- "examples/go/snippets/agents/llm-agents/snippets/main.go:include_contents"
```

### Planner

<div class="language-support-tag" title="">
Expand Down Expand Up @@ -551,6 +596,12 @@ call_agent("If it's raining in New York right now, what is the current temperatu
--8<-- "examples/java/snippets/src/main/java/agents/LlmAgentExample.java:full_code"
```

=== "Golang"

```go
--8<-- "examples/go/snippets/agents/llm-agents/main.go:full_code"
```

_(This example demonstrates the core concepts. More complex agents might incorporate schemas, context control, planning, etc.)_

## Related Concepts (Deferred Topics)
Expand Down
14 changes: 13 additions & 1 deletion docs/agents/models.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Using Different Models with ADK

<div class="language-support-tag" title="Java ADK currently supports Gemini and Anthropic models.">
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v0.1.0</span><span class="lst-java">Java v0.1.0</span>
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v0.1.0</span><span class="lst-java">Java v0.1.0</span><span class="lst-go">Go v0.1.0</span>
</div>

The Agent Development Kit (ADK) is designed for flexibility, allowing you to
Expand Down Expand Up @@ -184,6 +184,18 @@ For deployed applications, a service account is the standard method.
// different availability or quota limitations.
```

=== "Go"

```go
import (
"google.golang.org/adk/agent/llmagent"
"google.golang.org/adk/model/gemini"
"google.golang.org/genai"
)

--8<-- "examples/go/snippets/agents/models/models.go:gemini-example"
```

!!!warning "Secure Your Credentials"
Service account credentials or API keys are powerful credentials. Never expose them publicly. Use a secret manager like [Google Secret Manager](https://cloud.google.com/secret-manager) to store and access them securely in production.

Expand Down
Loading