Skip to content
Open
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
31 changes: 1 addition & 30 deletions core/src/main/java/com/google/adk/agents/LlmAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
import com.google.adk.agents.ConfigAgentUtils.ConfigurationException;
import com.google.adk.codeexecutors.BaseCodeExecutor;
import com.google.adk.events.Event;
import com.google.adk.examples.BaseExampleProvider;
import com.google.adk.examples.Example;
import com.google.adk.flows.llmflows.AutoFlow;
import com.google.adk.flows.llmflows.BaseLlmFlow;
import com.google.adk.flows.llmflows.SingleFlow;
Expand Down Expand Up @@ -97,8 +95,6 @@ public enum IncludeContents {
private final List<Object> toolsUnion;
private final ImmutableList<BaseToolset> toolsets;
private final Optional<GenerateContentConfig> generateContentConfig;
// TODO: Remove exampleProvider field - examples should only be provided via ExampleTool
private final Optional<BaseExampleProvider> exampleProvider;
private final IncludeContents includeContents;

private final boolean planning;
Expand Down Expand Up @@ -132,7 +128,6 @@ protected LlmAgent(Builder builder) {
this.globalInstruction =
requireNonNullElse(builder.globalInstruction, new Instruction.Static(""));
this.generateContentConfig = Optional.ofNullable(builder.generateContentConfig);
this.exampleProvider = Optional.ofNullable(builder.exampleProvider);
this.includeContents = requireNonNullElse(builder.includeContents, IncludeContents.DEFAULT);
this.planning = builder.planning != null && builder.planning;
this.maxSteps = Optional.ofNullable(builder.maxSteps);
Expand Down Expand Up @@ -180,7 +175,6 @@ public static class Builder extends BaseAgent.Builder<Builder> {
private Instruction globalInstruction;
private ImmutableList<Object> toolsUnion;
private GenerateContentConfig generateContentConfig;
private BaseExampleProvider exampleProvider;
private IncludeContents includeContents;
private Boolean planning;
private Integer maxSteps;
Expand Down Expand Up @@ -253,26 +247,6 @@ public Builder generateContentConfig(GenerateContentConfig generateContentConfig
return this;
}

// TODO: Remove these example provider methods and only use ExampleTool for providing examples.
// Direct example methods should be deprecated in favor of using ExampleTool consistently.
@CanIgnoreReturnValue
public Builder exampleProvider(BaseExampleProvider exampleProvider) {
this.exampleProvider = exampleProvider;
return this;
}

@CanIgnoreReturnValue
public Builder exampleProvider(List<Example> examples) {
this.exampleProvider = (unused) -> examples;
return this;
}

@CanIgnoreReturnValue
public Builder exampleProvider(Example... examples) {
this.exampleProvider = (unused) -> ImmutableList.copyOf(examples);
return this;
}

@CanIgnoreReturnValue
public Builder includeContents(IncludeContents includeContents) {
this.includeContents = includeContents;
Expand Down Expand Up @@ -820,10 +794,7 @@ public Optional<GenerateContentConfig> generateContentConfig() {
return generateContentConfig;
}

// TODO: Remove this getter - examples should only be provided via ExampleTool
public Optional<BaseExampleProvider> exampleProvider() {
return exampleProvider;
}


public IncludeContents includeContents() {
return includeContents;
Expand Down
57 changes: 0 additions & 57 deletions core/src/main/java/com/google/adk/flows/llmflows/Examples.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class SingleFlow extends BaseLlmFlow {
new Identity(),
new Compaction(),
new Contents(),
new Examples(),
CodeExecution.requestProcessor);

protected static final ImmutableList<ResponseProcessor> RESPONSE_PROCESSORS =
Expand Down
99 changes: 0 additions & 99 deletions core/src/test/java/com/google/adk/flows/llmflows/ExamplesTest.java

This file was deleted.

Loading