langchain 0.0.145 → 0.0.147
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/dist/base_language/index.cjs +2 -2
- package/dist/base_language/index.d.ts +2 -1
- package/dist/base_language/index.js +1 -1
- package/dist/chains/api/api_chain.d.ts +1 -1
- package/dist/chains/base.d.ts +1 -1
- package/dist/chains/openai_functions/extraction.d.ts +1 -1
- package/dist/chains/openai_functions/openapi.cjs +32 -27
- package/dist/chains/openai_functions/openapi.d.ts +10 -1
- package/dist/chains/openai_functions/openapi.js +31 -27
- package/dist/chains/openai_functions/structured_output.d.ts +1 -1
- package/dist/chains/openai_functions/tagging.d.ts +1 -1
- package/dist/chat_models/anthropic.d.ts +2 -2
- package/dist/chat_models/base.d.ts +1 -1
- package/dist/chat_models/openai.cjs +1 -1
- package/dist/chat_models/openai.js +1 -1
- package/dist/experimental/llms/bittensor.cjs +141 -0
- package/dist/experimental/llms/bittensor.d.ts +33 -0
- package/dist/experimental/llms/bittensor.js +137 -0
- package/dist/hub.cjs +14 -0
- package/dist/hub.d.ts +15 -1
- package/dist/hub.js +14 -0
- package/dist/llms/base.d.ts +1 -1
- package/dist/llms/openai-chat.cjs +1 -1
- package/dist/llms/openai-chat.js +1 -1
- package/dist/llms/openai.cjs +1 -1
- package/dist/llms/openai.js +1 -1
- package/dist/load/import_constants.cjs +2 -0
- package/dist/load/import_constants.js +2 -0
- package/dist/load/import_map.cjs +1 -1
- package/dist/load/import_map.d.ts +1 -1
- package/dist/load/import_map.js +1 -1
- package/dist/load/index.cjs +2 -1
- package/dist/load/index.js +2 -1
- package/dist/prompts/base.cjs +2 -2
- package/dist/prompts/base.d.ts +1 -1
- package/dist/prompts/base.js +1 -1
- package/dist/prompts/chat.cjs +2 -2
- package/dist/prompts/chat.d.ts +1 -1
- package/dist/prompts/chat.js +1 -1
- package/dist/schema/document.cjs +2 -2
- package/dist/schema/document.d.ts +1 -1
- package/dist/schema/document.js +1 -1
- package/dist/schema/index.cjs +5 -22
- package/dist/schema/index.d.ts +1 -5
- package/dist/schema/index.js +5 -22
- package/dist/schema/output_parser.cjs +2 -2
- package/dist/schema/output_parser.d.ts +2 -1
- package/dist/schema/output_parser.js +1 -1
- package/dist/schema/retriever.cjs +2 -2
- package/dist/schema/retriever.d.ts +2 -1
- package/dist/schema/retriever.js +1 -1
- package/dist/schema/runnable/config.cjs +8 -0
- package/dist/schema/runnable/config.d.ts +3 -0
- package/dist/schema/runnable/config.js +4 -0
- package/dist/schema/{runnable.cjs → runnable/index.cjs} +290 -101
- package/dist/schema/{runnable.d.ts → runnable/index.d.ts} +127 -41
- package/dist/schema/{runnable.js → runnable/index.js} +284 -99
- package/dist/tools/base.d.ts +1 -1
- package/dist/types/googlevertexai-types.d.ts +1 -1
- package/dist/util/async_caller.cjs +35 -25
- package/dist/util/async_caller.d.ts +8 -0
- package/dist/util/async_caller.js +35 -25
- package/dist/vectorstores/pinecone.cjs +30 -22
- package/dist/vectorstores/pinecone.d.ts +3 -1
- package/dist/vectorstores/pinecone.js +30 -22
- package/dist/vectorstores/vectara.cjs +20 -23
- package/dist/vectorstores/vectara.d.ts +9 -2
- package/dist/vectorstores/vectara.js +20 -23
- package/dist/vectorstores/voy.cjs +158 -0
- package/dist/vectorstores/voy.d.ts +73 -0
- package/dist/vectorstores/voy.js +154 -0
- package/experimental/llms/bittensor.cjs +1 -0
- package/experimental/llms/bittensor.d.ts +1 -0
- package/experimental/llms/bittensor.js +1 -0
- package/package.json +24 -68
- package/schema/runnable.cjs +1 -1
- package/schema/runnable.d.ts +1 -1
- package/schema/runnable.js +1 -1
- package/vectorstores/voy.cjs +1 -0
- package/vectorstores/voy.d.ts +1 -0
- package/vectorstores/voy.js +1 -0
- package/chat_models.cjs +0 -1
- package/chat_models.d.ts +0 -1
- package/chat_models.js +0 -1
- package/dist/chat_models/index.cjs +0 -11
- package/dist/chat_models/index.d.ts +0 -3
- package/dist/chat_models/index.js +0 -4
- package/dist/document_loaders/index.cjs +0 -40
- package/dist/document_loaders/index.d.ts +0 -18
- package/dist/document_loaders/index.js +0 -18
- package/dist/embeddings/index.cjs +0 -12
- package/dist/embeddings/index.d.ts +0 -4
- package/dist/embeddings/index.js +0 -5
- package/dist/index.cjs +0 -12
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -4
- package/dist/llms/index.cjs +0 -18
- package/dist/llms/index.d.ts +0 -6
- package/dist/llms/index.js +0 -7
- package/dist/retrievers/index.cjs +0 -14
- package/dist/retrievers/index.d.ts +0 -5
- package/dist/retrievers/index.js +0 -6
- package/dist/vectorstores/index.cjs +0 -17
- package/dist/vectorstores/index.d.ts +0 -6
- package/dist/vectorstores/index.js +0 -7
- package/document_loaders.cjs +0 -1
- package/document_loaders.d.ts +0 -1
- package/document_loaders.js +0 -1
- package/embeddings.cjs +0 -1
- package/embeddings.d.ts +0 -1
- package/embeddings.js +0 -1
- package/llms.cjs +0 -1
- package/llms.d.ts +0 -1
- package/llms.js +0 -1
- package/retrievers.cjs +0 -1
- package/retrievers.d.ts +0 -1
- package/retrievers.js +0 -1
- package/vectorstores.cjs +0 -1
- package/vectorstores.d.ts +0 -1
- package/vectorstores.js +0 -1
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Serializable } from "
|
|
3
|
-
import { IterableReadableStream } from "
|
|
4
|
-
|
|
1
|
+
import { CallbackManager, CallbackManagerForChainRun, BaseCallbackConfig } from "../../callbacks/manager.js";
|
|
2
|
+
import { Serializable } from "../../load/serializable.js";
|
|
3
|
+
import { IterableReadableStream } from "../../util/stream.js";
|
|
4
|
+
import { RunnableConfig as _RunnableConfig } from "./config.js";
|
|
5
|
+
export type RunnableConfig = _RunnableConfig;
|
|
5
6
|
export type RunnableFunc<RunInput, RunOutput> = (input: RunInput) => RunOutput | Promise<RunOutput>;
|
|
6
7
|
export type RunnableLike<RunInput = any, RunOutput = any> = Runnable<RunInput, RunOutput> | RunnableFunc<RunInput, RunOutput> | {
|
|
7
8
|
[key: string]: RunnableLike<RunInput, RunOutput>;
|
|
8
9
|
};
|
|
10
|
+
export type RunnableBatchOptions = {
|
|
11
|
+
maxConcurrency?: number;
|
|
12
|
+
returnExceptions?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type RunnableRetryFailedAttemptHandler = (error: any) => any;
|
|
15
|
+
type RunnableConfigAndOptions = RunnableConfig & {
|
|
16
|
+
runType?: string;
|
|
17
|
+
};
|
|
9
18
|
/**
|
|
10
19
|
* A Runnable is a generic unit of work that can be invoked, batched, streamed, and/or
|
|
11
20
|
* transformed.
|
|
@@ -19,6 +28,15 @@ export declare abstract class Runnable<RunInput = any, RunOutput = any, CallOpti
|
|
|
19
28
|
* @returns A new RunnableBinding that, when invoked, will apply the bound args.
|
|
20
29
|
*/
|
|
21
30
|
bind(kwargs: Partial<CallOptions>): RunnableBinding<RunInput, RunOutput, CallOptions>;
|
|
31
|
+
/**
|
|
32
|
+
* Bind arguments to a Runnable, returning a new Runnable.
|
|
33
|
+
* @param kwargs
|
|
34
|
+
* @returns A new RunnableBinding that, when invoked, will apply the bound args.
|
|
35
|
+
*/
|
|
36
|
+
withRetry(fields?: {
|
|
37
|
+
stopAfterAttempt?: number;
|
|
38
|
+
onFailedAttempt?: RunnableRetryFailedAttemptHandler;
|
|
39
|
+
}): RunnableRetry<RunInput, RunOutput, CallOptions>;
|
|
22
40
|
/**
|
|
23
41
|
* Create a new runnable from the current one that will try invoking
|
|
24
42
|
* other passed fallback runnables if the initial invocation fails.
|
|
@@ -35,11 +53,16 @@ export declare abstract class Runnable<RunInput = any, RunOutput = any, CallOpti
|
|
|
35
53
|
* @param inputs Array of inputs to each batch call.
|
|
36
54
|
* @param options Either a single call options object to apply to each batch call or an array for each call.
|
|
37
55
|
* @param batchOptions.maxConcurrency Maximum number of calls to run at once.
|
|
38
|
-
* @
|
|
56
|
+
* @param batchOptions.returnExceptions Whether to return errors rather than throwing on the first one
|
|
57
|
+
* @returns An array of RunOutputs, or mixed RunOutputs and errors if batchOptions.returnExceptions is set
|
|
39
58
|
*/
|
|
40
|
-
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: {
|
|
41
|
-
|
|
59
|
+
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & {
|
|
60
|
+
returnExceptions?: false;
|
|
42
61
|
}): Promise<RunOutput[]>;
|
|
62
|
+
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & {
|
|
63
|
+
returnExceptions: true;
|
|
64
|
+
}): Promise<(RunOutput | Error)[]>;
|
|
65
|
+
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions): Promise<(RunOutput | Error)[]>;
|
|
43
66
|
/**
|
|
44
67
|
* Default streaming implementation.
|
|
45
68
|
* Subclasses should override this method if they support streaming output.
|
|
@@ -55,9 +78,17 @@ export declare abstract class Runnable<RunInput = any, RunOutput = any, CallOpti
|
|
|
55
78
|
*/
|
|
56
79
|
stream(input: RunInput, options?: Partial<CallOptions>): Promise<IterableReadableStream<RunOutput>>;
|
|
57
80
|
protected _separateRunnableConfigFromCallOptions(options?: Partial<CallOptions>): [RunnableConfig, Omit<Partial<CallOptions>, keyof RunnableConfig>];
|
|
58
|
-
protected _callWithConfig<T extends RunInput>(func: (input: T) => Promise<RunOutput
|
|
59
|
-
|
|
60
|
-
|
|
81
|
+
protected _callWithConfig<T extends RunInput>(func: ((input: T) => Promise<RunOutput>) | ((input: T, config?: RunnableConfig, runManager?: CallbackManagerForChainRun) => Promise<RunOutput>), input: T, options?: RunnableConfigAndOptions): Promise<RunOutput>;
|
|
82
|
+
/**
|
|
83
|
+
* Internal method that handles batching and configuration for a runnable
|
|
84
|
+
* It takes a function, input values, and optional configuration, and
|
|
85
|
+
* returns a promise that resolves to the output values.
|
|
86
|
+
* @param func The function to be executed for each input value.
|
|
87
|
+
* @param input The input values to be processed.
|
|
88
|
+
* @param config Optional configuration for the function execution.
|
|
89
|
+
* @returns A promise that resolves to the output values.
|
|
90
|
+
*/
|
|
91
|
+
_batchWithConfig<T extends RunInput>(func: (inputs: T[], configs?: RunnableConfig[], runManagers?: (CallbackManagerForChainRun | undefined)[], batchOptions?: RunnableBatchOptions) => Promise<(RunOutput | Error)[]>, inputs: T[], options?: Partial<RunnableConfigAndOptions> | Partial<RunnableConfigAndOptions>[], batchOptions?: RunnableBatchOptions): Promise<(RunOutput | Error)[]>;
|
|
61
92
|
/**
|
|
62
93
|
* Helper method to transform an Iterator of Input values into an Iterator of
|
|
63
94
|
* Output values, with callbacks.
|
|
@@ -73,7 +104,7 @@ export declare abstract class Runnable<RunInput = any, RunOutput = any, CallOpti
|
|
|
73
104
|
* @param coerceable A runnable, function, or object whose values are functions or runnables.
|
|
74
105
|
* @returns A new runnable sequence.
|
|
75
106
|
*/
|
|
76
|
-
pipe<NewRunOutput>(coerceable: RunnableLike<RunOutput, NewRunOutput>): RunnableSequence<RunInput, NewRunOutput
|
|
107
|
+
pipe<NewRunOutput>(coerceable: RunnableLike<RunOutput, NewRunOutput>): RunnableSequence<RunInput, Exclude<NewRunOutput, Error>>;
|
|
77
108
|
/**
|
|
78
109
|
* Default implementation of transform, which buffers input and then calls stream.
|
|
79
110
|
* Subclasses should override this method if they can start producing output while
|
|
@@ -81,9 +112,72 @@ export declare abstract class Runnable<RunInput = any, RunOutput = any, CallOpti
|
|
|
81
112
|
* @param generator
|
|
82
113
|
* @param options
|
|
83
114
|
*/
|
|
84
|
-
transform
|
|
115
|
+
transform(generator: AsyncGenerator<RunInput>, options: Partial<CallOptions>): AsyncGenerator<RunOutput>;
|
|
85
116
|
static isRunnable(thing: any): thing is Runnable;
|
|
86
117
|
}
|
|
118
|
+
export type RunnableBindingArgs<RunInput, RunOutput, CallOptions extends RunnableConfig> = {
|
|
119
|
+
bound: Runnable<RunInput, RunOutput, CallOptions>;
|
|
120
|
+
kwargs: Partial<CallOptions>;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* A runnable that delegates calls to another runnable with a set of kwargs.
|
|
124
|
+
*/
|
|
125
|
+
export declare class RunnableBinding<RunInput, RunOutput, CallOptions extends BaseCallbackConfig> extends Runnable<RunInput, RunOutput, CallOptions> {
|
|
126
|
+
static lc_name(): string;
|
|
127
|
+
lc_namespace: string[];
|
|
128
|
+
lc_serializable: boolean;
|
|
129
|
+
bound: Runnable<RunInput, RunOutput, CallOptions>;
|
|
130
|
+
protected kwargs: Partial<CallOptions>;
|
|
131
|
+
constructor(fields: RunnableBindingArgs<RunInput, RunOutput, CallOptions>);
|
|
132
|
+
bind(kwargs: Partial<CallOptions>): RunnableBinding<RunInput, RunOutput, CallOptions>;
|
|
133
|
+
invoke(input: RunInput, options?: Partial<CallOptions>): Promise<RunOutput>;
|
|
134
|
+
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & {
|
|
135
|
+
returnExceptions?: false;
|
|
136
|
+
}): Promise<RunOutput[]>;
|
|
137
|
+
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & {
|
|
138
|
+
returnExceptions: true;
|
|
139
|
+
}): Promise<(RunOutput | Error)[]>;
|
|
140
|
+
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions): Promise<(RunOutput | Error)[]>;
|
|
141
|
+
_streamIterator(input: RunInput, options?: Partial<CallOptions> | undefined): AsyncGenerator<Awaited<RunOutput>, void, unknown>;
|
|
142
|
+
stream(input: RunInput, options?: Partial<CallOptions> | undefined): Promise<IterableReadableStream<RunOutput>>;
|
|
143
|
+
transform(generator: AsyncGenerator<RunInput>, options: Partial<CallOptions>): AsyncGenerator<RunOutput>;
|
|
144
|
+
static isRunnableBinding(thing: any): thing is RunnableBinding<any, any, any>;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Base class for runnables that can be retried a
|
|
148
|
+
* specified number of times.
|
|
149
|
+
*/
|
|
150
|
+
export declare class RunnableRetry<RunInput = any, RunOutput = any, CallOptions extends RunnableConfig = RunnableConfig> extends RunnableBinding<RunInput, RunOutput, CallOptions> {
|
|
151
|
+
static lc_name(): string;
|
|
152
|
+
lc_namespace: string[];
|
|
153
|
+
protected maxAttemptNumber: number;
|
|
154
|
+
onFailedAttempt?: RunnableRetryFailedAttemptHandler;
|
|
155
|
+
constructor(fields: RunnableBindingArgs<RunInput, RunOutput, CallOptions> & {
|
|
156
|
+
maxAttemptNumber?: number;
|
|
157
|
+
onFailedAttempt?: RunnableRetryFailedAttemptHandler;
|
|
158
|
+
});
|
|
159
|
+
_patchConfigForRetry(attempt: number, config?: Partial<CallOptions>, runManager?: CallbackManagerForChainRun): Partial<CallOptions>;
|
|
160
|
+
protected _invoke(input: RunInput, config?: CallOptions, runManager?: CallbackManagerForChainRun): Promise<RunOutput>;
|
|
161
|
+
/**
|
|
162
|
+
* Method that invokes the runnable with the specified input, run manager,
|
|
163
|
+
* and config. It handles the retry logic by catching any errors and
|
|
164
|
+
* recursively invoking itself with the updated config for the next retry
|
|
165
|
+
* attempt.
|
|
166
|
+
* @param input The input for the runnable.
|
|
167
|
+
* @param runManager The run manager for the runnable.
|
|
168
|
+
* @param config The config for the runnable.
|
|
169
|
+
* @returns A promise that resolves to the output of the runnable.
|
|
170
|
+
*/
|
|
171
|
+
invoke(input: RunInput, config?: CallOptions): Promise<RunOutput>;
|
|
172
|
+
_batch<ReturnExceptions extends boolean = false>(inputs: RunInput[], configs?: RunnableConfig[], runManagers?: (CallbackManagerForChainRun | undefined)[], batchOptions?: RunnableBatchOptions): Promise<ReturnExceptions extends false ? RunOutput[] : (Error | RunOutput)[]>;
|
|
173
|
+
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & {
|
|
174
|
+
returnExceptions?: false;
|
|
175
|
+
}): Promise<RunOutput[]>;
|
|
176
|
+
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & {
|
|
177
|
+
returnExceptions: true;
|
|
178
|
+
}): Promise<(RunOutput | Error)[]>;
|
|
179
|
+
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions): Promise<(RunOutput | Error)[]>;
|
|
180
|
+
}
|
|
87
181
|
/**
|
|
88
182
|
* A sequence of runnables, where the output of each is the input of the next.
|
|
89
183
|
*/
|
|
@@ -101,17 +195,21 @@ export declare class RunnableSequence<RunInput = any, RunOutput = any> extends R
|
|
|
101
195
|
});
|
|
102
196
|
get steps(): Runnable<RunInput, any, BaseCallbackConfig>[];
|
|
103
197
|
invoke(input: RunInput, options?: RunnableConfig): Promise<RunOutput>;
|
|
104
|
-
batch(inputs: RunInput[], options?: RunnableConfig | RunnableConfig[], batchOptions?: {
|
|
105
|
-
|
|
198
|
+
batch(inputs: RunInput[], options?: Partial<RunnableConfig> | Partial<RunnableConfig>[], batchOptions?: RunnableBatchOptions & {
|
|
199
|
+
returnExceptions?: false;
|
|
106
200
|
}): Promise<RunOutput[]>;
|
|
201
|
+
batch(inputs: RunInput[], options?: Partial<RunnableConfig> | Partial<RunnableConfig>[], batchOptions?: RunnableBatchOptions & {
|
|
202
|
+
returnExceptions: true;
|
|
203
|
+
}): Promise<(RunOutput | Error)[]>;
|
|
204
|
+
batch(inputs: RunInput[], options?: Partial<RunnableConfig> | Partial<RunnableConfig>[], batchOptions?: RunnableBatchOptions): Promise<(RunOutput | Error)[]>;
|
|
107
205
|
_streamIterator(input: RunInput, options?: RunnableConfig): AsyncGenerator<RunOutput>;
|
|
108
|
-
pipe<NewRunOutput>(coerceable: RunnableLike<RunOutput, NewRunOutput>): RunnableSequence<RunInput, NewRunOutput
|
|
206
|
+
pipe<NewRunOutput>(coerceable: RunnableLike<RunOutput, NewRunOutput>): RunnableSequence<RunInput, Exclude<NewRunOutput, Error>>;
|
|
109
207
|
static isRunnableSequence(thing: any): thing is RunnableSequence;
|
|
110
208
|
static from<RunInput, RunOutput>([first, ...runnables]: [
|
|
111
209
|
RunnableLike<RunInput>,
|
|
112
210
|
...RunnableLike[],
|
|
113
211
|
RunnableLike<any, RunOutput>
|
|
114
|
-
]): RunnableSequence<RunInput, RunOutput
|
|
212
|
+
]): RunnableSequence<RunInput, Exclude<RunOutput, Error>>;
|
|
115
213
|
}
|
|
116
214
|
/**
|
|
117
215
|
* A runnable that runs a mapping of runnables in parallel,
|
|
@@ -148,27 +246,6 @@ export declare class RunnablePassthrough<RunInput> extends Runnable<RunInput, Ru
|
|
|
148
246
|
lc_serializable: boolean;
|
|
149
247
|
invoke(input: RunInput, options?: Partial<BaseCallbackConfig>): Promise<RunInput>;
|
|
150
248
|
}
|
|
151
|
-
/**
|
|
152
|
-
* A runnable that delegates calls to another runnable with a set of kwargs.
|
|
153
|
-
*/
|
|
154
|
-
export declare class RunnableBinding<RunInput, RunOutput, CallOptions extends BaseCallbackConfig> extends Runnable<RunInput, RunOutput, CallOptions> {
|
|
155
|
-
static lc_name(): string;
|
|
156
|
-
lc_namespace: string[];
|
|
157
|
-
lc_serializable: boolean;
|
|
158
|
-
protected bound: Runnable<RunInput, RunOutput, CallOptions>;
|
|
159
|
-
protected kwargs: Partial<CallOptions>;
|
|
160
|
-
constructor(fields: {
|
|
161
|
-
bound: Runnable<RunInput, RunOutput, CallOptions>;
|
|
162
|
-
kwargs: Partial<CallOptions>;
|
|
163
|
-
});
|
|
164
|
-
bind(kwargs: Partial<CallOptions>): RunnableBinding<RunInput, RunOutput, CallOptions>;
|
|
165
|
-
invoke(input: RunInput, options?: Partial<CallOptions>): Promise<RunOutput>;
|
|
166
|
-
batch(inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: {
|
|
167
|
-
maxConcurrency?: number;
|
|
168
|
-
}): Promise<RunOutput[]>;
|
|
169
|
-
_streamIterator(input: RunInput, options?: Partial<CallOptions> | undefined): AsyncGenerator<Awaited<RunOutput>, void, unknown>;
|
|
170
|
-
stream(input: RunInput, options?: Partial<CallOptions> | undefined): Promise<IterableReadableStream<RunOutput>>;
|
|
171
|
-
}
|
|
172
249
|
export type RouterInput = {
|
|
173
250
|
key: string;
|
|
174
251
|
input: any;
|
|
@@ -186,9 +263,13 @@ export declare class RouterRunnable<RunInput extends RouterInput, RunnableInput,
|
|
|
186
263
|
runnables: Record<string, Runnable<RunnableInput, RunOutput>>;
|
|
187
264
|
});
|
|
188
265
|
invoke(input: RunInput, options?: Partial<BaseCallbackConfig>): Promise<RunOutput>;
|
|
189
|
-
batch(inputs: RunInput[], options?: Partial<BaseCallbackConfig> | Partial<BaseCallbackConfig>[], batchOptions?: {
|
|
190
|
-
|
|
266
|
+
batch(inputs: RunInput[], options?: Partial<BaseCallbackConfig> | Partial<BaseCallbackConfig>[], batchOptions?: RunnableBatchOptions & {
|
|
267
|
+
returnExceptions?: false;
|
|
191
268
|
}): Promise<RunOutput[]>;
|
|
269
|
+
batch(inputs: RunInput[], options?: Partial<BaseCallbackConfig> | Partial<BaseCallbackConfig>[], batchOptions?: RunnableBatchOptions & {
|
|
270
|
+
returnExceptions: true;
|
|
271
|
+
}): Promise<(RunOutput | Error)[]>;
|
|
272
|
+
batch(inputs: RunInput[], options?: Partial<BaseCallbackConfig> | Partial<BaseCallbackConfig>[], batchOptions?: RunnableBatchOptions): Promise<(RunOutput | Error)[]>;
|
|
192
273
|
stream(input: RunInput, options?: Partial<BaseCallbackConfig>): Promise<IterableReadableStream<RunOutput>>;
|
|
193
274
|
}
|
|
194
275
|
/**
|
|
@@ -206,7 +287,12 @@ export declare class RunnableWithFallbacks<RunInput, RunOutput> extends Runnable
|
|
|
206
287
|
});
|
|
207
288
|
runnables(): Generator<Runnable<RunInput, RunOutput, BaseCallbackConfig>, void, unknown>;
|
|
208
289
|
invoke(input: RunInput, options?: Partial<BaseCallbackConfig>): Promise<RunOutput>;
|
|
209
|
-
batch(inputs: RunInput[], options?: Partial<BaseCallbackConfig> | Partial<BaseCallbackConfig>[], batchOptions?: {
|
|
210
|
-
|
|
290
|
+
batch(inputs: RunInput[], options?: Partial<BaseCallbackConfig> | Partial<BaseCallbackConfig>[], batchOptions?: RunnableBatchOptions & {
|
|
291
|
+
returnExceptions?: false;
|
|
211
292
|
}): Promise<RunOutput[]>;
|
|
293
|
+
batch(inputs: RunInput[], options?: Partial<BaseCallbackConfig> | Partial<BaseCallbackConfig>[], batchOptions?: RunnableBatchOptions & {
|
|
294
|
+
returnExceptions: true;
|
|
295
|
+
}): Promise<(RunOutput | Error)[]>;
|
|
296
|
+
batch(inputs: RunInput[], options?: Partial<BaseCallbackConfig> | Partial<BaseCallbackConfig>[], batchOptions?: RunnableBatchOptions): Promise<(RunOutput | Error)[]>;
|
|
212
297
|
}
|
|
298
|
+
export {};
|