@promptbook/openai 0.52.0-5 → 0.52.0-7
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/README.md +2 -2
- package/esm/typings/_packages/core.index.d.ts +2 -1
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +4 -17
- package/package.json +2 -2
- package/umd/typings/_packages/core.index.d.ts +2 -1
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +4 -17
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
createPromptbookLibraryFromDirectory,
|
|
43
43
|
assertsExecutionSuccessful,
|
|
44
44
|
} from '@promptbook/core';
|
|
45
|
-
import {
|
|
45
|
+
import { JavascriptExecutionTools } from '@promptbook/execute-javascript';
|
|
46
46
|
import { OpenAiExecutionTools } from '@promptbook/openai';
|
|
47
47
|
|
|
48
48
|
// Create whole Promptbook library
|
|
@@ -56,7 +56,7 @@ const tools = {
|
|
|
56
56
|
llm: new OpenAiExecutionTools({
|
|
57
57
|
apiKey: process.env.OPENAI_API_KEY,
|
|
58
58
|
}),
|
|
59
|
-
script: [new
|
|
59
|
+
script: [new JavascriptExecutionTools()],
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
// Create executor - the function that will execute the Promptbook
|
|
@@ -9,6 +9,7 @@ import { CallbackInterfaceTools } from '../execution/plugins/user-interface-exec
|
|
|
9
9
|
import { CallbackInterfaceToolsOptions } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions';
|
|
10
10
|
import { SimplePromptInterfaceTools } from '../execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools';
|
|
11
11
|
import { checkExpectations, isPassingExpectations } from '../execution/utils/checkExpectations';
|
|
12
|
+
import { createPromptbookLibraryFromDirectory } from '../library/constructors/createPromptbookLibraryFromDirectory';
|
|
12
13
|
import { createPromptbookLibraryFromPromise } from '../library/constructors/createPromptbookLibraryFromPromise';
|
|
13
14
|
import { createPromptbookLibraryFromSources } from '../library/constructors/createPromptbookLibraryFromSources';
|
|
14
15
|
import { createPromptbookSublibrary } from '../library/constructors/createPromptbookSublibrary';
|
|
@@ -19,7 +20,7 @@ import { ExecutionTypes } from '../types/ExecutionTypes';
|
|
|
19
20
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
20
21
|
export { ExecutionTypes, PROMPTBOOK_VERSION };
|
|
21
22
|
export { assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, isPassingExpectations, prettifyPromptbookString, };
|
|
22
|
-
export { createPromptbookLibraryFromPromise, createPromptbookLibraryFromSources, createPromptbookSublibrary, SimplePromptbookLibrary, };
|
|
23
|
+
export { createPromptbookLibraryFromDirectory, createPromptbookLibraryFromPromise, createPromptbookLibraryFromSources, createPromptbookSublibrary, SimplePromptbookLibrary, };
|
|
23
24
|
export { SimplePromptInterfaceTools };
|
|
24
25
|
export { promptbookJsonToString, promptbookStringToJson, validatePromptbookJson };
|
|
25
26
|
export { createPromptbookExecutor, MultipleLlmExecutionTools };
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JavascriptExecutionToolsOptions } from './JavascriptExecutionToolsOptions';
|
|
1
|
+
import { JavascriptEvalExecutionTools } from './JavascriptEvalExecutionTools';
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* Placeholder for better implementation of JavascriptExecutionTools - some propper sandboxing
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare class JavascriptExecutionTools implements ScriptExecutionTools {
|
|
9
|
-
private readonly options;
|
|
10
|
-
constructor(options?: JavascriptExecutionToolsOptions);
|
|
11
|
-
/**
|
|
12
|
-
* Executes a JavaScript
|
|
13
|
-
*/
|
|
14
|
-
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* TODO: !! Pass isVerbose to constructor and use it
|
|
18
|
-
* TODO: !! Probbably make some common util createStatementToEvaluate
|
|
19
|
-
* TODO: !! Implement via vm2
|
|
5
|
+
* @alias JavascriptExecutionTools
|
|
20
6
|
*/
|
|
7
|
+
export declare const JavascriptExecutionTools: typeof JavascriptEvalExecutionTools;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/openai",
|
|
3
|
-
"version": "0.52.0-
|
|
3
|
+
"version": "0.52.0-7",
|
|
4
4
|
"description": "Library to supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
],
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@promptbook/core": "0.52.0-
|
|
51
|
+
"@promptbook/core": "0.52.0-7"
|
|
52
52
|
},
|
|
53
53
|
"main": "./umd/index.umd.js",
|
|
54
54
|
"module": "./esm/index.es.js",
|
|
@@ -9,6 +9,7 @@ import { CallbackInterfaceTools } from '../execution/plugins/user-interface-exec
|
|
|
9
9
|
import { CallbackInterfaceToolsOptions } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions';
|
|
10
10
|
import { SimplePromptInterfaceTools } from '../execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools';
|
|
11
11
|
import { checkExpectations, isPassingExpectations } from '../execution/utils/checkExpectations';
|
|
12
|
+
import { createPromptbookLibraryFromDirectory } from '../library/constructors/createPromptbookLibraryFromDirectory';
|
|
12
13
|
import { createPromptbookLibraryFromPromise } from '../library/constructors/createPromptbookLibraryFromPromise';
|
|
13
14
|
import { createPromptbookLibraryFromSources } from '../library/constructors/createPromptbookLibraryFromSources';
|
|
14
15
|
import { createPromptbookSublibrary } from '../library/constructors/createPromptbookSublibrary';
|
|
@@ -19,7 +20,7 @@ import { ExecutionTypes } from '../types/ExecutionTypes';
|
|
|
19
20
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
20
21
|
export { ExecutionTypes, PROMPTBOOK_VERSION };
|
|
21
22
|
export { assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, isPassingExpectations, prettifyPromptbookString, };
|
|
22
|
-
export { createPromptbookLibraryFromPromise, createPromptbookLibraryFromSources, createPromptbookSublibrary, SimplePromptbookLibrary, };
|
|
23
|
+
export { createPromptbookLibraryFromDirectory, createPromptbookLibraryFromPromise, createPromptbookLibraryFromSources, createPromptbookSublibrary, SimplePromptbookLibrary, };
|
|
23
24
|
export { SimplePromptInterfaceTools };
|
|
24
25
|
export { promptbookJsonToString, promptbookStringToJson, validatePromptbookJson };
|
|
25
26
|
export { createPromptbookExecutor, MultipleLlmExecutionTools };
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JavascriptExecutionToolsOptions } from './JavascriptExecutionToolsOptions';
|
|
1
|
+
import { JavascriptEvalExecutionTools } from './JavascriptEvalExecutionTools';
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* Placeholder for better implementation of JavascriptExecutionTools - some propper sandboxing
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare class JavascriptExecutionTools implements ScriptExecutionTools {
|
|
9
|
-
private readonly options;
|
|
10
|
-
constructor(options?: JavascriptExecutionToolsOptions);
|
|
11
|
-
/**
|
|
12
|
-
* Executes a JavaScript
|
|
13
|
-
*/
|
|
14
|
-
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* TODO: !! Pass isVerbose to constructor and use it
|
|
18
|
-
* TODO: !! Probbably make some common util createStatementToEvaluate
|
|
19
|
-
* TODO: !! Implement via vm2
|
|
5
|
+
* @alias JavascriptExecutionTools
|
|
20
6
|
*/
|
|
7
|
+
export declare const JavascriptExecutionTools: typeof JavascriptEvalExecutionTools;
|