ChatCloudflareWorkersAI
features and configurations head to the API reference.
Overview
Integration details
Class | Package | Local | Serializable | PY support | Downloads | Version |
---|---|---|---|---|---|---|
ChatCloudflareWorkersAI | @langchain/cloudflare | ❌ | ✅ | ❌ |
Model features
See the links in the table headers below for guides on how to use specific features.Tool calling | Structured output | JSON mode | Image input | Audio input | Video input | Token-level streaming | Token usage | Logprobs |
---|---|---|---|---|---|---|---|---|
❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
Setup
To access Cloudflare Workers AI models you’ll need to create a Cloudflare account, get an API key, and install the@langchain/cloudflare
integration package.
Credentials
Head to this page to sign up to Cloudflare and generate an API key. Once you’ve done this, note yourCLOUDFLARE_ACCOUNT_ID
and CLOUDFLARE_API_TOKEN
.
Passing a binding within a Cloudflare Worker is not yet supported.
Installation
The LangChain ChatCloudflareWorkersAI integration lives in the@langchain/cloudflare
package:
Instantiation
Now we can instantiate our model object and generate chat completions:Invocation
Chaining
We can chain our model with a prompt template like so:API reference
For detailed documentation of allChatCloudflareWorkersAI
features and configurations head to the API reference.