@langchain/openai 1.7.1 → 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 +14 -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 +3 -5
- package/dist/chat_models/index.d.cts.map +1 -1
- package/dist/chat_models/index.d.ts +3 -5
- 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 +98 -0
- package/dist/decisions/index.cjs.map +1 -0
- package/dist/decisions/index.d.cts +50 -0
- package/dist/decisions/index.d.cts.map +1 -0
- package/dist/decisions/index.d.ts +50 -0
- package/dist/decisions/index.d.ts.map +1 -0
- package/dist/decisions/index.js +98 -0
- package/dist/decisions/index.js.map +1 -0
- package/dist/decisions/input.cjs +122 -0
- package/dist/decisions/input.cjs.map +1 -0
- package/dist/decisions/input.js +122 -0
- package/dist/decisions/input.js.map +1 -0
- package/dist/decisions/types.cjs +28 -0
- package/dist/decisions/types.cjs.map +1 -0
- package/dist/decisions/types.d.cts +58 -0
- package/dist/decisions/types.d.cts.map +1 -0
- package/dist/decisions/types.d.ts +58 -0
- package/dist/decisions/types.d.ts.map +1 -0
- package/dist/decisions/types.js +28 -0
- package/dist/decisions/types.js.map +1 -0
- 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 +40 -38
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +16 -15
- 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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/decisions/types.ts
|
|
2
|
+
/** Converts a named question to the shape the Decisions API expects. */
|
|
3
|
+
function toQuestionParam(name, question) {
|
|
4
|
+
const { type, instructions } = question;
|
|
5
|
+
if (type === "predicate") return {
|
|
6
|
+
type,
|
|
7
|
+
name,
|
|
8
|
+
instructions
|
|
9
|
+
};
|
|
10
|
+
if (type === "choice") return {
|
|
11
|
+
type,
|
|
12
|
+
name,
|
|
13
|
+
instructions,
|
|
14
|
+
choices: Object.entries(question.choices).map(([value, description]) => description == null ? { value } : {
|
|
15
|
+
value,
|
|
16
|
+
description
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
type,
|
|
21
|
+
name,
|
|
22
|
+
instructions,
|
|
23
|
+
levels: question.levels.map((level) => typeof level === "string" ? { label: level } : level)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export { toQuestionParam };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/decisions/types.ts"],"sourcesContent":["import type { OpenAI as OpenAIClient } from \"openai\";\nimport type { BaseMessage, UsageMetadata } from \"@langchain/core/messages\";\n\ntype QuestionParam = OpenAIClient.DecisionCreateParams[\"questions\"][number];\n\n/** Estimate the probability that a condition is true. */\nexport interface Predicate {\n type: \"predicate\";\n instructions: string;\n}\n\n/** Select one option. Keys are the option values; values describe when each applies. */\nexport interface Choice<K extends string = string> {\n type: \"choice\";\n instructions: string;\n choices: Record<K, string | null>;\n}\n\n/** One level of a `Score` rubric. */\nexport type Level = OpenAIClient.DecisionCreateParams.QuestionParamScore.Level;\n\n/** Rate the input against two or more levels, ordered lowest to highest. */\nexport interface Score {\n type: \"score\";\n instructions: string;\n levels: readonly (string | Level)[];\n}\n\nexport type Question = Predicate | Choice | Score;\n\nexport type Questions = Record<string, Question>;\n\nexport type PredicateAnswer = Omit<\n OpenAIClient.Decision.AnswerResourcePredicate,\n \"name\"\n>;\n\nexport type ChoiceAnswer<K extends string = string> = Omit<\n OpenAIClient.Decision.AnswerResourceChoice,\n \"name\" | \"choice\" | \"probabilities\"\n> & {\n choice: K;\n probabilities: { value: K; probability: number }[];\n};\n\n/** `score` is the probability-weighted average of the zero-based level indices. */\nexport type ScoreAnswer = Omit<\n OpenAIClient.Decision.AnswerResourceScore,\n \"name\"\n>;\n\nexport type RefusalAnswer = Omit<\n OpenAIClient.Decision.AnswerResourceRefusal,\n \"name\"\n>;\n\nexport type Answer =\n | PredicateAnswer\n | ChoiceAnswer\n | ScoreAnswer\n | RefusalAnswer;\n\n/** The answer type a question produces. */\nexport type AnswerFor<T extends Question> = T extends Predicate\n ? PredicateAnswer\n : T extends Choice\n ? ChoiceAnswer<Extract<keyof T[\"choices\"], string>>\n : T extends Score\n ? ScoreAnswer\n : never;\n\n/** Answers keyed by question name, typed from the questions that were asked. */\nexport type Answers<Q extends Questions> = {\n -readonly [K in keyof Q]: AnswerFor<Q[K]> | RefusalAnswer;\n};\n\n/**\n * Text, LangChain messages, or JSON state to evaluate. Messages are sent as a native\n * conversation; JSON objects, which may contain messages, as an `input_json` part.\n */\nexport type DecisionInput =\n | string\n | BaseMessage\n | BaseMessage[]\n | Record<string, unknown>\n | Record<string, unknown>[];\n\n/** One Decisions request: what to evaluate and the named questions to ask. */\nexport interface DecisionRequest<Q extends Questions = Questions> {\n input: DecisionInput;\n questions: Q;\n}\n\nexport interface DecisionResult<Q extends Questions = Questions> {\n answers: Answers<Q>;\n /** The model that answered, as reported by the API. */\n model: string;\n requestId?: string;\n /** Read by LangSmith to record token usage on the traced run. */\n usage_metadata: UsageMetadata;\n}\n\n/** Converts a named question to the shape the Decisions API expects. */\nexport function toQuestionParam(\n name: string,\n question: Question\n): QuestionParam {\n const { type, instructions } = question;\n if (type === \"predicate\") return { type, name, instructions };\n if (type === \"choice\") {\n return {\n type,\n name,\n instructions,\n choices: Object.entries(question.choices).map(([value, description]) =>\n description == null ? { value } : { value, description }\n ),\n };\n }\n return {\n type,\n name,\n instructions,\n levels: question.levels.map((level) =>\n typeof level === \"string\" ? { label: level } : level\n ),\n };\n}\n"],"mappings":";;AAuGA,SAAgB,gBACd,MACA,UACe;CACf,MAAM,EAAE,MAAM,iBAAiB;CAC/B,IAAI,SAAS,aAAa,OAAO;EAAE;EAAM;EAAM;CAAa;CAC5D,IAAI,SAAS,UACX,OAAO;EACL;EACA;EACA;EACA,SAAS,OAAO,QAAQ,SAAS,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,iBACrD,eAAe,OAAO,EAAE,MAAM,IAAI;GAAE;GAAO;EAAY,CACzD;CACF;CAEF,OAAO;EACL;EACA;EACA;EACA,QAAQ,SAAS,OAAO,KAAK,UAC3B,OAAO,UAAU,WAAW,EAAE,OAAO,MAAM,IAAI,KACjD;CACF;AACF"}
|
package/dist/embeddings.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_client = require("./utils/client.cjs");
|
|
2
1
|
const require_azure = require("./utils/azure.cjs");
|
|
2
|
+
const require_client = require("./utils/client.cjs");
|
|
3
3
|
let openai = require("openai");
|
|
4
4
|
let _langchain_core_utils_env = require("@langchain/core/utils/env");
|
|
5
5
|
let _langchain_core_utils_chunk_array = require("@langchain/core/utils/chunk_array");
|
|
6
6
|
let _langchain_core_embeddings = require("@langchain/core/embeddings");
|
|
7
|
-
|
|
7
|
+
// src/embeddings.ts
|
|
8
8
|
/**
|
|
9
9
|
* Class for generating embeddings using the OpenAI API.
|
|
10
10
|
*
|
|
@@ -134,7 +134,6 @@ var OpenAIEmbeddings = class extends _langchain_core_embeddings.Embeddings {
|
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
|
-
//#endregion
|
|
138
137
|
exports.OpenAIEmbeddings = OpenAIEmbeddings;
|
|
139
138
|
|
|
140
139
|
//# sourceMappingURL=embeddings.cjs.map
|
package/dist/embeddings.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { OpenAIApiKey } from "./types.cjs";
|
|
2
2
|
import { ClientOptions, OpenAI } from "openai";
|
|
3
3
|
import { Embeddings, EmbeddingsParams } from "@langchain/core/embeddings";
|
|
4
|
-
//#region src/embeddings.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* @see https://platform.openai.com/docs/guides/embeddings#embedding-models
|
|
7
6
|
*/
|
|
@@ -114,5 +113,4 @@ export declare class OpenAIEmbeddings<TOutput = number[]> extends Embeddings<TOu
|
|
|
114
113
|
_request_id?: string | null;
|
|
115
114
|
}>;
|
|
116
115
|
}
|
|
117
|
-
//#endregion
|
|
118
116
|
//# sourceMappingURL=embeddings.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.d.cts","names":["OpenAIClient"],"sources":["../src/embeddings.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"embeddings.d.cts","names":["OpenAIClient"],"sources":["../src/embeddings.ts"],"mappings":";;;;;;YAeY,yBACRA,OAAa,2BACH;;;;;iBAMG,+BAA+B;;;;;;EAM9C,WAAW;;EAEX,OAAO;;;;;EAMP;;;;EAKA;;;;;EAMA;;;;;;EAOA;;;;EAKA;;;;;;;;;;;;;;;;;;qBAmBW,iBAAiB,4BACpB,WAAW,oBACR,QAAQ;EAEnB;;EAGA;EAEA;EAGA;;;;;EAMA;EAEA;EAEA;EAEA;YAEU,QAAQA;YAER,cAAc;YAEd,SAAS;EAEnB,YACE,SAAS,QAAQ;IACf;;;;;IAKA,eAAe;;IAEf,SAAS;IACT,gBAAgB;;;;;;;;;EAyCd,eAAe,kBAAkB,QAAQ;;;;;;;EAsCzC,WAAW,eAAe,QAAQ;;;;;;;;YAsBxB,mBACd,SAASA,OAAa,wBAAqB,QAAAA,OAAA"}
|
package/dist/embeddings.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { OpenAIApiKey } from "./types.js";
|
|
2
2
|
import { ClientOptions, OpenAI } from "openai";
|
|
3
3
|
import { Embeddings, EmbeddingsParams } from "@langchain/core/embeddings";
|
|
4
|
-
//#region src/embeddings.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* @see https://platform.openai.com/docs/guides/embeddings#embedding-models
|
|
7
6
|
*/
|
|
@@ -114,5 +113,4 @@ export declare class OpenAIEmbeddings<TOutput = number[]> extends Embeddings<TOu
|
|
|
114
113
|
_request_id?: string | null;
|
|
115
114
|
}>;
|
|
116
115
|
}
|
|
117
|
-
//#endregion
|
|
118
116
|
//# sourceMappingURL=embeddings.d.ts.map
|
package/dist/embeddings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.d.ts","names":["OpenAIClient"],"sources":["../src/embeddings.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"embeddings.d.ts","names":["OpenAIClient"],"sources":["../src/embeddings.ts"],"mappings":";;;;;;YAeY,yBACRA,OAAa,2BACH;;;;;iBAMG,+BAA+B;;;;;;EAM9C,WAAW;;EAEX,OAAO;;;;;EAMP;;;;EAKA;;;;;EAMA;;;;;;EAOA;;;;EAKA;;;;;;;;;;;;;;;;;;qBAmBW,iBAAiB,4BACpB,WAAW,oBACR,QAAQ;EAEnB;;EAGA;EAEA;EAGA;;;;;EAMA;EAEA;EAEA;EAEA;YAEU,QAAQA;YAER,cAAc;YAEd,SAAS;EAEnB,YACE,SAAS,QAAQ;IACf;;;;;IAKA,eAAe;;IAEf,SAAS;IACT,gBAAgB;;;;;;;;;EAyCd,eAAe,kBAAkB,QAAQ;;;;;;;EAsCzC,WAAW,eAAe,QAAQ;;;;;;;;YAsBxB,mBACd,SAASA,OAAa,wBAAqB,QAAAA,OAAA"}
|
package/dist/embeddings.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { wrapOpenAIClientError } from "./utils/client.js";
|
|
2
1
|
import { getEndpoint, getHeadersWithUserAgent } from "./utils/azure.js";
|
|
2
|
+
import { wrapOpenAIClientError } from "./utils/client.js";
|
|
3
3
|
import { OpenAI } from "openai";
|
|
4
4
|
import { getEnvironmentVariable } from "@langchain/core/utils/env";
|
|
5
5
|
import { chunkArray } from "@langchain/core/utils/chunk_array";
|
|
6
6
|
import { Embeddings } from "@langchain/core/embeddings";
|
|
7
|
-
|
|
7
|
+
// src/embeddings.ts
|
|
8
8
|
/**
|
|
9
9
|
* Class for generating embeddings using the OpenAI API.
|
|
10
10
|
*
|
|
@@ -134,7 +134,6 @@ var OpenAIEmbeddings = class extends Embeddings {
|
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
|
-
//#endregion
|
|
138
137
|
export { OpenAIEmbeddings };
|
|
139
138
|
|
|
140
139
|
//# sourceMappingURL=embeddings.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,52 +1,54 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
2
|
+
const require_completions = require("./azure/chat_models/completions.cjs");
|
|
3
|
+
const require_responses = require("./azure/chat_models/responses.cjs");
|
|
4
|
+
const require_index = require("./azure/chat_models/index.cjs");
|
|
5
|
+
const require_llms = require("./azure/llms.cjs");
|
|
6
|
+
const require_completions$1 = require("./converters/completions.cjs");
|
|
7
|
+
const require_embeddings = require("./azure/embeddings.cjs");
|
|
5
8
|
const require_base = require("./chat_models/base.cjs");
|
|
6
|
-
const require_completions = require("./converters/completions.cjs");
|
|
7
|
-
require("./utils/stream_events.cjs");
|
|
8
|
-
const require_completions$1 = require("./chat_models/completions.cjs");
|
|
9
|
-
const require_completions$2 = require("./azure/chat_models/completions.cjs");
|
|
10
|
-
const require_responses = require("./converters/responses.cjs");
|
|
11
|
-
const require_responses_stream_events = require("./utils/responses_stream_events.cjs");
|
|
12
9
|
const require_responses$1 = require("./chat_models/responses.cjs");
|
|
13
|
-
const require_responses$2 = require("./
|
|
14
|
-
const
|
|
15
|
-
const require_index$1 = require("./
|
|
16
|
-
const require_llms = require("./llms.cjs");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const require_dalle = require("./tools/dalle.cjs");
|
|
10
|
+
const require_responses$2 = require("./converters/responses.cjs");
|
|
11
|
+
const require_completions$2 = require("./chat_models/completions.cjs");
|
|
12
|
+
const require_index$1 = require("./chat_models/index.cjs");
|
|
13
|
+
const require_llms$1 = require("./llms.cjs");
|
|
14
|
+
const require_embeddings$1 = require("./embeddings.cjs");
|
|
15
|
+
const require_client = require("./utils/client.cjs");
|
|
16
|
+
const require_azure = require("./utils/azure.cjs");
|
|
21
17
|
const require_index$2 = require("./tools/index.cjs");
|
|
22
18
|
const require_custom = require("./tools/custom.cjs");
|
|
23
19
|
const require_prompts = require("./utils/prompts.cjs");
|
|
20
|
+
const require_dalle = require("./tools/dalle.cjs");
|
|
21
|
+
const require_misc = require("./utils/misc.cjs");
|
|
22
|
+
require("./utils/stream_events.cjs");
|
|
23
|
+
const require_responses_stream_events = require("./utils/responses_stream_events.cjs");
|
|
24
24
|
require("./converters/index.cjs");
|
|
25
|
+
const require_index$4 = require("./decisions/index.cjs");
|
|
25
26
|
let openai = require("openai");
|
|
26
27
|
let _langchain_core_language_models_openai_completions_stream = require("@langchain/core/language_models/openai_completions_stream");
|
|
27
|
-
exports.AzureChatOpenAI = require_index
|
|
28
|
-
exports.AzureChatOpenAICompletions = require_completions
|
|
29
|
-
exports.AzureChatOpenAIResponses = require_responses
|
|
30
|
-
exports.AzureOpenAI = require_llms
|
|
31
|
-
exports.AzureOpenAIEmbeddings = require_embeddings
|
|
28
|
+
exports.AzureChatOpenAI = require_index.AzureChatOpenAI;
|
|
29
|
+
exports.AzureChatOpenAICompletions = require_completions.AzureChatOpenAICompletions;
|
|
30
|
+
exports.AzureChatOpenAIResponses = require_responses.AzureChatOpenAIResponses;
|
|
31
|
+
exports.AzureOpenAI = require_llms.AzureOpenAI;
|
|
32
|
+
exports.AzureOpenAIEmbeddings = require_embeddings.AzureOpenAIEmbeddings;
|
|
32
33
|
exports.BaseChatOpenAI = require_base.BaseChatOpenAI;
|
|
33
|
-
exports.ChatOpenAI = require_index.ChatOpenAI;
|
|
34
|
-
exports.ChatOpenAICompletions = require_completions$
|
|
34
|
+
exports.ChatOpenAI = require_index$1.ChatOpenAI;
|
|
35
|
+
exports.ChatOpenAICompletions = require_completions$2.ChatOpenAICompletions;
|
|
35
36
|
exports.ChatOpenAIResponses = require_responses$1.ChatOpenAIResponses;
|
|
36
37
|
exports.DallEAPIWrapper = require_dalle.DallEAPIWrapper;
|
|
37
|
-
exports.OpenAI = require_llms.OpenAI;
|
|
38
|
+
exports.OpenAI = require_llms$1.OpenAI;
|
|
38
39
|
Object.defineProperty(exports, "OpenAIClient", {
|
|
39
40
|
enumerable: true,
|
|
40
41
|
get: function() {
|
|
41
42
|
return openai.OpenAI;
|
|
42
43
|
}
|
|
43
44
|
});
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
45
|
+
exports.OpenAIDecisions = require_index$4.OpenAIDecisions;
|
|
46
|
+
exports.OpenAIEmbeddings = require_embeddings$1.OpenAIEmbeddings;
|
|
47
|
+
exports.completionsApiContentBlockConverter = require_completions$1.completionsApiContentBlockConverter;
|
|
48
|
+
exports.convertCompletionsDeltaToBaseMessageChunk = require_completions$1.convertCompletionsDeltaToBaseMessageChunk;
|
|
49
|
+
exports.convertCompletionsMessageToBaseMessage = require_completions$1.convertCompletionsMessageToBaseMessage;
|
|
50
|
+
exports.convertMessagesToCompletionsMessageParams = require_completions$1.convertMessagesToCompletionsMessageParams;
|
|
51
|
+
exports.convertMessagesToResponsesInput = require_responses$2.convertMessagesToResponsesInput;
|
|
50
52
|
Object.defineProperty(exports, "convertOpenAICompletionsStream", {
|
|
51
53
|
enumerable: true,
|
|
52
54
|
get: function() {
|
|
@@ -55,13 +57,13 @@ Object.defineProperty(exports, "convertOpenAICompletionsStream", {
|
|
|
55
57
|
});
|
|
56
58
|
exports.convertOpenAIResponsesStream = require_responses_stream_events.convertOpenAIResponsesStream;
|
|
57
59
|
exports.convertPromptToOpenAI = require_prompts.convertPromptToOpenAI;
|
|
58
|
-
exports.convertReasoningSummaryToResponsesReasoningItem = require_responses.convertReasoningSummaryToResponsesReasoningItem;
|
|
59
|
-
exports.convertResponsesDeltaToChatGenerationChunk = require_responses.convertResponsesDeltaToChatGenerationChunk;
|
|
60
|
-
exports.convertResponsesMessageToAIMessage = require_responses.convertResponsesMessageToAIMessage;
|
|
61
|
-
exports.convertResponsesUsageToUsageMetadata = require_responses.convertResponsesUsageToUsageMetadata;
|
|
62
|
-
exports.convertStandardContentBlockToCompletionsContentPart = require_completions.convertStandardContentBlockToCompletionsContentPart;
|
|
63
|
-
exports.convertStandardContentMessageToCompletionsMessage = require_completions.convertStandardContentMessageToCompletionsMessage;
|
|
64
|
-
exports.convertStandardContentMessageToResponsesInput = require_responses.convertStandardContentMessageToResponsesInput;
|
|
60
|
+
exports.convertReasoningSummaryToResponsesReasoningItem = require_responses$2.convertReasoningSummaryToResponsesReasoningItem;
|
|
61
|
+
exports.convertResponsesDeltaToChatGenerationChunk = require_responses$2.convertResponsesDeltaToChatGenerationChunk;
|
|
62
|
+
exports.convertResponsesMessageToAIMessage = require_responses$2.convertResponsesMessageToAIMessage;
|
|
63
|
+
exports.convertResponsesUsageToUsageMetadata = require_responses$2.convertResponsesUsageToUsageMetadata;
|
|
64
|
+
exports.convertStandardContentBlockToCompletionsContentPart = require_completions$1.convertStandardContentBlockToCompletionsContentPart;
|
|
65
|
+
exports.convertStandardContentMessageToCompletionsMessage = require_completions$1.convertStandardContentMessageToCompletionsMessage;
|
|
66
|
+
exports.convertStandardContentMessageToResponsesInput = require_responses$2.convertStandardContentMessageToResponsesInput;
|
|
65
67
|
exports.customTool = require_custom.customTool;
|
|
66
68
|
exports.getEndpoint = require_azure.getEndpoint;
|
|
67
69
|
exports.getFormattedEnv = require_azure.getFormattedEnv;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AzureOpenAIChatInput, AzureOpenAIInput, ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, OpenAIApiKey, OpenAIBaseInput, OpenAICacheRetentionParam, OpenAICallOptions, OpenAIChatInput, OpenAIChatModelId, OpenAICoreRequestOptions, OpenAIInput, OpenAIPromptCacheOptions, OpenAIVerbosityParam, ResponseFormatConfiguration, TiktokenModel } from "./types.cjs";
|
|
2
|
-
import { BaseChatOpenAI, BaseChatOpenAICallOptions, BaseChatOpenAIFields } from "./chat_models/base.cjs";
|
|
3
|
-
import { ChatOpenAIResponses, ChatOpenAIResponsesCallOptions } from "./chat_models/responses.cjs";
|
|
4
|
-
import { ChatOpenAICompletions, ChatOpenAICompletionsCallOptions } from "./chat_models/completions.cjs";
|
|
5
|
-
import { ChatOpenAI, ChatOpenAICallOptions, ChatOpenAIFields } from "./chat_models/index.cjs";
|
|
6
1
|
import { AzureChatOpenAIFields } from "./azure/chat_models/common.cjs";
|
|
7
2
|
import { AzureChatOpenAICompletions } from "./azure/chat_models/completions.cjs";
|
|
8
3
|
import { AzureChatOpenAIResponses } from "./azure/chat_models/responses.cjs";
|
|
9
4
|
import { AzureChatOpenAI } from "./azure/chat_models/index.cjs";
|
|
10
|
-
import { OpenAI } from "./llms.cjs";
|
|
11
5
|
import { AzureOpenAI } from "./azure/llms.cjs";
|
|
12
|
-
import { OpenAIEmbeddingModelId, OpenAIEmbeddings, OpenAIEmbeddingsParams } from "./embeddings.cjs";
|
|
13
6
|
import { AzureOpenAIEmbeddings } from "./azure/embeddings.cjs";
|
|
7
|
+
import { BaseChatOpenAI, BaseChatOpenAICallOptions, BaseChatOpenAIFields } from "./chat_models/base.cjs";
|
|
8
|
+
import { ChatOpenAIResponses, ChatOpenAIResponsesCallOptions } from "./chat_models/responses.cjs";
|
|
9
|
+
import { ChatOpenAICompletions, ChatOpenAICompletionsCallOptions } from "./chat_models/completions.cjs";
|
|
10
|
+
import { ChatOpenAI, ChatOpenAICallOptions, ChatOpenAIFields } from "./chat_models/index.cjs";
|
|
11
|
+
import { OpenAI } from "./llms.cjs";
|
|
12
|
+
import { OpenAIEmbeddingModelId, OpenAIEmbeddings, OpenAIEmbeddingsParams } from "./embeddings.cjs";
|
|
13
|
+
import { AzureOpenAIChatInput, AzureOpenAIInput, ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, OpenAIApiKey, OpenAIBaseInput, OpenAICacheRetentionParam, OpenAICallOptions, OpenAIChatInput, OpenAIChatModelId, OpenAICoreRequestOptions, OpenAIInput, OpenAIPromptCacheOptions, OpenAIVerbosityParam, ResponseFormatConfiguration, TiktokenModel } from "./types.cjs";
|
|
14
14
|
import { wrapOpenAIClientError } from "./utils/client.cjs";
|
|
15
15
|
import { HeadersLike, OpenAIEndpointConfig, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, normalizeHeaders } from "./utils/azure.cjs";
|
|
16
16
|
import { DallEAPIWrapper, DallEAPIWrapperParams, OpenAIImageModelId } from "./tools/dalle.cjs";
|
|
@@ -33,5 +33,7 @@ import { ConvertOpenAIResponsesStreamOptions, convertOpenAIResponsesStream } fro
|
|
|
33
33
|
import { completionsApiContentBlockConverter, convertCompletionsDeltaToBaseMessageChunk, convertCompletionsMessageToBaseMessage, convertMessagesToCompletionsMessageParams, convertStandardContentBlockToCompletionsContentPart, convertStandardContentMessageToCompletionsMessage } from "./converters/completions.cjs";
|
|
34
34
|
import { ResponsesCreate, ResponsesCreateInvoke, ResponsesInputItem, ResponsesParse, ResponsesParseInvoke, convertMessagesToResponsesInput, convertReasoningSummaryToResponsesReasoningItem, convertResponsesDeltaToChatGenerationChunk, convertResponsesMessageToAIMessage, convertResponsesUsageToUsageMetadata, convertStandardContentMessageToResponsesInput } from "./converters/responses.cjs";
|
|
35
35
|
import "./converters/index.cjs";
|
|
36
|
+
import { Answer, AnswerFor, Answers, Choice, ChoiceAnswer, DecisionInput, DecisionRequest, DecisionResult, Level, Predicate, PredicateAnswer, Question, Questions, RefusalAnswer, Score, ScoreAnswer } from "./decisions/types.cjs";
|
|
37
|
+
import { OpenAIDecisions, OpenAIDecisionsFields } from "./decisions/index.cjs";
|
|
36
38
|
import { ClientOptions, OpenAI as OpenAIClient, toFile } from "openai";
|
|
37
|
-
export { type ApplyPatchCreateFileOperation, type ApplyPatchDeleteFileOperation, type ApplyPatchOperation, type ApplyPatchOptions, type ApplyPatchTool, type ApplyPatchUpdateFileOperation, AzureChatOpenAI, AzureChatOpenAICompletions, type AzureChatOpenAIFields, AzureChatOpenAIResponses, AzureOpenAI, AzureOpenAIChatInput, AzureOpenAIEmbeddings, AzureOpenAIInput, BaseChatOpenAI, type BaseChatOpenAICallOptions, type BaseChatOpenAIFields, ChatOpenAI, type ChatOpenAICallOptions, ChatOpenAICompletions, type ChatOpenAICompletionsCallOptions, type ChatOpenAIFields, ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, ChatOpenAIResponses, type ChatOpenAIResponsesCallOptions, type ClientOptions, type CodeInterpreterAutoContainer, type CodeInterpreterMemoryLimit, type CodeInterpreterOptions, type CodeInterpreterTool, type ComputerUseAction, type ComputerUseClickAction, type ComputerUseDoubleClickAction, type ComputerUseDragAction, type ComputerUseEnvironment, type ComputerUseInput, type ComputerUseKeypressAction, type ComputerUseMoveAction, type ComputerUseOptions, type ComputerUseScreenshotAction, type ComputerUseScrollAction, type ComputerUseTool, type ComputerUseTypeAction, type ComputerUseWaitAction, type ConvertOpenAICompletionsStreamOptions, type ConvertOpenAIResponsesStreamOptions, DallEAPIWrapper, DallEAPIWrapperParams, type FileSearchComparisonFilter, type FileSearchComparisonType, type FileSearchCompoundFilter, type FileSearchFilter, type FileSearchHybridSearchWeights, type FileSearchOptions, type FileSearchRankingOptions, type FileSearchTool, HeadersLike, type ImageGenerationInputMask, type ImageGenerationOptions, type ImageGenerationTool, type LocalShellAction, type LocalShellOptions, type LocalShellTool, type McpApprovalFilter, type McpConnectorId, type McpConnectorOptions, type McpRemoteServerOptions, type McpTool, type McpToolFilter, OpenAI, OpenAIApiKey, OpenAIBaseInput, OpenAICacheRetentionParam, OpenAICallOptions, OpenAIChatInput, OpenAIChatModelId, OpenAIClient, OpenAICoreRequestOptions, OpenAIEmbeddingModelId, OpenAIEmbeddings, OpenAIEmbeddingsParams, OpenAIEndpointConfig, OpenAIImageModelId, OpenAIInput, OpenAIPromptCacheOptions, OpenAIVerbosityParam, ResponseFormatConfiguration, ResponsesCreate, ResponsesCreateInvoke, ResponsesInputItem, ResponsesParse, ResponsesParseInvoke, type ShellAction, type ShellCallOutcome, type ShellCommandOutput, type ShellOptions, type ShellResult, type ShellTool, type TiktokenModel, type ToolSearchOptions, type ToolSearchTool, type WebSearchFilters, type WebSearchOptions, type WebSearchTool, completionsApiContentBlockConverter, convertCompletionsDeltaToBaseMessageChunk, convertCompletionsMessageToBaseMessage, convertMessagesToCompletionsMessageParams, convertMessagesToResponsesInput, convertOpenAICompletionsStream, convertOpenAIResponsesStream, convertPromptToOpenAI, convertReasoningSummaryToResponsesReasoningItem, convertResponsesDeltaToChatGenerationChunk, convertResponsesMessageToAIMessage, convertResponsesUsageToUsageMetadata, convertStandardContentBlockToCompletionsContentPart, convertStandardContentMessageToCompletionsMessage, convertStandardContentMessageToResponsesInput, customTool, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, messageToOpenAIRole, normalizeHeaders, toFile, tools, wrapOpenAIClientError };
|
|
39
|
+
export { type Answer, type AnswerFor, type Answers, type ApplyPatchCreateFileOperation, type ApplyPatchDeleteFileOperation, type ApplyPatchOperation, type ApplyPatchOptions, type ApplyPatchTool, type ApplyPatchUpdateFileOperation, AzureChatOpenAI, AzureChatOpenAICompletions, type AzureChatOpenAIFields, AzureChatOpenAIResponses, AzureOpenAI, AzureOpenAIChatInput, AzureOpenAIEmbeddings, AzureOpenAIInput, BaseChatOpenAI, type BaseChatOpenAICallOptions, type BaseChatOpenAIFields, ChatOpenAI, type ChatOpenAICallOptions, ChatOpenAICompletions, type ChatOpenAICompletionsCallOptions, type ChatOpenAIFields, ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, ChatOpenAIResponses, type ChatOpenAIResponsesCallOptions, type Choice, type ChoiceAnswer, type ClientOptions, type CodeInterpreterAutoContainer, type CodeInterpreterMemoryLimit, type CodeInterpreterOptions, type CodeInterpreterTool, type ComputerUseAction, type ComputerUseClickAction, type ComputerUseDoubleClickAction, type ComputerUseDragAction, type ComputerUseEnvironment, type ComputerUseInput, type ComputerUseKeypressAction, type ComputerUseMoveAction, type ComputerUseOptions, type ComputerUseScreenshotAction, type ComputerUseScrollAction, type ComputerUseTool, type ComputerUseTypeAction, type ComputerUseWaitAction, type ConvertOpenAICompletionsStreamOptions, type ConvertOpenAIResponsesStreamOptions, DallEAPIWrapper, DallEAPIWrapperParams, type DecisionInput, type DecisionRequest, type DecisionResult, type FileSearchComparisonFilter, type FileSearchComparisonType, type FileSearchCompoundFilter, type FileSearchFilter, type FileSearchHybridSearchWeights, type FileSearchOptions, type FileSearchRankingOptions, type FileSearchTool, HeadersLike, type ImageGenerationInputMask, type ImageGenerationOptions, type ImageGenerationTool, type Level, type LocalShellAction, type LocalShellOptions, type LocalShellTool, type McpApprovalFilter, type McpConnectorId, type McpConnectorOptions, type McpRemoteServerOptions, type McpTool, type McpToolFilter, OpenAI, OpenAIApiKey, OpenAIBaseInput, OpenAICacheRetentionParam, OpenAICallOptions, OpenAIChatInput, OpenAIChatModelId, OpenAIClient, OpenAICoreRequestOptions, OpenAIDecisions, OpenAIDecisionsFields, OpenAIEmbeddingModelId, OpenAIEmbeddings, OpenAIEmbeddingsParams, OpenAIEndpointConfig, OpenAIImageModelId, OpenAIInput, OpenAIPromptCacheOptions, OpenAIVerbosityParam, type Predicate, type PredicateAnswer, type Question, type Questions, type RefusalAnswer, ResponseFormatConfiguration, ResponsesCreate, ResponsesCreateInvoke, ResponsesInputItem, ResponsesParse, ResponsesParseInvoke, type Score, type ScoreAnswer, type ShellAction, type ShellCallOutcome, type ShellCommandOutput, type ShellOptions, type ShellResult, type ShellTool, type TiktokenModel, type ToolSearchOptions, type ToolSearchTool, type WebSearchFilters, type WebSearchOptions, type WebSearchTool, completionsApiContentBlockConverter, convertCompletionsDeltaToBaseMessageChunk, convertCompletionsMessageToBaseMessage, convertMessagesToCompletionsMessageParams, convertMessagesToResponsesInput, convertOpenAICompletionsStream, convertOpenAIResponsesStream, convertPromptToOpenAI, convertReasoningSummaryToResponsesReasoningItem, convertResponsesDeltaToChatGenerationChunk, convertResponsesMessageToAIMessage, convertResponsesUsageToUsageMetadata, convertStandardContentBlockToCompletionsContentPart, convertStandardContentMessageToCompletionsMessage, convertStandardContentMessageToResponsesInput, customTool, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, messageToOpenAIRole, normalizeHeaders, toFile, tools, wrapOpenAIClientError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AzureOpenAIChatInput, AzureOpenAIInput, ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, OpenAIApiKey, OpenAIBaseInput, OpenAICacheRetentionParam, OpenAICallOptions, OpenAIChatInput, OpenAIChatModelId, OpenAICoreRequestOptions, OpenAIInput, OpenAIPromptCacheOptions, OpenAIVerbosityParam, ResponseFormatConfiguration, TiktokenModel } from "./types.js";
|
|
2
|
-
import { BaseChatOpenAI, BaseChatOpenAICallOptions, BaseChatOpenAIFields } from "./chat_models/base.js";
|
|
3
|
-
import { ChatOpenAIResponses, ChatOpenAIResponsesCallOptions } from "./chat_models/responses.js";
|
|
4
|
-
import { ChatOpenAICompletions, ChatOpenAICompletionsCallOptions } from "./chat_models/completions.js";
|
|
5
|
-
import { ChatOpenAI, ChatOpenAICallOptions, ChatOpenAIFields } from "./chat_models/index.js";
|
|
6
1
|
import { AzureChatOpenAIFields } from "./azure/chat_models/common.js";
|
|
7
2
|
import { AzureChatOpenAICompletions } from "./azure/chat_models/completions.js";
|
|
8
3
|
import { AzureChatOpenAIResponses } from "./azure/chat_models/responses.js";
|
|
9
4
|
import { AzureChatOpenAI } from "./azure/chat_models/index.js";
|
|
10
|
-
import { OpenAI } from "./llms.js";
|
|
11
5
|
import { AzureOpenAI } from "./azure/llms.js";
|
|
12
|
-
import { OpenAIEmbeddingModelId, OpenAIEmbeddings, OpenAIEmbeddingsParams } from "./embeddings.js";
|
|
13
6
|
import { AzureOpenAIEmbeddings } from "./azure/embeddings.js";
|
|
7
|
+
import { BaseChatOpenAI, BaseChatOpenAICallOptions, BaseChatOpenAIFields } from "./chat_models/base.js";
|
|
8
|
+
import { ChatOpenAIResponses, ChatOpenAIResponsesCallOptions } from "./chat_models/responses.js";
|
|
9
|
+
import { ChatOpenAICompletions, ChatOpenAICompletionsCallOptions } from "./chat_models/completions.js";
|
|
10
|
+
import { ChatOpenAI, ChatOpenAICallOptions, ChatOpenAIFields } from "./chat_models/index.js";
|
|
11
|
+
import { OpenAI } from "./llms.js";
|
|
12
|
+
import { OpenAIEmbeddingModelId, OpenAIEmbeddings, OpenAIEmbeddingsParams } from "./embeddings.js";
|
|
13
|
+
import { AzureOpenAIChatInput, AzureOpenAIInput, ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, OpenAIApiKey, OpenAIBaseInput, OpenAICacheRetentionParam, OpenAICallOptions, OpenAIChatInput, OpenAIChatModelId, OpenAICoreRequestOptions, OpenAIInput, OpenAIPromptCacheOptions, OpenAIVerbosityParam, ResponseFormatConfiguration, TiktokenModel } from "./types.js";
|
|
14
14
|
import { wrapOpenAIClientError } from "./utils/client.js";
|
|
15
15
|
import { HeadersLike, OpenAIEndpointConfig, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, normalizeHeaders } from "./utils/azure.js";
|
|
16
16
|
import { DallEAPIWrapper, DallEAPIWrapperParams, OpenAIImageModelId } from "./tools/dalle.js";
|
|
@@ -33,5 +33,7 @@ import { ConvertOpenAIResponsesStreamOptions, convertOpenAIResponsesStream } fro
|
|
|
33
33
|
import { completionsApiContentBlockConverter, convertCompletionsDeltaToBaseMessageChunk, convertCompletionsMessageToBaseMessage, convertMessagesToCompletionsMessageParams, convertStandardContentBlockToCompletionsContentPart, convertStandardContentMessageToCompletionsMessage } from "./converters/completions.js";
|
|
34
34
|
import { ResponsesCreate, ResponsesCreateInvoke, ResponsesInputItem, ResponsesParse, ResponsesParseInvoke, convertMessagesToResponsesInput, convertReasoningSummaryToResponsesReasoningItem, convertResponsesDeltaToChatGenerationChunk, convertResponsesMessageToAIMessage, convertResponsesUsageToUsageMetadata, convertStandardContentMessageToResponsesInput } from "./converters/responses.js";
|
|
35
35
|
import "./converters/index.js";
|
|
36
|
+
import { Answer, AnswerFor, Answers, Choice, ChoiceAnswer, DecisionInput, DecisionRequest, DecisionResult, Level, Predicate, PredicateAnswer, Question, Questions, RefusalAnswer, Score, ScoreAnswer } from "./decisions/types.js";
|
|
37
|
+
import { OpenAIDecisions, OpenAIDecisionsFields } from "./decisions/index.js";
|
|
36
38
|
import { ClientOptions, OpenAI as OpenAIClient, toFile } from "openai";
|
|
37
|
-
export { type ApplyPatchCreateFileOperation, type ApplyPatchDeleteFileOperation, type ApplyPatchOperation, type ApplyPatchOptions, type ApplyPatchTool, type ApplyPatchUpdateFileOperation, AzureChatOpenAI, AzureChatOpenAICompletions, type AzureChatOpenAIFields, AzureChatOpenAIResponses, AzureOpenAI, AzureOpenAIChatInput, AzureOpenAIEmbeddings, AzureOpenAIInput, BaseChatOpenAI, type BaseChatOpenAICallOptions, type BaseChatOpenAIFields, ChatOpenAI, type ChatOpenAICallOptions, ChatOpenAICompletions, type ChatOpenAICompletionsCallOptions, type ChatOpenAIFields, ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, ChatOpenAIResponses, type ChatOpenAIResponsesCallOptions, type ClientOptions, type CodeInterpreterAutoContainer, type CodeInterpreterMemoryLimit, type CodeInterpreterOptions, type CodeInterpreterTool, type ComputerUseAction, type ComputerUseClickAction, type ComputerUseDoubleClickAction, type ComputerUseDragAction, type ComputerUseEnvironment, type ComputerUseInput, type ComputerUseKeypressAction, type ComputerUseMoveAction, type ComputerUseOptions, type ComputerUseScreenshotAction, type ComputerUseScrollAction, type ComputerUseTool, type ComputerUseTypeAction, type ComputerUseWaitAction, type ConvertOpenAICompletionsStreamOptions, type ConvertOpenAIResponsesStreamOptions, DallEAPIWrapper, DallEAPIWrapperParams, type FileSearchComparisonFilter, type FileSearchComparisonType, type FileSearchCompoundFilter, type FileSearchFilter, type FileSearchHybridSearchWeights, type FileSearchOptions, type FileSearchRankingOptions, type FileSearchTool, HeadersLike, type ImageGenerationInputMask, type ImageGenerationOptions, type ImageGenerationTool, type LocalShellAction, type LocalShellOptions, type LocalShellTool, type McpApprovalFilter, type McpConnectorId, type McpConnectorOptions, type McpRemoteServerOptions, type McpTool, type McpToolFilter, OpenAI, OpenAIApiKey, OpenAIBaseInput, OpenAICacheRetentionParam, OpenAICallOptions, OpenAIChatInput, OpenAIChatModelId, OpenAIClient, OpenAICoreRequestOptions, OpenAIEmbeddingModelId, OpenAIEmbeddings, OpenAIEmbeddingsParams, OpenAIEndpointConfig, OpenAIImageModelId, OpenAIInput, OpenAIPromptCacheOptions, OpenAIVerbosityParam, ResponseFormatConfiguration, ResponsesCreate, ResponsesCreateInvoke, ResponsesInputItem, ResponsesParse, ResponsesParseInvoke, type ShellAction, type ShellCallOutcome, type ShellCommandOutput, type ShellOptions, type ShellResult, type ShellTool, type TiktokenModel, type ToolSearchOptions, type ToolSearchTool, type WebSearchFilters, type WebSearchOptions, type WebSearchTool, completionsApiContentBlockConverter, convertCompletionsDeltaToBaseMessageChunk, convertCompletionsMessageToBaseMessage, convertMessagesToCompletionsMessageParams, convertMessagesToResponsesInput, convertOpenAICompletionsStream, convertOpenAIResponsesStream, convertPromptToOpenAI, convertReasoningSummaryToResponsesReasoningItem, convertResponsesDeltaToChatGenerationChunk, convertResponsesMessageToAIMessage, convertResponsesUsageToUsageMetadata, convertStandardContentBlockToCompletionsContentPart, convertStandardContentMessageToCompletionsMessage, convertStandardContentMessageToResponsesInput, customTool, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, messageToOpenAIRole, normalizeHeaders, toFile, tools, wrapOpenAIClientError };
|
|
39
|
+
export { type Answer, type AnswerFor, type Answers, type ApplyPatchCreateFileOperation, type ApplyPatchDeleteFileOperation, type ApplyPatchOperation, type ApplyPatchOptions, type ApplyPatchTool, type ApplyPatchUpdateFileOperation, AzureChatOpenAI, AzureChatOpenAICompletions, type AzureChatOpenAIFields, AzureChatOpenAIResponses, AzureOpenAI, AzureOpenAIChatInput, AzureOpenAIEmbeddings, AzureOpenAIInput, BaseChatOpenAI, type BaseChatOpenAICallOptions, type BaseChatOpenAIFields, ChatOpenAI, type ChatOpenAICallOptions, ChatOpenAICompletions, type ChatOpenAICompletionsCallOptions, type ChatOpenAIFields, ChatOpenAIReasoningSummary, ChatOpenAIResponseFormat, ChatOpenAIResponses, type ChatOpenAIResponsesCallOptions, type Choice, type ChoiceAnswer, type ClientOptions, type CodeInterpreterAutoContainer, type CodeInterpreterMemoryLimit, type CodeInterpreterOptions, type CodeInterpreterTool, type ComputerUseAction, type ComputerUseClickAction, type ComputerUseDoubleClickAction, type ComputerUseDragAction, type ComputerUseEnvironment, type ComputerUseInput, type ComputerUseKeypressAction, type ComputerUseMoveAction, type ComputerUseOptions, type ComputerUseScreenshotAction, type ComputerUseScrollAction, type ComputerUseTool, type ComputerUseTypeAction, type ComputerUseWaitAction, type ConvertOpenAICompletionsStreamOptions, type ConvertOpenAIResponsesStreamOptions, DallEAPIWrapper, DallEAPIWrapperParams, type DecisionInput, type DecisionRequest, type DecisionResult, type FileSearchComparisonFilter, type FileSearchComparisonType, type FileSearchCompoundFilter, type FileSearchFilter, type FileSearchHybridSearchWeights, type FileSearchOptions, type FileSearchRankingOptions, type FileSearchTool, HeadersLike, type ImageGenerationInputMask, type ImageGenerationOptions, type ImageGenerationTool, type Level, type LocalShellAction, type LocalShellOptions, type LocalShellTool, type McpApprovalFilter, type McpConnectorId, type McpConnectorOptions, type McpRemoteServerOptions, type McpTool, type McpToolFilter, OpenAI, OpenAIApiKey, OpenAIBaseInput, OpenAICacheRetentionParam, OpenAICallOptions, OpenAIChatInput, OpenAIChatModelId, OpenAIClient, OpenAICoreRequestOptions, OpenAIDecisions, OpenAIDecisionsFields, OpenAIEmbeddingModelId, OpenAIEmbeddings, OpenAIEmbeddingsParams, OpenAIEndpointConfig, OpenAIImageModelId, OpenAIInput, OpenAIPromptCacheOptions, OpenAIVerbosityParam, type Predicate, type PredicateAnswer, type Question, type Questions, type RefusalAnswer, ResponseFormatConfiguration, ResponsesCreate, ResponsesCreateInvoke, ResponsesInputItem, ResponsesParse, ResponsesParseInvoke, type Score, type ScoreAnswer, type ShellAction, type ShellCallOutcome, type ShellCommandOutput, type ShellOptions, type ShellResult, type ShellTool, type TiktokenModel, type ToolSearchOptions, type ToolSearchTool, type WebSearchFilters, type WebSearchOptions, type WebSearchTool, completionsApiContentBlockConverter, convertCompletionsDeltaToBaseMessageChunk, convertCompletionsMessageToBaseMessage, convertMessagesToCompletionsMessageParams, convertMessagesToResponsesInput, convertOpenAICompletionsStream, convertOpenAIResponsesStream, convertPromptToOpenAI, convertReasoningSummaryToResponsesReasoningItem, convertResponsesDeltaToChatGenerationChunk, convertResponsesMessageToAIMessage, convertResponsesUsageToUsageMetadata, convertStandardContentBlockToCompletionsContentPart, convertStandardContentMessageToCompletionsMessage, convertStandardContentMessageToResponsesInput, customTool, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, messageToOpenAIRole, normalizeHeaders, toFile, tools, wrapOpenAIClientError };
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { wrapOpenAIClientError } from "./utils/client.js";
|
|
2
|
-
import { messageToOpenAIRole } from "./utils/misc.js";
|
|
3
|
-
import { getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, normalizeHeaders } from "./utils/azure.js";
|
|
4
|
-
import { BaseChatOpenAI } from "./chat_models/base.js";
|
|
5
|
-
import { completionsApiContentBlockConverter, convertCompletionsDeltaToBaseMessageChunk, convertCompletionsMessageToBaseMessage, convertMessagesToCompletionsMessageParams, convertStandardContentBlockToCompletionsContentPart, convertStandardContentMessageToCompletionsMessage } from "./converters/completions.js";
|
|
6
|
-
import { convertOpenAICompletionsStream } from "./utils/stream_events.js";
|
|
7
|
-
import { ChatOpenAICompletions } from "./chat_models/completions.js";
|
|
8
1
|
import { AzureChatOpenAICompletions } from "./azure/chat_models/completions.js";
|
|
9
|
-
import { convertMessagesToResponsesInput, convertReasoningSummaryToResponsesReasoningItem, convertResponsesDeltaToChatGenerationChunk, convertResponsesMessageToAIMessage, convertResponsesUsageToUsageMetadata, convertStandardContentMessageToResponsesInput } from "./converters/responses.js";
|
|
10
|
-
import { convertOpenAIResponsesStream } from "./utils/responses_stream_events.js";
|
|
11
|
-
import { ChatOpenAIResponses } from "./chat_models/responses.js";
|
|
12
2
|
import { AzureChatOpenAIResponses } from "./azure/chat_models/responses.js";
|
|
13
|
-
import { ChatOpenAI } from "./chat_models/index.js";
|
|
14
3
|
import { AzureChatOpenAI } from "./azure/chat_models/index.js";
|
|
15
|
-
import { OpenAI } from "./llms.js";
|
|
16
4
|
import { AzureOpenAI } from "./azure/llms.js";
|
|
17
|
-
import {
|
|
5
|
+
import { completionsApiContentBlockConverter, convertCompletionsDeltaToBaseMessageChunk, convertCompletionsMessageToBaseMessage, convertMessagesToCompletionsMessageParams, convertStandardContentBlockToCompletionsContentPart, convertStandardContentMessageToCompletionsMessage } from "./converters/completions.js";
|
|
18
6
|
import { AzureOpenAIEmbeddings } from "./azure/embeddings.js";
|
|
19
|
-
import {
|
|
7
|
+
import { BaseChatOpenAI } from "./chat_models/base.js";
|
|
8
|
+
import { ChatOpenAIResponses } from "./chat_models/responses.js";
|
|
9
|
+
import { convertMessagesToResponsesInput, convertReasoningSummaryToResponsesReasoningItem, convertResponsesDeltaToChatGenerationChunk, convertResponsesMessageToAIMessage, convertResponsesUsageToUsageMetadata, convertStandardContentMessageToResponsesInput } from "./converters/responses.js";
|
|
10
|
+
import { ChatOpenAICompletions } from "./chat_models/completions.js";
|
|
11
|
+
import { ChatOpenAI } from "./chat_models/index.js";
|
|
12
|
+
import { OpenAI } from "./llms.js";
|
|
13
|
+
import { OpenAIEmbeddings } from "./embeddings.js";
|
|
14
|
+
import { wrapOpenAIClientError } from "./utils/client.js";
|
|
15
|
+
import { getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, normalizeHeaders } from "./utils/azure.js";
|
|
20
16
|
import { tools } from "./tools/index.js";
|
|
21
17
|
import { customTool } from "./tools/custom.js";
|
|
22
18
|
import { convertPromptToOpenAI } from "./utils/prompts.js";
|
|
19
|
+
import { DallEAPIWrapper } from "./tools/dalle.js";
|
|
20
|
+
import { messageToOpenAIRole } from "./utils/misc.js";
|
|
21
|
+
import { convertOpenAICompletionsStream } from "./utils/stream_events.js";
|
|
22
|
+
import { convertOpenAIResponsesStream } from "./utils/responses_stream_events.js";
|
|
23
23
|
import "./converters/index.js";
|
|
24
|
+
import { OpenAIDecisions } from "./decisions/index.js";
|
|
24
25
|
import { OpenAI as OpenAIClient, toFile } from "openai";
|
|
25
|
-
export { AzureChatOpenAI, AzureChatOpenAICompletions, AzureChatOpenAIResponses, AzureOpenAI, AzureOpenAIEmbeddings, BaseChatOpenAI, ChatOpenAI, ChatOpenAICompletions, ChatOpenAIResponses, DallEAPIWrapper, OpenAI, OpenAIClient, OpenAIEmbeddings, completionsApiContentBlockConverter, convertCompletionsDeltaToBaseMessageChunk, convertCompletionsMessageToBaseMessage, convertMessagesToCompletionsMessageParams, convertMessagesToResponsesInput, convertOpenAICompletionsStream, convertOpenAIResponsesStream, convertPromptToOpenAI, convertReasoningSummaryToResponsesReasoningItem, convertResponsesDeltaToChatGenerationChunk, convertResponsesMessageToAIMessage, convertResponsesUsageToUsageMetadata, convertStandardContentBlockToCompletionsContentPart, convertStandardContentMessageToCompletionsMessage, convertStandardContentMessageToResponsesInput, customTool, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, messageToOpenAIRole, normalizeHeaders, toFile, tools, wrapOpenAIClientError };
|
|
26
|
+
export { AzureChatOpenAI, AzureChatOpenAICompletions, AzureChatOpenAIResponses, AzureOpenAI, AzureOpenAIEmbeddings, BaseChatOpenAI, ChatOpenAI, ChatOpenAICompletions, ChatOpenAIResponses, DallEAPIWrapper, OpenAI, OpenAIClient, OpenAIDecisions, OpenAIEmbeddings, completionsApiContentBlockConverter, convertCompletionsDeltaToBaseMessageChunk, convertCompletionsMessageToBaseMessage, convertMessagesToCompletionsMessageParams, convertMessagesToResponsesInput, convertOpenAICompletionsStream, convertOpenAIResponsesStream, convertPromptToOpenAI, convertReasoningSummaryToResponsesReasoningItem, convertResponsesDeltaToChatGenerationChunk, convertResponsesMessageToAIMessage, convertResponsesUsageToUsageMetadata, convertStandardContentBlockToCompletionsContentPart, convertStandardContentMessageToCompletionsMessage, convertStandardContentMessageToResponsesInput, customTool, getEndpoint, getFormattedEnv, getHeadersWithUserAgent, isHeaders, messageToOpenAIRole, normalizeHeaders, toFile, tools, wrapOpenAIClientError };
|
package/dist/llms.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_client = require("./utils/client.cjs");
|
|
2
1
|
const require_azure = require("./utils/azure.cjs");
|
|
2
|
+
const require_client = require("./utils/client.cjs");
|
|
3
3
|
let openai = require("openai");
|
|
4
4
|
let _langchain_core_outputs = require("@langchain/core/outputs");
|
|
5
5
|
let _langchain_core_utils_env = require("@langchain/core/utils/env");
|
|
6
6
|
let _langchain_core_language_models_base = require("@langchain/core/language_models/base");
|
|
7
7
|
let _langchain_core_language_models_llms = require("@langchain/core/language_models/llms");
|
|
8
8
|
let _langchain_core_utils_chunk_array = require("@langchain/core/utils/chunk_array");
|
|
9
|
-
|
|
9
|
+
// src/llms.ts
|
|
10
10
|
/**
|
|
11
11
|
* Wrapper around OpenAI large language models.
|
|
12
12
|
*
|
|
@@ -82,7 +82,7 @@ var OpenAI = class extends _langchain_core_language_models_llms.BaseLLM {
|
|
|
82
82
|
clientConfig;
|
|
83
83
|
constructor(fields) {
|
|
84
84
|
super(fields ?? {});
|
|
85
|
-
this._addVersion("@langchain/openai", "1.
|
|
85
|
+
this._addVersion("@langchain/openai", "1.8.1");
|
|
86
86
|
this.openAIApiKey = fields?.apiKey ?? fields?.openAIApiKey ?? (0, _langchain_core_utils_env.getEnvironmentVariable)("OPENAI_API_KEY");
|
|
87
87
|
this.apiKey = this.openAIApiKey;
|
|
88
88
|
this.organization = fields?.configuration?.organization ?? (0, _langchain_core_utils_env.getEnvironmentVariable)("OPENAI_ORGANIZATION");
|
|
@@ -306,7 +306,6 @@ var OpenAI = class extends _langchain_core_language_models_llms.BaseLLM {
|
|
|
306
306
|
return "openai";
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
|
-
//#endregion
|
|
310
309
|
exports.OpenAI = OpenAI;
|
|
311
310
|
|
|
312
311
|
//# sourceMappingURL=llms.cjs.map
|
package/dist/llms.d.cts
CHANGED
|
@@ -3,7 +3,6 @@ import { ClientOptions, OpenAI } from "openai";
|
|
|
3
3
|
import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
|
|
4
4
|
import { GenerationChunk, LLMResult } from "@langchain/core/outputs";
|
|
5
5
|
import { BaseLLM, BaseLLMParams } from "@langchain/core/language_models/llms";
|
|
6
|
-
//#region src/llms.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Wrapper around OpenAI large language models.
|
|
9
8
|
*
|
|
@@ -115,6 +114,5 @@ declare class OpenAI$2<CallOptions extends OpenAICallOptions = OpenAICallOptions
|
|
|
115
114
|
protected _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;
|
|
116
115
|
_llmType(): string;
|
|
117
116
|
}
|
|
118
|
-
//#endregion
|
|
119
117
|
export { OpenAI$2 as OpenAI, type OpenAICallOptions, type OpenAIInput };
|
|
120
118
|
//# sourceMappingURL=llms.d.cts.map
|
package/dist/llms.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llms.d.cts","names":["OpenAI","OpenAIClient"],"sources":["../src/llms.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"llms.d.cts","names":["OpenAI","OpenAIClient"],"sources":["../src/llms.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+DaA,SAAO,oBAAoB,oBAAoB,2BAClD,QAAQ,wBACL,QAAQ;SAEZ;MAIH;EAIJ;MAEI;KAAiB;;MAQjB,cAAc;EAQlB;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA,YAAY;EAEZ;;EAGA;EAEA,cAAc;EAEd;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA,eAAe;EAEf,SAAS;EAET;YAEU,QAAQC;YAER,cAAc;EAExB,YACE,SAAS,QAAQ,eACf;IACE,gBAAgB;;;;;EAqEtB,iBACE,sCACC,KAAKA,OAAa;;EAmBrB,sBAAsB,KAAKA,OAAa;IACtC;MACE;;;;EAWJ,qBAAqB,KAAKA,OAAa;IACrC;MACE;;;;;;;;;;;;;;;;;EAoBE,UACJ,mBACA,oCACA,aAAa,2BACZ,QAAQ;EA0HJ,sBACL,eACA,oCACA,aAAa,2BACZ,eAAe;;;;;;;EAiCZ,oBACJ,SAASA,OAAa,iCACtB,UAAU,2BACT,QAAQ,cAAcA,OAAa;EAEhC,oBACJ,SAASA,OAAa,oCACtB,UAAU,2BACT,QAAQA,OAAa,YAAY;;;;;;;YAkC1B,kBACR,SAAS,uCACR;EA8BH"}
|
package/dist/llms.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { ClientOptions, OpenAI } from "openai";
|
|
|
3
3
|
import { GenerationChunk, LLMResult } from "@langchain/core/outputs";
|
|
4
4
|
import { BaseLLM, BaseLLMParams } from "@langchain/core/language_models/llms";
|
|
5
5
|
import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
|
|
6
|
-
//#region src/llms.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Wrapper around OpenAI large language models.
|
|
9
8
|
*
|
|
@@ -115,6 +114,5 @@ declare class OpenAI$2<CallOptions extends OpenAICallOptions = OpenAICallOptions
|
|
|
115
114
|
protected _getClientOptions(options: OpenAICoreRequestOptions | undefined): OpenAICoreRequestOptions;
|
|
116
115
|
_llmType(): string;
|
|
117
116
|
}
|
|
118
|
-
//#endregion
|
|
119
117
|
export { OpenAI$2 as OpenAI, type OpenAICallOptions, type OpenAIInput };
|
|
120
118
|
//# sourceMappingURL=llms.d.ts.map
|
package/dist/llms.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llms.d.ts","names":["OpenAI","OpenAIClient"],"sources":["../src/llms.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"llms.d.ts","names":["OpenAI","OpenAIClient"],"sources":["../src/llms.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+DaA,SAAO,oBAAoB,oBAAoB,2BAClD,QAAQ,wBACL,QAAQ;SAEZ;MAIH;EAIJ;MAEI;KAAiB;;MAQjB,cAAc;EAQlB;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA,YAAY;EAEZ;;EAGA;EAEA,cAAc;EAEd;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA,eAAe;EAEf,SAAS;EAET;YAEU,QAAQC;YAER,cAAc;EAExB,YACE,SAAS,QAAQ,eACf;IACE,gBAAgB;;;;;EAqEtB,iBACE,sCACC,KAAKA,OAAa;;EAmBrB,sBAAsB,KAAKA,OAAa;IACtC;MACE;;;;EAWJ,qBAAqB,KAAKA,OAAa;IACrC;MACE;;;;;;;;;;;;;;;;;EAoBE,UACJ,mBACA,oCACA,aAAa,2BACZ,QAAQ;EA0HJ,sBACL,eACA,oCACA,aAAa,2BACZ,eAAe;;;;;;;EAiCZ,oBACJ,SAASA,OAAa,iCACtB,UAAU,2BACT,QAAQ,cAAcA,OAAa;EAEhC,oBACJ,SAASA,OAAa,oCACtB,UAAU,2BACT,QAAQA,OAAa,YAAY;;;;;;;YAkC1B,kBACR,SAAS,uCACR;EA8BH"}
|
package/dist/llms.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { wrapOpenAIClientError } from "./utils/client.js";
|
|
2
1
|
import { getEndpoint, getHeadersWithUserAgent } from "./utils/azure.js";
|
|
2
|
+
import { wrapOpenAIClientError } from "./utils/client.js";
|
|
3
3
|
import { OpenAI } from "openai";
|
|
4
4
|
import { GenerationChunk } from "@langchain/core/outputs";
|
|
5
5
|
import { getEnvironmentVariable } from "@langchain/core/utils/env";
|
|
6
6
|
import { calculateMaxTokens } from "@langchain/core/language_models/base";
|
|
7
7
|
import { BaseLLM } from "@langchain/core/language_models/llms";
|
|
8
8
|
import { chunkArray } from "@langchain/core/utils/chunk_array";
|
|
9
|
-
|
|
9
|
+
// src/llms.ts
|
|
10
10
|
/**
|
|
11
11
|
* Wrapper around OpenAI large language models.
|
|
12
12
|
*
|
|
@@ -82,7 +82,7 @@ var OpenAI$2 = class extends BaseLLM {
|
|
|
82
82
|
clientConfig;
|
|
83
83
|
constructor(fields) {
|
|
84
84
|
super(fields ?? {});
|
|
85
|
-
this._addVersion("@langchain/openai", "1.
|
|
85
|
+
this._addVersion("@langchain/openai", "1.8.1");
|
|
86
86
|
this.openAIApiKey = fields?.apiKey ?? fields?.openAIApiKey ?? getEnvironmentVariable("OPENAI_API_KEY");
|
|
87
87
|
this.apiKey = this.openAIApiKey;
|
|
88
88
|
this.organization = fields?.configuration?.organization ?? getEnvironmentVariable("OPENAI_ORGANIZATION");
|
|
@@ -306,7 +306,6 @@ var OpenAI$2 = class extends BaseLLM {
|
|
|
306
306
|
return "openai";
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
|
-
//#endregion
|
|
310
309
|
export { OpenAI$2 as OpenAI };
|
|
311
310
|
|
|
312
311
|
//# sourceMappingURL=llms.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let _langchain_core_tools = require("@langchain/core/tools");
|
|
2
2
|
let zod_v4 = require("zod/v4");
|
|
3
|
-
|
|
3
|
+
// src/tools/applyPatch.ts
|
|
4
4
|
const ApplyPatchCreateFileOperationSchema = zod_v4.z.object({
|
|
5
5
|
type: zod_v4.z.literal("create_file"),
|
|
6
6
|
path: zod_v4.z.string(),
|
|
@@ -108,7 +108,6 @@ function applyPatch(options) {
|
|
|
108
108
|
};
|
|
109
109
|
return patchTool;
|
|
110
110
|
}
|
|
111
|
-
//#endregion
|
|
112
111
|
exports.ApplyPatchCreateFileOperationSchema = ApplyPatchCreateFileOperationSchema;
|
|
113
112
|
exports.ApplyPatchDeleteFileOperationSchema = ApplyPatchDeleteFileOperationSchema;
|
|
114
113
|
exports.ApplyPatchOperationSchema = ApplyPatchOperationSchema;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { DynamicStructuredTool } from "@langchain/core/tools";
|
|
3
3
|
import { z } from "zod/v4";
|
|
4
|
-
//#region src/tools/applyPatch.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Re-export operation types from OpenAI SDK for convenience.
|
|
7
6
|
*/
|
|
@@ -142,5 +141,4 @@ export type ApplyPatchTool = OpenAI.Responses.ApplyPatchTool;
|
|
|
142
141
|
* - Implement "all-or-nothing" semantics if atomicity is required
|
|
143
142
|
*/
|
|
144
143
|
export declare function applyPatch(options: ApplyPatchOptions): DynamicStructuredTool<typeof ApplyPatchOperationSchema, ApplyPatchOperation, unknown, string>;
|
|
145
|
-
//#endregion
|
|
146
144
|
//# sourceMappingURL=applyPatch.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyPatch.d.cts","names":["OpenAIClient"],"sources":["../../src/tools/applyPatch.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"applyPatch.d.cts","names":["OpenAIClient"],"sources":["../../src/tools/applyPatch.ts"],"mappings":";;;;;;YAOY,gCACVA,OAAa,UAAU,2BAA2B;YACxC,gCACVA,OAAa,UAAU,2BAA2B;YACxC,gCACVA,OAAa,UAAU,2BAA2B;;;;YAKxC,sBAAsB,YAChCA,OAAa,UAAU;qBAsBZ,2BAAyB,EAAA,mBAAA,EAAA;;;;;;;;;;;GAIpC,EAAA,KAAA;;;;iBAKe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCf,UAAU,WAAW,iCAAiC;;;;;YAM5C,iBAAiBA,OAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+EpC,WAAW,SAAS,oBAed,6BACX,2BACP"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { DynamicStructuredTool } from "@langchain/core/tools";
|
|
3
3
|
import { z } from "zod/v4";
|
|
4
|
-
//#region src/tools/applyPatch.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Re-export operation types from OpenAI SDK for convenience.
|
|
7
6
|
*/
|
|
@@ -142,5 +141,4 @@ export type ApplyPatchTool = OpenAI.Responses.ApplyPatchTool;
|
|
|
142
141
|
* - Implement "all-or-nothing" semantics if atomicity is required
|
|
143
142
|
*/
|
|
144
143
|
export declare function applyPatch(options: ApplyPatchOptions): DynamicStructuredTool<typeof ApplyPatchOperationSchema, ApplyPatchOperation, unknown, string>;
|
|
145
|
-
//#endregion
|
|
146
144
|
//# sourceMappingURL=applyPatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyPatch.d.ts","names":["OpenAIClient"],"sources":["../../src/tools/applyPatch.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"applyPatch.d.ts","names":["OpenAIClient"],"sources":["../../src/tools/applyPatch.ts"],"mappings":";;;;;;YAOY,gCACVA,OAAa,UAAU,2BAA2B;YACxC,gCACVA,OAAa,UAAU,2BAA2B;YACxC,gCACVA,OAAa,UAAU,2BAA2B;;;;YAKxC,sBAAsB,YAChCA,OAAa,UAAU;qBAsBZ,2BAAyB,EAAA,mBAAA,EAAA;;;;;;;;;;;GAIpC,EAAA,KAAA;;;;iBAKe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCf,UAAU,WAAW,iCAAiC;;;;;YAM5C,iBAAiBA,OAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+EpC,WAAW,SAAS,oBAed,6BACX,2BACP"}
|
package/dist/tools/applyPatch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tool } from "@langchain/core/tools";
|
|
2
2
|
import { z } from "zod/v4";
|
|
3
|
-
|
|
3
|
+
// src/tools/applyPatch.ts
|
|
4
4
|
const ApplyPatchCreateFileOperationSchema = z.object({
|
|
5
5
|
type: z.literal("create_file"),
|
|
6
6
|
path: z.string(),
|
|
@@ -108,7 +108,6 @@ function applyPatch(options) {
|
|
|
108
108
|
};
|
|
109
109
|
return patchTool;
|
|
110
110
|
}
|
|
111
|
-
//#endregion
|
|
112
111
|
export { ApplyPatchCreateFileOperationSchema, ApplyPatchDeleteFileOperationSchema, ApplyPatchOperationSchema, ApplyPatchUpdateFileOperationSchema, applyPatch };
|
|
113
112
|
|
|
114
113
|
//# sourceMappingURL=applyPatch.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/tools/codeInterpreter.ts
|
|
2
2
|
/**
|
|
3
3
|
* Converts container options to the API format.
|
|
4
4
|
*/
|
|
@@ -88,7 +88,6 @@ function codeInterpreter(options) {
|
|
|
88
88
|
container: convertContainer(options?.container)
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
//#endregion
|
|
92
91
|
exports.codeInterpreter = codeInterpreter;
|
|
93
92
|
|
|
94
93
|
//# sourceMappingURL=codeInterpreter.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OpenAI } from "openai";
|
|
2
2
|
import { ServerTool } from "@langchain/core/tools";
|
|
3
|
-
//#region src/tools/codeInterpreter.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Memory limit options for the Code Interpreter container.
|
|
6
5
|
* Higher tiers offer more RAM and are billed at different rates.
|
|
@@ -118,5 +117,4 @@ export type CodeInterpreterTool = OpenAI.Responses.Tool.CodeInterpreter;
|
|
|
118
117
|
* - Generated files are returned as `container_file_citation` annotations
|
|
119
118
|
*/
|
|
120
119
|
export declare function codeInterpreter(options?: CodeInterpreterOptions): ServerTool;
|
|
121
|
-
//#endregion
|
|
122
120
|
//# sourceMappingURL=codeInterpreter.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeInterpreter.d.cts","names":["OpenAIClient"],"sources":["../../src/tools/codeInterpreter.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"codeInterpreter.d.cts","names":["OpenAIClient"],"sources":["../../src/tools/codeInterpreter.ts"],"mappings":";;;;;;YAOY;;;;;iBAMK;;;;;;;;EAQf,cAAc;;;;;;EAMd;;;;;iBAMe;;;;;;;;;;EAUf,qBAAqB;;;;;YAMX,sBAAsBA,OAAa,UAAU,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+F9C,gBAAgB,UAAU,yBAAyB"}
|