unstale

pypi / langchain-cloudflare

langchain-cloudflare

What changed in langchain-cloudflare 0.4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-31.

13 new APIs and options2 behavior and defaults2 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.9 on npm

langchain-cloudflare 0.417 changes

New APIs and options 13

  • 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.3release notes

  • 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.3release notes

  • The Worker extraction endpoint forwards native text and image extraction requests through the existing AI binding.

    0.4.3release notes

  • Embedded PNG, JPEG, and WebP inputs accept data URLs or content_type/base64 objects, including image-only requests.

    0.4.3release notes

  • 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.3release notes

  • 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.2release notes

  • Supports @cf/cloudflare/clef-omni through synchronous REST, asynchronous REST, and Python Workers AI bindings, preserving native answers, probabilities, and token usage.

    0.4.2release notes

  • 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.2release notes

  • 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.1release notes

  • Adds optional session and turn controls for Auto Router through aig_session_id, aig_turn_id, and aig_no_session_affinity fields.

    0.4.1release notes

  • REST calls using Auto Router require endpoint_format="openai_compatible".

    0.4.1release notes

  • Supports the cloudflare/auto model route when an explicit list of Workers AI candidates is provided.

    0.4.1release notes

  • Auto Router responses report the serving model in model_name and the requested route in requested_model.

    0.4.1release notes

Behavior and default changes 2

  • Native structured agents return the validated Pydantic instance in structured_response.

    0.4.3release notes

  • 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.1release notes

Fixes and other changes 2

  • Older Clef models reject audio and video arguments before calling the provider.

    0.4.2release notes

  • Python Worker AI binding session affinity and Auto Router candidate headers now use the documented extraHeaders option.

    0.4.1release notes