Skip to content
Merged
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
11 changes: 0 additions & 11 deletions core/src/main/java/com/google/adk/flows/llmflows/BaseLlmFlow.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,9 @@ protected Single<ResponseProcessingResult> postprocess(
updatedResponse, Iterables.concat(eventIterables), Optional.empty()));
}

logger.debug("Response after processors: {}", updatedResponse);
Event modelResponseEvent =
buildModelResponseEvent(baseEventForLlmResponse, llmRequest, updatedResponse);
eventIterables.add(Collections.singleton(modelResponseEvent));
logger.debug("Model response event: {}", modelResponseEvent.toJson());

Maybe<Event> maybeFunctionCallEvent =
modelResponseEvent.functionCalls().isEmpty()
Expand All @@ -183,7 +181,6 @@ protected Single<ResponseProcessingResult> postprocess(
Optional<String> transferToAgent = Optional.empty();
if (functionCallEventOpt.isPresent()) {
Event functionCallEvent = functionCallEventOpt.get();
logger.debug("Function call event generated: {}", functionCallEvent);
eventIterables.add(Collections.singleton(functionCallEvent));
transferToAgent = functionCallEvent.actions().transferToAgent();
}
Expand Down Expand Up @@ -332,7 +329,6 @@ private Flowable<Event> runOneStep(InvocationContext context) {
LlmRequest llmRequestAfterPreprocess = preResult.updatedRequest();
Iterable<Event> preEvents = preResult.events();

logger.debug("Pre-processing result: {}", preResult);
if (context.endInvocation()) {
logger.debug("End invocation requested during preprocessing.");
return Flowable.fromIterable(preEvents);
Expand All @@ -353,16 +349,10 @@ private Flowable<Event> runOneStep(InvocationContext context) {
.branch(context.branch())
.build();

logger.debug("Starting LLM call with request: {}", llmRequestAfterPreprocess);
Flowable<Event> restOfFlow =
callLlm(context, llmRequestAfterPreprocess, mutableEventTemplate)
.concatMap(
llmResponse -> {
logger.debug(
"Processing LlmResponse with Event ID: {}",
mutableEventTemplate.id());
logger.debug("LLM response for current step: {}", llmResponse);

Single<ResponseProcessingResult> postResultSingle =
postprocess(
context,
Expand All @@ -385,7 +375,6 @@ private Flowable<Event> runOneStep(InvocationContext context) {
})
.concatMap(
postResult -> {
logger.debug("Post-processing result: {}", postResult);
Flowable<Event> postProcessedEvents =
Flowable.fromIterable(postResult.events());
if (postResult.transferToAgent().isPresent()) {
Expand Down