@langchain/openai 0.0.6 → 0.0.7

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
@@ -21,14 +21,14 @@ You can do so by adding appropriate fields to your project's `package.json` like
21
21
  "langchain": "0.0.207"
22
22
  },
23
23
  "resolutions": {
24
- "@langchain/core": "0.1.1"
24
+ "@langchain/core": "0.1.2"
25
25
  },
26
26
  "overrides": {
27
- "@langchain/core": "0.1.1"
27
+ "@langchain/core": "0.1.2"
28
28
  },
29
29
  "pnpm": {
30
30
  "overrides": {
31
- "@langchain/core": "0.1.1"
31
+ "@langchain/core": "0.1.2"
32
32
  }
33
33
  }
34
34
  }
@@ -2,7 +2,7 @@ import { type ClientOptions, OpenAI as OpenAIClient } from "openai";
2
2
  import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
3
3
  import { type BaseMessage } from "@langchain/core/messages";
4
4
  import { ChatGenerationChunk, type ChatResult } from "@langchain/core/outputs";
5
- import { StructuredTool } from "@langchain/core/tools";
5
+ import type { StructuredToolInterface } from "@langchain/core/tools";
6
6
  import { BaseChatModel, type BaseChatModelParams } from "@langchain/core/language_models/chat_models";
7
7
  import type { BaseFunctionCallOptions } from "@langchain/core/language_models/base";
8
8
  import type { AzureOpenAIInput, OpenAICallOptions, OpenAIChatInput, OpenAICoreRequestOptions, LegacyOpenAIInput } from "./types.js";
@@ -18,7 +18,7 @@ interface OpenAILLMOutput {
18
18
  type OpenAIRoleEnum = "system" | "assistant" | "user" | "function" | "tool";
19
19
  export declare function messageToOpenAIRole(message: BaseMessage): OpenAIRoleEnum;
20
20
  export interface ChatOpenAICallOptions extends OpenAICallOptions, BaseFunctionCallOptions {
21
- tools?: StructuredTool[] | OpenAIClient.ChatCompletionTool[];
21
+ tools?: StructuredToolInterface[] | OpenAIClient.ChatCompletionTool[];
22
22
  tool_choice?: OpenAIClient.ChatCompletionToolChoiceOption;
23
23
  promptIndex?: number;
24
24
  response_format?: {
@@ -1,5 +1,5 @@
1
1
  import { type OpenAI as OpenAIClient } from "openai";
2
- import { StructuredTool } from "@langchain/core/tools";
2
+ import type { StructuredToolInterface } from "@langchain/core/tools";
3
3
  export declare function wrapOpenAIClientError(e: any): any;
4
4
  /**
5
5
  * Formats a `StructuredTool` instance into a format that is compatible
@@ -7,6 +7,6 @@ export declare function wrapOpenAIClientError(e: any): any;
7
7
  * function to convert the schema of the `StructuredTool` into a JSON
8
8
  * schema, which is then used as the parameters for the OpenAI function.
9
9
  */
10
- export declare function formatToOpenAIFunction(tool: StructuredTool): OpenAIClient.Chat.ChatCompletionCreateParams.Function;
11
- export declare function formatToOpenAITool(tool: StructuredTool): OpenAIClient.Chat.ChatCompletionTool;
12
- export declare function formatToOpenAIAssistantTool(tool: StructuredTool): OpenAIClient.Beta.AssistantCreateParams.AssistantToolsFunction;
10
+ export declare function formatToOpenAIFunction(tool: StructuredToolInterface): OpenAIClient.Chat.ChatCompletionCreateParams.Function;
11
+ export declare function formatToOpenAITool(tool: StructuredToolInterface): OpenAIClient.Chat.ChatCompletionTool;
12
+ export declare function formatToOpenAIAssistantTool(tool: StructuredToolInterface): OpenAIClient.Beta.AssistantCreateParams.AssistantToolsFunction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/openai",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "OpenAI integrations for LangChain.js",
5
5
  "type": "module",
6
6
  "engines": {
@@ -35,7 +35,7 @@
35
35
  "author": "LangChain",
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
- "@langchain/core": "~0.1.2",
38
+ "@langchain/core": "~0.1.3",
39
39
  "js-tiktoken": "^1.0.7",
40
40
  "openai": "^4.19.0",
41
41
  "zod": "^3.22.3",