4848import com .google .adk .models .Model ;
4949import com .google .adk .tools .BaseTool ;
5050import com .google .adk .tools .BaseToolset ;
51- import com .google .adk .tools .ToolMarker ;
5251import com .google .common .base .Preconditions ;
5352import com .google .common .collect .ImmutableList ;
5453import com .google .errorprone .annotations .CanIgnoreReturnValue ;
@@ -85,7 +84,7 @@ public enum IncludeContents {
8584 private final Optional <Model > model ;
8685 private final Instruction instruction ;
8786 private final Instruction globalInstruction ;
88- private final List <ToolMarker > toolsUnion ;
87+ private final List <Object > toolsUnion ;
8988 private final ImmutableList <BaseToolset > toolsets ;
9089 private final Optional <GenerateContentConfig > generateContentConfig ;
9190 // TODO: Remove exampleProvider field - examples should only be provided via ExampleTool
@@ -153,7 +152,7 @@ public static Builder builder() {
153152 }
154153
155154 /** Extracts BaseToolset instances from the toolsUnion list. */
156- private static ImmutableList <BaseToolset > extractToolsets (List <ToolMarker > toolsUnion ) {
155+ private static ImmutableList <BaseToolset > extractToolsets (List <Object > toolsUnion ) {
157156 return toolsUnion .stream ()
158157 .filter (obj -> obj instanceof BaseToolset )
159158 .map (obj -> (BaseToolset ) obj )
@@ -166,7 +165,7 @@ public static class Builder extends BaseAgent.Builder<Builder> {
166165
167166 private Instruction instruction ;
168167 private Instruction globalInstruction ;
169- private ImmutableList <ToolMarker > toolsUnion ;
168+ private ImmutableList <Object > toolsUnion ;
170169 private GenerateContentConfig generateContentConfig ;
171170 private BaseExampleProvider exampleProvider ;
172171 private IncludeContents includeContents ;
@@ -222,13 +221,13 @@ public Builder globalInstruction(String globalInstruction) {
222221 }
223222
224223 @ CanIgnoreReturnValue
225- public Builder tools (List <? extends ToolMarker > tools ) {
224+ public Builder tools (List <?> tools ) {
226225 this .toolsUnion = ImmutableList .copyOf (tools );
227226 return this ;
228227 }
229228
230229 @ CanIgnoreReturnValue
231- public Builder tools (ToolMarker ... tools ) {
230+ public Builder tools (Object ... tools ) {
232231 this .toolsUnion = ImmutableList .copyOf (tools );
233232 return this ;
234233 }
@@ -680,7 +679,7 @@ public Single<Map.Entry<String, Boolean>> canonicalGlobalInstruction(ReadonlyCon
680679 */
681680 public Flowable <BaseTool > canonicalTools (Optional <ReadonlyContext > context ) {
682681 List <Flowable <BaseTool >> toolFlowables = new ArrayList <>();
683- for (ToolMarker toolOrToolset : toolsUnion ) {
682+ for (Object toolOrToolset : toolsUnion ) {
684683 if (toolOrToolset instanceof BaseTool baseTool ) {
685684 toolFlowables .add (Flowable .just (baseTool ));
686685 } else if (toolOrToolset instanceof BaseToolset baseToolset ) {
@@ -741,7 +740,7 @@ public Single<List<BaseTool>> tools() {
741740 return canonicalTools ().toList ();
742741 }
743742
744- public List <ToolMarker > toolsUnion () {
743+ public List <Object > toolsUnion () {
745744 return toolsUnion ;
746745 }
747746
0 commit comments