Interface ChatBedrockConverseInput

Inputs for ChatBedrockConverse.

interface ChatBedrockConverseInput {
    durationSeconds: undefined | number;
    policy: undefined | string;
    policyArns: undefined | {
        arn?: string;
    }[];
    providerId: undefined | string;
    roleArn: undefined | string;
    additionalModelRequestFields?: DocumentType;
    authorizationToken?: string;
    awsContainerAuthorizationToken?: string;
    awsContainerAuthorizationTokenFile?: string;
    awsContainerCredentialsFullUri?: string;
    awsContainerCredentialsRelativeUri?: string;
    configFilepath?: string;
    credentials?: CredentialType;
    credentialsFullUri?: string;
    ec2MetadataV1Disabled?: boolean;
    endpointHost?: string;
    filepath?: string;
    guardrailConfig?: GuardrailConfiguration;
    ignoreCache?: boolean;
    logger?: Logger;
    maxRetries?: number;
    maxTokens?: number;
    mfaCodeProvider?: ((mfaSerial: string) => Promise<string>);
    model?: string;
    profile?: string;
    region?: string;
    roleAssumer?: ((sourceCreds: AwsCredentialIdentity, params: AssumeRoleParams) => Promise<AwsCredentialIdentity>);
    roleAssumerWithWebIdentity?: ((params: AssumeRoleWithWebIdentityParams) => Promise<AwsCredentialIdentity>) & ((params: AssumeRoleWithWebIdentityParams) => Promise<AwsCredentialIdentity>);
    roleSessionName?: string;
    ssoAccountId?: string;
    ssoClient?: SSOClient;
    ssoRegion?: string;
    ssoRoleName?: string;
    ssoSession?: string;
    ssoStartUrl?: string;
    streamUsage?: boolean;
    streaming?: boolean;
    supportsToolChoiceValues?: ("any" | "auto" | "tool")[];
    temperature?: number;
    timeout?: number;
    topP?: number;
    webIdentityTokenFile?: string;
}

Hierarchy (view full)

  • Toolkit
  • Partial<DefaultProviderInit>
    • ChatBedrockConverseInput

Implemented by

Properties

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

Additional inference parameters that the model supports, beyond the base set of inference parameters that the Converse API supports in the inferenceConfig field. For more information, see the model parameters link below.

authorizationToken?: string

BROWSER ONLY.

Providing this value will set an "Authorization" request header value on the GET request.

awsContainerAuthorizationToken?: string

An alternative to awsContainerAuthorizationTokenFile, this is the token value itself.

For browser environments, use instead authorizationToken.

awsContainerAuthorizationTokenFile?: string

Will be read on each credentials request to add an Authorization request header value.

Not supported in browsers.

awsContainerCredentialsFullUri?: string

If this value is provided, it will be used as-is.

For browser environments, use instead credentialsFullUri.

awsContainerCredentialsRelativeUri?: string

If this value is provided instead of the full URI, it will be appended to the default link local host of 169.254.170.2.

Not supported in browsers.

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.

credentialsFullUri?: string

BROWSER ONLY.

In browsers, a relative URI is not allowed, and a full URI must be provided. HTTPS is required.

This value is required for the browser environment.

ec2MetadataV1Disabled?: boolean

Only used in the IMDS credential provider.

endpointHost?: string

Override the default endpoint hostname.

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?: GuardrailConfiguration

Configuration information for a guardrail that you want to use in the request.

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

For credential resolution trace logging.

maxRetries?: number

Default is 3 retry attempts or 4 total attempts.

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, "anthropic.claude-3-haiku-20240307-v1:0", this is equivalent to the modelId property in the list-foundation-models api. See the below link for a full list of models.

https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns

anthropic.claude-3-haiku-20240307-v1:0
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.

ssoAccountId?: string

The ID of the AWS account to use for temporary credentials.

ssoClient?: SSOClient
ssoRegion?: string

The AWS region to use for temporary credentials.

ssoRoleName?: string

The name of the AWS role to assume.

ssoSession?: string

SSO session identifier. Presence implies usage of the SSOTokenProvider.

ssoStartUrl?: string

The URL to the AWS SSO service.

streamUsage?: boolean

Whether or not to include usage data, like token counts in the streamed response chunks. Passing as a call option will take precedence over the class-level setting.

true
streaming?: boolean

Whether or not to stream responses

supportsToolChoiceValues?: ("any" | "auto" | "tool")[]

Which types of tool_choice values the model supports.

Inferred if not specified. Inferred as ['auto', 'any', 'tool'] if a 'claude-3' model is used, ['auto', 'any'] if a 'mistral-large' model is used, empty otherwise.

temperature?: number

Temperature.

timeout?: number

Default is 1000ms. Time in milliseconds to spend waiting between retry attempts.

topP?: number

The percentage of most-likely candidates that the model considers for the next token. For example, if you choose a value of 0.8 for topP, the model selects from the top 80% of the probability distribution of tokens that could be next in the sequence. The default value is the default value for the model that you are using. For more information, see the inference parameters for foundation models link below.

webIdentityTokenFile?: string

File location of where the OIDC token is stored.