@promptbook/openai 0.48.1-0 → 0.49.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
@@ -5,12 +5,11 @@ Library to supercharge your use of large language models
5
5
 
6
6
 
7
7
 
8
-
9
8
  [![NPM Version of ![Promptbook logo - cube with letters P and B](./other/design/logo-h1.png) Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
10
9
  [![Quality of package ![Promptbook logo - cube with letters P and B](./other/design/logo-h1.png) Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
11
10
  [![Known Vulnerabilities](https://snyk.io/test/github/webgptorg/promptbook/badge.svg)](https://snyk.io/test/github/webgptorg/promptbook)
12
11
  [![Issues](https://img.shields.io/github/issues/webgptorg/promptbook.svg?style=flat)](https://github.com/webgptorg/promptbook/issues)
13
- [![Socket](https://socket.dev/api/badge/npm/package/promptbook)](https://socket.dev/npm/package/promptbook)
12
+
14
13
 
15
14
  [![Socket Badge](https://socket.dev/api/badge/npm/package/@promptbook/openai)](https://socket.dev/npm/package/@promptbook/openai)
16
15
 
@@ -662,9 +661,6 @@ GPTs are chat assistants that can be assigned to specific tasks and materials. B
662
661
 
663
662
 
664
663
 
665
-
666
-
667
-
668
664
  ### Where should I store my promptbooks?
669
665
 
670
666
  If you use raw SDKs, you just put prompts in the sourcecode, mixed in with typescript, javascript, python or whatever programming language you use.
@@ -1,9 +1,12 @@
1
1
  import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
2
2
  import type { PromptbookString } from '../types/PromptbookString';
3
+ /**
4
+ * Converts promptbook in JSON format to string format
5
+ *
6
+ * @param promptbookJson Promptbook in JSON format (.ptbk.json)
7
+ * @returns Promptbook in string format (.ptbk.md)
8
+ */
3
9
  export declare function promptbookJsonToString(promptbookJson: PromptbookJson): PromptbookString;
4
10
  /**
5
- * TODO: !!!!! Implement
6
- * TODO: !!!!! Annotate and warn
7
- * TODO: !!!!! Test + test together with promptbookStringToJson
8
11
  * TODO: Escape all
9
12
  */
@@ -6,7 +6,7 @@ import type { number_integer, number_positive_or_zero, string_javascript, string
6
6
  /**
7
7
  * Describes one prompt template in the promptbook
8
8
  */
9
- export type PromptTemplateJson = LlmTemplateJson | SimpleTemplateJson | ScriptTemplateJson | PromptDialogJson;
9
+ export type PromptTemplateJson = LlmTemplateJson | SimpleTemplateJson | ScriptJson | PromptDialogJson;
10
10
  /**
11
11
  * Template for prompt to LLM
12
12
  */
@@ -50,7 +50,7 @@ interface SimpleTemplateJson extends PromptTemplateJsonCommon {
50
50
  /**
51
51
  * Template for script execution
52
52
  */
53
- interface ScriptTemplateJson extends PromptTemplateJsonCommon {
53
+ interface ScriptJson extends PromptTemplateJsonCommon {
54
54
  readonly executionType: 'SCRIPT';
55
55
  /**
56
56
  * Language of the script
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/openai",
3
- "version": "0.48.1-0",
3
+ "version": "0.49.0",
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.48.1-0"
51
+ "@promptbook/core": "0.49.0"
52
52
  },
53
53
  "main": "./umd/index.umd.js",
54
54
  "module": "./esm/index.es.js",
@@ -1,9 +1,12 @@
1
1
  import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
2
2
  import type { PromptbookString } from '../types/PromptbookString';
3
+ /**
4
+ * Converts promptbook in JSON format to string format
5
+ *
6
+ * @param promptbookJson Promptbook in JSON format (.ptbk.json)
7
+ * @returns Promptbook in string format (.ptbk.md)
8
+ */
3
9
  export declare function promptbookJsonToString(promptbookJson: PromptbookJson): PromptbookString;
4
10
  /**
5
- * TODO: !!!!! Implement
6
- * TODO: !!!!! Annotate and warn
7
- * TODO: !!!!! Test + test together with promptbookStringToJson
8
11
  * TODO: Escape all
9
12
  */
@@ -6,7 +6,7 @@ import type { number_integer, number_positive_or_zero, string_javascript, string
6
6
  /**
7
7
  * Describes one prompt template in the promptbook
8
8
  */
9
- export type PromptTemplateJson = LlmTemplateJson | SimpleTemplateJson | ScriptTemplateJson | PromptDialogJson;
9
+ export type PromptTemplateJson = LlmTemplateJson | SimpleTemplateJson | ScriptJson | PromptDialogJson;
10
10
  /**
11
11
  * Template for prompt to LLM
12
12
  */
@@ -50,7 +50,7 @@ interface SimpleTemplateJson extends PromptTemplateJsonCommon {
50
50
  /**
51
51
  * Template for script execution
52
52
  */
53
- interface ScriptTemplateJson extends PromptTemplateJsonCommon {
53
+ interface ScriptJson extends PromptTemplateJsonCommon {
54
54
  readonly executionType: 'SCRIPT';
55
55
  /**
56
56
  * Language of the script