@promptbook/markitdown 0.103.0-8 → 0.103.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 (273) hide show
  1. package/README.md +59 -39
  2. package/esm/index.es.js +260 -171
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/books/index.d.ts +0 -81
  5. package/esm/typings/servers.d.ts +9 -7
  6. package/esm/typings/src/_packages/browser.index.d.ts +6 -0
  7. package/esm/typings/src/_packages/cli.index.d.ts +4 -0
  8. package/esm/typings/src/_packages/components.index.d.ts +22 -8
  9. package/esm/typings/src/_packages/core.index.d.ts +58 -18
  10. package/esm/typings/src/_packages/node.index.d.ts +2 -2
  11. package/esm/typings/src/_packages/remote-server.index.d.ts +2 -0
  12. package/esm/typings/src/_packages/types.index.d.ts +70 -8
  13. package/esm/typings/src/_packages/utils.index.d.ts +6 -0
  14. package/esm/typings/src/_packages/wizard.index.d.ts +4 -0
  15. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +20 -5
  16. package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +17 -1
  17. package/esm/typings/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +3 -2
  18. package/esm/typings/src/book-2.0/agent-source/computeAgentHash.d.ts +8 -0
  19. package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +3 -3
  20. package/esm/typings/src/book-2.0/agent-source/createDefaultAgentName.d.ts +8 -0
  21. package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.d.ts +9 -0
  22. package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +18 -0
  23. package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +1 -1
  24. package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +3 -0
  25. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +6 -1
  26. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +85 -14
  27. package/esm/typings/src/book-components/BookEditor/BookEditorActionbar.d.ts +18 -0
  28. package/esm/typings/src/book-components/BookEditor/BookEditorMonaco.d.ts +5 -0
  29. package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +17 -0
  30. package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +13 -0
  31. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +16 -0
  32. package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
  33. package/esm/typings/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +15 -0
  34. package/esm/typings/src/book-components/Chat/MockedChat/MockedChat.d.ts +5 -0
  35. package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
  36. package/esm/typings/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +1 -0
  37. package/esm/typings/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +4 -0
  38. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
  39. package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +52 -0
  40. package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +14 -0
  41. package/esm/typings/src/book-components/Qr/BrandedQrCode.d.ts +18 -0
  42. package/esm/typings/src/book-components/Qr/GenericQrCode.d.ts +10 -0
  43. package/esm/typings/src/book-components/Qr/PromptbookQrCode.d.ts +18 -0
  44. package/esm/typings/src/book-components/Qr/useQrCode.d.ts +15 -0
  45. package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +15 -0
  46. package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +12 -0
  47. package/esm/typings/src/book-components/_common/Modal/Modal.d.ts +2 -2
  48. package/esm/typings/src/book-components/_common/Tooltip/Tooltip.d.ts +47 -0
  49. package/esm/typings/src/book-components/icons/AboutIcon.d.ts +9 -0
  50. package/esm/typings/src/book-components/icons/CameraIcon.d.ts +11 -0
  51. package/esm/typings/src/book-components/icons/CloseIcon.d.ts +4 -8
  52. package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +9 -0
  53. package/esm/typings/src/book-components/icons/ExitFullscreenIcon.d.ts +7 -0
  54. package/esm/typings/src/book-components/icons/FullscreenIcon.d.ts +7 -0
  55. package/esm/typings/src/book-components/icons/MenuIcon.d.ts +12 -0
  56. package/esm/typings/src/book-components/icons/MicIcon.d.ts +8 -0
  57. package/esm/typings/src/book-components/icons/SendIcon.d.ts +3 -0
  58. package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +2 -1
  59. package/esm/typings/src/cli/cli-commands/about.d.ts +3 -1
  60. package/esm/typings/src/cli/cli-commands/hello.d.ts +2 -1
  61. package/esm/typings/src/cli/cli-commands/list-models.d.ts +2 -1
  62. package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +2 -1
  63. package/esm/typings/src/cli/cli-commands/login.d.ts +2 -1
  64. package/esm/typings/src/cli/cli-commands/make.d.ts +2 -1
  65. package/esm/typings/src/cli/cli-commands/prettify.d.ts +2 -1
  66. package/esm/typings/src/cli/cli-commands/run.d.ts +2 -1
  67. package/esm/typings/src/cli/cli-commands/{start-server.d.ts → start-agents-server.d.ts} +3 -2
  68. package/esm/typings/src/cli/cli-commands/start-pipelines-server.d.ts +15 -0
  69. package/esm/typings/src/cli/cli-commands/test-command.d.ts +2 -1
  70. package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +2 -1
  71. package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +12 -0
  72. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +75 -0
  73. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +10 -0
  74. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +154 -0
  75. package/esm/typings/src/collection/{PipelineCollection.d.ts → pipeline-collection/PipelineCollection.d.ts} +7 -3
  76. package/esm/typings/src/collection/{SimplePipelineCollection.d.ts → pipeline-collection/SimplePipelineCollection.d.ts} +5 -5
  77. package/esm/typings/src/collection/{constructors/createCollectionFromDirectory.d.ts → pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts} +8 -11
  78. package/esm/typings/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +13 -0
  79. package/esm/typings/src/collection/{constructors/createCollectionFromPromise.d.ts → pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts} +6 -5
  80. package/esm/typings/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.test.d.ts +1 -0
  81. package/esm/typings/src/collection/{constructors/createCollectionFromUrl.d.ts → pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts} +3 -3
  82. package/esm/typings/src/collection/{constructors/createSubcollection.d.ts → pipeline-collection/constructors/createPipelineSubcollection.d.ts} +3 -3
  83. package/esm/typings/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +13 -0
  84. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -5
  85. package/esm/typings/src/{book-2.0/commitments → commitments}/ACTION/ACTION.d.ts +5 -1
  86. package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +39 -0
  87. package/esm/typings/src/commitments/CLOSED/CLOSED.test.d.ts +4 -0
  88. package/esm/typings/src/commitments/COMPONENT/COMPONENT.d.ts +28 -0
  89. package/esm/typings/src/{book-2.0/commitments → commitments}/DELETE/DELETE.d.ts +5 -1
  90. package/esm/typings/src/{book-2.0/commitments → commitments}/FORMAT/FORMAT.d.ts +5 -1
  91. package/esm/typings/src/commitments/FROM/FROM.d.ts +34 -0
  92. package/esm/typings/src/{book-2.0/commitments → commitments}/GOAL/GOAL.d.ts +5 -1
  93. package/esm/typings/src/{book-2.0/commitments → commitments}/KNOWLEDGE/KNOWLEDGE.d.ts +5 -5
  94. package/esm/typings/src/commitments/LANGUAGE/LANGUAGE.d.ts +35 -0
  95. package/esm/typings/src/{book-2.0/commitments → commitments}/MEMORY/MEMORY.d.ts +5 -1
  96. package/esm/typings/src/commitments/MESSAGE/AgentMessageCommitmentDefinition.d.ts +32 -0
  97. package/esm/typings/src/commitments/MESSAGE/InitialMessageCommitmentDefinition.d.ts +32 -0
  98. package/esm/typings/src/{book-2.0/commitments → commitments}/MESSAGE/MESSAGE.d.ts +5 -1
  99. package/esm/typings/src/commitments/MESSAGE/UserMessageCommitmentDefinition.d.ts +32 -0
  100. package/esm/typings/src/{book-2.0/commitments → commitments}/META/META.d.ts +5 -1
  101. package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +48 -0
  102. package/esm/typings/src/commitments/META_FONT/META_FONT.d.ts +42 -0
  103. package/esm/typings/src/{book-2.0/commitments → commitments}/META_IMAGE/META_IMAGE.d.ts +5 -1
  104. package/esm/typings/src/{book-2.0/commitments → commitments}/META_LINK/META_LINK.d.ts +5 -1
  105. package/esm/typings/src/{book-2.0/commitments → commitments}/MODEL/MODEL.d.ts +5 -1
  106. package/esm/typings/src/{book-2.0/commitments → commitments}/NOTE/NOTE.d.ts +5 -1
  107. package/esm/typings/src/commitments/OPEN/OPEN.d.ts +35 -0
  108. package/esm/typings/src/{book-2.0/commitments → commitments}/PERSONA/PERSONA.d.ts +5 -1
  109. package/esm/typings/src/{book-2.0/commitments → commitments}/RULE/RULE.d.ts +5 -1
  110. package/esm/typings/src/{book-2.0/commitments → commitments}/SAMPLE/SAMPLE.d.ts +5 -1
  111. package/esm/typings/src/{book-2.0/commitments → commitments}/SCENARIO/SCENARIO.d.ts +5 -1
  112. package/esm/typings/src/{book-2.0/commitments → commitments}/STYLE/STYLE.d.ts +5 -1
  113. package/esm/typings/src/commitments/USE/USE.d.ts +53 -0
  114. package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +42 -0
  115. package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +1 -0
  116. package/esm/typings/src/commitments/USE_MCP/USE_MCP.d.ts +37 -0
  117. package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +38 -0
  118. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BaseCommitmentDefinition.d.ts +14 -2
  119. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/CommitmentDefinition.d.ts +6 -1
  120. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/NotYetImplementedCommitmentDefinition.d.ts +5 -1
  121. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/createEmptyAgentModelRequirements.d.ts +1 -1
  122. package/esm/typings/src/commitments/index.d.ts +93 -0
  123. package/esm/typings/src/config.d.ts +24 -3
  124. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +2 -0
  125. package/esm/typings/src/errors/0-index.d.ts +6 -0
  126. package/esm/typings/src/errors/DatabaseError.d.ts +12 -0
  127. package/esm/typings/src/errors/NotAllowed.d.ts +9 -0
  128. package/esm/typings/src/errors/WrappedError.d.ts +2 -2
  129. package/esm/typings/src/execution/AvailableModel.d.ts +1 -0
  130. package/esm/typings/src/execution/Executables.d.ts +3 -0
  131. package/esm/typings/src/execution/ExecutionTask.d.ts +12 -3
  132. package/esm/typings/src/execution/ExecutionTools.d.ts +5 -0
  133. package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
  134. package/esm/typings/src/execution/LlmExecutionTools.d.ts +26 -2
  135. package/esm/typings/src/execution/PromptResult.d.ts +7 -1
  136. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +5 -0
  137. package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +5 -0
  138. package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +5 -0
  139. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +5 -0
  140. package/esm/typings/src/execution/utils/usage-constants.d.ts +4 -124
  141. package/esm/typings/src/execution/utils/validatePromptResult.d.ts +2 -0
  142. package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +2 -1
  143. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +2 -2
  144. package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +2 -1
  145. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
  146. package/esm/typings/src/llm-providers/_common/utils/assertUniqueModels.d.ts +12 -0
  147. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
  148. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
  149. package/esm/typings/src/llm-providers/agent/Agent.d.ts +72 -0
  150. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +26 -4
  151. package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +19 -0
  152. package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +17 -0
  153. package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +50 -0
  154. package/esm/typings/src/llm-providers/agent/RemoteAgentOptions.d.ts +11 -0
  155. package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +1 -19
  156. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  157. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  158. package/esm/typings/src/llm-providers/ollama/OllamaExecutionTools.d.ts +4 -0
  159. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +60 -2
  160. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionToolsOptions.d.ts +7 -1
  161. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +13 -1
  162. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +4 -0
  163. package/esm/typings/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +6 -6
  164. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  165. package/esm/typings/src/llm-providers/openai/openai-models.test.d.ts +4 -0
  166. package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +1 -1
  167. package/esm/typings/src/pipeline/validatePipelineString.d.ts +2 -0
  168. package/esm/typings/src/playground/permanent/_boilerplate.d.ts +5 -0
  169. package/esm/typings/src/playground/permanent/agent-with-browser-playground.d.ts +5 -0
  170. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +1 -0
  171. package/esm/typings/src/remote-server/startAgentServer.d.ts +26 -0
  172. package/esm/typings/src/remote-server/startRemoteServer.d.ts +4 -1
  173. package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +3 -8
  174. package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -12
  175. package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -9
  176. package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -12
  177. package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -9
  178. package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +1 -12
  179. package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -9
  180. package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +1 -12
  181. package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -9
  182. package/esm/typings/src/scrapers/markitdown/createMarkitdownScraper.d.ts +1 -12
  183. package/esm/typings/src/scrapers/markitdown/register-metadata.d.ts +1 -9
  184. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -12
  185. package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -9
  186. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +1 -12
  187. package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -9
  188. package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -0
  189. package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +2 -1
  190. package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +33 -0
  191. package/esm/typings/src/transpilers/_common/BookTranspilerOptions.d.ts +18 -0
  192. package/esm/typings/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +15 -0
  193. package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +16 -0
  194. package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +15 -0
  195. package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +16 -0
  196. package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.test.d.ts +1 -0
  197. package/esm/typings/src/transpilers/openai-sdk/playground/playground.d.ts +5 -0
  198. package/esm/typings/src/transpilers/openai-sdk/register.d.ts +15 -0
  199. package/esm/typings/src/types/LlmCall.d.ts +20 -0
  200. package/esm/typings/src/types/ModelRequirements.d.ts +13 -1
  201. package/esm/typings/src/types/ModelVariant.d.ts +1 -1
  202. package/esm/typings/src/types/Prompt.d.ts +13 -1
  203. package/esm/typings/src/types/Updatable.d.ts +19 -0
  204. package/esm/typings/src/types/typeAliases.d.ts +38 -2
  205. package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
  206. package/esm/typings/src/utils/color/Color.d.ts +16 -1
  207. package/esm/typings/src/utils/color/Color.test.d.ts +1 -0
  208. package/esm/typings/src/utils/color/css-colors.d.ts +1 -0
  209. package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +0 -3
  210. package/esm/typings/src/utils/color/operators/darken.d.ts +1 -1
  211. package/esm/typings/src/utils/color/operators/grayscale.d.ts +1 -1
  212. package/esm/typings/src/utils/color/operators/lighten.d.ts +1 -1
  213. package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +1 -1
  214. package/esm/typings/src/utils/color/operators/saturate.d.ts +1 -1
  215. package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +16 -0
  216. package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -2
  217. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +2 -1
  218. package/esm/typings/src/utils/execCommand/$execCommands.d.ts +2 -1
  219. package/esm/typings/src/utils/files/$induceBookDownload.d.ts +13 -0
  220. package/esm/typings/src/utils/files/$induceFileDownload.d.ts +13 -0
  221. package/esm/typings/src/utils/files/ObjectUrl.d.ts +46 -0
  222. package/esm/typings/src/utils/files/listAllFiles.d.ts +2 -3
  223. package/esm/typings/src/utils/misc/aboutPromptbookInformation.d.ts +27 -0
  224. package/esm/typings/src/utils/misc/computeHash.d.ts +11 -0
  225. package/esm/typings/src/utils/misc/computeHash.test.d.ts +1 -0
  226. package/esm/typings/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +1 -0
  227. package/esm/typings/src/utils/misc/xAboutPromptbookInformation.d.ts +13 -0
  228. package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -0
  229. package/esm/typings/src/utils/normalization/normalizeMessageText.d.ts +9 -0
  230. package/esm/typings/src/utils/normalization/normalizeMessageText.test.d.ts +1 -0
  231. package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +3 -0
  232. package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -0
  233. package/esm/typings/src/utils/normalization/titleToName.d.ts +2 -0
  234. package/esm/typings/src/utils/organization/$sideEffect.d.ts +2 -2
  235. package/esm/typings/src/utils/organization/$side_effect.d.ts +7 -0
  236. package/esm/typings/src/utils/organization/TODO_USE.d.ts +2 -2
  237. package/esm/typings/src/utils/organization/keepUnused.d.ts +2 -2
  238. package/esm/typings/src/utils/organization/preserve.d.ts +3 -3
  239. package/esm/typings/src/utils/organization/really_any.d.ts +7 -0
  240. package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +31 -0
  241. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
  242. package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
  243. package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
  244. package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
  245. package/esm/typings/src/utils/random/$randomToken.d.ts +2 -0
  246. package/esm/typings/src/utils/random/CzechNamePool.d.ts +7 -0
  247. package/esm/typings/src/utils/random/EnglishNamePool.d.ts +7 -0
  248. package/esm/typings/src/utils/random/NamePool.d.ts +17 -0
  249. package/esm/typings/src/utils/random/getNamePool.d.ts +10 -0
  250. package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +2 -1
  251. package/esm/typings/src/utils/serialization/asSerializable.d.ts +2 -2
  252. package/esm/typings/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -2
  253. package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +2 -0
  254. package/esm/typings/src/version.d.ts +1 -1
  255. package/esm/typings/src/wizard/$getCompiledBook.d.ts +1 -2
  256. package/package.json +8 -8
  257. package/umd/index.umd.js +285 -196
  258. package/umd/index.umd.js.map +1 -1
  259. package/esm/typings/src/book-2.0/commitments/index.d.ts +0 -60
  260. package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +0 -5
  261. package/esm/typings/src/book-components/BookEditor/BookEditorWrapper.d.ts +0 -9
  262. package/esm/typings/src/book-components/BookEditor/config.d.ts +0 -10
  263. package/esm/typings/src/book-components/Chat/utils/renderMarkdown.d.ts +0 -21
  264. package/esm/typings/src/collection/collectionToJson.d.ts +0 -13
  265. package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +0 -13
  266. /package/esm/typings/src/{book-components/Chat/utils/renderMarkdown.test.d.ts → book-2.0/agent-source/computeAgentHash.test.d.ts} +0 -0
  267. /package/esm/typings/src/{collection/constructors/createCollectionFromDirectory.test.d.ts → book-2.0/agent-source/normalizeAgentName.test.d.ts} +0 -0
  268. /package/esm/typings/src/{collection/constructors/createCollectionFromJson.test.d.ts → book-components/Chat/AgentChat/AgentChat.test.d.ts} +0 -0
  269. /package/esm/typings/src/collection/{constructors/createCollectionFromPromise.test.d.ts → pipeline-collection/constructors/createPipelineCollectionFromDirectory.test.d.ts} +0 -0
  270. /package/esm/typings/src/{commands/_common/parseCommand.test.d.ts → collection/pipeline-collection/constructors/createPipelineCollectionFromJson.test.d.ts} +0 -0
  271. /package/esm/typings/src/collection/{collectionToJson.test.d.ts → pipeline-collection/pipelineCollectionToJson.test.d.ts} +0 -0
  272. /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BookCommitment.d.ts +0 -0
  273. /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/ParsedCommitment.d.ts +0 -0
