Class BaseLlmFlow
java.lang.Object
com.google.adk.flows.llmflows.BaseLlmFlow
- All Implemented Interfaces:
BaseFlow
- Direct Known Subclasses:
SingleFlow
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBaseLlmFlow
(List<com.google.adk.flows.llmflows.RequestProcessor> requestProcessors, List<com.google.adk.flows.llmflows.ResponseProcessor> responseProcessors) -
Method Summary
Modifier and TypeMethodDescriptionprotected io.reactivex.rxjava3.core.Single
<com.google.adk.flows.llmflows.ResponseProcessor.ResponseProcessingResult> postprocess
(InvocationContext context, Event baseEventForLlmResponse, LlmRequest llmRequest, LlmResponse llmResponse) Post-processes the LLM response after receiving it from the LLM.protected com.google.adk.flows.llmflows.RequestProcessor.RequestProcessingResult
preprocess
(InvocationContext context, LlmRequest llmRequest) Pre-processes the LLM request before sending it to the LLM.io.reactivex.rxjava3.core.Flowable
<Event> run
(InvocationContext invocationContext) Run this flow.io.reactivex.rxjava3.core.Flowable
<Event> runLive
(InvocationContext invocationContext)
-
Field Details
-
requestProcessors
-
responseProcessors
-
-
Constructor Details
-
BaseLlmFlow
-
-
Method Details
-
preprocess
protected com.google.adk.flows.llmflows.RequestProcessor.RequestProcessingResult preprocess(InvocationContext context, LlmRequest llmRequest) Pre-processes the LLM request before sending it to the LLM. Executes all registeredRequestProcessor
. -
postprocess
protected io.reactivex.rxjava3.core.Single<com.google.adk.flows.llmflows.ResponseProcessor.ResponseProcessingResult> postprocess(InvocationContext context, Event baseEventForLlmResponse, LlmRequest llmRequest, LlmResponse llmResponse) Post-processes the LLM response after receiving it from the LLM. Executes all registeredResponseProcessor
instances. Handles function calls if present in the response. -
run
Description copied from interface:BaseFlow
Run this flow.To implement this method, the flow should follow the below requirements:
- 1. `session` should be treated as immutable, DO NOT change it.
- 2. The caller who trigger the flow is responsible for updating the session as the events being generated. The subclass implementation will assume session is updated after each yield event statement.
- 3. A flow may spawn sub-agent flows depending on the agent definition.
-
runLive
-