BedrockLLMClient
class BedrockLLMClient(bedrockClient: BedrockRuntimeClient, moderationGuardrailsSettings: BedrockGuardrailsSettings? = null, fallbackModelFamily: BedrockModelFamilies? = null, clock: Clock = Clock.System) : LLMClient, LLMEmbeddingProvider(source)
Creates a new Bedrock LLM client configured with the specified AWS credentials and settings.
Return
A configured LLMClient instance for Bedrock
Parameters
bedrockClient
The runtime client for interacting with Bedrock, highly configurable
moderationGuardrailsSettings
Optional settings of the AWS bedrock Guardrails (see AWS documentation ) that would be used for the LLMClient.moderate request
fallbackModelFamily
Optional fallback model family to use for unsupported models
clock
A clock used for time-based operations
Constructors
Link copied to clipboard
constructor(bedrockClient: BedrockRuntimeClient, moderationGuardrailsSettings: BedrockGuardrailsSettings? = null, fallbackModelFamily: BedrockModelFamilies? = null, clock: Clock = Clock.System)
constructor(identityProvider: IdentityProvider, settings: BedrockClientSettings = BedrockClientSettings(), clock: Clock = Clock.System)
Creates a new Bedrock LLM client configured with the specified identity provider and settings.
Functions
Link copied to clipboard
open suspend override fun execute(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): List<Message.Response>
Link copied to clipboard
open suspend fun executeMultipleChoices(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): List<LLMChoice>
Link copied to clipboard
open override fun executeStreaming(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): Flow<StreamFrame>
Link copied to clipboard
Provides the current language learning model provider utilized by this client.
Link copied to clipboard
Moderates the provided prompt using AWS Bedrock Guardrails.