Class Claude
java.lang.Object
com.google.adk.models.BaseLlm
com.google.adk.models.Claude
Represents the Claude Generative AI model by Anthropic.
This class provides methods for interacting with Claude models. Streaming and live connections are not currently supported for Claude.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect
(LlmRequest llmRequest) Creates a live connection to the LLM.io.reactivex.rxjava3.core.Flowable
<LlmResponse> generateContent
(LlmRequest llmRequest, boolean stream) Generates one content from the given LLM request and tools.
-
Constructor Details
-
Claude
Constructs a new Claude instance.- Parameters:
modelName
- The name of the Claude model to use (e.g., "claude-3-opus-20240229").anthropicClient
- The Anthropic API client instance.
-
-
Method Details
-
generateContent
public io.reactivex.rxjava3.core.Flowable<LlmResponse> generateContent(LlmRequest llmRequest, boolean stream) Description copied from class:BaseLlm
Generates one content from the given LLM request and tools.- Specified by:
generateContent
in classBaseLlm
- 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
Description copied from class:BaseLlm
Creates a live connection to the LLM.
-