Skip to content

Commit c195b0b

Browse files
committed
feat: allow runAsync with null newMessage
1 parent 9e3723b commit c195b0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/src/main/java/com/google/adk/runner/Runner.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ public Flowable<Event> runAsync(String userId, String sessionId, Content newMess
203203
* @param runConfig Configuration for the agent run.
204204
* @return A Flowable stream of {@link Event} objects generated by the agent during execution.
205205
*/
206-
public Flowable<Event> runAsync(Session session, Content newMessage, RunConfig runConfig) {
206+
public Flowable<Event> runAsync(
207+
Session session, @Nullable Content newMessage, RunConfig runConfig) {
207208
Span span = Telemetry.getTracer().spanBuilder("invocation").startSpan();
208209
try (Scope scope = span.makeCurrent()) {
209210
return Flowable.just(session)
@@ -213,7 +214,7 @@ public Flowable<Event> runAsync(Session session, Content newMessage, RunConfig r
213214
InvocationContext invocationContext =
214215
newInvocationContext(
215216
sess,
216-
Optional.of(newMessage),
217+
Optional.ofNullable(newMessage),
217218
/* liveRequestQueue= */ Optional.empty(),
218219
runConfig);
219220

0 commit comments

Comments
 (0)