@@ -82,21 +82,6 @@ public class RequestConfirmationLlmRequestProcessorTest {
8282 .build ()))
8383 .build ();
8484
85- private static final Event USER_DECLINE_EVENT =
86- Event .builder ()
87- .author ("user" )
88- .content (
89- Content .fromParts (
90- Part .builder ()
91- .functionResponse (
92- FunctionResponse .builder ()
93- .id (FUNCTION_CALL_ID )
94- .name (REQUEST_CONFIRMATION_FUNCTION_CALL_NAME )
95- .response (ImmutableMap .of ("confirmed" , false ))
96- .build ())
97- .build ()))
98- .build ();
99-
10085 private static final RequestConfirmationLlmRequestProcessor processor =
10186 new RequestConfirmationLlmRequestProcessor ();
10287
@@ -123,30 +108,6 @@ public void runAsync_withConfirmation_callsOriginalFunction() {
123108 assertThat (fr .response ()).hasValue (ImmutableMap .of ("result" , ORIGINAL_FUNCTION_CALL_ARGS ));
124109 }
125110
126- @ Test
127- public void runAsync_withDecline_returnsErrorFunctionResponse () {
128- LlmAgent agent = createAgentWithEchoTool ();
129- Session session =
130- Session .builder ("session_id" )
131- .events (ImmutableList .of (REQUEST_CONFIRMATION_EVENT , USER_DECLINE_EVENT ))
132- .build ();
133-
134- InvocationContext context = createInvocationContext (agent , session );
135-
136- RequestProcessor .RequestProcessingResult result =
137- processor .processRequest (context , LlmRequest .builder ().build ()).blockingGet ();
138-
139- assertThat (result ).isNotNull ();
140- assertThat (result .events ()).hasSize (1 );
141- Event event = result .events ().iterator ().next ();
142- assertThat (event .functionResponses ()).hasSize (1 );
143- FunctionResponse fr = event .functionResponses ().get (0 );
144- assertThat (fr .id ()).hasValue (ORIGINAL_FUNCTION_CALL_ID );
145- assertThat (fr .name ()).hasValue (ECHO_TOOL_NAME );
146- assertThat (fr .response ())
147- .hasValue (ImmutableMap .of ("error" , "User declined tool execution for echo_tool" ));
148- }
149-
150111 @ Test
151112 public void runAsync_withConfirmationAndToolAlreadyCalled_doesNotCallOriginalFunction () {
152113 LlmAgent agent = createAgentWithEchoTool ();
0 commit comments