Spaces:
Sleeping
@langchain/openai
1.4.5
Patch Changes
#10749
dc20c0eThanks @open-swe! - fix(openai): add gpt-5.5 and gpt-5.5-pro to profiles, default gpt-5.5-pro to Responses API, bump openai sdk#10776
20a9abeThanks @hntrl! - fix(deps): remediate uuid vulnerability by removing direct uuid usageUpdated dependencies [
20a9abe]:- @langchain/core@1.1.42
1.4.4
Patch Changes
- #10681
2301260Thanks @hntrl! - fix(openai): add index to streaming reasoning content blocks for proper chunk merging
1.4.3
Patch Changes
- #10670
6b8ef6cThanks @christian-bromann! - fix(openai): preserve plain string responses content
1.4.2
Patch Changes
#10614
d6bf4fcThanks @colifran! - feat(openai): imput placeholder filenames for openai file inputsUpdated dependencies [
d3d0922]:- @langchain/core@1.1.39
1.4.1
Patch Changes
#10551
9270c48Thanks @muhammadosama984! - fix(openai): preserve reasoning_content in ChatOpenAICompletionsUpdated dependencies [
589ab9b]:- @langchain/core@1.1.38
1.4.0
Minor Changes
- #10509
5552999Thanks @hntrl! - feat(openai): add support for phase parameter on Responses API messages- Extract
phasefrom message output items and surface it on text content blocks - Support phase in streaming via
response.output_item.addedevents - Round-trip phase through both raw provider and standard content paths
- Move phase into
extrasdict in the core standard content translator
- Extract
Patch Changes
- Updated dependencies [
6933769,50d5f32,5552999,8331833]:- @langchain/core@1.1.37
1.3.1
Patch Changes
#10481
478652cThanks @hnustwjj! - fix(openai): detect DeepSeek context overflow errors asContextOverflowErrorDeepSeek returns
maximum context lengthin 400 error messages when the context limit is exceeded. These are now recognized bywrapOpenAIClientError, so downstream code (e.g. summarization middleware fallback) can handle them correctly.#10507
52e501bThanks @App-arently! - fix(openai): guard JSON.parse in streaming json_schema when text is emptyUpdated dependencies [
bbbfea1]:- @langchain/core@1.1.36
1.3.0
Minor Changes
- #10317
af9bbd3Thanks @hntrl! - feat(openai): support tool search and defer_loading- Add
tools.toolSearch()factory for the OpenAI Responses APItool_searchbuilt-in tool, supporting both server-executed and client-executed modes. - Propagate
defer_loadingfrom LangChain toolextrasthroughbindTools()and into the Responses API payload, enabling on-demand tool discovery. - Handle
tool_search_callandtool_search_outputresponse items in both streaming and non-streaming converters. - Add core block translator support to convert
tool_search_call→server_tool_callandtool_search_output→server_tool_call_result.
- Add
Patch Changes
- Updated dependencies [
6db417b,d69dfcc]:- @langchain/core@1.1.33
1.2.13
Patch Changes
#10311
aacbe87Thanks @christian-bromann! - fix(openai): add gpt-5.4 to profilesUpdated dependencies [
26488b5,ca826f6,a602c42,db7d017]:- @langchain/core@1.1.32
1.2.12
Patch Changes
#10205
3682a8dThanks @colifran! - feat(openai): add standard schema support for structured outputUpdated dependencies [
96c630d,a8b9ccc,a1f22bb]:- @langchain/core@1.1.30
1.2.11
Patch Changes
#10106
9f30267Thanks @hntrl! - Add package version metadata to runnable traces. Each package now stamps its version inthis.metadata.versionsat construction time, making version info available in LangSmith trace metadata.#10151
f298a9bThanks @hntrl! - Bump openai SDK to ^6.24.0, fix ChatCompletionTool type narrowing for new union type, add file input converter tests for newly supported document types (docx, pptx, xlsx, csv)Updated dependencies [
9f30267,403a99f,3b1fd54,77bd982]:- @langchain/core@1.1.29
1.2.10
Patch Changes
#10143
62ba83eThanks @topliceanurazvan! - fix(openai): emit handleLLMNewToken callback for usage chunk in Completions API streamingThe final usage chunk in
_streamResponseChunkswas only yielded via the async generator but did not callrunManager.handleLLMNewToken(). This meant callback-based consumers (e.g. LangGraph'sStreamMessagesHandler) never received theusage_metadatachunk. Added the missinghandleLLMNewTokencall to match the behavior of the main streaming loop.Updated dependencies [
10a876c,b46d96a]:- @langchain/core@1.1.28
1.2.9
Patch Changes
#10080
b583729Thanks @hntrl! - Add string-model constructor overloads for chat models (with supporting tests where applicable).Updated dependencies [
fb2226e]:- @langchain/core@1.1.27
1.2.8
Patch Changes
#10077
05396f7Thanks @christian-bromann! - feat(core): add ContextOverflowError, raise in anthropic and openai#10081
5a6f26bThanks @hntrl! - feat(core): add namespace-based symbol branding for error class hierarchiesIntroduces
createNamespaceutility for hierarchical symbol-based branding of class hierarchies. All LangChain error classes now use this pattern, replacing hand-rolled duck-typeisInstancechecks with reliable cross-realmSymbol.for-based identity.- New
LangChainErrorbase class that all LangChain errors extend - New
createNamespace/NamespaceAPI in@langchain/core/utils/namespace - Refactored
ModelAbortError,ContextOverflowErrorto use namespace branding - Added
ContextOverflowError.fromError()static factory method - Deprecated
addLangChainErrorFieldsin favor ofLangChainErrorsubclasses - Migrated Google provider errors (
GoogleError,ConfigurationError, etc.) to namespace branding - Updated Anthropic and OpenAI providers to use
ContextOverflowError.fromError()
- New
#10078
7be50a7Thanks @christian-bromann! - chore(*): update model profiles
1.2.7
Patch Changes
#9954
6939dabThanks @akintunero! - fix(openai): store response.output in response_metadata for reasoning model round-trips#9898
ad581c7Thanks @Muhammad-Kamran-Khan! - fix(openai): pass service_tier to API when using Responses API
1.2.6
Patch Changes
#9972
16d691cThanks @hntrl! - fix(openai): drop Anthropictool_usecontent blocks when converting messages for OpenAIWhen messages originating from Anthropic (e.g. via
ChatAnthropic) are passed toChatOpenAI, Anthropic-nativetool_useblocks inmessage.contentare now filtered out during conversion. These blocks are already represented inmessage.tool_callsand would cause an OpenAI API error if passed through.#9940
1058574Thanks @saakshigupta2002! - fix(openai): correctly convert annotations back to OpenAI format in Responses API multi-turn conversations
1.2.5
Patch Changes
#9743
0870ca0Thanks @d2201! - fix(openai): include encrypted reasoning in ZDR responses input#9934
cf46089Thanks @hntrl! - feat(openai): update openai SDK to ^6.18.0- Adds support for codex 5.3
- Added
actionoption to image generation tool (generate,edit,auto) - Removed
@ts-expect-errorforgpt-image-1.5model (now in SDK types) - Auto-route codex models (
codex-mini-latest,gpt-5-codex,gpt-5.1-codex, etc.) to Responses API - Added
shell_callandlocal_shell_callto streaming converter and input reconstruction - Added unit tests for
isReasoningModeland_modelPrefersResponsesAPI
1.2.4
Patch Changes
#9887
1fa865bThanks @Muhammad-Kamran-Khan! - Fix validation to allow file_url and file_id without filename metadata in Responses API, and prevent sending filename when not allowed.#9873
28efb57Thanks @hntrl! - AddreasoningEffortcall option as a convenience shorthand forreasoning.effort- Adds
reasoningEfforttoBaseChatOpenAICallOptionsfor easier configuration of reasoning models - Automatically coalesces
reasoningEffortintoreasoning.effortwhen calling reasoning models (o1, o3, etc.) - If both
reasoningEffortandreasoning.effortare provided,reasoning.efforttakes precedence - Marked as
@deprecatedto encourage use of the fullreasoning.effortoption
- Adds
#9876
4e42452Thanks @sflanker! - fix(openai): pass runManager to responses._generate function in ChatOpenAI#9900
a9b5059Thanks @hntrl! - Improved abort signal handling for chat models:- Added
ModelAbortErrorclass in@langchain/core/errorsthat contains partial output when a model invocation is aborted mid-stream invoke()now throwsModelAbortErrorwith accumulatedpartialOutputwhen aborted during streaming (when using streaming callback handlers)stream()throws a regularAbortErrorwhen aborted (since chunks are already yielded to the caller)- All provider implementations now properly check and propagate abort signals in both
_generate()and_streamResponseChunks()methods - Added standard tests for abort signal behavior
- Added
#9900
a9b5059Thanks @hntrl! - fix(providers): add proper abort signal handling for invoke and stream operations- Added early abort check (
signal.throwIfAborted()) at the start of_generatemethods to immediately throw when signal is already aborted - Added abort signal checks inside streaming loops in
_streamResponseChunksto return early when signal is aborted - Propagated abort signals to underlying SDK calls where applicable (Google GenAI, Google Common/VertexAI, Cohere)
- Added standard tests for abort signal behavior in
@langchain/standard-tests
This enables proper cancellation behavior for both invoke and streaming operations, and allows fallback chains to correctly proceed to the next runnable when the previous one is aborted.
- Added early abort check (
1.2.3
Patch Changes
#9679
a7c6ec5Thanks @christian-bromann! - feat(openai): elevate OpenAI image generation outputs to proper image content blocks#9810
04923f9Thanks @christian-bromann! - Cb/OpenAI reasoning fix#9827
e16c218Thanks @sanjaiyan-dev! - optimize stream chunk aggregation and remove redundant sorting
1.2.2
Patch Changes
- #9777
3efe79cThanks @christian-bromann! - fix(core): properly elevate reasoning tokens
1.2.1
Patch Changes
#9730
13c9d5bThanks @christian-bromann! - fix(openai): pass through provider-native content in ToolMessage without stringification#9737
75b3b90Thanks @hntrl! - fix(openai): pass runManager to _streamResponseChunks in responses API
1.2.0
Minor Changes
#9541
eab88a5Thanks @christian-bromann! - feat(openai): add support for fileSearch tool#9541
5f79bc5Thanks @christian-bromann! - feat(openai): support web search tool#9541
7b301c0Thanks @christian-bromann! - feat(openai): add support for shell tool#9541
bb2f422Thanks @christian-bromann! - feat(openai): support code interpreter tool#9541
2a5ba50Thanks @christian-bromann! - feat(openai): add support for local shell tool#9634
47edf3fThanks @christian-bromann! - feat(openai): add 'moderateContent' to ChatOpenAI for content moderation #9410#9541
2e563e3Thanks @christian-bromann! - feat(openai): add support for apply patch tool#9541
f97b488Thanks @christian-bromann! - feat(openai): support for MCP connector tool#9541
6baa851Thanks @christian-bromann! - feat(langchain): add support for image generation tool#9541
69a1045Thanks @christian-bromann! - add support for computer use tool
Patch Changes
#9636
5a01b5bThanks @christian-bromann! - fix content in AIMessage for tool and function calls#9570
72795feThanks @ddewaele! - fixes filename / base64 conversions in openai completions converters (#9512)#9648
29a8480Thanks @christian-bromann! - fix(langchain): allow to set strict tag manually in providerStrategy #9578#9631
3ecc1e7Thanks @jacoblee93! - feat(openai): Prefer responses API for 5.2 pro#9591
a552cadThanks @Ayushsingla1! - add prompt cache retention support
1.1.3
Patch Changes
1.1.2
Patch Changes
#9408
415cb0bThanks @sinedied! - Fix missing and inconsistent user agent headers#9301
a2ad61eThanks @sinedied! - support callable function for apiKey
1.1.1
Patch Changes
#9308
04bd55cThanks @ro0sterjam! - respect JSON schema references in interopZodTransformInputSchema#9387
ac0d4feThanks @hntrl! - AddModelProfileand.profileproperties to ChatModel
1.1.0
Minor Changes
- 8319201: hoist message/tool conversion utilities from classes
Patch Changes
- 4906522: fix(openai): pair reasoning with function_call id
1.0.0
This release updates the package for compatibility with LangChain v1.0. See the v1.0 release notes for details on what's new.
0.6.16
Patch Changes
- b8ffc1e: fix(openai): Remove raw OpenAI fields from token usage
0.6.15
Patch Changes
- e63c7cc: fix(openai): Convert OpenAI responses API usage to tracing format
0.6.14
Patch Changes
- d38e9d6: fix(openai): fix streaming in openai
0.6.12
Patch Changes
- 41bd944: support base64 embeddings format
- 707a768: handle undefined disableStreaming to restore streaming functionality
0.6.11
Patch Changes
- 65459e3: use proper casing for reasoning effort param
0.6.10
Patch Changes
- 4a3f5af: add verbosity to json schema response format (#8754)
- 424360b: re-add reasoning_effort param