@@ -591,9 +591,9 @@ private void copySessionStates(Session source, Session target) {
591591 * @return invocation context configured for a live run.
592592 */
593593 private InvocationContext newInvocationContextForLive (
594- Session session , Optional < LiveRequestQueue > liveRequestQueue , RunConfig runConfig ) {
594+ Session session , @ Nullable LiveRequestQueue liveRequestQueue , RunConfig runConfig ) {
595595 RunConfig .Builder runConfigBuilder = RunConfig .builder (runConfig );
596- if (liveRequestQueue . isPresent () ) {
596+ if (liveRequestQueue != null ) {
597597 // Default to AUDIO modality if not specified.
598598 if (CollectionUtils .isNullOrEmpty (runConfig .responseModalities ())) {
599599 runConfigBuilder .setResponseModalities (
@@ -614,8 +614,9 @@ private InvocationContext newInvocationContextForLive(
614614 InvocationContext .Builder builder =
615615 newInvocationContextBuilder (session )
616616 .runConfig (runConfigBuilder .build ())
617- .userContent (Content .fromParts ());
618- liveRequestQueue .ifPresent (builder ::liveRequestQueue );
617+ .userContent (Content .fromParts ())
618+ .liveRequestQueue (liveRequestQueue );
619+
619620 return builder .build ();
620621 }
621622
@@ -643,7 +644,7 @@ public Flowable<Event> runLive(
643644 return Flowable .defer (
644645 () -> {
645646 InvocationContext invocationContext =
646- newInvocationContextForLive (session , Optional . of ( liveRequestQueue ) , runConfig );
647+ newInvocationContextForLive (session , liveRequestQueue , runConfig );
647648
648649 Single <InvocationContext > invocationContextSingle ;
649650 if (invocationContext .agent () instanceof LlmAgent agent ) {
0 commit comments