@promptbook/openai 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 CHANGED
@@ -308,15 +308,26 @@ _Note: We are using [postprocessing functions](#postprocessing-functions) like `
308
308
 
309
309
  ## 📦 Packages
310
310
 
311
- This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook):
311
+ This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
312
+ You can install all of them at once:
313
+
314
+ ```bash
315
+ npm i ptbk
316
+ ```
317
+
318
+ Or you can install them separately:
312
319
 
313
320
  <!--[🔠]-->
314
321
 
322
+ <!-- Add all new -->
323
+
315
324
  - **[@promptbook/core](https://www.npmjs.com/package/@promptbook/core)** - Core of the library, it contains the main logic for promptbooks
316
- - ⭐ **[@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
325
+ - ⭐ **[@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
317
326
  - _(Not finished)_ **[@promptbook/wizzard](https://www.npmjs.com/package/@promptbook/wizzard)** - Wizard for creating+running promptbooks in single line
318
327
  - **[@promptbook/execute-javascript](https://www.npmjs.com/package/@promptbook/execute-javascript)** - Execution tools for javascript inside promptbooks
319
328
  - **[@promptbook/openai](https://www.npmjs.com/package/@promptbook/openai)** - Execution tools for OpenAI API, wrapper around OpenAI SDK
329
+ - **[@promptbook/langtail](https://www.npmjs.com/package/@promptbook/langtail)** - Execution tools for Langtail API, wrapper around Langtail SDK
330
+ - **[@promptbook/mock](https://www.npmjs.com/package/@promptbook/mock)** - Mocked execution tools for testing the library and saving the tokens
320
331
  - **[@promptbook/remote-client](https://www.npmjs.com/package/@promptbook/remote-client)** - Remote client for remote execution of promptbooks
321
332
  - **[@promptbook/remote-server](https://www.npmjs.com/package/@promptbook/remote-server)** - Remote server for remote execution of promptbooks
322
333
  - **[@promptbook/types](https://www.npmjs.com/package/@promptbook/types)** - Just typescript types used in the library
@@ -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
+ */
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/openai",
3
- "version": "0.45.0",
3
+ "version": "0.46.0-0",
4
4
  "description": "Library to supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -38,7 +38,7 @@
38
38
  "openai": "4.2.0"
39
39
  },
40
40
  "peerDependencies": {
41
- "@promptbook/core": "0.45.0"
41
+ "@promptbook/core": "0.46.0-0"
42
42
  },
43
43
  "main": "./umd/index.umd.js",
44
44
  "module": "./esm/index.es.js",
@@ -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
+ */
@@ -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
  */