@promptbook/node 0.70.0-1 → 0.72.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.
Files changed (51) hide show
  1. package/README.md +21 -57
  2. package/esm/index.es.js +256 -273
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/promptbook-collection/index.d.ts +0 -3
  5. package/esm/typings/src/_packages/core.index.d.ts +4 -2
  6. package/esm/typings/src/_packages/openai.index.d.ts +4 -0
  7. package/esm/typings/src/_packages/types.index.d.ts +2 -0
  8. package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
  9. package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
  10. package/esm/typings/src/commands/FOREACH/ForeachCommand.d.ts +1 -6
  11. package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +1 -2
  12. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +1 -16
  13. package/esm/typings/src/config.d.ts +2 -2
  14. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +1 -1
  15. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +5 -5
  16. package/esm/typings/src/execution/createPipelineExecutor.d.ts +1 -1
  17. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +1 -1
  18. package/esm/typings/src/execution/utils/addUsage.d.ts +0 -56
  19. package/esm/typings/src/execution/utils/usage-constants.d.ts +127 -0
  20. package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceTools.d.ts +1 -1
  21. package/esm/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -1
  22. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
  23. package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +1 -1
  24. package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +1 -1
  25. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -2
  26. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  27. package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +2 -2
  28. package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +2 -2
  29. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +3 -2
  30. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +1 -1
  31. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +1 -1
  32. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +37 -0
  33. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionToolsOptions.d.ts +14 -0
  34. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +3 -2
  35. package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +1 -1
  36. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
  37. package/esm/typings/src/personas/preparePersona.d.ts +1 -1
  38. package/esm/typings/src/prepare/isPipelinePrepared.d.ts +1 -1
  39. package/esm/typings/src/prepare/prepareTemplates.d.ts +1 -1
  40. package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +1 -1
  41. package/esm/typings/src/scripting/python/PythonExecutionTools.d.ts +1 -1
  42. package/esm/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +1 -1
  43. package/esm/typings/src/storage/files-storage/FilesStorage.d.ts +1 -1
  44. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +1 -1
  45. package/esm/typings/src/types/typeAliases.d.ts +1 -1
  46. package/esm/typings/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
  47. package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +1 -1
  48. package/package.json +2 -2
  49. package/umd/index.umd.js +256 -273
  50. package/umd/index.umd.js.map +1 -1
  51. package/esm/typings/src/personas/preparePersona.test.d.ts +0 -1
package/README.md CHANGED
@@ -42,15 +42,21 @@ Core of the library for Node.js runtime, it contains the main logic for promptbo
42
42
 
43
43
  Rest of the documentation is common for **entire promptbook ecosystem**:
44
44
 
