interface BedrockChatFields {
    cache?: boolean | BaseCache<Generation[]>;
    callbackManager?: CallbackManager;
    callbacks?: Callbacks;
    credentials?: CredentialType;
    endpointHost?: string;
    endpointUrl?: string;
    fetchFn?: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>);
    guardrailConfig?: {
        streamProcessingMode: "SYNCHRONOUS" | "ASYNCHRONOUS";
        tagSuffix: string;
    };
    guardrailIdentifier?: string;
    guardrailVersion?: string;
    maxConcurrency?: number;
    maxRetries?: number;
    maxTokens?: number;
    metadata?: Record<string, unknown>;
    model?: string;
    modelKwargs?: Record<string, unknown>;
    onFailedAttempt?: FailedAttemptHandler;
    region?: string;
    stopSequences?: string[];
    streaming?: boolean;
    tags?: string[];
    temperature?: number;
    trace?: "ENABLED" | "DISABLED";
    verbose?: boolean;
}

Hierarchy

  • Partial<BaseBedrockInput>
  • BaseChatModelParams
    • BedrockChatFields

Properties

cache?: boolean | BaseCache<Generation[]>
callbackManager?: CallbackManager

Use callbacks instead

callbacks?: Callbacks
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: RequestInfo | URL, 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: RequestInfo | URL
      • Optionalinit: RequestInit

      Returns Promise<Response>

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.

maxConcurrency?: number

The maximum number of concurrent calls that can be made. Defaults to Infinity, which means no limit.

maxRetries?: number

The maximum number of retries that can be made for a single call, with an exponential backoff between each attempt. Defaults to 6.

maxTokens?: number

Max tokens.

metadata?: Record<string, unknown>
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.

onFailedAttempt?: FailedAttemptHandler

Custom handler to handle failed attempts. Takes the originally thrown error object as input, and should itself throw an error if the input error is not retryable.

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.

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

tags?: string[]
temperature?: number

Temperature.

trace?: "ENABLED" | "DISABLED"

Trace settings for the Bedrock Guardrails.

verbose?: boolean