google-adk-extras 0.1.1__py3-none-any.whl → 0.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- google_adk_extras/__init__.py +31 -1
- google_adk_extras/adk_builder.py +1030 -0
- google_adk_extras/artifacts/__init__.py +25 -12
- google_adk_extras/artifacts/base_custom_artifact_service.py +148 -11
- google_adk_extras/artifacts/local_folder_artifact_service.py +133 -13
- google_adk_extras/artifacts/s3_artifact_service.py +135 -19
- google_adk_extras/artifacts/sql_artifact_service.py +109 -10
- google_adk_extras/credentials/__init__.py +34 -0
- google_adk_extras/credentials/base_custom_credential_service.py +113 -0
- google_adk_extras/credentials/github_oauth2_credential_service.py +213 -0
- google_adk_extras/credentials/google_oauth2_credential_service.py +216 -0
- google_adk_extras/credentials/http_basic_auth_credential_service.py +388 -0
- google_adk_extras/credentials/jwt_credential_service.py +345 -0
- google_adk_extras/credentials/microsoft_oauth2_credential_service.py +250 -0
- google_adk_extras/credentials/x_oauth2_credential_service.py +240 -0
- google_adk_extras/custom_agent_loader.py +156 -0
- google_adk_extras/enhanced_adk_web_server.py +137 -0
- google_adk_extras/enhanced_fastapi.py +470 -0
- google_adk_extras/enhanced_runner.py +38 -0
- google_adk_extras/memory/__init__.py +30 -13
- google_adk_extras/memory/base_custom_memory_service.py +37 -5
- google_adk_extras/memory/sql_memory_service.py +105 -19
- google_adk_extras/memory/yaml_file_memory_service.py +115 -22
- google_adk_extras/sessions/__init__.py +29 -13
- google_adk_extras/sessions/base_custom_session_service.py +133 -11
- google_adk_extras/sessions/sql_session_service.py +127 -16
- google_adk_extras/sessions/yaml_file_session_service.py +122 -14
- google_adk_extras-0.2.3.dist-info/METADATA +302 -0
- google_adk_extras-0.2.3.dist-info/RECORD +37 -0
- google_adk_extras/py.typed +0 -0
- google_adk_extras-0.1.1.dist-info/METADATA +0 -175
- google_adk_extras-0.1.1.dist-info/RECORD +0 -25
- {google_adk_extras-0.1.1.dist-info → google_adk_extras-0.2.3.dist-info}/WHEEL +0 -0
- {google_adk_extras-0.1.1.dist-info → google_adk_extras-0.2.3.dist-info}/licenses/LICENSE +0 -0
- {google_adk_extras-0.1.1.dist-info → google_adk_extras-0.2.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,302 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: google-adk-extras
|
3
|
+
Version: 0.2.3
|
4
|
+
Summary: Production-ready services, credentials, and FastAPI wiring for Google ADK
|
5
|
+
Home-page: https://github.com/DeadMeme5441/google-adk-extras
|
6
|
+
Author: DeadMeme5441
|
7
|
+
Author-email: DeadMeme5441 <deadunderscorememe@gmail.com>
|
8
|
+
Requires-Python: >=3.10,<3.13
|
9
|
+
Description-Content-Type: text/markdown
|
10
|
+
License-File: LICENSE
|
11
|
+
Requires-Dist: google-adk
|
12
|
+
Requires-Dist: google-genai
|
13
|
+
Provides-Extra: sql
|
14
|
+
Requires-Dist: sqlalchemy; extra == "sql"
|
15
|
+
Provides-Extra: mongodb
|
16
|
+
Requires-Dist: pymongo; extra == "mongodb"
|
17
|
+
Provides-Extra: redis
|
18
|
+
Requires-Dist: redis; extra == "redis"
|
19
|
+
Provides-Extra: yaml
|
20
|
+
Requires-Dist: pyyaml; extra == "yaml"
|
21
|
+
Provides-Extra: s3
|
22
|
+
Requires-Dist: boto3; extra == "s3"
|
23
|
+
Provides-Extra: jwt
|
24
|
+
Requires-Dist: PyJWT; extra == "jwt"
|
25
|
+
Provides-Extra: web
|
26
|
+
Requires-Dist: fastapi; extra == "web"
|
27
|
+
Requires-Dist: watchdog; extra == "web"
|
28
|
+
Provides-Extra: dev
|
29
|
+
Requires-Dist: pytest; extra == "dev"
|
30
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
31
|
+
Requires-Dist: build; extra == "dev"
|
32
|
+
Requires-Dist: twine; extra == "dev"
|
33
|
+
Provides-Extra: docs
|
34
|
+
Requires-Dist: mkdocs; extra == "docs"
|
35
|
+
Requires-Dist: mkdocs-material; extra == "docs"
|
36
|
+
Requires-Dist: mkdocs-llmstxt; extra == "docs"
|
37
|
+
Provides-Extra: all
|
38
|
+
Requires-Dist: google-adk-extras[docs,jwt,mongodb,redis,s3,sql,web,yaml]; extra == "all"
|
39
|
+
Dynamic: author
|
40
|
+
Dynamic: home-page
|
41
|
+
Dynamic: license-file
|
42
|
+
Dynamic: requires-python
|
43
|
+
|
44
|
+
# google-adk-extras
|
45
|
+
|
46
|
+
[](https://pypi.org/project/google-adk-extras/)
|
47
|
+

|
48
|
+

|
49
|
+
[](https://deadmeme5441.github.io/google-adk-extras/)
|
50
|
+
[](https://github.com/DeadMeme5441/google-adk-extras/actions/workflows/docs.yml)
|
51
|
+
|
52
|
+
Production-ready extensions for Google ADK (Agent Development Kit). This library adds durable service backends (sessions, artifacts, memory), practical credential services (OAuth2/JWT/Basic), and clean FastAPI wiring so you can run ADK agents with real storage and auth.
|
53
|
+
|
54
|
+
What this is not: a fork of ADK. It builds on ADK’s core runtime, agents, tools and callbacks, and drops in where ADK expects services and a web server.
|
55
|
+
|
56
|
+
|
57
|
+
## Why it exists
|
58
|
+
|
59
|
+
ADK provides the core primitives (Runner, Session/State, MemoryService, ArtifactService, CredentialService, Agents/Tools, callbacks, Dev UI, and deployment paths). See the official ADK docs for concepts and APIs.
|
60
|
+
|
61
|
+
This package focuses on three gaps common in real apps:
|
62
|
+
- Durable storage backends beyond in‑memory defaults
|
63
|
+
- Usable credential flows (Google/GitHub/Microsoft/X OAuth2, JWT, Basic)
|
64
|
+
- FastAPI integration that accepts your credential service without hacks
|
65
|
+
|
66
|
+
|
67
|
+
## Features
|
68
|
+
|
69
|
+
- Session services: SQL (SQLite/Postgres/MySQL), MongoDB, Redis, YAML files
|
70
|
+
- Artifact services: Local folder (versioned), S3‑compatible, SQL, MongoDB
|
71
|
+
- Memory services: SQL, MongoDB, Redis, YAML files (term search over text parts)
|
72
|
+
- Credential services: Google/GitHub/Microsoft/X (OAuth2), JWT, HTTP Basic
|
73
|
+
- Enhanced FastAPI wiring that respects a provided credential service
|
74
|
+
- Fluent builder (`AdkBuilder`) to assemble a FastAPI app or a Runner
|
75
|
+
- A2A helpers for exposing/consuming agents (see below)
|
76
|
+
|
77
|
+
Note on Runner: `EnhancedRunner` is a thin subclass of ADK’s `Runner` for compatibility with the enhanced web server; it does not change behavior.
|
78
|
+
|
79
|
+
|
80
|
+
## Install
|
81
|
+
|
82
|
+
Requirements: Python 3.12+, google-adk.
|
83
|
+
|
84
|
+
Using uv:
|
85
|
+
|
86
|
+
```bash
|
87
|
+
# create a venv (optional)
|
88
|
+
uv venv && source .venv/bin/activate
|
89
|
+
# install the package
|
90
|
+
uv pip install google-adk-extras
|
91
|
+
```
|
92
|
+
|
93
|
+
If you plan to use specific backends, also install their clients (examples):
|
94
|
+
- SQL: `uv pip install sqlalchemy`
|
95
|
+
- MongoDB: `uv pip install pymongo`
|
96
|
+
- Redis: `uv pip install redis`
|
97
|
+
- S3: `uv pip install boto3`
|
98
|
+
- JWT: `uv pip install PyJWT`
|
99
|
+
|
100
|
+
|
101
|
+
## Quickstart (FastAPI)
|
102
|
+
|
103
|
+
Use the fluent builder to wire services and credentials. Then run with uvicorn.
|
104
|
+
|
105
|
+
```python
|
106
|
+
# app.py
|
107
|
+
from google_adk_extras import AdkBuilder
|
108
|
+
from google_adk_extras.credentials import GoogleOAuth2CredentialService
|
109
|
+
|
110
|
+
app = (
|
111
|
+
AdkBuilder()
|
112
|
+
.with_agents_dir("./agents") # ADK agents on disk
|
113
|
+
.with_session_service("sqlite:///./sessions.db") # or: mongodb://, redis://, yaml://
|
114
|
+
.with_artifact_service("local://./artifacts") # or: s3://bucket, mongodb://, sql://
|
115
|
+
.with_memory_service("yaml://./memory") # or: redis://, mongodb://, sql://
|
116
|
+
.with_credential_service(GoogleOAuth2CredentialService(
|
117
|
+
client_id="…apps.googleusercontent.com",
|
118
|
+
client_secret="…",
|
119
|
+
scopes=["openid", "email", "profile"],
|
120
|
+
))
|
121
|
+
.with_web_ui(True) # serve ADK’s dev UI if assets available
|
122
|
+
.with_agent_reload(True)
|
123
|
+
.build_fastapi_app()
|
124
|
+
)
|
125
|
+
```
|
126
|
+
|
127
|
+
Run:
|
128
|
+
|
129
|
+
```bash
|
130
|
+
uvicorn app:app --reload
|
131
|
+
```
|
132
|
+
|
133
|
+
If you don’t keep agents on disk, register them programmatically and use a custom loader (see below).
|
134
|
+
|
135
|
+
|
136
|
+
## Quickstart (Runner)
|
137
|
+
|
138
|
+
Create a Runner wired with your chosen backends. Use agent name (filesystem loader) or pass an agent instance.
|
139
|
+
|
140
|
+
```python
|
141
|
+
from google_adk_extras import AdkBuilder
|
142
|
+
|
143
|
+
runner = (
|
144
|
+
AdkBuilder()
|
145
|
+
.with_agents_dir("./agents")
|
146
|
+
.with_session_service("sqlite:///./sessions.db")
|
147
|
+
.with_memory_service("redis://localhost:6379")
|
148
|
+
.with_artifact_service("local://./artifacts")
|
149
|
+
.build_runner("my_agent")
|
150
|
+
)
|
151
|
+
|
152
|
+
result = await runner.run("Hello there!")
|
153
|
+
```
|
154
|
+
|
155
|
+
|
156
|
+
## How this extends ADK (in practice)
|
157
|
+
|
158
|
+
ADK defines abstract service interfaces and a runner/web stack. This package provides drop‑in implementations and a small web‑server shim:
|
159
|
+
|
160
|
+
- Sessions
|
161
|
+
- `SQLSessionService` — SQLAlchemy; JSON‑serialized state/events
|
162
|
+
- `MongoSessionService` — PyMongo; per‑session doc, indexed by app/user/id
|
163
|
+
- `RedisSessionService` — hashes per session + user set; JSON state/events
|
164
|
+
- `YamlFileSessionService` — `base/app/user/{session_id}.yaml`
|
165
|
+
|
166
|
+
### A2A helpers (new)
|
167
|
+
|
168
|
+
Two light-weight helpers wrap ADK’s A2A capabilities:
|
169
|
+
|
170
|
+
- `AdkBuilder.enable_a2a_for_registered_agents(enabled=True, mount_base="/a2a", card_factory=None)`
|
171
|
+
- Expose programmatically registered agents (added via `with_agent_instance()` / `with_agents()`) over A2A without an `agents_dir`.
|
172
|
+
- Optionally supply `card_factory(name, agent) -> dict` to build an Agent Card; otherwise a minimal card is used.
|
173
|
+
|
174
|
+
- `AdkBuilder.with_remote_a2a_agent(name, agent_card_url, description=None)`
|
175
|
+
- Register a `RemoteA2aAgent` by agent card URL so your root agent can delegate to a remote agent.
|
176
|
+
- Requires `google-adk[a2a]` installed.
|
177
|
+
|
178
|
+
Expose a programmatic agent via A2A:
|
179
|
+
|
180
|
+
```python
|
181
|
+
from google_adk_extras import AdkBuilder
|
182
|
+
from google.adk.agents import Agent
|
183
|
+
|
184
|
+
hello = Agent(model="gemini-2.0-flash", name="hello", instruction="You are helpful.")
|
185
|
+
|
186
|
+
app = (
|
187
|
+
AdkBuilder()
|
188
|
+
.with_agent_instance("hello", hello)
|
189
|
+
.with_a2a_protocol(True)
|
190
|
+
.enable_a2a_for_registered_agents() # becomes available at /a2a/hello
|
191
|
+
.build_fastapi_app()
|
192
|
+
)
|
193
|
+
```
|
194
|
+
|
195
|
+
Consume a remote A2A agent:
|
196
|
+
|
197
|
+
```python
|
198
|
+
from a2a.utils.constants import AGENT_CARD_WELL_KNOWN_PATH
|
199
|
+
from google_adk_extras import AdkBuilder
|
200
|
+
|
201
|
+
card_url = f"http://remote-host:8001/a2a/prime{AGENT_CARD_WELL_KNOWN_PATH}"
|
202
|
+
|
203
|
+
app = (
|
204
|
+
AdkBuilder()
|
205
|
+
.with_remote_a2a_agent("prime_agent", card_url, description="Prime checker")
|
206
|
+
# add your root agent via with_agent_instance(...)
|
207
|
+
.build_fastapi_app()
|
208
|
+
)
|
209
|
+
```
|
210
|
+
|
211
|
+
- Artifacts
|
212
|
+
- `LocalFolderArtifactService` — per‑artifact metadata JSON + versioned data files
|
213
|
+
- `S3ArtifactService` — metadata JSON + versioned data objects in S3‑compatible storage
|
214
|
+
- `SQLArtifactService` — blobs per version in SQL
|
215
|
+
- `MongoArtifactService` — blobs per version in MongoDB
|
216
|
+
|
217
|
+
- Memory
|
218
|
+
- `SQLMemoryService`, `MongoMemoryService`, `RedisMemoryService`, `YamlFileMemoryService`
|
219
|
+
- Extracts text from `google.genai.types.Content`, tokenizes simple terms, and searches terms
|
220
|
+
|
221
|
+
- Credentials
|
222
|
+
- OAuth2: Google, GitHub, Microsoft, X (Twitter)
|
223
|
+
- Tokens: JWT (generate/verify/refresh‑aware), HTTP Basic (+ multi‑user variant)
|
224
|
+
- Persist via ADK’s session/in‑memory credential stores
|
225
|
+
|
226
|
+
- FastAPI integration
|
227
|
+
- `get_enhanced_fast_api_app(...)` accepts a provided credential service
|
228
|
+
- `EnhancedAdkWebServer` returns `EnhancedRunner` and keeps ADK’s caching/cleanup
|
229
|
+
- Prefer the fluent `AdkBuilder()` path for multi‑backend wiring in one place
|
230
|
+
|
231
|
+
|
232
|
+
## Agent loading options
|
233
|
+
|
234
|
+
- Directory loading (ADK default): `with_agents_dir("./agents")` and create `./agents/<app_name>/agent.json` (or your ADK agent files) per app.
|
235
|
+
- Programmatic agents: register instances and avoid a folder layout.
|
236
|
+
|
237
|
+
```python
|
238
|
+
from google_adk_extras import AdkBuilder
|
239
|
+
from google_adk_extras.custom_agent_loader import CustomAgentLoader
|
240
|
+
from google.adk.agents.base_agent import BaseAgent
|
241
|
+
|
242
|
+
loader = CustomAgentLoader()
|
243
|
+
loader.register_agent("my_app", BaseAgent(name="my_app")) # replace with a real agent
|
244
|
+
|
245
|
+
app = (
|
246
|
+
AdkBuilder()
|
247
|
+
.with_agent_loader(loader)
|
248
|
+
.with_session_service("sqlite:///./sessions.db")
|
249
|
+
.build_fastapi_app()
|
250
|
+
)
|
251
|
+
```
|
252
|
+
|
253
|
+
|
254
|
+
## Credential URI cheatsheet (optional)
|
255
|
+
|
256
|
+
If you prefer URIs instead of constructing services:
|
257
|
+
|
258
|
+
- Google OAuth2: `oauth2-google://client_id:secret@scopes=openid,email,profile`
|
259
|
+
- GitHub OAuth2: `oauth2-github://client_id:secret@scopes=user,repo`
|
260
|
+
- Microsoft OAuth2: `oauth2-microsoft://<tenant>/<client_id>:<secret>@scopes=User.Read`
|
261
|
+
- X OAuth2: `oauth2-x://client_id:secret@scopes=tweet.read,users.read`
|
262
|
+
- JWT: `jwt://<secret>@algorithm=HS256&issuer=my-app&audience=api.example.com&expiration_minutes=60`
|
263
|
+
- Basic: `basic-auth://username:password@realm=My%20API`
|
264
|
+
|
265
|
+
```python
|
266
|
+
cred = (
|
267
|
+
AdkBuilder()
|
268
|
+
.with_credential_service_uri("jwt://secret@issuer=my-app")
|
269
|
+
._create_credential_service()
|
270
|
+
)
|
271
|
+
```
|
272
|
+
|
273
|
+
|
274
|
+
## Notes & limitations
|
275
|
+
|
276
|
+
- The runner in this package is intentionally thin. All agent logic, tools, callbacks, and evaluation remain ADK responsibilities.
|
277
|
+
- The repository currently ships only the pieces listed above; referenced registries or configuration subsystems are intentionally out of scope.
|
278
|
+
- Some direct FastAPI parameters (e.g., ADK’s special memory URIs) pass through for parity, but the fluent builder is the recommended path for the extended backends offered here.
|
279
|
+
|
280
|
+
|
281
|
+
## Docs
|
282
|
+
|
283
|
+
This repo ships a full MkDocs site in `docs/`.
|
284
|
+
|
285
|
+
Build locally with uv:
|
286
|
+
|
287
|
+
```bash
|
288
|
+
uv pip install .[docs]
|
289
|
+
uv run mkdocs serve
|
290
|
+
```
|
291
|
+
|
292
|
+
## Development
|
293
|
+
|
294
|
+
```bash
|
295
|
+
uv sync # or: pip install -e .
|
296
|
+
pytest -q # run tests
|
297
|
+
```
|
298
|
+
|
299
|
+
|
300
|
+
## License
|
301
|
+
|
302
|
+
Apache 2.0 — see LICENSE.
|
@@ -0,0 +1,37 @@
|
|
1
|
+
google_adk_extras/__init__.py,sha256=s6tVJq91a1hoCIS1AbyiYclXM15mWHR2VVEXTmKZBfE,830
|
2
|
+
google_adk_extras/adk_builder.py,sha256=anTpd-UYtPugRSqdYNmWa_uesVjHGEKO2mntkcU-J6g,41179
|
3
|
+
google_adk_extras/custom_agent_loader.py,sha256=fExcVqshlGkIT3JJ8YXwhAz_Tbw1aCYSeCbc24MpLn0,5320
|
4
|
+
google_adk_extras/enhanced_adk_web_server.py,sha256=rML_m4Um9QCcnnlHvCOyLGjLHDcyladEunX-x4JX43Q,5414
|
5
|
+
google_adk_extras/enhanced_fastapi.py,sha256=ndQbMGgZi_XT-4cywlEbeLMqnZ0IMn7cu72RLuRcMCo,20914
|
6
|
+
google_adk_extras/enhanced_runner.py,sha256=b7O1a9-4S49LduILOEDs6IxjCI4w_E39sc-Hs4y3Rys,1410
|
7
|
+
google_adk_extras/artifacts/__init__.py,sha256=_IsKDgf6wanWR0HXvSpK9SiLa3n5URKLtazkKyH1P-o,931
|
8
|
+
google_adk_extras/artifacts/base_custom_artifact_service.py,sha256=O9rkc250B3yDRYbyDI0EvTrCKvnih5_DQas5OF-hRMY,9721
|
9
|
+
google_adk_extras/artifacts/local_folder_artifact_service.py,sha256=Vb-KYExEcanHy9c1wAjB1n6hVAUw7pg9ZeahWE--Jx8,12533
|
10
|
+
google_adk_extras/artifacts/mongo_artifact_service.py,sha256=z6x7zL4RsPuUYOgv02xkD_c3BNInjTa61ElgsvkZazc,7111
|
11
|
+
google_adk_extras/artifacts/s3_artifact_service.py,sha256=HMOlHzs5Z2DicaTa6O3LJRwzhzPlpBpwftxWtmjwf1I,15669
|
12
|
+
google_adk_extras/artifacts/sql_artifact_service.py,sha256=9wy-UP8rvFng_h66X7mU0y7DRlxI-AcqxRtg6Ph2VDU,11992
|
13
|
+
google_adk_extras/credentials/__init__.py,sha256=sklM_jV5hM_zffABV5TWx-B99bFNrSLP8Ik7Z6mD7Zs,1274
|
14
|
+
google_adk_extras/credentials/base_custom_credential_service.py,sha256=iYHacJAsZmDfpxLOPYx4tQpbtWTbwC75tRp6hlZFoSg,4014
|
15
|
+
google_adk_extras/credentials/github_oauth2_credential_service.py,sha256=bQwVh6uLLH7w_9EtS_BIcEI3VpHS6G93KSzNPB-gsig,8677
|
16
|
+
google_adk_extras/credentials/google_oauth2_credential_service.py,sha256=3zl3bZmzch7gD4FaQinlRzKfS0Z8GRMbn161kIqgwgg,8503
|
17
|
+
google_adk_extras/credentials/http_basic_auth_credential_service.py,sha256=s_t98s1ESnTDMUwg6Z5dvxxZ6aPd5w4Qooz6ZtMNm2I,14305
|
18
|
+
google_adk_extras/credentials/jwt_credential_service.py,sha256=S5JzD2gGrg9YGr8iu4zYsC1B8x6vUijglAVkACOCYOA,12604
|
19
|
+
google_adk_extras/credentials/microsoft_oauth2_credential_service.py,sha256=ST1i3O7LCCOa2RnvTP0mPIFsj5aMtWgfMnCyW2kgyUg,10366
|
20
|
+
google_adk_extras/credentials/x_oauth2_credential_service.py,sha256=zFESyKPjzJJnmdKcU3ZCLZvbHLMPifdKUDYTiN_16vc,8952
|
21
|
+
google_adk_extras/memory/__init__.py,sha256=2FFJXw9CZHctKXmCuc-lrdETeQ5xqdivy3oarHJz5gs,994
|
22
|
+
google_adk_extras/memory/base_custom_memory_service.py,sha256=TRQMaXiRg2LXFwYZnFHoL-yBVtecuX1ownyPBJf6Xww,3613
|
23
|
+
google_adk_extras/memory/mongo_memory_service.py,sha256=M2FGzGaWuEkDILjEpUPx7OOzuek7d1OP9TXzKAeb9jE,6759
|
24
|
+
google_adk_extras/memory/redis_memory_service.py,sha256=P6vYvP8gv6kCH1lRB0SQld3mzS_JVKMUDtKifXDfu38,7400
|
25
|
+
google_adk_extras/memory/sql_memory_service.py,sha256=cmy2sL4bzVi4WWyEeVt7FNhioxSd1OGm7fQKzESvyO8,10766
|
26
|
+
google_adk_extras/memory/yaml_file_memory_service.py,sha256=St1LMYwLE7HnW-hWhckuEKFadlULUPKkqRMwLpOf48I,9941
|
27
|
+
google_adk_extras/sessions/__init__.py,sha256=VgHyPULLzjJD7ShsyABz98rWVND0mOoM6qX74MrTJwA,915
|
28
|
+
google_adk_extras/sessions/base_custom_session_service.py,sha256=npwrSNAtgqN6K7C8e4idiWkFNr_3pcOAiFYpGXu3NnI,8912
|
29
|
+
google_adk_extras/sessions/mongo_session_service.py,sha256=r3jZ3PmDpbZ0veNzXzuAj_fqRWNZL8RO53ESEHrr7uQ,8329
|
30
|
+
google_adk_extras/sessions/redis_session_service.py,sha256=yyfXZozeFWJ2S_kz7zXqz--f_ymE6HMMpT3MhcpFXIE,10434
|
31
|
+
google_adk_extras/sessions/sql_session_service.py,sha256=TaOeEVWnwQ_8nvDZBW7e3qhzR_ecuGsjvZ_kh6Guq8g,14558
|
32
|
+
google_adk_extras/sessions/yaml_file_session_service.py,sha256=SpTh8YHIALcoxzmturhcZ4ReHKQrJI1CxoYiJQ-baRc,11819
|
33
|
+
google_adk_extras-0.2.3.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
34
|
+
google_adk_extras-0.2.3.dist-info/METADATA,sha256=CUcNOt9H533ZLHeyKvhP4C_EcLDDl18m2XOzHCwDMns,10707
|
35
|
+
google_adk_extras-0.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
36
|
+
google_adk_extras-0.2.3.dist-info/top_level.txt,sha256=DDWgVkz8G8ihPzznxAWyKa2jgJW3F6Fwy__qMddoKTs,18
|
37
|
+
google_adk_extras-0.2.3.dist-info/RECORD,,
|
google_adk_extras/py.typed
DELETED
File without changes
|
@@ -1,175 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: google-adk-extras
|
3
|
-
Version: 0.1.1
|
4
|
-
Summary: Custom implementations of Google ADK services (Session, Artifact, Memory) with multiple storage backends
|
5
|
-
Home-page: https://github.com/DeadMeme5441/google-adk-extras
|
6
|
-
Author: Your Name
|
7
|
-
Author-email: your.email@example.com
|
8
|
-
Requires-Python: >=3.10
|
9
|
-
Description-Content-Type: text/markdown
|
10
|
-
License-File: LICENSE
|
11
|
-
Requires-Dist: google-genai>=1.0.0
|
12
|
-
Requires-Dist: sqlalchemy>=2.0.0
|
13
|
-
Requires-Dist: pymongo>=4.0.0
|
14
|
-
Requires-Dist: redis>=4.0.0
|
15
|
-
Requires-Dist: pyyaml>=6.0.0
|
16
|
-
Requires-Dist: typing-extensions>=4.0.0
|
17
|
-
Requires-Dist: pytest>=8.4.2
|
18
|
-
Requires-Dist: pytest-asyncio>=1.1.0
|
19
|
-
Requires-Dist: google-adk>=1.13.0
|
20
|
-
Requires-Dist: boto3>=1.0.0
|
21
|
-
Provides-Extra: dev
|
22
|
-
Requires-Dist: pytest>=6.0; extra == "dev"
|
23
|
-
Requires-Dist: pytest-asyncio>=0.15.0; extra == "dev"
|
24
|
-
Requires-Dist: google-genai>=1.0.0; extra == "dev"
|
25
|
-
Dynamic: author
|
26
|
-
Dynamic: author-email
|
27
|
-
Dynamic: home-page
|
28
|
-
Dynamic: license-file
|
29
|
-
Dynamic: requires-python
|
30
|
-
|
31
|
-
# Google ADK Custom Services
|
32
|
-
|
33
|
-
[](https://github.com/DeadMeme5441/google-adk-extras/actions/workflows/ci.yml)
|
34
|
-
[](https://badge.fury.io/py/google-adk-extras)
|
35
|
-
|
36
|
-
Custom implementations of Google ADK services (Session, Artifact, Memory) with multiple storage backends.
|
37
|
-
|
38
|
-
## Features
|
39
|
-
|
40
|
-
This package provides custom implementations for Google ADK services with various storage backends:
|
41
|
-
|
42
|
-
### Session Services
|
43
|
-
- **SQLSessionService**: Store sessions in SQL databases (SQLite, PostgreSQL, MySQL, etc.)
|
44
|
-
- **MongoSessionService**: Store sessions in MongoDB
|
45
|
-
- **RedisSessionService**: Store sessions in Redis
|
46
|
-
- **YamlFileSessionService**: Store sessions in YAML files
|
47
|
-
|
48
|
-
### Artifact Services
|
49
|
-
- **SQLArtifactService**: Store artifacts in SQL databases
|
50
|
-
- **MongoArtifactService**: Store artifacts in MongoDB
|
51
|
-
- **LocalFolderArtifactService**: Store artifacts in local file system
|
52
|
-
- **S3ArtifactService**: Store artifacts in AWS S3 or S3-compatible services
|
53
|
-
|
54
|
-
### Memory Services
|
55
|
-
- **SQLMemoryService**: Store memories in SQL databases
|
56
|
-
- **MongoMemoryService**: Store memories in MongoDB
|
57
|
-
- **RedisMemoryService**: Store memories in Redis
|
58
|
-
- **YamlFileMemoryService**: Store memories in YAML files
|
59
|
-
|
60
|
-
## Installation
|
61
|
-
|
62
|
-
```bash
|
63
|
-
pip install google-adk-extras
|
64
|
-
```
|
65
|
-
|
66
|
-
## Usage
|
67
|
-
|
68
|
-
### Session Services
|
69
|
-
|
70
|
-
```python
|
71
|
-
from google_adk_extras.sessions import SQLSessionService
|
72
|
-
|
73
|
-
# Initialize SQL session service
|
74
|
-
session_service = SQLSessionService("sqlite:///sessions.db")
|
75
|
-
await session_service.initialize()
|
76
|
-
|
77
|
-
# Create a session
|
78
|
-
session = await session_service.create_session(
|
79
|
-
app_name="my_app",
|
80
|
-
user_id="user_123",
|
81
|
-
state={"theme": "dark"}
|
82
|
-
)
|
83
|
-
```
|
84
|
-
|
85
|
-
### Artifact Services
|
86
|
-
|
87
|
-
```python
|
88
|
-
from google_adk_extras.artifacts import LocalFolderArtifactService
|
89
|
-
from google.genai import types
|
90
|
-
|
91
|
-
# Initialize local folder artifact service
|
92
|
-
artifact_service = LocalFolderArtifactService("./artifacts")
|
93
|
-
await artifact_service.initialize()
|
94
|
-
|
95
|
-
# Save an artifact
|
96
|
-
text_blob = types.Blob(data=b"Hello, world!", mime_type="text/plain")
|
97
|
-
text_part = types.Part(inline_data=text_blob)
|
98
|
-
version = await artifact_service.save_artifact(
|
99
|
-
app_name="my_app",
|
100
|
-
user_id="user_123",
|
101
|
-
session_id="session_456",
|
102
|
-
filename="hello.txt",
|
103
|
-
artifact=text_part
|
104
|
-
)
|
105
|
-
```
|
106
|
-
|
107
|
-
### Memory Services
|
108
|
-
|
109
|
-
```python
|
110
|
-
from google_adk_extras.memory import RedisMemoryService
|
111
|
-
from google.adk.sessions.session import Session
|
112
|
-
from google.adk.events.event import Event
|
113
|
-
|
114
|
-
# Initialize Redis memory service
|
115
|
-
memory_service = RedisMemoryService(host="localhost", port=6379)
|
116
|
-
await memory_service.initialize()
|
117
|
-
|
118
|
-
# Add a session to memory
|
119
|
-
session = Session(id="session_1", app_name="my_app", user_id="user_123", events=[])
|
120
|
-
await memory_service.add_session_to_memory(session)
|
121
|
-
|
122
|
-
# Search memory
|
123
|
-
response = await memory_service.search_memory(
|
124
|
-
app_name="my_app",
|
125
|
-
user_id="user_123",
|
126
|
-
query="important information"
|
127
|
-
)
|
128
|
-
```
|
129
|
-
|
130
|
-
## Examples
|
131
|
-
|
132
|
-
See the [examples](examples/) directory for complete working examples of each service.
|
133
|
-
|
134
|
-
## Requirements
|
135
|
-
|
136
|
-
- Python 3.10+
|
137
|
-
- Google ADK
|
138
|
-
- Storage backend dependencies (installed automatically):
|
139
|
-
- SQLAlchemy for SQL services
|
140
|
-
- PyMongo for MongoDB services
|
141
|
-
- redis-py for Redis services
|
142
|
-
- PyYAML for YAML file services
|
143
|
-
- boto3 for S3 services
|
144
|
-
|
145
|
-
## Development
|
146
|
-
|
147
|
-
### Setup
|
148
|
-
|
149
|
-
```bash
|
150
|
-
# Clone the repository
|
151
|
-
git clone https://github.com/DeadMeme5441/google-adk-extras.git
|
152
|
-
cd google-adk-extras
|
153
|
-
|
154
|
-
# Install with uv (recommended)
|
155
|
-
uv sync
|
156
|
-
|
157
|
-
# Or install with pip
|
158
|
-
pip install -e .
|
159
|
-
```
|
160
|
-
|
161
|
-
### Running Tests
|
162
|
-
|
163
|
-
```bash
|
164
|
-
# Run all tests
|
165
|
-
uv run pytest tests/
|
166
|
-
|
167
|
-
# Run specific test suite
|
168
|
-
uv run pytest tests/unit/
|
169
|
-
uv run pytest tests/integration/
|
170
|
-
uv run pytest tests/e2e/
|
171
|
-
```
|
172
|
-
|
173
|
-
## License
|
174
|
-
|
175
|
-
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
|
@@ -1,25 +0,0 @@
|
|
1
|
-
google_adk_extras/__init__.py,sha256=HXajqVldJRhLGIQr5yI22yA54_-Fm36M59NI-VuhED4,76
|
2
|
-
google_adk_extras/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
google_adk_extras/artifacts/__init__.py,sha256=78QXiuHidvhS3vtNUJvPdcdx3UOkOHGbtDoIOFkk13o,522
|
4
|
-
google_adk_extras/artifacts/base_custom_artifact_service.py,sha256=QjikAJrRxGxzRyX_vW30OvgIIrRXB-xqwXbEbCg3yJc,5496
|
5
|
-
google_adk_extras/artifacts/local_folder_artifact_service.py,sha256=j8MQAYhtDX4MEDrqSxLpP5gqVVxPe7EdGsrFa_WtjQI,8894
|
6
|
-
google_adk_extras/artifacts/mongo_artifact_service.py,sha256=z6x7zL4RsPuUYOgv02xkD_c3BNInjTa61ElgsvkZazc,7111
|
7
|
-
google_adk_extras/artifacts/s3_artifact_service.py,sha256=JZYyhdYQmnPVlAX6xML5VtK00zJ799lnBe11IG-rgHc,12034
|
8
|
-
google_adk_extras/artifacts/sql_artifact_service.py,sha256=6nDWrWYNdGxxVqlyiitspAqLfOfTObPcAPzodJ9nGZs,9015
|
9
|
-
google_adk_extras/memory/__init__.py,sha256=ijfxxZjU47CwbnnpORTnY_8RKCjvd1skVQId2iiHZ1M,472
|
10
|
-
google_adk_extras/memory/base_custom_memory_service.py,sha256=L0e5O-XzoP10m6ZsQ8ZIJTA6RpxEcF5uC4Rasp0mHAc,2782
|
11
|
-
google_adk_extras/memory/mongo_memory_service.py,sha256=M2FGzGaWuEkDILjEpUPx7OOzuek7d1OP9TXzKAeb9jE,6759
|
12
|
-
google_adk_extras/memory/redis_memory_service.py,sha256=P6vYvP8gv6kCH1lRB0SQld3mzS_JVKMUDtKifXDfu38,7400
|
13
|
-
google_adk_extras/memory/sql_memory_service.py,sha256=31iouO1ehqXXRoQrZWwyU7UkLnZUChBY1ItEyjJ4jCk,8123
|
14
|
-
google_adk_extras/memory/yaml_file_memory_service.py,sha256=oZjp2mLbwXGzzwcma9NhbeL4qbpj53uNBmkmXnV_KBA,7106
|
15
|
-
google_adk_extras/sessions/__init__.py,sha256=yr4q9Z_14NTMri7P5lF-eJPNpTIXcbih2qGOsB7_iAU,408
|
16
|
-
google_adk_extras/sessions/base_custom_session_service.py,sha256=Af5FHmVgVJGWHovizquzSLIfogEwvjOBFXuNr0fLhQs,5305
|
17
|
-
google_adk_extras/sessions/mongo_session_service.py,sha256=r3jZ3PmDpbZ0veNzXzuAj_fqRWNZL8RO53ESEHrr7uQ,8329
|
18
|
-
google_adk_extras/sessions/redis_session_service.py,sha256=yyfXZozeFWJ2S_kz7zXqz--f_ymE6HMMpT3MhcpFXIE,10434
|
19
|
-
google_adk_extras/sessions/sql_session_service.py,sha256=SjcHrdsLLKIMeLkik5Kc6KJ1UE0jWkIhbza-8GJqoUc,11445
|
20
|
-
google_adk_extras/sessions/yaml_file_session_service.py,sha256=kgEdg1jlS0Lf0XH2Hgnj4LWiarobIvldauWgQ6sY-hU,8743
|
21
|
-
google_adk_extras-0.1.1.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
22
|
-
google_adk_extras-0.1.1.dist-info/METADATA,sha256=K6_U7iJD8EcOGwB8dq8WZCh2CzrGjhkESXLoGnGxngY,4841
|
23
|
-
google_adk_extras-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
24
|
-
google_adk_extras-0.1.1.dist-info/top_level.txt,sha256=DDWgVkz8G8ihPzznxAWyKa2jgJW3F6Fwy__qMddoKTs,18
|
25
|
-
google_adk_extras-0.1.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|