RetryingLLMClient
A decorator that adds retry capabilities to any LLMClient implementation.
This is a pure decorator - it has no knowledge of specific providers or implementations. It simply wraps any LLMClient and retries operations based on configurable policies.
Example usage:
val client = AnthropicLLMClient(apiKey)
val retryingClient = RetryingLLMClient(client, RetryConfig.CONSERVATIVE)Parameters
The LLMClient to wrap with retry logic
Configuration for retry behavior
Functions
Executes a prompt and returns a list of response messages.
Executes a prompt and returns a list of LLM choices.
Executes a prompt and returns a streaming flow of response chunks.
Basic JSON schema generator supported by the LLMClient. Return BasicJsonSchemaGenerator by default.
Standard JSON schema generator supported by the LLMClient. Return StandardJsonSchemaGenerator by default.
Retrieves the configured instance of the LLMProvider in use.
Analyzes the provided prompt for violations of content policies or other moderation criteria.
Converts an instance of LLMClient into a retrying client with customizable retry behavior.