# What changed in langchain-cloudflare

> 17 changes in langchain-cloudflare 0.4 from its official release notes, upgrade guides and advisories: 13 new APIs and options. Each one cited. Sources checked 2026-10-31. HTML: https://unstale.sh/pypi/langchain-cloudflare/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## langchain-cloudflare 0.4

### New APIs and options

- Supports @cf/cloudflare/clairic through synchronous REST, asynchronous REST, and Python Workers AI bindings, with native field definitions, reference dates, and extraction options. (0.4.3) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#043---2026-10-20)
- Pass Clef or Clairic with response_format to receive a validated Pydantic instance in structured_response, with automatic, provider-format, and single-schema tool-format strategies. (0.4.3) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#043---2026-10-20)
- The Worker extraction endpoint forwards native text and image extraction requests through the existing AI binding. (0.4.3) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#043---2026-10-20)
- Embedded PNG, JPEG, and WebP inputs accept data URLs or content_type/base64 objects, including image-only requests. (0.4.3) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#043---2026-10-20)
- Clef and Clairic expose native Pydantic structured output with LangChain Runnable sync, async, and batch methods; unsupported schema shapes are rejected before inference. (0.4.3) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#043---2026-10-20)
- Clef Omni accepts optional audio inputs in WAV or MP3 format as embedded data URLs or content_type/base64 objects alongside text, JSON, and images. (0.4.2) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#042---2026-10-11)
- Supports @cf/cloudflare/clef-omni through synchronous REST, asynchronous REST, and Python Workers AI bindings, preserving native answers, probabilities, and token usage. (0.4.2) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#042---2026-10-11)
- Clef Omni accepts optional video inputs in MP4 or WebM format as embedded data URLs or content_type/base64 objects alongside text, JSON, and images. (0.4.2) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#042---2026-10-11)
- Adds a list of Workers AI candidates for the Auto Router; REST calls send it through cf-aig-allowed-models and Worker binding calls use extraHeaders. (0.4.1) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#041---2026-10-03)
- Adds optional session and turn controls for Auto Router through aig_session_id, aig_turn_id, and aig_no_session_affinity fields. (0.4.1) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#041---2026-10-03)
- REST calls using Auto Router require endpoint_format="openai_compatible". (0.4.1) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#041---2026-10-03)
- Supports the cloudflare/auto model route when an explicit list of Workers AI candidates is provided. (0.4.1) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#041---2026-10-03)
- Auto Router responses report the serving model in model_name and the requested route in requested_model. (0.4.1) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#041---2026-10-03)

### Behavior and default changes

- Native structured agents return the validated Pydantic instance in structured_response. (0.4.3) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#043---2026-10-20)
- REST and Python Worker responses include routing reason and request identifiers when AI Gateway returns those headers; Worker binding uses returnRawResponse to read them. (0.4.1) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#041---2026-10-03)

### Fixes and other changes

- Older Clef models reject audio and video arguments before calling the provider. (0.4.2) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#042---2026-10-11)
- Python Worker AI binding session affinity and Auto Router candidate headers now use the documented extraHeaders option. (0.4.1) — [release notes](https://github.com/cloudflare/langchain-cloudflare/blob/b3ada298a7c625b229004f5b46a3a50ef616b5a3/CHANGELOG.md#041---2026-10-03)
