# Class BaseLlm

java.lang.Object
com.google.adk.models.BaseLlm

Direct Known Subclasses:
  `ApigeeLlm, Claude, Gemini, LangChain4j, SpringAI`

public abstract class BaseLlm extends Object
Abstract base class for Large Language Models (LLMs).

Provides a common interface for interacting with different LLMs.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BaseLlm(String model)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract 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.
  `String`
  `model()`
  Returns the name of the LLM model.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BaseLlm

    public BaseLlm(String model)

- ## Method Details

  - ### model

    public String model()
    Returns the name of the LLM model.
    Returns:
      The name of the LLM 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

    public abstract BaseLlmConnection connect(LlmRequest llmRequest)
    Creates a live connection to the LLM.