Repository navigation
Commit 8cecdad
authored
dialogflow: fix detect-intent-stream losing the query result (#2336)
The response stream doesn't always end with the query result. With output
audio enabled the server sends the result first and then keeps streaming
audio chunks, so looking at the last response alone died with "Call to a
member function getQueryText() on null" and threw away the whole answer
the caller asked for.
Collect the result as the responses come in instead, and stop reading
$response after the loop since it's undefined when the stream is empty.1 parent 7476d33 commit 8cecdad
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
| 92 | + | |
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
90 | | - | |
| 96 | + | |
91 | 97 | | |
92 | | - | |
93 | 98 | | |
94 | 99 | | |
95 | 100 | | |
| |||
0 commit comments