package/umd/index.umd.js CHANGED
@@ -1,12 +1,12 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('fs/promises'), require('spacetrim'), require('crypto-js'), require('crypto-js/enc-hex'), require('path'), require('crypto'), require('rxjs'), require('waitasecond'), require('crypto-js/sha256'), require('mime-types'), require('papaparse')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', 'fs/promises', 'spacetrim', 'crypto-js', 'crypto-js/enc-hex', 'path', 'crypto', 'rxjs', 'waitasecond', 'crypto-js/sha256', 'mime-types', 'papaparse'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-markitdown"] = {}, global.promises, global.spaceTrim, global.cryptoJs, global.hexEncoder, global.path, global.crypto, global.rxjs, global.waitasecond, global.sha256, global.mimeTypes, global.papaparse));
5
- })(this, (function (exports, promises, spaceTrim, cryptoJs, hexEncoder, path, crypto, rxjs, waitasecond, sha256, mimeTypes, papaparse) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-markitdown"] = {}, global.promises, global.spaceTrim$1, global.cryptoJs, global.hexEncoder, global.path, global.crypto, global.rxjs, global.waitasecond, global.sha256, global.mimeTypes, global.papaparse));
5
+ })(this, (function (exports, promises, spaceTrim$1, cryptoJs, hexEncoder, path, crypto, rxjs, waitasecond, sha256, mimeTypes, papaparse) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
- var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim);
9
+ var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim$1);
10
10
  var hexEncoder__default = /*#__PURE__*/_interopDefaultLegacy(hexEncoder);
11
11
  var sha256__default = /*#__PURE__*/_interopDefaultLegacy(sha256);
12
12
 
@@ -17,14 +17,14 @@
17
17
  * @generated
18
18
  * @see https://github.com/webgptorg/book
19
19
  */
20
- const BOOK_LANGUAGE_VERSION = '1.0.0';
20
+ const BOOK_LANGUAGE_VERSION = '2.0.0';
21
21
  /**
22
22
  * The version of the Promptbook engine
23
23
  *
24
24
  * @generated
25
25
  * @see https://github.com/webgptorg/promptbook
26
26
  */
27
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-8';
27
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0';
28
28
  /**
29
29
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
30
30
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -47,6 +47,17 @@
47
47
  function keepUnused(...valuesToKeep) {
48
48
  }
49
49
 
50
+ /**
51
+ * Trims string from all 4 sides
52
+ *
53
+ * Note: This is a re-exported function from the `spacetrim` package which is
54
+ * Developed by same author @hejny as this package
55
+ *
56
+ * @public exported from `@promptbook/utils`
57
+ * @see https://github.com/hejny/spacetrim#usage
58
+ */
59
+ const spaceTrim = spaceTrim$1.spaceTrim;
60
+
50
61
  /**
51
62
  * @private util of `@promptbook/color`
52
63
  * @de
@@ -95,6 +106,7 @@
95
106
  * @public exported from `@promptbook/color`
96
107
  */
97
108
  const CSS_COLORS = {
109
+ promptbook: '#79EAFD',
98
110
  transparent: 'rgba(0,0,0,0)',
99
111
  aliceblue: '#f0f8ff',
100
112
  antiquewhite: '#faebd7',
@@ -276,9 +288,6 @@
276
288
  throw new Error(`${channelName} channel is greater than 255, it is ${value}`);
277
289
  }
278
290
  }
279
- /**
280
- * TODO: [🧠][🚓] Is/which combination it better to use asserts/check, validate or is utility function?
281
- */
282
291
 
283
292
  /**
284
293
  * Color object represents an RGB color with alpha channel
@@ -298,21 +307,61 @@
298
307
  * @param color
299
308
  * @returns Color object
300
309
  */
