File tree Expand file tree Collapse file tree
main/java/com/google/adk/flows/llmflows Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747import io .reactivex .rxjava3 .core .Single ;
4848import io .reactivex .rxjava3 .disposables .Disposable ;
4949import io .reactivex .rxjava3 .functions .Function ;
50+ import io .reactivex .rxjava3 .schedulers .Schedulers ;
5051import java .util .ArrayList ;
5152import java .util .HashMap ;
5253import java .util .HashSet ;
@@ -160,7 +161,9 @@ public static Maybe<Event> handleFunctionCalls(
160161 } else {
161162 functionResponseEventsObservable =
162163 Observable .fromIterable (validFunctionCalls )
163- .concatMapEager (call -> functionCallMapper .apply (call ).toObservable ());
164+ .concatMapEager (
165+ call ->
166+ functionCallMapper .apply (call ).toObservable ().subscribeOn (Schedulers .io ()));
164167 }
165168 return functionResponseEventsObservable
166169 .toList ()
@@ -231,7 +234,9 @@ public static Maybe<Event> handleFunctionCallsLive(
231234 } else {
232235 responseEventsObservable =
233236 Observable .fromIterable (validFunctionCalls )
234- .concatMapEager (call -> functionCallMapper .apply (call ).toObservable ());
237+ .concatMapEager (
238+ call ->
239+ functionCallMapper .apply (call ).toObservable ().subscribeOn (Schedulers .io ()));
235240 }
236241
237242 return responseEventsObservable
You can’t perform that action at this time.
0 commit comments