Optionalfields: BedrockChatFieldsAWS Credentials.
If no credentials are provided, the default credentials from @aws-sdk/credential-provider-node will be used.
OptionalendpointOverride the default endpoint hostname.
A custom fetch function for low-level access to AWS API. Defaults to fetch().
Optionalinit: RequestInitOptionalinit: RequestInitOptionalguardrailRequired when Guardrail is in use.
Identifier for the guardrail configuration.
Version for the guardrail configuration.
OptionalmaxMax tokens.
Model to use. For example, "amazon.titan-tg1-large", this is equivalent to the modelId property in the list-foundation-models api.
OptionalmodelAdditional kwargs to pass to the model.
The AWS region e.g. us-west-2.
Fallback to AWS_DEFAULT_REGION env variable or region specified in ~/.aws/config in case it is not provided here.
Whether or not to stream responses
OptionaltemperatureTemperature.
OptionaltraceTrace settings for the Bedrock Guardrails.
Optionaloptions: unknownStaticlc_
AWS Bedrock chat model integration.
Setup: Install
@langchain/communityand set the following environment variables:Constructor args
Runtime args
Runtime args can be passed as the second argument to any of the base runnable methods
.invoke..stream,.batch, etc. They can also be passed via.withConfig, or the second arg in.bindTools, like shown in the examples below:Examples
Instantiate
Invoking
Streaming Chunks
Aggregate Streamed Chunks
Bind tools
Structured Output
Response Metadata