Class ChatAnthropicMessages<CallOptions>

Wrapper around Anthropic large language models.

To use this package, you should have an Anthropic API key set as an environment variable named ANTHROPIC_API_KEY or passed into the constructor.

Any parameters that are valid to be passed to anthropic.messages can be passed through invocationKwargs, even if not explicitly available on this class.

import { ChatAnthropic } from "@langchain/anthropic";

const model = new ChatAnthropic({
temperature: 0.9,
apiKey: 'YOUR-API-KEY',
});
const res = await model.invoke({ input: 'Hello!' });
console.log(res);

Type Parameters

Hierarchy (view full)

Implements

Constructors

Methods