interface BedrockChatFields {
    durationSeconds: undefined | number;
    policy: undefined | string;
    policyArns: undefined | {
        arn?: string;
    }[];
    providerId: undefined | string;
    roleArn: undefined | string;
    configFilepath?: string;
    credentials?: CredentialType;
    endpointHost?: string;
    endpointUrl?: string;
    fetchFn?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: RequestInfo, init?: RequestInit): Promise<Response>;
    };
    filepath?: string;
    guardrailConfig?: {
        streamProcessingMode: "SYNCHRONOUS" | "ASYNCHRONOUS";
        tagSuffix: string;
    };
    guardrailIdentifier?: string;
    guardrailVersion?: string;
    ignoreCache?: boolean;
    logger?: Logger;
    maxRetries?: number;
    maxTokens?: number;
    mfaCodeProvider?: ((mfaSerial: string) => Promise<string>);
    model?: string;
    modelKwargs?: Record<string, unknown>;
    profile?: string;
    region?: string;
    roleAssumer?: ((sourceCreds: AwsCredentialIdentity, params: AssumeRoleParams) => Promise<AwsCredentialIdentity>);
    roleAssumerWithWebIdentity?: ((params: AssumeRoleWithWebIdentityParams) => Promise<AwsCredentialIdentity>) & ((params: AssumeRoleWithWebIdentityParams) => Promise<AwsCredentialIdentity>);
    roleSessionName?: string;
    ssoClient?: SSOClient;
    stopSequences?: string[];
    streaming?: boolean;
    temperature?: number;
    timeout?: number;
    trace?: "ENABLED" | "DISABLED";
    webIdentityTokenFile?: string;
}

Hierarchy (view full)

  • Partial<BaseBedrockInput>
  • Toolkit
  • Partial<DefaultProviderInit>
    • BedrockChatFields

Properties

durationSeconds: undefined | number
policy: undefined | string
policyArns: undefined | {
    arn?: string;
}[]
providerId: undefined | string
roleArn: undefined | string
configFilepath?: string

The path at which to locate the ini config file. Defaults to the value of the AWS_CONFIG_FILE environment variable (if defined) or ~/.aws/config otherwise.

credentials?: CredentialType

AWS Credentials. If no credentials are provided, the default credentials from @aws-sdk/credential-provider-node will be used.

endpointHost?: string

Override the default endpoint hostname.

endpointUrl?: string

Use endpointHost instead Override the default endpoint url.

fetchFn?: {
    (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
    (input: RequestInfo, init?: RequestInit): Promise<Response>;
}

A custom fetch function for low-level access to AWS API. Defaults to fetch().

Type declaration

    • (input, init?): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optionalinit: RequestInit

      Returns Promise<Response>

    • (input, init?): Promise<Response>
    • Parameters

      • input: RequestInfo
      • Optionalinit: RequestInit

      Returns Promise<Response>

filepath?: string

The path at which to locate the ini credentials file. Defaults to the value of the AWS_SHARED_CREDENTIALS_FILE environment variable (if defined) or ~/.aws/credentials otherwise.

guardrailConfig?: {
    streamProcessingMode: "SYNCHRONOUS" | "ASYNCHRONOUS";
    tagSuffix: string;
}

Required when Guardrail is in use.

guardrailIdentifier?: string

Identifier for the guardrail configuration.

guardrailVersion?: string

Version for the guardrail configuration.

ignoreCache?: boolean

Configuration files are normally cached after the first time they are loaded. When this property is set, the provider will always reload any configuration files loaded before.

logger?: Logger
maxRetries?: number

The maximum number of times the HTTP connection should be retried

maxTokens?: number

Max tokens.

mfaCodeProvider?: ((mfaSerial: string) => Promise<string>)

A function that returns a promise fulfilled with an MFA token code for the provided MFA Serial code. If a profile requires an MFA code and mfaCodeProvider is not a valid function, the credential provider promise will be rejected.

Type declaration

    • (mfaSerial): Promise<string>
    • Parameters

      • mfaSerial: string

        The serial code of the MFA device specified.

      Returns Promise<string>

model?: string

Model to use. For example, "amazon.titan-tg1-large", this is equivalent to the modelId property in the list-foundation-models api.

modelKwargs?: Record<string, unknown>

Additional kwargs to pass to the model.

profile?: string

The configuration profile to use.

region?: 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.

roleAssumer?: ((sourceCreds: AwsCredentialIdentity, params: AssumeRoleParams) => Promise<AwsCredentialIdentity>)

A function that assumes a role and returns a promise fulfilled with credentials for the assumed role.

Type declaration

    • (sourceCreds, params): Promise<AwsCredentialIdentity>
    • Parameters

      • sourceCreds: AwsCredentialIdentity

        The credentials with which to assume a role.

      • params: AssumeRoleParams

      Returns Promise<AwsCredentialIdentity>

roleAssumerWithWebIdentity?: ((params: AssumeRoleWithWebIdentityParams) => Promise<AwsCredentialIdentity>) & ((params: AssumeRoleWithWebIdentityParams) => Promise<AwsCredentialIdentity>)

A function that assumes a role with web identity and returns a promise fulfilled with credentials for the assumed role.

The credentials with which to assume a role.

roleSessionName?: string

The IAM session name used to distinguish sessions.

ssoClient?: SSOClient
stopSequences?: string[]

Optional additional stop sequences to pass to the model. Currently only supported for Anthropic and AI21.

Use .bind({ "stop": [...] }) instead

streaming?: boolean

Whether or not to stream responses

temperature?: number

Temperature.

timeout?: number

The connection timeout (in milliseconds)

trace?: "ENABLED" | "DISABLED"

Trace settings for the Bedrock Guardrails.

webIdentityTokenFile?: string

File location of where the OIDC token is stored.