Example

const model = new BedrockChat({
model: "anthropic.claude-v2",
region: "us-east-1",
});
const res = await model.invoke([{ content: "Tell me a joke" }]);
console.log(res);

Hierarchy (view full)

Constructors

Properties

codec: EventStreamCodec = ...
credentials: CredentialType
fetchFn: {
    (input, init?): Promise<Response>;
    (input, init?): Promise<Response>;
}

Type declaration

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

      • input: string | URL | Request
      • Optional init: RequestInit

      Returns Promise<Response>

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

      • input: RequestInfo
      • Optional init: RequestInit

      Returns Promise<Response>

guardrailIdentifier: string = ""
guardrailVersion: string = ""
model: string = "amazon.titan-tg1-large"
region: string
streaming: boolean = false
usesMessagesApi: boolean = false
endpointHost?: string
guardrailConfig?: {
    streamProcessingMode: "SYNCHRONOUS" | "ASYNCHRONOUS";
    tagSuffix: string;
}

Type declaration

  • streamProcessingMode: "SYNCHRONOUS" | "ASYNCHRONOUS"
  • tagSuffix: string
maxTokens?: number = undefined
modelKwargs?: Record<string, unknown>
stopSequences?: string[]

⚠️ Deprecated ⚠️

Use as a call option using .bind() instead.

This feature is deprecated and will be removed in the future.

It is not recommended for use.

temperature?: number = undefined
trace?: "ENABLED" | "DISABLED"

Methods

  • Parameters

    • Optional options: unknown

    Returns {
        guardrailConfig: undefined | {
            streamProcessingMode: "SYNCHRONOUS" | "ASYNCHRONOUS";
            tagSuffix: string;
        };
        max_tokens: undefined | number;
        modelKwargs: undefined | Record<string, unknown>;
        stop: any;
        temperature: undefined | number;
        tools: AnthropicTool[];
    }

    • guardrailConfig: undefined | {
          streamProcessingMode: "SYNCHRONOUS" | "ASYNCHRONOUS";
          tagSuffix: string;
      }
    • max_tokens: undefined | number
    • modelKwargs: undefined | Record<string, unknown>
    • stop: any
    • temperature: undefined | number
    • tools: AnthropicTool[]

Generated using TypeDoc