File tree Expand file tree Collapse file tree
main/java/com/google/adk/flows/llmflows
test/java/com/google/adk/flows/llmflows Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,16 +159,15 @@ public Single<ResponseProcessor.ResponseProcessingResult> processResponse(
159159 InvocationContext invocationContext , LlmResponse llmResponse ) {
160160 if (llmResponse .partial ().orElse (false )) {
161161 return Single .just (
162- ResponseProcessor .ResponseProcessingResult .create (
163- llmResponse , ImmutableList .of (), Optional .empty ()));
162+ ResponseProcessor .ResponseProcessingResult .create (llmResponse , ImmutableList .of ()));
164163 }
165164 var llmResponseBuilder = llmResponse .toBuilder ();
166165 return runPostProcessor (invocationContext , llmResponseBuilder )
167166 .toList ()
168167 .map (
169168 events ->
170169 ResponseProcessor .ResponseProcessingResult .create (
171- llmResponseBuilder .build (), events , Optional . empty () ));
170+ llmResponseBuilder .build (), events ));
172171 }
173172 }
174173
Original file line number Diff line number Diff line change @@ -50,11 +50,16 @@ public abstract static class ResponseProcessingResult {
5050 */
5151 public abstract Optional <String > transferToAgent ();
5252
53- /** Creates a new {@link ResponseProcessingResult}. */
5453 public static ResponseProcessingResult create (
55- LlmResponse updatedResponse , Iterable <Event > events , Optional < String > transferToAgent ) {
54+ LlmResponse updatedResponse , Iterable <Event > events , String transferToAgent ) {
5655 return new AutoValue_ResponseProcessor_ResponseProcessingResult (
57- updatedResponse , events , transferToAgent );
56+ updatedResponse , events , Optional .of (transferToAgent ));
57+ }
58+
59+ public static ResponseProcessingResult create (
60+ LlmResponse updatedResponse , Iterable <Event > events ) {
61+ return new AutoValue_ResponseProcessor_ResponseProcessingResult (
62+ updatedResponse , events , /* transferToAgent= */ Optional .empty ());
5863 }
5964 }
6065
Original file line number Diff line number Diff line change @@ -524,19 +524,14 @@ private static RequestProcessor createRequestProcessor(
524524
525525 private static ResponseProcessor createResponseProcessor () {
526526 return (context , response ) ->
527- Single .just (
528- ResponseProcessingResult .create (
529- response , ImmutableList .of (), /* transferToAgent= */ Optional .empty ()));
527+ Single .just (ResponseProcessingResult .create (response , ImmutableList .of ()));
530528 }
531529
532530 private static ResponseProcessor createResponseProcessor (
533531 Function <LlmResponse , LlmResponse > responseUpdater ) {
534532 return (context , response ) ->
535533 Single .just (
536- ResponseProcessingResult .create (
537- responseUpdater .apply (response ),
538- ImmutableList .of (),
539- /* transferToAgent= */ Optional .empty ()));
534+ ResponseProcessingResult .create (responseUpdater .apply (response ), ImmutableList .of ()));
540535 }
541536
542537 private static class TestTool extends BaseTool {
You can’t perform that action at this time.
0 commit comments