301
- static from(color) {
302
- if (color instanceof Color) {
310
+ static from(color, _isSingleValue = false) {
311
+ if (color === '') {
312
+ throw new Error(`Can not create color from empty string`);
313
+ }
314
+ else if (color instanceof Color) {
303
315
  return take(color);
304
316
  }
305
317
  else if (Color.isColor(color)) {
306
318
  return take(color);
307
319
  }
308
320
  else if (typeof color === 'string') {
309
- return Color.fromString(color);
321
+ try {
322
+ return Color.fromString(color);
323
+ }
324
+ catch (error) {
325
+ // <- Note: Can not use `assertsError(error)` here because it causes circular dependency
326
+ if (_isSingleValue) {
327
+ throw error;
328
+ }
329
+ const parts = color.split(/[\s+,;|]/);
330
+ if (parts.length > 0) {
331
+ return Color.from(parts[0].trim(), true);
332
+ }
333
+ else {
334
+ throw new Error(`Can not create color from given string "${color}"`);
335
+ }
336
+ }
310
337
  }
311
338
  else {
312
339
  console.error({ color });
313
340
  throw new Error(`Can not create color from given object`);
314
341
  }
315
342
  }
343
+ /**
344
+ * Creates a new Color instance from miscellaneous formats
345
+ * It just does not throw error when it fails, it returns PROMPTBOOK_COLOR instead
346
+ *
347
+ * @param color
348
+ * @returns Color object
349
+ */
350
+ static fromSafe(color) {
351
+ try {
352
+ return Color.from(color);
353
+ }
354
+ catch (error) {
355
+ // <- Note: Can not use `assertsError(error)` here because it causes circular dependency
356
+ console.warn(spaceTrim((block) => `
357
+ Color.fromSafe error:
358
+ ${block(error.message)}
359
+
360
+ Returning default PROMPTBOOK_COLOR.
361
+ `));
362
+ return Color.fromString('promptbook');
363
+ }
364
+ }
316
365
  /**
317
366
  * Creates a new Color instance from miscellaneous string formats
318
367
  *
@@ -380,6 +429,9 @@
380
429
  if (hex.length === 3) {
381
430
  return Color.fromHex3(hex);
382
431
  }
432
+ if (hex.length === 4) {
433
+ return Color.fromHex4(hex);
434
+ }
383
435
  if (hex.length === 6) {
384
436
  return Color.fromHex6(hex);
385
437
  }
@@ -400,6 +452,19 @@
400
452
  const b = parseInt(hex.substr(2, 1), 16) * 16;
401
453
  return take(new Color(r, g, b));
402
454
  }
455
+ /**
456
+ * Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
457
+ *
458
+ * @param color in hex for example `09df`
459
+ * @returns Color object
460
+ */
461
+ static fromHex4(hex) {
462
+ const r = parseInt(hex.substr(0, 1), 16) * 16;
463
+ const g = parseInt(hex.substr(1, 1), 16) * 16;
464
+ const b = parseInt(hex.substr(2, 1), 16) * 16;
465
+ const a = parseInt(hex.substr(3, 1), 16) * 16;
466
+ return take(new Color(r, g, b, a));
467
+ }
403
468
  /**
404
469
  * Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
405
470
  *
@@ -590,7 +655,8 @@
590
655
  * @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
591
656
  */
592
657
  static isHexColorString(value) {
593
- return typeof value === 'string' && /^#(?:[0-9a-fA-F]{3}){1,2}$/.test(value);
658
+ return (typeof value === 'string' &&
659
+ /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value));
594
660
  }
595
661
  /**
596
662
  * Creates new Color object
@@ -705,6 +771,23 @@
705
771
  * TODO: Maybe connect with textures
706
772
  */
707
773
 
774
+ /**
775
+ * Makes color transformer which returns a grayscale version of the color
776
+ *
777
+ * @param amount from 0 to 1
778
+ *
779
+ * @public exported from `@promptbook/color`
780
+ */
781
+ function grayscale(amount) {
782
+ return ({ red, green, blue, alpha }) => {
783
+ const average = (red + green + blue) / 3;
784
+ red = Math.round(average * amount + red * (1 - amount));
785
+ green = Math.round(average * amount + green * (1 - amount));
786
+ blue = Math.round(average * amount + blue * (1 - amount));
787
+ return Color.fromValues(red, green, blue, alpha);
788
+ };
789
+ }
790
+
708
791
  /**
709
792
  * Converts HSL values to RGB values
710
793
  *
@@ -820,102 +903,6 @@
820
903
  * TODO: Maybe implement by mix+hsl
821
904
  */
822
905
 
823
- /**
824
- * Calculates distance between two colors
825
- *
826
- * @param color1 first color
827
- * @param color2 second color
828
- *
829
- * Note: This function is inefficient. Use colorDistanceSquared instead if possible.
830
- *
831
- * @public exported from `@promptbook/color`
832
- */
833
- /**
834
- * Calculates distance between two colors without square root
835
- *
836
- * @param color1 first color
837
- * @param color2 second color
838
- *
839
- * @public exported from `@promptbook/color`
840
- */
841
- function colorDistanceSquared(color1, color2) {
842
- const rmean = (color1.red + color2.red) / 2;
843
- const r = color1.red - color2.red;
844
- const g = color1.green - color2.green;
845
- const b = color1.blue - color2.blue;
846
- const weightR = 2 + rmean / 256;
847
- const weightG = 4.0;
848
- const weightB = 2 + (255 - rmean) / 256;
849
- const distance = weightR * r * r + weightG * g * g + weightB * b * b;
850
- return distance;
851
- }
852
-
853
- /**
854
- * Makes color transformer which finds the nearest color from the given list
855
- *
856
- * @param colors array of colors to choose from
857
- *
858
- * @public exported from `@promptbook/color`
859
- */
860
- function nearest(...colors) {
861
- return (color) => {
862
- const distances = colors.map((c) => colorDistanceSquared(c, color));
863
- const minDistance = Math.min(...distances);
864
- const minIndex = distances.indexOf(minDistance);
865
- const nearestColor = colors[minIndex];
866
- return nearestColor;
867
- };
868
- }
869
-
870
- /**
871
- * Color transformer which returns the negative color
872
- *
873
- * @public exported from `@promptbook/color`
874
- */
875
- function negative(color) {
876
- const r = 255 - color.red;
877
- const g = 255 - color.green;
878
- const b = 255 - color.blue;
879
- return Color.fromValues(r, g, b, color.alpha);
880
- }
881
-
882
- /**
883
- * Makes color transformer which finds the furthest color from the given list
884
- *
885
- * @param colors array of colors to choose from
886
- *
887
- * @public exported from `@promptbook/color`
888
- */
889
- function furthest(...colors) {
890
- return (color) => {
891
- const furthestColor = negative(nearest(...colors.map(negative))(color));
892
- return furthestColor;
893
- };
894
- }
895
- /**
896
- * Makes color transformer which finds the best text color (black or white) for the given background color
897
- *
898
- * @public exported from `@promptbook/color`
899
- */
900
- furthest(Color.get('white'), Color.from('black'));
901
-
902
- /**
903
- * Makes color transformer which returns a grayscale version of the color
904
- *
905
- * @param amount from 0 to 1
906
- *
907
- * @public exported from `@promptbook/color`
908
- */
909
- function grayscale(amount) {
910
- return ({ red, green, blue, alpha }) => {
911
- const average = (red + green + blue) / 3;
912
- red = Math.round(average * amount + red * (1 - amount));
913
- green = Math.round(average * amount + green * (1 - amount));
914
- blue = Math.round(average * amount + blue * (1 - amount));
915
- return Color.fromValues(red, green, blue, alpha);
916
- };
917
- }
918
-
919
906
  /**
920
907
  * Makes color transformer which saturate the given color
921
908
  *
@@ -984,16 +971,32 @@
984
971
  *
985
972
  * @public exported from `@promptbook/core`
986
973
  */
987
- const PROMPTBOOK_COLOR = Color.fromHex('#79EAFD');
988
- // <- TODO: [🧠] Using `Color` here increases the package size approx 3kb, maybe remove it
974
+ const PROMPTBOOK_COLOR = Color.fromString('promptbook');
975
+ // <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
989
976
  /**
990
- * Dark color of the Promptbook
977
+ * Colors for syntax highlighting in the `<BookEditor/>`
978
+ *
979
+ * TODO: [🗽] Unite branding and make single place for it
980
+ *
981
+ * @public exported from `@promptbook/core`
982
+ */
983
+ ({
984
+ TITLE: Color.fromHex('#244EA8'),
985
+ LINE: Color.fromHex('#eeeeee'),
986
+ SEPARATOR: Color.fromHex('#cccccc'),
987
+ COMMITMENT: Color.fromHex('#DA0F78'),
988
+ PARAMETER: Color.fromHex('#8e44ad'),
989
+ });
990
+ // <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
991
+ /**
992
+ * Chat color of the Promptbook (in chat)
991
993
  *
992
994
  * TODO: [🗽] Unite branding and make single place for it
993
995
  *
994
996
  * @public exported from `@promptbook/core`
995
997
  */
996
998
  PROMPTBOOK_COLOR.then(lighten(0.1)).then(saturate(0.9)).then(grayscale(0.9));
999
+ // <- TODO: [🧠][🈵] Using `Color` and `lighten`, `saturate`,... here increases the package size approx 3kb, maybe remove it
997
1000
  /**
998
1001
  * Color of the user (in chat)
999
1002
  *
@@ -1002,6 +1005,7 @@
1002
1005
  * @public exported from `@promptbook/core`
1003
1006
  */
1004
1007
  Color.fromHex('#1D4ED8');
1008
+ // <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
1005
1009
  /**
1006
1010
  * When the title is not provided, the default title is used
1007
1011
  *
@@ -1088,7 +1092,7 @@
1088
1092
  * @public exported from `@promptbook/core`
1089
1093
  */
1090
1094
  const DEFAULT_MAX_EXECUTION_ATTEMPTS = 7; // <- TODO: [🤹‍♂️]
1091
- // <- TODO: [🕝] Make also `BOOKS_DIRNAME_ALTERNATIVES`
1095
+ // <- TODO: [🕝] Make also `AGENTS_DIRNAME_ALTERNATIVES`
1092
1096
  // TODO: Just `.promptbook` in config, hardcode subfolders like `download-cache` or `execution-cache`
1093
1097
  /**
1094
1098
  * Where to store the temporary downloads
@@ -1234,7 +1238,7 @@
1234
1238
  */
1235
1239
  class UnexpectedError extends Error {
1236
1240
  constructor(message) {
1237
- super(spaceTrim.spaceTrim((block) => `
1241
+ super(spaceTrim$1.spaceTrim((block) => `
1238
1242
  ${block(message)}
1239
1243
 
1240
1244
  Note: This error should not happen.
@@ -1570,6 +1574,8 @@
1570
1574
  /**
1571
1575
  * Converts a given text to kebab-case format.
1572
1576
  *
1577
+ * Note: [🔂] This function is idempotent.
1578
+ *
1573
1579
  * @param text The text to be converted.
1574
1580
  * @returns The kebab-case formatted string.
1575
1581
  * @example 'hello-world'
@@ -1725,6 +1731,8 @@
1725
1731
  /**
1726
1732
  * Converts a title string into a normalized name.
1727
1733
  *
1734
+ * Note: [🔂] This function is idempotent.
1735
+ *
1728
1736
  * @param value The title string to be converted to a name.
1729
1737
  * @returns A normalized name derived from the input title.
1730
1738
  * @example 'Hello World!' -> 'hello-world'
@@ -1816,7 +1824,7 @@
1816
1824
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
1817
1825
  */
1818
1826
 
1819
- var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book",formfactorName:"GENERIC",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge from Markdown\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book`\n- INPUT PARAMETER `{knowledgeContent}` Markdown document content\n- OUTPUT PARAMETER `{knowledgePieces}` The knowledge JSON object\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}\n```\n\n`-> {knowledgePieces}`\n"}],sourceFile:"./books/prepare-knowledge-from-markdown.book"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Keywords\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-keywords.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{keywords}` Keywords separated by comma\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}\n```\n\n`-> {keywords}`\n"}],sourceFile:"./books/prepare-knowledge-keywords.book"},{title:"Prepare Knowledge-piece Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge-piece Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-title.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{title}` The title of the document\n\n## Knowledge\n\n- EXPECT MIN 1 WORD\n- EXPECT MAX 8 WORDS\n\n```markdown\nYou are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-knowledge-title.book"},{title:"Prepare Persona",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.book",formfactorName:"GENERIC",parameters:[{name:"availableModels",description:"List of available model names together with their descriptions as JSON",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelsRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-model-requirements",title:"Make modelRequirements",content:"You are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n```json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n```\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n```json\n{availableModels}\n```\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",resultingParameterName:"modelsRequirements",format:"JSON",dependentParameterNames:["availableModels","personaDescription"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Persona\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-persona.book`\n- INPUT PARAMETER `{availableModels}` List of available model names together with their descriptions as JSON\n- INPUT PARAMETER `{personaDescription}` Description of the persona\n- OUTPUT PARAMETER `{modelsRequirements}` Specific requirements for the model\n\n## Make modelRequirements\n\n- FORMAT JSON\n\n```markdown\nYou are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n\\`\\`\\`json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n\\`\\`\\`\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n\\`\\`\\`json\n{availableModels}\n\\`\\`\\`\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}\n```\n\n`-> {modelsRequirements}`\n"}],sourceFile:"./books/prepare-persona.book"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-title.book",formfactorName:"GENERIC",parameters:[{name:"book",description:"The book to prepare the title for",isInput:true,isOutput:false},{name:"title",description:"Best title for the book",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-title",title:"Make title",content:"Make best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}",resultingParameterName:"title",expectations:{words:{min:1,max:8},lines:{min:1,max:1}},dependentParameterNames:["book"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-title.book`\n- INPUT PARAMETER `{book}` The book to prepare the title for\n- OUTPUT PARAMETER `{title}` Best title for the book\n\n## Make title\n\n- EXPECT MIN 1 Word\n- EXPECT MAX 8 Words\n- EXPECT EXACTLY 1 Line\n\n```markdown\nMake best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-title.book"},{title:"📊 Curriculum Audit",pipelineUrl:"https://promptbook.studio/promptbook//examples/lsvp-asistent.book",formfactorName:"GENERIC",parameters:[{name:"result",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"prompt",title:"Prompt",content:"Asistent pro LŠVP\n\nPERSONA Jsi asistent pro RVP Lyceum v rámci Národního pedagogického institutu České Republiky\nMETA IMAGE https://edulk.cz/getFile/id:475818/type:large/02%20zna%C4%8Dka%20npi.jpg\nRULE Pokud jsi nejsi jistý, napiš nevím\nKNOWLEDGE ./241129_Lyceum_final.pdf\nCONTEXT Obecně dokážeš řešit libovolné ŠVP, aktuálně řešíš {Školní vzdělávací program LYCEUM}\nRULE Z {Porovnání RVP a ŠVP - postup} je nejdůležitější fáze 3\nKNOWLEDGE {Školní vzdělávací program LYCEUM} ./ŠVP Lyceum - Finance v digitální době.pdf\nKNOWLEDGE @Slovník\n\n**Interní slovník - RVP/ŠVP**\n\n**RVP**\n\nRámcový vzdělávací program pro obor vzdělání Lyceum je dokument na národní úrovni, který formuluje požadavky na školní vzdělávací programy ve formě především očekávaných výsledků učení, kterých mají žáci absolvováním tohoto programu na dané škole dosáhnout.\n\n**ŠVP**\n\nŠkolní vzdělávací program pro obor vzdělání Lyceum je dokument každé jednotlivé školy, který popisuje v jakých vyučovacích předmětech/ vzdělávacích modulech a v jakých ročnících budou požadované očekávané výsledky učení naplněny. Zároveň formuluje další očekávané výsledky učení, které naplňují disponibilní část vyučovacího času určeného RVP pro tento obor vzdělání.\n\n**Očekávaný výsledek učení (OVU)**\n\nVyjadřuje jednotlivý požadavek na to, co mají žáci umět na konci vzdělávacího programu, tzn. jejich požadované kompetence. Je vyjádřen formulací, která je uvozena činnostním slovesem a dále obsahuje předmět této činnosti. Formulace je konkretizována resp. doplněna zpravidla formou odrážek vymezením dílčích znalostí, dovedností, postojů, jejichž splnění je předpokladem dosažení OVU jako celku.\n\n_Příklad:_\n\n<div class=\"joplin-table-wrapper\"><table><tbody><tr><th><p><strong>Žák/žákyně řídí realizaci jednoduchého projektu</strong></p></th></tr><tr><td><ul><li>naplánuje aktivity projektu</li></ul></td></tr><tr><td><ul><li>navrhne rozpočet projektu vzhledem k navrženým aktivitám</li></ul></td></tr><tr><td><ul><li>stanoví základní ukazatele a sleduje jejich naplňování</li></ul></td></tr><tr><td><ul><li>vede projektový tým</li></ul></td></tr><tr><td><ul><li>uvede, jak by řešil krizové situace v projektu</li></ul></td></tr><tr><td><ul><li>vyhodnotí úspěšnost projektu</li></ul></td></tr></tbody></table></div>\n\n**Vzdělávací oblasti**\n\nOčekávané výsledky učení jsou v **_RVP členěny do 4 vzdělávacích oblastí_**, které tvoří společný všeobecně vzdělávací základ:\n\n- Osobnostní rozvoj, vzdělávání ke zdraví, bezpečí a produktivnímu pracovnímu životu (kariéře)\n- Komunikační a jazykové vzdělávání\n- Aplikované vzdělávání STEM (Science, Technology, Engeneering, Math), tj. přírodní vědy, informatika, technika, matematika\n- Prakticky orientované vzdělávání společenskovědní a humanitní\n\nKaždá vzdělávací oblast se dále člení na okruhy, v jejichž rámci jsou OVU samostatně číslované.\n\n<div class=\"joplin-table-wrapper\"><table><tbody><tr><th rowspan=\"21\"><ul><li>Prakticky orientované vzdělávání společenskovědní a humanitní</li></ul></th><th rowspan=\"21\"><p><strong>Člověk, ekonomie a podnikání</strong></p></th><th rowspan=\"7\"><p><strong>1</strong></p></th><th><p><strong>zpracuje podklady související s podnikáním</strong></p></th></tr><tr><td><p>připraví podnikatelský záměr</p></td></tr><tr><td><p>sestaví zakladatelský rozpočet</p></td></tr><tr><td><p>zkalkuluje cenu zboží nebo služby</p></td></tr><tr><td><p>vysvětlí na příkladu základní povinnosti podnikatele vůči státu a zaměstnancům</p></td></tr><tr><td><p>vede daňovou evidenci</p></td></tr><tr><td><p>vysvětlí na příkladech etiku v podnikání</p></td></tr><tr><td rowspan=\"7\"><p><strong>2</strong></p></td><td><p><strong>řídí realizaci jednoduchého projektu</strong></p></td></tr><tr><td><p>naplánuje aktivity projektu</p></td></tr><tr><td><p>navrhne rozpočet projektu vzhledem k navrženým aktivitám</p></td></tr><tr><td><p>stanoví základní ukazatele a sleduje jejich naplňování</p></td></tr><tr><td><p>vede projektový tým</p></td></tr><tr><td><p>uvede, jak by řešil krizové situace v projektu</p></td></tr><tr><td><p>vyhodnotí úspěšnost projektu</p></td></tr><tr><td rowspan=\"7\"><p><strong>3</strong></p></td><td><p><strong>aplikuje ekonomické teorie v osobním a profesním životě</strong></p></td></tr><tr><td><p>vysvětlí základní ekonomické otázky</p></td></tr><tr><td><p>vysvětí stanovení rovnovážné ceny na dokonalém i nedokonalém trhu</p></td></tr><tr><td><p>charakterizuje výrobní faktory a vysvětlí hranici produkčních možností a náklady obětované příležitosti</p></td></tr><tr><td><p>uvede nejdůležitější makroekonomické pojmy a vliv jejich výše na kvalitu života a podnikání v daném státě</p></td></tr><tr><td><p>vysvětlí podstatu inflace a její důsledky na finanční situaci obyvatel a na příkladu ukáže jak se bránit jejím nepříznivým důsledkům</p></td></tr><tr><td><p>uvede hlavní výhody a nevýhody mezinárodního obchodu a vliv ochranářských opatření na ekonomickou situaci dané země</p></td></tr><tr><td></td><td></td><td><p><strong>4</strong></p></td><td><p>Atd.</p></td></tr></tbody></table></div>\n\n**Vyučovací předmět / vzdělávací modul**\n\nOčekávané výsledky učení jsou v **ŠVP** členěny do vyučovacích předmětů nebo vzdělávacích modulů, které jsou dále zařazeny do jednoho nebo více ročníků 4letého studia. Vyučovací předmět / vzdělávací modul tvoří vyučovací jednotku, kde jsou očekávané výsledky učení dále rozpracovány pro potřeby výuky podle následující šablony\n\n| **A. VSTUPNÍ ČÁST** |\n| --- |\n| **1\\. Název** |\n| **2\\. Kód** (kódy by měly být navázány na obory vzdělání a výsledky učení) |\n| **2a) Kategorie vzdělání** - v případě, že nebude součástí kódu |\n| **3\\. Typ vyučovací jednotky** (modul, předmět, stáž apod.) |\n| **4\\. Délka** (počet hodin - dělitelný čtyřmi (optimální modul 16, 32 hodin = týden výuky) |\n| **5\\. Platnost** (datum, od kterého platí) |\n| **6\\. Vstupní předpoklady** (vymezení požadované úrovně vstupních vědomostí a dovedností, které jsou předpokladem úspěšného studia) |\n| |\n| **B. JÁDRO VYUČOVACÍ JEDNOTKY** |\n| **1\\. Charakteristika** (stručná anotace popisující obecné cíle a pojetí) |\n| **2\\. Očekávané výsledky učení a jejich indikátory (převzaté z RVP nebo dále konkretizované)** |\n| **3\\. Podpora rozvoje klíčových kompetencí a základních gramotností** (které klíčové kompetence jsou v rozvíjeny) |\n| **4\\. Obsah vzdělávání** (rozpis učiva) |\n| **5\\. Vzdělávací strategie** (strategie výuky, resp. učební činnosti žáků, které jsou doporučené pro dosažení výsledků) |\n| |\n| **C. VÝSTUPNÍ ČÁST** |\n| **1\\. Způsob ověřování dosažených výsledků** (ve vazbě na jednotlivé výsledky učení) |\n| **2\\. Kritéria hodnocení** (co znamená splnění výsledků učení, kdy je splněna celá vyučovací jednotka, kritéria pro známky, příp. procentuální, slovní hodnocení) |\n| **3\\. Doporučená studijní literatura, odkazy na ilustrační zdroje** |\n| **4\\. Poznámky** |\n\n**Soulad OVU RVP a ŠVP**\n\nTento soulad je předmětem zjišťování. Soulad nastává, jestliže jsou očekávané výsledky učení z jednotlivých vzdělávacích oblastí RVP **obsaženy** ve vyučovacích předmětech/ vzdělávacích modulech ŠVP jednotlivých škol, tzn. že v ŠVP se objevuje jejich formulace buď v doslovném nebo podobném znění v jednom nebo více vyučovacích předmětech/ vzdělávacích modulech.\n\n_Příklad souladu:_\n\nRVP ŠVP - komunikace a marketing (SŠ obchodní Č.\n\n| **2** | **řídí realizaci jednoduchého projektu** |\n| --- | --- |\n| naplánuje aktivity projektu |\n| navrhne rozpočet projektu vzhledem k navrženým aktivitám |\n| stanoví základní ukazatele a sleduje jejich naplňování |\n| vede projektový tým |\n| uvede, jak by řešil krizové situace v projektu |\n| vyhodnotí úspěšnost projektu |\n\nKNOWLEDGE {Porovnání RVP a ŠVP - postup}\n\n\n# AUDITNÍ PROTOKOL ŠVP-RVP\n\n# (POPIS KONTROLNÍHO ALGORITMU)\n\nMetodika je určena pro **Kvantifikaci Shody** školního vzdělávacího programu (ŠVP) s Rámcovým vzdělávacím programem (RVP).\n\n## FÁZE 1: VALIDACE DOKUMENTACE\n\n**Cíl:** Ověřit platnost, aktuálnost a strukturu zdrojových dokumentů.\n\n- **RVP Verifikace:** Otevřít aktuální verzi RVP (např. RVP ZV/G/SOŠ).\n- **Typová shoda:** Ověřit, že RVP se vztahuje k danému typu školy.\n- **ŠVP Dimenze:** Identifikovat a izolovat relevantní části ŠVP: Profil absolventa, Klíčové kompetence (KK), Vzdělávací oblasti (VO), případně Učební plán (UP).\n- **Verzování:** Potvrdit, že obě verze (RVP a ŠVP) jsou nejnovější a platné (včetně dodatků RVP).\n\n## FÁZE 2: DATABÁZOVÉ MAPOVÁNÍ VÝSTUPŮ (MASTER MATICE)\n\n**Cíl:** Vytvořit systémovou databázi pro křížové porovnání všech povinných komponent RVP se ŠVP.\n\n- **Dekompozice RVP:** Rozložit RVP na základní povinné komponenty: Klíčové kompetence, Vzdělávací oblasti a obory, Očekávané výstupy (OVU), Průřezová témata (PT).\n- **Přiřazovací mapa:** Vytvořit hlavní kontrolní matici (Master Matice) pro záznam vazeb.\n\n| Oblast RVP | Výstup RVP (OVU) | Odpovídající Část ŠVP (Předmět/Ročník) | Konkrétní Tématický Celek v ŠVP | Stav Shody (Protokol) |\n| --- | --- | --- | --- | --- |\n| ... | ... | ... | ... | ... |\n| --- | --- | --- | --- | --- |\n\n## FÁZE 3: ALGORITMICKÁ KONTROLA POKRYTÍ A HLOUBKY\n\n**Cíl:** Posoudit, zda každý povinný výstup RVP je adekvátně reflektován v obsahu ŠVP, a přidělit bodovou hodnotu pro kvantifikaci.\n\n- **Audit OVU:** Projít každý jednotlivý Očekávaný výstup (OVU) z RVP.\n- **Kódování stavu a bodování:** U každého OVU v matici označit stav pokrytí dle následujícího schématu:\n\n| Kód (Protokol) | Popis (Kvalitativní zjištění) | Bodová hodnota (Kvantifikace) |\n| --- | --- | --- |\n| ✅ | Plná shoda (Výstup pokryt v plném rozsahu, odpovídající úrovni RVP) | 1,0 |\n| --- | --- | --- |\n| ⚠️ | Částečná shoda (Formální pokrytí, omezený rozsah, chybná návaznost) | 0,5 |\n| --- | --- | --- |\n| ❌ | Absence (Výstup zcela chybí v obsahu ŠVP) | 0,0 |\n| --- | --- | --- |\n\n- **Defektologie ŠVP:** Identifikovat a zaznamenat deficity ŠVP: Chybějící výstupy (❌), Sémantické překryvy, Přetížení obsahu.\n- **Kvalitativní posun:** Ověřit, zda je formulace výstupů v ŠVP **aktivní, měřitelná a v souladu** s úrovní RVP.\n\n## FÁZE 4: STRUKTURÁLNÍ VERIFIKACE NÁVAZNOSTI (VERTIKÁLA/HORIZONTÁLA)\n\n**Cíl:** Zkontrolovat logickou posloupnost a provázanost učiva v rámci ŠVP.\n\n- **Vertikální Kontrola:** Ověřit posloupnost OVU a učiva uvnitř jednoho předmětu/oblasti (postup od jednodušších ke složitějším konceptům napříč ročníky).\n- **Horizontální Kontrola:** Zkontrolovat logické provázání napříč vzdělávacími oblastmi a předměty (např. fyzika ↔ matematika).\n- **PT Integrace:** Audit reálné integrace Průřezových témat (PT) do konkrétních částí obsahu, metod a projektů.\n\n## FÁZE 5: ANALÝZA ŠKOLNÍ PROFILACE A ROZŠÍŘENÍ RVP\n\n**Cíl:** Validovat, že profilace školy je **v souladu** s RVP a nejedná se o **rozpor**.\n\n- **Nekonfliktnost:** Porovnat definovaný Profil absolventa školy s Klíčovými kompetencemi RVP. Profil ŠVP musí RVP rozvíjet, nikoli mu odporovat.\n- **Modularita:** Zkontrolovat, zda volitelné předměty a rozšiřující moduly logicky navazují na vzdělávací oblasti RVP.\n- **Implementace specializace:** Popisně uvést, jak je školní profilace (např. STEM zaměření, projektová výuka) integrována do OVU a kompetencí definovaných RVP.\n\n## FÁZE 6: GENERÁTOR ZÁVĚREČNÉ ZPRÁVY A KVANTIFIKACE\n\n**Cíl:** Syntetizovat výsledky, kvantifikovat soulad a generovat závazné návrhy na korekce.\n\n### 6.1 Kvantifikace Souladu\n\nVypočítat Index shody (IS) na základě bodového hodnocení (Fáze 3):\n\n### 6.2 Interpretace Indexu Shody (IS)\n\nKlasifikace souladu pro standardizované vyhodnocení:\n\n| Interval IS | Klasifikace souladu | Popis |\n| --- | --- | --- |\n| 95-100 % | Výborný soulad | ŠVP plně odpovídá RVP, pouze stylistické nebo formální rozdíly. |\n| --- | --- | --- |\n| 85-94 % | Dobrá shoda | ŠVP pokrývá všechny klíčové výstupy, menší korekce nutné. |\n| --- | --- | --- |\n| 70-84 % | Částečná shoda | Významné nedostatky v některých oblastech, nutná revize obsahu. |\n| --- | --- | --- |\n| < 70 % | Kritická neshoda | ŠVP neplní rámcové požadavky, ohrožuje legislativní soulad. |\n| --- | --- | --- |\n\n### 6.3 Doplňkové Indexy\n\nVypočítat následující doplňkové indexy pro detailní kvalitativní analýzu:\n\n- **Index kompetenčního souladu (IKS):** Poměr pokrytí klíčových kompetencí RVP v ŠVP.\n- **Index průřezové integrace (IPI):** Míra reálné integrace průřezových témat do výuky.\n- **Index hloubky pokrytí (IHP):** Procento výstupů, které jsou v ŠVP rozvedeny na konkrétní výukové cíle (měřitelné, aktivní formulace).\n- **Index profilové rozšiřitelnosti (IPR):** Kolik rozšiřujících nebo profilových výstupů přesahuje rámec RVP, aniž by narušily jeho strukturu.\n\n### 6.4 Vizuální výstupy\n\nZajistit generování následujících vizualizací pro Závěrečnou zprávu:\n\n- Graf pokrytí po vzdělávacích oblastech (Sloupcový graf IS pro VO).\n- Pavoukový diagram Klíčových kompetencí (RVP vs. ŠVP).\n- Mapa defektů (Vizualizace ❌ a ⚠️ výstupů).\n\n### 6.5 Struktura Závěrečné Zprávy\n\nZpráva musí být strukturována dle standardizovaného formátu:\n\n| Oddíl | Obsah |\n| --- | --- |\n| A. Identifikace | Název školy, IZO, typ školy, datum revize, zpracovatel, verze ŠVP a RVP. |\n| --- | --- |\n| B. Shrnutí výsledků | Celkový Index Shody (IS), hlavní závěry a doporučení. |\n| --- | --- |\n| C. Kvantitativní analýza | Přehled IS v % dle kategorií OVU / VO / kompetencí. |\n| --- | --- |\n| D. Kvalitativní analýza | Slovní zhodnocení kvality souladu (formulace, obtížnost, integrace PT). |\n| --- | --- |\n| E. Rizikové oblasti | Přehled nalezených defektů (chybějící OVU, přetížení, formální shoda). |\n| --- | --- |\n| F. Návrhy opatření (Korekční plán) | Přesné návrhy změn - **Co, Kde, Kdo** má upravit, včetně termínu. |\n| --- | --- |\n| G. Přílohy | Master Matice (Fáze 2-3), revizní tabulka, výstupní grafy a metriky. |\n| --- | --- |\n\n\n\n\n.",resultingParameterName:"result",dependentParameterNames:[]}],personas:[],preparations:[{id:1,promptbookVersion:"0.103.0-7",usage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"Asistent pro LŠVP\n\nPERSONA Jsi asistent pro RVP Lyceum v rámci Národního pedagogického institutu České Republiky\nMETA IMAGE https://edulk.cz/getFile/id:475818/type:large/02%20zna%C4%8Dka%20npi.jpg\nRULE Pokud jsi nejsi jistý, napiš nevím\nKNOWLEDGE ./241129_Lyceum_final.pdf\nCONTEXT Obecně dokážeš řešit libovolné ŠVP, aktuálně řešíš {Školní vzdělávací program LYCEUM}\nRULE Z {Porovnání RVP a ŠVP - postup} je nejdůležitější fáze 3\nKNOWLEDGE {Školní vzdělávací program LYCEUM} ./ŠVP Lyceum - Finance v digitální době.pdf\nKNOWLEDGE @Slovník\n\n**Interní slovník - RVP/ŠVP**\n\n**RVP**\n\nRámcový vzdělávací program pro obor vzdělání Lyceum je dokument na národní úrovni, který formuluje požadavky na školní vzdělávací programy ve formě především očekávaných výsledků učení, kterých mají žáci absolvováním tohoto programu na dané škole dosáhnout.\n\n**ŠVP**\n\nŠkolní vzdělávací program pro obor vzdělání Lyceum je dokument každé jednotlivé školy, který popisuje v jakých vyučovacích předmětech/ vzdělávacích modulech a v jakých ročnících budou požadované očekávané výsledky učení naplněny. Zároveň formuluje další očekávané výsledky učení, které naplňují disponibilní část vyučovacího času určeného RVP pro tento obor vzdělání.\n\n**Očekávaný výsledek učení (OVU)**\n\nVyjadřuje jednotlivý požadavek na to, co mají žáci umět na konci vzdělávacího programu, tzn. jejich požadované kompetence. Je vyjádřen formulací, která je uvozena činnostním slovesem a dále obsahuje předmět této činnosti. Formulace je konkretizována resp. doplněna zpravidla formou odrážek vymezením dílčích znalostí, dovedností, postojů, jejichž splnění je předpokladem dosažení OVU jako celku.\n\n_Příklad:_\n\n<div class=\"joplin-table-wrapper\"><table><tbody><tr><th><p><strong>Žák/žákyně řídí realizaci jednoduchého projektu</strong></p></th></tr><tr><td><ul><li>naplánuje aktivity projektu</li></ul></td></tr><tr><td><ul><li>navrhne rozpočet projektu vzhledem k navrženým aktivitám</li></ul></td></tr><tr><td><ul><li>stanoví základní ukazatele a sleduje jejich naplňování</li></ul></td></tr><tr><td><ul><li>vede projektový tým</li></ul></td></tr><tr><td><ul><li>uvede, jak by řešil krizové situace v projektu</li></ul></td></tr><tr><td><ul><li>vyhodnotí úspěšnost projektu</li></ul></td></tr></tbody></table></div>\n\n**Vzdělávací oblasti**\n\nOčekávané výsledky učení jsou v **_RVP členěny do 4 vzdělávacích oblastí_**, které tvoří společný všeobecně vzdělávací základ:\n\n- Osobnostní rozvoj, vzdělávání ke zdraví, bezpečí a produktivnímu pracovnímu životu (kariéře)\n- Komunikační a jazykové vzdělávání\n- Aplikované vzdělávání STEM (Science, Technology, Engeneering, Math), tj. přírodní vědy, informatika, technika, matematika\n- Prakticky orientované vzdělávání společenskovědní a humanitní\n\nKaždá vzdělávací oblast se dále člení na okruhy, v jejichž rámci jsou OVU samostatně číslované.\n\n<div class=\"joplin-table-wrapper\"><table><tbody><tr><th rowspan=\"21\"><ul><li>Prakticky orientované vzdělávání společenskovědní a humanitní</li></ul></th><th rowspan=\"21\"><p><strong>Člověk, ekonomie a podnikání</strong></p></th><th rowspan=\"7\"><p><strong>1</strong></p></th><th><p><strong>zpracuje podklady související s podnikáním</strong></p></th></tr><tr><td><p>připraví podnikatelský záměr</p></td></tr><tr><td><p>sestaví zakladatelský rozpočet</p></td></tr><tr><td><p>zkalkuluje cenu zboží nebo služby</p></td></tr><tr><td><p>vysvětlí na příkladu základní povinnosti podnikatele vůči státu a zaměstnancům</p></td></tr><tr><td><p>vede daňovou evidenci</p></td></tr><tr><td><p>vysvětlí na příkladech etiku v podnikání</p></td></tr><tr><td rowspan=\"7\"><p><strong>2</strong></p></td><td><p><strong>řídí realizaci jednoduchého projektu</strong></p></td></tr><tr><td><p>naplánuje aktivity projektu</p></td></tr><tr><td><p>navrhne rozpočet projektu vzhledem k navrženým aktivitám</p></td></tr><tr><td><p>stanoví základní ukazatele a sleduje jejich naplňování</p></td></tr><tr><td><p>vede projektový tým</p></td></tr><tr><td><p>uvede, jak by řešil krizové situace v projektu</p></td></tr><tr><td><p>vyhodnotí úspěšnost projektu</p></td></tr><tr><td rowspan=\"7\"><p><strong>3</strong></p></td><td><p><strong>aplikuje ekonomické teorie v osobním a profesním životě</strong></p></td></tr><tr><td><p>vysvětlí základní ekonomické otázky</p></td></tr><tr><td><p>vysvětí stanovení rovnovážné ceny na dokonalém i nedokonalém trhu</p></td></tr><tr><td><p>charakterizuje výrobní faktory a vysvětlí hranici produkčních možností a náklady obětované příležitosti</p></td></tr><tr><td><p>uvede nejdůležitější makroekonomické pojmy a vliv jejich výše na kvalitu života a podnikání v daném státě</p></td></tr><tr><td><p>vysvětlí podstatu inflace a její důsledky na finanční situaci obyvatel a na příkladu ukáže jak se bránit jejím nepříznivým důsledkům</p></td></tr><tr><td><p>uvede hlavní výhody a nevýhody mezinárodního obchodu a vliv ochranářských opatření na ekonomickou situaci dané země</p></td></tr><tr><td></td><td></td><td><p><strong>4</strong></p></td><td><p>Atd.</p></td></tr></tbody></table></div>\n\n**Vyučovací předmět / vzdělávací modul**\n\nOčekávané výsledky učení jsou v **ŠVP** členěny do vyučovacích předmětů nebo vzdělávacích modulů, které jsou dále zařazeny do jednoho nebo více ročníků 4letého studia. Vyučovací předmět / vzdělávací modul tvoří vyučovací jednotku, kde jsou očekávané výsledky učení dále rozpracovány pro potřeby výuky podle následující šablony\n\n| **A. VSTUPNÍ ČÁST** |\n| --- |\n| **1\\. Název** |\n| **2\\. Kód** (kódy by měly být navázány na obory vzdělání a výsledky učení) |\n| **2a) Kategorie vzdělání** - v případě, že nebude součástí kódu |\n| **3\\. Typ vyučovací jednotky** (modul, předmět, stáž apod.) |\n| **4\\. Délka** (počet hodin - dělitelný čtyřmi (optimální modul 16, 32 hodin = týden výuky) |\n| **5\\. Platnost** (datum, od kterého platí) |\n| **6\\. Vstupní předpoklady** (vymezení požadované úrovně vstupních vědomostí a dovedností, které jsou předpokladem úspěšného studia) |\n| |\n| **B. JÁDRO VYUČOVACÍ JEDNOTKY** |\n| **1\\. Charakteristika** (stručná anotace popisující obecné cíle a pojetí) |\n| **2\\. Očekávané výsledky učení a jejich indikátory (převzaté z RVP nebo dále konkretizované)** |\n| **3\\. Podpora rozvoje klíčových kompetencí a základních gramotností** (které klíčové kompetence jsou v rozvíjeny) |\n| **4\\. Obsah vzdělávání** (rozpis učiva) |\n| **5\\. Vzdělávací strategie** (strategie výuky, resp. učební činnosti žáků, které jsou doporučené pro dosažení výsledků) |\n| |\n| **C. VÝSTUPNÍ ČÁST** |\n| **1\\. Způsob ověřování dosažených výsledků** (ve vazbě na jednotlivé výsledky učení) |\n| **2\\. Kritéria hodnocení** (co znamená splnění výsledků učení, kdy je splněna celá vyučovací jednotka, kritéria pro známky, příp. procentuální, slovní hodnocení) |\n| **3\\. Doporučená studijní literatura, odkazy na ilustrační zdroje** |\n| **4\\. Poznámky** |\n\n**Soulad OVU RVP a ŠVP**\n\nTento soulad je předmětem zjišťování. Soulad nastává, jestliže jsou očekávané výsledky učení z jednotlivých vzdělávacích oblastí RVP **obsaženy** ve vyučovacích předmětech/ vzdělávacích modulech ŠVP jednotlivých škol, tzn. že v ŠVP se objevuje jejich formulace buď v doslovném nebo podobném znění v jednom nebo více vyučovacích předmětech/ vzdělávacích modulech.\n\n_Příklad souladu:_\n\nRVP ŠVP - komunikace a marketing (SŠ obchodní Č.\n\n| **2** | **řídí realizaci jednoduchého projektu** |\n| --- | --- |\n| naplánuje aktivity projektu |\n| navrhne rozpočet projektu vzhledem k navrženým aktivitám |\n| stanoví základní ukazatele a sleduje jejich naplňování |\n| vede projektový tým |\n| uvede, jak by řešil krizové situace v projektu |\n| vyhodnotí úspěšnost projektu |\n\nKNOWLEDGE {Porovnání RVP a ŠVP - postup}\n\n\n# AUDITNÍ PROTOKOL ŠVP-RVP\n\n# (POPIS KONTROLNÍHO ALGORITMU)\n\nMetodika je určena pro **Kvantifikaci Shody** školního vzdělávacího programu (ŠVP) s Rámcovým vzdělávacím programem (RVP).\n\n## FÁZE 1: VALIDACE DOKUMENTACE\n\n**Cíl:** Ověřit platnost, aktuálnost a strukturu zdrojových dokumentů.\n\n- **RVP Verifikace:** Otevřít aktuální verzi RVP (např. RVP ZV/G/SOŠ).\n- **Typová shoda:** Ověřit, že RVP se vztahuje k danému typu školy.\n- **ŠVP Dimenze:** Identifikovat a izolovat relevantní části ŠVP: Profil absolventa, Klíčové kompetence (KK), Vzdělávací oblasti (VO), případně Učební plán (UP).\n- **Verzování:** Potvrdit, že obě verze (RVP a ŠVP) jsou nejnovější a platné (včetně dodatků RVP).\n\n## FÁZE 2: DATABÁZOVÉ MAPOVÁNÍ VÝSTUPŮ (MASTER MATICE)\n\n**Cíl:** Vytvořit systémovou databázi pro křížové porovnání všech povinných komponent RVP se ŠVP.\n\n- **Dekompozice RVP:** Rozložit RVP na základní povinné komponenty: Klíčové kompetence, Vzdělávací oblasti a obory, Očekávané výstupy (OVU), Průřezová témata (PT).\n- **Přiřazovací mapa:** Vytvořit hlavní kontrolní matici (Master Matice) pro záznam vazeb.\n\n| Oblast RVP | Výstup RVP (OVU) | Odpovídající Část ŠVP (Předmět/Ročník) | Konkrétní Tématický Celek v ŠVP | Stav Shody (Protokol) |\n| --- | --- | --- | --- | --- |\n| ... | ... | ... | ... | ... |\n| --- | --- | --- | --- | --- |\n\n## FÁZE 3: ALGORITMICKÁ KONTROLA POKRYTÍ A HLOUBKY\n\n**Cíl:** Posoudit, zda každý povinný výstup RVP je adekvátně reflektován v obsahu ŠVP, a přidělit bodovou hodnotu pro kvantifikaci.\n\n- **Audit OVU:** Projít každý jednotlivý Očekávaný výstup (OVU) z RVP.\n- **Kódování stavu a bodování:** U každého OVU v matici označit stav pokrytí dle následujícího schématu:\n\n| Kód (Protokol) | Popis (Kvalitativní zjištění) | Bodová hodnota (Kvantifikace) |\n| --- | --- | --- |\n| ✅ | Plná shoda (Výstup pokryt v plném rozsahu, odpovídající úrovni RVP) | 1,0 |\n| --- | --- | --- |\n| ⚠️ | Částečná shoda (Formální pokrytí, omezený rozsah, chybná návaznost) | 0,5 |\n| --- | --- | --- |\n| ❌ | Absence (Výstup zcela chybí v obsahu ŠVP) | 0,0 |\n| --- | --- | --- |\n\n- **Defektologie ŠVP:** Identifikovat a zaznamenat deficity ŠVP: Chybějící výstupy (❌), Sémantické překryvy, Přetížení obsahu.\n- **Kvalitativní posun:** Ověřit, zda je formulace výstupů v ŠVP **aktivní, měřitelná a v souladu** s úrovní RVP.\n\n## FÁZE 4: STRUKTURÁLNÍ VERIFIKACE NÁVAZNOSTI (VERTIKÁLA/HORIZONTÁLA)\n\n**Cíl:** Zkontrolovat logickou posloupnost a provázanost učiva v rámci ŠVP.\n\n- **Vertikální Kontrola:** Ověřit posloupnost OVU a učiva uvnitř jednoho předmětu/oblasti (postup od jednodušších ke složitějším konceptům napříč ročníky).\n- **Horizontální Kontrola:** Zkontrolovat logické provázání napříč vzdělávacími oblastmi a předměty (např. fyzika ↔ matematika).\n- **PT Integrace:** Audit reálné integrace Průřezových témat (PT) do konkrétních částí obsahu, metod a projektů.\n\n## FÁZE 5: ANALÝZA ŠKOLNÍ PROFILACE A ROZŠÍŘENÍ RVP\n\n**Cíl:** Validovat, že profilace školy je **v souladu** s RVP a nejedná se o **rozpor**.\n\n- **Nekonfliktnost:** Porovnat definovaný Profil absolventa školy s Klíčovými kompetencemi RVP. Profil ŠVP musí RVP rozvíjet, nikoli mu odporovat.\n- **Modularita:** Zkontrolovat, zda volitelné předměty a rozšiřující moduly logicky navazují na vzdělávací oblasti RVP.\n- **Implementace specializace:** Popisně uvést, jak je školní profilace (např. STEM zaměření, projektová výuka) integrována do OVU a kompetencí definovaných RVP.\n\n## FÁZE 6: GENERÁTOR ZÁVĚREČNÉ ZPRÁVY A KVANTIFIKACE\n\n**Cíl:** Syntetizovat výsledky, kvantifikovat soulad a generovat závazné návrhy na korekce.\n\n### 6.1 Kvantifikace Souladu\n\nVypočítat Index shody (IS) na základě bodového hodnocení (Fáze 3):\n\n### 6.2 Interpretace Indexu Shody (IS)\n\nKlasifikace souladu pro standardizované vyhodnocení:\n\n| Interval IS | Klasifikace souladu | Popis |\n| --- | --- | --- |\n| 95-100 % | Výborný soulad | ŠVP plně odpovídá RVP, pouze stylistické nebo formální rozdíly. |\n| --- | --- | --- |\n| 85-94 % | Dobrá shoda | ŠVP pokrývá všechny klíčové výstupy, menší korekce nutné. |\n| --- | --- | --- |\n| 70-84 % | Částečná shoda | Významné nedostatky v některých oblastech, nutná revize obsahu. |\n| --- | --- | --- |\n| < 70 % | Kritická neshoda | ŠVP neplní rámcové požadavky, ohrožuje legislativní soulad. |\n| --- | --- | --- |\n\n### 6.3 Doplňkové Indexy\n\nVypočítat následující doplňkové indexy pro detailní kvalitativní analýzu:\n\n- **Index kompetenčního souladu (IKS):** Poměr pokrytí klíčových kompetencí RVP v ŠVP.\n- **Index průřezové integrace (IPI):** Míra reálné integrace průřezových témat do výuky.\n- **Index hloubky pokrytí (IHP):** Procento výstupů, které jsou v ŠVP rozvedeny na konkrétní výukové cíle (měřitelné, aktivní formulace).\n- **Index profilové rozšiřitelnosti (IPR):** Kolik rozšiřujících nebo profilových výstupů přesahuje rámec RVP, aniž by narušily jeho strukturu.\n\n### 6.4 Vizuální výstupy\n\nZajistit generování následujících vizualizací pro Závěrečnou zprávu:\n\n- Graf pokrytí po vzdělávacích oblastech (Sloupcový graf IS pro VO).\n- Pavoukový diagram Klíčových kompetencí (RVP vs. ŠVP).\n- Mapa defektů (Vizualizace ❌ a ⚠️ výstupů).\n\n### 6.5 Struktura Závěrečné Zprávy\n\nZpráva musí být strukturována dle standardizovaného formátu:\n\n| Oddíl | Obsah |\n| --- | --- |\n| A. Identifikace | Název školy, IZO, typ školy, datum revize, zpracovatel, verze ŠVP a RVP. |\n| --- | --- |\n| B. Shrnutí výsledků | Celkový Index Shody (IS), hlavní závěry a doporučení. |\n| --- | --- |\n| C. Kvantitativní analýza | Přehled IS v % dle kategorií OVU / VO / kompetencí. |\n| --- | --- |\n| D. Kvalitativní analýza | Slovní zhodnocení kvality souladu (formulace, obtížnost, integrace PT). |\n| --- | --- |\n| E. Rizikové oblasti | Přehled nalezených defektů (chybějící OVU, přetížení, formální shoda). |\n| --- | --- |\n| F. Návrhy opatření (Korekční plán) | Přesné návrhy změn - **Co, Kde, Kdo** má upravit, včetně termínu. |\n| --- | --- |\n| G. Přílohy | Master Matice (Fáze 2-3), revizní tabulka, výstupní grafy a metriky. |\n| --- | --- |\n\n\n\n\n.\n"}],sourceFile:"./books/examples/lsvp-asistent.book"}];
1827
+ var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book",formfactorName:"GENERIC",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge from Markdown\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book`\n- INPUT PARAMETER `{knowledgeContent}` Markdown document content\n- OUTPUT PARAMETER `{knowledgePieces}` The knowledge JSON object\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}\n```\n\n`-> {knowledgePieces}`\n"}],sourceFile:"./books/prepare-knowledge-from-markdown.book"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Keywords\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-keywords.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{keywords}` Keywords separated by comma\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}\n```\n\n`-> {keywords}`\n"}],sourceFile:"./books/prepare-knowledge-keywords.book"},{title:"Prepare Knowledge-piece Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge-piece Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-title.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{title}` The title of the document\n\n## Knowledge\n\n- EXPECT MIN 1 WORD\n- EXPECT MAX 8 WORDS\n\n```markdown\nYou are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-knowledge-title.book"},{title:"Prepare Persona",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.book",formfactorName:"GENERIC",parameters:[{name:"availableModels",description:"List of available model names together with their descriptions as JSON",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelsRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-model-requirements",title:"Make modelRequirements",content:"You are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n```json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n```\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n```json\n{availableModels}\n```\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",resultingParameterName:"modelsRequirements",format:"JSON",dependentParameterNames:["availableModels","personaDescription"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Persona\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-persona.book`\n- INPUT PARAMETER `{availableModels}` List of available model names together with their descriptions as JSON\n- INPUT PARAMETER `{personaDescription}` Description of the persona\n- OUTPUT PARAMETER `{modelsRequirements}` Specific requirements for the model\n\n## Make modelRequirements\n\n- FORMAT JSON\n\n```markdown\nYou are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n\\`\\`\\`json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n\\`\\`\\`\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n\\`\\`\\`json\n{availableModels}\n\\`\\`\\`\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}\n```\n\n`-> {modelsRequirements}`\n"}],sourceFile:"./books/prepare-persona.book"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-title.book",formfactorName:"GENERIC",parameters:[{name:"book",description:"The book to prepare the title for",isInput:true,isOutput:false},{name:"title",description:"Best title for the book",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-title",title:"Make title",content:"Make best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}",resultingParameterName:"title",expectations:{words:{min:1,max:8},lines:{min:1,max:1}},dependentParameterNames:["book"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-title.book`\n- INPUT PARAMETER `{book}` The book to prepare the title for\n- OUTPUT PARAMETER `{title}` Best title for the book\n\n## Make title\n\n- EXPECT MIN 1 Word\n- EXPECT MAX 8 Words\n- EXPECT EXACTLY 1 Line\n\n```markdown\nMake best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-title.book"}];
1820
1828
 
1821
1829
  /**
1822
1830
  * Checks if value is valid email
@@ -1858,7 +1866,7 @@
1858
1866
  constructor(whatWasThrown) {
1859
1867
  const tag = `[🤮]`;
1860
1868
  console.error(tag, whatWasThrown);
1861
- super(spaceTrim.spaceTrim(`
1869
+ super(spaceTrim$1.spaceTrim(`
1862
1870
  Non-Error object was thrown
1863
1871
 
1864
1872
  Note: Look for ${tag} in the console for more details
@@ -1923,6 +1931,8 @@
1923
1931
  * Function `validatePipelineString` will validate the if the string is a valid pipeline string
1924
1932
  * It does not check if the string is fully logically correct, but if it is a string that can be a pipeline string or the string looks completely different.
1925
1933
  *
1934
+ * Note: [🔂] This function is idempotent.
1935
+ *
1926
1936
  * @param {string} pipelineString the candidate for a pipeline string
1927
1937
  * @returns {PipelineString} the same string as input, but validated as valid
1928
1938
  * @throws {ParseError} if the string is not a valid pipeline string
@@ -2307,7 +2317,7 @@
2307
2317
  TODO: [🧠] Is there a better implementation?
2308
2318
  > const propertyNames = Object.getOwnPropertyNames(objectValue);
2309
2319
  > for (const propertyName of propertyNames) {
2310
- > const value = (objectValue as really_any)[propertyName];
2320
+ > const value = (objectValue as chococake)[propertyName];
2311
2321
  > if (value && typeof value === 'object') {
2312
2322
  > deepClone(value);
2313
2323
  > }
@@ -2512,6 +2522,8 @@
2512
2522
  * - if it is valid json
2513
2523
  * - if it is meaningful
2514
2524
  *
2525
+ * Note: [🔂] This function is idempotent.
2526
+ *
2515
2527
  * @param pipeline valid or invalid PipelineJson
2516
2528
  * @returns the same pipeline if it is logically valid
2517
2529
  * @throws {PipelineLogicError} on logical error in the pipeline
@@ -2529,7 +2541,7 @@
2529
2541
  if (!(error instanceof PipelineLogicError)) {
2530
2542
  throw error;
2531
2543
  }
2532
- console.error(spaceTrim.spaceTrim((block) => `
2544
+ console.error(spaceTrim$1.spaceTrim((block) => `
2533
2545
  Pipeline is not valid but logic errors are temporarily disabled via \`IS_PIPELINE_LOGIC_VALIDATED\`
2534
2546
 
2535
2547
  ${block(error.message)}
@@ -2556,7 +2568,7 @@
2556
2568
  })();
2557
2569
  if (pipeline.pipelineUrl !== undefined && !isValidPipelineUrl(pipeline.pipelineUrl)) {
2558
2570
  // <- Note: [🚲]
2559
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2571
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2560
2572
  Invalid promptbook URL "${pipeline.pipelineUrl}"
2561
2573
 
2562
2574
  ${block(pipelineIdentification)}
@@ -2564,7 +2576,7 @@
2564
2576
  }
2565
2577
  if (pipeline.bookVersion !== undefined && !isValidPromptbookVersion(pipeline.bookVersion)) {
2566
2578
  // <- Note: [🚲]
2567
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2579
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2568
2580
  Invalid Promptbook Version "${pipeline.bookVersion}"
2569
2581
 
2570
2582
  ${block(pipelineIdentification)}
@@ -2573,7 +2585,7 @@
2573
2585
  // TODO: [🧠] Maybe do here some proper JSON-schema / ZOD checking
2574
2586
  if (!Array.isArray(pipeline.parameters)) {
2575
2587
  // TODO: [🧠] what is the correct error tp throw - maybe PromptbookSchemaError
2576
- throw new ParseError(spaceTrim.spaceTrim((block) => `
2588
+ throw new ParseError(spaceTrim$1.spaceTrim((block) => `
2577
2589
  Pipeline is valid JSON but with wrong structure
2578
2590
 
2579
2591
  \`PipelineJson.parameters\` expected to be an array, but got ${typeof pipeline.parameters}
@@ -2584,7 +2596,7 @@
2584
2596
  // TODO: [🧠] Maybe do here some proper JSON-schema / ZOD checking
2585
2597
  if (!Array.isArray(pipeline.tasks)) {
2586
2598
  // TODO: [🧠] what is the correct error tp throw - maybe PromptbookSchemaError
2587
- throw new ParseError(spaceTrim.spaceTrim((block) => `
2599
+ throw new ParseError(spaceTrim$1.spaceTrim((block) => `
2588
2600
  Pipeline is valid JSON but with wrong structure
2589
2601
 
2590
2602
  \`PipelineJson.tasks\` expected to be an array, but got ${typeof pipeline.tasks}
@@ -2610,7 +2622,7 @@
2610
2622
  // Note: Check each parameter individually
2611
2623
  for (const parameter of pipeline.parameters) {
2612
2624
  if (parameter.isInput && parameter.isOutput) {
2613
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2625
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2614
2626
 
2615
2627
  Parameter \`{${parameter.name}}\` can not be both input and output
2616
2628
 
@@ -2621,7 +2633,7 @@
2621
2633
  if (!parameter.isInput &&
2622
2634
  !parameter.isOutput &&
2623
2635
  !pipeline.tasks.some((task) => task.dependentParameterNames.includes(parameter.name))) {
2624
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2636
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2625
2637
  Parameter \`{${parameter.name}}\` is created but not used
2626
2638
 
2627
2639
  You can declare {${parameter.name}} as output parameter by adding in the header:
@@ -2633,7 +2645,7 @@
2633
2645
  }
2634
2646
  // Note: Testing that parameter is either input or result of some task
2635
2647
  if (!parameter.isInput && !pipeline.tasks.some((task) => task.resultingParameterName === parameter.name)) {
2636
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2648
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2637
2649
  Parameter \`{${parameter.name}}\` is declared but not defined
2638
2650
 
2639
2651
  You can do one of these:
@@ -2649,14 +2661,14 @@
2649
2661
  // Note: Checking each task individually
2650
2662
  for (const task of pipeline.tasks) {
2651
2663
  if (definedParameters.has(task.resultingParameterName)) {
2652
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2664
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2653
2665
  Parameter \`{${task.resultingParameterName}}\` is defined multiple times
2654
2666
 
2655
2667
  ${block(pipelineIdentification)}
2656
2668
  `));
2657
2669
  }
2658
2670
  if (RESERVED_PARAMETER_NAMES.includes(task.resultingParameterName)) {
2659
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2671
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2660
2672
  Parameter name {${task.resultingParameterName}} is reserved, please use different name
2661
2673
 
2662
2674
  ${block(pipelineIdentification)}
@@ -2666,7 +2678,7 @@
2666
2678
  if (task.jokerParameterNames && task.jokerParameterNames.length > 0) {
2667
2679
  if (!task.format &&
2668
2680
  !task.expectations /* <- TODO: Require at least 1 -> min <- expectation to use jokers */) {
2669
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2681
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2670
2682
  Joker parameters are used for {${task.resultingParameterName}} but no expectations are defined
2671
2683
 
2672
2684
  ${block(pipelineIdentification)}
@@ -2674,7 +2686,7 @@
2674
2686
  }
2675
2687
  for (const joker of task.jokerParameterNames) {
2676
2688
  if (!task.dependentParameterNames.includes(joker)) {
2677
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2689
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2678
2690
  Parameter \`{${joker}}\` is used for {${task.resultingParameterName}} as joker but not in \`dependentParameterNames\`
2679
2691
 
2680
2692
  ${block(pipelineIdentification)}
@@ -2685,21 +2697,21 @@
2685
2697
  if (task.expectations) {
2686
2698
  for (const [unit, { min, max }] of Object.entries(task.expectations)) {
2687
2699
  if (min !== undefined && max !== undefined && min > max) {
2688
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2700
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2689
2701
  Min expectation (=${min}) of ${unit} is higher than max expectation (=${max})
2690
2702
 
2691
2703
  ${block(pipelineIdentification)}
2692
2704
  `));
2693
2705
  }
2694
2706
  if (min !== undefined && min < 0) {
2695
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2707
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2696
2708
  Min expectation of ${unit} must be zero or positive
2697
2709
 
2698
2710
  ${block(pipelineIdentification)}
2699
2711
  `));
2700
2712
  }
2701
2713
  if (max !== undefined && max <= 0) {
2702
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2714
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2703
2715
  Max expectation of ${unit} must be positive
2704
2716
 
2705
2717
  ${block(pipelineIdentification)}
@@ -2721,7 +2733,7 @@
2721
2733
  while (unresovedTasks.length > 0) {
2722
2734
  if (loopLimit-- < 0) {
2723
2735
  // Note: Really UnexpectedError not LimitReachedError - this should not happen and be caught below
2724
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
2736
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
2725
2737
  Loop limit reached during detection of circular dependencies in \`validatePipeline\`
2726
2738
 
2727
2739
  ${block(pipelineIdentification)}
@@ -2731,7 +2743,7 @@
2731
2743
  if (currentlyResovedTasks.length === 0) {
2732
2744
  throw new PipelineLogicError(
2733
2745
  // TODO: [🐎] DRY
2734
- spaceTrim.spaceTrim((block) => `
2746
+ spaceTrim$1.spaceTrim((block) => `
2735
2747
 
2736
2748
  Can not resolve some parameters:
2737
2749
  Either you are using a parameter that is not defined, or there are some circular dependencies.
@@ -2878,7 +2890,7 @@
2878
2890
  * Library of pipelines that groups together pipelines for an application.
2879
2891
  * This implementation is a very thin wrapper around the Array / Map of pipelines.
2880
2892
  *
2881
- * @private internal function of `createCollectionFromJson`, use `createCollectionFromJson` instead
2893
+ * @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
2882
2894
  * @see https://github.com/webgptorg/pipeline#pipeline-collection
2883
2895
  */
2884
2896
  class SimplePipelineCollection {
@@ -2888,14 +2900,14 @@
2888
2900
  * @param pipelines Array of pipeline JSON objects to include in the collection
2889
2901
  *
2890
2902
  * Note: During the construction logic of all pipelines are validated
2891
- * Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
2903
+ * Note: It is not recommended to use this constructor directly, use `createPipelineCollectionFromJson` *(or other variant)* instead
2892
2904
  */
2893
2905
  constructor(...pipelines) {
2894
2906
  this.collection = new Map();
2895
2907
  for (const pipeline of pipelines) {
2896
2908
  // TODO: [👠] DRY
2897
2909
  if (pipeline.pipelineUrl === undefined) {
2898
- throw new PipelineUrlError(spaceTrim.spaceTrim(`
2910
+ throw new PipelineUrlError(spaceTrim$1.spaceTrim(`
2899
2911
  Pipeline with name "${pipeline.title}" does not have defined URL
2900
2912
 
2901
2913
  File:
@@ -2917,7 +2929,7 @@
2917
2929
  pipelineJsonToString(unpreparePipeline(pipeline)) !==
2918
2930
  pipelineJsonToString(unpreparePipeline(this.collection.get(pipeline.pipelineUrl)))) {
2919
2931
  const existing = this.collection.get(pipeline.pipelineUrl);
2920
- throw new PipelineUrlError(spaceTrim.spaceTrim(`
2932
+ throw new PipelineUrlError(spaceTrim$1.spaceTrim(`
2921
2933
  Pipeline with URL ${pipeline.pipelineUrl} is already in the collection 🍎
2922
2934
 
2923
2935
  Conflicting files:
@@ -2949,13 +2961,13 @@
2949
2961
  const pipeline = this.collection.get(url);
2950
2962
  if (!pipeline) {
2951
2963
  if (this.listPipelines().length === 0) {
2952
- throw new NotFoundError(spaceTrim.spaceTrim(`
2964
+ throw new NotFoundError(spaceTrim$1.spaceTrim(`
2953
2965
  Pipeline with url "${url}" not found
2954
2966
 
2955
2967
  No pipelines available
2956
2968
  `));
2957
2969
  }
2958
- throw new NotFoundError(spaceTrim.spaceTrim((block) => `
2970
+ throw new NotFoundError(spaceTrim$1.spaceTrim((block) => `
2959
2971
  Pipeline with url "${url}" not found
2960
2972
 
2961
2973
  Available pipelines:
@@ -2976,16 +2988,16 @@
2976
2988
  }
2977
2989
 
2978
2990
  /**
2979
- * Creates PipelineCollection from array of PipelineJson or PipelineString
2991
+ * Creates `PipelineCollection` from array of PipelineJson or PipelineString
2980
2992
  *
2981
- * Note: Functions `collectionToJson` and `createCollectionFromJson` are complementary
2993
+ * Note: Functions `pipelineCollectionToJson` and `createPipelineCollectionFromJson` are complementary
2982
2994
  * Note: Syntax, parsing, and logic consistency checks are performed on all sources during build
2983
2995
  *
2984
2996
  * @param promptbookSources
2985
2997
  * @returns PipelineCollection
2986
2998
  * @public exported from `@promptbook/core`
2987
2999
  */
2988
- function createCollectionFromJson(...promptbooks) {
3000
+ function createPipelineCollectionFromJson(...promptbooks) {
2989
3001
  return new SimplePipelineCollection(...promptbooks);
2990
3002
  }
2991
3003
 
@@ -2996,7 +3008,7 @@
2996
3008
  */
2997
3009
  class MissingToolsError extends Error {
2998
3010
  constructor(message) {
2999
- super(spaceTrim.spaceTrim((block) => `
3011
+ super(spaceTrim$1.spaceTrim((block) => `
3000
3012
  ${block(message)}
3001
3013
 
3002
3014
  Note: You have probably forgot to provide some tools for pipeline execution or preparation
@@ -3010,6 +3022,7 @@
3010
3022
  /**
3011
3023
  * Generates random token
3012
3024
  *
3025
+ * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
3013
3026
  * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
3014
3027
  *
3015
3028
  * @private internal helper function
@@ -3019,6 +3032,7 @@
3019
3032
  return crypto.randomBytes(randomness).toString('hex');
3020
3033
  }
3021
3034
  /**
3035
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
3022
3036
  * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
3023
3037
  */
3024
3038
 
@@ -3137,6 +3151,22 @@
3137
3151
  }
3138
3152
  }
3139
3153
 
3154
+ /**
3155
+ * This error indicates error from the database
3156
+ *
3157
+ * @public exported from `@promptbook/core`
3158
+ */
3159
+ class DatabaseError extends Error {
3160
+ constructor(message) {
3161
+ super(message);
3162
+ this.name = 'DatabaseError';
3163
+ Object.setPrototypeOf(this, DatabaseError.prototype);
3164
+ }
3165
+ }
3166
+ /**
3167
+ * TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
3168
+ */
3169
+
3140
3170
  /**
3141
3171
  * This error occurs when some expectation is not met in the execution of the pipeline
3142
3172
  *
@@ -3166,6 +3196,19 @@
3166
3196
  }
3167
3197
  }
3168
3198
 
3199
+ /**
3200
+ * This error indicates that promptbook operation is not allowed
3201
+ *
3202
+ * @public exported from `@promptbook/core`
3203
+ */
3204
+ class NotAllowed extends Error {
3205
+ constructor(message) {
3206
+ super(message);
3207
+ this.name = 'NotAllowed';
3208
+ Object.setPrototypeOf(this, NotAllowed.prototype);
3209
+ }
3210
+ }
3211
+
3169
3212
  /**
3170
3213
  * This error type indicates that some part of the code is not implemented yet
3171
3214
  *
@@ -3173,7 +3216,7 @@
3173
3216
  */
3174
3217
  class NotYetImplementedError extends Error {
3175
3218
  constructor(message) {
3176
- super(spaceTrim.spaceTrim((block) => `
3219
+ super(spaceTrim$1.spaceTrim((block) => `
3177
3220
  ${block(message)}
3178
3221
 
3179
3222
  Note: This feature is not implemented yet but it will be soon.
@@ -3226,6 +3269,8 @@
3226
3269
  PromptbookFetchError,
3227
3270
  UnexpectedError,
3228
3271
  WrappedError,
3272
+ NotAllowed,
3273
+ DatabaseError,
3229
3274
  // TODO: [🪑]> VersionMismatchError,
3230
3275
  };
3231
3276
  /**
@@ -3410,11 +3455,11 @@
3410
3455
  throw deserializeError(errors[0]);
3411
3456
  }
3412
3457
  else {
3413
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
3458
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
3414
3459
  Multiple errors occurred during Promptbook execution
3415
3460
 
3416
3461
  ${block(errors
3417
- .map(({ name, stack, message }, index) => spaceTrim.spaceTrim((block) => `
3462
+ .map(({ name, stack, message }, index) => spaceTrim$1.spaceTrim((block) => `
3418
3463
  ${name} ${index + 1}:
3419
3464
  ${block(stack || message)}
3420
3465
  `))
@@ -3441,6 +3486,7 @@
3441
3486
  let updatedAt = createdAt;
3442
3487
  const errors = [];
3443
3488
  const warnings = [];
3489
+ const llmCalls = [];
3444
3490
  let currentValue = {};
3445
3491
  let customTldr = null;
3446
3492
  const partialResultSubject = new rxjs.Subject();
@@ -3456,6 +3502,9 @@
3456
3502
  }, (tldrInfo) => {
3457
3503
  customTldr = tldrInfo;
3458
3504
  updatedAt = new Date();
3505
+ }, (llmCall) => {
3506
+ llmCalls.push(llmCall);
3507
+ updatedAt = new Date();
3459
3508
  });
3460
3509
  finalResultPromise
3461
3510
  .catch((error) => {
@@ -3578,7 +3627,7 @@
3578
3627
  }
3579
3628
  return {
3580
3629
  percent: percent,
3581
- message,
3630
+ message: message + ' (!!!fallback)',
3582
3631
  };
3583
3632
  },
3584
3633
  get createdAt() {
@@ -3601,6 +3650,10 @@
3601
3650
  return warnings;
3602
3651
  // <- Note: [1] --||--
3603
3652
  },
3653
+ get llmCalls() {
3654
+ return [...llmCalls, { foo: '!!! bar' }];
3655
+ // <- Note: [1] --||--
3656
+ },
3604
3657
  get currentValue() {
3605
3658
  return currentValue;
3606
3659
  // <- Note: [1] --||--
@@ -4054,6 +4107,7 @@
4054
4107
  return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
4055
4108
  }
4056
4109
  /**
4110
+ * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4057
4111
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
4058
4112
  */
4059
4113
 
@@ -4070,6 +4124,7 @@
4070
4124
  return llmTools;
4071
4125
  }
4072
4126
  /**
4127
+ * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4073
4128
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
4074
4129
  */
4075
4130
 
@@ -4085,7 +4140,7 @@
4085
4140
  throw new MissingToolsError('LLM tools are required for preparing persona');
4086
4141
  }
4087
4142
  // TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
4088
- const collection = createCollectionFromJson(...PipelineCollection);
4143
+ const collection = createPipelineCollectionFromJson(...PipelineCollection);
4089
4144
  const preparePersonaExecutor = createPipelineExecutor({
4090
4145
  pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-persona.book'),
4091
4146
  tools,
@@ -4803,7 +4858,7 @@
4803
4858
  if (task.taskType === 'PROMPT_TASK' &&
4804
4859
  knowledgePiecesCount > 0 &&
4805
4860
  !dependentParameterNames.includes('knowledge')) {
4806
- preparedContent = spaceTrim.spaceTrim(`
4861
+ preparedContent = spaceTrim$1.spaceTrim(`
4807
4862
  {content}
4808
4863
 
4809
4864
  ## Knowledge
@@ -4889,7 +4944,7 @@
4889
4944
  let title = pipeline.title;
4890
4945
  if (title === undefined || title === '' || title === DEFAULT_BOOK_TITLE) {
4891
4946
  // TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
4892
- const collection = createCollectionFromJson(...PipelineCollection);
4947
+ const collection = createPipelineCollectionFromJson(...PipelineCollection);
4893
4948
  const prepareTitleExecutor = createPipelineExecutor({
4894
4949
  pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-title.book'),
4895
4950
  tools,
@@ -5116,7 +5171,7 @@
5116
5171
  }
5117
5172
  catch (error) {
5118
5173
  assertsError(error);
5119
- throw new ParseError(spaceTrim.spaceTrim((block) => `
5174
+ throw new ParseError(spaceTrim$1.spaceTrim((block) => `
5120
5175
  Can not extract variables from the script
5121
5176
  ${block(error.stack || error.message)}
5122
5177
 
@@ -5801,10 +5856,13 @@
5801
5856
  * @public exported from `@promptbook/utils`
5802
5857
  */
5803
5858
  function countLines(text) {
5859
+ if (text === '') {
5860
+ return 0;
5861
+ }
5804
5862
  text = text.replace('\r\n', '\n');
5805
5863
  text = text.replace('\r', '\n');
5806
5864
  const lines = text.split('\n');
5807
- return lines.reduce((count, line) => count + Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 0);
5865
+ return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
5808
5866
  }
5809
5867
  /**
5810
5868
  * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
@@ -5929,6 +5987,8 @@
5929
5987
  * This function provides a common abstraction for result validation that can be used
5930
5988
  * by both execution logic and caching logic to ensure consistency.
5931
5989
  *
5990
+ * Note: [🔂] This function is idempotent.
5991
+ *
5932
5992
  * @param options - The validation options including result string, expectations, and format
5933
5993
  * @returns Validation result with processed string and validity status
5934
5994
  * @private internal function of `createPipelineExecutor` and `cacheLlmTools`
@@ -5948,7 +6008,7 @@
5948
6008
  }
5949
6009
  catch (error) {
5950
6010
  keepUnused(error);
5951
- throw new ExpectError(spaceTrim.spaceTrim((block) => `
6011
+ throw new ExpectError(spaceTrim$1.spaceTrim((block) => `
5952
6012
  Expected valid JSON string
5953
6013
 
5954
6014
  The expected JSON text:
@@ -5997,7 +6057,7 @@
5997
6057
  */
5998
6058
  async function executeAttempts(options) {
5999
6059
  const { jokerParameterNames, priority, maxAttempts, // <- Note: [💂]
6000
- preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, } = options;
6060
+ preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, logLlmCall, } = options;
6001
6061
  const $ongoingTaskResult = {
6002
6062
  $result: null,
6003
6063
  $resultString: null,
@@ -6011,7 +6071,7 @@
6011
6071
  const jokerParameterName = jokerParameterNames[jokerParameterNames.length + attemptIndex];
6012
6072
  // TODO: [🧠][🍭] JOKERS, EXPECTATIONS, POSTPROCESSING and FOREACH
6013
6073
  if (isJokerAttempt && !jokerParameterName) {
6014
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6074
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6015
6075
  Joker not found in attempt ${attemptIndex}
6016
6076
 
6017
6077
  ${block(pipelineIdentification)}
@@ -6022,7 +6082,7 @@
6022
6082
  $ongoingTaskResult.$expectError = null;
6023
6083
  if (isJokerAttempt) {
6024
6084
  if (parameters[jokerParameterName] === undefined) {
6025
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6085
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6026
6086
  Joker parameter {${jokerParameterName}} not defined
6027
6087
 
6028
6088
  ${block(pipelineIdentification)}
@@ -6080,7 +6140,7 @@
6080
6140
  $ongoingTaskResult.$resultString = $ongoingTaskResult.$completionResult.content;
6081
6141
  break variant;
6082
6142
  case 'EMBEDDING':
6083
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6143
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6084
6144
  Embedding model can not be used in pipeline
6085
6145
 
6086
6146
  This should be catched during parsing
@@ -6091,7 +6151,7 @@
6091
6151
  break variant;
6092
6152
  // <- case [🤖]:
6093
6153
  default:
6094
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6154
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6095
6155
  Unknown model variant "${task.modelRequirements.modelVariant}"
6096
6156
 
6097
6157
  ${block(pipelineIdentification)}
@@ -6102,14 +6162,14 @@
6102
6162
  break;
6103
6163
  case 'SCRIPT_TASK':
6104
6164
  if (arrayableToArray(tools.script).length === 0) {
6105
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6165
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6106
6166
  No script execution tools are available
6107
6167
 
6108
6168
  ${block(pipelineIdentification)}
6109
6169
  `));
6110
6170
  }
6111
6171
  if (!task.contentLanguage) {
6112
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6172
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6113
6173
  Script language is not defined for SCRIPT TASK "${task.name}"
6114
6174
 
6115
6175
  ${block(pipelineIdentification)}
@@ -6140,7 +6200,7 @@
6140
6200
  throw $ongoingTaskResult.$scriptPipelineExecutionErrors[0];
6141
6201
  }
6142
6202
  else {
6143
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6203
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6144
6204
  Script execution failed ${$ongoingTaskResult.$scriptPipelineExecutionErrors.length}x
6145
6205
 
6146
6206
  ${block(pipelineIdentification)}
@@ -6154,7 +6214,7 @@
6154
6214
  break taskType;
6155
6215
  case 'DIALOG_TASK':
6156
6216
  if (tools.userInterface === undefined) {
6157
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6217
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6158
6218
  User interface tools are not available
6159
6219
 
6160
6220
  ${block(pipelineIdentification)}
@@ -6172,7 +6232,7 @@
6172
6232
  break taskType;
6173
6233
  // <- case: [🅱]
6174
6234
  default:
6175
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6235
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6176
6236
  Unknown execution type "${task.taskType}"
6177
6237
 
6178
6238
  ${block(pipelineIdentification)}
@@ -6245,14 +6305,10 @@
6245
6305
  });
6246
6306
  }
6247
6307
  finally {
6248
- if (!isJokerAttempt &&
6249
- task.taskType === 'PROMPT_TASK' &&
6250
- $ongoingTaskResult.$prompt
6251
- // <- Note: [2] When some expected parameter is not defined, error will occur in templateParameters
6252
- // In that case we don’t want to make a report about it because it’s not a llm execution error
6253
- ) {
6254
- // TODO: [🧠] Maybe put other taskTypes into report
6255
- $executionReport.promptExecutions.push({
6308
+ if (!isJokerAttempt && task.taskType === 'PROMPT_TASK' && $ongoingTaskResult.$prompt) {
6309
+ // Note: [2] When some expected parameter is not defined, error will occur in templateParameters
6310
+ // In that case we don’t want to make a report about it because it’s not a llm execution error
6311
+ const executionPromptReport = {
6256
6312
  prompt: {
6257
6313
  ...$ongoingTaskResult.$prompt,
6258
6314
  // <- TODO: [🧠] How to pick everyhing except `pipelineUrl`
@@ -6261,13 +6317,20 @@
6261
6317
  error: $ongoingTaskResult.$expectError === null
6262
6318
  ? undefined
6263
6319
  : serializeError($ongoingTaskResult.$expectError),
6264
- });
6320
+ };
6321
+ $executionReport.promptExecutions.push(executionPromptReport);
6322
+ if (logLlmCall) {
6323
+ logLlmCall({
6324
+ modelName: 'model' /* <- TODO: How to get model name from the report */,
6325
+ report: executionPromptReport,
6326
+ });
6327
+ }
6265
6328
  }
6266
6329
  }
6267
6330
  if ($ongoingTaskResult.$expectError !== null && attemptIndex === maxAttempts - 1) {
6268
6331
  // Note: Create a summary of all failures
6269
6332
  const failuresSummary = $ongoingTaskResult.$failedResults
6270
- .map((failure) => spaceTrim.spaceTrim((block) => {
6333
+ .map((failure) => spaceTrim$1.spaceTrim((block) => {
6271
6334
  var _a, _b;
6272
6335
  return `
6273
6336
  Attempt ${failure.attemptIndex + 1}:
@@ -6277,14 +6340,14 @@
6277
6340
  Result:
6278
6341
  ${block(failure.result === null
6279
6342
  ? 'null'
6280
- : spaceTrim.spaceTrim(failure.result)
6343
+ : spaceTrim$1.spaceTrim(failure.result)
6281
6344
  .split('\n')
6282
6345
  .map((line) => `> ${line}`)
6283
6346
  .join('\n'))}
6284
6347
  `;
6285
6348
  }))
6286
6349
  .join('\n\n---\n\n');
6287
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => {
6350
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => {
6288
6351
  var _a;
6289
6352
  return `
6290
6353
  LLM execution failed ${maxExecutionAttempts}x
@@ -6304,7 +6367,7 @@
6304
6367
  }
6305
6368
  }
6306
6369
  if ($ongoingTaskResult.$resultString === null) {
6307
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6370
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6308
6371
  Something went wrong and prompt result is null
6309
6372
 
6310
6373
  ${block(pipelineIdentification)}
@@ -6326,9 +6389,9 @@
6326
6389
  * @private internal utility of `createPipelineExecutor`
6327
6390
  */
6328
6391
  async function executeFormatSubvalues(options) {
6329
- const { task, jokerParameterNames, parameters, priority, csvSettings, onProgress, pipelineIdentification } = options;
6392
+ const { task, jokerParameterNames, parameters, priority, csvSettings, onProgress, logLlmCall, pipelineIdentification, } = options;
6330
6393
  if (task.foreach === undefined) {
6331
- return /* not await */ executeAttempts(options);
6394
+ return /* not await */ executeAttempts({ ...options, logLlmCall });
6332
6395
  }
6333
6396
  if (jokerParameterNames.length !== 0) {
6334
6397
  throw new UnexpectedError(spaceTrim__default["default"]((block) => `
@@ -6534,7 +6597,7 @@
6534
6597
  },
6535
6598
  content: task.content,
6536
6599
  parameters,
6537
- };
6600
+ }; /* <- Note: [🤛] */
6538
6601
  const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
6539
6602
  const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
6540
6603
  const { index } = knowledgePiece;
@@ -6610,7 +6673,7 @@
6610
6673
  // Note: Doublecheck that ALL reserved parameters are defined:
6611
6674
  for (const parameterName of RESERVED_PARAMETER_NAMES) {
6612
6675
  if (reservedParameters[parameterName] === undefined) {
6613
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6676
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6614
6677
  Reserved parameter {${parameterName}} is not defined
6615
6678
 
6616
6679
  ${block(pipelineIdentification)}
@@ -6629,14 +6692,14 @@
6629
6692
  * @private internal utility of `createPipelineExecutor`
6630
6693
  */
6631
6694
  async function executeTask(options) {
6632
- const { currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSuppressed, } = options;
6695
+ const { currentTask, preparedPipeline, parametersToPass, tools, onProgress, logLlmCall, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSuppressed, } = options;
6633
6696
  const priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
6634
6697
  // Note: Check consistency of used and dependent parameters which was also done in `validatePipeline`, but it’s good to doublecheck
6635
6698
  const usedParameterNames = extractParameterNamesFromTask(currentTask);
6636
6699
  const dependentParameterNames = new Set(currentTask.dependentParameterNames);
6637
6700
  // TODO: [👩🏾‍🤝‍👩🏻] Use here `mapAvailableToExpectedParameters`
6638
6701
  if (difference(union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)), new Set(RESERVED_PARAMETER_NAMES)).size !== 0) {
6639
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6702
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6640
6703
  Dependent parameters are not consistent with used parameters:
6641
6704
 
6642
6705
  Dependent parameters:
@@ -6680,7 +6743,7 @@
6680
6743
  else if (!definedParameterNames.has(parameterName) && usedParameterNames.has(parameterName)) {
6681
6744
  // Houston, we have a problem
6682
6745
  // Note: Checking part is also done in `validatePipeline`, but it’s good to doublecheck
6683
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6746
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6684
6747
  Parameter \`{${parameterName}}\` is NOT defined
6685
6748
  BUT used in task "${currentTask.title || currentTask.name}"
6686
6749
 
@@ -6708,6 +6771,7 @@
6708
6771
  tools,
6709
6772
  $executionReport,
6710
6773
  onProgress,
6774
+ logLlmCall,
6711
6775
  pipelineIdentification,
6712
6776
  maxExecutionAttempts,
6713
6777
  maxParallelCount,
@@ -6748,9 +6812,32 @@
6748
6812
  for (const parameter of preparedPipeline.parameters.filter(({ isOutput }) => isOutput)) {
6749
6813
  if (parametersToPass[parameter.name] === undefined) {
6750
6814
  // [4]
6751
- $warnings.push(new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6815
+ $warnings.push(new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6752
6816
  Parameter \`{${parameter.name}}\` should be an output parameter, but it was not generated during pipeline execution
6753
6817
 
6818
+ Note: This is a warning which happened after the pipeline was executed, and \`{${parameter.name}}\` was not for some reason defined in output parameters
6819
+
6820
+ All parameters:
6821
+ ${block(preparedPipeline.parameters
6822
+ .map(({ name, isInput, isOutput, description }) => {
6823
+ let line = `\`{${name}}\``;
6824
+ if (isInput) {
6825
+ line += ' `[input parameter]`';
6826
+ }
6827
+ if (isOutput) {
6828
+ line += ' `[output parameter]`';
6829
+ }
6830
+ if (parametersToPass[name] === undefined) {
6831
+ line += ` <- Warning: Should be in the output but its not |`;
6832
+ }
6833
+ if (description) {
6834
+ line += ` ${description}`;
6835
+ }
6836
+ return line;
6837
+ })
6838
+ .map((line, index) => `${index + 1}) ${line}`)
6839
+ .join('\n'))}
6840
+
6754
6841
  ${block(pipelineIdentification)}
6755
6842
  `)));
6756
6843
  continue;
@@ -6771,7 +6858,7 @@
6771
6858
  * @private internal utility of `createPipelineExecutor`
6772
6859
  */
6773
6860
  async function executePipeline(options) {
6774
- const { inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname, isVerbose, } = options;
6861
+ const { inputParameters, tools, onProgress, logLlmCall, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname, isVerbose, } = options;
6775
6862
  let { preparedPipeline } = options;
6776
6863
  if (preparedPipeline === undefined) {
6777
6864
  preparedPipeline = await preparePipeline(pipeline, tools, {
@@ -6833,7 +6920,7 @@
6833
6920
  for (const parameterName of Object.keys(inputParameters)) {
6834
6921
  const parameter = preparedPipeline.parameters.find(({ name }) => name === parameterName);
6835
6922
  if (parameter === undefined) {
6836
- warnings.push(new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6923
+ warnings.push(new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6837
6924
  Extra parameter {${parameterName}} is being passed which is not part of the pipeline.
6838
6925
 
6839
6926
  ${block(pipelineIdentification)}
@@ -6848,7 +6935,7 @@
6848
6935
  // TODO: [🧠] This should be also non-critical error
6849
6936
  return exportJson({
6850
6937
  name: 'pipelineExecutorResult',
6851
- message: spaceTrim.spaceTrim((block) => `
6938
+ message: spaceTrim$1.spaceTrim((block) => `
6852
6939
  Unsuccessful PipelineExecutorResult (with extra parameter {${parameter.name}}) PipelineExecutorResult
6853
6940
 
6854
6941
  ${block(pipelineIdentification)}
@@ -6857,7 +6944,7 @@
6857
6944
  value: {
6858
6945
  isSuccessful: false,
6859
6946
  errors: [
6860
- new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6947
+ new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6861
6948
  Parameter \`{${parameter.name}}\` is passed as input parameter but it is not input
6862
6949
 
6863
6950
  ${block(pipelineIdentification)}
@@ -6884,7 +6971,7 @@
6884
6971
  while (unresovedTasks.length > 0) {
6885
6972
  if (loopLimit-- < 0) {
6886
6973
  // Note: Really UnexpectedError not LimitReachedError - this should be catched during validatePipeline
6887
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6974
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6888
6975
  Loop limit reached during resolving parameters pipeline execution
6889
6976
 
6890
6977
  ${block(pipelineIdentification)}
@@ -6894,7 +6981,7 @@
6894
6981
  if (!currentTask && resolving.length === 0) {
6895
6982
  throw new UnexpectedError(
6896
6983
  // TODO: [🐎] DRY
6897
- spaceTrim.spaceTrim((block) => `
6984
+ spaceTrim$1.spaceTrim((block) => `
6898
6985
  Can not resolve some parameters:
6899
6986
 
6900
6987
  ${block(pipelineIdentification)}
@@ -6934,7 +7021,7 @@
6934
7021
  tools,
6935
7022
  onProgress(newOngoingResult) {
6936
7023
  if (isReturned) {
6937
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
7024
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6938
7025
  Can not call \`onProgress\` after pipeline execution is finished
6939
7026
 
6940
7027
  ${block(pipelineIdentification)}
@@ -6949,8 +7036,9 @@
6949
7036
  onProgress(newOngoingResult);
6950
7037
  }
6951
7038
  },
7039
+ logLlmCall,
6952
7040
  $executionReport: executionReport,
6953
- pipelineIdentification: spaceTrim.spaceTrim((block) => `
7041
+ pipelineIdentification: spaceTrim$1.spaceTrim((block) => `
6954
7042
  ${block(pipelineIdentification)}
6955
7043
  Task name: ${currentTask.name}
6956
7044
  Task title: ${currentTask.title}
@@ -7059,7 +7147,7 @@
7059
7147
  preparedPipeline = pipeline;
7060
7148
  }
7061
7149
  else if (isNotPreparedWarningSuppressed !== true) {
7062
- console.warn(spaceTrim.spaceTrim((block) => `
7150
+ console.warn(spaceTrim$1.spaceTrim((block) => `
7063
7151
  Pipeline is not prepared
7064
7152
 
7065
7153
  ${block(pipelineIdentification)}
@@ -7072,7 +7160,7 @@
7072
7160
  // <- TODO: [🏮] Some standard way how to transform errors into warnings and how to handle non-critical fails during the tasks
7073
7161
  }
7074
7162
  let runCount = 0;
7075
- const pipelineExecutorWithCallback = async (inputParameters, onProgress) => {
7163
+ const pipelineExecutorWithCallback = async (inputParameters, onProgress, logLlmCall) => {
7076
7164
  runCount++;
7077
7165
  return /* not await */ executePipeline({
7078
7166
  pipeline,
@@ -7083,7 +7171,8 @@
7083
7171
  inputParameters,
7084
7172
  tools,
7085
7173
  onProgress,
7086
- pipelineIdentification: spaceTrim.spaceTrim((block) => `
7174
+ logLlmCall,
7175
+ pipelineIdentification: spaceTrim$1.spaceTrim((block) => `
7087
7176
  ${block(pipelineIdentification)}
7088
7177
  ${runCount === 1 ? '' : `Run #${runCount}`}
7089
7178
  `),
@@ -7244,7 +7333,7 @@
7244
7333
  }
7245
7334
  const llmTools = getSingleLlmExecutionTools(llm);
7246
7335
  // TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
7247
- const collection = createCollectionFromJson(...PipelineCollection);
7336
+ const collection = createPipelineCollectionFromJson(...PipelineCollection);
7248
7337
  const prepareKnowledgeFromMarkdownExecutor = createPipelineExecutor({
7249
7338
  pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book'),
7250
7339
  tools: {