Skip to content

Commit 668ad27

Browse files
Mateusz Krawieccopybara-github
authored andcommitted
chore!: remove deprecated Example processor
PiperOrigin-RevId: 880745271
1 parent 4864287 commit 668ad27

4 files changed

Lines changed: 0 additions & 188 deletions

File tree

core/src/main/java/com/google/adk/agents/LlmAgent.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
import com.google.adk.agents.ConfigAgentUtils.ConfigurationException;
4646
import com.google.adk.codeexecutors.BaseCodeExecutor;
4747
import com.google.adk.events.Event;
48-
import com.google.adk.examples.BaseExampleProvider;
49-
import com.google.adk.examples.Example;
5048
import com.google.adk.flows.llmflows.AutoFlow;
5149
import com.google.adk.flows.llmflows.BaseLlmFlow;
5250
import com.google.adk.flows.llmflows.SingleFlow;
@@ -97,8 +95,6 @@ public enum IncludeContents {
9795
private final List<Object> toolsUnion;
9896
private final ImmutableList<BaseToolset> toolsets;
9997
private final Optional<GenerateContentConfig> generateContentConfig;
100-
// TODO: Remove exampleProvider field - examples should only be provided via ExampleTool
101-
private final Optional<BaseExampleProvider> exampleProvider;
10298
private final IncludeContents includeContents;
10399

104100
private final boolean planning;
@@ -132,7 +128,6 @@ protected LlmAgent(Builder builder) {
132128
this.globalInstruction =
133129
requireNonNullElse(builder.globalInstruction, new Instruction.Static(""));
134130
this.generateContentConfig = Optional.ofNullable(builder.generateContentConfig);
135-
this.exampleProvider = Optional.ofNullable(builder.exampleProvider);
136131
this.includeContents = requireNonNullElse(builder.includeContents, IncludeContents.DEFAULT);
137132
this.planning = builder.planning != null && builder.planning;
138133
this.maxSteps = Optional.ofNullable(builder.maxSteps);
@@ -180,7 +175,6 @@ public static class Builder extends BaseAgent.Builder<Builder> {
180175
private Instruction globalInstruction;
181176
private ImmutableList<Object> toolsUnion;
182177
private GenerateContentConfig generateContentConfig;
183-
private BaseExampleProvider exampleProvider;
184178
private IncludeContents includeContents;
185179
private Boolean planning;
186180
private Integer maxSteps;
@@ -253,26 +247,6 @@ public Builder generateContentConfig(GenerateContentConfig generateContentConfig
253247
return this;
254248
}
255249

256-
// TODO: Remove these example provider methods and only use ExampleTool for providing examples.
257-
// Direct example methods should be deprecated in favor of using ExampleTool consistently.
258-
@CanIgnoreReturnValue
259-
public Builder exampleProvider(BaseExampleProvider exampleProvider) {
260-
this.exampleProvider = exampleProvider;
261-
return this;
262-
}
263-
264-
@CanIgnoreReturnValue
265-
public Builder exampleProvider(List<Example> examples) {
266-
this.exampleProvider = (unused) -> examples;
267-
return this;
268-
}
269-
270-
@CanIgnoreReturnValue
271-
public Builder exampleProvider(Example... examples) {
272-
this.exampleProvider = (unused) -> ImmutableList.copyOf(examples);
273-
return this;
274-
}
275-
276250
@CanIgnoreReturnValue
277251
public Builder includeContents(IncludeContents includeContents) {
278252
this.includeContents = includeContents;
@@ -812,11 +786,6 @@ public Optional<GenerateContentConfig> generateContentConfig() {
812786
return generateContentConfig;
813787
}
814788

815-
// TODO: Remove this getter - examples should only be provided via ExampleTool
816-
public Optional<BaseExampleProvider> exampleProvider() {
817-
return exampleProvider;
818-
}
819-
820789
public IncludeContents includeContents() {
821790
return includeContents;
822791
}

core/src/main/java/com/google/adk/flows/llmflows/Examples.java

Lines changed: 0 additions & 57 deletions
This file was deleted.

core/src/main/java/com/google/adk/flows/llmflows/SingleFlow.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public class SingleFlow extends BaseLlmFlow {
3232
new Identity(),
3333
new Compaction(),
3434
new Contents(),
35-
new Examples(),
3635
CodeExecution.requestProcessor);
3736

3837
protected static final ImmutableList<ResponseProcessor> RESPONSE_PROCESSORS =

core/src/test/java/com/google/adk/flows/llmflows/ExamplesTest.java

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)