Skip to content

Commit 02438f0

Browse files
committed
feat: add spring boot starter
1 parent 2906eb5 commit 02438f0

29 files changed

Lines changed: 1647 additions & 0 deletions
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
HELP.md
2+
target/
3+
.mvn/wrapper/maven-wrapper.jar
4+
!**/src/main/**/target/
5+
!**/src/test/**/target/
6+
7+
### STS ###
8+
.apt_generated
9+
.classpath
10+
.factorypath
11+
.project
12+
.settings
13+
.springBeans
14+
.sts4-cache
15+
16+
### IntelliJ IDEA ###
17+
.idea
18+
*.iws
19+
*.iml
20+
*.ipr
21+
22+
### NetBeans ###
23+
/nbproject/private/
24+
/nbbuild/
25+
/dist/
26+
/nbdist/
27+
/.nb-gradle/
28+
build/
29+
!**/src/main/**/build/
30+
!**/src/test/**/build/
31+
32+
### VS Code ###
33+
.vscode/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
wrapperVersion=3.3.4
2+
distributionType=only-script
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# ADK Spring Boot Starter
2+
3+
This starter integrates the Google Agent Development Kit (ADK) into Spring Boot applications. It provides auto-configuration for Agents, Runners, and core services like Artifacts, Session, and Memory management.
4+
5+
## Installation
6+
7+
Add the following dependency to your `pom.xml`:
8+
9+
```xml
10+
<dependency>
11+
<groupId>com.google.adk</groupId>
12+
<artifactId>adk-spring-boot-starter</artifactId>
13+
<version>${adk-starter.version}</version>
14+
</dependency>
15+
```
16+
17+
## Configuration
18+
19+
By default, the starter configures all services to use **In-Memory** implementations. This is great for local development and testing.
20+
21+
You can configure the behavior using `application.yaml`:
22+
23+
### 1. Artifacts Service
24+
25+
* **Default**: `InMemoryArtifactService`
26+
* **Production**: `GcsArtifactService` (Google Cloud Storage)
27+
28+
To enable GCS:
29+
30+
```yaml
31+
adk:
32+
artifacts:
33+
gcs-enabled: true
34+
bucket-name: "my-agent-artifacts-bucket"
35+
```
36+
37+
### 2. Session Service
38+
39+
* **Default**: `InMemorySessionService`
40+
* **Production**: `VertexAiSessionService`
41+
42+
To enable Vertex AI Sessions:
43+
44+
```yaml
45+
adk:
46+
session:
47+
type: VERTEX_AI
48+
project-id: "my-gcp-project"
49+
location: "us-central1"
50+
```
51+
52+
### 3. Memory Service
53+
54+
* **Default**: `InMemoryMemoryService`
55+
56+
Currently, only In-Memory memory service is supported by default.
57+
58+
59+
### 4. Run Configuration
60+
61+
* **Default Streaming Mode**: `NONE`
62+
63+
To enable streaming (e.g., SSE or BIDI):
64+
65+
```yaml
66+
adk:
67+
run-config:
68+
streaming-mode: SSE # Options: NONE, SSE, BIDI
69+
```
70+
71+
*Note: Other `RunConfig` options (like modalities, audio config) will be added in future versions.*
72+
73+
## Architecture
74+
75+
The starter follows the Single Responsibility Principle by splitting configuration into:
76+
* `AdkArtifactsAutoConfiguration`
77+
* `AdkSessionAutoConfiguration`
78+
* `AdkMemoryAutoConfiguration`
79+
* `AdkRunConfigAutoConfiguration`
80+
81+
Each has its own properties class (e.g., `AdkArtifactProperties`).
82+
83+
## Usage
84+
85+
Simply inject the beans into your application:
86+
87+
```java
88+
@Service
89+
public class MyAgentService {
90+
91+
private final Runner runner;
92+
// Agent bean is no longer auto-configured by default.
93+
// You must define your own Agent bean or use the Runner directly.
94+
95+
public MyAgentService(Runner runner) {
96+
this.runner = runner;
97+
}
98+
99+
// ... use runner
100+
}
101+
```

0 commit comments

Comments
 (0)