@promptbook/utils 0.45.0 → 0.46.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/README.md +13 -2
- package/esm/index.es.js +1 -1
- package/esm/typings/_packages/core.index.d.ts +0 -3
- package/esm/typings/_packages/langtail.index.d.ts +3 -0
- package/esm/typings/_packages/mock.index.d.ts +6 -0
- package/esm/typings/execution/plugins/natural-execution-tools/langtail/LangtailExecutionToolsOptions.d.ts +11 -0
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +1 -1
- package/umd/typings/_packages/core.index.d.ts +0 -3
- package/umd/typings/_packages/langtail.index.d.ts +3 -0
- package/umd/typings/_packages/mock.index.d.ts +6 -0
- package/umd/typings/execution/plugins/natural-execution-tools/langtail/LangtailExecutionToolsOptions.d.ts +11 -0
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.d.ts +1 -1
package/README.md
CHANGED
|
@@ -427,15 +427,26 @@ _Note: We are using [postprocessing functions](#postprocessing-functions) like `
|
|
|
427
427
|
|
|
428
428
|
## 📦 Packages
|
|
429
429
|
|
|
430
|
-
This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook)
|
|
430
|
+
This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
431
|
+
You can install all of them at once:
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
npm i ptbk
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
Or you can install them separately:
|
|
431
438
|
|
|
432
439
|
<!--[🔠]-->
|
|
433
440
|
|
|
441
|
+
<!-- Add all new -->
|
|
442
|
+
|
|
434
443
|
- **[@promptbook/core](https://www.npmjs.com/package/@promptbook/core)** - Core of the library, it contains the main logic for promptbooks
|
|
435
|
-
-
|
|
444
|
+
- ⭐ **[@promptbook/utils](https://www.npmjs.com/package/@promptbook/utils)** - Utility functions used in the library but also useful for individual use in preprocessing and postprocessing LLM inputs and outputs
|
|
436
445
|
- _(Not finished)_ **[@promptbook/wizzard](https://www.npmjs.com/package/@promptbook/wizzard)** - Wizard for creating+running promptbooks in single line
|
|
437
446
|
- **[@promptbook/execute-javascript](https://www.npmjs.com/package/@promptbook/execute-javascript)** - Execution tools for javascript inside promptbooks
|
|
438
447
|
- **[@promptbook/openai](https://www.npmjs.com/package/@promptbook/openai)** - Execution tools for OpenAI API, wrapper around OpenAI SDK
|
|
448
|
+
- **[@promptbook/langtail](https://www.npmjs.com/package/@promptbook/langtail)** - Execution tools for Langtail API, wrapper around Langtail SDK
|
|
449
|
+
- **[@promptbook/mock](https://www.npmjs.com/package/@promptbook/mock)** - Mocked execution tools for testing the library and saving the tokens
|
|
439
450
|
- **[@promptbook/remote-client](https://www.npmjs.com/package/@promptbook/remote-client)** - Remote client for remote execution of promptbooks
|
|
440
451
|
- **[@promptbook/remote-server](https://www.npmjs.com/package/@promptbook/remote-server)** - Remote server for remote execution of promptbooks
|
|
441
452
|
- **[@promptbook/types](https://www.npmjs.com/package/@promptbook/types)** - Just typescript types used in the library
|
package/esm/index.es.js
CHANGED
|
@@ -403,7 +403,7 @@ function removeContentComments(content) {
|
|
|
403
403
|
/**
|
|
404
404
|
* The version of the Promptbook library
|
|
405
405
|
*/
|
|
406
|
-
var PROMPTBOOK_VERSION = '0.
|
|
406
|
+
var PROMPTBOOK_VERSION = '0.45.0';
|
|
407
407
|
|
|
408
408
|
/**
|
|
409
409
|
* Parses the given script and returns the list of all used variables that are not defined in the script
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { promptbookStringToJson } from '../conversion/promptbookStringToJson';
|
|
2
2
|
import { validatePromptbookJson } from '../conversion/validation/validatePromptbookJson';
|
|
3
3
|
import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
|
|
4
|
-
import { MockedEchoNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools';
|
|
5
|
-
import { MockedFackedNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedFackedNaturalExecutionTools';
|
|
6
4
|
import { CallbackInterfaceTools } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools';
|
|
7
5
|
import { CallbackInterfaceToolsOptions } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions';
|
|
8
6
|
import { SimplePromptInterfaceTools } from '../execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools';
|
|
@@ -16,6 +14,5 @@ export { ExecutionTypes, PROMPTBOOK_VERSION };
|
|
|
16
14
|
export { createPromptbookLibraryFromPromise, createPromptbookLibraryFromSources, createPromptbookSublibrary, SimplePromptbookLibrary, };
|
|
17
15
|
export { SimplePromptInterfaceTools };
|
|
18
16
|
export { promptbookStringToJson, validatePromptbookJson };
|
|
19
|
-
export { MockedEchoNaturalExecutionTools, MockedFackedNaturalExecutionTools };
|
|
20
17
|
export { createPromptbookExecutor };
|
|
21
18
|
export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LangtailExecutionTools } from '../execution/plugins/natural-execution-tools/langtail/LangtailExecutionTools';
|
|
2
|
+
import { LangtailExecutionToolsOptions } from '../execution/plugins/natural-execution-tools/langtail/LangtailExecutionToolsOptions';
|
|
3
|
+
export { LangtailExecutionTools, LangtailExecutionToolsOptions };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MockedEchoNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools';
|
|
2
|
+
import { MockedFackedNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedFackedNaturalExecutionTools';
|
|
3
|
+
export { MockedEchoNaturalExecutionTools, MockedFackedNaturalExecutionTools };
|
|
4
|
+
/**
|
|
5
|
+
* TODO: [🚏] FakeLLM
|
|
6
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OpenAiExecutionToolsOptions } from '../openai/OpenAiExecutionToolsOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Options for LangtailExecutionTools
|
|
4
|
+
*
|
|
5
|
+
* This extends OpenAI's `ClientOptions` with are directly passed to the OpenAI client.
|
|
6
|
+
* Rest is used by the `OpenAiExecutionTools`.
|
|
7
|
+
*/
|
|
8
|
+
export type LangtailExecutionToolsOptions = OpenAiExecutionToolsOptions;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: !!! Use or remove
|
|
11
|
+
*/
|
package/esm/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.d.ts
CHANGED
|
@@ -10,6 +10,6 @@ import { PostprocessingFunction } from '../../script-execution-tools/javascript/
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function $fakeTextToExpectations(expectations: Expectations, postprocessing?: Array<PostprocessingFunction>): Promise<string>;
|
|
12
12
|
/**
|
|
13
|
-
* TODO: Implement better - create FakeLLM from this
|
|
13
|
+
* TODO: [🚏] Implement better - create FakeLLM from this
|
|
14
14
|
* TODO: [💝] Unite object for expecting amount and format - use here also a format
|
|
15
15
|
*/
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
/**
|
|
409
409
|
* The version of the Promptbook library
|
|
410
410
|
*/
|
|
411
|
-
var PROMPTBOOK_VERSION = '0.
|
|
411
|
+
var PROMPTBOOK_VERSION = '0.45.0';
|
|
412
412
|
|
|
413
413
|
/**
|
|
414
414
|
* Parses the given script and returns the list of all used variables that are not defined in the script
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { promptbookStringToJson } from '../conversion/promptbookStringToJson';
|
|
2
2
|
import { validatePromptbookJson } from '../conversion/validation/validatePromptbookJson';
|
|
3
3
|
import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
|
|
4
|
-
import { MockedEchoNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools';
|
|
5
|
-
import { MockedFackedNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedFackedNaturalExecutionTools';
|
|
6
4
|
import { CallbackInterfaceTools } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools';
|
|
7
5
|
import { CallbackInterfaceToolsOptions } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions';
|
|
8
6
|
import { SimplePromptInterfaceTools } from '../execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools';
|
|
@@ -16,6 +14,5 @@ export { ExecutionTypes, PROMPTBOOK_VERSION };
|
|
|
16
14
|
export { createPromptbookLibraryFromPromise, createPromptbookLibraryFromSources, createPromptbookSublibrary, SimplePromptbookLibrary, };
|
|
17
15
|
export { SimplePromptInterfaceTools };
|
|
18
16
|
export { promptbookStringToJson, validatePromptbookJson };
|
|
19
|
-
export { MockedEchoNaturalExecutionTools, MockedFackedNaturalExecutionTools };
|
|
20
17
|
export { createPromptbookExecutor };
|
|
21
18
|
export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LangtailExecutionTools } from '../execution/plugins/natural-execution-tools/langtail/LangtailExecutionTools';
|
|
2
|
+
import { LangtailExecutionToolsOptions } from '../execution/plugins/natural-execution-tools/langtail/LangtailExecutionToolsOptions';
|
|
3
|
+
export { LangtailExecutionTools, LangtailExecutionToolsOptions };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MockedEchoNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools';
|
|
2
|
+
import { MockedFackedNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedFackedNaturalExecutionTools';
|
|
3
|
+
export { MockedEchoNaturalExecutionTools, MockedFackedNaturalExecutionTools };
|
|
4
|
+
/**
|
|
5
|
+
* TODO: [🚏] FakeLLM
|
|
6
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OpenAiExecutionToolsOptions } from '../openai/OpenAiExecutionToolsOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Options for LangtailExecutionTools
|
|
4
|
+
*
|
|
5
|
+
* This extends OpenAI's `ClientOptions` with are directly passed to the OpenAI client.
|
|
6
|
+
* Rest is used by the `OpenAiExecutionTools`.
|
|
7
|
+
*/
|
|
8
|
+
export type LangtailExecutionToolsOptions = OpenAiExecutionToolsOptions;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: !!! Use or remove
|
|
11
|
+
*/
|
package/umd/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.d.ts
CHANGED
|
@@ -10,6 +10,6 @@ import { PostprocessingFunction } from '../../script-execution-tools/javascript/
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function $fakeTextToExpectations(expectations: Expectations, postprocessing?: Array<PostprocessingFunction>): Promise<string>;
|
|
12
12
|
/**
|
|
13
|
-
* TODO: Implement better - create FakeLLM from this
|
|
13
|
+
* TODO: [🚏] Implement better - create FakeLLM from this
|
|
14
14
|
* TODO: [💝] Unite object for expecting amount and format - use here also a format
|
|
15
15
|
*/
|