Skip to content

Commit 29d3203

Browse files
google-genai-botcopybara-github
authored andcommitted
fix:SkillMdPath should be public
PiperOrigin-RevId: 924746114
1 parent f8555a0 commit 29d3203

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

core/src/main/java/com/google/adk/skills/AbstractSkillSource.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public abstract class AbstractSkillSource<PathT> implements SkillSource {
4444
private static final ObjectMapper yamlMapper = new ObjectMapper(new YAMLFactory());
4545

4646
/** A container class that holds a skill's name and the path to its SKILL.md file. */
47-
protected final class SkillMdPath {
47+
public static final class SkillMdPath<PathT> {
4848

4949
private final String name;
5050
private final PathT mdPath;
@@ -55,8 +55,7 @@ protected final class SkillMdPath {
5555
* @param name the name of the skill
5656
* @param mdPath the path to the SKILL.md file
5757
*/
58-
@SuppressWarnings("ProtectedMembersInFinalClass")
59-
protected SkillMdPath(String name, PathT mdPath) {
58+
public SkillMdPath(String name, PathT mdPath) {
6059
this.name = name;
6160
this.mdPath = mdPath;
6261
}
@@ -127,7 +126,7 @@ public InputStream openStream() throws IOException {
127126
/**
128127
* Returns a {@link Flowable} of skills as a pair of skill name and the path to the SKILL.md file.
129128
*/
130-
protected abstract Flowable<SkillMdPath> listSkills();
129+
protected abstract Flowable<SkillMdPath<PathT>> listSkills();
131130

132131
/** Returns the path to the SKILL.md file for the given skill. */
133132
protected abstract Single<PathT> findSkillMdPath(String skillName);

core/src/main/java/com/google/adk/skills/LocalSkillSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public Single<ImmutableList<String>> listResources(String skillName, String reso
8080

8181
@Override
8282
@SuppressWarnings("StreamResourceLeak")
83-
protected Flowable<SkillMdPath> listSkills() {
83+
protected Flowable<SkillMdPath<Path>> listSkills() {
8484
return Flowable.using(() -> Files.list(skillsBasePath), Flowable::fromStream, Stream::close)
8585
.onErrorResumeNext(
8686
t ->
@@ -91,7 +91,7 @@ protected Flowable<SkillMdPath> listSkills() {
9191
t)))
9292
.filter(Files::isDirectory)
9393
.mapOptional(this::findSkillMd)
94-
.map(skillMd -> new SkillMdPath(skillMd.getParent().getFileName().toString(), skillMd));
94+
.map(skillMd -> new SkillMdPath<>(skillMd.getParent().getFileName().toString(), skillMd));
9595
}
9696

9797
@Override

core/src/test/java/com/google/adk/tools/streaming/StreamingToolTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,10 @@ public void runLive_streamingTool_responsesAreSentAsUserContentToLlm() throws Ex
492492
List<Event> resEvents =
493493
runner.runLive(session, liveRequestQueue, BIDI_STREAMING_RUN_CONFIG).toList().blockingGet();
494494

495+
// Wait for the tool to send its 3 results back to the LLM
496+
assertThat(testLlm.waitForStreamingToolResults("monitorStockPrice", 3, Duration.ofSeconds(20)))
497+
.isTrue();
498+
495499
assertThat(resEvents).isNotNull();
496500
assertThat(resEvents).isNotEmpty();
497501

0 commit comments

Comments
 (0)