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
9 changes: 5 additions & 4 deletions core/src/main/java/com/google/adk/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@

public final class Version {
private static final Logger logger = LoggerFactory.getLogger(Version.class);

public static final String JAVA_ADK_VERSION;

static {
String version = "unknown";
try (InputStream input = Version.class.getClassLoader().getResourceAsStream("version.properties")) {
try (InputStream input =
Version.class.getClassLoader().getResourceAsStream("version.properties")) {
if (input != null) {
Properties properties = new Properties();
properties.load(input);
Expand All @@ -44,4 +45,4 @@ public final class Version {
}

private Version() {}
}
}
4 changes: 2 additions & 2 deletions core/src/main/java/com/google/adk/agents/CallbackUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package com.google.adk.agents;

import com.google.adk.agents.Callbacks.AfterAgentCallback;
import com.google.adk.agents.Callbacks.AfterAgentCallbackBase;
import com.google.adk.agents.Callbacks.AfterAgentCallbackSync;
import com.google.adk.agents.Callbacks.BeforeAgentCallback;
import com.google.adk.agents.Callbacks.BeforeAgentCallbackSync;
import com.google.adk.agents.Callbacks.BeforeAgentCallbackBase;
import com.google.adk.agents.Callbacks.AfterAgentCallbackBase;
import com.google.adk.agents.Callbacks.BeforeAgentCallbackSync;
import com.google.common.collect.ImmutableList;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import io.reactivex.rxjava3.core.Maybe;
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/com/google/adk/sessions/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.adk.sessions;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ public Single<Session> createSession(
JsonNode getSessionResponseMap = getJsonResponse(getSessionApiResponse);
Instant updateTimestamp = Instant.parse(getSessionResponseMap.get("updateTime").asText());
ConcurrentMap<String, Object> sessionState = null;
if (getSessionResponseMap != null && getSessionResponseMap.has("sessionState")) {
JsonNode sessionStateNode = getSessionResponseMap.get("sessionState");
if (sessionStateNode != null) {
if (getSessionResponseMap != null && getSessionResponseMap.has("sessionState")) {
JsonNode sessionStateNode = getSessionResponseMap.get("sessionState");
if (sessionStateNode != null) {
sessionState =
objectMapper.convertValue(
sessionStateNode, new TypeReference<ConcurrentMap<String, Object>>() {});
}
}
}
return Single.just(
Session.builder(sessId)
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/com/google/adk/VersionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ public void versionShouldMatchProjectVersion() {

assertThat(Version.JAVA_ADK_VERSION).matches("\\d+\\.\\d+\\.\\d+(-SNAPSHOT)?");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,7 @@ public void processRequest_agentInstructionProvider_appendsInstruction() {
public void
processRequest_agentInstructionString_withInvalidPlaceholderSyntax_appendsInstructionWithLiteral() {
LlmAgent agent =
LlmAgent.builder()
.name("agent")
.instruction("Value: { invalid name } and {var.}")
.build();
LlmAgent.builder().name("agent").instruction("Value: { invalid name } and {var.}").build();
InvocationContext context = createContext(agent, createSession());

RequestProcessor.RequestProcessingResult result =
Expand Down