# LangChain JS + OpenAI Responses API: stateless GPT-5 reasoning messages cause \`400 …reasoning without its required following item\`

**URL:** <https://forum.langchain.com/t/langchain-js-openai-responses-api-stateless-gpt-5-reasoning-messages-cause-400-reasoning-without-its-required-following-item/1688>\
**Category:** LangChain\
**Tags:** js-help\
**Created:** [September 29, 2025, 4:33pm UTC](https://forum.langchain.com/t/langchain-js-openai-responses-api-stateless-gpt-5-reasoning-messages-cause-400-reasoning-without-its-required-following-item/1688 "2025-09-29T16:33:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![niccotnt](https://avatars.discourse-cdn.com/v4/letter/n/58956e/32.png) [@niccotnt](https://forum.langchain.com/u/niccotnt)\
**Post date:** [September 29, 2025, 4:33pm UTC](https://forum.langchain.com/t/langchain-js-openai-responses-api-stateless-gpt-5-reasoning-messages-cause-400-reasoning-without-its-required-following-item/1688/1 "2025-09-29T16:33:03Z")

</div>

Hello everybody,

I’m trying to figure out how to implement a **stateless** interaction with a GPT-5 model, with reasoning.  
This is my very basic code snippet, where I force the model to reason and call a tool.

```ts
// ...imports

const tools: DynamicStructuredTool[] = [...];

// Instantiate the model
let runnable: Runnable = new ChatOpenAI({
	modelName: "gpt-5-2025-08-07",
    temperature: 1,
    openAIApiKey: " ****",
    streaming: false,
    useResponsesApi: true
}).bindTools(tools);

const messages: BaseMessage[] = [
	new SystemMessage(" *****"),
	new HumanMessage(" *****")
];
const callOptions = {};

let response: BaseMessage = await runnable.invoke(messages, callOptions);
if ("tool_calls" in response && Array.isArray(response.tool_calls) && response.tool_calls.length > 0) {
	const toolResults = [];
	for (const toolCall of response.tool_calls) {
		const { name, args } = toolCall;
		const tool = tools.find(t => t.name === name);
		let output = await tool.func(args);
		const toolMessageOutput: ToolMessageFieldsWithToolCallId = {
			tool_call_id: toolCall.id,
			content: typeof output === "string" ? output : JSON.stringify(output),
		};
		toolResults.push(new ToolMessage(toolMessageOutput));	
	}
	messages.push(response, ...toolResults);
} 

response = await runnable.invoke(messages, callOptions);

```

.. and the last invoke call throws an error:

```auto
BadRequestError: 400 Item 'rs_68daad45e5d8819592cbd2a8230ec4df019eeee1dd56aefc' of type 'reasoning' was provided without its required following item.
    at Function.generate (C:\ **** \node-projects\bookmaster\node_modules\openai\src\core\error.ts:72:14)        
    at OpenAI.makeStatusError (C:\ **** \node-projects\bookmaster\node_modules\openai\src\client.ts:445:28)      
    at OpenAI.makeRequest (C:\ **** \node-projects\bookmaster\node_modules\openai\src\client.ts:668:24)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async C:\ **** \node-projects\bookmaster\node_modules\@langchain\openai\dist\chat_models.cjs:1202:24      
    at async RetryOperation._fn (C:\ **** \node-projects\bookmaster\node_modules\p-retry\index.js:50:12) {       
  status: 400,
  headers: { ... },
  requestID: 'req_4a8f20b187070e4ea9218ca13f0ff645',
  error: {
    message: "Item 'rs_68daad45e5d8819592cbd2a8230ec4df019eeee1dd56aefc' of type 'reasoning' was provided without its required following item.",
    type: 'invalid_request_error',
    param: 'input',
    code: null
  },
  code: null,
  param: 'input',
  type: 'invalid_request_error',
  attemptNumber: 1,
  retriesLeft: 6
}

```

From what I understand, I need to resend the `reasoning` type message (like an echo), but LangChain does not provide a `ReasoningMessage extends BaseMessage` type to insert into the conversation.  
How can I do this?

Here is the full stateless conversation I get:

**First interaction:**

```json
[
  SystemMessage {
    "content": " *****",
    "additional_kwargs": {},
    "response_metadata": {}
  },
  HumanMessage {
    "content": [
      { "type": "text", "text": " *****" }
    ],
    "additional_kwargs": {},
    "response_metadata": {}
  }
]

```

**First Model response:**

```json
  AIMessage {
    "content": [],
    "additional_kwargs": {
      "reasoning": {
        "id": "rs_68daad45e5d8819592cbd2a8230ec4df019eeee1dd56aefc",
        "type": "reasoning",
        "summary": []
      },
      " __openai_function_call_ids__": {
        "call_vfJ1fZdxk8IhTRCjYnf0b3le": "fc_68daad7cad408195868dfdaf75c0b158019eeee1dd56aefc"
      }
    },
    "response_metadata": {
      "id": "resp_68daad453f6081959038cc97fb020159019eeee1dd56aefc",
      "estimatedTokenUsage": {
        "promptTokens": 1348,
        "completionTokens": 3610,
        "totalTokens": 4958
      },
      "model": "gpt-5-2025-08-07",
      "created_at": 1759161669,
      "incomplete_details": null,
      "metadata": {},
      "object": "response",
      "status": "completed",
      "user": null,
      "service_tier": "default",
      "model_name": "gpt-5-2025-08-07"
    },
    "tool_calls": [
      {
        "name": " ******",
        "args": { ... },
        "type": "tool_call",
        "id": "call_vfJ1fZdxk8IhTRCjYnf0b3le"
      }
    ],
    "invalid_tool_calls": [],
    "usage_metadata": {
      "input_tokens": 1348,
      "input_tokens_details": {
        "cached_tokens": 0
      },
      "output_tokens": 3610,
      "output_tokens_details": {
        "reasoning_tokens": 3584
      },
      "total_tokens": 4958
    }
  }

```

* * *

**Then I call again the invoke method with the following messages:**

```json
[
  SystemMessage { ... as before ... },
  HumanMessage { ... as before ... },
  AIMessage { ... as before ... },
  ToolMessage {
    "content": "{\"success\":true,\"message\":\" ***** \"}",
    "additional_kwargs": {},
    "response_metadata": {},
    "tool_call_id": "call_vfJ1fZdxk8IhTRCjYnf0b3le"
  }
]

```

Here I get the error:

```auto
BadRequestError: 400 Item 'rs_ *****' of type 'reasoning' was provided without its required following item.

```

Please note that with gpt-4o the interaction works perfectly.

---

<div class="post-metadata">

**Author:** ![pawel-twardziak](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/pawel-twardziak/32/960_2.png) [@pawel-twardziak](https://forum.langchain.com/u/pawel-twardziak)\
**Post date:** [September 29, 2025, 9:30pm UTC](https://forum.langchain.com/t/langchain-js-openai-responses-api-stateless-gpt-5-reasoning-messages-cause-400-reasoning-without-its-required-following-item/1688/2 "2025-09-29T21:30:15Z")

</div>

Hi @niccotnt

interesting issue… Have you tried setting `useResponsesApi: false` for GPT-5?

---

<div class="post-metadata">

**Author:** ![pawel-twardziak](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/pawel-twardziak/32/960_2.png) [@pawel-twardziak](https://forum.langchain.com/u/pawel-twardziak)\
**Post date:** [September 29, 2025, 9:41pm UTC](https://forum.langchain.com/t/langchain-js-openai-responses-api-stateless-gpt-5-reasoning-messages-cause-400-reasoning-without-its-required-following-item/1688/3 "2025-09-29T21:41:13Z")

</div>

Anyway, maybe this would help:

```js
function sanitizeAssistantForResponsesApi(ai: AIMessage): AIMessage {
  const additional = { ...(ai.additional_kwargs ?? {}) } as Record<string, unknown>;
  // 'reasoning' is output-only in the Responses API; never send it back in input
  if ("reasoning" in additional) delete additional.reasoning;
  return new AIMessage({
    content: ai.content,
    tool_calls: ai.tool_calls ?? [],
    additional_kwargs: additional,
  });
}

// ...

if ("tool_calls" in response && Array.isArray(response.tool_calls) && response.tool_calls.length > 0) {
  // ...

  // IMPORTANT: push a sanitized copy of the assistant message (no 'reasoning')
  messages.push(sanitizeAssistantForResponsesApi(response as AIMessage), ...toolResults);
}

```

Let me know whether or not this helps 🙂

---

<div class="post-metadata">

**Author:** ![hntrl](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@hntrl](https://forum.langchain.com/u/hntrl)\
**Post date:** [September 29, 2025, 9:47pm UTC](https://forum.langchain.com/t/langchain-js-openai-responses-api-stateless-gpt-5-reasoning-messages-cause-400-reasoning-without-its-required-following-item/1688/4 "2025-09-29T21:47:35Z")

</div>

Hey @niccotnt, thanks for flagging this. Would you mind opening an issue on the [langchainjs](https://github.com/langchain-ai/langchainjs/issues/new/choose) repo?

@pawel-twardziak‘s solution does resolve the error, but dropping the reasoning content is definitely not desired. The sequencing for reasoning items is important as the error mentioned, however I think it might be an exclusive behavior of gpt-5 that reasoning items can exist for tool calls (which isn’t something that I’ve seen before)

---

<div class="post-metadata">

**Author:** ![niccotnt](https://avatars.discourse-cdn.com/v4/letter/n/58956e/32.png) [@niccotnt](https://forum.langchain.com/u/niccotnt)\
**Post date:** [September 30, 2025, 10:57am UTC](https://forum.langchain.com/t/langchain-js-openai-responses-api-stateless-gpt-5-reasoning-messages-cause-400-reasoning-without-its-required-following-item/1688/5 "2025-09-30T10:57:47Z")

</div>

Thank you @hntrl and @pawel-twardziak for your reply.

If I remove the reasoning item from additional\_kwargs it works, but continuing the interaction, at some point I receive:

```auto
BadRequestError: 400 Item 'msg_0bf77cc637a35af90068dbb4da9dfc8195a981bc6cb8fc4361' of type 'message' was provided without its required 'reasoning' item: 'rs_0bf77cc637a35af90068dbb4c69b8c8195929f8311e89903fb'.
    at Function.generate (C:\ **** \node-projects\bookmaster\node_modules\openai\src\core\error.ts:72:14)        
    at OpenAI.makeStatusError (C:\ **** \node-projects\bookmaster\node_modules\openai\src\client.ts:445:28)      
    at OpenAI.makeRequest (C:\ **** \node-projects\bookmaster\node_modules\openai\src\client.ts:668:24)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async C:\ **** \node-projects\bookmaster\node_modules\@langchain\openai\dist\chat_models.cjs:1202:24      
    at async RetryOperation._fn (C:\ **** \node-projects\bookmaster\node_modules\p-retry\index.js:50:12) {       
  status: 400,
  headers: Headers { ... }

```

I think the reasoning items must be expected for every message and they can occur everywhere, with or without tool\_calls, and they must be handled correctly.

I will open an issue as suggested by @hntrl .

Thanks

---

<div class="post-metadata">

**Author:** ![niccotnt](https://avatars.discourse-cdn.com/v4/letter/n/58956e/32.png) [@niccotnt](https://forum.langchain.com/u/niccotnt)\
**Post date:** [September 30, 2025, 1:22pm UTC](https://forum.langchain.com/t/langchain-js-openai-responses-api-stateless-gpt-5-reasoning-messages-cause-400-reasoning-without-its-required-following-item/1688/6 "2025-09-30T13:22:39Z")

</div>

Bug opened here

> <https://github.com/langchain-ai/langchainjs/issues/9072>
>
> \### Checked other resources
> 
> \- \[x\] This is a bug, not a usage question. For ques…tions, please use the LangChain Forum (https://forum.langchain.com/).
> \- \[x\] I added a very descriptive title to this issue.
> \- \[x\] I searched the LangChain.js documentation with the integrated search.
> \- \[x\] I used the GitHub search to find a similar question and didn't find it.
> \- \[x\] I am sure that this is a bug in LangChain.js rather than my code.
> \- \[x\] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
> 
> \### Example Code
> 
> \`\`\`typescript
> // ...imports
> 
> const tools: DynamicStructuredTool\[\] = \[... \];
> 
> // Instantiate the model
> let runnable: Runnable = new ChatOpenAI({
> modelName: "gpt-5-2025-08-07",
> temperature: 1,
> openAIApiKey: "\*\*\*\*",
> streaming: false,
> useResponsesApi: true
> }).bindTools(tools);
> 
> const messages: BaseMessage\[\] = \[
> new SystemMessage("\*\*\*\*\*"),
> new HumanMessage("\*\*\*\*\*")
> \];
> const callOptions = {};
> 
> let response: BaseMessage = await runnable.invoke(messages, callOptions);
> if ("tool\_calls" in response && Array.isArray(response.tool\_calls) && response.tool\_calls.length \> 0) {
> const toolResults = \[\];
> for (const toolCall of response.tool\_calls) {
> const { name, args } = toolCall;
> const tool = tools.find(t =\> t.name === name);
> let output = await tool.func(args);
> const toolMessageOutput: ToolMessageFieldsWithToolCallId = {
> tool\_call\_id: toolCall.id,
> content: typeof output === "string" ? output : JSON.stringify(output),
> };
> toolResults.push(new ToolMessage(toolMessageOutput));	
> }
> messages.push(response, ...toolResults);
> } 
> 
> response = await runnable.invoke(messages, callOptions);
> \`\`\`
> 
> \### Error Message and Stack Trace (if applicable)
> 
> \`\`\`
> BadRequestError: 400 Item 'rs\_68daad45e5d8819592cbd2a8230ec4df019eeee1dd56aefc' of type 'reasoning' was provided without its required following item.
> at Function.generate (C:\\\*\*\*\*\\node-projects\\bookmaster\\node\_modules\\openai\\src\\core\\error.ts:72:14)        
> at OpenAI.makeStatusError (C:\\\*\*\*\*\\node-projects\\bookmaster\\node\_modules\\openai\\src\\client.ts:445:28)      
> at OpenAI.makeRequest (C:\\\*\*\*\*\\node-projects\\bookmaster\\node\_modules\\openai\\src\\client.ts:668:24)
> at processTicksAndRejections (node:internal/process/task\_queues:105:5)
> at async C:\\\*\*\*\*\\node-projects\\bookmaster\\node\_modules\\@langchain\\openai\\dist\\chat\_models.cjs:1202:24      
> at async RetryOperation.\_fn (C:\\\*\*\*\*\\node-projects\\bookmaster\\node\_modules\\p-retry\\index.js:50:12) {       
> status: 400,
> headers: { ... },
> requestID: 'req\_4a8f20b187070e4ea9218ca13f0ff645',
> error: {
> message: "Item 'rs\_68daad45e5d8819592cbd2a8230ec4df019eeee1dd56aefc' of type 'reasoning' was provided without its required following item.",
> type: 'invalid\_request\_error',
> param: 'input',
> code: null
> },
> code: null,
> param: 'input',
> type: 'invalid\_request\_error',
> attemptNumber: 1,
> retriesLeft: 6
> }
> \`\`\`
> 
> \### Description
> 
> I’m trying to figure out how to implement a stateless interaction with a GPT-5 model, with reasoning.
> I'm forcing the model, with a complex prompt, to reason and call a tool.
> I attached a snippet of the code for the most basic interaction I'm trying to achieve.
> 
> I can see the AIMessage contains both tool\_calls and reasoing item (stored in additional\_kwargs), but when I send back the AIMessage and the ToolMessage with outputs I receive the error I attached.
> 
> Please see the full thread with more examples and more errors in the official forum:
> https://forum.langchain.com/t/langchain-js-openai-responses-api-stateless-gpt-5-reasoning-messages-cause-400-reasoning-without-its-required-following-item/1688
> 
> 
> 
> \### System Info
> 
> \`\`\`
> yarn info v1.22.22
> {
> name: 'langchain',
> 'dist-tags': {
> 'tag-for-publishing-older-releases': '0.2.20',
> latest: '0.3.35',
> alpha: '1.0.0-alpha.7',
> next: '1.0.0-alpha.7'
> },
> versions: \[
> '0.0.4',
> '0.0.5',
> '0.0.6',
> '0.0.7',
> '0.0.8',
> '0.0.9',
> '0.0.10',
> '0.0.11',
> '0.0.12',
> '0.0.13',
> '0.0.14',
> '0.0.15',
> '0.0.16',
> '0.0.17',
> '0.0.18',
> '0.0.19',
> '0.0.20',
> '0.0.21',
> '0.0.22',
> '0.0.23',
> '0.0.24',
> '0.0.25',
> '0.0.26',
> '0.0.27',
> '0.0.28',
> '0.0.29',
> '0.0.30',
> '0.0.31',
> '0.0.32',
> '0.0.33',
> '0.0.34',
> '0.0.35',
> '0.0.36',
> '0.0.37',
> '0.0.38',
> '0.0.39',
> '0.0.40',
> '0.0.41',
> '0.0.42',
> '0.0.43',
> '0.0.44',
> '0.0.45',
> '0.0.46',
> '0.0.47',
> '0.0.48',
> '0.0.49-0',
> '0.0.49-1',
> '0.0.49',
> '0.0.50',
> '0.0.51',
> '0.0.52-0',
> '0.0.52',
> '0.0.53',
> '0.0.54',
> '0.0.55',
> '0.0.56',
> '0.0.57',
> '0.0.58',
> '0.0.59',
> '0.0.60',
> '0.0.61',
> '0.0.62',
> '0.0.63',
> '0.0.64',
> '0.0.65',
> '0.0.66',
> '0.0.67',
> '0.0.68',
> '0.0.69',
> '0.0.70',
> '0.0.71',
> '0.0.72',
> '0.0.73',
> '0.0.74',
> '0.0.75',
> '0.0.76',
> '0.0.77',
> '0.0.78',
> '0.0.79',
> '0.0.80',
> '0.0.81',
> '0.0.82',
> '0.0.83',
> '0.0.84',
> '0.0.85',
> '0.0.86',
> '0.0.87',
> '0.0.88',
> '0.0.89',
> '0.0.90',
> '0.0.91',
> '0.0.92',
> '0.0.93',
> '0.0.94',
> '0.0.95',
> '0.0.96',
> '0.0.97',
> '0.0.98',
> '0.0.99',
> '0.0.100',
> '0.0.101',
> '0.0.102',
> '0.0.103',
> '0.0.104',
> '0.0.105',
> '0.0.106',
> '0.0.107',
> '0.0.108',
> '0.0.109',
> '0.0.110',
> '0.0.111',
> '0.0.112',
> '0.0.113',
> '0.0.114',
> '0.0.115',
> '0.0.116',
> '0.0.117',
> '0.0.118',
> '0.0.119',
> '0.0.120',
> '0.0.121',
> '0.0.122',
> '0.0.123',
> '0.0.124',
> '0.0.125',
> '0.0.126',
> '0.0.127',
> '0.0.128',
> '0.0.129',
> '0.0.130',
> '0.0.131',
> '0.0.132',
> '0.0.133',
> '0.0.134',
> '0.0.135',
> '0.0.136',
> '0.0.137',
> '0.0.138',
> '0.0.139',
> '0.0.140',
> '0.0.141',
> '0.0.142',
> '0.0.143',
> '0.0.144',
> '0.0.145',
> '0.0.146',
> '0.0.147',
> '0.0.148',
> '0.0.149',
> '0.0.150',
> '0.0.151',
> '0.0.152',
> '0.0.153',
> '0.0.154',
> '0.0.155',
> '0.0.156',
> '0.0.157',
> '0.0.158',
> '0.0.159',
> '0.0.160',
> '0.0.161',
> '0.0.162',
> '0.0.163',
> '0.0.164',
> '0.0.165',
> '0.0.166',
> '0.0.167',
> '0.0.168',
> '0.0.169',
> '0.0.170',
> '0.0.171',
> '0.0.172',
> '0.0.173',
> '0.0.174',
> '0.0.175',
> '0.0.176',
> '0.0.177',
> '0.0.178',
> '0.0.179',
> '0.0.180',
> '0.0.181',
> '0.0.182-rc.0',
> '0.0.182-rc.1',
> '0.0.182',
> '0.0.183',
> '0.0.184',
> '0.0.185',
> '0.0.186',
> '0.0.187',
> '0.0.188',
> '0.0.189',
> '0.0.190',
> '0.0.191',
> '0.0.192',
> '0.0.193',
> '0.0.194',
> '0.0.195',
> '0.0.196',
> '0.0.197-rc.0',
> '0.0.197-rc.1',
> '0.0.197',
> '0.0.198',
> '0.0.199',
> '0.0.200',
> '0.0.201',
> '0.0.202',
> '0.0.203',
> '0.0.204-rc.0',
> '0.0.204-rc.1',
> '0.0.204-rc.2',
> '0.0.204',
> '0.0.205',
> '0.0.206',
> '0.0.207',
> '0.0.208',
> '0.0.209-rc.0',
> '0.0.209',
> '0.0.210',
> '0.0.211',
> '0.0.212',
> '0.0.213',
> '0.0.214',
> '0.1.0-rc.0',
> '0.1.0-rc.1',
> '0.1.0',
> '0.1.1',
> '0.1.2',
> '0.1.3',
> '0.1.4',
> '0.1.5',
> '0.1.6',
> '0.1.7',
> '0.1.8',
> '0.1.9-rc.0',
> '0.1.9',
> '0.1.10',
> '0.1.11',
> '0.1.12',
> '0.1.13',
> '0.1.14',
> '0.1.15',
> '0.1.16-rc.0',
> '0.1.16',
> '0.1.17',
> '0.1.18',
> '0.1.19-rc.0',
> '0.1.19-rc.1',
> '0.1.19-rc.2',
> '0.1.19',
> '0.1.20',
> '0.1.21',
> '0.1.22',
> '0.1.23',
> '0.1.24',
> '0.1.25',
> '0.1.26',
> '0.1.27',
> '0.1.28',
> '0.1.29-rc.0',
> '0.1.29',
> '0.1.30',
> '0.1.31',
> '0.1.32',
> '0.1.33',
> '0.1.34',
> '0.1.35',
> '0.1.36',
> '0.1.37',
> '0.2.0-rc.0',
> '0.2.0-rc.1',
> '0.2.0',
> '0.2.1',
> '0.2.2',
> '0.2.3-rc.0',
> '0.2.3',
> '0.2.4',
> '0.2.5',
> '0.2.6',
> '0.2.7',
> '0.2.8',
> '0.2.9',
> '0.2.10',
> '0.2.11',
> '0.2.12',
> '0.2.13',
> '0.2.14',
> '0.2.15',
> '0.2.16',
> '0.2.17',
> '0.2.18',
> '0.2.19',
> '0.2.20',
> '0.3.0-rc.0',
> '0.3.0',
> '0.3.1',
> '0.3.2-rc.0',
> '0.3.2',
> '0.3.3',
> '0.3.4',
> '0.3.5',
> '0.3.6',
> '0.3.7',
> '0.3.8',
> '0.3.9',
> '0.3.10',
> '0.3.11',
> '0.3.12',
> '0.3.13',
> '0.3.14',
> '0.3.15',
> '0.3.16',
> '0.3.17',
> '0.3.18',
> '0.3.19',
> '0.3.20',
> '0.3.21',
> '0.3.22',
> '0.3.23',
> '0.3.24',
> '0.3.25',
> '0.3.26',
> '0.3.27',
> '0.3.28',
> '0.3.29',
> '0.3.30',
> '0.3.31',
> '0.3.32',
> '0.3.33',
> '0.3.34',
> '0.3.35',
> '1.0.0-alpha.1',
> '1.0.0-alpha.2',
> '1.0.0-alpha.3',
> '1.0.0-alpha.4',
> '1.0.0-alpha.5',
> '1.0.0-alpha.6',
> '1.0.0-alpha.7'
> \],
> time: {
> created: '2023-02-14T18:06:57.074Z',
> modified: '2025-09-29T16:26:40.407Z',
> '1.0.0': '2023-01-20T03:45:29.634Z',
> '1.0.9': '2023-01-22T02:02:57.467Z',
> '0.0.1': '2023-01-26T21:22:58.657Z',
> '0.0.4': '2023-02-14T18:06:57.434Z',
> '0.0.5': '2023-02-17T05:51:37.227Z',
> '0.0.6': '2023-02-17T08:53:32.946Z',
> '0.0.7': '2023-02-18T00:31:00.386Z',
> '0.0.8': '2023-02-20T04:56:45.683Z',
> '0.0.9': '2023-02-21T07:17:14.208Z',
> '0.0.10': '2023-02-22T18:48:35.631Z',
> '0.0.11': '2023-02-23T16:12:41.455Z',
> '0.0.12': '2023-02-26T18:49:26.071Z',
> '0.0.13': '2023-02-27T16:03:50.432Z',
> '0.0.14': '2023-02-27T16:59:17.082Z',
> '0.0.15': '2023-02-27T17:59:53.741Z',
> '0.0.16': '2023-02-28T16:41:21.705Z',
> '0.0.17': '2023-03-01T15:28:09.338Z',
> '0.0.18': '2023-03-01T20:00:24.554Z',
> '0.0.19': '2023-03-01T20:58:49.811Z',
> '0.0.20': '2023-03-02T17:11:30.882Z',
> '0.0.21': '2023-03-03T19:23:04.354Z',
> '0.0.22': '2023-03-04T16:00:04.873Z',
> '0.0.23': '2023-03-06T16:42:44.996Z',
> '0.0.24': '2023-03-07T18:10:28.933Z',
> '0.0.25': '2023-03-08T17:42:24.706Z',
> '0.0.26': '2023-03-09T19:36:23.799Z',
> '0.0.27': '2023-03-10T16:24:31.279Z',
> '0.0.28': '2023-03-11T19:41:29.182Z',
> '0.0.29': '2023-03-12T07:41:25.588Z',
> '0.0.30': '2023-03-13T19:27:19.085Z',
> '0.0.31': '2023-03-13T22:48:33.902Z',
> '0.0.32': '2023-03-14T08:48:30.479Z',
> '0.0.33': '2023-03-14T18:36:54.970Z',
> '0.0.34': '2023-03-15T18:20:43.233Z',
> '0.0.35': '2023-03-15T18:59:13.048Z',
> '0.0.36': '2023-03-17T18:55:33.715Z',
> '0.0.37': '2023-03-20T20:10:36.444Z',
> '0.0.38': '2023-03-21T18:31:14.819Z',
> '0.0.39': '2023-03-22T15:47:46.529Z',
> '0.0.40': '2023-03-24T15:13:53.947Z',
> '0.0.41': '2023-03-24T19:33:29.565Z',
> '0.0.42': '2023-03-27T18:47:07.410Z',
> '0.0.43': '2023-03-28T18:43:21.068Z',
> '0.0.44': '2023-03-29T18:45:08.636Z',
> '0.0.45': '2023-03-31T15:55:26.705Z',
> '0.0.46': '2023-04-03T15:46:07.061Z',
> '0.0.47': '2023-04-03T15:55:06.384Z',
> '0.0.48': '2023-04-04T17:25:41.531Z',
> '0.0.49-0': '2023-04-05T12:56:44.659Z',
> '0.0.49-1': '2023-04-05T13:07:31.197Z',
> '0.0.49': '2023-04-06T10:31:23.786Z',
> '0.0.50': '2023-04-07T21:46:20.961Z',
> '0.0.51': '2023-04-08T17:07:19.121Z',
> '0.0.52-0': '2023-04-09T17:48:55.378Z',
> '0.0.52': '2023-04-10T18:57:02.678Z',
> '0.0.53': '2023-04-11T15:51:36.258Z',
> '0.0.54': '2023-04-12T16:59:09.975Z',
> '0.0.55': '2023-04-13T16:22:58.352Z',
> '0.0.56': '2023-04-14T17:47:49.152Z',
> '0.0.57': '2023-04-17T17:01:13.362Z',
> '0.0.58': '2023-04-18T18:51:48.339Z',
> '0.0.59': '2023-04-18T20:23:09.912Z',
> '0.0.60': '2023-04-21T18:45:14.498Z',
> '0.0.61': '2023-04-21T20:58:46.669Z',
> '0.0.62': '2023-04-22T20:27:37.499Z',
> '0.0.63': '2023-04-23T15:27:57.932Z',
> '0.0.64': '2023-04-25T15:58:01.314Z',
> '0.0.65': '2023-04-28T11:29:13.611Z',
> '0.0.66': '2023-04-28T12:48:12.798Z',
> '0.0.67': '2023-05-01T14:55:22.206Z',
> '0.0.68': '2023-05-02T19:51:47.329Z',
> '0.0.69': '2023-05-04T17:35:32.223Z',
> '0.0.70': '2023-05-05T16:40:01.904Z',
> '0.0.71': '2023-05-06T15:19:04.361Z',
> '0.0.72': '2023-05-08T07:03:31.569Z',
> '0.0.73': '2023-05-09T18:50:58.586Z',
> '0.0.74': '2023-05-10T15:50:49.597Z',
> '0.0.75': '2023-05-11T18:54:42.166Z',
> '0.0.76': '2023-05-17T19:35:53.355Z',
> '0.0.77': '2023-05-18T15:25:50.965Z',
> '0.0.78': '2023-05-19T15:18:20.002Z',
> '0.0.79': '2023-05-23T16:30:38.510Z',
> '0.0.80': '2023-05-23T18:18:28.751Z',
> '0.0.81': '2023-05-23T18:57:35.910Z',
> '0.0.82': '2023-05-25T00:15:56.768Z',
> '0.0.83': '2023-05-25T16:48:27.312Z',
> '0.0.84': '2023-05-26T20:43:14.443Z',
> '0.0.85': '2023-05-30T19:31:33.866Z',
> '0.0.86': '2023-05-30T23:26:55.520Z',
> '0.0.87': '2023-05-31T15:23:33.608Z',
> '0.0.88': '2023-06-01T02:10:23.366Z',
> '0.0.89': '2023-06-02T16:10:24.873Z',
> '0.0.90': '2023-06-03T01:29:12.535Z',
> '0.0.91': '2023-06-04T23:00:33.336Z',
> '0.0.92': '2023-06-07T20:40:58.171Z',
> '0.0.93': '2023-06-13T17:32:25.870Z',
> '0.0.94': '2023-06-13T21:41:36.359Z',
> '0.0.95': '2023-06-14T14:25:53.017Z',
> '0.0.96': '2023-06-19T18:24:31.016Z',
> '0.0.97': '2023-06-26T20:08:09.043Z',
> '0.0.98': '2023-06-28T05:15:53.569Z',
> '0.0.99': '2023-06-29T10:00:34.210Z',
> '0.0.100': '2023-06-29T16:19:24.235Z',
> '0.0.101': '2023-06-30T19:51:23.760Z',
> '0.0.102': '2023-07-01T19:12:19.594Z',
> '0.0.103': '2023-07-05T23:21:04.630Z',
> '0.0.104': '2023-07-07T01:35:39.991Z',
> '0.0.105': '2023-07-09T00:55:47.724Z',
> '0.0.106': '2023-07-10T17:32:39.936Z',
> '0.0.107': '2023-07-12T06:09:52.155Z',
> '0.0.108': '2023-07-13T02:24:55.332Z',
> '0.0.109': '2023-07-14T01:37:31.791Z',
> '0.0.110': '2023-07-15T17:39:11.281Z',
> '0.0.111': '2023-07-18T04:22:39.858Z',
> '0.0.112': '2023-07-18T18:22:02.588Z',
> '0.0.113': '2023-07-19T23:56:22.261Z',
> '0.0.114': '2023-07-21T03:00:26.247Z',
> '0.0.115': '2023-07-24T01:01:00.307Z',
> '0.0.116': '2023-07-24T05:19:14.838Z',
> '0.0.117': '2023-07-25T00:26:59.388Z',
> '0.0.118': '2023-07-26T16:09:04.672Z',
> '0.0.119': '2023-07-28T22:08:02.687Z',
> '0.0.120': '2023-07-30T17:08:46.417Z',
> '0.0.121': '2023-08-01T21:15:07.740Z',
> '0.0.122': '2023-08-03T03:25:11.530Z',
> '0.0.123': '2023-08-05T06:09:18.474Z',
> '0.0.124': '2023-08-07T05:38:39.271Z',
> '0.0.125': '2023-08-09T03:48:44.885Z',
> '0.0.126': '2023-08-11T01:19:19.011Z',
> '0.0.127': '2023-08-12T01:03:28.743Z',
> '0.0.128': '2023-08-15T06:55:07.574Z',
> '0.0.129': '2023-08-16T02:39:45.923Z',
> '0.0.130': '2023-08-18T01:17:54.954Z',
> '0.0.131': '2023-08-19T00:48:09.017Z',
> '0.0.132': '2023-08-21T23:24:17.628Z',
> '0.0.133': '2023-08-24T02:13:40.841Z',
> '0.0.134': '2023-08-25T04:45:19.565Z',
> '0.0.135': '2023-08-26T00:44:11.083Z',
> '0.0.136': '2023-08-29T01:36:44.900Z',
> '0.0.137': '2023-08-30T01:34:15.475Z',
> '0.0.138': '2023-08-31T02:22:36.630Z',
> '0.0.139': '2023-09-01T07:20:17.993Z',
> '0.0.140': '2023-09-02T00:37:02.261Z',
> '0.0.141': '2023-09-03T07:34:21.546Z',
> '0.0.142': '2023-09-04T20:15:53.914Z',
> '0.0.143': '2023-09-05T14:41:59.202Z',
> '0.0.144': '2023-09-06T01:21:44.338Z',
> '0.0.145': '2023-09-07T01:35:35.892Z',
> '0.0.146': '2023-09-08T15:27:22.355Z',
> '0.0.147': '2023-09-12T06:22:04.926Z',
> '0.0.148': '2023-09-13T03:03:39.760Z',
> '0.0.149': '2023-09-14T01:40:17.567Z',
> '0.0.150': '2023-09-15T06:28:14.560Z',
> '0.0.151': '2023-09-19T03:53:15.800Z',
> '0.0.152': '2023-09-20T00:08:57.506Z',
> '0.0.153': '2023-09-21T03:10:39.410Z',
> '0.0.154': '2023-09-26T01:47:45.016Z',
> '0.0.155': '2023-09-28T01:35:14.504Z',
> '0.0.156': '2023-09-29T05:55:44.312Z',
> '0.0.157': '2023-10-02T01:10:49.355Z',
> '0.0.158': '2023-10-03T16:33:07.960Z',
> '0.0.159': '2023-10-04T05:07:58.638Z',
> '0.0.160': '2023-10-04T22:07:49.157Z',
> '0.0.161': '2023-10-06T02:07:05.756Z',
> '0.0.162': '2023-10-07T01:37:20.312Z',
> '0.0.163': '2023-10-08T01:32:36.536Z',
> '0.0.164': '2023-10-10T01:43:32.276Z',
> '0.0.165': '2023-10-10T20:57:49.443Z',
> '0.0.166': '2023-10-12T01:40:20.109Z',
> '0.0.167': '2023-10-14T00:32:54.607Z',
> '0.0.168': '2023-10-18T02:53:34.953Z',
> '0.0.169': '2023-10-19T06:32:45.493Z',
> '0.0.170': '2023-10-20T22:38:06.659Z',
> '0.0.171': '2023-10-24T00:17:00.928Z',
> '0.0.172': '2023-10-24T20:19:09.813Z',
> '0.0.173': '2023-10-26T00:58:15.045Z',
> '0.0.174': '2023-10-26T23:11:53.499Z',
> '0.0.175': '2023-10-28T17:04:03.349Z',
> '0.0.176': '2023-10-31T00:57:13.953Z',
> '0.0.177': '2023-11-01T00:20:00.276Z',
> '0.0.178': '2023-11-01T22:33:03.571Z',
> '0.0.179': '2023-11-03T05:49:56.666Z',
> '0.0.180': '2023-11-03T22:15:10.842Z',
> '0.0.181': '2023-11-06T09:59:26.380Z',
> '0.0.182-rc.0': '2023-11-06T22:23:48.947Z',
> '0.0.182-rc.1': '2023-11-07T03:41:06.816Z',
> '0.0.182': '2023-11-08T04:04:31.241Z',
> '0.0.183': '2023-11-08T05:25:05.808Z',
> '0.0.184': '2023-11-08T23:56:28.690Z',
> '0.0.185': '2023-11-10T02:35:22.582Z',
> '0.0.186': '2023-11-11T02:24:26.776Z',
> '0.0.187': '2023-11-14T04:35:18.096Z',
> '0.0.188': '2023-11-15T05:34:58.759Z',
> '0.0.189': '2023-11-15T06:30:57.181Z',
> '0.0.190': '2023-11-16T15:23:59.223Z',
> '0.0.191': '2023-11-16T16:31:07.507Z',
> '0.0.192': '2023-11-17T02:06:54.439Z',
> '0.0.193': '2023-11-19T11:06:54.623Z',
> '0.0.194': '2023-11-20T02:15:31.205Z',
> '0.0.195': '2023-11-20T20:25:34.666Z',
> '0.0.196': '2023-11-22T02:19:47.812Z',
> '0.0.197-rc.0': '2023-11-22T22:16:48.971Z',
> '0.0.197-rc.1': '2023-11-23T05:27:13.906Z',
> '0.0.197': '2023-11-27T17:42:53.476Z',
> '0.0.198': '2023-11-28T02:22:55.183Z',
> '0.0.199': '2023-12-01T01:28:26.144Z',
> '0.0.200': '2023-12-02T04:43:25.313Z',
> '0.0.201': '2023-12-05T04:22:22.540Z',
> '0.0.202': '2023-12-06T01:34:55.388Z',
> '0.0.203': '2023-12-07T06:15:39.619Z',
> '0.0.204-rc.0': '2023-12-08T02:34:03.010Z',
> '0.0.204-rc.1': '2023-12-09T03:54:40.336Z',
> '0.0.204-rc.2': '2023-12-11T20:15:35.207Z',
> '0.0.204': '2023-12-11T22:28:49.455Z',
> '0.0.205': '2023-12-12T18:27:07.427Z',
> '0.0.206': '2023-12-13T04:51:42.993Z',
> '0.0.207': '2023-12-14T03:34:38.535Z',
> '0.0.208': '2023-12-15T10:05:40.181Z',
> '0.0.209-rc.0': '2023-12-17T03:47:20.439Z',
> '0.0.209': '2023-12-17T06:10:40.303Z',
> '0.0.210': '2023-12-20T02:53:42.769Z',
> '0.0.211': '2023-12-21T07:29:16.193Z',
> '0.0.212': '2023-12-23T01:22:18.040Z',
> '0.0.213': '2023-12-29T15:33:05.323Z',
> '0.0.214': '2024-01-03T03:24:13.994Z',
> '0.1.0-rc.0': '2024-01-05T22:33:51.804Z',
> '0.1.0-rc.1': '2024-01-06T03:41:30.131Z',
> '0.1.0': '2024-01-06T03:58:20.185Z',
> '0.1.1': '2024-01-08T00:25:32.620Z',
> '0.1.2': '2024-01-09T22:35:21.328Z',
> '0.1.3': '2024-01-15T17:18:03.822Z',
> '0.1.4': '2024-01-18T05:58:46.640Z',
> '0.1.5': '2024-01-21T17:57:55.335Z',
> '0.1.6': '2024-01-24T07:58:31.013Z',
> '0.1.7': '2024-01-25T07:27:13.252Z',
> '0.1.8': '2024-01-27T01:11:52.718Z',
> '0.1.9-rc.0': '2024-01-27T06:14:56.103Z',
> '0.1.9': '2024-01-27T06:25:12.844Z',
> '0.1.10': '2024-01-30T09:54:07.013Z',
> '0.1.11': '2024-01-31T03:31:39.843Z',
> '0.1.12': '2024-02-01T23:57:54.094Z',
> '0.1.13': '2024-02-05T03:24:29.383Z',
> '0.1.14': '2024-02-07T01:03:54.355Z',
> '0.1.15': '2024-02-07T19:22:37.134Z',
> '0.1.16-rc.0': '2024-02-07T23:34:28.951Z',
> '0.1.16': '2024-02-07T23:45:35.740Z',
> '0.1.17': '2024-02-08T23:22:04.844Z',
> '0.1.18': '2024-02-13T23:15:14.011Z',
> '0.1.19-rc.0': '2024-02-14T23:59:15.835Z',
> '0.1.19-rc.1': '2024-02-16T00:20:22.801Z',
> '0.1.19': '2024-02-16T04:48:07.787Z',
> '0.1.19-rc.2': '2024-02-16T18:47:07.688Z',
> '0.1.20': '2024-02-16T22:03:07.378Z',
> '0.1.21': '2024-02-21T22:48:04.422Z',
> '0.1.22': '2024-02-26T20:27:53.383Z',
> '0.1.23': '2024-02-27T04:07:47.477Z',
> '0.1.24': '2024-02-29T00:52:15.516Z',
> '0.1.25': '2024-03-01T18:49:55.617Z',
> '0.1.26': '2024-03-10T01:36:01.782Z',
> '0.1.27': '2024-03-13T01:01:08.908Z',
> '0.1.28': '2024-03-15T00:06:05.523Z',
> '0.1.29-rc.0': '2024-03-15T03:31:14.345Z',
> '0.1.29': '2024-03-25T04:19:39.067Z',
> '0.1.30': '2024-03-26T06:27:42.909Z',
> '0.1.31': '2024-04-04T08:23:54.517Z',
> '0.1.32': '2024-04-09T01:22:19.683Z',
> '0.1.33': '2024-04-11T09:30:55.275Z',
> '0.1.34': '2024-04-18T03:01:59.519Z',
> '0.1.35': '2024-04-22T23:30:56.916Z',
> '0.1.36': '2024-04-24T21:36:22.008Z',
> '0.2.0-rc.0': '2024-04-26T23:56:59.053Z',
> '0.2.0-rc.1': '2024-05-02T22:00:18.752Z',
> '0.1.37': '2024-05-10T21:40:01.263Z',
> '0.2.0': '2024-05-17T21:03:13.753Z',
> '0.2.1': '2024-05-22T17:32:07.344Z',
> '0.2.2': '2024-05-23T23:12:00.768Z',
> '0.2.3-rc.0': '2024-05-28T21:17:33.560Z',
> '0.2.3': '2024-05-29T01:15:36.521Z',
> '0.2.4': '2024-05-31T04:14:35.289Z',
> '0.2.5': '2024-06-04T22:19:23.685Z',
> '0.2.6': '2024-06-21T23:52:24.414Z',
> '0.2.7': '2024-06-25T19:24:56.599Z',
> '0.2.8': '2024-06-28T01:05:43.266Z',
> '0.2.9': '2024-07-10T01:19:00.661Z',
> '0.2.10': '2024-07-16T04:39:54.756Z',
> '0.2.11': '2024-07-24T23:01:59.481Z',
> '0.2.12': '2024-07-30T16:59:27.878Z',
> '0.2.13': '2024-08-06T23:34:44.938Z',
> '0.2.14': '2024-08-09T19:52:51.258Z',
> '0.2.15': '2024-08-10T15:14:36.266Z',
> '0.2.16': '2024-08-13T11:41:17.160Z',
> '0.2.17': '2024-08-23T01:13:12.015Z',
> '0.2.18': '2024-09-04T22:45:35.518Z',
> '0.3.0-rc.0': '2024-09-07T00:10:44.310Z',
> '0.2.19': '2024-09-11T23:34:20.084Z',
> '0.3.0': '2024-09-13T21:43:36.208Z',
> '0.3.1': '2024-09-15T05:37:11.723Z',
> '0.3.2-rc.0': '2024-09-15T05:53:56.512Z',
> '0.3.2': '2024-09-15T06:16:32.327Z',
> '0.2.20': '2024-09-15T06:29:13.500Z',
> '0.3.3': '2024-10-21T18:07:59.871Z',
> '0.3.4': '2024-10-25T03:33:59.476Z',
> '0.3.5': '2024-10-28T00:27:14.931Z',
> '0.3.6': '2024-11-17T06:50:09.362Z',
> '0.3.7': '2024-12-11T18:02:28.477Z',
> '0.3.8': '2024-12-24T18:53:32.828Z',
> '0.3.9': '2025-01-02T03:13:31.224Z',
> '0.3.10': '2025-01-07T00:35:28.251Z',
> '0.3.11': '2025-01-10T22:33:47.736Z',
> '0.3.12': '2025-01-20T01:50:04.488Z',
> '0.3.13': '2025-01-25T01:56:33.034Z',
> '0.3.14': '2025-01-28T15:55:29.535Z',
> '0.3.15': '2025-01-29T23:56:06.188Z',
> '0.3.16': '2025-02-18T01:20:19.602Z',
> '0.3.17': '2025-02-18T01:28:41.518Z',
> '0.3.18': '2025-02-18T03:10:11.563Z',
> '0.3.19': '2025-02-19T04:33:33.819Z',
> '0.3.20': '2025-04-03T21:03:27.866Z',
> '0.3.21': '2025-04-09T07:36:17.760Z',
> '0.3.22': '2025-04-17T03:22:51.115Z',
> '0.3.23': '2025-04-18T22:48:00.903Z',
> '0.3.24': '2025-04-24T00:15:05.308Z',
> '0.3.25': '2025-05-14T05:09:01.215Z',
> '0.3.26': '2025-05-16T04:20:22.395Z',
> '0.3.27': '2025-05-22T04:47:31.715Z',
> '0.3.28': '2025-06-11T21:38:17.136Z',
> '0.3.29': '2025-06-20T01:21:12.870Z',
> '0.3.30': '2025-07-15T19:52:08.285Z',
> '0.3.31': '2025-08-19T00:07:56.530Z',
> '1.0.0-alpha.1': '2025-08-28T21:53:30.502Z',
> '1.0.0-alpha.2': '2025-08-28T23:39:23.030Z',
> '1.0.0-alpha.3': '2025-09-02T03:26:41.420Z',
> '1.0.0-alpha.4': '2025-09-02T16:34:19.059Z',
> '0.3.32': '2025-09-02T19:19:24.539Z',
> '0.3.33': '2025-09-04T21:53:42.553Z',
> '1.0.0-alpha.5': '2025-09-08T08:49:07.024Z',
> '0.3.34': '2025-09-15T20:52:11.165Z',
> '1.0.0-alpha.6': '2025-09-15T22:56:53.188Z',
> '1.0.0-alpha.7': '2025-09-26T21:29:36.761Z',
> '0.3.35': '2025-09-29T16:26:39.971Z'
> },
> bugs: {
> url: 'https://github.com/langchain-ai/langchainjs/issues'
> },
> author: {
> name: 'LangChain'
> },
> license: 'MIT',
> homepage: 'https://github.com/langchain-ai/langchainjs/tree/main/langchain/',
> keywords: \[
> 'llm',
> 'ai',
> 'gpt3',
> 'chain',
> 'prompt',
> 'prompt engineering',
> 'chatgpt',
> 'machine learning',
> 'ml',
> 'openai',
> 'embeddings',
> 'vectorstores'
> \],
> repository: {
> type: 'git',
> url: 'git+ssh://git@github.com/langchain-ai/langchainjs.git'
> },
> description: 'Typescript bindings for langchain',
> maintainers: \[
> {
> name: 'christian-bromann',
> email: 'mail@bromann.dev'
> },
> {
> name: 'nfcampos',
> email: 'nuno@boringbits.io'
> },
> {
> name: 'jacoblee93',
> email: 'jacoblee93@gmail.com'
> },
> {
> name: 'andrewnguonly',
> email: 'andrewnguonly@gmail.com'
> },
> {
> name: 'davidduong',
> email: 'david@duong.cz'
> },
> {
> name: 'hntrl',
> email: 'hunter@hntrl.io'
> },
> {
> name: 'hwchase17',
> email: 'hw.chase.17@gmail.com'
> },
> {
> name: 'basproul',
> email: 'braceasproul@gmail.com'
> }
> \],
> readmeFilename: 'README.md',
> version: '0.3.35',
> type: 'module',
> engines: {
> node: '\>=18'
> },
> main: './index.js',
> types: './index.d.ts',
> scripts: {
> build: 'yarn turbo:command build:internal --filter=langchain',
> 'build:internal': 'yarn lc\_build --create-entrypoints --pre --tree-shaking --gen-maps',
> 'lint:eslint': 'NODE\_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/',
> 'lint:dpdm': 'dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/\*.ts src/\*\*/\*.ts',
> lint: 'yarn lint:eslint && yarn lint:dpdm',
> 'lint:fix': 'yarn lint:eslint --fix && yarn lint:dpdm',
> precommit: 'lint-staged',
> clean: 'rm -rf .turbo dist/',
> prepack: 'yarn build',
> release: 'release-it --only-version --config .release-it.json',
> test: 'NODE\_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\\\.int\\\\.test.ts --testTimeout 30000 --maxWorkers=50%',
> 'test:watch': 'NODE\_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\\\.int\\\\.test.ts',
> 'test:integration': 'NODE\_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\\\.int\\\\.test.ts --testTimeout 100000 --maxWorkers=50%',
> 'test:single': 'NODE\_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000',
> format: 'prettier --config .prettierrc --write "src"',
> 'format:check': 'prettier --config .prettierrc --check "src"'
> },
> devDependencies: {
> '@faker-js/faker': '^7.6.0',
> '@jest/globals': '^29.5.0',
> '@langchain/anthropic': '\*',
> '@langchain/aws': '\*',
> '@langchain/cerebras': '\*',
> '@langchain/cohere': '\*',
> '@langchain/core': 'workspace:\*',
> '@langchain/deepseek': '\*',
> '@langchain/google-genai': '\*',
> '@langchain/google-vertexai': '\*',
> '@langchain/google-vertexai-web': '\*',
> '@langchain/groq': '\*',
> '@langchain/mistralai': '\*',
> '@langchain/ollama': '\*',
> '@langchain/scripts': '\>=0.1.0 \<0.2.0',
> '@langchain/xai': '\*',
> '@swc/core': '^1.3.90',
> '@swc/jest': '^0.2.29',
> '@tsconfig/recommended': '^1.0.2',
> '@types/handlebars': '^4.1.0',
> '@types/html-to-text': '^9',
> '@types/js-yaml': '^4',
> '@types/jsdom': '^21.1.1',
> '@types/uuid': '^9',
> '@types/ws': '^8',
> '@typescript-eslint/eslint-plugin': '^5.58.0',
> '@typescript-eslint/parser': '^5.58.0',
> axios: '^1.12.0',
> cheerio: '1.0.0-rc.12',
> dotenv: '^16.0.3',
> dpdm: '^3.14.0',
> eslint: '^8.33.0',
> 'eslint-config-airbnb-base': '^15.0.0',
> 'eslint-config-prettier': '^8.6.0',
> 'eslint-plugin-import': '^2.27.5',
> 'eslint-plugin-jest': '^27.6.0',
> 'eslint-plugin-no-instanceof': '^1.0.1',
> 'eslint-plugin-prettier': '^4.2.1',
> handlebars: '^4.7.8',
> jest: '^29.5.0',
> 'jest-environment-node': '^29.6.4',
> openai: '^5.1.0',
> peggy: '^3.0.2',
> prettier: '^2.8.3',
> 'reflect-metadata': '^0.2.2',
> 'release-it': '^18.1.2',
> rimraf: '^5.0.1',
> rollup: '^3.19.1',
> 'ts-jest': '^29.1.0',
> typeorm: '^0.3.20',
> typescript: '~5.8.3',
> wikipedia: '^2.1.2'
> },
> peerDependencies: {
> '@langchain/anthropic': '\*',
> '@langchain/aws': '\*',
> '@langchain/cerebras': '\*',
> '@langchain/cohere': '\*',
> '@langchain/core': '\>=0.3.58 \<0.4.0',
> '@langchain/deepseek': '\*',
> '@langchain/google-genai': '\*',
> '@langchain/google-vertexai': '\*',
> '@langchain/google-vertexai-web': '\*',
> '@langchain/groq': '\*',
> '@langchain/mistralai': '\*',
> '@langchain/ollama': '\*',
> '@langchain/xai': '\*',
> axios: '\*',
> cheerio: '\*',
> handlebars: '^4.7.8',
> peggy: '^3.0.2',
> typeorm: '\*'
> },
> peerDependenciesMeta: {
> '@langchain/anthropic': {
> optional: true
> },
> '@langchain/aws': {
> optional: true
> },
> '@langchain/cerebras': {
> optional: true
> },
> '@langchain/cohere': {
> optional: true
> },
> '@langchain/deepseek': {
> optional: true
> },
> '@langchain/google-genai': {
> optional: true
> },
> '@langchain/google-vertexai': {
> optional: true
> },
> '@langchain/google-vertexai-web': {
> optional: true
> },
> '@langchain/groq': {
> optional: true
> },
> '@langchain/mistralai': {
> optional: true
> },
> '@langchain/ollama': {
> optional: true
> },
> '@langchain/xai': {
> optional: true
> },
> axios: {
> optional: true
> },
> cheerio: {
> optional: true
> },
> handlebars: {
> optional: true
> },
> peggy: {
> optional: true
> },
> typeorm: {
> optional: true
> }
> },
> dependencies: {
> '@langchain/openai': '\>=0.1.0 \<0.7.0',
> '@langchain/textsplitters': '\>=0.0.0 \<0.2.0',
> 'js-tiktoken': '^1.0.12',
> 'js-yaml': '^4.1.0',
> jsonpointer: '^5.0.1',
> langsmith: '^0.3.67',
> 'openapi-types': '^12.1.3',
> 'p-retry': '4',
> uuid: '^10.0.0',
> yaml: '^2.2.1',
> zod: '^3.25.32'
> },
> publishConfig: {
> access: 'public'
> },
> exports: {
> './load': {
> types: {
> import: './load.d.ts',
> require: './load.d.cts',
> default: './load.d.ts'
> },
> import: './load.js',
> require: './load.cjs'
> },
> './load/serializable': {
> types: {
> import: './load/serializable.d.ts',
> require: './load/serializable.d.cts',
> default: './load/serializable.d.ts'
> },
> import: './load/serializable.js',
> require: './load/serializable.cjs'
> },
> './agents': {
> types: {
> import: './agents.d.ts',
> require: './agents.d.cts',
> default: './agents.d.ts'
> },
> import: './agents.js',
> require: './agents.cjs'
> },
> './agents/load': {
> types: {
> import: './agents/load.d.ts',
> require: './agents/load.d.cts',
> default: './agents/load.d.ts'
> },
> import: './agents/load.js',
> require: './agents/load.cjs'
> },
> './agents/toolkits': {
> types: {
> import: './agents/toolkits.d.ts',
> require: './agents/toolkits.d.cts',
> default: './agents/toolkits.d.ts'
> },
> import: './agents/toolkits.js',
> require: './agents/toolkits.cjs'
> },
> './agents/toolkits/sql': {
> types: {
> import: './agents/toolkits/sql.d.ts',
> require: './agents/toolkits/sql.d.cts',
> default: './agents/toolkits/sql.d.ts'
> },
> import: './agents/toolkits/sql.js',
> require: './agents/toolkits/sql.cjs'
> },
> './agents/format\_scratchpad': {
> types: {
> import: './agents/format\_scratchpad.d.ts',
> require: './agents/format\_scratchpad.d.cts',
> default: './agents/format\_scratchpad.d.ts'
> },
> import: './agents/format\_scratchpad.js',
> require: './agents/format\_scratchpad.cjs'
> },
> './agents/format\_scratchpad/openai\_tools': {
> types: {
> import: './agents/format\_scratchpad/openai\_tools.d.ts',
> require: './agents/format\_scratchpad/openai\_tools.d.cts',
> default: './agents/format\_scratchpad/openai\_tools.d.ts'
> },
> import: './agents/format\_scratchpad/openai\_tools.js',
> require: './agents/format\_scratchpad/openai\_tools.cjs'
> },
> './agents/format\_scratchpad/log': {
> types: {
> import: './agents/format\_scratchpad/log.d.ts',
> require: './agents/format\_scratchpad/log.d.cts',
> default: './agents/format\_scratchpad/log.d.ts'
> },
> import: './agents/format\_scratchpad/log.js',
> require: './agents/format\_scratchpad/log.cjs'
> },
> './agents/format\_scratchpad/xml': {
> types: {
> import: './agents/format\_scratchpad/xml.d.ts',
> require: './agents/format\_scratchpad/xml.d.cts',
> default: './agents/format\_scratchpad/xml.d.ts'
> },
> import: './agents/format\_scratchpad/xml.js',
> require: './agents/format\_scratchpad/xml.cjs'
> },
> './agents/format\_scratchpad/log\_to\_message': {
> types: {
> import: './agents/format\_scratchpad/log\_to\_message.d.ts',
> require: './agents/format\_scratchpad/log\_to\_message.d.cts',
> default: './agents/format\_scratchpad/log\_to\_message.d.ts'
> },
> import: './agents/format\_scratchpad/log\_to\_message.js',
> require: './agents/format\_scratchpad/log\_to\_message.cjs'
> },
> './agents/react/output\_parser': {
> types: {
> import: './agents/react/output\_parser.d.ts',
> require: './agents/react/output\_parser.d.cts',
> default: './agents/react/output\_parser.d.ts'
> },
> import: './agents/react/output\_parser.js',
> require: './agents/react/output\_parser.cjs'
> },
> './agents/xml/output\_parser': {
> types: {
> import: './agents/xml/output\_parser.d.ts',
> require: './agents/xml/output\_parser.d.cts',
> default: './agents/xml/output\_parser.d.ts'
> },
> import: './agents/xml/output\_parser.js',
> require: './agents/xml/output\_parser.cjs'
> },
> './agents/openai/output\_parser': {
> types: {
> import: './agents/openai/output\_parser.d.ts',
> require: './agents/openai/output\_parser.d.cts',
> default: './agents/openai/output\_parser.d.ts'
> },
> import: './agents/openai/output\_parser.js',
> require: './agents/openai/output\_parser.cjs'
> },
> './tools': {
> types: {
> import: './tools.d.ts',
> require: './tools.d.cts',
> default: './tools.d.ts'
> },
> import: './tools.js',
> require: './tools.cjs'
> },
> './tools/chain': {
> types: {
> import: './tools/chain.d.ts',
> require: './tools/chain.d.cts',
> default: './tools/chain.d.ts'
> },
> import: './tools/chain.js',
> require: './tools/chain.cjs'
> },
> './tools/render': {
> types: {
> import: './tools/render.d.ts',
> require: './tools/render.d.cts',
> default: './tools/render.d.ts'
> },
> import: './tools/render.js',
> require: './tools/render.cjs'
> },
> './tools/retriever': {
> types: {
> import: './tools/retriever.d.ts',
> require: './tools/retriever.d.cts',
> default: './tools/retriever.d.ts'
> },
> import: './tools/retriever.js',
> require: './tools/retriever.cjs'
> },
> './tools/sql': {
> types: {
> import: './tools/sql.d.ts',
> require: './tools/sql.d.cts',
> default: './tools/sql.d.ts'
> },
> import: './tools/sql.js',
> require: './tools/sql.cjs'
> },
> './tools/webbrowser': {
> types: {
> import: './tools/webbrowser.d.ts',
> require: './tools/webbrowser.d.cts',
> default: './tools/webbrowser.d.ts'
> },
> import: './tools/webbrowser.js',
> require: './tools/webbrowser.cjs'
> },
> './chains': {
> types: {
> import: './chains.d.ts',
> require: './chains.d.cts',
> default: './chains.d.ts'
> },
> import: './chains.js',
> require: './chains.cjs'
> },
> './chains/combine\_documents': {
> types: {
> import: './chains/combine\_documents.d.ts',
> require: './chains/combine\_documents.d.cts',
> default: './chains/combine\_documents.d.ts'
> },
> import: './chains/combine\_documents.js',
> require: './chains/combine\_documents.cjs'
> },
> './chains/combine\_documents/reduce': {
> types: {
> import: './chains/combine\_documents/reduce.d.ts',
> require: './chains/combine\_documents/reduce.d.cts',
> default: './chains/combine\_documents/reduce.d.ts'
> },
> import: './chains/combine\_documents/reduce.js',
> require: './chains/combine\_documents/reduce.cjs'
> },
> './chains/history\_aware\_retriever': {
> types: {
> import: './chains/history\_aware\_retriever.d.ts',
> require: './chains/history\_aware\_retriever.d.cts',
> default: './chains/history\_aware\_retriever.d.ts'
> },
> import: './chains/history\_aware\_retriever.js',
> require: './chains/history\_aware\_retriever.cjs'
> },
> './chains/load': {
> types: {
> import: './chains/load.d.ts',
> require: './chains/load.d.cts',
> default: './chains/load.d.ts'
> },
> import: './chains/load.js',
> require: './chains/load.cjs'
> },
> './chains/openai\_functions': {
> types: {
> import: './chains/openai\_functions.d.ts',
> require: './chains/openai\_functions.d.cts',
> default: './chains/openai\_functions.d.ts'
> },
> import: './chains/openai\_functions.js',
> require: './chains/openai\_functions.cjs'
> },
> './chains/query\_constructor': {
> types: {
> import: './chains/query\_constructor.d.ts',
> require: './chains/query\_constructor.d.cts',
> default: './chains/query\_constructor.d.ts'
> },
> import: './chains/query\_constructor.js',
> require: './chains/query\_constructor.cjs'
> },
> './chains/query\_constructor/ir': {
> types: {
> import: './chains/query\_constructor/ir.d.ts',
> require: './chains/query\_constructor/ir.d.cts',
> default: './chains/query\_constructor/ir.d.ts'
> },
> import: './chains/query\_constructor/ir.js',
> require: './chains/query\_constructor/ir.cjs'
> },
> './chains/retrieval': {
> types: {
> import: './chains/retrieval.d.ts',
> require: './chains/retrieval.d.cts',
> default: './chains/retrieval.d.ts'
> },
> import: './chains/retrieval.js',
> require: './chains/retrieval.cjs'
> },
> './chains/sql\_db': {
> types: {
> import: './chains/sql\_db.d.ts',
> require: './chains/sql\_db.d.cts',
> default: './chains/sql\_db.d.ts'
> },
> import: './chains/sql\_db.js',
> require: './chains/sql\_db.cjs'
> },
> './chains/graph\_qa/cypher': {
> types: {
> import: './chains/graph\_qa/cypher.d.ts',
> require: './chains/graph\_qa/cypher.d.cts',
> default: './chains/graph\_qa/cypher.d.ts'
> },
> import: './chains/graph\_qa/cypher.js',
> require: './chains/graph\_qa/cypher.cjs'
> },
> './chat\_models/universal': {
> types: {
> import: './chat\_models/universal.d.ts',
> require: './chat\_models/universal.d.cts',
> default: './chat\_models/universal.d.ts'
> },
> import: './chat\_models/universal.js',
> require: './chat\_models/universal.cjs'
> },
> './embeddings/cache\_backed': {
> types: {
> import: './embeddings/cache\_backed.d.ts',
> require: './embeddings/cache\_backed.d.cts',
> default: './embeddings/cache\_backed.d.ts'
> },
> import: './embeddings/cache\_backed.js',
> require: './embeddings/cache\_backed.cjs'
> },
> './embeddings/fake': {
> types: {
> import: './embeddings/fake.d.ts',
> require: './embeddings/fake.d.cts',
> default: './embeddings/fake.d.ts'
> },
> import: './embeddings/fake.js',
> require: './embeddings/fake.cjs'
> },
> './vectorstores/memory': {
> types: {
> import: './vectorstores/memory.d.ts',
> require: './vectorstores/memory.d.cts',
> default: './vectorstores/memory.d.ts'
> },
> import: './vectorstores/memory.js',
> require: './vectorstores/memory.cjs'
> },
> './text\_splitter': {
> types: {
> import: './text\_splitter.d.ts',
> require: './text\_splitter.d.cts',
> default: './text\_splitter.d.ts'
> },
> import: './text\_splitter.js',
> require: './text\_splitter.cjs'
> },
> './memory': {
> types: {
> import: './memory.d.ts',
> require: './memory.d.cts',
> default: './memory.d.ts'
> },
> import: './memory.js',
> require: './memory.cjs'
> },
> './memory/chat\_memory': {
> types: {
> import: './memory/chat\_memory.d.ts',
> require: './memory/chat\_memory.d.cts',
> default: './memory/chat\_memory.d.ts'
> },
> import: './memory/chat\_memory.js',
> require: './memory/chat\_memory.cjs'
> },
> './document': {
> types: {
> import: './document.d.ts',
> require: './document.d.cts',
> default: './document.d.ts'
> },
> import: './document.js',
> require: './document.cjs'
> },
> './document\_loaders/base': {
> types: {
> import: './document\_loaders/base.d.ts',
> require: './document\_loaders/base.d.cts',
> default: './document\_loaders/base.d.ts'
> },
> import: './document\_loaders/base.js',
> require: './document\_loaders/base.cjs'
> },
> './document\_loaders/fs/buffer': {
> types: {
> import: './document\_loaders/fs/buffer.d.ts',
> require: './document\_loaders/fs/buffer.d.cts',
> default: './document\_loaders/fs/buffer.d.ts'
> },
> import: './document\_loaders/fs/buffer.js',
> require: './document\_loaders/fs/buffer.cjs'
> },
> './document\_loaders/fs/directory': {
> types: {
> import: './document\_loaders/fs/directory.d.ts',
> require: './document\_loaders/fs/directory.d.cts',
> default: './document\_loaders/fs/directory.d.ts'
> },
> import: './document\_loaders/fs/directory.js',
> require: './document\_loaders/fs/directory.cjs'
> },
> './document\_loaders/fs/json': {
> types: {
> import: './document\_loaders/fs/json.d.ts',
> require: './document\_loaders/fs/json.d.cts',
> default: './document\_loaders/fs/json.d.ts'
> },
> import: './document\_loaders/fs/json.js',
> require: './document\_loaders/fs/json.cjs'
> },
> './document\_loaders/fs/multi\_file': {
> types: {
> import: './document\_loaders/fs/multi\_file.d.ts',
> require: './document\_loaders/fs/multi\_file.d.cts',
> default: './document\_loaders/fs/multi\_file.d.ts'
> },
> import: './document\_loaders/fs/multi\_file.js',
> require: './document\_loaders/fs/multi\_file.cjs'
> },
> './document\_loaders/fs/text': {
> types: {
> import: './document\_loaders/fs/text.d.ts',
> require: './document\_loaders/fs/text.d.cts',
> default: './document\_loaders/fs/text.d.ts'
> },
> import: './document\_loaders/fs/text.js',
> require: './document\_loaders/fs/text.cjs'
> },
> './document\_transformers/openai\_functions': {
> types: {
> import: './document\_transformers/openai\_functions.d.ts',
> require: './document\_transformers/openai\_functions.d.cts',
> default: './document\_transformers/openai\_functions.d.ts'
> },
> import: './document\_transformers/openai\_functions.js',
> require: './document\_transformers/openai\_functions.cjs'
> },
> './sql\_db': {
> types: {
> import: './sql\_db.d.ts',
> require: './sql\_db.d.cts',
> default: './sql\_db.d.ts'
> },
> import: './sql\_db.js',
> require: './sql\_db.cjs'
> },
> './callbacks': {
> types: {
> import: './callbacks.d.ts',
> require: './callbacks.d.cts',
> default: './callbacks.d.ts'
> },
> import: './callbacks.js',
> require: './callbacks.cjs'
> },
> './output\_parsers': {
> types: {
> import: './output\_parsers.d.ts',
> require: './output\_parsers.d.cts',
> default: './output\_parsers.d.ts'
> },
> import: './output\_parsers.js',
> require: './output\_parsers.cjs'
> },
> './output\_parsers/expression': {
> types: {
> import: './output\_parsers/expression.d.ts',
> require: './output\_parsers/expression.d.cts',
> default: './output\_parsers/expression.d.ts'
> },
> import: './output\_parsers/expression.js',
> require: './output\_parsers/expression.cjs'
> },
> './retrievers/contextual\_compression': {
> types: {
> import: './retrievers/contextual\_compression.d.ts',
> require: './retrievers/contextual\_compression.d.cts',
> default: './retrievers/contextual\_compression.d.ts'
> },
> import: './retrievers/contextual\_compression.js',
> require: './retrievers/contextual\_compression.cjs'
> },
> './retrievers/document\_compressors': {
> types: {
> import: './retrievers/document\_compressors.d.ts',
> require: './retrievers/document\_compressors.d.cts',
> default: './retrievers/document\_compressors.d.ts'
> },
> import: './retrievers/document\_compressors.js',
> require: './retrievers/document\_compressors.cjs'
> },
> './retrievers/ensemble': {
> types: {
> import: './retrievers/ensemble.d.ts',
> require: './retrievers/ensemble.d.cts',
> default: './retrievers/ensemble.d.ts'
> },
> import: './retrievers/ensemble.js',
> require: './retrievers/ensemble.cjs'
> },
> './retrievers/multi\_query': {
> types: {
> import: './retrievers/multi\_query.d.ts',
> require: './retrievers/multi\_query.d.cts',
> default: './retrievers/multi\_query.d.ts'
> },
> import: './retrievers/multi\_query.js',
> require: './retrievers/multi\_query.cjs'
> },
> './retrievers/multi\_vector': {
> types: {
> import: './retrievers/multi\_vector.d.ts',
> require: './retrievers/multi\_vector.d.cts',
> default: './retrievers/multi\_vector.d.ts'
> },
> import: './retrievers/multi\_vector.js',
> require: './retrievers/multi\_vector.cjs'
> },
> './retrievers/parent\_document': {
> types: {
> import: './retrievers/parent\_document.d.ts',
> require: './retrievers/parent\_document.d.cts',
> default: './retrievers/parent\_document.d.ts'
> },
> import: './retrievers/parent\_document.js',
> require: './retrievers/parent\_document.cjs'
> },
> './retrievers/time\_weighted': {
> types: {
> import: './retrievers/time\_weighted.d.ts',
> require: './retrievers/time\_weighted.d.cts',
> default: './retrievers/time\_weighted.d.ts'
> },
> import: './retrievers/time\_weighted.js',
> require: './retrievers/time\_weighted.cjs'
> },
> './retrievers/document\_compressors/chain\_extract': {
> types: {
> import: './retrievers/document\_compressors/chain\_extract.d.ts',
> require: './retrievers/document\_compressors/chain\_extract.d.cts',
> default: './retrievers/document\_compressors/chain\_extract.d.ts'
> },
> import: './retrievers/document\_compressors/chain\_extract.js',
> require: './retrievers/document\_compressors/chain\_extract.cjs'
> },
> './retrievers/document\_compressors/embeddings\_filter': {
> types: {
> import: './retrievers/document\_compressors/embeddings\_filter.d.ts',
> require: './retrievers/document\_compressors/embeddings\_filter.d.cts',
> default: './retrievers/document\_compressors/embeddings\_filter.d.ts'
> },
> import: './retrievers/document\_compressors/embeddings\_filter.js',
> require: './retrievers/document\_compressors/embeddings\_filter.cjs'
> },
> './retrievers/hyde': {
> types: {
> import: './retrievers/hyde.d.ts',
> require: './retrievers/hyde.d.cts',
> default: './retrievers/hyde.d.ts'
> },
> import: './retrievers/hyde.js',
> require: './retrievers/hyde.cjs'
> },
> './retrievers/score\_threshold': {
> types: {
> import: './retrievers/score\_threshold.d.ts',
> require: './retrievers/score\_threshold.d.cts',
> default: './retrievers/score\_threshold.d.ts'
> },
> import: './retrievers/score\_threshold.js',
> require: './retrievers/score\_threshold.cjs'
> },
> './retrievers/self\_query': {
> types: {
> import: './retrievers/self\_query.d.ts',
> require: './retrievers/self\_query.d.cts',
> default: './retrievers/self\_query.d.ts'
> },
> import: './retrievers/self\_query.js',
> require: './retrievers/self\_query.cjs'
> },
> './retrievers/self\_query/functional': {
> types: {
> import: './retrievers/self\_query/functional.d.ts',
> require: './retrievers/self\_query/functional.d.cts',
> default: './retrievers/self\_query/functional.d.ts'
> },
> import: './retrievers/self\_query/functional.js',
> require: './retrievers/self\_query/functional.cjs'
> },
> './retrievers/matryoshka\_retriever': {
> types: {
> import: './retrievers/matryoshka\_retriever.d.ts',
> require: './retrievers/matryoshka\_retriever.d.cts',
> default: './retrievers/matryoshka\_retriever.d.ts'
> },
> import: './retrievers/matryoshka\_retriever.js',
> require: './retrievers/matryoshka\_retriever.cjs'
> },
> './cache/file\_system': {
> types: {
> import: './cache/file\_system.d.ts',
> require: './cache/file\_system.d.cts',
> default: './cache/file\_system.d.ts'
> },
> import: './cache/file\_system.js',
> require: './cache/file\_system.cjs'
> },
> './stores/doc/base': {
> types: {
> import: './stores/doc/base.d.ts',
> require: './stores/doc/base.d.cts',
> default: './stores/doc/base.d.ts'
> },
> import: './stores/doc/base.js',
> require: './stores/doc/base.cjs'
> },
> './stores/doc/in\_memory': {
> types: {
> import: './stores/doc/in\_memory.d.ts',
> require: './stores/doc/in\_memory.d.cts',
> default: './stores/doc/in\_memory.d.ts'
> },
> import: './stores/doc/in\_memory.js',
> require: './stores/doc/in\_memory.cjs'
> },
> './stores/file/in\_memory': {
> types: {
> import: './stores/file/in\_memory.d.ts',
> require: './stores/file/in\_memory.d.cts',
> default: './stores/file/in\_memory.d.ts'
> },
> import: './stores/file/in\_memory.js',
> require: './stores/file/in\_memory.cjs'
> },
> './stores/file/node': {
> types: {
> import: './stores/file/node.d.ts',
> require: './stores/file/node.d.cts',
> default: './stores/file/node.d.ts'
> },
> import: './stores/file/node.js',
> require: './stores/file/node.cjs'
> },
> './stores/message/in\_memory': {
> types: {
> import: './stores/message/in\_memory.d.ts',
> require: './stores/message/in\_memory.d.cts',
> default: './stores/message/in\_memory.d.ts'
> },
> import: './stores/message/in\_memory.js',
> require: './stores/message/in\_memory.cjs'
> },
> './storage/encoder\_backed': {
> types: {
> import: './storage/encoder\_backed.d.ts',
> require: './storage/encoder\_backed.d.cts',
> default: './storage/encoder\_backed.d.ts'
> },
> import: './storage/encoder\_backed.js',
> require: './storage/encoder\_backed.cjs'
> },
> './storage/in\_memory': {
> types: {
> import: './storage/in\_memory.d.ts',
> require: './storage/in\_memory.d.cts',
> default: './storage/in\_memory.d.ts'
> },
> import: './storage/in\_memory.js',
> require: './storage/in\_memory.cjs'
> },
> './storage/file\_system': {
> types: {
> import: './storage/file\_system.d.ts',
> require: './storage/file\_system.d.cts',
> default: './storage/file\_system.d.ts'
> },
> import: './storage/file\_system.js',
> require: './storage/file\_system.cjs'
> },
> './hub': {
> types: {
> import: './hub.d.ts',
> require: './hub.d.cts',
> default: './hub.d.ts'
> },
> import: './hub.js',
> require: './hub.cjs'
> },
> './hub/node': {
> types: {
> import: './hub/node.d.ts',
> require: './hub/node.d.cts',
> default: './hub/node.d.ts'
> },
> import: './hub/node.js',
> require: './hub/node.cjs'
> },
> './util/document': {
> types: {
> import: './util/document.d.ts',
> require: './util/document.d.cts',
> default: './util/document.d.ts'
> },
> import: './util/document.js',
> require: './util/document.cjs'
> },
> './util/math': {
> types: {
> import: './util/math.d.ts',
> require: './util/math.d.cts',
> default: './util/math.d.ts'
> },
> import: './util/math.js',
> require: './util/math.cjs'
> },
> './util/time': {
> types: {
> import: './util/time.d.ts',
> require: './util/time.d.cts',
> default: './util/time.d.ts'
> },
> import: './util/time.js',
> require: './util/time.cjs'
> },
> './experimental/autogpt': {
> types: {
> import: './experimental/autogpt.d.ts',
> require: './experimental/autogpt.d.cts',
> default: './experimental/autogpt.d.ts'
> },
> import: './experimental/autogpt.js',
> require: './experimental/autogpt.cjs'
> },
> './experimental/openai\_assistant': {
> types: {
> import: './experimental/openai\_assistant.d.ts',
> require: './experimental/openai\_assistant.d.cts',
> default: './experimental/openai\_assistant.d.ts'
> },
> import: './experimental/openai\_assistant.js',
> require: './experimental/openai\_assistant.cjs'
> },
> './experimental/openai\_files': {
> types: {
> import: './experimental/openai\_files.d.ts',
> require: './experimental/openai\_files.d.cts',
> default: './experimental/openai\_files.d.ts'
> },
> import: './experimental/openai\_files.js',
> require: './experimental/openai\_files.cjs'
> },
> './experimental/babyagi': {
> types: {
> import: './experimental/babyagi.d.ts',
> require: './experimental/babyagi.d.cts',
> default: './experimental/babyagi.d.ts'
> },
> import: './experimental/babyagi.js',
> require: './experimental/babyagi.cjs'
> },
> './experimental/generative\_agents': {
> types: {
> import: './experimental/generative\_agents.d.ts',
> require: './experimental/generative\_agents.d.cts',
> default: './experimental/generative\_agents.d.ts'
> },
> import: './experimental/generative\_agents.js',
> require: './experimental/generative\_agents.cjs'
> },
> './experimental/plan\_and\_execute': {
> types: {
> import: './experimental/plan\_and\_execute.d.ts',
> require: './experimental/plan\_and\_execute.d.cts',
> default: './experimental/plan\_and\_execute.d.ts'
> },
> import: './experimental/plan\_and\_execute.js',
> require: './experimental/plan\_and\_execute.cjs'
> },
> './experimental/chains/violation\_of\_expectations': {
> types: {
> import: './experimental/chains/violation\_of\_expectations.d.ts',
> require: './experimental/chains/violation\_of\_expectations.d.cts',
> default: './experimental/chains/violation\_of\_expectations.d.ts'
> },
> import: './experimental/chains/violation\_of\_expectations.js',
> require: './experimental/chains/violation\_of\_expectations.cjs'
> },
> './experimental/masking': {
> types: {
> import: './experimental/masking.d.ts',
> require: './experimental/masking.d.cts',
> default: './experimental/masking.d.ts'
> },
> import: './experimental/masking.js',
> require: './experimental/masking.cjs'
> },
> './experimental/prompts/custom\_format': {
> types: {
> import: './experimental/prompts/custom\_format.d.ts',
> require: './experimental/prompts/custom\_format.d.cts',
> default: './experimental/prompts/custom\_format.d.ts'
> },
> import: './experimental/prompts/custom\_format.js',
> require: './experimental/prompts/custom\_format.cjs'
> },
> './experimental/prompts/handlebars': {
> types: {
> import: './experimental/prompts/handlebars.d.ts',
> require: './experimental/prompts/handlebars.d.cts',
> default: './experimental/prompts/handlebars.d.ts'
> },
> import: './experimental/prompts/handlebars.js',
> require: './experimental/prompts/handlebars.cjs'
> },
> './evaluation': {
> types: {
> import: './evaluation.d.ts',
> require: './evaluation.d.cts',
> default: './evaluation.d.ts'
> },
> import: './evaluation.js',
> require: './evaluation.cjs'
> },
> './smith': {
> types: {
> import: './smith.d.ts',
> require: './smith.d.cts',
> default: './smith.d.ts'
> },
> import: './smith.js',
> require: './smith.cjs'
> },
> './runnables/remote': {
> types: {
> import: './runnables/remote.d.ts',
> require: './runnables/remote.d.cts',
> default: './runnables/remote.d.ts'
> },
> import: './runnables/remote.js',
> require: './runnables/remote.cjs'
> },
> './indexes': {
> types: {
> import: './indexes.d.ts',
> require: './indexes.d.cts',
> default: './indexes.d.ts'
> },
> import: './indexes.js',
> require: './indexes.cjs'
> },
> './schema/query\_constructor': {
> types: {
> import: './schema/query\_constructor.d.ts',
> require: './schema/query\_constructor.d.cts',
> default: './schema/query\_constructor.d.ts'
> },
> import: './schema/query\_constructor.js',
> require: './schema/query\_constructor.cjs'
> },
> './schema/prompt\_template': {
> types: {
> import: './schema/prompt\_template.d.ts',
> require: './schema/prompt\_template.d.cts',
> default: './schema/prompt\_template.d.ts'
> },
> import: './schema/prompt\_template.js',
> require: './schema/prompt\_template.cjs'
> },
> './package.json': './package.json'
> },
> gitHead: 'eae9a629ccbffe7a3887ac66fcc4480954980d5d',
> dist: {
> integrity: 'sha512-OkPstP43L3rgaAk72UAVcXy4BzJSiyzXfJsHRBTx9xD3rRtgrAu/jsWpMcsbFAoNO3iGerK+ULzkTzaBJBz6kg==',
> shasum: '66c859a10aacaf04ed864f2b219a128887c19f56',
> tarball: 'https://registry.npmjs.org/langchain/-/langchain-0.3.35.tgz',
> fileCount: 1345,
> unpackedSize: 2929800,
> signatures: \[
> {
> keyid: 'SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U',
> sig: 'MEUCIQCbzdn98bWrj2qUFDuvpSARWgtbSBt+Zqnot+XARvOBNgIgf5tcZtcah5g1m854KeYjpMzGgCX/42VefySP0CrxZY4='
> }
> \]
> },
> directories: {}
> }
> Done in 0.65s.
> \`\`\`
> 
> \`\`\`
> Platform: Windows
> \`\`\`
> 
> \`\`\`
> $ node -v
> v22.14.0
> \`\`\`
> 
> \`\`\`
> $ yarn -v
> 1.22.22
> \`\`\`

---

<div class="post-metadata">

**Author:** ![pawel-twardziak](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/pawel-twardziak/32/960_2.png) [@pawel-twardziak](https://forum.langchain.com/u/pawel-twardziak)\
**Post date:** [September 30, 2025, 8:36pm UTC](https://forum.langchain.com/t/langchain-js-openai-responses-api-stateless-gpt-5-reasoning-messages-cause-400-reasoning-without-its-required-following-item/1688/7 "2025-09-30T20:36:03Z")

</div>

Hi @hntrl and @niccotnt

I’ve raised a PR - there was an inconsistency in pairing the `reasoning item` with the following message.

> <https://github.com/langchain-ai/langchainjs/pull/9082>
>
> Fixes #9072 
> 
> \#### Goal
> 
> Fix Responses API pairing error for reasoning → “re…quired following item” and add unit tests that cover it.
> 
> \#### Changes:
> 
> \- In libs/langchain-openai/src/chat\_models.ts:
> - For the Responses API when !zdrEnabled, attach the id to function\_call items using the \_\_openai\_function\_call\_ids\_\_ map. This allows the API to correctly pair a preceding reasoning item with its required following item.
> - The logic for adding reasoning in history remains unchanged from the state prior to this iteration (no gating, as requested).
> \- Tests (unit, .standard.test.ts):
> - Added libs/langchain-openai/src/tests/chat\_models\_responses\_reasoning\_pairing.standard.test.ts:
> - “includes function\_call id when !zdrEnabled so reasoning can pair”
> - “does not include function\_call id when zdrEnabled=true (and reasoning omitted)”
> - “errors when orphan reasoning is sent without following item” (negative scenario: if a reasoning item lacks its required following item, we expect an error)
> - The filename follows the existing chat\_models... convention to clearly scope the test to chat models.
> 
> \#### Rationale:
> 
> The Responses API requires that a reasoning item must be immediately followed by (and paired with) another item via id. Missing id on function\_call broke validation and resulted in a 400 error.
> 
> \#### Impact scope:
> \- Only affects the Responses API path and conversation history containing reasoning + function\_call.
> \- No changes to the Completions API.
> 
> \#### Local testing:
> 
> \- Unit only: yarn test:single libs/langchain-openai/src/tests/chat\_models\_responses\_reasoning\_pairing.standard.test.ts
> \- All unit tests: yarn test
> 
> \#### Documentation: 
> 
> N/A (no public API change).
