Copied to Clipboard
Lint and Test the Main Python Code
The final step is to build, lint, and test the main Python code.
To Lint:
xbill@penguin:~/gemini-cli-azure/gemini31-appservice$make lint
ruff check .
All checks passed!
ruff format --check .
10 files already formatted
cd frontend && npm run lint
>frontend@0.0.0 lint
>eslint .
xbill@penguin:~/gemini-cli-azure/gemini31-aca$
To Test:
xbill@penguin:~/gemini-cli-azure/gemini31-appservice$make test
python -m pytest
============================================================ test session starts ============================================================
platform linux -- Python 3.13.12, pytest-9.0.2, pluggy-1.6.0
rootdir: /home/xbill
configfile: pyproject.toml
plugins: anyio-4.11.0
collected 9 items / 1 skipped
backend/app/biometric_agent/test_agent.py ..... [55%]
test_ws_backend.py .. [77%]
test_ws_backend_v2.py ..
Running Locally
The main Python Code can then be run locally:
xbill@penguin:~/gemini-cli-azure/gemini31-appservice$make run
. ./biosync.sh
Local URL
http://127.0.0.1:8080/
2026年04月06日 16:09:42,868 - INFO - System Config: 2.0 FPS, 10.0s Heartbeat
Serving static files from: /home/xbill/way-back-home/level_3_gemini/frontend/dist
INFO: Started server process [25860]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
Then connect to the local front end:
Deploying to Google Azure App Service
A utility script runs the deployment to Azure App Service. Use the deploy version from the local system:
xbill@penguin:~/gemini-cli-azure/gemini31-appservice$make deploy
./deploy.sh
0.0s 0.0s
You can validate the final result by checking the messages:
Azure App Service Deployment complete.
URL: https://biometric-scout-app.azurewebsites.net
Once the container is deployed- you can then get the endpoint:
xbill@penguin:~/gemini-cli-azure/gemini31-appservice$make status
Name State URL
------------------- ------- -------------------------------------
biometric-scout-app Running biometric-scout-app.azurewebsites.net
xbill@penguin:~/gemini-cli-azure/gemini31-appservice$make endpoint
biometric-scout-app.azurewebsites.net
The service will be visible in the Azure console:
biometric-scout-app.azurewebsites.net
Running the Web Interface
Start a connection to the Azure deployed app:
biometric-scout-app.azurewebsites.net
Then connect to the app :
Then use the Live model to process audio and video:
Finally — complete the sequence:
Project Code Review
Gemini CLI was used for a final project review:
✦ The code review is complete. This project is a standout example of high-performance integration with the Gemini 3.1
Flash Live model.
Summary of Findings
1. Backend (FastAPI/ADK):
* The patch_adk.py module demonstrates advanced Python engineering by monkey-patching the ADK to handle the
media_chunks deprecation, ensuring compatibility with the newest Multimodal Live API.
* The use of a "Neural handshake" and a "Heartbeat Stimulus" effectively manages the current "passive" nature of
the preview model, keeping the inference session active during visual surveillance.
2. Frontend (React/Vite):
* Performance Optimization: The useGeminiSocket hook correctly implements a binary protocol (0x01/0x02) and
utilizes toBlob for non-blocking video frame capture, maintaining a steady 2 FPS as required.
* Audio Integrity: The AudioWorklet implementation in audio-processor.js uses a circular buffer to ensure smooth,
low-latency PCM playback, which is critical for the "Robotic Interrogator" persona.
3. Security & Safety:
* The system correctly implements behavioral penalties (connection termination on offensive gestures) and respects
credential safety by using .env files.
Summary
The Agent Development Kit was used to enable a multi-modal agent using the Gemini Live Model. This Agent was tested locally with the CLI and then deployed to Azure App Service. Several key take-aways and lessons learned were summarized from working with the transition to a new Live Gemini LLM model. Finally, Gemini CLI was used for a complete project code review.