Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions core/src/main/java/com/google/adk/runner/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ protected Flowable<Event> runAsyncImpl(
Content newMessage,
RunConfig runConfig,
@Nullable Map<String, Object> stateDelta) {
Preconditions.checkNotNull(session, "session cannot be null");
Preconditions.checkNotNull(newMessage, "newMessage cannot be null");
Preconditions.checkNotNull(runConfig, "runConfig cannot be null");
return Flowable.defer(
() -> {
BaseAgent rootAgent = this.agent;
Expand All @@ -476,19 +479,14 @@ protected Flowable<Event> runAsyncImpl(
.defaultIfEmpty(newMessage)
.flatMap(
content ->
(content != null)
? appendNewMessageToSession(
session,
content,
initialContext,
runConfig.saveInputBlobsAsArtifacts(),
stateDelta)
: Single.just(null))
appendNewMessageToSession(
session,
content,
initialContext,
runConfig.saveInputBlobsAsArtifacts(),
stateDelta))
.flatMapPublisher(
event -> {
if (event == null) {
return Flowable.empty();
}
// Get the updated session after the message and state delta are
// applied
return this.sessionService
Expand Down
Loading