langchain 0.0.204-rc.1 → 0.0.204
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._coerceToRunnable = exports.RunnableWithFallbacks = exports.RunnableLambda = exports.RunnableMap = exports.RunnableSequence = exports.RunnableRetry = exports.RunnableEach = exports.RunnableBinding = exports.Runnable = void 0;
|
|
3
|
+
exports._coerceToRunnable = exports.RunnableWithFallbacks = exports.RunnableLambda = exports.RunnableParallel = exports.RunnableMap = exports.RunnableSequence = exports.RunnableRetry = exports.RunnableEach = exports.RunnableBinding = exports.Runnable = void 0;
|
|
4
4
|
var runnables_1 = require("@langchain/core/runnables");
|
|
5
5
|
Object.defineProperty(exports, "Runnable", { enumerable: true, get: function () { return runnables_1.Runnable; } });
|
|
6
6
|
Object.defineProperty(exports, "RunnableBinding", { enumerable: true, get: function () { return runnables_1.RunnableBinding; } });
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "RunnableEach", { enumerable: true, get: function
|
|
|
8
8
|
Object.defineProperty(exports, "RunnableRetry", { enumerable: true, get: function () { return runnables_1.RunnableRetry; } });
|
|
9
9
|
Object.defineProperty(exports, "RunnableSequence", { enumerable: true, get: function () { return runnables_1.RunnableSequence; } });
|
|
10
10
|
Object.defineProperty(exports, "RunnableMap", { enumerable: true, get: function () { return runnables_1.RunnableMap; } });
|
|
11
|
+
Object.defineProperty(exports, "RunnableParallel", { enumerable: true, get: function () { return runnables_1.RunnableParallel; } });
|
|
11
12
|
Object.defineProperty(exports, "RunnableLambda", { enumerable: true, get: function () { return runnables_1.RunnableLambda; } });
|
|
12
13
|
Object.defineProperty(exports, "RunnableWithFallbacks", { enumerable: true, get: function () { return runnables_1.RunnableWithFallbacks; } });
|
|
13
14
|
Object.defineProperty(exports, "_coerceToRunnable", { enumerable: true, get: function () { return runnables_1._coerceToRunnable; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { type RunnableFunc, type RunnableLike, type RunnableBatchOptions, type RunnableRetryFailedAttemptHandler, Runnable, type RunnableBindingArgs, RunnableBinding, RunnableEach, RunnableRetry, RunnableSequence, RunnableMap, RunnableLambda, RunnableWithFallbacks, _coerceToRunnable, } from "@langchain/core/runnables";
|
|
1
|
+
export { type RunnableFunc, type RunnableLike, type RunnableBatchOptions, type RunnableRetryFailedAttemptHandler, Runnable, type RunnableBindingArgs, RunnableBinding, RunnableEach, RunnableRetry, RunnableSequence, RunnableMap, RunnableParallel, RunnableLambda, RunnableWithFallbacks, _coerceToRunnable, } from "@langchain/core/runnables";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Runnable, RunnableBinding, RunnableEach, RunnableRetry, RunnableSequence, RunnableMap, RunnableLambda, RunnableWithFallbacks, _coerceToRunnable, } from "@langchain/core/runnables";
|
|
1
|
+
export { Runnable, RunnableBinding, RunnableEach, RunnableRetry, RunnableSequence, RunnableMap, RunnableParallel, RunnableLambda, RunnableWithFallbacks, _coerceToRunnable, } from "@langchain/core/runnables";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langchain",
|
|
3
|
-
"version": "0.0.204
|
|
3
|
+
"version": "0.0.204",
|
|
4
4
|
"description": "Typescript bindings for langchain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -1174,9 +1174,9 @@
|
|
|
1174
1174
|
},
|
|
1175
1175
|
"dependencies": {
|
|
1176
1176
|
"@anthropic-ai/sdk": "^0.9.1",
|
|
1177
|
-
"@langchain/community": "~0.0.
|
|
1178
|
-
"@langchain/core": "~0.0.11
|
|
1179
|
-
"@langchain/openai": "~0.0.2
|
|
1177
|
+
"@langchain/community": "~0.0.2",
|
|
1178
|
+
"@langchain/core": "~0.0.11",
|
|
1179
|
+
"@langchain/openai": "~0.0.2",
|
|
1180
1180
|
"binary-extensions": "^2.2.0",
|
|
1181
1181
|
"expr-eval": "^2.0.2",
|
|
1182
1182
|
"js-tiktoken": "^1.0.7",
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import type { OpenAIClient } from "@langchain/openai";
|
|
2
|
-
import { TiktokenModel } from "js-tiktoken/lite";
|
|
3
|
-
import { BaseLanguageModelCallOptions } from "../base_language/index.js";
|
|
4
|
-
export type { TiktokenModel };
|
|
5
|
-
export declare interface OpenAIBaseInput {
|
|
6
|
-
/** Sampling temperature to use */
|
|
7
|
-
temperature: number;
|
|
8
|
-
/**
|
|
9
|
-
* Maximum number of tokens to generate in the completion. -1 returns as many
|
|
10
|
-
* tokens as possible given the prompt and the model's maximum context size.
|
|
11
|
-
*/
|
|
12
|
-
maxTokens?: number;
|
|
13
|
-
/** Total probability mass of tokens to consider at each step */
|
|
14
|
-
topP: number;
|
|
15
|
-
/** Penalizes repeated tokens according to frequency */
|
|
16
|
-
frequencyPenalty: number;
|
|
17
|
-
/** Penalizes repeated tokens */
|
|
18
|
-
presencePenalty: number;
|
|
19
|
-
/** Number of completions to generate for each prompt */
|
|
20
|
-
n: number;
|
|
21
|
-
/** Dictionary used to adjust the probability of specific tokens being generated */
|
|
22
|
-
logitBias?: Record<string, number>;
|
|
23
|
-
/** Unique string identifier representing your end-user, which can help OpenAI to monitor and detect abuse. */
|
|
24
|
-
user?: string;
|
|
25
|
-
/** Whether to stream the results or not. Enabling disables tokenUsage reporting */
|
|
26
|
-
streaming: boolean;
|
|
27
|
-
/** Model name to use */
|
|
28
|
-
modelName: string;
|
|
29
|
-
/** Holds any additional parameters that are valid to pass to {@link
|
|
30
|
-
* https://platform.openai.com/docs/api-reference/completions/create |
|
|
31
|
-
* `openai.createCompletion`} that are not explicitly specified on this class.
|
|
32
|
-
*/
|
|
33
|
-
modelKwargs?: Record<string, any>;
|
|
34
|
-
/** List of stop words to use when generating */
|
|
35
|
-
stop?: string[];
|
|
36
|
-
/**
|
|
37
|
-
* Timeout to use when making requests to OpenAI.
|
|
38
|
-
*/
|
|
39
|
-
timeout?: number;
|
|
40
|
-
/**
|
|
41
|
-
* API key to use when making requests to OpenAI. Defaults to the value of
|
|
42
|
-
* `OPENAI_API_KEY` environment variable.
|
|
43
|
-
*/
|
|
44
|
-
openAIApiKey?: string;
|
|
45
|
-
}
|
|
46
|
-
export type OpenAICoreRequestOptions<Req extends object = Record<string, unknown>> = {
|
|
47
|
-
path?: string;
|
|
48
|
-
query?: Req | undefined;
|
|
49
|
-
body?: Req | undefined;
|
|
50
|
-
headers?: Record<string, string | null | undefined> | undefined;
|
|
51
|
-
maxRetries?: number;
|
|
52
|
-
stream?: boolean | undefined;
|
|
53
|
-
timeout?: number;
|
|
54
|
-
httpAgent?: any;
|
|
55
|
-
signal?: AbortSignal | undefined | null;
|
|
56
|
-
idempotencyKey?: string;
|
|
57
|
-
};
|
|
58
|
-
export interface OpenAICallOptions extends BaseLanguageModelCallOptions {
|
|
59
|
-
/**
|
|
60
|
-
* Additional options to pass to the underlying axios request.
|
|
61
|
-
*/
|
|
62
|
-
options?: OpenAICoreRequestOptions;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Input to OpenAI class.
|
|
66
|
-
*/
|
|
67
|
-
export declare interface OpenAIInput extends OpenAIBaseInput {
|
|
68
|
-
/** Generates `bestOf` completions server side and returns the "best" */
|
|
69
|
-
bestOf?: number;
|
|
70
|
-
/** Batch size to use when passing multiple documents to generate */
|
|
71
|
-
batchSize: number;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* @deprecated Use "baseURL", "defaultHeaders", and "defaultParams" instead.
|
|
75
|
-
*/
|
|
76
|
-
export interface LegacyOpenAIInput {
|
|
77
|
-
/** @deprecated Use baseURL instead */
|
|
78
|
-
basePath?: string;
|
|
79
|
-
/** @deprecated Use defaultHeaders and defaultQuery instead */
|
|
80
|
-
baseOptions?: {
|
|
81
|
-
headers?: Record<string, string>;
|
|
82
|
-
params?: Record<string, string>;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
export interface OpenAIChatInput extends OpenAIBaseInput {
|
|
86
|
-
/** ChatGPT messages to pass as a prefix to the prompt */
|
|
87
|
-
prefixMessages?: OpenAIClient.Chat.CreateChatCompletionRequestMessage[];
|
|
88
|
-
}
|
|
89
|
-
export declare interface AzureOpenAIInput {
|
|
90
|
-
/**
|
|
91
|
-
* API version to use when making requests to Azure OpenAI.
|
|
92
|
-
*/
|
|
93
|
-
azureOpenAIApiVersion?: string;
|
|
94
|
-
/**
|
|
95
|
-
* API key to use when making requests to Azure OpenAI.
|
|
96
|
-
*/
|
|
97
|
-
azureOpenAIApiKey?: string;
|
|
98
|
-
/**
|
|
99
|
-
* Azure OpenAI API instance name to use when making requests to Azure OpenAI.
|
|
100
|
-
* this is the name of the instance you created in the Azure portal.
|
|
101
|
-
* e.g. "my-openai-instance"
|
|
102
|
-
* this will be used in the endpoint URL: https://my-openai-instance.openai.azure.com/openai/deployments/{DeploymentName}/
|
|
103
|
-
*/
|
|
104
|
-
azureOpenAIApiInstanceName?: string;
|
|
105
|
-
/**
|
|
106
|
-
* Azure OpenAI API deployment name to use for completions when making requests to Azure OpenAI.
|
|
107
|
-
* This is the name of the deployment you created in the Azure portal.
|
|
108
|
-
* e.g. "my-openai-deployment"
|
|
109
|
-
* this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/
|
|
110
|
-
*/
|
|
111
|
-
azureOpenAIApiDeploymentName?: string;
|
|
112
|
-
/**
|
|
113
|
-
* Azure OpenAI API deployment name to use for embedding when making requests to Azure OpenAI.
|
|
114
|
-
* This is the name of the deployment you created in the Azure portal.
|
|
115
|
-
* This will fallback to azureOpenAIApiDeploymentName if not provided.
|
|
116
|
-
* e.g. "my-openai-deployment"
|
|
117
|
-
* this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/
|
|
118
|
-
*/
|
|
119
|
-
azureOpenAIApiEmbeddingsDeploymentName?: string;
|
|
120
|
-
/**
|
|
121
|
-
* Azure OpenAI API deployment name to use for completions when making requests to Azure OpenAI.
|
|
122
|
-
* Completions are only available for gpt-3.5-turbo and text-davinci-003 deployments.
|
|
123
|
-
* This is the name of the deployment you created in the Azure portal.
|
|
124
|
-
* This will fallback to azureOpenAIApiDeploymentName if not provided.
|
|
125
|
-
* e.g. "my-openai-deployment"
|
|
126
|
-
* this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/
|
|
127
|
-
*/
|
|
128
|
-
azureOpenAIApiCompletionsDeploymentName?: string;
|
|
129
|
-
/**
|
|
130
|
-
* Custom endpoint for Azure OpenAI API. This is useful in case you have a deployment in another region.
|
|
131
|
-
* e.g. setting this value to "https://westeurope.api.cognitive.microsoft.com/openai/deployments"
|
|
132
|
-
* will be result in the endpoint URL: https://westeurope.api.cognitive.microsoft.com/openai/deployments/{DeploymentName}/
|
|
133
|
-
*/
|
|
134
|
-
azureOpenAIBasePath?: string;
|
|
135
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|