Commit 8dd5a79
fix: Fix transcript finish
Merge #3324
**Problem:**
ADK seems to not pass output/input transcription `finished` flag from the Gemini.
**Solution:**
Relaxation of checking conditions of valid llm_response for input/output transcription.
### Testing Plan
Unit test `test_receive_transcript_finished` checks if input/output transcription message with no text but `finished` flag is received.
**Unit Tests:**
- [x] I have added or updated unit tests for my change.
- [x] All unit tests pass locally.
<img width="785" height="373" alt="image" src="https://github.com/user-attachments/assets/6d870e9f-1372-4808-91a9-38578c1b3729" />
**Manual End-to-End (E2E) Tests:**
Configure Gemini Agent to produce input & output transcriptions. Observe incoming transcript messages - to see if the finished flag appears at the end agents & users statement.
### Checklist
- [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have added tests that prove my fix is effective or that my feature works.
- [x] New and existing unit tests pass locally with my changes.
- [x] I have manually tested my changes end-to-end.
- [x] Any dependent changes have been merged and published in downstream modules.
### Additional context
The mentioned `finished` flag can be obtained in native Gemini APIs like via Websocket but not via ADK.
Co-authored-by: Hangfei Lin <[email protected]>
COPYBARA_INTEGRATE_REVIEW=#3324 from ChrisQlasty:fix/transcript_finish e7b8e5e
PiperOrigin-RevId: 8289879961 parent f167890 commit 8dd5a79
File tree
2 files changed
+42
-8
lines changed- src/google/adk/models
- tests/unittests/models
2 files changed
+42
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 168 | + | |
172 | 169 | | |
173 | 170 | | |
174 | 171 | | |
175 | 172 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 173 | + | |
180 | 174 | | |
181 | 175 | | |
182 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
115 | 155 | | |
116 | 156 | | |
117 | 157 | | |
| |||
0 commit comments