@promptbook/openai 0.44.0-22 → 0.44.0-23

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
@@ -25,7 +25,7 @@ npm i @promptbook/openai
25
25
 
26
26
  Wrapper around [OpenAI's SDK](https://www.npmjs.com/package/openai) to make it easier to use inside Promptbooks.
27
27
 
28
- <!--!!! Simillar wrappers-->
28
+ <!-- Link Simillar wrappers -->
29
29
 
30
30
 
31
31
  ---
@@ -426,8 +426,7 @@ Internally it can have multiple formats:
426
426
  ### Promptbook **Library**
427
427
 
428
428
  Library of all promptbooks used in your application.
429
-
430
- <!-- TODO: !!! Write more -->
429
+ Each promptbook is a separate `.ptbk.md` file with unique `PROMPTBOOK URL`. Theese urls are used to reference promptbooks in other promptbooks or in the application code.
431
430
 
432
431
  ### Prompt Result
433
432
 
@@ -604,6 +603,30 @@ npm install --save @promptbook/wizzard
604
603
  - [Simple usage](./samples/usage/simple-script)
605
604
  - [Usage with client and remote server](./samples/usage/remote)
606
605
 
606
+ ## ➕➖ When to use Promptbook?
607
+
608
+ ### ➕ When to use
609
+
610
+ - When you are writing app that generates complex things via LLM - like **websites, articles, presentations, code, stories, songs**,...
611
+ - When you want to **separate code from text prompts**
612
+ - When you want to describe **complex prompt pipelines** and don't want to do it in the code
613
+ - When you want to **orchestrate multiple prompts** together
614
+ - When you want to **reuse** parts of prompts in multiple places
615
+ - When you want to **version** your prompts and **test multiple versions**
616
+ - When you want to **log** the execution of prompts and backtrace the issues
617
+
618
+ ### ➖ When not to use
619
+
620
+ - When you are writing just a simple chatbot without any extra logic, just system messages
621
+
622
+ ## 🐜 Known issues
623
+
624
+ <!-- TODO: -->
625
+
626
+ ## 🧼 Intentionally not implemented features
627
+
628
+ <!-- TODO: -->
629
+
607
630
  ## ❔ FAQ
608
631
 
609
632
  If you have a question [start a discussion](https://github.com/webgptorg/promptbook/discussions/), [open an issue](https://github.com/webgptorg/promptbook/issues) or [write me an email](https://www.pavolhejny.com/contact).
@@ -634,14 +657,14 @@ Include:
634
657
  GPTs are chat assistants that can be assigned to specific tasks and materials. But they are still chat assistants. Promptbooks are a way to orchestrate many more predefined tasks to have much tighter control over the process. Promptbooks are not a good technology for creating human-like chatbots, GPTs are not a good technology for creating outputs with specific requirements.
635
658
 
636
659
  <!--
637
- TODO:!!!
660
+ TODO:
638
661
  ### Promptbooks vs. Semantic Kernel
639
662
 
640
663
 
641
664
  -->
642
665
 
643
666
  <!--
644
- TODO:
667
+ TODO: !
645
668
  ### Promptbooks vs. Langtail
646
669
 
647
670
 
@@ -684,7 +707,7 @@ TODO: (Maybe)
684
707
 
685
708
 
686
709
 
687
- !!!!
710
+ !
688
711
 
689
712
 
690
713
 
@@ -709,7 +732,7 @@ See [CHANGELOG.md](./CHANGELOG.md)
709
732
 
710
733
  ## 📜 License
711
734
 
712
- <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://github.com/webgptorg/promptbook">Promptbook</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://github.com/hejny/">Pavol Hejný</a> is licensed under <a href="https://creativecommons.org/licenses/by/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""></a></p>
735
+ <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://github.com/webgptorg/promptbook">Promptbook</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://github.com/hejny/">Pavol Hejný</a> is licensed under <a href="https://creativecommons.org/licenses/by/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY 4.0</a></p>
713
736
 
714
737
  <!--Contributing-->
715
738
  <!--⚠️WARNING: This section was generated by https://github.com/hejny/batch-project-editor/blob/main/src/workflows/810-contributing/contributing.ts so every manual change will be overwritten.-->
@@ -1,3 +1,4 @@
1
+ import { spaceTrim } from 'spacetrim';
1
2
  import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptbookString';
2
3
  import { parseNumber } from '../conversion/utils/parseNumber';
3
4
  import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
@@ -44,7 +45,7 @@ import { unwrapResult } from '../utils/unwrapResult';
44
45
  export { assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, extractAllBlocksFromMarkdown, // <- [🌻]
45
46
  extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
46
47
  extractOneBlockFromMarkdown, isPassingExpectations, isValidJsonString, parseNumber, // <- [🌻]
47
- prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
48
+ prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
48
49
  export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
49
50
  export { splitIntoSentences };
50
51
  export declare const normalizeTo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/openai",
3
- "version": "0.44.0-22",
3
+ "version": "0.44.0-23",
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.44.0-22"
41
+ "@promptbook/core": "0.44.0-23"
42
42
  },
43
43
  "main": "./umd/index.umd.js",
44
44
  "module": "./esm/index.es.js",
@@ -1,3 +1,4 @@
1
+ import { spaceTrim } from 'spacetrim';
1
2
  import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptbookString';
2
3
  import { parseNumber } from '../conversion/utils/parseNumber';
3
4
  import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
@@ -44,7 +45,7 @@ import { unwrapResult } from '../utils/unwrapResult';
44
45
  export { assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, extractAllBlocksFromMarkdown, // <- [🌻]
45
46
  extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
46
47
  extractOneBlockFromMarkdown, isPassingExpectations, isValidJsonString, parseNumber, // <- [🌻]
47
- prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
48
+ prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
48
49
  export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
49
50
  export { splitIntoSentences };
50
51
  export declare const normalizeTo: {