Install and import from "@langchain/cloudflare" instead.
A class that enables calls to the Cloudflare Workers AI API to access large language
models in a chat-like fashion. It extends the SimpleChatModel class and
implements the CloudflareWorkersAIInput interface.
constresponse = awaitmodel.invoke([ ["system", "You are a helpful assistant that translates English to German."], ["human", `Translate "I love programming".`] ]);
Deprecated
Install and import from "@langchain/cloudflare" instead.
A class that enables calls to the Cloudflare Workers AI API to access large language models in a chat-like fashion. It extends the SimpleChatModel class and implements the CloudflareWorkersAIInput interface.
Example