Skip to content

Commit b892d9e

Browse files
committed
feat: Add Redis-backed session service to ADK community extensions
1 parent a0fc800 commit b892d9e

20 files changed

+5200
-0
lines changed

.gitignore

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual Environment
24+
venv/
25+
ENV/
26+
env/
27+
.env
28+
.venv
29+
env.bak/
30+
venv.bak/
31+
32+
# IDE
33+
.idea/
34+
.vscode/
35+
*.swp
36+
*.swo
37+
.DS_Store
38+
39+
# Testing
40+
.coverage
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.pytest_cache/
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
53+
# Jupyter Notebook
54+
.ipynb_checkpoints
55+
56+
# Logs
57+
*.log
58+
logs/
59+
log/
60+
61+
# Local development settings
62+
.env.local
63+
.env.development.local
64+
.env.test.local
65+
.env.production.local
66+
uv.lock
67+
68+
# Google Cloud specific
69+
.gcloudignore
70+
.gcloudignore.local
71+
72+
# Documentation
73+
docs/_build/
74+
site/
75+
76+
# Misc
77+
Thumbs.db
78+
*.bak
79+
*.tmp
80+
*.temp

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dependencies = [
2727
# go/keep-sorted start
2828
"google-genai>=1.21.1, <2.0.0", # Google GenAI SDK
2929
"google-adk", # Google ADK
30+
"redis>=5.0.0, <6.0.0", # Redis for session storage
3031
# go/keep-sorted end
3132
]
3233
dynamic = ["version"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
Lines changed: 17 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
class AudioProcessor extends AudioWorkletProcessor {
18+
constructor() {
19+
super();
20+
this.targetSampleRate = 22000; // Change to your desired rate
21+
this.originalSampleRate = sampleRate; // Browser's sample rate
22+
this.resampleRatio = this.originalSampleRate / this.targetSampleRate;
23+
}
24+
25+
process(inputs, outputs, parameters) {
26+
const input = inputs[0];
27+
if (input.length > 0) {
28+
let audioData = input[0]; // Get first channel's data
29+
30+
if (this.resampleRatio !== 1) {
31+
audioData = this.resample(audioData);
32+
}
33+
34+
this.port.postMessage(audioData);
35+
}
36+
return true; // Keep processor alive
37+
}
38+
39+
resample(audioData) {
40+
const newLength = Math.round(audioData.length / this.resampleRatio);
41+
const resampled = new Float32Array(newLength);
42+
43+
for (let i = 0; i < newLength; i++) {
44+
const srcIndex = Math.floor(i * this.resampleRatio);
45+
resampled[i] = audioData[srcIndex]; // Nearest neighbor resampling
46+
}
47+
return resampled;
48+
}
49+
}
50+
51+
registerProcessor('audio-processor', AudioProcessor);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"backendUrl": ""
3+
}

src/google/adk_community/cli/browser/chunk-EQDQRRRY.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/adk_community/cli/browser/chunk-TXJFAAIW.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/adk_community/cli/browser/index.html

Lines changed: 34 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)