llm-exe 3.0.0 → 3.0.2
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/index.d.mts +77 -27
- package/dist/index.d.ts +77 -27
- package/dist/index.js +283 -24
- package/dist/index.mjs +281 -24
- package/package.json +2 -1
- package/readme.md +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -14,11 +14,18 @@ interface Serializable {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
type IChatMessageRole = "system" | "model" | "assistant" | "user" | "function" | "function_call";
|
|
17
|
+
/**
|
|
18
|
+
* Loose content-block shape accepted everywhere content blocks are taken.
|
|
19
|
+
* Prefer `IChatMessageContent`; this stays loose (`type: string`) for
|
|
20
|
+
* backwards compatibility with previously-accepted shapes like
|
|
21
|
+
* `{ type: "image", image_url: {...} }`, which providers normalize.
|
|
22
|
+
*/
|
|
17
23
|
interface IChatMessageContentDetailed {
|
|
18
24
|
type: string;
|
|
19
25
|
text?: string;
|
|
20
26
|
image_url?: {
|
|
21
27
|
url: string;
|
|
28
|
+
detail?: "low" | "high" | "auto";
|
|
22
29
|
};
|
|
23
30
|
}
|
|
24
31
|
interface IChatMessageBase {
|
|
@@ -670,7 +677,7 @@ declare function createChatPrompt<I extends Record<string, any>>(initialSystemPr
|
|
|
670
677
|
* @template O - Output type.
|
|
671
678
|
* @template H - Hooks type.
|
|
672
679
|
*/
|
|
673
|
-
declare abstract class BaseExecutor<I extends PlainObject, O = any, H extends BaseExecutorHooks = BaseExecutorHooks> {
|
|
680
|
+
declare abstract class BaseExecutor<I extends PlainObject, O = any, H extends BaseExecutorHooks = BaseExecutorHooks, R = any, HI = any> {
|
|
674
681
|
/**
|
|
675
682
|
* @property id - internal id of the executor
|
|
676
683
|
*/
|
|
@@ -701,7 +708,7 @@ declare abstract class BaseExecutor<I extends PlainObject, O = any, H extends Ba
|
|
|
701
708
|
* @property maxHooksPerEvent - Maximum number of hooks allowed per event
|
|
702
709
|
*/
|
|
703
710
|
readonly maxHooksPerEvent: number;
|
|
704
|
-
constructor(name: string, type: string, options?: CoreExecutorExecuteOptions<H>);
|
|
711
|
+
constructor(name: string, type: string, options?: CoreExecutorExecuteOptions<I, O, R, HI, H>);
|
|
705
712
|
abstract handler(input: I, _options?: any, _context?: ExecutionContext<I, O>): Promise<any>;
|
|
706
713
|
/**
|
|
707
714
|
* Build a per-call execution context snapshot. Captures the current
|
|
@@ -745,7 +752,7 @@ declare abstract class BaseExecutor<I extends PlainObject, O = any, H extends Ba
|
|
|
745
752
|
metadata(): Record<string, any>;
|
|
746
753
|
getMetadata(metadata?: Record<string, any>): ExecutorMetadata;
|
|
747
754
|
runHook(hook: keyof H, _metadata: ExecutorExecutionMetadata): HookErrorRecord[];
|
|
748
|
-
setHooks(hooks?: CoreExecutorHookInput<H>): this;
|
|
755
|
+
setHooks(hooks?: CoreExecutorHookInput<I, O, R, HI, H>): this;
|
|
749
756
|
removeHook(eventName: keyof H, fn: ListenerFunction): this;
|
|
750
757
|
on(eventName: keyof H, fn: ListenerFunction): this;
|
|
751
758
|
off(eventName: keyof H, fn: ListenerFunction): this;
|
|
@@ -770,9 +777,9 @@ declare abstract class BaseExecutor<I extends PlainObject, O = any, H extends Ba
|
|
|
770
777
|
* Core Function Executor
|
|
771
778
|
*/
|
|
772
779
|
declare class CoreExecutor<I extends PlainObject, O> extends BaseExecutor<I, O> {
|
|
773
|
-
_handler: (input: I) => Promise<any> | any;
|
|
774
|
-
constructor(fn: CoreExecutorInput<I, O>, options?: CoreExecutorExecuteOptions);
|
|
775
|
-
handler(_input: I): Promise<O>;
|
|
780
|
+
_handler: (input: I, context?: ExecutionContext<I, O>) => Promise<any> | any;
|
|
781
|
+
constructor(fn: CoreExecutorInput<I, O>, options?: CoreExecutorExecuteOptions<I, O>);
|
|
782
|
+
handler(_input: I, _options?: any, _context?: ExecutionContext<I, O>): Promise<O>;
|
|
776
783
|
}
|
|
777
784
|
|
|
778
785
|
declare abstract class BaseStateItem<T> implements Serializable {
|
|
@@ -903,12 +910,12 @@ declare function createStateItem<T>(name: string, defaultValue: T): DefaultState
|
|
|
903
910
|
/**
|
|
904
911
|
* Core Executor With LLM
|
|
905
912
|
*/
|
|
906
|
-
declare class LlmExecutor<Llm extends BaseLlm<any>, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser<any, any>, State extends BaseState> extends BaseExecutor<PromptInput<Prompt>, ParserOutput<Parser>, LlmExecutorHooks
|
|
913
|
+
declare class LlmExecutor<Llm extends BaseLlm<any>, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser<any, any>, State extends BaseState> extends BaseExecutor<PromptInput<Prompt>, ParserOutput<Parser>, LlmExecutorHooks, BaseLlCall, ReturnType<Prompt["format"]>> {
|
|
907
914
|
llm: Llm;
|
|
908
915
|
prompt: Prompt | undefined;
|
|
909
916
|
promptFn: any;
|
|
910
917
|
parser: StringParser | Parser;
|
|
911
|
-
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<LlmExecutorHooks>);
|
|
918
|
+
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<PromptInput<Prompt>, ParserOutput<Parser>, BaseLlCall, ReturnType<Prompt["format"]>, LlmExecutorHooks>);
|
|
912
919
|
/**
|
|
913
920
|
* Runs the executor against the configured LLM and prompt.
|
|
914
921
|
*
|
|
@@ -931,14 +938,14 @@ declare class LlmExecutor<Llm extends BaseLlm<any>, Prompt extends BasePrompt<Re
|
|
|
931
938
|
* Core Executor With LLM
|
|
932
939
|
*/
|
|
933
940
|
declare class LlmExecutorWithFunctions<Llm extends BaseLlm, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser, State extends BaseState = BaseState> extends LlmExecutor<Llm, Prompt, LlmFunctionParser<Parser>, State> {
|
|
934
|
-
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<LlmExecutorHooks>);
|
|
941
|
+
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<PromptInput<Prompt>, ParserOutput<LlmFunctionParser<Parser>>, BaseLlCall, ReturnType<Prompt["format"]>, LlmExecutorHooks>);
|
|
935
942
|
execute<T extends GenericFunctionCall>(_input: PromptInput<Prompt>, _options: LlmExecutorWithFunctionsOptions<T>): Promise<OutputResultContent[] | ParserOutput<Parser>>;
|
|
936
943
|
}
|
|
937
944
|
/**
|
|
938
945
|
* @deprecated Use `LlmExecutorWithFunctions` instead.
|
|
939
946
|
*/
|
|
940
947
|
declare class LlmExecutorOpenAiFunctions<Llm extends BaseLlm, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser, State extends BaseState = BaseState> extends LlmExecutor<Llm, Prompt, LlmNativeFunctionParser<Parser>, State> {
|
|
941
|
-
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<LlmExecutorHooks>);
|
|
948
|
+
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<PromptInput<Prompt>, ParserOutput<LlmNativeFunctionParser<Parser>>, BaseLlCall, ReturnType<Prompt["format"]>, LlmExecutorHooks>);
|
|
942
949
|
execute<T extends GenericFunctionCall>(_input: PromptInput<Prompt>, _options: LlmExecutorWithFunctionsOptions<T>): Promise<ParserOutput<Parser> | {
|
|
943
950
|
name: string;
|
|
944
951
|
arguments: any;
|
|
@@ -952,7 +959,7 @@ declare class LlmExecutorOpenAiFunctions<Llm extends BaseLlm, Prompt extends Bas
|
|
|
952
959
|
* @param handler - The handler function.
|
|
953
960
|
* @returns - A new CoreExecutor instance.
|
|
954
961
|
*/
|
|
955
|
-
declare function createCoreExecutor<I extends PlainObject, O>(handler: (input: I) => Promise<O> | O, options?: CoreExecutorExecuteOptions): CoreExecutor<I, O>;
|
|
962
|
+
declare function createCoreExecutor<I extends PlainObject, O>(handler: (input: I, context?: ExecutionContext<I, O>) => Promise<O> | O, options?: CoreExecutorExecuteOptions<I, O>): CoreExecutor<I, O>;
|
|
956
963
|
/**
|
|
957
964
|
* Function to create a core executor with Llm.
|
|
958
965
|
* @template Llm - Llm type.
|
|
@@ -962,8 +969,8 @@ declare function createCoreExecutor<I extends PlainObject, O>(handler: (input: I
|
|
|
962
969
|
* @param options - Options for BaseExecutorV3.
|
|
963
970
|
* @returns - A new LlmExecutor instance.
|
|
964
971
|
*/
|
|
965
|
-
declare function createLlmExecutor<Llm extends BaseLlm<any>, Prompt extends BasePrompt<any>, Parser extends BaseParser, State extends BaseState>(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<LlmExecutorHooks>): LlmExecutor<Llm, Prompt, Parser, State>;
|
|
966
|
-
declare function createLlmFunctionExecutor<Llm extends BaseLlm, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser, State extends BaseState>(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<LlmExecutorHooks>): LlmExecutorWithFunctions<Llm, Prompt, Parser, State>;
|
|
972
|
+
declare function createLlmExecutor<Llm extends BaseLlm<any>, Prompt extends BasePrompt<any>, Parser extends BaseParser, State extends BaseState>(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<PromptInput<Prompt>, ParserOutput<Parser>, BaseLlCall, ReturnType<Prompt["format"]>, LlmExecutorHooks>): LlmExecutor<Llm, Prompt, Parser, State>;
|
|
973
|
+
declare function createLlmFunctionExecutor<Llm extends BaseLlm, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser, State extends BaseState>(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<PromptInput<Prompt>, ParserOutput<LlmFunctionParser<Parser>>, BaseLlCall, ReturnType<Prompt["format"]>, LlmExecutorHooks>): LlmExecutorWithFunctions<Llm, Prompt, Parser, State>;
|
|
967
974
|
|
|
968
975
|
declare const hookOnComplete = "onComplete";
|
|
969
976
|
declare const hookOnError = "onError";
|
|
@@ -982,7 +989,7 @@ interface ExecutorWithLlmOptions<Llm, Prompt, Parser, State> {
|
|
|
982
989
|
}
|
|
983
990
|
interface CoreExecutorInput<I, O> {
|
|
984
991
|
name?: string;
|
|
985
|
-
handler: (input: I) => Promise<O> | O;
|
|
992
|
+
handler: (input: I, context?: ExecutionContext<I, O>) => Promise<O> | O;
|
|
986
993
|
getHandlerInput?(input: I): Promise<any>;
|
|
987
994
|
getHandlerOutput?(out: any): O;
|
|
988
995
|
}
|
|
@@ -1006,12 +1013,12 @@ interface HookErrorRecord {
|
|
|
1006
1013
|
errorContext?: unknown;
|
|
1007
1014
|
errorCause?: unknown;
|
|
1008
1015
|
}
|
|
1009
|
-
interface ExecutorExecutionMetadata<I = any, O = any> {
|
|
1016
|
+
interface ExecutorExecutionMetadata<I = any, O = any, R = any, HI = any> {
|
|
1010
1017
|
start: null | number;
|
|
1011
1018
|
end: null | number;
|
|
1012
1019
|
input: I;
|
|
1013
|
-
handlerInput?:
|
|
1014
|
-
handlerOutput?:
|
|
1020
|
+
handlerInput?: HI;
|
|
1021
|
+
handlerOutput?: R;
|
|
1015
1022
|
output?: O;
|
|
1016
1023
|
errorMessage?: string;
|
|
1017
1024
|
error?: Error;
|
|
@@ -1045,11 +1052,20 @@ interface BaseExecutorHooks {
|
|
|
1045
1052
|
}
|
|
1046
1053
|
interface LlmExecutorHooks extends BaseExecutorHooks {
|
|
1047
1054
|
}
|
|
1048
|
-
|
|
1049
|
-
|
|
1055
|
+
/**
|
|
1056
|
+
* A single executor hook callback. Receives the per-run execution metadata
|
|
1057
|
+
* (input/output/error fields typed via I/O) followed by the executor's own
|
|
1058
|
+
* identity metadata. This is the shape fired for onSuccess / onError /
|
|
1059
|
+
* onComplete — the metadata fields that are populated differ per event
|
|
1060
|
+
* (`output` on success, `error` on failure), but all are optional on
|
|
1061
|
+
* {@link ExecutorExecutionMetadata}, so one signature covers every hook.
|
|
1062
|
+
*/
|
|
1063
|
+
type ExecutorHookFunction<I = any, O = any, R = any, HI = any> = (metadata: ExecutorExecutionMetadata<I, O, R, HI>, executor: ExecutorMetadata) => void;
|
|
1064
|
+
type CoreExecutorHookInput<I = any, O = any, R = any, HI = any, H = BaseExecutorHooks> = {
|
|
1065
|
+
[key in keyof H]?: ExecutorHookFunction<I, O, R, HI> | ExecutorHookFunction<I, O, R, HI>[];
|
|
1050
1066
|
};
|
|
1051
|
-
interface CoreExecutorExecuteOptions<T = BaseExecutorHooks> {
|
|
1052
|
-
hooks?: CoreExecutorHookInput<T>;
|
|
1067
|
+
interface CoreExecutorExecuteOptions<I = any, O = any, R = any, HI = any, T = BaseExecutorHooks> {
|
|
1068
|
+
hooks?: CoreExecutorHookInput<I, O, R, HI, T>;
|
|
1053
1069
|
}
|
|
1054
1070
|
interface CallableExecutorCore {
|
|
1055
1071
|
name: string;
|
|
@@ -1073,6 +1089,18 @@ interface LlmExecutorWithFunctionsOptions<T extends GenericFunctionCall = "auto"
|
|
|
1073
1089
|
|
|
1074
1090
|
interface ParserSchemaOptions<S extends JSONSchema | undefined = undefined> {
|
|
1075
1091
|
schema?: S;
|
|
1092
|
+
/**
|
|
1093
|
+
* Controls schema enforcement when `schema` is provided. Validation —
|
|
1094
|
+
* including `required` fields and type/constraint checks — is **on by
|
|
1095
|
+
* default** whenever a schema is set; invalid or incomplete input throws a
|
|
1096
|
+
* `parser.schema_validation_failed` error.
|
|
1097
|
+
*
|
|
1098
|
+
* Set `validateSchema: false` to opt out into the legacy filter/default-only
|
|
1099
|
+
* behavior: unknown keys are stripped and defaults applied, but `required`
|
|
1100
|
+
* fields and constraints are NOT checked. Has no effect when no schema is set.
|
|
1101
|
+
*
|
|
1102
|
+
* @default true (when `schema` is provided)
|
|
1103
|
+
*/
|
|
1076
1104
|
validateSchema?: boolean;
|
|
1077
1105
|
}
|
|
1078
1106
|
type JsonParserMatch = "exact" | "extract";
|
|
@@ -1251,6 +1279,15 @@ type AllLlm = {
|
|
|
1251
1279
|
};
|
|
1252
1280
|
};
|
|
1253
1281
|
type AllUseLlmOptions = AllLlm & {
|
|
1282
|
+
"openai.gpt-5.5": {
|
|
1283
|
+
input: Omit<OpenAiRequest, "model">;
|
|
1284
|
+
};
|
|
1285
|
+
"openai.gpt-5.4": {
|
|
1286
|
+
input: Omit<OpenAiRequest, "model">;
|
|
1287
|
+
};
|
|
1288
|
+
"openai.gpt-5.4-mini": {
|
|
1289
|
+
input: Omit<OpenAiRequest, "model">;
|
|
1290
|
+
};
|
|
1254
1291
|
"openai.gpt-5.2": {
|
|
1255
1292
|
input: Omit<OpenAiRequest, "model">;
|
|
1256
1293
|
};
|
|
@@ -1284,6 +1321,9 @@ type AllUseLlmOptions = AllLlm & {
|
|
|
1284
1321
|
"openai.o4-mini": {
|
|
1285
1322
|
input: Omit<OpenAiRequest, "model">;
|
|
1286
1323
|
};
|
|
1324
|
+
"anthropic.claude-fable-5": {
|
|
1325
|
+
input: Omit<AnthropicRequest, "model">;
|
|
1326
|
+
};
|
|
1287
1327
|
"anthropic.claude-opus-4-8": {
|
|
1288
1328
|
input: Omit<AnthropicRequest, "model">;
|
|
1289
1329
|
};
|
|
@@ -1305,9 +1345,6 @@ type AllUseLlmOptions = AllLlm & {
|
|
|
1305
1345
|
"anthropic.claude-opus-4-6": {
|
|
1306
1346
|
input: Omit<AnthropicRequest, "model">;
|
|
1307
1347
|
};
|
|
1308
|
-
"anthropic.claude-opus-4-1": {
|
|
1309
|
-
input: Omit<AnthropicRequest, "model">;
|
|
1310
|
-
};
|
|
1311
1348
|
"anthropic.claude-sonnet-4-0": {
|
|
1312
1349
|
input: Omit<AnthropicRequest, "model">;
|
|
1313
1350
|
};
|
|
@@ -1771,6 +1808,9 @@ type LlmExeErrorJson<C extends ErrorCodes = ErrorCodes> = {
|
|
|
1771
1808
|
cause?: SerializableCause;
|
|
1772
1809
|
truncated?: boolean;
|
|
1773
1810
|
};
|
|
1811
|
+
type SerializeOptions = {
|
|
1812
|
+
includeStack?: boolean;
|
|
1813
|
+
};
|
|
1774
1814
|
|
|
1775
1815
|
declare function enforceResultAttributes<O>(input: any): {
|
|
1776
1816
|
result: O;
|
|
@@ -1910,6 +1950,8 @@ declare function importHelpers(_helpers: {
|
|
|
1910
1950
|
|
|
1911
1951
|
declare function filterObjectOnSchema(schema: any, doc: any, detach?: any, property?: string): any;
|
|
1912
1952
|
|
|
1953
|
+
declare function escapeTemplateString(input: string): string;
|
|
1954
|
+
|
|
1913
1955
|
declare const asyncCallWithTimeout: <T = any>(asyncPromise: Promise<T>, timeLimit?: number) => Promise<T>;
|
|
1914
1956
|
|
|
1915
1957
|
declare function guessProviderFromModel(payload: {
|
|
@@ -1929,6 +1971,7 @@ declare const index_LlmExeError: typeof LlmExeError;
|
|
|
1929
1971
|
declare const index_assert: typeof assert;
|
|
1930
1972
|
declare const index_asyncCallWithTimeout: typeof asyncCallWithTimeout;
|
|
1931
1973
|
declare const index_defineSchema: typeof defineSchema;
|
|
1974
|
+
declare const index_escapeTemplateString: typeof escapeTemplateString;
|
|
1932
1975
|
declare const index_filterObjectOnSchema: typeof filterObjectOnSchema;
|
|
1933
1976
|
declare const index_guessProviderFromModel: typeof guessProviderFromModel;
|
|
1934
1977
|
declare const index_importHelpers: typeof importHelpers;
|
|
@@ -1942,7 +1985,7 @@ declare const index_registerPartials: typeof registerPartials;
|
|
|
1942
1985
|
declare const index_replaceTemplateString: typeof replaceTemplateString;
|
|
1943
1986
|
declare const index_replaceTemplateStringAsync: typeof replaceTemplateStringAsync;
|
|
1944
1987
|
declare namespace index {
|
|
1945
|
-
export { index_LLM_EXE_ERROR_SYMBOL as LLM_EXE_ERROR_SYMBOL, index_LlmExeError as LlmExeError, index_assert as assert, index_asyncCallWithTimeout as asyncCallWithTimeout, index_defineSchema as defineSchema, index_filterObjectOnSchema as filterObjectOnSchema, index_guessProviderFromModel as guessProviderFromModel, index_importHelpers as importHelpers, index_importPartials as importPartials, index_isLlmExeError as isLlmExeError, index_isObjectStringified as isObjectStringified, index_maybeParseJSON as maybeParseJSON, index_maybeStringifyJSON as maybeStringifyJSON, index_registerHelpers as registerHelpers, index_registerPartials as registerPartials, index_replaceTemplateString as replaceTemplateString, index_replaceTemplateStringAsync as replaceTemplateStringAsync };
|
|
1988
|
+
export { index_LLM_EXE_ERROR_SYMBOL as LLM_EXE_ERROR_SYMBOL, index_LlmExeError as LlmExeError, index_assert as assert, index_asyncCallWithTimeout as asyncCallWithTimeout, index_defineSchema as defineSchema, index_escapeTemplateString as escapeTemplateString, index_filterObjectOnSchema as filterObjectOnSchema, index_guessProviderFromModel as guessProviderFromModel, index_importHelpers as importHelpers, index_importPartials as importPartials, index_isLlmExeError as isLlmExeError, index_isObjectStringified as isObjectStringified, index_maybeParseJSON as maybeParseJSON, index_maybeStringifyJSON as maybeStringifyJSON, index_registerHelpers as registerHelpers, index_registerPartials as registerPartials, index_replaceTemplateString as replaceTemplateString, index_replaceTemplateStringAsync as replaceTemplateStringAsync };
|
|
1946
1989
|
}
|
|
1947
1990
|
|
|
1948
1991
|
declare function isOutputResult(obj: any): obj is OutputResult;
|
|
@@ -2019,9 +2062,9 @@ declare const configs: {
|
|
|
2019
2062
|
"anthropic.claude-3-7-sonnet": Config<any>;
|
|
2020
2063
|
"anthropic.claude-opus-4": Config<any>;
|
|
2021
2064
|
"anthropic.claude-sonnet-4": Config<any>;
|
|
2022
|
-
"anthropic.claude-opus-4-1": Config<any>;
|
|
2023
2065
|
"anthropic.claude-opus-4-6": Config<any>;
|
|
2024
2066
|
"anthropic.chat.v1": Config<keyof AllLlm>;
|
|
2067
|
+
"anthropic.claude-fable-5": Config<keyof AllLlm>;
|
|
2025
2068
|
"anthropic.claude-opus-4-8": Config<keyof AllLlm>;
|
|
2026
2069
|
"anthropic.claude-opus-4-7": Config<keyof AllLlm>;
|
|
2027
2070
|
"anthropic.claude-sonnet-4-6": Config<keyof AllLlm>;
|
|
@@ -2031,6 +2074,9 @@ declare const configs: {
|
|
|
2031
2074
|
"openai.o4-mini": Config<any>;
|
|
2032
2075
|
"openai.chat.v1": Config<keyof AllLlm>;
|
|
2033
2076
|
"openai.chat-mock.v1": Config<keyof AllLlm>;
|
|
2077
|
+
"openai.gpt-5.5": Config<keyof AllLlm>;
|
|
2078
|
+
"openai.gpt-5.4": Config<keyof AllLlm>;
|
|
2079
|
+
"openai.gpt-5.4-mini": Config<keyof AllLlm>;
|
|
2034
2080
|
"openai.gpt-5.2": Config<keyof AllLlm>;
|
|
2035
2081
|
"openai.gpt-5-mini": Config<keyof AllLlm>;
|
|
2036
2082
|
"openai.gpt-5-nano": Config<keyof AllLlm>;
|
|
@@ -2092,4 +2138,8 @@ declare function createEmbedding<T extends EmbeddingProviderKey>(provider: T, op
|
|
|
2092
2138
|
};
|
|
2093
2139
|
};
|
|
2094
2140
|
|
|
2095
|
-
|
|
2141
|
+
declare function serializeLlmExeError(error: unknown, options?: SerializeOptions): JsonSafe;
|
|
2142
|
+
|
|
2143
|
+
declare function formatLlmExeErrorForLog(error: unknown): string;
|
|
2144
|
+
|
|
2145
|
+
export { BaseExecutor, type BaseLlm, BaseParser, BasePrompt, BaseStateItem, type BooleanParserMatch, type BooleanParserOptions, ChatPrompt, CustomParser, DefaultState, DefaultStateItem, type EmbeddingProviderKey, type ErrorCategory, type ErrorCodes, type ErrorContextByCode, type ExecutionContext, type ExecutorContext, type ExecutorExecutionMetadata, type HookErrorRecord, type IChatMessages, type JsonParserMatch, type JsonParserOptions, LLM_EXE_ERROR_SYMBOL, LlmExeError, LlmExecutorOpenAiFunctions, LlmExecutorWithFunctions, LlmNativeFunctionParser, type LlmProvider, type LlmProviderKey, type NormalizedProviderError, type NumberParserMatch, type NumberParserOptions, type OpenAIModelName, OpenAiFunctionParser, type ProviderErrorContext, type StringExtractMatch, type StringExtractParserOptions, TextPrompt, type UseLlmKey, createCallableExecutor, createChatPrompt, createCoreExecutor, createCustomParser, createDialogue, createEmbedding, createLlmExecutor, createLlmFunctionExecutor, createOpenAiCompatibleConfiguration, createParser, createPrompt, createState, createStateItem, defineSchema, formatLlmExeErrorForLog, guards, isLlmExeError, registerHelpers, registerPartials, serializeLlmExeError, useExecutors, useLlm, useLlmConfiguration, index as utils };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,11 +14,18 @@ interface Serializable {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
type IChatMessageRole = "system" | "model" | "assistant" | "user" | "function" | "function_call";
|
|
17
|
+
/**
|
|
18
|
+
* Loose content-block shape accepted everywhere content blocks are taken.
|
|
19
|
+
* Prefer `IChatMessageContent`; this stays loose (`type: string`) for
|
|
20
|
+
* backwards compatibility with previously-accepted shapes like
|
|
21
|
+
* `{ type: "image", image_url: {...} }`, which providers normalize.
|
|
22
|
+
*/
|
|
17
23
|
interface IChatMessageContentDetailed {
|
|
18
24
|
type: string;
|
|
19
25
|
text?: string;
|
|
20
26
|
image_url?: {
|
|
21
27
|
url: string;
|
|
28
|
+
detail?: "low" | "high" | "auto";
|
|
22
29
|
};
|
|
23
30
|
}
|
|
24
31
|
interface IChatMessageBase {
|
|
@@ -670,7 +677,7 @@ declare function createChatPrompt<I extends Record<string, any>>(initialSystemPr
|
|
|
670
677
|
* @template O - Output type.
|
|
671
678
|
* @template H - Hooks type.
|
|
672
679
|
*/
|
|
673
|
-
declare abstract class BaseExecutor<I extends PlainObject, O = any, H extends BaseExecutorHooks = BaseExecutorHooks> {
|
|
680
|
+
declare abstract class BaseExecutor<I extends PlainObject, O = any, H extends BaseExecutorHooks = BaseExecutorHooks, R = any, HI = any> {
|
|
674
681
|
/**
|
|
675
682
|
* @property id - internal id of the executor
|
|
676
683
|
*/
|
|
@@ -701,7 +708,7 @@ declare abstract class BaseExecutor<I extends PlainObject, O = any, H extends Ba
|
|
|
701
708
|
* @property maxHooksPerEvent - Maximum number of hooks allowed per event
|
|
702
709
|
*/
|
|
703
710
|
readonly maxHooksPerEvent: number;
|
|
704
|
-
constructor(name: string, type: string, options?: CoreExecutorExecuteOptions<H>);
|
|
711
|
+
constructor(name: string, type: string, options?: CoreExecutorExecuteOptions<I, O, R, HI, H>);
|
|
705
712
|
abstract handler(input: I, _options?: any, _context?: ExecutionContext<I, O>): Promise<any>;
|
|
706
713
|
/**
|
|
707
714
|
* Build a per-call execution context snapshot. Captures the current
|
|
@@ -745,7 +752,7 @@ declare abstract class BaseExecutor<I extends PlainObject, O = any, H extends Ba
|
|
|
745
752
|
metadata(): Record<string, any>;
|
|
746
753
|
getMetadata(metadata?: Record<string, any>): ExecutorMetadata;
|
|
747
754
|
runHook(hook: keyof H, _metadata: ExecutorExecutionMetadata): HookErrorRecord[];
|
|
748
|
-
setHooks(hooks?: CoreExecutorHookInput<H>): this;
|
|
755
|
+
setHooks(hooks?: CoreExecutorHookInput<I, O, R, HI, H>): this;
|
|
749
756
|
removeHook(eventName: keyof H, fn: ListenerFunction): this;
|
|
750
757
|
on(eventName: keyof H, fn: ListenerFunction): this;
|
|
751
758
|
off(eventName: keyof H, fn: ListenerFunction): this;
|
|
@@ -770,9 +777,9 @@ declare abstract class BaseExecutor<I extends PlainObject, O = any, H extends Ba
|
|
|
770
777
|
* Core Function Executor
|
|
771
778
|
*/
|
|
772
779
|
declare class CoreExecutor<I extends PlainObject, O> extends BaseExecutor<I, O> {
|
|
773
|
-
_handler: (input: I) => Promise<any> | any;
|
|
774
|
-
constructor(fn: CoreExecutorInput<I, O>, options?: CoreExecutorExecuteOptions);
|
|
775
|
-
handler(_input: I): Promise<O>;
|
|
780
|
+
_handler: (input: I, context?: ExecutionContext<I, O>) => Promise<any> | any;
|
|
781
|
+
constructor(fn: CoreExecutorInput<I, O>, options?: CoreExecutorExecuteOptions<I, O>);
|
|
782
|
+
handler(_input: I, _options?: any, _context?: ExecutionContext<I, O>): Promise<O>;
|
|
776
783
|
}
|
|
777
784
|
|
|
778
785
|
declare abstract class BaseStateItem<T> implements Serializable {
|
|
@@ -903,12 +910,12 @@ declare function createStateItem<T>(name: string, defaultValue: T): DefaultState
|
|
|
903
910
|
/**
|
|
904
911
|
* Core Executor With LLM
|
|
905
912
|
*/
|
|
906
|
-
declare class LlmExecutor<Llm extends BaseLlm<any>, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser<any, any>, State extends BaseState> extends BaseExecutor<PromptInput<Prompt>, ParserOutput<Parser>, LlmExecutorHooks
|
|
913
|
+
declare class LlmExecutor<Llm extends BaseLlm<any>, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser<any, any>, State extends BaseState> extends BaseExecutor<PromptInput<Prompt>, ParserOutput<Parser>, LlmExecutorHooks, BaseLlCall, ReturnType<Prompt["format"]>> {
|
|
907
914
|
llm: Llm;
|
|
908
915
|
prompt: Prompt | undefined;
|
|
909
916
|
promptFn: any;
|
|
910
917
|
parser: StringParser | Parser;
|
|
911
|
-
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<LlmExecutorHooks>);
|
|
918
|
+
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<PromptInput<Prompt>, ParserOutput<Parser>, BaseLlCall, ReturnType<Prompt["format"]>, LlmExecutorHooks>);
|
|
912
919
|
/**
|
|
913
920
|
* Runs the executor against the configured LLM and prompt.
|
|
914
921
|
*
|
|
@@ -931,14 +938,14 @@ declare class LlmExecutor<Llm extends BaseLlm<any>, Prompt extends BasePrompt<Re
|
|
|
931
938
|
* Core Executor With LLM
|
|
932
939
|
*/
|
|
933
940
|
declare class LlmExecutorWithFunctions<Llm extends BaseLlm, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser, State extends BaseState = BaseState> extends LlmExecutor<Llm, Prompt, LlmFunctionParser<Parser>, State> {
|
|
934
|
-
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<LlmExecutorHooks>);
|
|
941
|
+
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<PromptInput<Prompt>, ParserOutput<LlmFunctionParser<Parser>>, BaseLlCall, ReturnType<Prompt["format"]>, LlmExecutorHooks>);
|
|
935
942
|
execute<T extends GenericFunctionCall>(_input: PromptInput<Prompt>, _options: LlmExecutorWithFunctionsOptions<T>): Promise<OutputResultContent[] | ParserOutput<Parser>>;
|
|
936
943
|
}
|
|
937
944
|
/**
|
|
938
945
|
* @deprecated Use `LlmExecutorWithFunctions` instead.
|
|
939
946
|
*/
|
|
940
947
|
declare class LlmExecutorOpenAiFunctions<Llm extends BaseLlm, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser, State extends BaseState = BaseState> extends LlmExecutor<Llm, Prompt, LlmNativeFunctionParser<Parser>, State> {
|
|
941
|
-
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<LlmExecutorHooks>);
|
|
948
|
+
constructor(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<PromptInput<Prompt>, ParserOutput<LlmNativeFunctionParser<Parser>>, BaseLlCall, ReturnType<Prompt["format"]>, LlmExecutorHooks>);
|
|
942
949
|
execute<T extends GenericFunctionCall>(_input: PromptInput<Prompt>, _options: LlmExecutorWithFunctionsOptions<T>): Promise<ParserOutput<Parser> | {
|
|
943
950
|
name: string;
|
|
944
951
|
arguments: any;
|
|
@@ -952,7 +959,7 @@ declare class LlmExecutorOpenAiFunctions<Llm extends BaseLlm, Prompt extends Bas
|
|
|
952
959
|
* @param handler - The handler function.
|
|
953
960
|
* @returns - A new CoreExecutor instance.
|
|
954
961
|
*/
|
|
955
|
-
declare function createCoreExecutor<I extends PlainObject, O>(handler: (input: I) => Promise<O> | O, options?: CoreExecutorExecuteOptions): CoreExecutor<I, O>;
|
|
962
|
+
declare function createCoreExecutor<I extends PlainObject, O>(handler: (input: I, context?: ExecutionContext<I, O>) => Promise<O> | O, options?: CoreExecutorExecuteOptions<I, O>): CoreExecutor<I, O>;
|
|
956
963
|
/**
|
|
957
964
|
* Function to create a core executor with Llm.
|
|
958
965
|
* @template Llm - Llm type.
|
|
@@ -962,8 +969,8 @@ declare function createCoreExecutor<I extends PlainObject, O>(handler: (input: I
|
|
|
962
969
|
* @param options - Options for BaseExecutorV3.
|
|
963
970
|
* @returns - A new LlmExecutor instance.
|
|
964
971
|
*/
|
|
965
|
-
declare function createLlmExecutor<Llm extends BaseLlm<any>, Prompt extends BasePrompt<any>, Parser extends BaseParser, State extends BaseState>(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<LlmExecutorHooks>): LlmExecutor<Llm, Prompt, Parser, State>;
|
|
966
|
-
declare function createLlmFunctionExecutor<Llm extends BaseLlm, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser, State extends BaseState>(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<LlmExecutorHooks>): LlmExecutorWithFunctions<Llm, Prompt, Parser, State>;
|
|
972
|
+
declare function createLlmExecutor<Llm extends BaseLlm<any>, Prompt extends BasePrompt<any>, Parser extends BaseParser, State extends BaseState>(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<PromptInput<Prompt>, ParserOutput<Parser>, BaseLlCall, ReturnType<Prompt["format"]>, LlmExecutorHooks>): LlmExecutor<Llm, Prompt, Parser, State>;
|
|
973
|
+
declare function createLlmFunctionExecutor<Llm extends BaseLlm, Prompt extends BasePrompt<Record<string, any>>, Parser extends BaseParser, State extends BaseState>(llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>, options?: CoreExecutorExecuteOptions<PromptInput<Prompt>, ParserOutput<LlmFunctionParser<Parser>>, BaseLlCall, ReturnType<Prompt["format"]>, LlmExecutorHooks>): LlmExecutorWithFunctions<Llm, Prompt, Parser, State>;
|
|
967
974
|
|
|
968
975
|
declare const hookOnComplete = "onComplete";
|
|
969
976
|
declare const hookOnError = "onError";
|
|
@@ -982,7 +989,7 @@ interface ExecutorWithLlmOptions<Llm, Prompt, Parser, State> {
|
|
|
982
989
|
}
|
|
983
990
|
interface CoreExecutorInput<I, O> {
|
|
984
991
|
name?: string;
|
|
985
|
-
handler: (input: I) => Promise<O> | O;
|
|
992
|
+
handler: (input: I, context?: ExecutionContext<I, O>) => Promise<O> | O;
|
|
986
993
|
getHandlerInput?(input: I): Promise<any>;
|
|
987
994
|
getHandlerOutput?(out: any): O;
|
|
988
995
|
}
|
|
@@ -1006,12 +1013,12 @@ interface HookErrorRecord {
|
|
|
1006
1013
|
errorContext?: unknown;
|
|
1007
1014
|
errorCause?: unknown;
|
|
1008
1015
|
}
|
|
1009
|
-
interface ExecutorExecutionMetadata<I = any, O = any> {
|
|
1016
|
+
interface ExecutorExecutionMetadata<I = any, O = any, R = any, HI = any> {
|
|
1010
1017
|
start: null | number;
|
|
1011
1018
|
end: null | number;
|
|
1012
1019
|
input: I;
|
|
1013
|
-
handlerInput?:
|
|
1014
|
-
handlerOutput?:
|
|
1020
|
+
handlerInput?: HI;
|
|
1021
|
+
handlerOutput?: R;
|
|
1015
1022
|
output?: O;
|
|
1016
1023
|
errorMessage?: string;
|
|
1017
1024
|
error?: Error;
|
|
@@ -1045,11 +1052,20 @@ interface BaseExecutorHooks {
|
|
|
1045
1052
|
}
|
|
1046
1053
|
interface LlmExecutorHooks extends BaseExecutorHooks {
|
|
1047
1054
|
}
|
|
1048
|
-
|
|
1049
|
-
|
|
1055
|
+
/**
|
|
1056
|
+
* A single executor hook callback. Receives the per-run execution metadata
|
|
1057
|
+
* (input/output/error fields typed via I/O) followed by the executor's own
|
|
1058
|
+
* identity metadata. This is the shape fired for onSuccess / onError /
|
|
1059
|
+
* onComplete — the metadata fields that are populated differ per event
|
|
1060
|
+
* (`output` on success, `error` on failure), but all are optional on
|
|
1061
|
+
* {@link ExecutorExecutionMetadata}, so one signature covers every hook.
|
|
1062
|
+
*/
|
|
1063
|
+
type ExecutorHookFunction<I = any, O = any, R = any, HI = any> = (metadata: ExecutorExecutionMetadata<I, O, R, HI>, executor: ExecutorMetadata) => void;
|
|
1064
|
+
type CoreExecutorHookInput<I = any, O = any, R = any, HI = any, H = BaseExecutorHooks> = {
|
|
1065
|
+
[key in keyof H]?: ExecutorHookFunction<I, O, R, HI> | ExecutorHookFunction<I, O, R, HI>[];
|
|
1050
1066
|
};
|
|
1051
|
-
interface CoreExecutorExecuteOptions<T = BaseExecutorHooks> {
|
|
1052
|
-
hooks?: CoreExecutorHookInput<T>;
|
|
1067
|
+
interface CoreExecutorExecuteOptions<I = any, O = any, R = any, HI = any, T = BaseExecutorHooks> {
|
|
1068
|
+
hooks?: CoreExecutorHookInput<I, O, R, HI, T>;
|
|
1053
1069
|
}
|
|
1054
1070
|
interface CallableExecutorCore {
|
|
1055
1071
|
name: string;
|
|
@@ -1073,6 +1089,18 @@ interface LlmExecutorWithFunctionsOptions<T extends GenericFunctionCall = "auto"
|
|
|
1073
1089
|
|
|
1074
1090
|
interface ParserSchemaOptions<S extends JSONSchema | undefined = undefined> {
|
|
1075
1091
|
schema?: S;
|
|
1092
|
+
/**
|
|
1093
|
+
* Controls schema enforcement when `schema` is provided. Validation —
|
|
1094
|
+
* including `required` fields and type/constraint checks — is **on by
|
|
1095
|
+
* default** whenever a schema is set; invalid or incomplete input throws a
|
|
1096
|
+
* `parser.schema_validation_failed` error.
|
|
1097
|
+
*
|
|
1098
|
+
* Set `validateSchema: false` to opt out into the legacy filter/default-only
|
|
1099
|
+
* behavior: unknown keys are stripped and defaults applied, but `required`
|
|
1100
|
+
* fields and constraints are NOT checked. Has no effect when no schema is set.
|
|
1101
|
+
*
|
|
1102
|
+
* @default true (when `schema` is provided)
|
|
1103
|
+
*/
|
|
1076
1104
|
validateSchema?: boolean;
|
|
1077
1105
|
}
|
|
1078
1106
|
type JsonParserMatch = "exact" | "extract";
|
|
@@ -1251,6 +1279,15 @@ type AllLlm = {
|
|
|
1251
1279
|
};
|
|
1252
1280
|
};
|
|
1253
1281
|
type AllUseLlmOptions = AllLlm & {
|
|
1282
|
+
"openai.gpt-5.5": {
|
|
1283
|
+
input: Omit<OpenAiRequest, "model">;
|
|
1284
|
+
};
|
|
1285
|
+
"openai.gpt-5.4": {
|
|
1286
|
+
input: Omit<OpenAiRequest, "model">;
|
|
1287
|
+
};
|
|
1288
|
+
"openai.gpt-5.4-mini": {
|
|
1289
|
+
input: Omit<OpenAiRequest, "model">;
|
|
1290
|
+
};
|
|
1254
1291
|
"openai.gpt-5.2": {
|
|
1255
1292
|
input: Omit<OpenAiRequest, "model">;
|
|
1256
1293
|
};
|
|
@@ -1284,6 +1321,9 @@ type AllUseLlmOptions = AllLlm & {
|
|
|
1284
1321
|
"openai.o4-mini": {
|
|
1285
1322
|
input: Omit<OpenAiRequest, "model">;
|
|
1286
1323
|
};
|
|
1324
|
+
"anthropic.claude-fable-5": {
|
|
1325
|
+
input: Omit<AnthropicRequest, "model">;
|
|
1326
|
+
};
|
|
1287
1327
|
"anthropic.claude-opus-4-8": {
|
|
1288
1328
|
input: Omit<AnthropicRequest, "model">;
|
|
1289
1329
|
};
|
|
@@ -1305,9 +1345,6 @@ type AllUseLlmOptions = AllLlm & {
|
|
|
1305
1345
|
"anthropic.claude-opus-4-6": {
|
|
1306
1346
|
input: Omit<AnthropicRequest, "model">;
|
|
1307
1347
|
};
|
|
1308
|
-
"anthropic.claude-opus-4-1": {
|
|
1309
|
-
input: Omit<AnthropicRequest, "model">;
|
|
1310
|
-
};
|
|
1311
1348
|
"anthropic.claude-sonnet-4-0": {
|
|
1312
1349
|
input: Omit<AnthropicRequest, "model">;
|
|
1313
1350
|
};
|
|
@@ -1771,6 +1808,9 @@ type LlmExeErrorJson<C extends ErrorCodes = ErrorCodes> = {
|
|
|
1771
1808
|
cause?: SerializableCause;
|
|
1772
1809
|
truncated?: boolean;
|
|
1773
1810
|
};
|
|
1811
|
+
type SerializeOptions = {
|
|
1812
|
+
includeStack?: boolean;
|
|
1813
|
+
};
|
|
1774
1814
|
|
|
1775
1815
|
declare function enforceResultAttributes<O>(input: any): {
|
|
1776
1816
|
result: O;
|
|
@@ -1910,6 +1950,8 @@ declare function importHelpers(_helpers: {
|
|
|
1910
1950
|
|
|
1911
1951
|
declare function filterObjectOnSchema(schema: any, doc: any, detach?: any, property?: string): any;
|
|
1912
1952
|
|
|
1953
|
+
declare function escapeTemplateString(input: string): string;
|
|
1954
|
+
|
|
1913
1955
|
declare const asyncCallWithTimeout: <T = any>(asyncPromise: Promise<T>, timeLimit?: number) => Promise<T>;
|
|
1914
1956
|
|
|
1915
1957
|
declare function guessProviderFromModel(payload: {
|
|
@@ -1929,6 +1971,7 @@ declare const index_LlmExeError: typeof LlmExeError;
|
|
|
1929
1971
|
declare const index_assert: typeof assert;
|
|
1930
1972
|
declare const index_asyncCallWithTimeout: typeof asyncCallWithTimeout;
|
|
1931
1973
|
declare const index_defineSchema: typeof defineSchema;
|
|
1974
|
+
declare const index_escapeTemplateString: typeof escapeTemplateString;
|
|
1932
1975
|
declare const index_filterObjectOnSchema: typeof filterObjectOnSchema;
|
|
1933
1976
|
declare const index_guessProviderFromModel: typeof guessProviderFromModel;
|
|
1934
1977
|
declare const index_importHelpers: typeof importHelpers;
|
|
@@ -1942,7 +1985,7 @@ declare const index_registerPartials: typeof registerPartials;
|
|
|
1942
1985
|
declare const index_replaceTemplateString: typeof replaceTemplateString;
|
|
1943
1986
|
declare const index_replaceTemplateStringAsync: typeof replaceTemplateStringAsync;
|
|
1944
1987
|
declare namespace index {
|
|
1945
|
-
export { index_LLM_EXE_ERROR_SYMBOL as LLM_EXE_ERROR_SYMBOL, index_LlmExeError as LlmExeError, index_assert as assert, index_asyncCallWithTimeout as asyncCallWithTimeout, index_defineSchema as defineSchema, index_filterObjectOnSchema as filterObjectOnSchema, index_guessProviderFromModel as guessProviderFromModel, index_importHelpers as importHelpers, index_importPartials as importPartials, index_isLlmExeError as isLlmExeError, index_isObjectStringified as isObjectStringified, index_maybeParseJSON as maybeParseJSON, index_maybeStringifyJSON as maybeStringifyJSON, index_registerHelpers as registerHelpers, index_registerPartials as registerPartials, index_replaceTemplateString as replaceTemplateString, index_replaceTemplateStringAsync as replaceTemplateStringAsync };
|
|
1988
|
+
export { index_LLM_EXE_ERROR_SYMBOL as LLM_EXE_ERROR_SYMBOL, index_LlmExeError as LlmExeError, index_assert as assert, index_asyncCallWithTimeout as asyncCallWithTimeout, index_defineSchema as defineSchema, index_escapeTemplateString as escapeTemplateString, index_filterObjectOnSchema as filterObjectOnSchema, index_guessProviderFromModel as guessProviderFromModel, index_importHelpers as importHelpers, index_importPartials as importPartials, index_isLlmExeError as isLlmExeError, index_isObjectStringified as isObjectStringified, index_maybeParseJSON as maybeParseJSON, index_maybeStringifyJSON as maybeStringifyJSON, index_registerHelpers as registerHelpers, index_registerPartials as registerPartials, index_replaceTemplateString as replaceTemplateString, index_replaceTemplateStringAsync as replaceTemplateStringAsync };
|
|
1946
1989
|
}
|
|
1947
1990
|
|
|
1948
1991
|
declare function isOutputResult(obj: any): obj is OutputResult;
|
|
@@ -2019,9 +2062,9 @@ declare const configs: {
|
|
|
2019
2062
|
"anthropic.claude-3-7-sonnet": Config<any>;
|
|
2020
2063
|
"anthropic.claude-opus-4": Config<any>;
|
|
2021
2064
|
"anthropic.claude-sonnet-4": Config<any>;
|
|
2022
|
-
"anthropic.claude-opus-4-1": Config<any>;
|
|
2023
2065
|
"anthropic.claude-opus-4-6": Config<any>;
|
|
2024
2066
|
"anthropic.chat.v1": Config<keyof AllLlm>;
|
|
2067
|
+
"anthropic.claude-fable-5": Config<keyof AllLlm>;
|
|
2025
2068
|
"anthropic.claude-opus-4-8": Config<keyof AllLlm>;
|
|
2026
2069
|
"anthropic.claude-opus-4-7": Config<keyof AllLlm>;
|
|
2027
2070
|
"anthropic.claude-sonnet-4-6": Config<keyof AllLlm>;
|
|
@@ -2031,6 +2074,9 @@ declare const configs: {
|
|
|
2031
2074
|
"openai.o4-mini": Config<any>;
|
|
2032
2075
|
"openai.chat.v1": Config<keyof AllLlm>;
|
|
2033
2076
|
"openai.chat-mock.v1": Config<keyof AllLlm>;
|
|
2077
|
+
"openai.gpt-5.5": Config<keyof AllLlm>;
|
|
2078
|
+
"openai.gpt-5.4": Config<keyof AllLlm>;
|
|
2079
|
+
"openai.gpt-5.4-mini": Config<keyof AllLlm>;
|
|
2034
2080
|
"openai.gpt-5.2": Config<keyof AllLlm>;
|
|
2035
2081
|
"openai.gpt-5-mini": Config<keyof AllLlm>;
|
|
2036
2082
|
"openai.gpt-5-nano": Config<keyof AllLlm>;
|
|
@@ -2092,4 +2138,8 @@ declare function createEmbedding<T extends EmbeddingProviderKey>(provider: T, op
|
|
|
2092
2138
|
};
|
|
2093
2139
|
};
|
|
2094
2140
|
|
|
2095
|
-
|
|
2141
|
+
declare function serializeLlmExeError(error: unknown, options?: SerializeOptions): JsonSafe;
|
|
2142
|
+
|
|
2143
|
+
declare function formatLlmExeErrorForLog(error: unknown): string;
|
|
2144
|
+
|
|
2145
|
+
export { BaseExecutor, type BaseLlm, BaseParser, BasePrompt, BaseStateItem, type BooleanParserMatch, type BooleanParserOptions, ChatPrompt, CustomParser, DefaultState, DefaultStateItem, type EmbeddingProviderKey, type ErrorCategory, type ErrorCodes, type ErrorContextByCode, type ExecutionContext, type ExecutorContext, type ExecutorExecutionMetadata, type HookErrorRecord, type IChatMessages, type JsonParserMatch, type JsonParserOptions, LLM_EXE_ERROR_SYMBOL, LlmExeError, LlmExecutorOpenAiFunctions, LlmExecutorWithFunctions, LlmNativeFunctionParser, type LlmProvider, type LlmProviderKey, type NormalizedProviderError, type NumberParserMatch, type NumberParserOptions, type OpenAIModelName, OpenAiFunctionParser, type ProviderErrorContext, type StringExtractMatch, type StringExtractParserOptions, TextPrompt, type UseLlmKey, createCallableExecutor, createChatPrompt, createCoreExecutor, createCustomParser, createDialogue, createEmbedding, createLlmExecutor, createLlmFunctionExecutor, createOpenAiCompatibleConfiguration, createParser, createPrompt, createState, createStateItem, defineSchema, formatLlmExeErrorForLog, guards, isLlmExeError, registerHelpers, registerPartials, serializeLlmExeError, useExecutors, useLlm, useLlmConfiguration, index as utils };
|