@langchain/openai 1.6.2 → 1.7.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/CHANGELOG.md +22 -0
- package/dist/azure/chat_models/common.d.cts +1 -2
- package/dist/azure/chat_models/common.d.cts.map +1 -1
- package/dist/azure/chat_models/common.d.ts +1 -2
- package/dist/azure/chat_models/common.d.ts.map +1 -1
- package/dist/azure/chat_models/completions.d.cts +1 -2
- package/dist/azure/chat_models/completions.d.cts.map +1 -1
- package/dist/azure/chat_models/completions.d.ts +1 -2
- package/dist/azure/chat_models/completions.d.ts.map +1 -1
- package/dist/azure/chat_models/index.cjs +5 -0
- package/dist/azure/chat_models/index.cjs.map +1 -1
- package/dist/azure/chat_models/index.d.cts +3 -2
- package/dist/azure/chat_models/index.d.cts.map +1 -1
- package/dist/azure/chat_models/index.d.ts +3 -2
- package/dist/azure/chat_models/index.d.ts.map +1 -1
- package/dist/azure/chat_models/index.js +5 -0
- package/dist/azure/chat_models/index.js.map +1 -1
- package/dist/azure/chat_models/responses.cjs +5 -0
- package/dist/azure/chat_models/responses.cjs.map +1 -1
- package/dist/azure/chat_models/responses.d.cts +3 -2
- package/dist/azure/chat_models/responses.d.cts.map +1 -1
- package/dist/azure/chat_models/responses.d.ts +3 -2
- package/dist/azure/chat_models/responses.d.ts.map +1 -1
- package/dist/azure/chat_models/responses.js +5 -0
- package/dist/azure/chat_models/responses.js.map +1 -1
- package/dist/azure/embeddings.d.cts +1 -2
- package/dist/azure/embeddings.d.cts.map +1 -1
- package/dist/azure/embeddings.d.ts +1 -2
- package/dist/azure/embeddings.d.ts.map +1 -1
- package/dist/azure/llms.d.cts +1 -2
- package/dist/azure/llms.d.cts.map +1 -1
- package/dist/azure/llms.d.ts.map +1 -1
- package/dist/chat_models/base.cjs +1 -1
- package/dist/chat_models/base.d.cts +4 -4
- package/dist/chat_models/base.d.cts.map +1 -1
- package/dist/chat_models/base.d.ts +4 -4
- package/dist/chat_models/base.d.ts.map +1 -1
- package/dist/chat_models/base.js +1 -1
- package/dist/chat_models/completions.cjs +2 -2
- package/dist/chat_models/completions.cjs.map +1 -1
- package/dist/chat_models/completions.d.cts +2 -3
- package/dist/chat_models/completions.d.cts.map +1 -1
- package/dist/chat_models/completions.d.ts +2 -3
- package/dist/chat_models/completions.d.ts.map +1 -1
- package/dist/chat_models/completions.js +2 -2
- package/dist/chat_models/completions.js.map +1 -1
- package/dist/chat_models/index.cjs +2 -2
- package/dist/chat_models/index.cjs.map +1 -1
- package/dist/chat_models/index.d.cts +4 -4
- package/dist/chat_models/index.d.cts.map +1 -1
- package/dist/chat_models/index.d.ts +4 -4
- package/dist/chat_models/index.d.ts.map +1 -1
- package/dist/chat_models/index.js +2 -2
- package/dist/chat_models/index.js.map +1 -1
- package/dist/chat_models/profiles.cjs +350 -193
- package/dist/chat_models/profiles.cjs.map +1 -1
- package/dist/chat_models/profiles.js +350 -193
- package/dist/chat_models/profiles.js.map +1 -1
- package/dist/chat_models/responses.cjs +2 -2
- package/dist/chat_models/responses.cjs.map +1 -1
- package/dist/chat_models/responses.d.cts +3 -4
- package/dist/chat_models/responses.d.cts.map +1 -1
- package/dist/chat_models/responses.d.ts +3 -4
- package/dist/chat_models/responses.d.ts.map +1 -1
- package/dist/chat_models/responses.js +2 -2
- package/dist/chat_models/responses.js.map +1 -1
- package/dist/converters/completions.d.cts +6 -7
- package/dist/converters/completions.d.cts.map +1 -1
- package/dist/converters/completions.d.ts +6 -7
- package/dist/converters/completions.d.ts.map +1 -1
- package/dist/converters/responses.d.cts +11 -12
- package/dist/converters/responses.d.cts.map +1 -1
- package/dist/converters/responses.d.ts +11 -12
- package/dist/converters/responses.d.ts.map +1 -1
- package/dist/embeddings.d.cts +3 -4
- package/dist/embeddings.d.cts.map +1 -1
- package/dist/embeddings.d.ts +3 -4
- package/dist/embeddings.d.ts.map +1 -1
- package/dist/llms.cjs +1 -1
- package/dist/llms.d.cts.map +1 -1
- package/dist/llms.d.ts.map +1 -1
- package/dist/llms.js +1 -1
- package/dist/tools/applyPatch.d.cts +8 -9
- package/dist/tools/applyPatch.d.cts.map +1 -1
- package/dist/tools/applyPatch.d.ts +8 -9
- package/dist/tools/applyPatch.d.ts.map +1 -1
- package/dist/tools/codeInterpreter.d.cts +5 -6
- package/dist/tools/codeInterpreter.d.cts.map +1 -1
- package/dist/tools/codeInterpreter.d.ts +5 -6
- package/dist/tools/codeInterpreter.d.ts.map +1 -1
- package/dist/tools/computerUse.d.cts +17 -18
- package/dist/tools/computerUse.d.cts.map +1 -1
- package/dist/tools/computerUse.d.ts +17 -18
- package/dist/tools/computerUse.d.ts.map +1 -1
- package/dist/tools/custom.d.cts +2 -3
- package/dist/tools/custom.d.cts.map +1 -1
- package/dist/tools/custom.d.ts +2 -3
- package/dist/tools/custom.d.ts.map +1 -1
- package/dist/tools/dalle.d.cts +3 -4
- package/dist/tools/dalle.d.cts.map +1 -1
- package/dist/tools/dalle.d.ts +3 -4
- package/dist/tools/dalle.d.ts.map +1 -1
- package/dist/tools/fileSearch.d.cts +9 -10
- package/dist/tools/fileSearch.d.cts.map +1 -1
- package/dist/tools/fileSearch.d.ts +9 -10
- package/dist/tools/fileSearch.d.ts.map +1 -1
- package/dist/tools/imageGeneration.d.cts +4 -5
- package/dist/tools/imageGeneration.d.cts.map +1 -1
- package/dist/tools/imageGeneration.d.ts +4 -5
- package/dist/tools/imageGeneration.d.ts.map +1 -1
- package/dist/tools/index.d.cts +2 -2
- package/dist/tools/index.d.cts.map +1 -1
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/localShell.d.cts +5 -6
- package/dist/tools/localShell.d.cts.map +1 -1
- package/dist/tools/localShell.d.ts +5 -6
- package/dist/tools/localShell.d.ts.map +1 -1
- package/dist/tools/mcp.d.cts +8 -9
- package/dist/tools/mcp.d.cts.map +1 -1
- package/dist/tools/mcp.d.ts +8 -9
- package/dist/tools/mcp.d.ts.map +1 -1
- package/dist/tools/shell.d.cts +8 -9
- package/dist/tools/shell.d.cts.map +1 -1
- package/dist/tools/shell.d.ts +8 -9
- package/dist/tools/shell.d.ts.map +1 -1
- package/dist/tools/toolSearch.d.cts +3 -4
- package/dist/tools/toolSearch.d.cts.map +1 -1
- package/dist/tools/toolSearch.d.ts +3 -4
- package/dist/tools/toolSearch.d.ts.map +1 -1
- package/dist/tools/webSearch.d.cts +5 -6
- package/dist/tools/webSearch.d.cts.map +1 -1
- package/dist/tools/webSearch.d.ts +5 -6
- package/dist/tools/webSearch.d.ts.map +1 -1
- package/dist/types.d.cts +16 -16
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +16 -16
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/azure.d.cts +7 -8
- package/dist/utils/azure.d.cts.map +1 -1
- package/dist/utils/azure.d.ts +7 -8
- package/dist/utils/azure.d.ts.map +1 -1
- package/dist/utils/client.d.cts +1 -2
- package/dist/utils/client.d.cts.map +1 -1
- package/dist/utils/client.d.ts +1 -2
- package/dist/utils/client.d.ts.map +1 -1
- package/dist/utils/misc.d.cts +1 -2
- package/dist/utils/misc.d.cts.map +1 -1
- package/dist/utils/misc.d.ts +1 -2
- package/dist/utils/misc.d.ts.map +1 -1
- package/dist/utils/profile.cjs +27 -0
- package/dist/utils/profile.cjs.map +1 -0
- package/dist/utils/profile.js +27 -0
- package/dist/utils/profile.js.map +1 -0
- package/dist/utils/prompts.d.cts +1 -2
- package/dist/utils/prompts.d.cts.map +1 -1
- package/dist/utils/prompts.d.ts +1 -2
- package/dist/utils/prompts.d.ts.map +1 -1
- package/dist/utils/responses_stream_events.cjs +25 -34
- package/dist/utils/responses_stream_events.cjs.map +1 -1
- package/dist/utils/responses_stream_events.d.cts +2 -3
- package/dist/utils/responses_stream_events.d.cts.map +1 -1
- package/dist/utils/responses_stream_events.d.ts +2 -3
- package/dist/utils/responses_stream_events.d.ts.map +1 -1
- package/dist/utils/responses_stream_events.js +25 -34
- package/dist/utils/responses_stream_events.js.map +1 -1
- package/dist/utils/tools.d.cts +4 -5
- package/dist/utils/tools.d.cts.map +1 -1
- package/dist/utils/tools.d.ts +4 -5
- package/dist/utils/tools.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/utils/file_mime_types.cjs +0 -15
- package/dist/utils/file_mime_types.cjs.map +0 -1
- package/dist/utils/file_mime_types.js +0 -15
- package/dist/utils/file_mime_types.js.map +0 -1
package/dist/tools/mcp.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.cts","names":[],"sources":["../../src/tools/mcp.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"mcp.d.cts","names":["OpenAIClient"],"sources":["../../src/tools/mcp.ts"],"mappings":";;;;;;;YAOY;;;;iBAaK;;;;EAIf;;;;;EAKA;;;;;iBAMe;;;;EAIf,SAAS;;;;EAIT,QAAQ;;;;;UAMA;;;;EAIR;;;;;EAKA,0BAA0B;;;;;EAK1B;;;;;EAKA,UAAU;;;;;;;;;EASV,uCAAuC;;;;EAIvC;;;;;iBAMe,+BAA+B;;;;;EAK9C;;;;;iBAMe,4BAA4B;;;;;;;;;;;;;;;EAe3C,aAAa;;;;;YAMH,UAAUA,OAAa,UAAU,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+GlC,IAAI,SAAS,yBAAyB;wBACtC,IAAI,SAAS,sBAAsB"}
|
package/dist/tools/mcp.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ import { ServerTool } from "@langchain/core/tools";
|
|
|
5
5
|
* Available connector IDs for OpenAI's built-in service connectors.
|
|
6
6
|
* These are OpenAI-maintained MCP wrappers for popular services.
|
|
7
7
|
*/
|
|
8
|
-
type McpConnectorId = "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | "connector_googledrive" | "connector_microsoftteams" | "connector_outlookcalendar" | "connector_outlookemail" | "connector_sharepoint";
|
|
8
|
+
export type McpConnectorId = "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | "connector_googledrive" | "connector_microsoftteams" | "connector_outlookcalendar" | "connector_outlookemail" | "connector_sharepoint";
|
|
9
9
|
/**
|
|
10
10
|
* Filter object to specify which tools are allowed.
|
|
11
11
|
*/
|
|
12
|
-
interface McpToolFilter {
|
|
12
|
+
export interface McpToolFilter {
|
|
13
13
|
/**
|
|
14
14
|
* List of allowed tool names.
|
|
15
15
|
*/
|
|
@@ -23,7 +23,7 @@ interface McpToolFilter {
|
|
|
23
23
|
/**
|
|
24
24
|
* Filter object for approval requirements.
|
|
25
25
|
*/
|
|
26
|
-
interface McpApprovalFilter {
|
|
26
|
+
export interface McpApprovalFilter {
|
|
27
27
|
/**
|
|
28
28
|
* Tools that always require approval before execution.
|
|
29
29
|
*/
|
|
@@ -73,7 +73,7 @@ interface McpBaseOptions {
|
|
|
73
73
|
/**
|
|
74
74
|
* Options for connecting to a remote MCP server via URL.
|
|
75
75
|
*/
|
|
76
|
-
interface McpRemoteServerOptions extends McpBaseOptions {
|
|
76
|
+
export interface McpRemoteServerOptions extends McpBaseOptions {
|
|
77
77
|
/**
|
|
78
78
|
* The URL for the MCP server.
|
|
79
79
|
* The server must implement the Streamable HTTP or HTTP/SSE transport protocol.
|
|
@@ -83,7 +83,7 @@ interface McpRemoteServerOptions extends McpBaseOptions {
|
|
|
83
83
|
/**
|
|
84
84
|
* Options for connecting to an OpenAI-maintained service connector.
|
|
85
85
|
*/
|
|
86
|
-
interface McpConnectorOptions extends McpBaseOptions {
|
|
86
|
+
export interface McpConnectorOptions extends McpBaseOptions {
|
|
87
87
|
/**
|
|
88
88
|
* Identifier for the service connector.
|
|
89
89
|
* These are OpenAI-maintained MCP wrappers for popular services.
|
|
@@ -103,7 +103,7 @@ interface McpConnectorOptions extends McpBaseOptions {
|
|
|
103
103
|
/**
|
|
104
104
|
* OpenAI MCP tool type for the Responses API.
|
|
105
105
|
*/
|
|
106
|
-
type McpTool = OpenAI.Responses.Tool.Mcp;
|
|
106
|
+
export type McpTool = OpenAI.Responses.Tool.Mcp;
|
|
107
107
|
/**
|
|
108
108
|
* Creates an MCP tool that connects to a remote MCP server or OpenAI service connector.
|
|
109
109
|
* This allows OpenAI models to access external tools and services via the Model Context Protocol.
|
|
@@ -168,8 +168,7 @@ type McpTool = OpenAI.Responses.Tool.Mcp;
|
|
|
168
168
|
* });
|
|
169
169
|
* ```
|
|
170
170
|
*/
|
|
171
|
-
declare function mcp(options: McpRemoteServerOptions): ServerTool;
|
|
172
|
-
declare function mcp(options: McpConnectorOptions): ServerTool;
|
|
171
|
+
export declare function mcp(options: McpRemoteServerOptions): ServerTool;
|
|
172
|
+
export declare function mcp(options: McpConnectorOptions): ServerTool;
|
|
173
173
|
//#endregion
|
|
174
|
-
export { McpApprovalFilter, McpConnectorId, McpConnectorOptions, McpRemoteServerOptions, McpTool, McpToolFilter, mcp };
|
|
175
174
|
//# sourceMappingURL=mcp.d.ts.map
|
package/dist/tools/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","names":[],"sources":["../../src/tools/mcp.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","names":["OpenAIClient"],"sources":["../../src/tools/mcp.ts"],"mappings":";;;;;;;YAOY;;;;iBAaK;;;;EAIf;;;;;EAKA;;;;;iBAMe;;;;EAIf,SAAS;;;;EAIT,QAAQ;;;;;UAMA;;;;EAIR;;;;;EAKA,0BAA0B;;;;;EAK1B;;;;;EAKA,UAAU;;;;;;;;;EASV,uCAAuC;;;;EAIvC;;;;;iBAMe,+BAA+B;;;;;EAK9C;;;;;iBAMe,4BAA4B;;;;;;;;;;;;;;;EAe3C,aAAa;;;;;YAMH,UAAUA,OAAa,UAAU,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+GlC,IAAI,SAAS,yBAAyB;wBACtC,IAAI,SAAS,sBAAsB"}
|
package/dist/tools/shell.d.cts
CHANGED
|
@@ -6,8 +6,8 @@ import { z } from "zod/v4";
|
|
|
6
6
|
* Re-export action type from OpenAI SDK for convenience.
|
|
7
7
|
* The action contains command details like commands array, timeout, and max output length.
|
|
8
8
|
*/
|
|
9
|
-
type ShellAction = OpenAI.Responses.ResponseFunctionShellToolCall.Action;
|
|
10
|
-
declare const ShellActionSchema: z.ZodObject<{
|
|
9
|
+
export type ShellAction = OpenAI.Responses.ResponseFunctionShellToolCall.Action;
|
|
10
|
+
export declare const ShellActionSchema: z.ZodObject<{
|
|
11
11
|
commands: z.ZodArray<z.ZodString>;
|
|
12
12
|
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
13
13
|
max_output_length: z.ZodOptional<z.ZodNumber>;
|
|
@@ -16,16 +16,16 @@ declare const ShellActionSchema: z.ZodObject<{
|
|
|
16
16
|
* Result of a single shell command execution.
|
|
17
17
|
* Contains stdout, stderr, and the outcome (exit code or timeout).
|
|
18
18
|
*/
|
|
19
|
-
type ShellCommandOutput = OpenAI.Responses.ResponseFunctionShellCallOutputContent;
|
|
19
|
+
export type ShellCommandOutput = OpenAI.Responses.ResponseFunctionShellCallOutputContent;
|
|
20
20
|
/**
|
|
21
21
|
* Outcome type for shell command execution - either exit with code or timeout.
|
|
22
22
|
*/
|
|
23
|
-
type ShellCallOutcome = ShellCommandOutput["outcome"];
|
|
23
|
+
export type ShellCallOutcome = ShellCommandOutput["outcome"];
|
|
24
24
|
/**
|
|
25
25
|
* Result of executing shell commands.
|
|
26
26
|
* Contains an array of outputs (one per command) and the max_output_length parameter.
|
|
27
27
|
*/
|
|
28
|
-
interface ShellResult {
|
|
28
|
+
export interface ShellResult {
|
|
29
29
|
/**
|
|
30
30
|
* Array of command outputs. Each entry corresponds to a command from the action.
|
|
31
31
|
* The order should match the order of commands in the action.
|
|
@@ -40,7 +40,7 @@ interface ShellResult {
|
|
|
40
40
|
/**
|
|
41
41
|
* Options for the Shell tool.
|
|
42
42
|
*/
|
|
43
|
-
interface ShellOptions {
|
|
43
|
+
export interface ShellOptions {
|
|
44
44
|
/**
|
|
45
45
|
* Execute function that handles shell command execution.
|
|
46
46
|
* This function receives the action input containing the commands and limits,
|
|
@@ -84,7 +84,7 @@ interface ShellOptions {
|
|
|
84
84
|
/**
|
|
85
85
|
* OpenAI Shell tool type for the Responses API.
|
|
86
86
|
*/
|
|
87
|
-
type ShellTool = OpenAI.Responses.FunctionShellTool;
|
|
87
|
+
export type ShellTool = OpenAI.Responses.FunctionShellTool;
|
|
88
88
|
/**
|
|
89
89
|
* Creates a Shell tool that allows models to run shell commands through your integration.
|
|
90
90
|
*
|
|
@@ -214,7 +214,6 @@ type ShellTool = OpenAI.Responses.FunctionShellTool;
|
|
|
214
214
|
* - If `max_output_length` exists in the action, always pass it back in the output
|
|
215
215
|
* - Many CLI tools return non-zero exit codes for warnings; still capture stdout/stderr
|
|
216
216
|
*/
|
|
217
|
-
declare function shell(options: ShellOptions): DynamicStructuredTool<typeof ShellActionSchema, ShellAction, unknown, string>;
|
|
217
|
+
export declare function shell(options: ShellOptions): DynamicStructuredTool<typeof ShellActionSchema, ShellAction, unknown, string>;
|
|
218
218
|
//#endregion
|
|
219
|
-
export { ShellAction, ShellActionSchema, ShellCallOutcome, ShellCommandOutput, ShellOptions, ShellResult, ShellTool, shell };
|
|
220
219
|
//# sourceMappingURL=shell.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.d.cts","names":[],"sources":["../../src/tools/shell.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"shell.d.cts","names":["OpenAIClient"],"sources":["../../src/tools/shell.ts"],"mappings":";;;;;;;;YAQY,cACVA,OAAa,UAAU,8BAA8B;qBAG1C,mBAAiB,EAAA;;;;GAY5B,EAAA,KAAA;;;;;YAMU,qBACVA,OAAa,UAAU;;;;YAKb,mBAAmB;;;;;iBAMd;;;;;EAKf,QAAQ;;;;;EAKR;;;;;iBAMe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCf,UAAU,QAAQ,gBAAgB,cAAc,QAAQ;;;;;YAM9C,YAAYA,OAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqI/B,MAAM,SAAS,eAyBT,6BACX,mBACP"}
|
package/dist/tools/shell.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ import { z } from "zod/v4";
|
|
|
6
6
|
* Re-export action type from OpenAI SDK for convenience.
|
|
7
7
|
* The action contains command details like commands array, timeout, and max output length.
|
|
8
8
|
*/
|
|
9
|
-
type ShellAction = OpenAI.Responses.ResponseFunctionShellToolCall.Action;
|
|
10
|
-
declare const ShellActionSchema: z.ZodObject<{
|
|
9
|
+
export type ShellAction = OpenAI.Responses.ResponseFunctionShellToolCall.Action;
|
|
10
|
+
export declare const ShellActionSchema: z.ZodObject<{
|
|
11
11
|
commands: z.ZodArray<z.ZodString>;
|
|
12
12
|
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
13
13
|
max_output_length: z.ZodOptional<z.ZodNumber>;
|
|
@@ -16,16 +16,16 @@ declare const ShellActionSchema: z.ZodObject<{
|
|
|
16
16
|
* Result of a single shell command execution.
|
|
17
17
|
* Contains stdout, stderr, and the outcome (exit code or timeout).
|
|
18
18
|
*/
|
|
19
|
-
type ShellCommandOutput = OpenAI.Responses.ResponseFunctionShellCallOutputContent;
|
|
19
|
+
export type ShellCommandOutput = OpenAI.Responses.ResponseFunctionShellCallOutputContent;
|
|
20
20
|
/**
|
|
21
21
|
* Outcome type for shell command execution - either exit with code or timeout.
|
|
22
22
|
*/
|
|
23
|
-
type ShellCallOutcome = ShellCommandOutput["outcome"];
|
|
23
|
+
export type ShellCallOutcome = ShellCommandOutput["outcome"];
|
|
24
24
|
/**
|
|
25
25
|
* Result of executing shell commands.
|
|
26
26
|
* Contains an array of outputs (one per command) and the max_output_length parameter.
|
|
27
27
|
*/
|
|
28
|
-
interface ShellResult {
|
|
28
|
+
export interface ShellResult {
|
|
29
29
|
/**
|
|
30
30
|
* Array of command outputs. Each entry corresponds to a command from the action.
|
|
31
31
|
* The order should match the order of commands in the action.
|
|
@@ -40,7 +40,7 @@ interface ShellResult {
|
|
|
40
40
|
/**
|
|
41
41
|
* Options for the Shell tool.
|
|
42
42
|
*/
|
|
43
|
-
interface ShellOptions {
|
|
43
|
+
export interface ShellOptions {
|
|
44
44
|
/**
|
|
45
45
|
* Execute function that handles shell command execution.
|
|
46
46
|
* This function receives the action input containing the commands and limits,
|
|
@@ -84,7 +84,7 @@ interface ShellOptions {
|
|
|
84
84
|
/**
|
|
85
85
|
* OpenAI Shell tool type for the Responses API.
|
|
86
86
|
*/
|
|
87
|
-
type ShellTool = OpenAI.Responses.FunctionShellTool;
|
|
87
|
+
export type ShellTool = OpenAI.Responses.FunctionShellTool;
|
|
88
88
|
/**
|
|
89
89
|
* Creates a Shell tool that allows models to run shell commands through your integration.
|
|
90
90
|
*
|
|
@@ -214,7 +214,6 @@ type ShellTool = OpenAI.Responses.FunctionShellTool;
|
|
|
214
214
|
* - If `max_output_length` exists in the action, always pass it back in the output
|
|
215
215
|
* - Many CLI tools return non-zero exit codes for warnings; still capture stdout/stderr
|
|
216
216
|
*/
|
|
217
|
-
declare function shell(options: ShellOptions): DynamicStructuredTool<typeof ShellActionSchema, ShellAction, unknown, string>;
|
|
217
|
+
export declare function shell(options: ShellOptions): DynamicStructuredTool<typeof ShellActionSchema, ShellAction, unknown, string>;
|
|
218
218
|
//#endregion
|
|
219
|
-
export { ShellAction, ShellActionSchema, ShellCallOutcome, ShellCommandOutput, ShellOptions, ShellResult, ShellTool, shell };
|
|
220
219
|
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.d.ts","names":[],"sources":["../../src/tools/shell.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"shell.d.ts","names":["OpenAIClient"],"sources":["../../src/tools/shell.ts"],"mappings":";;;;;;;;YAQY,cACVA,OAAa,UAAU,8BAA8B;qBAG1C,mBAAiB,EAAA;;;;GAY5B,EAAA,KAAA;;;;;YAMU,qBACVA,OAAa,UAAU;;;;YAKb,mBAAmB;;;;;iBAMd;;;;;EAKf,QAAQ;;;;;EAKR;;;;;iBAMe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCf,UAAU,QAAQ,gBAAgB,cAAc,QAAQ;;;;;YAM9C,YAAYA,OAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqI/B,MAAM,SAAS,eAyBT,6BACX,mBACP"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { ServerTool } from "@langchain/core/tools";
|
|
3
3
|
//#region src/tools/toolSearch.d.ts
|
|
4
|
-
interface ToolSearchOptions {
|
|
4
|
+
export interface ToolSearchOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Whether tool search is executed by the server or by the client.
|
|
7
7
|
* - `"server"` (default): OpenAI's servers handle the search internally.
|
|
@@ -17,7 +17,7 @@ interface ToolSearchOptions {
|
|
|
17
17
|
*/
|
|
18
18
|
parameters?: unknown;
|
|
19
19
|
}
|
|
20
|
-
type ToolSearchTool = OpenAI.Responses.ToolSearchTool;
|
|
20
|
+
export type ToolSearchTool = OpenAI.Responses.ToolSearchTool;
|
|
21
21
|
/**
|
|
22
22
|
* Creates a tool search tool that enables OpenAI models to dynamically discover
|
|
23
23
|
* and load tools on-demand from a large pool, rather than requiring all tool
|
|
@@ -72,7 +72,6 @@ type ToolSearchTool = OpenAI.Responses.ToolSearchTool;
|
|
|
72
72
|
* });
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
declare function toolSearch(options?: ToolSearchOptions): ServerTool;
|
|
75
|
+
export declare function toolSearch(options?: ToolSearchOptions): ServerTool;
|
|
76
76
|
//#endregion
|
|
77
|
-
export { ToolSearchOptions, ToolSearchTool, toolSearch };
|
|
78
77
|
//# sourceMappingURL=toolSearch.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolSearch.d.cts","names":[],"sources":["../../src/tools/toolSearch.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"toolSearch.d.cts","names":["OpenAIClient"],"sources":["../../src/tools/toolSearch.ts"],"mappings":";;;iBAGiB;;;;;;EAMf;;;;EAIA;;;;EAIA;;YAGU,iBAAiBA,OAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwDpC,WAAW,UAAU,oBAAoB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { ServerTool } from "@langchain/core/tools";
|
|
3
3
|
//#region src/tools/toolSearch.d.ts
|
|
4
|
-
interface ToolSearchOptions {
|
|
4
|
+
export interface ToolSearchOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Whether tool search is executed by the server or by the client.
|
|
7
7
|
* - `"server"` (default): OpenAI's servers handle the search internally.
|
|
@@ -17,7 +17,7 @@ interface ToolSearchOptions {
|
|
|
17
17
|
*/
|
|
18
18
|
parameters?: unknown;
|
|
19
19
|
}
|
|
20
|
-
type ToolSearchTool = OpenAI.Responses.ToolSearchTool;
|
|
20
|
+
export type ToolSearchTool = OpenAI.Responses.ToolSearchTool;
|
|
21
21
|
/**
|
|
22
22
|
* Creates a tool search tool that enables OpenAI models to dynamically discover
|
|
23
23
|
* and load tools on-demand from a large pool, rather than requiring all tool
|
|
@@ -72,7 +72,6 @@ type ToolSearchTool = OpenAI.Responses.ToolSearchTool;
|
|
|
72
72
|
* });
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
declare function toolSearch(options?: ToolSearchOptions): ServerTool;
|
|
75
|
+
export declare function toolSearch(options?: ToolSearchOptions): ServerTool;
|
|
76
76
|
//#endregion
|
|
77
|
-
export { ToolSearchOptions, ToolSearchTool, toolSearch };
|
|
78
77
|
//# sourceMappingURL=toolSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolSearch.d.ts","names":[],"sources":["../../src/tools/toolSearch.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"toolSearch.d.ts","names":["OpenAIClient"],"sources":["../../src/tools/toolSearch.ts"],"mappings":";;;iBAGiB;;;;;;EAMf;;;;EAIA;;;;EAIA;;YAGU,iBAAiBA,OAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwDpC,WAAW,UAAU,oBAAoB"}
|
|
@@ -4,7 +4,7 @@ import { ServerTool } from "@langchain/core/tools";
|
|
|
4
4
|
/**
|
|
5
5
|
* User location configuration for geographic search refinement.
|
|
6
6
|
*/
|
|
7
|
-
interface WebSearchUserLocation {
|
|
7
|
+
export interface WebSearchUserLocation {
|
|
8
8
|
/**
|
|
9
9
|
* The type of location. Currently only "approximate" is supported.
|
|
10
10
|
*/
|
|
@@ -31,7 +31,7 @@ interface WebSearchUserLocation {
|
|
|
31
31
|
/**
|
|
32
32
|
* Domain filtering configuration for web search.
|
|
33
33
|
*/
|
|
34
|
-
interface WebSearchFilters {
|
|
34
|
+
export interface WebSearchFilters {
|
|
35
35
|
/**
|
|
36
36
|
* Allow-list of up to 100 domains to limit search results.
|
|
37
37
|
* Omit the HTTP/HTTPS prefix (e.g., "openai.com" instead of "https://openai.com/").
|
|
@@ -42,7 +42,7 @@ interface WebSearchFilters {
|
|
|
42
42
|
/**
|
|
43
43
|
* Options for the OpenAI web search tool.
|
|
44
44
|
*/
|
|
45
|
-
interface WebSearchOptions {
|
|
45
|
+
export interface WebSearchOptions {
|
|
46
46
|
/**
|
|
47
47
|
* Domain filtering configuration.
|
|
48
48
|
* Limit results to a specific set of up to 100 domains.
|
|
@@ -62,7 +62,7 @@ interface WebSearchOptions {
|
|
|
62
62
|
/**
|
|
63
63
|
* OpenAI web search tool type for the Responses API.
|
|
64
64
|
*/
|
|
65
|
-
type WebSearchTool = OpenAI.Responses.WebSearchTool;
|
|
65
|
+
export type WebSearchTool = OpenAI.Responses.WebSearchTool;
|
|
66
66
|
/**
|
|
67
67
|
* Creates a web search tool that allows OpenAI models to search the web
|
|
68
68
|
* for up-to-date information before generating a response.
|
|
@@ -122,7 +122,6 @@ type WebSearchTool = OpenAI.Responses.WebSearchTool;
|
|
|
122
122
|
* });
|
|
123
123
|
* ```
|
|
124
124
|
*/
|
|
125
|
-
declare function webSearch(options?: WebSearchOptions): ServerTool;
|
|
125
|
+
export declare function webSearch(options?: WebSearchOptions): ServerTool;
|
|
126
126
|
//#endregion
|
|
127
|
-
export { WebSearchFilters, WebSearchOptions, WebSearchTool, WebSearchUserLocation, webSearch };
|
|
128
127
|
//# sourceMappingURL=webSearch.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webSearch.d.cts","names":[],"sources":["../../src/tools/webSearch.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"webSearch.d.cts","names":["OpenAIClient"],"sources":["../../src/tools/webSearch.ts"],"mappings":";;;;;;iBAMiB;;;;EAIf;;;;;EAKA;;;;EAIA;;;;EAIA;;;;;EAKA;;;;;iBAMe;;;;;;EAMf;;;;;iBAMe;;;;;EAKf,UAAU;;;;;EAKV,eAAe;;;;;EAKf;;;;;YAMU,gBAAgBA,OAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6DnC,UAAU,UAAU,mBAAmB"}
|
|
@@ -4,7 +4,7 @@ import { ServerTool } from "@langchain/core/tools";
|
|
|
4
4
|
/**
|
|
5
5
|
* User location configuration for geographic search refinement.
|
|
6
6
|
*/
|
|
7
|
-
interface WebSearchUserLocation {
|
|
7
|
+
export interface WebSearchUserLocation {
|
|
8
8
|
/**
|
|
9
9
|
* The type of location. Currently only "approximate" is supported.
|
|
10
10
|
*/
|
|
@@ -31,7 +31,7 @@ interface WebSearchUserLocation {
|
|
|
31
31
|
/**
|
|
32
32
|
* Domain filtering configuration for web search.
|
|
33
33
|
*/
|
|
34
|
-
interface WebSearchFilters {
|
|
34
|
+
export interface WebSearchFilters {
|
|
35
35
|
/**
|
|
36
36
|
* Allow-list of up to 100 domains to limit search results.
|
|
37
37
|
* Omit the HTTP/HTTPS prefix (e.g., "openai.com" instead of "https://openai.com/").
|
|
@@ -42,7 +42,7 @@ interface WebSearchFilters {
|
|
|
42
42
|
/**
|
|
43
43
|
* Options for the OpenAI web search tool.
|
|
44
44
|
*/
|
|
45
|
-
interface WebSearchOptions {
|
|
45
|
+
export interface WebSearchOptions {
|
|
46
46
|
/**
|
|
47
47
|
* Domain filtering configuration.
|
|
48
48
|
* Limit results to a specific set of up to 100 domains.
|
|
@@ -62,7 +62,7 @@ interface WebSearchOptions {
|
|
|
62
62
|
/**
|
|
63
63
|
* OpenAI web search tool type for the Responses API.
|
|
64
64
|
*/
|
|
65
|
-
type WebSearchTool = OpenAI.Responses.WebSearchTool;
|
|
65
|
+
export type WebSearchTool = OpenAI.Responses.WebSearchTool;
|
|
66
66
|
/**
|
|
67
67
|
* Creates a web search tool that allows OpenAI models to search the web
|
|
68
68
|
* for up-to-date information before generating a response.
|
|
@@ -122,7 +122,6 @@ type WebSearchTool = OpenAI.Responses.WebSearchTool;
|
|
|
122
122
|
* });
|
|
123
123
|
* ```
|
|
124
124
|
*/
|
|
125
|
-
declare function webSearch(options?: WebSearchOptions): ServerTool;
|
|
125
|
+
export declare function webSearch(options?: WebSearchOptions): ServerTool;
|
|
126
126
|
//#endregion
|
|
127
|
-
export { WebSearchFilters, WebSearchOptions, WebSearchTool, WebSearchUserLocation, webSearch };
|
|
128
127
|
//# sourceMappingURL=webSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webSearch.d.ts","names":[],"sources":["../../src/tools/webSearch.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"webSearch.d.ts","names":["OpenAIClient"],"sources":["../../src/tools/webSearch.ts"],"mappings":";;;;;;iBAMiB;;;;EAIf;;;;;EAKA;;;;EAIA;;;;EAIA;;;;;EAKA;;;;;iBAMe;;;;;;EAMf;;;;;iBAMe;;;;;EAKf,UAAU;;;;;EAKV,eAAe;;;;;EAKf;;;;;YAMU,gBAAgBA,OAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6DnC,UAAU,UAAU,mBAAmB"}
|
package/dist/types.d.cts
CHANGED
|
@@ -7,12 +7,12 @@ import { TiktokenModel } from "js-tiktoken/lite";
|
|
|
7
7
|
/**
|
|
8
8
|
* @see https://platform.openai.com/docs/models
|
|
9
9
|
*/
|
|
10
|
-
type OpenAIChatModelId = OpenAI.ChatModel | (string & NonNullable<unknown>);
|
|
11
|
-
type OpenAIVerbosityParam = "low" | "medium" | "high" | null;
|
|
12
|
-
type OpenAICacheRetentionParam = "in_memory" | "in-memory" | "24h" | null;
|
|
13
|
-
type OpenAIPromptCacheOptions = OpenAI.Responses.ResponseCreateParams["prompt_cache_options"];
|
|
14
|
-
type OpenAIApiKey = ClientOptions["apiKey"];
|
|
15
|
-
declare interface OpenAIBaseInput {
|
|
10
|
+
export type OpenAIChatModelId = OpenAI.ChatModel | (string & NonNullable<unknown>);
|
|
11
|
+
export type OpenAIVerbosityParam = "low" | "medium" | "high" | null;
|
|
12
|
+
export type OpenAICacheRetentionParam = "in_memory" | "in-memory" | "24h" | null;
|
|
13
|
+
export type OpenAIPromptCacheOptions = OpenAI.Responses.ResponseCreateParams["prompt_cache_options"];
|
|
14
|
+
export type OpenAIApiKey = ClientOptions["apiKey"];
|
|
15
|
+
export declare interface OpenAIBaseInput {
|
|
16
16
|
/** Sampling temperature to use */
|
|
17
17
|
temperature: number;
|
|
18
18
|
/**
|
|
@@ -85,8 +85,8 @@ declare interface OpenAIBaseInput {
|
|
|
85
85
|
*/
|
|
86
86
|
verbosity?: OpenAIVerbosityParam;
|
|
87
87
|
}
|
|
88
|
-
type OpenAICoreRequestOptions = OpenAI.RequestOptions;
|
|
89
|
-
interface OpenAICallOptions extends BaseLanguageModelCallOptions {
|
|
88
|
+
export type OpenAICoreRequestOptions = OpenAI.RequestOptions;
|
|
89
|
+
export interface OpenAICallOptions extends BaseLanguageModelCallOptions {
|
|
90
90
|
/**
|
|
91
91
|
* Additional options to pass to the underlying axios request.
|
|
92
92
|
*/
|
|
@@ -95,13 +95,13 @@ interface OpenAICallOptions extends BaseLanguageModelCallOptions {
|
|
|
95
95
|
/**
|
|
96
96
|
* Input to OpenAI class.
|
|
97
97
|
*/
|
|
98
|
-
declare interface OpenAIInput extends OpenAIBaseInput {
|
|
98
|
+
export declare interface OpenAIInput extends OpenAIBaseInput {
|
|
99
99
|
/** Generates `bestOf` completions server side and returns the "best" */
|
|
100
100
|
bestOf?: number;
|
|
101
101
|
/** Batch size to use when passing multiple documents to generate */
|
|
102
102
|
batchSize: number;
|
|
103
103
|
}
|
|
104
|
-
interface OpenAIChatInput extends OpenAIBaseInput {
|
|
104
|
+
export interface OpenAIChatInput extends OpenAIBaseInput {
|
|
105
105
|
/**
|
|
106
106
|
* Whether to return log probabilities of the output tokens or not.
|
|
107
107
|
* If true, returns the log probabilities of each output token returned in the content of message.
|
|
@@ -177,7 +177,7 @@ interface OpenAIChatInput extends OpenAIBaseInput {
|
|
|
177
177
|
*/
|
|
178
178
|
promptCacheOptions?: OpenAIPromptCacheOptions;
|
|
179
179
|
}
|
|
180
|
-
interface AzureOpenAIInput {
|
|
180
|
+
export interface AzureOpenAIInput {
|
|
181
181
|
/**
|
|
182
182
|
* API version to use when making requests to Azure OpenAI.
|
|
183
183
|
*/
|
|
@@ -235,7 +235,7 @@ interface AzureOpenAIInput {
|
|
|
235
235
|
*/
|
|
236
236
|
azureADTokenProvider?: () => Promise<string>;
|
|
237
237
|
}
|
|
238
|
-
interface AzureOpenAIChatInput extends OpenAIChatInput, AzureOpenAIInput {
|
|
238
|
+
export interface AzureOpenAIChatInput extends OpenAIChatInput, AzureOpenAIInput {
|
|
239
239
|
openAIApiVersion?: string;
|
|
240
240
|
openAIBasePath?: string;
|
|
241
241
|
deploymentName?: string;
|
|
@@ -252,7 +252,7 @@ type ChatOpenAIResponseFormatJSONSchema = Omit<ResponseFormatJSONSchema, "json_s
|
|
|
252
252
|
/**
|
|
253
253
|
* The summary of a model's reasoning step.
|
|
254
254
|
*/
|
|
255
|
-
type ChatOpenAIReasoningSummary = Omit<OpenAI.Responses.ResponseReasoningItem, "summary"> & {
|
|
255
|
+
export type ChatOpenAIReasoningSummary = Omit<OpenAI.Responses.ResponseReasoningItem, "summary"> & {
|
|
256
256
|
/**
|
|
257
257
|
* The summary of the reasoning step. The index field will be populated if the response was
|
|
258
258
|
* streamed. This allows LangChain to recompose the reasoning summary output correctly when the
|
|
@@ -262,8 +262,8 @@ type ChatOpenAIReasoningSummary = Omit<OpenAI.Responses.ResponseReasoningItem, "
|
|
|
262
262
|
index?: number;
|
|
263
263
|
}>;
|
|
264
264
|
};
|
|
265
|
-
type ChatOpenAIResponseFormat = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatTextGrammar | ResponseFormatTextPython | ChatOpenAIResponseFormatJSONSchema;
|
|
266
|
-
type ResponseFormatConfiguration = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema;
|
|
265
|
+
export type ChatOpenAIResponseFormat = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatTextGrammar | ResponseFormatTextPython | ChatOpenAIResponseFormatJSONSchema;
|
|
266
|
+
export type ResponseFormatConfiguration = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema;
|
|
267
267
|
//#endregion
|
|
268
|
-
export {
|
|
268
|
+
export type { TiktokenModel };
|
|
269
269
|
//# sourceMappingURL=types.d.cts.map
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":["OpenAIClient"],"sources":["../src/types.ts"],"mappings":";;;;;;;;;YAoBY,oBACRA,OAAa,sBACH;YAEF;YAEA;YAKA,2BACVA,OAAa,UAAU;YAEb,eAAe;yBAEF;;EAEvB;;;;;EAMA;;;;;;EAOA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,YAAY;;EAGZ;;EAGA;;;;;EAMA;;;;;;EAOA;;EAGA,OAAO;;;;;EAOP,cAAc;;;;;EAMd;;EAEA;;;;EAKA;;;;;;EAOA,eAAe;;;;;EAKf,SAAS;;;;EAKT,YAAY;;YAGF,2BAA2BA,OAAa;iBAEnC,0BAA0B;;;;EAIzC,UAAU;;;;;yBAMa,oBAAoB;;EAE3C;;EAGA;;iBAGe,wBAAwB;;;;;EAKvC;;;;;EAMA;;EAGA,iBAAiBA,OAAa,KAAK;;;;;EAMnC;;;;;EAMA;;;;;;;;;;;;;EAcA,aAAa,MAAMA,OAAa,KAAK;;;;;;EAOrC,QAAQA,OAAa,KAAK;;;;;;;EAQ1B,YAAYA,OAAa;;;;;;;EAQzB;;;;;EAMA,eAAeA,OAAa,UAAU;;;;;;EAOtC;;;;EAKA,uBAAuB;;;;EAKvB,qBAAqB;;iBAGN;;;;EAIf;;;;EAKA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;;EASA;;;;;;;;;EAUA;;;;;;EAOA;;;;;;EAOA;;;;;EAMA,6BAA6B;;iBAGd,6BACP,iBAAiB;EACzB;EACA;EACA;;KAGG,qCAAqC,KACxC;EAGA,aAAa,KAAK;;;;;IAMhB,QAAQ,sBAAsB;;;;;;YAOtB,6BAA6B,KACvCA,OAAa,UAAU;;;;;;EAQvB,SAAS,MACPA,OAAa,UAAU,sBAAsB;IAAY;;;YAIjD,2BACR,qBACA,2BACA,4BACA,2BACA;YAEQ,8BACR,qBACA,2BACA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -7,12 +7,12 @@ import { TiktokenModel } from "js-tiktoken/lite";
|
|
|
7
7
|
/**
|
|
8
8
|
* @see https://platform.openai.com/docs/models
|
|
9
9
|
*/
|
|
10
|
-
type OpenAIChatModelId = OpenAI.ChatModel | (string & NonNullable<unknown>);
|
|
11
|
-
type OpenAIVerbosityParam = "low" | "medium" | "high" | null;
|
|
12
|
-
type OpenAICacheRetentionParam = "in_memory" | "in-memory" | "24h" | null;
|
|
13
|
-
type OpenAIPromptCacheOptions = OpenAI.Responses.ResponseCreateParams["prompt_cache_options"];
|
|
14
|
-
type OpenAIApiKey = ClientOptions["apiKey"];
|
|
15
|
-
declare interface OpenAIBaseInput {
|
|
10
|
+
export type OpenAIChatModelId = OpenAI.ChatModel | (string & NonNullable<unknown>);
|
|
11
|
+
export type OpenAIVerbosityParam = "low" | "medium" | "high" | null;
|
|
12
|
+
export type OpenAICacheRetentionParam = "in_memory" | "in-memory" | "24h" | null;
|
|
13
|
+
export type OpenAIPromptCacheOptions = OpenAI.Responses.ResponseCreateParams["prompt_cache_options"];
|
|
14
|
+
export type OpenAIApiKey = ClientOptions["apiKey"];
|
|
15
|
+
export declare interface OpenAIBaseInput {
|
|
16
16
|
/** Sampling temperature to use */
|
|
17
17
|
temperature: number;
|
|
18
18
|
/**
|
|
@@ -85,8 +85,8 @@ declare interface OpenAIBaseInput {
|
|
|
85
85
|
*/
|
|
86
86
|
verbosity?: OpenAIVerbosityParam;
|
|
87
87
|
}
|
|
88
|
-
type OpenAICoreRequestOptions = OpenAI.RequestOptions;
|
|
89
|
-
interface OpenAICallOptions extends BaseLanguageModelCallOptions {
|
|
88
|
+
export type OpenAICoreRequestOptions = OpenAI.RequestOptions;
|
|
89
|
+
export interface OpenAICallOptions extends BaseLanguageModelCallOptions {
|
|
90
90
|
/**
|
|
91
91
|
* Additional options to pass to the underlying axios request.
|
|
92
92
|
*/
|
|
@@ -95,13 +95,13 @@ interface OpenAICallOptions extends BaseLanguageModelCallOptions {
|
|
|
95
95
|
/**
|
|
96
96
|
* Input to OpenAI class.
|
|
97
97
|
*/
|
|
98
|
-
declare interface OpenAIInput extends OpenAIBaseInput {
|
|
98
|
+
export declare interface OpenAIInput extends OpenAIBaseInput {
|
|
99
99
|
/** Generates `bestOf` completions server side and returns the "best" */
|
|
100
100
|
bestOf?: number;
|
|
101
101
|
/** Batch size to use when passing multiple documents to generate */
|
|
102
102
|
batchSize: number;
|
|
103
103
|
}
|
|
104
|
-
interface OpenAIChatInput extends OpenAIBaseInput {
|
|
104
|
+
export interface OpenAIChatInput extends OpenAIBaseInput {
|
|
105
105
|
/**
|
|
106
106
|
* Whether to return log probabilities of the output tokens or not.
|
|
107
107
|
* If true, returns the log probabilities of each output token returned in the content of message.
|
|
@@ -177,7 +177,7 @@ interface OpenAIChatInput extends OpenAIBaseInput {
|
|
|
177
177
|
*/
|
|
178
178
|
promptCacheOptions?: OpenAIPromptCacheOptions;
|
|
179
179
|
}
|
|
180
|
-
interface AzureOpenAIInput {
|
|
180
|
+
export interface AzureOpenAIInput {
|
|
181
181
|
/**
|
|
182
182
|
* API version to use when making requests to Azure OpenAI.
|
|
183
183
|
*/
|
|
@@ -235,7 +235,7 @@ interface AzureOpenAIInput {
|
|
|
235
235
|
*/
|
|
236
236
|
azureADTokenProvider?: () => Promise<string>;
|
|
237
237
|
}
|
|
238
|
-
interface AzureOpenAIChatInput extends OpenAIChatInput, AzureOpenAIInput {
|
|
238
|
+
export interface AzureOpenAIChatInput extends OpenAIChatInput, AzureOpenAIInput {
|
|
239
239
|
openAIApiVersion?: string;
|
|
240
240
|
openAIBasePath?: string;
|
|
241
241
|
deploymentName?: string;
|
|
@@ -252,7 +252,7 @@ type ChatOpenAIResponseFormatJSONSchema = Omit<ResponseFormatJSONSchema, "json_s
|
|
|
252
252
|
/**
|
|
253
253
|
* The summary of a model's reasoning step.
|
|
254
254
|
*/
|
|
255
|
-
type ChatOpenAIReasoningSummary = Omit<OpenAI.Responses.ResponseReasoningItem, "summary"> & {
|
|
255
|
+
export type ChatOpenAIReasoningSummary = Omit<OpenAI.Responses.ResponseReasoningItem, "summary"> & {
|
|
256
256
|
/**
|
|
257
257
|
* The summary of the reasoning step. The index field will be populated if the response was
|
|
258
258
|
* streamed. This allows LangChain to recompose the reasoning summary output correctly when the
|
|
@@ -262,8 +262,8 @@ type ChatOpenAIReasoningSummary = Omit<OpenAI.Responses.ResponseReasoningItem, "
|
|
|
262
262
|
index?: number;
|
|
263
263
|
}>;
|
|
264
264
|
};
|
|
265
|
-
type ChatOpenAIResponseFormat = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatTextGrammar | ResponseFormatTextPython | ChatOpenAIResponseFormatJSONSchema;
|
|
266
|
-
type ResponseFormatConfiguration = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema;
|
|
265
|
+
export type ChatOpenAIResponseFormat = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatTextGrammar | ResponseFormatTextPython | ChatOpenAIResponseFormatJSONSchema;
|
|
266
|
+
export type ResponseFormatConfiguration = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema;
|
|
267
267
|
//#endregion
|
|
268
|
-
export {
|
|
268
|
+
export type { TiktokenModel };
|
|
269
269
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":["OpenAIClient"],"sources":["../src/types.ts"],"mappings":";;;;;;;;;YAoBY,oBACRA,OAAa,sBACH;YAEF;YAEA;YAKA,2BACVA,OAAa,UAAU;YAEb,eAAe;yBAEF;;EAEvB;;;;;EAMA;;;;;;EAOA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,YAAY;;EAGZ;;EAGA;;;;;EAMA;;;;;;EAOA;;EAGA,OAAO;;;;;EAOP,cAAc;;;;;EAMd;;EAEA;;;;EAKA;;;;;;EAOA,eAAe;;;;;EAKf,SAAS;;;;EAKT,YAAY;;YAGF,2BAA2BA,OAAa;iBAEnC,0BAA0B;;;;EAIzC,UAAU;;;;;yBAMa,oBAAoB;;EAE3C;;EAGA;;iBAGe,wBAAwB;;;;;EAKvC;;;;;EAMA;;EAGA,iBAAiBA,OAAa,KAAK;;;;;EAMnC;;;;;EAMA;;;;;;;;;;;;;EAcA,aAAa,MAAMA,OAAa,KAAK;;;;;;EAOrC,QAAQA,OAAa,KAAK;;;;;;;EAQ1B,YAAYA,OAAa;;;;;;;EAQzB;;;;;EAMA,eAAeA,OAAa,UAAU;;;;;;EAOtC;;;;EAKA,uBAAuB;;;;EAKvB,qBAAqB;;iBAGN;;;;EAIf;;;;EAKA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;;EASA;;;;;;;;;EAUA;;;;;;EAOA;;;;;;EAOA;;;;;EAMA,6BAA6B;;iBAGd,6BACP,iBAAiB;EACzB;EACA;EACA;;KAGG,qCAAqC,KACxC;EAGA,aAAa,KAAK;;;;;IAMhB,QAAQ,sBAAsB;;;;;;YAOtB,6BAA6B,KACvCA,OAAa,UAAU;;;;;;EAQvB,SAAS,MACPA,OAAa,UAAU,sBAAsB;IAAY;;;YAIjD,2BACR,qBACA,2BACA,4BACA,2BACA;YAEQ,8BACR,qBACA,2BACA"}
|
package/dist/utils/azure.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/utils/azure.d.ts
|
|
2
|
-
interface OpenAIEndpointConfig {
|
|
2
|
+
export interface OpenAIEndpointConfig {
|
|
3
3
|
azureOpenAIApiDeploymentName?: string;
|
|
4
4
|
azureOpenAIApiInstanceName?: string;
|
|
5
5
|
azureOpenAIApiKey?: string;
|
|
@@ -32,13 +32,13 @@ interface OpenAIEndpointConfig {
|
|
|
32
32
|
*
|
|
33
33
|
* @returns {string | undefined} The generated (Azure) OpenAI endpoint URL.
|
|
34
34
|
*/
|
|
35
|
-
declare function getEndpoint(config: OpenAIEndpointConfig): string | null | undefined;
|
|
35
|
+
export declare function getEndpoint(config: OpenAIEndpointConfig): string | null | undefined;
|
|
36
36
|
type HeaderValue = string | undefined | null;
|
|
37
|
-
type HeadersLike = Headers | readonly HeaderValue[][] | Record<string, HeaderValue | readonly HeaderValue[]> | undefined | null | {
|
|
37
|
+
export type HeadersLike = Headers | readonly HeaderValue[][] | Record<string, HeaderValue | readonly HeaderValue[]> | undefined | null | {
|
|
38
38
|
values: Headers;
|
|
39
39
|
[key: string]: unknown;
|
|
40
40
|
};
|
|
41
|
-
declare function isHeaders(headers: unknown): headers is Headers;
|
|
41
|
+
export declare function isHeaders(headers: unknown): headers is Headers;
|
|
42
42
|
/**
|
|
43
43
|
* Normalizes various header formats into a consistent Record format.
|
|
44
44
|
*
|
|
@@ -68,9 +68,8 @@ declare function isHeaders(headers: unknown): headers is Headers;
|
|
|
68
68
|
* const normalized3 = normalizeHeaders(headers3);
|
|
69
69
|
* ```
|
|
70
70
|
*/
|
|
71
|
-
declare function normalizeHeaders(headers: HeadersLike): Record<string, HeaderValue | readonly HeaderValue[]>;
|
|
72
|
-
declare function getFormattedEnv(): string;
|
|
73
|
-
declare function getHeadersWithUserAgent(headers: HeadersLike, isAzure?: boolean, version?: string): Record<string, string>;
|
|
71
|
+
export declare function normalizeHeaders(headers: HeadersLike): Record<string, HeaderValue | readonly HeaderValue[]>;
|
|
72
|
+
export declare function getFormattedEnv(): string;
|
|
73
|
+
export declare function getHeadersWithUserAgent(headers: HeadersLike, isAzure?: boolean, version?: string): Record<string, string>;
|
|
74
74
|
//#endregion
|
|
75
|
-
export { HeadersLike, OpenAIEndpointConfig, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, normalizeHeaders };
|
|
76
75
|
//# sourceMappingURL=azure.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azure.d.cts","names":[],"sources":["../../src/utils/azure.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"azure.d.cts","names":[],"sources":["../../src/utils/azure.ts"],"mappings":";iBAGiB;EACf;EACA;EACA;EACA,6BAA6B;EAC7B;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2Bc,YAAY,QAAQ;KA2C/B;YACO,cACR,mBACS,kBACT,eAAe,uBAAuB;EAIpC,QAAQ;GAAU;;wBAER,UAAU,mBAAmB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsCxC,iBACd,SAAS,cACR,eAAe,uBAAuB;wBAgCzB;wBAUA,wBACd,SAAS,aACT,mBACA,mBACC"}
|
package/dist/utils/azure.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/utils/azure.d.ts
|
|
2
|
-
interface OpenAIEndpointConfig {
|
|
2
|
+
export interface OpenAIEndpointConfig {
|
|
3
3
|
azureOpenAIApiDeploymentName?: string;
|
|
4
4
|
azureOpenAIApiInstanceName?: string;
|
|
5
5
|
azureOpenAIApiKey?: string;
|
|
@@ -32,13 +32,13 @@ interface OpenAIEndpointConfig {
|
|
|
32
32
|
*
|
|
33
33
|
* @returns {string | undefined} The generated (Azure) OpenAI endpoint URL.
|
|
34
34
|
*/
|
|
35
|
-
declare function getEndpoint(config: OpenAIEndpointConfig): string | null | undefined;
|
|
35
|
+
export declare function getEndpoint(config: OpenAIEndpointConfig): string | null | undefined;
|
|
36
36
|
type HeaderValue = string | undefined | null;
|
|
37
|
-
type HeadersLike = Headers | readonly HeaderValue[][] | Record<string, HeaderValue | readonly HeaderValue[]> | undefined | null | {
|
|
37
|
+
export type HeadersLike = Headers | readonly HeaderValue[][] | Record<string, HeaderValue | readonly HeaderValue[]> | undefined | null | {
|
|
38
38
|
values: Headers;
|
|
39
39
|
[key: string]: unknown;
|
|
40
40
|
};
|
|
41
|
-
declare function isHeaders(headers: unknown): headers is Headers;
|
|
41
|
+
export declare function isHeaders(headers: unknown): headers is Headers;
|
|
42
42
|
/**
|
|
43
43
|
* Normalizes various header formats into a consistent Record format.
|
|
44
44
|
*
|
|
@@ -68,9 +68,8 @@ declare function isHeaders(headers: unknown): headers is Headers;
|
|
|
68
68
|
* const normalized3 = normalizeHeaders(headers3);
|
|
69
69
|
* ```
|
|
70
70
|
*/
|
|
71
|
-
declare function normalizeHeaders(headers: HeadersLike): Record<string, HeaderValue | readonly HeaderValue[]>;
|
|
72
|
-
declare function getFormattedEnv(): string;
|
|
73
|
-
declare function getHeadersWithUserAgent(headers: HeadersLike, isAzure?: boolean, version?: string): Record<string, string>;
|
|
71
|
+
export declare function normalizeHeaders(headers: HeadersLike): Record<string, HeaderValue | readonly HeaderValue[]>;
|
|
72
|
+
export declare function getFormattedEnv(): string;
|
|
73
|
+
export declare function getHeadersWithUserAgent(headers: HeadersLike, isAzure?: boolean, version?: string): Record<string, string>;
|
|
74
74
|
//#endregion
|
|
75
|
-
export { HeadersLike, OpenAIEndpointConfig, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, normalizeHeaders };
|
|
76
75
|
//# sourceMappingURL=azure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azure.d.ts","names":[],"sources":["../../src/utils/azure.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"azure.d.ts","names":[],"sources":["../../src/utils/azure.ts"],"mappings":";iBAGiB;EACf;EACA;EACA;EACA,6BAA6B;EAC7B;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2Bc,YAAY,QAAQ;KA2C/B;YACO,cACR,mBACS,kBACT,eAAe,uBAAuB;EAIpC,QAAQ;GAAU;;wBAER,UAAU,mBAAmB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsCxC,iBACd,SAAS,cACR,eAAe,uBAAuB;wBAgCzB;wBAUA,wBACd,SAAS,aACT,mBACA,mBACC"}
|