45
+ # ✨ New Features
46
+
47
+ - ✨ **Support [OpenAI o1 model](https://openai.com/o1/)**
48
+
45
49
  ## 🤍 The Promptbook Whitepaper
46
50
 
51
+
52
+
47
53
  If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 2, or whatever, it doesn't matter how you integrate it. Whether it's calling a REST API directly, using the SDK, hardcoding the prompt into the source code, or importing a text file, the process remains the same.
48
54
 
49
55
  But often you will struggle with the limitations of LLMs, such as hallucinations, off-topic responses, poor quality output, language drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd responses. When this happens, you generally have three options:
50
56
 
51
57
  1. **Fine-tune** the model to your specifications or even train your own.
52
58
  2. **Prompt-engineer** the prompt to the best shape you can achieve.
53
- 3. Use **multiple prompts** in a [pipeline](https://github.com/webgptorg/promptbook/discussions/64) to get the best result.
59
+ 3. Orchestrate **multiple prompts** in a [pipeline](https://github.com/webgptorg/promptbook/discussions/64) to get the best result.
54
60
 
55
61
  In all of these situations, but especially in 3., the Promptbook library can make your life easier.
56
62
 
@@ -62,7 +68,9 @@ In all of these situations, but especially in 3., the Promptbook library can mak
62
68
  - Promptbook has built in versioning. You can test multiple **A/B versions** of pipelines and see which one works best.
63
69
  - Promptbook is designed to do [**RAG** (Retrieval-Augmented Generation)](https://github.com/webgptorg/promptbook/discussions/41) and other advanced techniques. You can use **knowledge** to improve the quality of the output.
64
70
 
65
- ## 🧔 Promptbook _(for prompt-engeneers)_
71
+
72
+
73
+ ## 🧔 Pipeline _(for prompt-engeneers)_
66
74
 
67
75
  **P**romp**t** **b**oo**k** markdown file (or `.ptbk.md` file) is document that describes a **pipeline** - a series of prompts that are chained together to form somewhat reciepe for transforming natural language input.
68
76
 
@@ -379,6 +387,8 @@ The following glossary is used to clarify certain concepts:
379
387
  - When you want to **version** your prompts and **test multiple versions**
380
388
  - When you want to **log** the execution of prompts and backtrace the issues
381
389
 
390
+ [See more](https://github.com/webgptorg/promptbook/discussions/111)
391
+
382
392
  ### ➖ When not to use
383
393
 
384
394
  - When you have already implemented single simple prompt and it works fine for your job
@@ -388,6 +398,8 @@ The following glossary is used to clarify certain concepts:
388
398
  - When your main focus is on something other than text - like images, audio, video, spreadsheets _(other media types may be added in the future, [see discussion](https://github.com/webgptorg/promptbook/discussions/103))_
389
399
  - When you need to use recursion _([see the discussion](https://github.com/webgptorg/promptbook/discussions/38))_
390
400
 
401
+ [See more](https://github.com/webgptorg/promptbook/discussions/112)
402
+
391
403
  ## 🐜 Known issues
392
404
 
393
405
  - [🤸‍♂️ Iterations not working yet](https://github.com/webgptorg/promptbook/discussions/55)
@@ -400,63 +412,15 @@ The following glossary is used to clarify certain concepts:
400
412
 
401
413
  ## ❔ FAQ
402
414
 
403
-
404
-
405
415
  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).
406
416
 
407
- ### Why not just use the OpenAI SDK / Anthropic Claude SDK / ...?
408
-
409
- Different levels of abstraction. OpenAI library is for direct use of OpenAI API. This library is for a higher level of abstraction. It define pipelines that are independent of the underlying library, LLM model, or even LLM provider.
410
-
411
- ### How is it different from the Langchain library?
412
-
413
- Langchain is primarily aimed at ML developers working in Python. This library is for developers working in javascript/typescript and creating applications for end users.
414
-
415
- We are considering creating a bridge/converter between these two libraries.
416
-
417
-
418
-
419
- ### Promptbooks vs. OpenAI`s GPTs
420
-
421
- 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.
422
-
423
-
424
-
425
-
426
-
427
-
428
-
429
-
430
-
431
-
432
-
433
-
434
-
435
-
436
-
437
- ### Where should I store my promptbooks?
438
-
439
- If you use raw SDKs, you just put prompts in the sourcecode, mixed in with typescript, javascript, python or whatever programming language you use.
440
-
441
- If you use promptbooks, you can store them in several places, each with its own advantages and disadvantages:
442
-
443
- 1. As **source code**, typically git-committed. In this case you can use the versioning system and the promptbooks will be tightly coupled with the version of the application. You still get the power of promptbooks, as you separate the concerns of the prompt-engineer and the programmer.
444
-
445
- 2. As data in a **database** In this case, promptbooks are like posts / articles on the blog. They can be modified independently of the application. You don't need to redeploy the application to change the promptbooks. You can have multiple versions of promptbooks for each user. You can have a web interface for non-programmers to create and modify promptbooks. But you lose the versioning system and you still have to consider the interface between the promptbooks and the application _(= input and output parameters)_.
446
-
447
- 3. In a **configuration** in environment variables. This is a good way to store promptbooks if you have an application with multiple deployments and you want to have different but simple promptbooks for each deployment and you don't need to change them often.
448
-
449
- ### What should I do when I need same promptbook in multiple human languages?
450
-
451
- A single promptbook can be written for several _(human)_ languages at once. However, we recommend that you have separate promptbooks for each language.
452
-
453
- In large language models, you will get better results if you have prompts in the same language as the user input.
454
-
455
- The best way to manage this is to have suffixed promptbooks like `write-website-content.en.ptbk.md` and `write-website-content.cs.ptbk.md` for each supported language.
456
-
457
-
458
-
459
-
417
+ - [❔ Why not just use the OpenAI SDK / Anthropic Claude SDK / ...?](https://github.com/webgptorg/promptbook/discussions/114)
418
+ - [❔ How is it different from the OpenAI`s GPTs?](https://github.com/webgptorg/promptbook/discussions/118)
419
+ - [❔ How is it different from the Langchain?](https://github.com/webgptorg/promptbook/discussions/115)
420
+ - [❔ How is it different from the DSPy?](https://github.com/webgptorg/promptbook/discussions/117)
421
+ - [❔ How is it different from _anything_?](https://github.com/webgptorg/promptbook/discussions?discussions_q=is%3Aopen+label%3A%22Promptbook+vs%22)
422
+ - [❔ Is Promptbook using RAG _(Retrieval-Augmented Generation)_?](https://github.com/webgptorg/promptbook/discussions/123)
423
+ - [❔ Is Promptbook using function calling?](https://github.com/webgptorg/promptbook/discussions/124)
460
424
 
461
425
  ## ⌚ Changelog
462
426