Class BaseLlm
java.lang.Object
com.google.adk.models.BaseLlm
Abstract base class for Large Language Models (LLMs).
Provides a common interface for interacting with different LLMs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract BaseLlmConnection
connect
(LlmRequest llmRequest) Creates a live connection to the LLM.abstract io.reactivex.rxjava3.core.Flowable
<LlmResponse> generateContent
(LlmRequest llmRequest, boolean stream) Generates one content from the given LLM request and tools.model()
Returns the name of the LLM model.
-
Constructor Details
-
BaseLlm
-
-
Method Details
-
model
-
generateContent
public abstract io.reactivex.rxjava3.core.Flowable<LlmResponse> generateContent(LlmRequest llmRequest, boolean stream) Generates one content from the given LLM request and tools.- Parameters:
llmRequest
- The LLM request containing the input prompt and parameters.stream
- A boolean flag indicating whether to stream the response.- Returns:
- A Flowable of LlmResponses. For non-streaming calls, it will only yield one LlmResponse. For streaming calls, it may yield more than one LlmResponse, but all yielded LlmResponses should be treated as one content by merging their parts.
-
connect
Creates a live connection to the LLM.
-