@promptbook/openai 0.28.0-8 → 0.29.0-0
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/esm/typings/execution/CommonExecutionToolsOptions.d.ts +3 -0
- package/esm/typings/execution/ScriptExecutionTools.d.ts +3 -0
- package/esm/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -0
- package/esm/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +4 -0
- package/esm/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -0
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +3 -2
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +2 -2
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +22 -0
- package/esm/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +0 -3
- package/package.json +2 -2
- package/umd/typings/execution/CommonExecutionToolsOptions.d.ts +3 -0
- package/umd/typings/execution/ScriptExecutionTools.d.ts +3 -0
- package/umd/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -0
- package/umd/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +4 -0
- package/umd/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -0
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +3 -2
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +2 -2
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +22 -0
- package/umd/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +0 -3
package/esm/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
2
1
|
import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../../ScriptExecutionTools';
|
|
2
|
+
import { JavascriptExecutionToolsOptions } from './JavascriptExecutionToolsOptions';
|
|
3
3
|
/**
|
|
4
4
|
* ScriptExecutionTools for JavaScript implemented via eval
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@ import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class JavascriptEvalExecutionTools implements ScriptExecutionTools {
|
|
10
10
|
private readonly options;
|
|
11
|
-
constructor(options:
|
|
11
|
+
constructor(options: JavascriptExecutionToolsOptions);
|
|
12
12
|
/**
|
|
13
13
|
* Executes a JavaScript
|
|
14
14
|
*/
|
|
@@ -16,4 +16,5 @@ export declare class JavascriptEvalExecutionTools implements ScriptExecutionTool
|
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
|
|
19
|
+
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
19
20
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
2
1
|
import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../../ScriptExecutionTools';
|
|
2
|
+
import { JavascriptExecutionToolsOptions } from './JavascriptExecutionToolsOptions';
|
|
3
3
|
/**
|
|
4
4
|
* ScriptExecutionTools for JavaScript implemented via vm2
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@ import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class JavascriptExecutionTools implements ScriptExecutionTools {
|
|
9
9
|
private readonly options;
|
|
10
|
-
constructor(options:
|
|
10
|
+
constructor(options: JavascriptExecutionToolsOptions);
|
|
11
11
|
/**
|
|
12
12
|
* Executes a JavaScript
|
|
13
13
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { string_javascript_name } from '../../../../types/typeAliases';
|
|
3
|
+
import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
4
|
+
/**
|
|
5
|
+
* Options for javascript execution
|
|
6
|
+
*/
|
|
7
|
+
export type JavascriptExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
8
|
+
/**
|
|
9
|
+
* Functions to be executed in the JavaScript evaluation.
|
|
10
|
+
*
|
|
11
|
+
* This can be used in two ways:
|
|
12
|
+
* 1. To provide custom postprocessing functions. For this case function must receive one string and return a (promise of) string.
|
|
13
|
+
* 2. As environment for the ECECUTE SCRIPT, For this case function can be any function. [0]
|
|
14
|
+
*
|
|
15
|
+
* Note: There are also some built-in functions available:
|
|
16
|
+
* @see ./JavascriptEvalExecutionTools.ts
|
|
17
|
+
*/
|
|
18
|
+
functions?: Record<string_javascript_name, (value: string) => Promisable<string> | Function>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
22
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/openai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0-0",
|
|
4
4
|
"description": "Library to supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"openai": "4.2.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@promptbook/core": "0.
|
|
40
|
+
"@promptbook/core": "0.29.0-0"
|
|
41
41
|
},
|
|
42
42
|
"main": "./umd/index.umd.js",
|
|
43
43
|
"module": "./esm/index.es.js",
|
package/umd/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
2
1
|
import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../../ScriptExecutionTools';
|
|
2
|
+
import { JavascriptExecutionToolsOptions } from './JavascriptExecutionToolsOptions';
|
|
3
3
|
/**
|
|
4
4
|
* ScriptExecutionTools for JavaScript implemented via eval
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@ import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class JavascriptEvalExecutionTools implements ScriptExecutionTools {
|
|
10
10
|
private readonly options;
|
|
11
|
-
constructor(options:
|
|
11
|
+
constructor(options: JavascriptExecutionToolsOptions);
|
|
12
12
|
/**
|
|
13
13
|
* Executes a JavaScript
|
|
14
14
|
*/
|
|
@@ -16,4 +16,5 @@ export declare class JavascriptEvalExecutionTools implements ScriptExecutionTool
|
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
|
|
19
|
+
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
19
20
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
2
1
|
import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../../ScriptExecutionTools';
|
|
2
|
+
import { JavascriptExecutionToolsOptions } from './JavascriptExecutionToolsOptions';
|
|
3
3
|
/**
|
|
4
4
|
* ScriptExecutionTools for JavaScript implemented via vm2
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@ import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class JavascriptExecutionTools implements ScriptExecutionTools {
|
|
9
9
|
private readonly options;
|
|
10
|
-
constructor(options:
|
|
10
|
+
constructor(options: JavascriptExecutionToolsOptions);
|
|
11
11
|
/**
|
|
12
12
|
* Executes a JavaScript
|
|
13
13
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { string_javascript_name } from '../../../../types/typeAliases';
|
|
3
|
+
import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
4
|
+
/**
|
|
5
|
+
* Options for javascript execution
|
|
6
|
+
*/
|
|
7
|
+
export type JavascriptExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
8
|
+
/**
|
|
9
|
+
* Functions to be executed in the JavaScript evaluation.
|
|
10
|
+
*
|
|
11
|
+
* This can be used in two ways:
|
|
12
|
+
* 1. To provide custom postprocessing functions. For this case function must receive one string and return a (promise of) string.
|
|
13
|
+
* 2. As environment for the ECECUTE SCRIPT, For this case function can be any function. [0]
|
|
14
|
+
*
|
|
15
|
+
* Note: There are also some built-in functions available:
|
|
16
|
+
* @see ./JavascriptEvalExecutionTools.ts
|
|
17
|
+
*/
|
|
18
|
+
functions?: Record<string_javascript_name, (value: string) => Promisable<string> | Function>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
22
|
+
*/
|