@langchain/openai 1.8.0 → 1.8.1
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 +8 -0
- package/dist/azure/chat_models/common.cjs +1 -2
- package/dist/azure/chat_models/common.d.cts +1 -3
- package/dist/azure/chat_models/common.d.cts.map +1 -1
- package/dist/azure/chat_models/common.d.ts +1 -3
- package/dist/azure/chat_models/common.d.ts.map +1 -1
- package/dist/azure/chat_models/common.js +1 -2
- package/dist/azure/chat_models/completions.cjs +1 -2
- package/dist/azure/chat_models/completions.d.cts +1 -3
- package/dist/azure/chat_models/completions.d.cts.map +1 -1
- package/dist/azure/chat_models/completions.d.ts +1 -3
- package/dist/azure/chat_models/completions.d.ts.map +1 -1
- package/dist/azure/chat_models/completions.js +1 -2
- package/dist/azure/chat_models/index.cjs +2 -3
- package/dist/azure/chat_models/index.d.cts +1 -3
- package/dist/azure/chat_models/index.d.cts.map +1 -1
- package/dist/azure/chat_models/index.d.ts +1 -3
- package/dist/azure/chat_models/index.d.ts.map +1 -1
- package/dist/azure/chat_models/index.js +2 -3
- package/dist/azure/chat_models/responses.cjs +2 -3
- package/dist/azure/chat_models/responses.d.cts +1 -3
- package/dist/azure/chat_models/responses.d.cts.map +1 -1
- package/dist/azure/chat_models/responses.d.ts +1 -3
- package/dist/azure/chat_models/responses.d.ts.map +1 -1
- package/dist/azure/chat_models/responses.js +2 -3
- package/dist/azure/embeddings.cjs +3 -4
- package/dist/azure/embeddings.d.cts +1 -3
- package/dist/azure/embeddings.d.cts.map +1 -1
- package/dist/azure/embeddings.d.ts +1 -3
- package/dist/azure/embeddings.d.ts.map +1 -1
- package/dist/azure/embeddings.js +3 -4
- package/dist/azure/llms.cjs +2 -3
- package/dist/azure/llms.d.cts +1 -3
- package/dist/azure/llms.d.cts.map +1 -1
- package/dist/azure/llms.d.ts +1 -3
- package/dist/azure/llms.d.ts.map +1 -1
- package/dist/azure/llms.js +2 -3
- package/dist/chat_models/base.cjs +5 -6
- package/dist/chat_models/base.d.cts +1 -3
- package/dist/chat_models/base.d.cts.map +1 -1
- package/dist/chat_models/base.d.ts +1 -3
- package/dist/chat_models/base.d.ts.map +1 -1
- package/dist/chat_models/base.js +5 -6
- package/dist/chat_models/completions.cjs +1 -2
- package/dist/chat_models/completions.d.cts +1 -2
- package/dist/chat_models/completions.d.cts.map +1 -1
- package/dist/chat_models/completions.d.ts +1 -2
- package/dist/chat_models/completions.d.ts.map +1 -1
- package/dist/chat_models/completions.js +1 -2
- package/dist/chat_models/index.cjs +3 -4
- package/dist/chat_models/index.d.cts +2 -4
- package/dist/chat_models/index.d.cts.map +1 -1
- package/dist/chat_models/index.d.ts +2 -4
- package/dist/chat_models/index.d.ts.map +1 -1
- package/dist/chat_models/index.js +3 -4
- package/dist/chat_models/profiles.cjs +1 -2
- package/dist/chat_models/profiles.js +1 -2
- package/dist/chat_models/responses.cjs +3 -4
- package/dist/chat_models/responses.d.cts +1 -3
- package/dist/chat_models/responses.d.cts.map +1 -1
- package/dist/chat_models/responses.d.ts +1 -3
- package/dist/chat_models/responses.d.ts.map +1 -1
- package/dist/chat_models/responses.js +3 -4
- package/dist/converters/completions.cjs +2 -3
- package/dist/converters/completions.d.cts +0 -2
- package/dist/converters/completions.d.cts.map +1 -1
- package/dist/converters/completions.d.ts +0 -2
- package/dist/converters/completions.d.ts.map +1 -1
- package/dist/converters/completions.js +2 -3
- package/dist/converters/responses.cjs +2 -4
- package/dist/converters/responses.cjs.map +1 -1
- package/dist/converters/responses.d.cts +1 -2
- package/dist/converters/responses.d.cts.map +1 -1
- package/dist/converters/responses.d.ts +1 -2
- package/dist/converters/responses.d.ts.map +1 -1
- package/dist/converters/responses.js +2 -4
- package/dist/converters/responses.js.map +1 -1
- package/dist/decisions/index.cjs +2 -3
- package/dist/decisions/index.d.cts +0 -2
- package/dist/decisions/index.d.cts.map +1 -1
- package/dist/decisions/index.d.ts +0 -2
- package/dist/decisions/index.d.ts.map +1 -1
- package/dist/decisions/index.js +2 -3
- package/dist/decisions/input.cjs +1 -2
- package/dist/decisions/input.js +1 -2
- package/dist/decisions/types.cjs +1 -2
- package/dist/decisions/types.d.cts +0 -2
- package/dist/decisions/types.d.cts.map +1 -1
- package/dist/decisions/types.d.ts +0 -2
- package/dist/decisions/types.d.ts.map +1 -1
- package/dist/decisions/types.js +1 -2
- package/dist/embeddings.cjs +2 -3
- package/dist/embeddings.d.cts +0 -2
- package/dist/embeddings.d.cts.map +1 -1
- package/dist/embeddings.d.ts +0 -2
- package/dist/embeddings.d.ts.map +1 -1
- package/dist/embeddings.js +2 -3
- package/dist/index.cjs +38 -38
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +14 -14
- package/dist/llms.cjs +3 -4
- package/dist/llms.d.cts +0 -2
- package/dist/llms.d.cts.map +1 -1
- package/dist/llms.d.ts +0 -2
- package/dist/llms.d.ts.map +1 -1
- package/dist/llms.js +3 -4
- package/dist/tools/applyPatch.cjs +1 -2
- package/dist/tools/applyPatch.d.cts +0 -2
- package/dist/tools/applyPatch.d.cts.map +1 -1
- package/dist/tools/applyPatch.d.ts +0 -2
- package/dist/tools/applyPatch.d.ts.map +1 -1
- package/dist/tools/applyPatch.js +1 -2
- package/dist/tools/codeInterpreter.cjs +1 -2
- package/dist/tools/codeInterpreter.d.cts +0 -2
- package/dist/tools/codeInterpreter.d.cts.map +1 -1
- package/dist/tools/codeInterpreter.d.ts +0 -2
- package/dist/tools/codeInterpreter.d.ts.map +1 -1
- package/dist/tools/codeInterpreter.js +1 -2
- package/dist/tools/computerUse.cjs +1 -2
- package/dist/tools/computerUse.d.cts +0 -2
- package/dist/tools/computerUse.d.cts.map +1 -1
- package/dist/tools/computerUse.d.ts +0 -2
- package/dist/tools/computerUse.d.ts.map +1 -1
- package/dist/tools/computerUse.js +1 -2
- package/dist/tools/custom.cjs +1 -2
- package/dist/tools/custom.d.cts +0 -2
- package/dist/tools/custom.d.cts.map +1 -1
- package/dist/tools/custom.d.ts +0 -2
- package/dist/tools/custom.d.ts.map +1 -1
- package/dist/tools/custom.js +1 -2
- package/dist/tools/dalle.cjs +1 -2
- package/dist/tools/dalle.d.cts +0 -2
- package/dist/tools/dalle.d.cts.map +1 -1
- package/dist/tools/dalle.d.ts +0 -2
- package/dist/tools/dalle.d.ts.map +1 -1
- package/dist/tools/dalle.js +1 -2
- package/dist/tools/fileSearch.cjs +1 -2
- package/dist/tools/fileSearch.d.cts +0 -2
- package/dist/tools/fileSearch.d.cts.map +1 -1
- package/dist/tools/fileSearch.d.ts +0 -2
- package/dist/tools/fileSearch.d.ts.map +1 -1
- package/dist/tools/fileSearch.js +1 -2
- package/dist/tools/imageGeneration.cjs +1 -2
- package/dist/tools/imageGeneration.d.cts +0 -2
- package/dist/tools/imageGeneration.d.cts.map +1 -1
- package/dist/tools/imageGeneration.d.ts +0 -2
- package/dist/tools/imageGeneration.d.ts.map +1 -1
- package/dist/tools/imageGeneration.js +1 -2
- package/dist/tools/index.cjs +1 -2
- package/dist/tools/index.d.cts +0 -2
- package/dist/tools/index.d.cts.map +1 -1
- package/dist/tools/index.d.ts +0 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -2
- package/dist/tools/localShell.cjs +1 -2
- package/dist/tools/localShell.d.cts +0 -2
- package/dist/tools/localShell.d.cts.map +1 -1
- package/dist/tools/localShell.d.ts +0 -2
- package/dist/tools/localShell.d.ts.map +1 -1
- package/dist/tools/localShell.js +1 -2
- package/dist/tools/mcp.cjs +1 -2
- package/dist/tools/mcp.d.cts +1 -2
- package/dist/tools/mcp.d.cts.map +1 -1
- package/dist/tools/mcp.d.ts +1 -2
- package/dist/tools/mcp.d.ts.map +1 -1
- package/dist/tools/mcp.js +1 -2
- package/dist/tools/shell.cjs +1 -2
- package/dist/tools/shell.d.cts +0 -2
- package/dist/tools/shell.d.cts.map +1 -1
- package/dist/tools/shell.d.ts +0 -2
- package/dist/tools/shell.d.ts.map +1 -1
- package/dist/tools/shell.js +1 -2
- package/dist/tools/toolSearch.cjs +1 -2
- package/dist/tools/toolSearch.d.cts +0 -2
- package/dist/tools/toolSearch.d.cts.map +1 -1
- package/dist/tools/toolSearch.d.ts +0 -2
- package/dist/tools/toolSearch.d.ts.map +1 -1
- package/dist/tools/toolSearch.js +1 -2
- package/dist/tools/webSearch.cjs +1 -2
- package/dist/tools/webSearch.d.cts +0 -2
- package/dist/tools/webSearch.d.cts.map +1 -1
- package/dist/tools/webSearch.d.ts +0 -2
- package/dist/tools/webSearch.d.ts.map +1 -1
- package/dist/tools/webSearch.js +1 -2
- package/dist/types.d.cts +0 -2
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +0 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/azure.cjs +1 -2
- package/dist/utils/azure.d.cts +1 -2
- package/dist/utils/azure.d.cts.map +1 -1
- package/dist/utils/azure.d.ts +1 -2
- package/dist/utils/azure.d.ts.map +1 -1
- package/dist/utils/azure.js +1 -2
- package/dist/utils/client.cjs +1 -2
- package/dist/utils/client.d.cts +0 -2
- package/dist/utils/client.d.cts.map +1 -1
- package/dist/utils/client.d.ts +0 -2
- package/dist/utils/client.d.ts.map +1 -1
- package/dist/utils/client.js +1 -2
- package/dist/utils/errors.cjs +1 -2
- package/dist/utils/errors.js +1 -2
- package/dist/utils/misc.cjs +1 -2
- package/dist/utils/misc.d.cts +0 -2
- package/dist/utils/misc.d.cts.map +1 -1
- package/dist/utils/misc.d.ts +0 -2
- package/dist/utils/misc.d.ts.map +1 -1
- package/dist/utils/misc.js +1 -2
- package/dist/utils/output.cjs +1 -2
- package/dist/utils/output.js +1 -2
- package/dist/utils/profile.cjs +1 -2
- package/dist/utils/profile.js +1 -2
- package/dist/utils/prompts.cjs +1 -2
- package/dist/utils/prompts.d.cts +0 -2
- package/dist/utils/prompts.d.cts.map +1 -1
- package/dist/utils/prompts.d.ts +0 -2
- package/dist/utils/prompts.d.ts.map +1 -1
- package/dist/utils/prompts.js +1 -2
- package/dist/utils/responses_stream_events.cjs +2 -2
- package/dist/utils/responses_stream_events.cjs.map +1 -1
- package/dist/utils/responses_stream_events.d.cts +1 -2
- package/dist/utils/responses_stream_events.d.cts.map +1 -1
- package/dist/utils/responses_stream_events.d.ts +1 -2
- package/dist/utils/responses_stream_events.d.ts.map +1 -1
- package/dist/utils/responses_stream_events.js +2 -2
- package/dist/utils/responses_stream_events.js.map +1 -1
- package/dist/utils/stream_events.js +1 -2
- package/dist/utils/tools.cjs +1 -2
- package/dist/utils/tools.d.cts +0 -2
- package/dist/utils/tools.d.cts.map +1 -1
- package/dist/utils/tools.d.ts +0 -2
- package/dist/utils/tools.d.ts.map +1 -1
- package/dist/utils/tools.js +1 -2
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/tools/toolSearch.ts
|
|
2
2
|
/**
|
|
3
3
|
* Creates a tool search tool that enables OpenAI models to dynamically discover
|
|
4
4
|
* and load tools on-demand from a large pool, rather than requiring all tool
|
|
@@ -61,7 +61,6 @@ function toolSearch(options) {
|
|
|
61
61
|
...options?.parameters !== void 0 ? { parameters: options.parameters } : {}
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
//#endregion
|
|
65
64
|
exports.toolSearch = toolSearch;
|
|
66
65
|
|
|
67
66
|
//# sourceMappingURL=toolSearch.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { ServerTool } from "@langchain/core/tools";
|
|
3
|
-
//#region src/tools/toolSearch.d.ts
|
|
4
3
|
export interface ToolSearchOptions {
|
|
5
4
|
/**
|
|
6
5
|
* Whether tool search is executed by the server or by the client.
|
|
@@ -73,5 +72,4 @@ export type ToolSearchTool = OpenAI.Responses.ToolSearchTool;
|
|
|
73
72
|
* ```
|
|
74
73
|
*/
|
|
75
74
|
export declare function toolSearch(options?: ToolSearchOptions): ServerTool;
|
|
76
|
-
//#endregion
|
|
77
75
|
//# sourceMappingURL=toolSearch.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolSearch.d.cts","names":["OpenAIClient"],"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,6 +1,5 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { ServerTool } from "@langchain/core/tools";
|
|
3
|
-
//#region src/tools/toolSearch.d.ts
|
|
4
3
|
export interface ToolSearchOptions {
|
|
5
4
|
/**
|
|
6
5
|
* Whether tool search is executed by the server or by the client.
|
|
@@ -73,5 +72,4 @@ export type ToolSearchTool = OpenAI.Responses.ToolSearchTool;
|
|
|
73
72
|
* ```
|
|
74
73
|
*/
|
|
75
74
|
export declare function toolSearch(options?: ToolSearchOptions): ServerTool;
|
|
76
|
-
//#endregion
|
|
77
75
|
//# sourceMappingURL=toolSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolSearch.d.ts","names":["OpenAIClient"],"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"}
|
package/dist/tools/toolSearch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/tools/toolSearch.ts
|
|
2
2
|
/**
|
|
3
3
|
* Creates a tool search tool that enables OpenAI models to dynamically discover
|
|
4
4
|
* and load tools on-demand from a large pool, rather than requiring all tool
|
|
@@ -61,7 +61,6 @@ function toolSearch(options) {
|
|
|
61
61
|
...options?.parameters !== void 0 ? { parameters: options.parameters } : {}
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
//#endregion
|
|
65
64
|
export { toolSearch };
|
|
66
65
|
|
|
67
66
|
//# sourceMappingURL=toolSearch.js.map
|
package/dist/tools/webSearch.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/tools/webSearch.ts
|
|
2
2
|
/**
|
|
3
3
|
* Creates a web search tool that allows OpenAI models to search the web
|
|
4
4
|
* for up-to-date information before generating a response.
|
|
@@ -66,7 +66,6 @@ function webSearch(options) {
|
|
|
66
66
|
search_context_size: options?.search_context_size
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
//#endregion
|
|
70
69
|
exports.webSearch = webSearch;
|
|
71
70
|
|
|
72
71
|
//# sourceMappingURL=webSearch.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { ServerTool } from "@langchain/core/tools";
|
|
3
|
-
//#region src/tools/webSearch.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* User location configuration for geographic search refinement.
|
|
6
5
|
*/
|
|
@@ -123,5 +122,4 @@ export type WebSearchTool = OpenAI.Responses.WebSearchTool;
|
|
|
123
122
|
* ```
|
|
124
123
|
*/
|
|
125
124
|
export declare function webSearch(options?: WebSearchOptions): ServerTool;
|
|
126
|
-
//#endregion
|
|
127
125
|
//# sourceMappingURL=webSearch.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webSearch.d.cts","names":["OpenAIClient"],"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"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { ServerTool } from "@langchain/core/tools";
|
|
3
|
-
//#region src/tools/webSearch.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* User location configuration for geographic search refinement.
|
|
6
5
|
*/
|
|
@@ -123,5 +122,4 @@ export type WebSearchTool = OpenAI.Responses.WebSearchTool;
|
|
|
123
122
|
* ```
|
|
124
123
|
*/
|
|
125
124
|
export declare function webSearch(options?: WebSearchOptions): ServerTool;
|
|
126
|
-
//#endregion
|
|
127
125
|
//# sourceMappingURL=webSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webSearch.d.ts","names":["OpenAIClient"],"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/tools/webSearch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/tools/webSearch.ts
|
|
2
2
|
/**
|
|
3
3
|
* Creates a web search tool that allows OpenAI models to search the web
|
|
4
4
|
* for up-to-date information before generating a response.
|
|
@@ -66,7 +66,6 @@ function webSearch(options) {
|
|
|
66
66
|
search_context_size: options?.search_context_size
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
//#endregion
|
|
70
69
|
export { webSearch };
|
|
71
70
|
|
|
72
71
|
//# sourceMappingURL=webSearch.js.map
|
package/dist/types.d.cts
CHANGED
|
@@ -3,7 +3,6 @@ import { BaseLanguageModelCallOptions } from "@langchain/core/language_models/ba
|
|
|
3
3
|
import { InteropZodObject } from "@langchain/core/utils/types";
|
|
4
4
|
import { ResponseFormatJSONObject, ResponseFormatJSONSchema, ResponseFormatText, ResponseFormatTextGrammar, ResponseFormatTextPython } from "openai/resources/shared";
|
|
5
5
|
import { TiktokenModel } from "js-tiktoken/lite";
|
|
6
|
-
//#region src/types.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* @see https://platform.openai.com/docs/models
|
|
9
8
|
*/
|
|
@@ -264,6 +263,5 @@ export type ChatOpenAIReasoningSummary = Omit<OpenAI.Responses.ResponseReasoning
|
|
|
264
263
|
};
|
|
265
264
|
export type ChatOpenAIResponseFormat = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatTextGrammar | ResponseFormatTextPython | ChatOpenAIResponseFormatJSONSchema;
|
|
266
265
|
export type ResponseFormatConfiguration = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema;
|
|
267
|
-
//#endregion
|
|
268
266
|
export type { TiktokenModel };
|
|
269
267
|
//# sourceMappingURL=types.d.cts.map
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":["OpenAIClient"],"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
|
@@ -3,7 +3,6 @@ import { InteropZodObject } from "@langchain/core/utils/types";
|
|
|
3
3
|
import { BaseLanguageModelCallOptions } from "@langchain/core/language_models/base";
|
|
4
4
|
import { ResponseFormatJSONObject, ResponseFormatJSONSchema, ResponseFormatText, ResponseFormatTextGrammar, ResponseFormatTextPython } from "openai/resources/shared";
|
|
5
5
|
import { TiktokenModel } from "js-tiktoken/lite";
|
|
6
|
-
//#region src/types.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* @see https://platform.openai.com/docs/models
|
|
9
8
|
*/
|
|
@@ -264,6 +263,5 @@ export type ChatOpenAIReasoningSummary = Omit<OpenAI.Responses.ResponseReasoning
|
|
|
264
263
|
};
|
|
265
264
|
export type ChatOpenAIResponseFormat = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatTextGrammar | ResponseFormatTextPython | ChatOpenAIResponseFormatJSONSchema;
|
|
266
265
|
export type ResponseFormatConfiguration = ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema;
|
|
267
|
-
//#endregion
|
|
268
266
|
export type { TiktokenModel };
|
|
269
267
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":["OpenAIClient"],"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.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_misc = require("./misc.cjs");
|
|
2
2
|
let _langchain_core_utils_env = require("@langchain/core/utils/env");
|
|
3
|
-
|
|
3
|
+
// src/utils/azure.ts
|
|
4
4
|
/**
|
|
5
5
|
* This function generates an endpoint URL for (Azure) OpenAI
|
|
6
6
|
* based on the configuration parameters provided.
|
|
@@ -95,7 +95,6 @@ function getHeadersWithUserAgent(headers, isAzure = false, version = "1.0.0") {
|
|
|
95
95
|
"User-Agent": normalizedHeaders["User-Agent"] ? `${library}/${version} (${env})${normalizedHeaders["User-Agent"]}` : `${library}/${version} (${env})`
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
//#endregion
|
|
99
98
|
exports.getEndpoint = getEndpoint;
|
|
100
99
|
exports.getFormattedEnv = getFormattedEnv;
|
|
101
100
|
exports.getHeadersWithUserAgent = getHeadersWithUserAgent;
|
package/dist/utils/azure.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/azure.d.ts
|
|
2
1
|
export interface OpenAIEndpointConfig {
|
|
3
2
|
azureOpenAIApiDeploymentName?: string;
|
|
4
3
|
azureOpenAIApiInstanceName?: string;
|
|
@@ -71,5 +70,5 @@ export declare function isHeaders(headers: unknown): headers is Headers;
|
|
|
71
70
|
export declare function normalizeHeaders(headers: HeadersLike): Record<string, HeaderValue | readonly HeaderValue[]>;
|
|
72
71
|
export declare function getFormattedEnv(): string;
|
|
73
72
|
export declare function getHeadersWithUserAgent(headers: HeadersLike, isAzure?: boolean, version?: string): Record<string, string>;
|
|
74
|
-
|
|
73
|
+
export {};
|
|
75
74
|
//# 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":"A,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,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/azure.d.ts
|
|
2
1
|
export interface OpenAIEndpointConfig {
|
|
3
2
|
azureOpenAIApiDeploymentName?: string;
|
|
4
3
|
azureOpenAIApiInstanceName?: string;
|
|
@@ -71,5 +70,5 @@ export declare function isHeaders(headers: unknown): headers is Headers;
|
|
|
71
70
|
export declare function normalizeHeaders(headers: HeadersLike): Record<string, HeaderValue | readonly HeaderValue[]>;
|
|
72
71
|
export declare function getFormattedEnv(): string;
|
|
73
72
|
export declare function getHeadersWithUserAgent(headers: HeadersLike, isAzure?: boolean, version?: string): Record<string, string>;
|
|
74
|
-
|
|
73
|
+
export {};
|
|
75
74
|
//# 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":"A,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.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { iife } from "./misc.js";
|
|
2
2
|
import { getEnv } from "@langchain/core/utils/env";
|
|
3
|
-
|
|
3
|
+
// src/utils/azure.ts
|
|
4
4
|
/**
|
|
5
5
|
* This function generates an endpoint URL for (Azure) OpenAI
|
|
6
6
|
* based on the configuration parameters provided.
|
|
@@ -95,7 +95,6 @@ function getHeadersWithUserAgent(headers, isAzure = false, version = "1.0.0") {
|
|
|
95
95
|
"User-Agent": normalizedHeaders["User-Agent"] ? `${library}/${version} (${env})${normalizedHeaders["User-Agent"]}` : `${library}/${version} (${env})`
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
//#endregion
|
|
99
98
|
export { getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, normalizeHeaders };
|
|
100
99
|
|
|
101
100
|
//# sourceMappingURL=azure.js.map
|
package/dist/utils/client.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_errors = require("./errors.cjs");
|
|
2
2
|
let openai = require("openai");
|
|
3
3
|
let _langchain_core_errors = require("@langchain/core/errors");
|
|
4
|
-
|
|
4
|
+
// src/utils/client.ts
|
|
5
5
|
function _isOpenAIContextOverflowError(e) {
|
|
6
6
|
if (String(e).includes("context_length_exceeded")) return true;
|
|
7
7
|
if ("message" in e && typeof e.message === "string" && (e.message.includes("Input tokens exceed the configured limit") || e.message.includes("exceeds the context window") || e.message.includes("maximum context length"))) return true;
|
|
@@ -26,7 +26,6 @@ function wrapOpenAIClientError(e) {
|
|
|
26
26
|
else error = e;
|
|
27
27
|
return error;
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
exports.wrapOpenAIClientError = wrapOpenAIClientError;
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=client.cjs.map
|
package/dist/utils/client.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.cts","names":[],"sources":["../../src/utils/client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.cts","names":[],"sources":["../../src/utils/client.ts"],"mappings":"A,wBAqBgB,sBAAsB"}
|
package/dist/utils/client.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","names":[],"sources":["../../src/utils/client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../../src/utils/client.ts"],"mappings":"A,wBAqBgB,sBAAsB"}
|
package/dist/utils/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addLangChainErrorFields } from "./errors.js";
|
|
2
2
|
import { APIConnectionTimeoutError, APIUserAbortError } from "openai";
|
|
3
3
|
import { ContextOverflowError, stampRetryable } from "@langchain/core/errors";
|
|
4
|
-
|
|
4
|
+
// src/utils/client.ts
|
|
5
5
|
function _isOpenAIContextOverflowError(e) {
|
|
6
6
|
if (String(e).includes("context_length_exceeded")) return true;
|
|
7
7
|
if ("message" in e && typeof e.message === "string" && (e.message.includes("Input tokens exceed the configured limit") || e.message.includes("exceeds the context window") || e.message.includes("maximum context length"))) return true;
|
|
@@ -26,7 +26,6 @@ function wrapOpenAIClientError(e) {
|
|
|
26
26
|
else error = e;
|
|
27
27
|
return error;
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
export { wrapOpenAIClientError };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=client.js.map
|
package/dist/utils/errors.cjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/errors.ts
|
|
2
2
|
function addLangChainErrorFields(error, lc_error_code) {
|
|
3
3
|
error.lc_error_code = lc_error_code;
|
|
4
4
|
error.message = `${error.message}\n\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\n`;
|
|
5
5
|
return error;
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
exports.addLangChainErrorFields = addLangChainErrorFields;
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=errors.cjs.map
|
package/dist/utils/errors.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/errors.ts
|
|
2
2
|
function addLangChainErrorFields(error, lc_error_code) {
|
|
3
3
|
error.lc_error_code = lc_error_code;
|
|
4
4
|
error.message = `${error.message}\n\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\n`;
|
|
5
5
|
return error;
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { addLangChainErrorFields };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=errors.js.map
|
package/dist/utils/misc.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
let _langchain_core_messages = require("@langchain/core/messages");
|
|
2
|
-
|
|
2
|
+
// src/utils/misc.ts
|
|
3
3
|
const iife = (fn) => fn();
|
|
4
4
|
/**
|
|
5
5
|
* Returns the provider payload a content block carries: the `value` of a
|
|
@@ -94,7 +94,6 @@ function _modelPrefersResponsesAPI(model) {
|
|
|
94
94
|
if (model.includes("codex")) return true;
|
|
95
95
|
return false;
|
|
96
96
|
}
|
|
97
|
-
//#endregion
|
|
98
97
|
exports.LC_AUTOGENERATED_FILENAME = LC_AUTOGENERATED_FILENAME;
|
|
99
98
|
exports._modelPrefersResponsesAPI = _modelPrefersResponsesAPI;
|
|
100
99
|
exports.applyPromptCacheBreakpoint = applyPromptCacheBreakpoint;
|
package/dist/utils/misc.d.cts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import "../types.cjs";
|
|
2
2
|
import { OpenAI } from "openai";
|
|
3
3
|
import { BaseMessage, ContentBlock } from "@langchain/core/messages";
|
|
4
|
-
//#region src/utils/misc.d.ts
|
|
5
4
|
export declare function messageToOpenAIRole(message: BaseMessage): OpenAI.ChatCompletionRole;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=misc.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.d.cts","names":["OpenAIClient"],"sources":["../../src/utils/misc.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"misc.d.cts","names":["OpenAIClient"],"sources":["../../src/utils/misc.ts"],"mappings":";;;wBA0KgB,oBACd,SAAS,cACRA,OAAa"}
|
package/dist/utils/misc.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import "../types.js";
|
|
2
2
|
import { OpenAI } from "openai";
|
|
3
3
|
import { BaseMessage, ChatMessage, ContentBlock } from "@langchain/core/messages";
|
|
4
|
-
//#region src/utils/misc.d.ts
|
|
5
4
|
export declare function messageToOpenAIRole(message: BaseMessage): OpenAI.ChatCompletionRole;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=misc.d.ts.map
|
package/dist/utils/misc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.d.ts","names":["OpenAIClient"],"sources":["../../src/utils/misc.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"misc.d.ts","names":["OpenAIClient"],"sources":["../../src/utils/misc.ts"],"mappings":";;;wBA0KgB,oBACd,SAAS,cACRA,OAAa"}
|
package/dist/utils/misc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AIMessage, ChatMessage, SystemMessage } from "@langchain/core/messages";
|
|
2
|
-
|
|
2
|
+
// src/utils/misc.ts
|
|
3
3
|
const iife$1 = (fn) => fn();
|
|
4
4
|
/**
|
|
5
5
|
* Returns the provider payload a content block carries: the `value` of a
|
|
@@ -94,7 +94,6 @@ function _modelPrefersResponsesAPI(model) {
|
|
|
94
94
|
if (model.includes("codex")) return true;
|
|
95
95
|
return false;
|
|
96
96
|
}
|
|
97
|
-
//#endregion
|
|
98
97
|
export { LC_AUTOGENERATED_FILENAME, _modelPrefersResponsesAPI, applyPromptCacheBreakpoint, assertAdditionalToolsPlacement, extractGenericMessageCustomRole, getFilenameFromMetadata, getRequiredFilenameFromMetadata, hasExtrasPromptCacheBreakpoint, iife$1 as iife, isReasoningModel, liftExtrasPromptCacheBreakpoint, messageToOpenAIRole, normalizePromptCacheRetention, unwrapNonStandard };
|
|
99
98
|
|
|
100
99
|
//# sourceMappingURL=misc.js.map
|
package/dist/utils/output.cjs
CHANGED
|
@@ -2,7 +2,7 @@ let _langchain_core_utils_types = require("@langchain/core/utils/types");
|
|
|
2
2
|
let _langchain_core_utils_json_schema = require("@langchain/core/utils/json_schema");
|
|
3
3
|
let zod_v4_core = require("zod/v4/core");
|
|
4
4
|
let openai_helpers_zod = require("openai/helpers/zod");
|
|
5
|
-
|
|
5
|
+
// src/utils/output.ts
|
|
6
6
|
const SUPPORTED_METHODS = [
|
|
7
7
|
"jsonSchema",
|
|
8
8
|
"functionCalling",
|
|
@@ -90,7 +90,6 @@ function handleMultiModalOutput(content, messages) {
|
|
|
90
90
|
}
|
|
91
91
|
return content;
|
|
92
92
|
}
|
|
93
|
-
//#endregion
|
|
94
93
|
exports.getStructuredOutputMethod = getStructuredOutputMethod;
|
|
95
94
|
exports.handleMultiModalOutput = handleMultiModalOutput;
|
|
96
95
|
exports.interopZodResponseFormat = interopZodResponseFormat;
|
package/dist/utils/output.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isZodSchemaV3, isZodSchemaV4 } from "@langchain/core/utils/types";
|
|
|
2
2
|
import { toJsonSchema } from "@langchain/core/utils/json_schema";
|
|
3
3
|
import { parse } from "zod/v4/core";
|
|
4
4
|
import { zodResponseFormat } from "openai/helpers/zod";
|
|
5
|
-
|
|
5
|
+
// src/utils/output.ts
|
|
6
6
|
const SUPPORTED_METHODS = [
|
|
7
7
|
"jsonSchema",
|
|
8
8
|
"functionCalling",
|
|
@@ -90,7 +90,6 @@ function handleMultiModalOutput(content, messages) {
|
|
|
90
90
|
}
|
|
91
91
|
return content;
|
|
92
92
|
}
|
|
93
|
-
//#endregion
|
|
94
93
|
export { getStructuredOutputMethod, handleMultiModalOutput, interopZodResponseFormat };
|
|
95
94
|
|
|
96
95
|
//# sourceMappingURL=output.js.map
|
package/dist/utils/profile.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/profile.ts
|
|
2
2
|
/**
|
|
3
3
|
* Narrows the static profile, which describes the Responses API, to what the
|
|
4
4
|
* API a model calls can send.
|
|
@@ -21,7 +21,6 @@ function profileForApi(profile, usesResponsesApi) {
|
|
|
21
21
|
};
|
|
22
22
|
return result;
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
exports.profileForApi = profileForApi;
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=profile.cjs.map
|
package/dist/utils/profile.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/profile.ts
|
|
2
2
|
/**
|
|
3
3
|
* Narrows the static profile, which describes the Responses API, to what the
|
|
4
4
|
* API a model calls can send.
|
|
@@ -21,7 +21,6 @@ function profileForApi(profile, usesResponsesApi) {
|
|
|
21
21
|
};
|
|
22
22
|
return result;
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
export { profileForApi };
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=profile.js.map
|
package/dist/utils/prompts.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_completions = require("../converters/completions.cjs");
|
|
2
|
-
|
|
2
|
+
// src/utils/prompts.ts
|
|
3
3
|
/**
|
|
4
4
|
* Convert a formatted LangChain prompt (e.g. pulled from the hub) into
|
|
5
5
|
* a format expected by OpenAI's JS SDK.
|
|
@@ -35,7 +35,6 @@ function convertPromptToOpenAI(formattedPrompt) {
|
|
|
35
35
|
const messages = formattedPrompt.toChatMessages();
|
|
36
36
|
return { messages: require_completions.convertMessagesToCompletionsMessageParams({ messages }) };
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
exports.convertPromptToOpenAI = convertPromptToOpenAI;
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=prompts.cjs.map
|
package/dist/utils/prompts.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { BasePromptValue } from "@langchain/core/prompt_values";
|
|
3
|
-
//#region src/utils/prompts.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Convert a formatted LangChain prompt (e.g. pulled from the hub) into
|
|
6
5
|
* a format expected by OpenAI's JS SDK.
|
|
@@ -35,5 +34,4 @@ import { BasePromptValue } from "@langchain/core/prompt_values";
|
|
|
35
34
|
export declare function convertPromptToOpenAI(formattedPrompt: BasePromptValue): {
|
|
36
35
|
messages: OpenAI.Chat.ChatCompletionMessageParam[];
|
|
37
36
|
};
|
|
38
|
-
//#endregion
|
|
39
37
|
//# sourceMappingURL=prompts.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.cts","names":[],"sources":["../../src/utils/prompts.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompts.d.cts","names":[],"sources":["../../src/utils/prompts.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoCgB,sBAAsB,iBAAiB;EACrD,UAAU,OAAO,KAAK"}
|
package/dist/utils/prompts.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { BasePromptValue } from "@langchain/core/prompt_values";
|
|
3
|
-
//#region src/utils/prompts.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Convert a formatted LangChain prompt (e.g. pulled from the hub) into
|
|
6
5
|
* a format expected by OpenAI's JS SDK.
|
|
@@ -35,5 +34,4 @@ import { BasePromptValue } from "@langchain/core/prompt_values";
|
|
|
35
34
|
export declare function convertPromptToOpenAI(formattedPrompt: BasePromptValue): {
|
|
36
35
|
messages: OpenAI.Chat.ChatCompletionMessageParam[];
|
|
37
36
|
};
|
|
38
|
-
//#endregion
|
|
39
37
|
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","names":[],"sources":["../../src/utils/prompts.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","names":[],"sources":["../../src/utils/prompts.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoCgB,sBAAsB,iBAAiB;EACrD,UAAU,OAAO,KAAK"}
|
package/dist/utils/prompts.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertMessagesToCompletionsMessageParams } from "../converters/completions.js";
|
|
2
|
-
|
|
2
|
+
// src/utils/prompts.ts
|
|
3
3
|
/**
|
|
4
4
|
* Convert a formatted LangChain prompt (e.g. pulled from the hub) into
|
|
5
5
|
* a format expected by OpenAI's JS SDK.
|
|
@@ -35,7 +35,6 @@ function convertPromptToOpenAI(formattedPrompt) {
|
|
|
35
35
|
const messages = formattedPrompt.toChatMessages();
|
|
36
36
|
return { messages: convertMessagesToCompletionsMessageParams({ messages }) };
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { convertPromptToOpenAI };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=prompts.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_responses = require("../converters/responses.cjs");
|
|
2
2
|
let _langchain_core_language_models_compat = require("@langchain/core/language_models/compat");
|
|
3
|
-
|
|
3
|
+
// src/utils/responses_stream_events.ts
|
|
4
4
|
async function* convertOpenAIResponsesStream(source, options = {}) {
|
|
5
5
|
const shouldStreamUsage = options.streamUsage ?? true;
|
|
6
6
|
const provider = options.provider ?? "openai";
|
|
@@ -220,6 +220,7 @@ async function* convertOpenAIResponsesStream(source, options = {}) {
|
|
|
220
220
|
model_provider: provider,
|
|
221
221
|
id: event.response.id,
|
|
222
222
|
model: event.response.model,
|
|
223
|
+
model_name: event.response.model,
|
|
223
224
|
status: event.response.status
|
|
224
225
|
};
|
|
225
226
|
if (shouldStreamUsage && event.response.usage) {
|
|
@@ -255,7 +256,6 @@ function mapResponseStatusToFinishReason(status, eventType) {
|
|
|
255
256
|
if (status === "incomplete") return "length";
|
|
256
257
|
return "stop";
|
|
257
258
|
}
|
|
258
|
-
//#endregion
|
|
259
259
|
exports.convertOpenAIResponsesStream = convertOpenAIResponsesStream;
|
|
260
260
|
|
|
261
261
|
//# sourceMappingURL=responses_stream_events.cjs.map
|