mirror of
https://github.com/google/adk-docs.git
synced 2026-09-14 16:16:59 +08:00
e040a94029
* Bump adk-docs to adk-kotlin 1.0.0
KT-23. adk-docs compiles its Kotlin snippets against the pinned SDK, so no 1.0
feature can be documented until this pin moves. Prerequisite only - no snippets,
no prose about 1.0 features.
Moves the examples pin (core, webserver, processor, a2a) and the install
instructions readers copy from, which track the pin for the same reason they did
at 0.8.0: leaving them behind hands newcomers an SDK older than the snippets on
the same page.
THIS DOES NOT BUILD YET, and cannot until the artifacts are published:
> Could not find com.google.adk:google-adk-kotlin-core:1.0.0.
> Could not find com.google.adk:google-adk-kotlin-webserver:1.0.0.
> Could not find com.google.adk:google-adk-kotlin-a2a:1.0.0.
Maven Central carries 0.8.0 as the newest release for every artifact today, and
google/adk-kotlin has no v1.0.0 tag. The PR is a draft until the release lands.
Two comments that pinned third-party versions against adk-kotlin 0.8.0's
catalog - Ktor 2.3.13 and a2a-java-sdk-client 1.0.0.Final - now say the match
was made against 0.8.0 and needs re-checking, rather than restating it as though
it still held. A major release is exactly where a transitive version moves.
Also note the version string is assumed to be `1.0.0`. If the release is cut as
`1.0.0-rc.1` or similar, these five coordinates need to match it.
* Bump the A2A quickstart's dependency to 1.0.0 as well
Missed on the first pass, and the reason is worth recording: the sweep used
`google-adk-kotlin[a-z-]*:0\.8\.0`, whose character class has no digits, so it
silently skipped `google-adk-kotlin-a2a` - the one artifact with a digit in its
name. Every other coordinate matched, so the search looked exhaustive and was
not.
The corrected pattern is `google-adk-kotlin[a-z0-9-]*:[0-9]+\.[0-9]+\.[0-9]+`.
Run repo-wide it now finds five live coordinates in the examples build file and
seventeen in the docs, all at 1.0.0, and nothing left below it.
* Bump every adk-kotlin coordinate to 1.0.0
main moved to 0.9.0 (#2191) after this branch was cut, so the merge above
took main wholesale and this re-applies the 1.0 pin on top. Two coordinates
are new since the branch was opened and were never in the original bump:
- `google-adk-kotlin-litertlm` in `docs/agents/models/litert-lm.md`
- `google-adk-kotlin-integrations` in
`docs/integrations/bigquery-agent-analytics.md` (arrived with #2147, the
reconciliation the original PR description flagged as owed)
Also bumps the two tag-pinned `adk-kotlin/blob/v0.8.0` source links in
`docs/agents/llm-agents.md`. Those point at `SchemaUtils` and `LlmAgent` to
back a claim about how Kotlin validates output schemas; pinned to a tag five
releases behind, they document what 0.8 did, not what a reader on 1.0 runs.
19 coordinates and 2 permalinks. No `com.google.adk:google-adk-kotlin-*`
coordinate below 1.0.0 remains anywhere in the repo.
Deliberately untouched, because they record history rather than a pin:
the ~42 `Kotlin vX.Y.Z` support badges (bumping them would assert that e.g.
artifacts first shipped in Kotlin 1.0), and the "added in adk-kotlin 0.8.0"
/ "Since adk-kotlin 0.7.0" comments in CapitalAgent.kt and
CountInvocationPlugin.kt.
Still unbuildable and still a draft: Maven Central's newest
google-adk-kotlin-core is 0.9.0 and google/adk-kotlin's newest tag is v0.9.0,
so there is no 1.0.0 to resolve. `verify_snippets.py --fast` passes L3, L5 and
L6 and refuses L0 for exactly that reason -- no grounding source exists at the
target version. The bundled Dokka API reference under docs/api-reference/kotlin
still renders 0.5.0 across 1,674 files and cannot be regenerated until the tag
exists; it remains on the pre-merge checklist.
4.8 KiB
4.8 KiB
hide
| hide | |
|---|---|
|
Advanced setup
This page provides detailed installation and configuration instructions for ADK across supported languages. For a guided introduction, start with the quickstart for your language.
=== "Python"
**Create & activate virtual environment**
We recommend creating a virtual Python environment using
[venv](https://docs.python.org/3/library/venv.html):
```shell
python3 -m venv .venv
```
Now, you can activate the virtual environment using the appropriate command
for your operating system and environment:
```
# Mac / Linux
source .venv/bin/activate
# Windows CMD:
.venv\Scripts\activate.bat
# Windows PowerShell:
.venv\Scripts\Activate.ps1
```
**Install ADK**
```bash
pip install google-adk
```
(Optional) Verify your installation:
```bash
pip show google-adk
```
=== "TypeScript"
**Install ADK and ADK DevTools**
```bash
npm install @google/adk @google/adk-devtools
```
=== "Go"
**Prerequisites:** Go 1.25 or later is required for ADK Go v2.0.0.
**Create a new Go module**
If you are starting a new project, you can create a new Go module:
```shell
go mod init example.com/my-agent
```
**Install ADK Go v2.0.0**
To add ADK Go v2.0.0 to your project, run the following command:
```shell
go get google.golang.org/adk/v2
```
This will add ADK Go v2.0.0 as a dependency to your `go.mod` file.
(Optional) Verify your installation by checking your `go.mod` file for the
`google.golang.org/adk/v2` entry.
??? tip "Still using ADK Go v1.x?"
If you are not yet ready to upgrade to v2.0.0, you can continue using
the v1.x release line:
```shell
go get google.golang.org/adk@v1
```
See the [ADK 2.0 release page](/2.0/) for upgrade guidance, including
breaking changes and migration steps for ADK Go 1.x projects.
=== "Java"
You can either use maven or gradle to add the `google-adk` and
`google-adk-dev` package.
`google-adk` is the core Java ADK library. Java ADK also comes with a
pluggable example SpringBoot server to run your agents seamlessly. This
optional package is present as part of `google-adk-dev`.
If you are using maven, add the following to your `pom.xml`:
```xml title="pom.xml"
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.agent</groupId>
<artifactId>adk-agents</artifactId>
<version>1.0-SNAPSHOT</version>
<!-- Specify the version of Java you'll be using -->
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- The ADK core dependency -->
<dependency>
<groupId>com.google.adk</groupId>
<artifactId>google-adk</artifactId>
<version>1.6.0</version>
</dependency>
<!-- The ADK dev web UI to debug your agent -->
<dependency>
<groupId>com.google.adk</groupId>
<artifactId>google-adk-dev</artifactId>
<version>1.6.0</version>
</dependency>
</dependencies>
</project>
```
Here's a [complete
pom.xml](https://github.com/google/adk-docs/tree/main/examples/java/cloud-run/pom.xml)
file for reference.
If you are using gradle, add the dependency to your build.gradle:
```title="build.gradle"
dependencies {
implementation 'com.google.adk:google-adk:1.6.0'
implementation 'com.google.adk:google-adk-dev:1.6.0'
}
```
You should also configure Gradle to pass `-parameters` to `javac`.
(Alternatively, use `@Schema(name = "...")`).
=== "Kotlin"
**Use ADK Kotlin on the JVM**
For Kotlin on the JVM, add the ADK core library and the KSP annotation
processor to your `build.gradle.kts`:
```kotlin title="build.gradle.kts"
plugins {
kotlin("jvm") version "2.1.20"
id("com.google.devtools.ksp") version "2.1.20-2.0.1"
}
dependencies {
implementation("com.google.adk:google-adk-kotlin-core:1.0.0")
ksp("com.google.adk:google-adk-kotlin-processor:1.0.0")
}
```
The KSP processor generates code for the `@Tool` annotation used to
register function tools. See the [Kotlin Quickstart](/get-started/kotlin/)
for a complete project setup.