Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

/** Manages streaming tool related resources during invocation. */
public class ActiveStreamingTool {
@Nullable private Disposable task;
@Nullable private LiveRequestQueue stream;
private @Nullable Disposable task;
private @Nullable LiveRequestQueue stream;

public ActiveStreamingTool(Disposable task) {
this(task, null);
Expand All @@ -41,8 +41,7 @@ public ActiveStreamingTool(Disposable task, LiveRequestQueue stream) {
public ActiveStreamingTool() {}

/** Returns the active task of this streaming tool. */
@Nullable
public Disposable task() {
public @Nullable Disposable task() {
return task;
}

Expand All @@ -52,8 +51,7 @@ public void task(@Nullable Disposable task) {
}

/** Returns the active stream of this streaming tool. */
@Nullable
public LiveRequestQueue stream() {
public @Nullable LiveRequestQueue stream() {
return stream;
}

Expand Down
9 changes: 4 additions & 5 deletions core/src/main/java/com/google/adk/agents/LlmAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ protected LlmAgent(Builder builder) {
requireNonNullElse(builder.globalInstruction, new Instruction.Static(""));
this.generateContentConfig = Optional.ofNullable(builder.generateContentConfig);
this.includeContents = requireNonNullElse(builder.includeContents, IncludeContents.DEFAULT);
this.planning = builder.planning != null && builder.planning;
this.planning = requireNonNullElse(builder.planning, false);
this.maxSteps = Optional.ofNullable(builder.maxSteps);
this.disallowTransferToParent = builder.disallowTransferToParent;
this.disallowTransferToPeers = builder.disallowTransferToPeers;
this.disallowTransferToParent = requireNonNullElse(builder.disallowTransferToParent, false);
this.disallowTransferToPeers = requireNonNullElse(builder.disallowTransferToPeers, false);
this.beforeModelCallback = requireNonNullElse(builder.beforeModelCallback, ImmutableList.of());
this.afterModelCallback = requireNonNullElse(builder.afterModelCallback, ImmutableList.of());
this.onModelErrorCallback =
Expand Down Expand Up @@ -566,8 +566,7 @@ public Builder codeExecutor(BaseCodeExecutor codeExecutor) {
return this;
}

@Nullable
private static <B, A> ImmutableList<A> convertCallbacks(
private static <B, A> @Nullable ImmutableList<A> convertCallbacks(
@Nullable List<? extends B> callbacks, Function<B, A> converter, String callbackType) {
return Optional.ofNullable(callbacks)
.map(
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/com/google/adk/apps/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public class App {
private final String name;
private final BaseAgent rootAgent;
private final ImmutableList<? extends Plugin> plugins;
@Nullable private final EventsCompactionConfig eventsCompactionConfig;
@Nullable private final ContextCacheConfig contextCacheConfig;
private final @Nullable EventsCompactionConfig eventsCompactionConfig;
private final @Nullable ContextCacheConfig contextCacheConfig;

private App(
String name,
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/com/google/adk/events/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public static class Builder {
private String invocationId;
private String author;
private @Nullable Content content;
private EventActions actions;
private @Nullable EventActions actions;
private @Nullable Set<String> longRunningToolIds;
private @Nullable Boolean partial;
private @Nullable Boolean turnComplete;
Expand Down Expand Up @@ -399,7 +399,7 @@ public Builder content(@Nullable Content value) {

@CanIgnoreReturnValue
@JsonProperty("actions")
public Builder actions(EventActions value) {
public Builder actions(@Nullable EventActions value) {
this.actions = value;
return this;
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/com/google/adk/events/EventActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private Builder(EventActions eventActions) {

@CanIgnoreReturnValue
@JsonProperty("skipSummarization")
public Builder skipSummarization(boolean skipSummarization) {
public Builder skipSummarization(@Nullable Boolean skipSummarization) {
this.skipSummarization = skipSummarization;
return this;
}
Expand Down Expand Up @@ -324,7 +324,7 @@ public Builder transferToAgent(@Nullable String agentId) {

@CanIgnoreReturnValue
@JsonProperty("escalate")
public Builder escalate(boolean escalate) {
public Builder escalate(@Nullable Boolean escalate) {
this.escalate = escalate;
return this;
}
Expand Down
Loading