Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libs/langchain-community/src/chat_models/bedrock/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ export class BedrockChat
this.guardrailIdentifier =
fields?.guardrailIdentifier ?? this.guardrailIdentifier;
this.guardrailConfig = fields?.guardrailConfig;
// Permit Application Inference Profile override in fetch URL (expects to be url-encoded)
if (fields?.applicationInferenceProfile) {
this.model = fields?.applicationInferenceProfile;
}
}

override invocationParams(options?: this["ParsedCallOptions"]) {
Expand Down
6 changes: 6 additions & 0 deletions libs/langchain-community/src/utils/bedrock/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ export interface BaseBedrockInput {
*/
model: string;

/** Optional URL Encoded overide for URL model parameter in fetch. Necessary for invoking an Application Inference Profile.
For example, "arn%3Aaws%3Abedrock%3Aus-east-1%3A1234567890%3Aapplication-inference-profile%2Fabcdefghi", will override this.model in final /invoke URL call.
Must still provide `model` as normal modelId to benefit from all the metadata.
*/
applicationInferenceProfile?: string;

/** 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.
*/
Expand Down
Loading