@langchain/openai 0.2.11 → 0.3.0

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.
package/README.md CHANGED
@@ -5,7 +5,7 @@ This package contains the LangChain.js integrations for OpenAI through their SDK
5
5
  ## Installation
6
6
 
7
7
  ```bash npm2yarn
8
- npm install @langchain/openai
8
+ npm install @langchain/openai @langchain/core
9
9
  ```
10
10
 
11
11
  This package, along with the main LangChain package, depends on [`@langchain/core`](https://npmjs.com/package/@langchain/core/).
@@ -17,18 +17,18 @@ You can do so by adding appropriate fields to your project's `package.json` like
17
17
  "name": "your-project",
18
18
  "version": "0.0.0",
19
19
  "dependencies": {
20
- "@langchain/openai": "^0.0.9",
21
- "langchain": "0.0.207"
20
+ "@langchain/core": "^0.3.0",
21
+ "@langchain/openai": "^0.0.0"
22
22
  },
23
23
  "resolutions": {
24
- "@langchain/core": "0.1.5"
24
+ "@langchain/core": "^0.3.0"
25
25
  },
26
26
  "overrides": {
27
- "@langchain/core": "0.1.5"
27
+ "@langchain/core": "^0.3.0"
28
28
  },
29
29
  "pnpm": {
30
30
  "overrides": {
31
- "@langchain/core": "0.1.5"
31
+ "@langchain/core": "^0.3.0"
32
32
  }
33
33
  }
34
34
  }
package/dist/llms.cjs CHANGED
@@ -82,7 +82,7 @@ class OpenAI extends llms_1.BaseLLM {
82
82
  "",
83
83
  `See this page for more information:`,
84
84
  "|",
85
- `└> https://js.langchain.com/v0.2/docs/integrations/chat/openai`,
85
+ `└> https://js.langchain.com/docs/integrations/chat/openai`,
86
86
  ].join("\n"));
87
87
  // eslint-disable-next-line no-constructor-return
88
88
  return new legacy_js_1.OpenAIChat(fields, configuration);
package/dist/llms.js CHANGED
@@ -79,7 +79,7 @@ export class OpenAI extends BaseLLM {
79
79
  "",
80
80
  `See this page for more information:`,
81
81
  "|",
82
- `└> https://js.langchain.com/v0.2/docs/integrations/chat/openai`,
82
+ `└> https://js.langchain.com/docs/integrations/chat/openai`,
83
83
  ].join("\n"));
84
84
  // eslint-disable-next-line no-constructor-return
85
85
  return new OpenAIChat(fields, configuration);
@@ -1,4 +1,4 @@
1
- import { ToolDefinition } from "@langchain/core/language_models/base";
1
+ import { OpenAI as OpenAIClient } from "openai";
2
2
  import { BindToolsInput } from "@langchain/core/language_models/chat_models";
3
3
  /**
4
4
  * Formats a tool in either OpenAI format, or LangChain structured tool format
@@ -17,4 +17,4 @@ export declare function _convertToOpenAITool(tool: BindToolsInput, fields?: {
17
17
  * provided in the function definition.
18
18
  */
19
19
  strict?: boolean;
20
- }): ToolDefinition;
20
+ }): OpenAIClient.ChatCompletionTool;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/openai",
3
- "version": "0.2.11",
3
+ "version": "0.3.0",
4
4
  "description": "OpenAI integrations for LangChain.js",
5
5
  "type": "module",
6
6
  "engines": {
@@ -35,15 +35,18 @@
35
35
  "author": "LangChain",
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
- "@langchain/core": ">=0.2.26 <0.3.0",
39
38
  "js-tiktoken": "^1.0.12",
40
39
  "openai": "^4.57.3",
41
40
  "zod": "^3.22.4",
42
41
  "zod-to-json-schema": "^3.22.3"
43
42
  },
43
+ "peerDependencies": {
44
+ "@langchain/core": ">=0.2.26 <0.4.0"
45
+ },
44
46
  "devDependencies": {
45
47
  "@azure/identity": "^4.2.1",
46
48
  "@jest/globals": "^29.5.0",
49
+ "@langchain/core": "workspace:*",
47
50
  "@langchain/scripts": ">=0.1.0 <0.2.0",
48
51
  "@langchain/standard-tests": "0.0.0",
49
52
  "@swc/core": "^1.3.90",