LemonAi.Providers.Bedrock (lemon_ai v0.1.0)

View Source

Amazon Bedrock Converse Stream API provider.

Implements the LemonAi.Provider behaviour for streaming responses from Amazon Bedrock using the Converse Stream API.

Configuration

AWS credentials and region should be resolved by the caller before requests reach this provider. Stream options still take precedence for per-request overrides.

Usage

model = %Model{id: "anthropic.claude-3-5-sonnet-20240620-v1:0", api: :bedrock_converse_stream, ...}
context = Context.new(system_prompt: "You are helpful", messages: [...])
{:ok, stream} = LemonAi.Providers.Bedrock.stream(model, context, %StreamOptions{})

stream
|> EventStream.events()
|> Enum.each(&IO.inspect/1)