@langchain/openai 0.6.6 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,13 @@ const openai_format_fndef_js_1 = require("./utils/openai-format-fndef.cjs");
20
20
  const tools_js_1 = require("./utils/tools.cjs");
21
21
  const _FUNCTION_CALL_IDS_MAP_KEY = "__openai_function_call_ids__";
22
22
  function isReasoningModel(model) {
23
- return model && (/^o\d/.test(model) || model.startsWith("gpt-5"));
23
+ if (!model)
24
+ return false;
25
+ if (/^o\d/.test(model ?? ""))
26
+ return true;
27
+ if (model.startsWith("gpt-5") && !model.startsWith("gpt-5-chat"))
28
+ return true;
29
+ return false;
24
30
  }
25
31
  function isStructuredOutputMethodParams(x
26
32
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1991,7 +1997,6 @@ class ChatOpenAICompletions extends BaseChatOpenAI {
1991
1997
  return await this.client.chat.completions.parse(request, clientOptions);
1992
1998
  }
1993
1999
  else {
1994
- console.log("request", request);
1995
2000
  return await this.client.chat.completions.create(request, clientOptions);
1996
2001
  }
1997
2002
  }
@@ -15,7 +15,13 @@ import { formatFunctionDefinitions, } from "./utils/openai-format-fndef.js";
15
15
  import { _convertToOpenAITool, convertCompletionsCustomTool, convertResponsesCustomTool, isBuiltInTool, isBuiltInToolChoice, isCustomTool, isCustomToolCall, isOpenAICustomTool, parseCustomToolCall, } from "./utils/tools.js";
16
16
  const _FUNCTION_CALL_IDS_MAP_KEY = "__openai_function_call_ids__";
17
17
  function isReasoningModel(model) {
18
- return model && (/^o\d/.test(model) || model.startsWith("gpt-5"));
18
+ if (!model)
19
+ return false;
20
+ if (/^o\d/.test(model ?? ""))
21
+ return true;
22
+ if (model.startsWith("gpt-5") && !model.startsWith("gpt-5-chat"))
23
+ return true;
24
+ return false;
19
25
  }
20
26
  function isStructuredOutputMethodParams(x
21
27
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1984,7 +1990,6 @@ export class ChatOpenAICompletions extends BaseChatOpenAI {
1984
1990
  return await this.client.chat.completions.parse(request, clientOptions);
1985
1991
  }
1986
1992
  else {
1987
- console.log("request", request);
1988
1993
  return await this.client.chat.completions.create(request, clientOptions);
1989
1994
  }
1990
1995
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/openai",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "OpenAI integrations for LangChain.js",
5
5
  "type": "module",
6
6
  "engines": {