@langchain/openai
Advanced tools
+21
-0
| # @langchain/openai | ||
| ## 1.2.8 | ||
| ### Patch Changes | ||
| - [#10077](https://github.com/langchain-ai/langchainjs/pull/10077) [`05396f7`](https://github.com/langchain-ai/langchainjs/commit/05396f7ce0a91c49a3bae4bbcd3dbdd6cbd18089) Thanks [@christian-bromann](https://github.com/christian-bromann)! - feat(core): add ContextOverflowError, raise in anthropic and openai | ||
| - [#10081](https://github.com/langchain-ai/langchainjs/pull/10081) [`5a6f26b`](https://github.com/langchain-ai/langchainjs/commit/5a6f26bbaed80195dc538c538b96219a8b03f38f) Thanks [@hntrl](https://github.com/hntrl)! - feat(core): add namespace-based symbol branding for error class hierarchies | ||
| Introduces `createNamespace` utility for hierarchical symbol-based branding of class hierarchies. | ||
| All LangChain error classes now use this pattern, replacing hand-rolled duck-type `isInstance` checks | ||
| with reliable cross-realm `Symbol.for`-based identity. | ||
| - New `LangChainError` base class that all LangChain errors extend | ||
| - New `createNamespace` / `Namespace` API in `@langchain/core/utils/namespace` | ||
| - Refactored `ModelAbortError`, `ContextOverflowError` to use namespace branding | ||
| - Added `ContextOverflowError.fromError()` static factory method | ||
| - Deprecated `addLangChainErrorFields` in favor of `LangChainError` subclasses | ||
| - Migrated Google provider errors (`GoogleError`, `ConfigurationError`, etc.) to namespace branding | ||
| - Updated Anthropic and OpenAI providers to use `ContextOverflowError.fromError()` | ||
| - [#10078](https://github.com/langchain-ai/langchainjs/pull/10078) [`7be50a7`](https://github.com/langchain-ai/langchainjs/commit/7be50a7014d7622e0ab8d303dfc9c633ebc96333) Thanks [@christian-bromann](https://github.com/christian-bromann)! - chore(\*): update model profiles | ||
| ## 1.2.7 | ||
@@ -4,0 +25,0 @@ |
| //#region src/chat_models/profiles.ts | ||
| const PROFILES = { | ||
| "gpt-4.1-nano": { | ||
| maxInputTokens: 1047576, | ||
| "gpt-4o-2024-11-20": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: true, | ||
@@ -10,3 +10,3 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 32768, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
@@ -23,4 +23,76 @@ imageOutputs: false, | ||
| }, | ||
| "text-embedding-3-small": { | ||
| maxInputTokens: 8191, | ||
| "gpt-5.3-codex": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-5-codex": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-5-pro": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 272e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-4o-mini": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "text-embedding-ada-002": { | ||
| maxInputTokens: 8192, | ||
| imageInputs: false, | ||
@@ -42,4 +114,22 @@ audioInputs: false, | ||
| }, | ||
| "gpt-4": { | ||
| maxInputTokens: 8192, | ||
| "gpt-5-chat-latest": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "codex-mini-latest": { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: false, | ||
@@ -49,4 +139,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 8192, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -62,4 +152,4 @@ audioOutputs: false, | ||
| }, | ||
| "o1-pro": { | ||
| maxInputTokens: 2e5, | ||
| "gpt-5.1-codex-max": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
@@ -69,3 +159,3 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 1e5, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
@@ -100,3 +190,3 @@ imageOutputs: false, | ||
| }, | ||
| "gpt-4o-2024-08-06": { | ||
| "gpt-5.2-chat-latest": { | ||
| maxInputTokens: 128e3, | ||
@@ -108,3 +198,3 @@ imageInputs: true, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -120,4 +210,4 @@ audioOutputs: false, | ||
| }, | ||
| "gpt-4.1-mini": { | ||
| maxInputTokens: 1047576, | ||
| "gpt-5.2-codex": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
@@ -127,4 +217,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 32768, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -158,32 +248,32 @@ audioOutputs: false, | ||
| }, | ||
| "gpt-3.5-turbo": { | ||
| maxInputTokens: 16385, | ||
| imageInputs: false, | ||
| o1: { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 4096, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| structuredOutput: false, | ||
| imageUrlInputs: false, | ||
| pdfToolMessage: false, | ||
| imageToolMessage: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "text-embedding-3-large": { | ||
| maxInputTokens: 8191, | ||
| imageInputs: false, | ||
| "gpt-5.1": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 3072, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
@@ -195,4 +285,4 @@ imageUrlInputs: true, | ||
| }, | ||
| "gpt-4-turbo": { | ||
| maxInputTokens: 128e3, | ||
| "o4-mini-deep-research": { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: true, | ||
@@ -202,4 +292,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 4096, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -215,9 +305,9 @@ audioOutputs: false, | ||
| }, | ||
| "o1-preview": { | ||
| "gpt-5.3-codex-spark": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: false, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 32768, | ||
| maxOutputTokens: 32e3, | ||
| reasoningOutput: true, | ||
@@ -227,3 +317,3 @@ imageOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
@@ -235,5 +325,5 @@ imageUrlInputs: true, | ||
| }, | ||
| "o3-mini": { | ||
| o3: { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: false, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
@@ -254,4 +344,4 @@ pdfInputs: true, | ||
| }, | ||
| "codex-mini-latest": { | ||
| maxInputTokens: 2e5, | ||
| "text-embedding-3-small": { | ||
| maxInputTokens: 8191, | ||
| imageInputs: false, | ||
@@ -261,8 +351,8 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
| maxOutputTokens: 1536, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| toolCalling: false, | ||
| structuredOutput: true, | ||
@@ -274,4 +364,4 @@ imageUrlInputs: true, | ||
| }, | ||
| "gpt-5-nano": { | ||
| maxInputTokens: 4e5, | ||
| "gpt-4.1-nano": { | ||
| maxInputTokens: 1047576, | ||
| imageInputs: true, | ||
@@ -281,4 +371,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| maxOutputTokens: 32768, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
@@ -294,3 +384,39 @@ audioOutputs: false, | ||
| }, | ||
| "gpt-5-codex": { | ||
| "text-embedding-3-large": { | ||
| maxInputTokens: 8191, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 3072, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-3.5-turbo": { | ||
| maxInputTokens: 16385, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
| pdfInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 4096, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| structuredOutput: false, | ||
| imageUrlInputs: false, | ||
| pdfToolMessage: false, | ||
| imageToolMessage: false, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-5.1-codex-mini": { | ||
| maxInputTokens: 4e5, | ||
@@ -313,4 +439,4 @@ imageInputs: true, | ||
| }, | ||
| "gpt-4o": { | ||
| maxInputTokens: 128e3, | ||
| "gpt-5.2": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
@@ -320,4 +446,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -351,3 +477,3 @@ audioOutputs: false, | ||
| }, | ||
| "o4-mini": { | ||
| "o3-pro": { | ||
| maxInputTokens: 2e5, | ||
@@ -370,4 +496,4 @@ imageInputs: true, | ||
| }, | ||
| o1: { | ||
| maxInputTokens: 2e5, | ||
| "gpt-4-turbo": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: true, | ||
@@ -377,4 +503,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
| maxOutputTokens: 4096, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
@@ -390,3 +516,3 @@ audioOutputs: false, | ||
| }, | ||
| "gpt-5-mini": { | ||
| "gpt-5": { | ||
| maxInputTokens: 4e5, | ||
@@ -409,9 +535,9 @@ imageInputs: true, | ||
| }, | ||
| "o1-mini": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: false, | ||
| "o4-mini": { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 65536, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
@@ -421,3 +547,3 @@ imageOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
@@ -429,9 +555,9 @@ imageUrlInputs: true, | ||
| }, | ||
| "text-embedding-ada-002": { | ||
| maxInputTokens: 8192, | ||
| imageInputs: false, | ||
| "gpt-4.1-mini": { | ||
| maxInputTokens: 1047576, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 1536, | ||
| maxOutputTokens: 32768, | ||
| reasoningOutput: false, | ||
@@ -441,2 +567,20 @@ imageOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "o1-preview": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 32768, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
@@ -449,3 +593,3 @@ structuredOutput: true, | ||
| }, | ||
| "o3-pro": { | ||
| "o1-pro": { | ||
| maxInputTokens: 2e5, | ||
@@ -468,4 +612,4 @@ imageInputs: true, | ||
| }, | ||
| "gpt-4o-2024-11-20": { | ||
| maxInputTokens: 128e3, | ||
| "gpt-5.1-codex": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
@@ -475,4 +619,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -488,4 +632,4 @@ audioOutputs: false, | ||
| }, | ||
| o3: { | ||
| maxInputTokens: 2e5, | ||
| "gpt-5.2-pro": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
@@ -495,3 +639,3 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 1e5, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
@@ -508,5 +652,5 @@ imageOutputs: false, | ||
| }, | ||
| "o4-mini-deep-research": { | ||
| "o3-mini": { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: true, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
@@ -527,3 +671,21 @@ pdfInputs: true, | ||
| }, | ||
| "gpt-5-chat-latest": { | ||
| "gpt-4o-2024-08-06": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-5-mini": { | ||
| maxInputTokens: 4e5, | ||
@@ -539,3 +701,3 @@ imageInputs: true, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
@@ -547,3 +709,3 @@ imageUrlInputs: true, | ||
| }, | ||
| "gpt-4o-mini": { | ||
| "gpt-5.1-chat-latest": { | ||
| maxInputTokens: 128e3, | ||
@@ -555,2 +717,20 @@ imageInputs: true, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-4": { | ||
| maxInputTokens: 8192, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 8192, | ||
| reasoningOutput: false, | ||
@@ -567,3 +747,3 @@ imageOutputs: false, | ||
| }, | ||
| "gpt-5": { | ||
| "gpt-5-nano": { | ||
| maxInputTokens: 4e5, | ||
@@ -586,9 +766,9 @@ imageInputs: true, | ||
| }, | ||
| "gpt-5-pro": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| "o1-mini": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 272e3, | ||
| maxOutputTokens: 65536, | ||
| reasoningOutput: true, | ||
@@ -598,2 +778,20 @@ imageOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-4o": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
@@ -600,0 +798,0 @@ structuredOutput: true, |
+290
-92
| //#region src/chat_models/profiles.ts | ||
| const PROFILES = { | ||
| "gpt-4.1-nano": { | ||
| maxInputTokens: 1047576, | ||
| "gpt-4o-2024-11-20": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: true, | ||
@@ -9,3 +9,3 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 32768, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
@@ -22,4 +22,76 @@ imageOutputs: false, | ||
| }, | ||
| "text-embedding-3-small": { | ||
| maxInputTokens: 8191, | ||
| "gpt-5.3-codex": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-5-codex": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-5-pro": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 272e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-4o-mini": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "text-embedding-ada-002": { | ||
| maxInputTokens: 8192, | ||
| imageInputs: false, | ||
@@ -41,4 +113,22 @@ audioInputs: false, | ||
| }, | ||
| "gpt-4": { | ||
| maxInputTokens: 8192, | ||
| "gpt-5-chat-latest": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "codex-mini-latest": { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: false, | ||
@@ -48,4 +138,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 8192, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -61,4 +151,4 @@ audioOutputs: false, | ||
| }, | ||
| "o1-pro": { | ||
| maxInputTokens: 2e5, | ||
| "gpt-5.1-codex-max": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
@@ -68,3 +158,3 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 1e5, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
@@ -99,3 +189,3 @@ imageOutputs: false, | ||
| }, | ||
| "gpt-4o-2024-08-06": { | ||
| "gpt-5.2-chat-latest": { | ||
| maxInputTokens: 128e3, | ||
@@ -107,3 +197,3 @@ imageInputs: true, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -119,4 +209,4 @@ audioOutputs: false, | ||
| }, | ||
| "gpt-4.1-mini": { | ||
| maxInputTokens: 1047576, | ||
| "gpt-5.2-codex": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
@@ -126,4 +216,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 32768, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -157,32 +247,32 @@ audioOutputs: false, | ||
| }, | ||
| "gpt-3.5-turbo": { | ||
| maxInputTokens: 16385, | ||
| imageInputs: false, | ||
| o1: { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 4096, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| structuredOutput: false, | ||
| imageUrlInputs: false, | ||
| pdfToolMessage: false, | ||
| imageToolMessage: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "text-embedding-3-large": { | ||
| maxInputTokens: 8191, | ||
| imageInputs: false, | ||
| "gpt-5.1": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 3072, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
@@ -194,4 +284,4 @@ imageUrlInputs: true, | ||
| }, | ||
| "gpt-4-turbo": { | ||
| maxInputTokens: 128e3, | ||
| "o4-mini-deep-research": { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: true, | ||
@@ -201,4 +291,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 4096, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -214,9 +304,9 @@ audioOutputs: false, | ||
| }, | ||
| "o1-preview": { | ||
| "gpt-5.3-codex-spark": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: false, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 32768, | ||
| maxOutputTokens: 32e3, | ||
| reasoningOutput: true, | ||
@@ -226,3 +316,3 @@ imageOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
@@ -234,5 +324,5 @@ imageUrlInputs: true, | ||
| }, | ||
| "o3-mini": { | ||
| o3: { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: false, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
@@ -253,4 +343,4 @@ pdfInputs: true, | ||
| }, | ||
| "codex-mini-latest": { | ||
| maxInputTokens: 2e5, | ||
| "text-embedding-3-small": { | ||
| maxInputTokens: 8191, | ||
| imageInputs: false, | ||
@@ -260,8 +350,8 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
| maxOutputTokens: 1536, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| toolCalling: false, | ||
| structuredOutput: true, | ||
@@ -273,4 +363,4 @@ imageUrlInputs: true, | ||
| }, | ||
| "gpt-5-nano": { | ||
| maxInputTokens: 4e5, | ||
| "gpt-4.1-nano": { | ||
| maxInputTokens: 1047576, | ||
| imageInputs: true, | ||
@@ -280,4 +370,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| maxOutputTokens: 32768, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
@@ -293,3 +383,39 @@ audioOutputs: false, | ||
| }, | ||
| "gpt-5-codex": { | ||
| "text-embedding-3-large": { | ||
| maxInputTokens: 8191, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 3072, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-3.5-turbo": { | ||
| maxInputTokens: 16385, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
| pdfInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 4096, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| structuredOutput: false, | ||
| imageUrlInputs: false, | ||
| pdfToolMessage: false, | ||
| imageToolMessage: false, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-5.1-codex-mini": { | ||
| maxInputTokens: 4e5, | ||
@@ -312,4 +438,4 @@ imageInputs: true, | ||
| }, | ||
| "gpt-4o": { | ||
| maxInputTokens: 128e3, | ||
| "gpt-5.2": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
@@ -319,4 +445,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -350,3 +476,3 @@ audioOutputs: false, | ||
| }, | ||
| "o4-mini": { | ||
| "o3-pro": { | ||
| maxInputTokens: 2e5, | ||
@@ -369,4 +495,4 @@ imageInputs: true, | ||
| }, | ||
| o1: { | ||
| maxInputTokens: 2e5, | ||
| "gpt-4-turbo": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: true, | ||
@@ -376,4 +502,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
| maxOutputTokens: 4096, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
@@ -389,3 +515,3 @@ audioOutputs: false, | ||
| }, | ||
| "gpt-5-mini": { | ||
| "gpt-5": { | ||
| maxInputTokens: 4e5, | ||
@@ -408,9 +534,9 @@ imageInputs: true, | ||
| }, | ||
| "o1-mini": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: false, | ||
| "o4-mini": { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 65536, | ||
| maxOutputTokens: 1e5, | ||
| reasoningOutput: true, | ||
@@ -420,3 +546,3 @@ imageOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
@@ -428,9 +554,9 @@ imageUrlInputs: true, | ||
| }, | ||
| "text-embedding-ada-002": { | ||
| maxInputTokens: 8192, | ||
| imageInputs: false, | ||
| "gpt-4.1-mini": { | ||
| maxInputTokens: 1047576, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 1536, | ||
| maxOutputTokens: 32768, | ||
| reasoningOutput: false, | ||
@@ -440,2 +566,20 @@ imageOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "o1-preview": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 32768, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
@@ -448,3 +592,3 @@ structuredOutput: true, | ||
| }, | ||
| "o3-pro": { | ||
| "o1-pro": { | ||
| maxInputTokens: 2e5, | ||
@@ -467,4 +611,4 @@ imageInputs: true, | ||
| }, | ||
| "gpt-4o-2024-11-20": { | ||
| maxInputTokens: 128e3, | ||
| "gpt-5.1-codex": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
@@ -474,4 +618,4 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
@@ -487,4 +631,4 @@ audioOutputs: false, | ||
| }, | ||
| o3: { | ||
| maxInputTokens: 2e5, | ||
| "gpt-5.2-pro": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
@@ -494,3 +638,3 @@ audioInputs: false, | ||
| videoInputs: false, | ||
| maxOutputTokens: 1e5, | ||
| maxOutputTokens: 128e3, | ||
| reasoningOutput: true, | ||
@@ -507,5 +651,5 @@ imageOutputs: false, | ||
| }, | ||
| "o4-mini-deep-research": { | ||
| "o3-mini": { | ||
| maxInputTokens: 2e5, | ||
| imageInputs: true, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
@@ -526,3 +670,21 @@ pdfInputs: true, | ||
| }, | ||
| "gpt-5-chat-latest": { | ||
| "gpt-4o-2024-08-06": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-5-mini": { | ||
| maxInputTokens: 4e5, | ||
@@ -538,3 +700,3 @@ imageInputs: true, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
@@ -546,3 +708,3 @@ imageUrlInputs: true, | ||
| }, | ||
| "gpt-4o-mini": { | ||
| "gpt-5.1-chat-latest": { | ||
| maxInputTokens: 128e3, | ||
@@ -554,2 +716,20 @@ imageInputs: true, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: true, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-4": { | ||
| maxInputTokens: 8192, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 8192, | ||
| reasoningOutput: false, | ||
@@ -566,3 +746,3 @@ imageOutputs: false, | ||
| }, | ||
| "gpt-5": { | ||
| "gpt-5-nano": { | ||
| maxInputTokens: 4e5, | ||
@@ -585,9 +765,9 @@ imageInputs: true, | ||
| }, | ||
| "gpt-5-pro": { | ||
| maxInputTokens: 4e5, | ||
| imageInputs: true, | ||
| "o1-mini": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: false, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 272e3, | ||
| maxOutputTokens: 65536, | ||
| reasoningOutput: true, | ||
@@ -597,2 +777,20 @@ imageOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: false, | ||
| structuredOutput: true, | ||
| imageUrlInputs: true, | ||
| pdfToolMessage: true, | ||
| imageToolMessage: true, | ||
| toolChoice: true | ||
| }, | ||
| "gpt-4o": { | ||
| maxInputTokens: 128e3, | ||
| imageInputs: true, | ||
| audioInputs: false, | ||
| pdfInputs: true, | ||
| videoInputs: false, | ||
| maxOutputTokens: 16384, | ||
| reasoningOutput: false, | ||
| imageOutputs: false, | ||
| audioOutputs: false, | ||
| videoOutputs: false, | ||
| toolCalling: true, | ||
@@ -599,0 +797,0 @@ structuredOutput: true, |
@@ -6,3 +6,3 @@ const require_errors = require('./errors.cjs'); | ||
| //#region src/utils/client.ts | ||
| function _isContextOverflowError(e) { | ||
| function _isOpenAIContextOverflowError(e) { | ||
| if (String(e).includes("context_length_exceeded")) return true; | ||
@@ -21,3 +21,3 @@ if ("message" in e && typeof e.message === "string" && (e.message.includes("Input tokens exceed the configured limit") || e.message.includes("exceeds the context window"))) return true; | ||
| error.name = "AbortError"; | ||
| } else if (_isContextOverflowError(e)) error = new _langchain_core_errors.ContextOverflowError("message" in e && typeof e.message === "string" ? e.message : String(e), { cause: e }); | ||
| } else if (_isOpenAIContextOverflowError(e)) error = _langchain_core_errors.ContextOverflowError.fromError(e); | ||
| else if ("status" in e && e.status === 400 && "message" in e && typeof e.message === "string" && e.message.includes("tool_calls")) error = require_errors.addLangChainErrorFields(e, "INVALID_TOOL_RESULTS"); | ||
@@ -24,0 +24,0 @@ else if ("status" in e && e.status === 401) error = require_errors.addLangChainErrorFields(e, "MODEL_AUTHENTICATION"); |
@@ -6,3 +6,3 @@ import { addLangChainErrorFields } from "./errors.js"; | ||
| //#region src/utils/client.ts | ||
| function _isContextOverflowError(e) { | ||
| function _isOpenAIContextOverflowError(e) { | ||
| if (String(e).includes("context_length_exceeded")) return true; | ||
@@ -21,3 +21,3 @@ if ("message" in e && typeof e.message === "string" && (e.message.includes("Input tokens exceed the configured limit") || e.message.includes("exceeds the context window"))) return true; | ||
| error.name = "AbortError"; | ||
| } else if (_isContextOverflowError(e)) error = new ContextOverflowError("message" in e && typeof e.message === "string" ? e.message : String(e), { cause: e }); | ||
| } else if (_isOpenAIContextOverflowError(e)) error = ContextOverflowError.fromError(e); | ||
| else if ("status" in e && e.status === 400 && "message" in e && typeof e.message === "string" && e.message.includes("tool_calls")) error = addLangChainErrorFields(e, "INVALID_TOOL_RESULTS"); | ||
@@ -24,0 +24,0 @@ else if ("status" in e && e.status === 401) error = addLangChainErrorFields(e, "MODEL_AUTHENTICATION"); |
+5
-5
| { | ||
| "name": "@langchain/openai", | ||
| "version": "1.2.8-dev-1771365493298", | ||
| "version": "1.2.8", | ||
| "description": "OpenAI integrations for LangChain.js", | ||
@@ -22,3 +22,3 @@ "author": "LangChain", | ||
| "peerDependencies": { | ||
| "@langchain/core": "1.1.25-dev-1771365493298" | ||
| "@langchain/core": "^1.0.0" | ||
| }, | ||
@@ -40,6 +40,6 @@ "devDependencies": { | ||
| "zod-to-json-schema": "^3.24.6", | ||
| "@langchain/core": "^1.1.25", | ||
| "@langchain/standard-tests": "0.0.23", | ||
| "@langchain/eslint": "0.1.1", | ||
| "@langchain/standard-tests": "0.0.23", | ||
| "@langchain/tsconfig": "0.0.1", | ||
| "@langchain/core": "^1.1.25-dev-1771365493298" | ||
| "@langchain/tsconfig": "0.0.1" | ||
| }, | ||
@@ -46,0 +46,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1856580
1.31%19097
2.12%1
-50%