@promptbook/website-crawler 0.103.0-10 → 0.103.0-100

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 (253) hide show
  1. package/README.md +59 -35
  2. package/esm/index.es.js +295 -224
  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 +20 -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 +58 -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 +19 -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 +77 -7
  27. package/esm/typings/src/book-components/BookEditor/BookEditorActionbar.d.ts +14 -0
  28. package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +14 -0
  29. package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +13 -0
  30. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +10 -0
  31. package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
  32. package/esm/typings/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +15 -0
  33. package/esm/typings/src/book-components/Chat/MockedChat/MockedChat.d.ts +5 -0
  34. package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
  35. package/esm/typings/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +1 -0
  36. package/esm/typings/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +4 -0
  37. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
  38. package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgent.d.ts +29 -0
  39. package/esm/typings/src/book-components/Qr/BrandedQrCode.d.ts +18 -0
  40. package/esm/typings/src/book-components/Qr/GenericQrCode.d.ts +10 -0
  41. package/esm/typings/src/book-components/Qr/PromptbookQrCode.d.ts +18 -0
  42. package/esm/typings/src/book-components/Qr/useQrCode.d.ts +15 -0
  43. package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +15 -0
  44. package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +12 -0
  45. package/esm/typings/src/book-components/_common/Modal/Modal.d.ts +2 -2
  46. package/esm/typings/src/book-components/_common/Tooltip/Tooltip.d.ts +47 -0
  47. package/esm/typings/src/book-components/icons/AboutIcon.d.ts +9 -0
  48. package/esm/typings/src/book-components/icons/CloseIcon.d.ts +4 -8
  49. package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +9 -0
  50. package/esm/typings/src/book-components/icons/ExitFullscreenIcon.d.ts +7 -0
  51. package/esm/typings/src/book-components/icons/FullscreenIcon.d.ts +7 -0
  52. package/esm/typings/src/book-components/icons/MenuIcon.d.ts +12 -0
  53. package/esm/typings/src/book-components/icons/MicIcon.d.ts +8 -0
  54. package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +2 -1
  55. package/esm/typings/src/cli/cli-commands/about.d.ts +3 -1
  56. package/esm/typings/src/cli/cli-commands/hello.d.ts +2 -1
  57. package/esm/typings/src/cli/cli-commands/list-models.d.ts +2 -1
  58. package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +2 -1
  59. package/esm/typings/src/cli/cli-commands/login.d.ts +2 -1
  60. package/esm/typings/src/cli/cli-commands/make.d.ts +2 -1
  61. package/esm/typings/src/cli/cli-commands/prettify.d.ts +2 -1
  62. package/esm/typings/src/cli/cli-commands/run.d.ts +2 -1
  63. package/esm/typings/src/cli/cli-commands/{start-server.d.ts → start-agents-server.d.ts} +3 -2
  64. package/esm/typings/src/cli/cli-commands/start-pipelines-server.d.ts +15 -0
  65. package/esm/typings/src/cli/cli-commands/test-command.d.ts +2 -1
  66. package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +2 -1
  67. package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +12 -0
  68. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +75 -0
  69. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +10 -0
  70. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +154 -0
  71. package/esm/typings/src/collection/{PipelineCollection.d.ts → pipeline-collection/PipelineCollection.d.ts} +7 -3
  72. package/esm/typings/src/collection/{SimplePipelineCollection.d.ts → pipeline-collection/SimplePipelineCollection.d.ts} +5 -5
  73. package/esm/typings/src/collection/{constructors/createCollectionFromDirectory.d.ts → pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts} +8 -11
  74. package/esm/typings/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +13 -0
  75. package/esm/typings/src/collection/{constructors/createCollectionFromPromise.d.ts → pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts} +6 -5
  76. package/esm/typings/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.test.d.ts +1 -0
  77. package/esm/typings/src/collection/{constructors/createCollectionFromUrl.d.ts → pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts} +3 -3
  78. package/esm/typings/src/collection/{constructors/createSubcollection.d.ts → pipeline-collection/constructors/createPipelineSubcollection.d.ts} +3 -3
  79. package/esm/typings/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +13 -0
  80. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -5
  81. package/esm/typings/src/{book-2.0/commitments → commitments}/ACTION/ACTION.d.ts +5 -1
  82. package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +35 -0
  83. package/esm/typings/src/commitments/COMPONENT/COMPONENT.d.ts +28 -0
  84. package/esm/typings/src/{book-2.0/commitments → commitments}/DELETE/DELETE.d.ts +5 -1
  85. package/esm/typings/src/{book-2.0/commitments → commitments}/FORMAT/FORMAT.d.ts +5 -1
  86. package/esm/typings/src/commitments/FROM/FROM.d.ts +34 -0
  87. package/esm/typings/src/{book-2.0/commitments → commitments}/GOAL/GOAL.d.ts +5 -1
  88. package/esm/typings/src/{book-2.0/commitments → commitments}/KNOWLEDGE/KNOWLEDGE.d.ts +5 -5
  89. package/esm/typings/src/commitments/LANGUAGE/LANGUAGE.d.ts +35 -0
  90. package/esm/typings/src/{book-2.0/commitments → commitments}/MEMORY/MEMORY.d.ts +5 -1
  91. package/esm/typings/src/commitments/MESSAGE/AgentMessageCommitmentDefinition.d.ts +32 -0
  92. package/esm/typings/src/commitments/MESSAGE/InitialMessageCommitmentDefinition.d.ts +32 -0
  93. package/esm/typings/src/{book-2.0/commitments → commitments}/MESSAGE/MESSAGE.d.ts +5 -1
  94. package/esm/typings/src/commitments/MESSAGE/UserMessageCommitmentDefinition.d.ts +32 -0
  95. package/esm/typings/src/{book-2.0/commitments → commitments}/META/META.d.ts +5 -1
  96. package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +48 -0
  97. package/esm/typings/src/commitments/META_FONT/META_FONT.d.ts +42 -0
  98. package/esm/typings/src/{book-2.0/commitments → commitments}/META_IMAGE/META_IMAGE.d.ts +5 -1
  99. package/esm/typings/src/{book-2.0/commitments → commitments}/META_LINK/META_LINK.d.ts +5 -1
  100. package/esm/typings/src/{book-2.0/commitments → commitments}/MODEL/MODEL.d.ts +5 -1
  101. package/esm/typings/src/{book-2.0/commitments → commitments}/NOTE/NOTE.d.ts +5 -1
  102. package/esm/typings/src/commitments/OPEN/OPEN.d.ts +35 -0
  103. package/esm/typings/src/{book-2.0/commitments → commitments}/PERSONA/PERSONA.d.ts +5 -1
  104. package/esm/typings/src/{book-2.0/commitments → commitments}/RULE/RULE.d.ts +5 -1
  105. package/esm/typings/src/{book-2.0/commitments → commitments}/SAMPLE/SAMPLE.d.ts +5 -1
  106. package/esm/typings/src/{book-2.0/commitments → commitments}/SCENARIO/SCENARIO.d.ts +5 -1
  107. package/esm/typings/src/{book-2.0/commitments → commitments}/STYLE/STYLE.d.ts +5 -1
  108. package/esm/typings/src/commitments/USE/USE.d.ts +53 -0
  109. package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +38 -0
  110. package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +1 -0
  111. package/esm/typings/src/commitments/USE_MCP/USE_MCP.d.ts +37 -0
  112. package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +38 -0
  113. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BaseCommitmentDefinition.d.ts +8 -2
  114. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/CommitmentDefinition.d.ts +6 -1
  115. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/NotYetImplementedCommitmentDefinition.d.ts +5 -1
  116. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/createEmptyAgentModelRequirements.d.ts +1 -1
  117. package/esm/typings/src/commitments/index.d.ts +93 -0
  118. package/esm/typings/src/config.d.ts +24 -3
  119. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +2 -0
  120. package/esm/typings/src/errors/0-index.d.ts +6 -0
  121. package/esm/typings/src/errors/DatabaseError.d.ts +12 -0
  122. package/esm/typings/src/errors/NotAllowed.d.ts +9 -0
  123. package/esm/typings/src/errors/WrappedError.d.ts +2 -2
  124. package/esm/typings/src/execution/AvailableModel.d.ts +1 -0
  125. package/esm/typings/src/execution/Executables.d.ts +3 -0
  126. package/esm/typings/src/execution/ExecutionTask.d.ts +12 -3
  127. package/esm/typings/src/execution/ExecutionTools.d.ts +5 -0
  128. package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
  129. package/esm/typings/src/execution/LlmExecutionTools.d.ts +21 -1
  130. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +5 -0
  131. package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +5 -0
  132. package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +5 -0
  133. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +5 -0
  134. package/esm/typings/src/execution/utils/usage-constants.d.ts +4 -124
  135. package/esm/typings/src/execution/utils/validatePromptResult.d.ts +2 -0
  136. package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +2 -1
  137. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +2 -2
  138. package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +2 -1
  139. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
  140. package/esm/typings/src/llm-providers/_common/utils/assertUniqueModels.d.ts +12 -0
  141. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
  142. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
  143. package/esm/typings/src/llm-providers/agent/Agent.d.ts +70 -0
  144. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +26 -4
  145. package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +19 -0
  146. package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +17 -0
  147. package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +50 -0
  148. package/esm/typings/src/llm-providers/agent/RemoteAgentOptions.d.ts +11 -0
  149. package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +1 -19
  150. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  151. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  152. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +60 -2
  153. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionToolsOptions.d.ts +7 -1
  154. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  155. package/esm/typings/src/llm-providers/openai/openai-models.test.d.ts +4 -0
  156. package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +1 -1
  157. package/esm/typings/src/pipeline/validatePipelineString.d.ts +2 -0
  158. package/esm/typings/src/playground/permanent/_boilerplate.d.ts +5 -0
  159. package/esm/typings/src/playground/permanent/agent-with-browser-playground.d.ts +5 -0
  160. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +1 -0
  161. package/esm/typings/src/remote-server/startAgentServer.d.ts +26 -0
  162. package/esm/typings/src/remote-server/startRemoteServer.d.ts +4 -1
  163. package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +3 -8
  164. package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -12
  165. package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -9
  166. package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -12
  167. package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -9
  168. package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +1 -12
  169. package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -9
  170. package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +1 -12
  171. package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -9
  172. package/esm/typings/src/scrapers/markitdown/createMarkitdownScraper.d.ts +1 -12
  173. package/esm/typings/src/scrapers/markitdown/register-metadata.d.ts +1 -9
  174. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -12
  175. package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -9
  176. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +1 -12
  177. package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -9
  178. package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -0
  179. package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +2 -1
  180. package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +33 -0
  181. package/esm/typings/src/transpilers/_common/BookTranspilerOptions.d.ts +18 -0
  182. package/esm/typings/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +15 -0
  183. package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +16 -0
  184. package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +15 -0
  185. package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +16 -0
  186. package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.test.d.ts +1 -0
  187. package/esm/typings/src/transpilers/openai-sdk/playground/playground.d.ts +5 -0
  188. package/esm/typings/src/transpilers/openai-sdk/register.d.ts +15 -0
  189. package/esm/typings/src/types/LlmCall.d.ts +20 -0
  190. package/esm/typings/src/types/Updatable.d.ts +19 -0
  191. package/esm/typings/src/types/typeAliases.d.ts +32 -2
  192. package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
  193. package/esm/typings/src/utils/color/Color.d.ts +15 -0
  194. package/esm/typings/src/utils/color/Color.test.d.ts +1 -0
  195. package/esm/typings/src/utils/color/css-colors.d.ts +1 -0
  196. package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +0 -3
  197. package/esm/typings/src/utils/color/operators/darken.d.ts +1 -1
  198. package/esm/typings/src/utils/color/operators/grayscale.d.ts +1 -1
  199. package/esm/typings/src/utils/color/operators/lighten.d.ts +1 -1
  200. package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +1 -1
  201. package/esm/typings/src/utils/color/operators/saturate.d.ts +1 -1
  202. package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +16 -0
  203. package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -2
  204. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +2 -1
  205. package/esm/typings/src/utils/execCommand/$execCommands.d.ts +2 -1
  206. package/esm/typings/src/utils/files/$induceBookDownload.d.ts +13 -0
  207. package/esm/typings/src/utils/files/$induceFileDownload.d.ts +13 -0
  208. package/esm/typings/src/utils/files/ObjectUrl.d.ts +46 -0
  209. package/esm/typings/src/utils/files/listAllFiles.d.ts +2 -3
  210. package/esm/typings/src/utils/misc/aboutPromptbookInformation.d.ts +27 -0
  211. package/esm/typings/src/utils/misc/computeHash.d.ts +11 -0
  212. package/esm/typings/src/utils/misc/computeHash.test.d.ts +1 -0
  213. package/esm/typings/src/utils/misc/xAboutPromptbookInformation.d.ts +13 -0
  214. package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -0
  215. package/esm/typings/src/utils/normalization/normalizeMessageText.d.ts +9 -0
  216. package/esm/typings/src/utils/normalization/normalizeMessageText.test.d.ts +1 -0
  217. package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +3 -0
  218. package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -0
  219. package/esm/typings/src/utils/normalization/titleToName.d.ts +2 -0
  220. package/esm/typings/src/utils/organization/$sideEffect.d.ts +2 -2
  221. package/esm/typings/src/utils/organization/$side_effect.d.ts +7 -0
  222. package/esm/typings/src/utils/organization/TODO_USE.d.ts +2 -2
  223. package/esm/typings/src/utils/organization/keepUnused.d.ts +2 -2
  224. package/esm/typings/src/utils/organization/preserve.d.ts +3 -3
  225. package/esm/typings/src/utils/organization/really_any.d.ts +7 -0
  226. package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +25 -0
  227. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
  228. package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
  229. package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
  230. package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
  231. package/esm/typings/src/utils/random/$randomToken.d.ts +2 -0
  232. package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +2 -1
  233. package/esm/typings/src/utils/serialization/asSerializable.d.ts +2 -2
  234. package/esm/typings/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -2
  235. package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +2 -0
  236. package/esm/typings/src/version.d.ts +1 -1
  237. package/esm/typings/src/wizard/$getCompiledBook.d.ts +1 -2
  238. package/package.json +6 -6
  239. package/umd/index.umd.js +264 -193
  240. package/umd/index.umd.js.map +1 -1
  241. package/esm/typings/src/book-2.0/commitments/index.d.ts +0 -60
  242. package/esm/typings/src/book-components/BookEditor/config.d.ts +0 -11
  243. package/esm/typings/src/book-components/Chat/utils/renderMarkdown.d.ts +0 -21
  244. package/esm/typings/src/collection/collectionToJson.d.ts +0 -13
  245. package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +0 -13
  246. /package/esm/typings/src/{book-components/Chat/utils/renderMarkdown.test.d.ts → book-2.0/agent-source/computeAgentHash.test.d.ts} +0 -0
  247. /package/esm/typings/src/{collection/constructors/createCollectionFromDirectory.test.d.ts → book-2.0/agent-source/normalizeAgentName.test.d.ts} +0 -0
  248. /package/esm/typings/src/{collection/constructors/createCollectionFromJson.test.d.ts → book-components/Chat/AgentChat/AgentChat.test.d.ts} +0 -0
  249. /package/esm/typings/src/collection/{constructors/createCollectionFromPromise.test.d.ts → pipeline-collection/constructors/createPipelineCollectionFromDirectory.test.d.ts} +0 -0
  250. /package/esm/typings/src/{commands/_common/parseCommand.test.d.ts → collection/pipeline-collection/constructors/createPipelineCollectionFromJson.test.d.ts} +0 -0
  251. /package/esm/typings/src/collection/{collectionToJson.test.d.ts → pipeline-collection/pipelineCollectionToJson.test.d.ts} +0 -0
  252. /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BookCommitment.d.ts +0 -0
  253. /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('spacetrim'), require('@mozilla/readability'), require('jsdom'), require('crypto-js'), require('crypto-js/enc-hex'), require('fs/promises'), require('path'), require('crypto'), require('rxjs'), require('waitasecond'), require('crypto-js/sha256'), require('mime-types'), require('papaparse'), require('showdown')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', 'spacetrim', '@mozilla/readability', 'jsdom', 'crypto-js', 'crypto-js/enc-hex', 'fs/promises', 'path', 'crypto', 'rxjs', 'waitasecond', 'crypto-js/sha256', 'mime-types', 'papaparse', 'showdown'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-website-crawler"] = {}, global.spaceTrim, global.readability, global.jsdom, global.cryptoJs, global.hexEncoder, global.promises, global.path, global.crypto, global.rxjs, global.waitasecond, global.sha256, global.mimeTypes, global.papaparse, global.showdown));
5
- })(this, (function (exports, spaceTrim, readability, jsdom, cryptoJs, hexEncoder, promises, path, crypto, rxjs, waitasecond, sha256, mimeTypes, papaparse, showdown) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-website-crawler"] = {}, global.spaceTrim$1, global.readability, global.jsdom, global.cryptoJs, global.hexEncoder, global.promises, global.path, global.crypto, global.rxjs, global.waitasecond, global.sha256, global.mimeTypes, global.papaparse, global.showdown));
5
+ })(this, (function (exports, spaceTrim$1, readability, jsdom, cryptoJs, hexEncoder, promises, path, crypto, rxjs, waitasecond, sha256, mimeTypes, papaparse, showdown) { '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-10';
27
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-100';
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
@@ -74,6 +74,17 @@
74
74
  * TODO: [🧠] Is there a way how to meaningfully test this utility
75
75
  */
76
76
 
77
+ /**
78
+ * Trims string from all 4 sides
79
+ *
80
+ * Note: This is a re-exported function from the `spacetrim` package which is
81
+ * Developed by same author @hejny as this package
82
+ *
83
+ * @public exported from `@promptbook/utils`
84
+ * @see https://github.com/hejny/spacetrim#usage
85
+ */
86
+ const spaceTrim = spaceTrim$1.spaceTrim;
87
+
77
88
  /**
78
89
  * @private util of `@promptbook/color`
79
90
  * @de
@@ -122,6 +133,7 @@
122
133
  * @public exported from `@promptbook/color`
123
134
  */
124
135
  const CSS_COLORS = {
136
+ promptbook: '#79EAFD',
125
137
  transparent: 'rgba(0,0,0,0)',
126
138
  aliceblue: '#f0f8ff',
127
139
  antiquewhite: '#faebd7',
@@ -303,9 +315,6 @@
303
315
  throw new Error(`${channelName} channel is greater than 255, it is ${value}`);
304
316
  }
305
317
  }
306
- /**
307
- * TODO: [🧠][🚓] Is/which combination it better to use asserts/check, validate or is utility function?
308
- */
309
318
 
310
319
  /**
311
320
  * Color object represents an RGB color with alpha channel
@@ -340,6 +349,28 @@
340
349
  throw new Error(`Can not create color from given object`);
341
350
  }
342
351
  }
352
+ /**
353
+ * Creates a new Color instance from miscellaneous formats
354
+ * It just does not throw error when it fails, it returns PROMPTBOOK_COLOR instead
355
+ *
356
+ * @param color
357
+ * @returns Color object
358
+ */
359
+ static fromSafe(color) {
360
+ try {
361
+ return Color.from(color);
362
+ }
363
+ catch (error) {
364
+ // <- Note: Can not use `assertsError(error)` here because it causes circular dependency
365
+ console.warn(spaceTrim((block) => `
366
+ Color.fromSafe error:
367
+ ${block(error.message)}
368
+
369
+ Returning default PROMPTBOOK_COLOR.
370
+ `));
371
+ return Color.fromString('promptbook');
372
+ }
373
+ }
343
374
  /**
344
375
  * Creates a new Color instance from miscellaneous string formats
345
376
  *
@@ -407,6 +438,9 @@
407
438
  if (hex.length === 3) {
408
439
  return Color.fromHex3(hex);
409
440
  }
441
+ if (hex.length === 4) {
442
+ return Color.fromHex4(hex);
443
+ }
410
444
  if (hex.length === 6) {
411
445
  return Color.fromHex6(hex);
412
446
  }
@@ -427,6 +461,19 @@
427
461
  const b = parseInt(hex.substr(2, 1), 16) * 16;
428
462
  return take(new Color(r, g, b));
429
463
  }
464
+ /**
465
+ * Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
466
+ *
467
+ * @param color in hex for example `09df`
468
+ * @returns Color object
469
+ */
470
+ static fromHex4(hex) {
471
+ const r = parseInt(hex.substr(0, 1), 16) * 16;
472
+ const g = parseInt(hex.substr(1, 1), 16) * 16;
473
+ const b = parseInt(hex.substr(2, 1), 16) * 16;
474
+ const a = parseInt(hex.substr(3, 1), 16) * 16;
475
+ return take(new Color(r, g, b, a));
476
+ }
430
477
  /**
431
478
  * Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
432
479
  *
@@ -617,7 +664,8 @@
617
664
  * @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
618
665
  */
619
666
  static isHexColorString(value) {
620
- return typeof value === 'string' && /^#(?:[0-9a-fA-F]{3}){1,2}$/.test(value);
667
+ return (typeof value === 'string' &&
668
+ /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value));
621
669
  }
622
670
  /**
623
671
  * Creates new Color object
@@ -732,6 +780,23 @@
732
780
  * TODO: Maybe connect with textures
733
781
  */
734
782
 
783
+ /**
784
+ * Makes color transformer which returns a grayscale version of the color
785
+ *
786
+ * @param amount from 0 to 1
787
+ *
788
+ * @public exported from `@promptbook/color`
789
+ */
790
+ function grayscale(amount) {
791
+ return ({ red, green, blue, alpha }) => {
792
+ const average = (red + green + blue) / 3;
793
+ red = Math.round(average * amount + red * (1 - amount));
794
+ green = Math.round(average * amount + green * (1 - amount));
795
+ blue = Math.round(average * amount + blue * (1 - amount));
796
+ return Color.fromValues(red, green, blue, alpha);
797
+ };
798
+ }
799
+
735
800
  /**
736
801
  * Converts HSL values to RGB values
737
802
  *
@@ -847,102 +912,6 @@
847
912
  * TODO: Maybe implement by mix+hsl
848
913
  */
849
914
 
850
- /**
851
- * Calculates distance between two colors
852
- *
853
- * @param color1 first color
854
- * @param color2 second color
855
- *
856
- * Note: This function is inefficient. Use colorDistanceSquared instead if possible.
857
- *
858
- * @public exported from `@promptbook/color`
859
- */
860
- /**
861
- * Calculates distance between two colors without square root
862
- *
863
- * @param color1 first color
864
- * @param color2 second color
865
- *
866
- * @public exported from `@promptbook/color`
867
- */
868
- function colorDistanceSquared(color1, color2) {
869
- const rmean = (color1.red + color2.red) / 2;
870
- const r = color1.red - color2.red;
871
- const g = color1.green - color2.green;
872
- const b = color1.blue - color2.blue;
873
- const weightR = 2 + rmean / 256;
874
- const weightG = 4.0;
875
- const weightB = 2 + (255 - rmean) / 256;
876
- const distance = weightR * r * r + weightG * g * g + weightB * b * b;
877
- return distance;
878
- }
879
-
880
- /**
881
- * Makes color transformer which finds the nearest color from the given list
882
- *
883
- * @param colors array of colors to choose from
884
- *
885
- * @public exported from `@promptbook/color`
886
- */
887
- function nearest(...colors) {
888
- return (color) => {
889
- const distances = colors.map((c) => colorDistanceSquared(c, color));
890
- const minDistance = Math.min(...distances);
891
- const minIndex = distances.indexOf(minDistance);
892
- const nearestColor = colors[minIndex];
893
- return nearestColor;
894
- };
895
- }
896
-
897
- /**
898
- * Color transformer which returns the negative color
899
- *
900
- * @public exported from `@promptbook/color`
901
- */
902
- function negative(color) {
903
- const r = 255 - color.red;
904
- const g = 255 - color.green;
905
- const b = 255 - color.blue;
906
- return Color.fromValues(r, g, b, color.alpha);
907
- }
908
-
909
- /**
910
- * Makes color transformer which finds the furthest color from the given list
911
- *
912
- * @param colors array of colors to choose from
913
- *
914
- * @public exported from `@promptbook/color`
915
- */
916
- function furthest(...colors) {
917
- return (color) => {
918
- const furthestColor = negative(nearest(...colors.map(negative))(color));
919
- return furthestColor;
920
- };
921
- }
922
- /**
923
- * Makes color transformer which finds the best text color (black or white) for the given background color
924
- *
925
- * @public exported from `@promptbook/color`
926
- */
927
- furthest(Color.get('white'), Color.from('black'));
928
-
929
- /**
930
- * Makes color transformer which returns a grayscale version of the color
931
- *
932
- * @param amount from 0 to 1
933
- *
934
- * @public exported from `@promptbook/color`
935
- */
936
- function grayscale(amount) {
937
- return ({ red, green, blue, alpha }) => {
938
- const average = (red + green + blue) / 3;
939
- red = Math.round(average * amount + red * (1 - amount));
940
- green = Math.round(average * amount + green * (1 - amount));
941
- blue = Math.round(average * amount + blue * (1 - amount));
942
- return Color.fromValues(red, green, blue, alpha);
943
- };
944
- }
945
-
946
915
  /**
947
916
  * Makes color transformer which saturate the given color
948
917
  *
@@ -1011,16 +980,32 @@
1011
980
  *
1012
981
  * @public exported from `@promptbook/core`
1013
982
  */
1014
- const PROMPTBOOK_COLOR = Color.fromHex('#79EAFD');
1015
- // <- TODO: [🧠] Using `Color` here increases the package size approx 3kb, maybe remove it
983
+ const PROMPTBOOK_COLOR = Color.fromString('promptbook');
984
+ // <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
985
+ /**
986
+ * Colors for syntax highlighting in the `<BookEditor/>`
987
+ *
988
+ * TODO: [🗽] Unite branding and make single place for it
989
+ *
990
+ * @public exported from `@promptbook/core`
991
+ */
992
+ ({
993
+ TITLE: Color.fromHex('#244EA8'),
994
+ LINE: Color.fromHex('#eeeeee'),
995
+ SEPARATOR: Color.fromHex('#cccccc'),
996
+ COMMITMENT: Color.fromHex('#DA0F78'),
997
+ PARAMETER: Color.fromHex('#8e44ad'),
998
+ });
999
+ // <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
1016
1000
  /**
1017
- * Dark color of the Promptbook
1001
+ * Chat color of the Promptbook (in chat)
1018
1002
  *
1019
1003
  * TODO: [🗽] Unite branding and make single place for it
1020
1004
  *
1021
1005
  * @public exported from `@promptbook/core`
1022
1006
  */
1023
1007
  PROMPTBOOK_COLOR.then(lighten(0.1)).then(saturate(0.9)).then(grayscale(0.9));
1008
+ // <- TODO: [🧠][🈵] Using `Color` and `lighten`, `saturate`,... here increases the package size approx 3kb, maybe remove it
1024
1009
  /**
1025
1010
  * Color of the user (in chat)
1026
1011
  *
@@ -1029,6 +1014,7 @@
1029
1014
  * @public exported from `@promptbook/core`
1030
1015
  */
1031
1016
  Color.fromHex('#1D4ED8');
1017
+ // <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
1032
1018
  /**
1033
1019
  * When the title is not provided, the default title is used
1034
1020
  *
@@ -1115,7 +1101,7 @@
1115
1101
  * @public exported from `@promptbook/core`
1116
1102
  */
1117
1103
  const DEFAULT_MAX_EXECUTION_ATTEMPTS = 7; // <- TODO: [🤹‍♂️]
1118
- // <- TODO: [🕝] Make also `BOOKS_DIRNAME_ALTERNATIVES`
1104
+ // <- TODO: [🕝] Make also `AGENTS_DIRNAME_ALTERNATIVES`
1119
1105
  // TODO: Just `.promptbook` in config, hardcode subfolders like `download-cache` or `execution-cache`
1120
1106
  /**
1121
1107
  * Where to store the temporary downloads
@@ -1191,7 +1177,7 @@
1191
1177
  */
1192
1178
  class NotYetImplementedError extends Error {
1193
1179
  constructor(message) {
1194
- super(spaceTrim.spaceTrim((block) => `
1180
+ super(spaceTrim$1.spaceTrim((block) => `
1195
1181
  ${block(message)}
1196
1182
 
1197
1183
  Note: This feature is not implemented yet but it will be soon.
@@ -1258,7 +1244,7 @@
1258
1244
  */
1259
1245
  class UnexpectedError extends Error {
1260
1246
  constructor(message) {
1261
- super(spaceTrim.spaceTrim((block) => `
1247
+ super(spaceTrim$1.spaceTrim((block) => `
1262
1248
  ${block(message)}
1263
1249
 
1264
1250
  Note: This error should not happen.
@@ -1750,6 +1736,8 @@
1750
1736
  /**
1751
1737
  * Converts a given text to kebab-case format.
1752
1738
  *
1739
+ * Note: [🔂] This function is idempotent.
1740
+ *
1753
1741
  * @param text The text to be converted.
1754
1742
  * @returns The kebab-case formatted string.
1755
1743
  * @example 'hello-world'
@@ -1905,6 +1893,8 @@
1905
1893
  /**
1906
1894
  * Converts a title string into a normalized name.
1907
1895
  *
1896
+ * Note: [🔂] This function is idempotent.
1897
+ *
1908
1898
  * @param value The title string to be converted to a name.
1909
1899
  * @returns A normalized name derived from the input title.
1910
1900
  * @example 'Hello World!' -> 'hello-world'
@@ -1996,7 +1986,7 @@
1996
1986
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
1997
1987
  */
1998
1988
 
1999
- 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-9",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"}];
1989
+ 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"}];
2000
1990
 
2001
1991
  /**
2002
1992
  * Checks if value is valid email
@@ -2038,7 +2028,7 @@
2038
2028
  constructor(whatWasThrown) {
2039
2029
  const tag = `[🤮]`;
2040
2030
  console.error(tag, whatWasThrown);
2041
- super(spaceTrim.spaceTrim(`
2031
+ super(spaceTrim$1.spaceTrim(`
2042
2032
  Non-Error object was thrown
2043
2033
 
2044
2034
  Note: Look for ${tag} in the console for more details
@@ -2103,6 +2093,8 @@
2103
2093
  * Function `validatePipelineString` will validate the if the string is a valid pipeline string
2104
2094
  * 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.
2105
2095
  *
2096
+ * Note: [🔂] This function is idempotent.
2097
+ *
2106
2098
  * @param {string} pipelineString the candidate for a pipeline string
2107
2099
  * @returns {PipelineString} the same string as input, but validated as valid
2108
2100
  * @throws {ParseError} if the string is not a valid pipeline string
@@ -2460,7 +2452,7 @@
2460
2452
  TODO: [🧠] Is there a better implementation?
2461
2453
  > const propertyNames = Object.getOwnPropertyNames(objectValue);
2462
2454
  > for (const propertyName of propertyNames) {
2463
- > const value = (objectValue as really_any)[propertyName];
2455
+ > const value = (objectValue as chococake)[propertyName];
2464
2456
  > if (value && typeof value === 'object') {
2465
2457
  > deepClone(value);
2466
2458
  > }
@@ -2665,6 +2657,8 @@
2665
2657
  * - if it is valid json
2666
2658
  * - if it is meaningful
2667
2659
  *
2660
+ * Note: [🔂] This function is idempotent.
2661
+ *
2668
2662
  * @param pipeline valid or invalid PipelineJson
2669
2663
  * @returns the same pipeline if it is logically valid
2670
2664
  * @throws {PipelineLogicError} on logical error in the pipeline
@@ -2682,7 +2676,7 @@
2682
2676
  if (!(error instanceof PipelineLogicError)) {
2683
2677
  throw error;
2684
2678
  }
2685
- console.error(spaceTrim.spaceTrim((block) => `
2679
+ console.error(spaceTrim$1.spaceTrim((block) => `
2686
2680
  Pipeline is not valid but logic errors are temporarily disabled via \`IS_PIPELINE_LOGIC_VALIDATED\`
2687
2681
 
2688
2682
  ${block(error.message)}
@@ -2709,7 +2703,7 @@
2709
2703
  })();
2710
2704
  if (pipeline.pipelineUrl !== undefined && !isValidPipelineUrl(pipeline.pipelineUrl)) {
2711
2705
  // <- Note: [🚲]
2712
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2706
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2713
2707
  Invalid promptbook URL "${pipeline.pipelineUrl}"
2714
2708
 
2715
2709
  ${block(pipelineIdentification)}
@@ -2717,7 +2711,7 @@
2717
2711
  }
2718
2712
  if (pipeline.bookVersion !== undefined && !isValidPromptbookVersion(pipeline.bookVersion)) {
2719
2713
  // <- Note: [🚲]
2720
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2714
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2721
2715
  Invalid Promptbook Version "${pipeline.bookVersion}"
2722
2716
 
2723
2717
  ${block(pipelineIdentification)}
@@ -2726,7 +2720,7 @@
2726
2720
  // TODO: [🧠] Maybe do here some proper JSON-schema / ZOD checking
2727
2721
  if (!Array.isArray(pipeline.parameters)) {
2728
2722
  // TODO: [🧠] what is the correct error tp throw - maybe PromptbookSchemaError
2729
- throw new ParseError(spaceTrim.spaceTrim((block) => `
2723
+ throw new ParseError(spaceTrim$1.spaceTrim((block) => `
2730
2724
  Pipeline is valid JSON but with wrong structure
2731
2725
 
2732
2726
  \`PipelineJson.parameters\` expected to be an array, but got ${typeof pipeline.parameters}
@@ -2737,7 +2731,7 @@
2737
2731
  // TODO: [🧠] Maybe do here some proper JSON-schema / ZOD checking
2738
2732
  if (!Array.isArray(pipeline.tasks)) {
2739
2733
  // TODO: [🧠] what is the correct error tp throw - maybe PromptbookSchemaError
2740
- throw new ParseError(spaceTrim.spaceTrim((block) => `
2734
+ throw new ParseError(spaceTrim$1.spaceTrim((block) => `
2741
2735
  Pipeline is valid JSON but with wrong structure
2742
2736
 
2743
2737
  \`PipelineJson.tasks\` expected to be an array, but got ${typeof pipeline.tasks}
@@ -2763,7 +2757,7 @@
2763
2757
  // Note: Check each parameter individually
2764
2758
  for (const parameter of pipeline.parameters) {
2765
2759
  if (parameter.isInput && parameter.isOutput) {
2766
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2760
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2767
2761
 
2768
2762
  Parameter \`{${parameter.name}}\` can not be both input and output
2769
2763
 
@@ -2774,7 +2768,7 @@
2774
2768
  if (!parameter.isInput &&
2775
2769
  !parameter.isOutput &&
2776
2770
  !pipeline.tasks.some((task) => task.dependentParameterNames.includes(parameter.name))) {
2777
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2771
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2778
2772
  Parameter \`{${parameter.name}}\` is created but not used
2779
2773
 
2780
2774
  You can declare {${parameter.name}} as output parameter by adding in the header:
@@ -2786,7 +2780,7 @@
2786
2780
  }
2787
2781
  // Note: Testing that parameter is either input or result of some task
2788
2782
  if (!parameter.isInput && !pipeline.tasks.some((task) => task.resultingParameterName === parameter.name)) {
2789
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2783
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2790
2784
  Parameter \`{${parameter.name}}\` is declared but not defined
2791
2785
 
2792
2786
  You can do one of these:
@@ -2802,14 +2796,14 @@
2802
2796
  // Note: Checking each task individually
2803
2797
  for (const task of pipeline.tasks) {
2804
2798
  if (definedParameters.has(task.resultingParameterName)) {
2805
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2799
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2806
2800
  Parameter \`{${task.resultingParameterName}}\` is defined multiple times
2807
2801
 
2808
2802
  ${block(pipelineIdentification)}
2809
2803
  `));
2810
2804
  }
2811
2805
  if (RESERVED_PARAMETER_NAMES.includes(task.resultingParameterName)) {
2812
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2806
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2813
2807
  Parameter name {${task.resultingParameterName}} is reserved, please use different name
2814
2808
 
2815
2809
  ${block(pipelineIdentification)}
@@ -2819,7 +2813,7 @@
2819
2813
  if (task.jokerParameterNames && task.jokerParameterNames.length > 0) {
2820
2814
  if (!task.format &&
2821
2815
  !task.expectations /* <- TODO: Require at least 1 -> min <- expectation to use jokers */) {
2822
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2816
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2823
2817
  Joker parameters are used for {${task.resultingParameterName}} but no expectations are defined
2824
2818
 
2825
2819
  ${block(pipelineIdentification)}
@@ -2827,7 +2821,7 @@
2827
2821
  }
2828
2822
  for (const joker of task.jokerParameterNames) {
2829
2823
  if (!task.dependentParameterNames.includes(joker)) {
2830
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2824
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2831
2825
  Parameter \`{${joker}}\` is used for {${task.resultingParameterName}} as joker but not in \`dependentParameterNames\`
2832
2826
 
2833
2827
  ${block(pipelineIdentification)}
@@ -2838,21 +2832,21 @@
2838
2832
  if (task.expectations) {
2839
2833
  for (const [unit, { min, max }] of Object.entries(task.expectations)) {
2840
2834
  if (min !== undefined && max !== undefined && min > max) {
2841
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2835
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2842
2836
  Min expectation (=${min}) of ${unit} is higher than max expectation (=${max})
2843
2837
 
2844
2838
  ${block(pipelineIdentification)}
2845
2839
  `));
2846
2840
  }
2847
2841
  if (min !== undefined && min < 0) {
2848
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2842
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2849
2843
  Min expectation of ${unit} must be zero or positive
2850
2844
 
2851
2845
  ${block(pipelineIdentification)}
2852
2846
  `));
2853
2847
  }
2854
2848
  if (max !== undefined && max <= 0) {
2855
- throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
2849
+ throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
2856
2850
  Max expectation of ${unit} must be positive
2857
2851
 
2858
2852
  ${block(pipelineIdentification)}
@@ -2874,7 +2868,7 @@
2874
2868
  while (unresovedTasks.length > 0) {
2875
2869
  if (loopLimit-- < 0) {
2876
2870
  // Note: Really UnexpectedError not LimitReachedError - this should not happen and be caught below
2877
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
2871
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
2878
2872
  Loop limit reached during detection of circular dependencies in \`validatePipeline\`
2879
2873
 
2880
2874
  ${block(pipelineIdentification)}
@@ -2884,7 +2878,7 @@
2884
2878
  if (currentlyResovedTasks.length === 0) {
2885
2879
  throw new PipelineLogicError(
2886
2880
  // TODO: [🐎] DRY
2887
- spaceTrim.spaceTrim((block) => `
2881
+ spaceTrim$1.spaceTrim((block) => `
2888
2882
 
2889
2883
  Can not resolve some parameters:
2890
2884
  Either you are using a parameter that is not defined, or there are some circular dependencies.
@@ -3031,7 +3025,7 @@
3031
3025
  * Library of pipelines that groups together pipelines for an application.
3032
3026
  * This implementation is a very thin wrapper around the Array / Map of pipelines.
3033
3027
  *
3034
- * @private internal function of `createCollectionFromJson`, use `createCollectionFromJson` instead
3028
+ * @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
3035
3029
  * @see https://github.com/webgptorg/pipeline#pipeline-collection
3036
3030
  */
3037
3031
  class SimplePipelineCollection {
@@ -3041,14 +3035,14 @@
3041
3035
  * @param pipelines Array of pipeline JSON objects to include in the collection
3042
3036
  *
3043
3037
  * Note: During the construction logic of all pipelines are validated
3044
- * Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
3038
+ * Note: It is not recommended to use this constructor directly, use `createPipelineCollectionFromJson` *(or other variant)* instead
3045
3039
  */
3046
3040
  constructor(...pipelines) {
3047
3041
  this.collection = new Map();
3048
3042
  for (const pipeline of pipelines) {
3049
3043
  // TODO: [👠] DRY
3050
3044
  if (pipeline.pipelineUrl === undefined) {
3051
- throw new PipelineUrlError(spaceTrim.spaceTrim(`
3045
+ throw new PipelineUrlError(spaceTrim$1.spaceTrim(`
3052
3046
  Pipeline with name "${pipeline.title}" does not have defined URL
3053
3047
 
3054
3048
  File:
@@ -3070,7 +3064,7 @@
3070
3064
  pipelineJsonToString(unpreparePipeline(pipeline)) !==
3071
3065
  pipelineJsonToString(unpreparePipeline(this.collection.get(pipeline.pipelineUrl)))) {
3072
3066
  const existing = this.collection.get(pipeline.pipelineUrl);
3073
- throw new PipelineUrlError(spaceTrim.spaceTrim(`
3067
+ throw new PipelineUrlError(spaceTrim$1.spaceTrim(`
3074
3068
  Pipeline with URL ${pipeline.pipelineUrl} is already in the collection 🍎
3075
3069
 
3076
3070
  Conflicting files:
@@ -3102,13 +3096,13 @@
3102
3096
  const pipeline = this.collection.get(url);
3103
3097
  if (!pipeline) {
3104
3098
  if (this.listPipelines().length === 0) {
3105
- throw new NotFoundError(spaceTrim.spaceTrim(`
3099
+ throw new NotFoundError(spaceTrim$1.spaceTrim(`
3106
3100
  Pipeline with url "${url}" not found
3107
3101
 
3108
3102
  No pipelines available
3109
3103
  `));
3110
3104
  }
3111
- throw new NotFoundError(spaceTrim.spaceTrim((block) => `
3105
+ throw new NotFoundError(spaceTrim$1.spaceTrim((block) => `
3112
3106
  Pipeline with url "${url}" not found
3113
3107
 
3114
3108
  Available pipelines:
@@ -3129,16 +3123,16 @@
3129
3123
  }
3130
3124
 
3131
3125
  /**
3132
- * Creates PipelineCollection from array of PipelineJson or PipelineString
3126
+ * Creates `PipelineCollection` from array of PipelineJson or PipelineString
3133
3127
  *
3134
- * Note: Functions `collectionToJson` and `createCollectionFromJson` are complementary
3128
+ * Note: Functions `pipelineCollectionToJson` and `createPipelineCollectionFromJson` are complementary
3135
3129
  * Note: Syntax, parsing, and logic consistency checks are performed on all sources during build
3136
3130
  *
3137
3131
  * @param promptbookSources
3138
3132
  * @returns PipelineCollection
3139
3133
  * @public exported from `@promptbook/core`
3140
3134
  */
3141
- function createCollectionFromJson(...promptbooks) {
3135
+ function createPipelineCollectionFromJson(...promptbooks) {
3142
3136
  return new SimplePipelineCollection(...promptbooks);
3143
3137
  }
3144
3138
 
@@ -3149,7 +3143,7 @@
3149
3143
  */
3150
3144
  class MissingToolsError extends Error {
3151
3145
  constructor(message) {
3152
- super(spaceTrim.spaceTrim((block) => `
3146
+ super(spaceTrim$1.spaceTrim((block) => `
3153
3147
  ${block(message)}
3154
3148
 
3155
3149
  Note: You have probably forgot to provide some tools for pipeline execution or preparation
@@ -3163,6 +3157,7 @@
3163
3157
  /**
3164
3158
  * Generates random token
3165
3159
  *
3160
+ * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
3166
3161
  * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
3167
3162
  *
3168
3163
  * @private internal helper function
@@ -3172,6 +3167,7 @@
3172
3167
  return crypto.randomBytes(randomness).toString('hex');
3173
3168
  }
3174
3169
  /**
3170
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
3175
3171
  * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
3176
3172
  */
3177
3173
 
@@ -3290,6 +3286,22 @@
3290
3286
  }
3291
3287
  }
3292
3288
 
3289
+ /**
3290
+ * This error indicates error from the database
3291
+ *
3292
+ * @public exported from `@promptbook/core`
3293
+ */
3294
+ class DatabaseError extends Error {
3295
+ constructor(message) {
3296
+ super(message);
3297
+ this.name = 'DatabaseError';
3298
+ Object.setPrototypeOf(this, DatabaseError.prototype);
3299
+ }
3300
+ }
3301
+ /**
3302
+ * TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
3303
+ */
3304
+
3293
3305
  /**
3294
3306
  * This error occurs when some expectation is not met in the execution of the pipeline
3295
3307
  *
@@ -3319,6 +3331,19 @@
3319
3331
  }
3320
3332
  }
3321
3333
 
3334
+ /**
3335
+ * This error indicates that promptbook operation is not allowed
3336
+ *
3337
+ * @public exported from `@promptbook/core`
3338
+ */
3339
+ class NotAllowed extends Error {
3340
+ constructor(message) {
3341
+ super(message);
3342
+ this.name = 'NotAllowed';
3343
+ Object.setPrototypeOf(this, NotAllowed.prototype);
3344
+ }
3345
+ }
3346
+
3322
3347
  /**
3323
3348
  * Error thrown when a fetch request fails
3324
3349
  *
@@ -3356,6 +3381,8 @@
3356
3381
  PromptbookFetchError,
3357
3382
  UnexpectedError,
3358
3383
  WrappedError,
3384
+ NotAllowed,
3385
+ DatabaseError,
3359
3386
  // TODO: [🪑]> VersionMismatchError,
3360
3387
  };
3361
3388
  /**
@@ -3540,11 +3567,11 @@
3540
3567
  throw deserializeError(errors[0]);
3541
3568
  }
3542
3569
  else {
3543
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
3570
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
3544
3571
  Multiple errors occurred during Promptbook execution
3545
3572
 
3546
3573
  ${block(errors
3547
- .map(({ name, stack, message }, index) => spaceTrim.spaceTrim((block) => `
3574
+ .map(({ name, stack, message }, index) => spaceTrim$1.spaceTrim((block) => `
3548
3575
  ${name} ${index + 1}:
3549
3576
  ${block(stack || message)}
3550
3577
  `))
@@ -3571,6 +3598,7 @@
3571
3598
  let updatedAt = createdAt;
3572
3599
  const errors = [];
3573
3600
  const warnings = [];
3601
+ const llmCalls = [];
3574
3602
  let currentValue = {};
3575
3603
  let customTldr = null;
3576
3604
  const partialResultSubject = new rxjs.Subject();
@@ -3586,6 +3614,9 @@
3586
3614
  }, (tldrInfo) => {
3587
3615
  customTldr = tldrInfo;
3588
3616
  updatedAt = new Date();
3617
+ }, (llmCall) => {
3618
+ llmCalls.push(llmCall);
3619
+ updatedAt = new Date();
3589
3620
  });
3590
3621
  finalResultPromise
3591
3622
  .catch((error) => {
@@ -3708,7 +3739,7 @@
3708
3739
  }
3709
3740
  return {
3710
3741
  percent: percent,
3711
- message,
3742
+ message: message + ' (!!!fallback)',
3712
3743
  };
3713
3744
  },
3714
3745
  get createdAt() {
@@ -3731,6 +3762,10 @@
3731
3762
  return warnings;
3732
3763
  // <- Note: [1] --||--
3733
3764
  },
3765
+ get llmCalls() {
3766
+ return [...llmCalls, { foo: '!!! bar' }];
3767
+ // <- Note: [1] --||--
3768
+ },
3734
3769
  get currentValue() {
3735
3770
  return currentValue;
3736
3771
  // <- Note: [1] --||--
@@ -4184,6 +4219,7 @@
4184
4219
  return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
4185
4220
  }
4186
4221
  /**
4222
+ * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4187
4223
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
4188
4224
  */
4189
4225
 
@@ -4200,6 +4236,7 @@
4200
4236
  return llmTools;
4201
4237
  }
4202
4238
  /**
4239
+ * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4203
4240
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
4204
4241
  */
4205
4242
 
@@ -4215,7 +4252,7 @@
4215
4252
  throw new MissingToolsError('LLM tools are required for preparing persona');
4216
4253
  }
4217
4254
  // TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
4218
- const collection = createCollectionFromJson(...PipelineCollection);
4255
+ const collection = createPipelineCollectionFromJson(...PipelineCollection);
4219
4256
  const preparePersonaExecutor = createPipelineExecutor({
4220
4257
  pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-persona.book'),
4221
4258
  tools,
@@ -4814,7 +4851,7 @@
4814
4851
  if (task.taskType === 'PROMPT_TASK' &&
4815
4852
  knowledgePiecesCount > 0 &&
4816
4853
  !dependentParameterNames.includes('knowledge')) {
4817
- preparedContent = spaceTrim.spaceTrim(`
4854
+ preparedContent = spaceTrim$1.spaceTrim(`
4818
4855
  {content}
4819
4856
 
4820
4857
  ## Knowledge
@@ -4900,7 +4937,7 @@
4900
4937
  let title = pipeline.title;
4901
4938
  if (title === undefined || title === '' || title === DEFAULT_BOOK_TITLE) {
4902
4939
  // TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
4903
- const collection = createCollectionFromJson(...PipelineCollection);
4940
+ const collection = createPipelineCollectionFromJson(...PipelineCollection);
4904
4941
  const prepareTitleExecutor = createPipelineExecutor({
4905
4942
  pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-title.book'),
4906
4943
  tools,
@@ -5127,7 +5164,7 @@
5127
5164
  }
5128
5165
  catch (error) {
5129
5166
  assertsError(error);
5130
- throw new ParseError(spaceTrim.spaceTrim((block) => `
5167
+ throw new ParseError(spaceTrim$1.spaceTrim((block) => `
5131
5168
  Can not extract variables from the script
5132
5169
  ${block(error.stack || error.message)}
5133
5170
 
@@ -5812,10 +5849,13 @@
5812
5849
  * @public exported from `@promptbook/utils`
5813
5850
  */
5814
5851
  function countLines(text) {
5852
+ if (text === '') {
5853
+ return 0;
5854
+ }
5815
5855
  text = text.replace('\r\n', '\n');
5816
5856
  text = text.replace('\r', '\n');
5817
5857
  const lines = text.split('\n');
5818
- return lines.reduce((count, line) => count + Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 0);
5858
+ return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
5819
5859
  }
5820
5860
  /**
5821
5861
  * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
@@ -5940,6 +5980,8 @@
5940
5980
  * This function provides a common abstraction for result validation that can be used
5941
5981
  * by both execution logic and caching logic to ensure consistency.
5942
5982
  *
5983
+ * Note: [🔂] This function is idempotent.
5984
+ *
5943
5985
  * @param options - The validation options including result string, expectations, and format
5944
5986
  * @returns Validation result with processed string and validity status
5945
5987
  * @private internal function of `createPipelineExecutor` and `cacheLlmTools`
@@ -5959,7 +6001,7 @@
5959
6001
  }
5960
6002
  catch (error) {
5961
6003
  keepUnused(error);
5962
- throw new ExpectError(spaceTrim.spaceTrim((block) => `
6004
+ throw new ExpectError(spaceTrim$1.spaceTrim((block) => `
5963
6005
  Expected valid JSON string
5964
6006
 
5965
6007
  The expected JSON text:
@@ -6008,7 +6050,7 @@
6008
6050
  */
6009
6051
  async function executeAttempts(options) {
6010
6052
  const { jokerParameterNames, priority, maxAttempts, // <- Note: [💂]
6011
- preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, } = options;
6053
+ preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, logLlmCall, } = options;
6012
6054
  const $ongoingTaskResult = {
6013
6055
  $result: null,
6014
6056
  $resultString: null,
@@ -6022,7 +6064,7 @@
6022
6064
  const jokerParameterName = jokerParameterNames[jokerParameterNames.length + attemptIndex];
6023
6065
  // TODO: [🧠][🍭] JOKERS, EXPECTATIONS, POSTPROCESSING and FOREACH
6024
6066
  if (isJokerAttempt && !jokerParameterName) {
6025
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6067
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6026
6068
  Joker not found in attempt ${attemptIndex}
6027
6069
 
6028
6070
  ${block(pipelineIdentification)}
@@ -6033,7 +6075,7 @@
6033
6075
  $ongoingTaskResult.$expectError = null;
6034
6076
  if (isJokerAttempt) {
6035
6077
  if (parameters[jokerParameterName] === undefined) {
6036
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6078
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6037
6079
  Joker parameter {${jokerParameterName}} not defined
6038
6080
 
6039
6081
  ${block(pipelineIdentification)}
@@ -6091,7 +6133,7 @@
6091
6133
  $ongoingTaskResult.$resultString = $ongoingTaskResult.$completionResult.content;
6092
6134
  break variant;
6093
6135
  case 'EMBEDDING':
6094
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6136
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6095
6137
  Embedding model can not be used in pipeline
6096
6138
 
6097
6139
  This should be catched during parsing
@@ -6102,7 +6144,7 @@
6102
6144
  break variant;
6103
6145
  // <- case [🤖]:
6104
6146
  default:
6105
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6147
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6106
6148
  Unknown model variant "${task.modelRequirements.modelVariant}"
6107
6149
 
6108
6150
  ${block(pipelineIdentification)}
@@ -6113,14 +6155,14 @@
6113
6155
  break;
6114
6156
  case 'SCRIPT_TASK':
6115
6157
  if (arrayableToArray(tools.script).length === 0) {
6116
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6158
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6117
6159
  No script execution tools are available
6118
6160
 
6119
6161
  ${block(pipelineIdentification)}
6120
6162
  `));
6121
6163
  }
6122
6164
  if (!task.contentLanguage) {
6123
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6165
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6124
6166
  Script language is not defined for SCRIPT TASK "${task.name}"
6125
6167
 
6126
6168
  ${block(pipelineIdentification)}
@@ -6151,7 +6193,7 @@
6151
6193
  throw $ongoingTaskResult.$scriptPipelineExecutionErrors[0];
6152
6194
  }
6153
6195
  else {
6154
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6196
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6155
6197
  Script execution failed ${$ongoingTaskResult.$scriptPipelineExecutionErrors.length}x
6156
6198
 
6157
6199
  ${block(pipelineIdentification)}
@@ -6165,7 +6207,7 @@
6165
6207
  break taskType;
6166
6208
  case 'DIALOG_TASK':
6167
6209
  if (tools.userInterface === undefined) {
6168
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6210
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6169
6211
  User interface tools are not available
6170
6212
 
6171
6213
  ${block(pipelineIdentification)}
@@ -6183,7 +6225,7 @@
6183
6225
  break taskType;
6184
6226
  // <- case: [🅱]
6185
6227
  default:
6186
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6228
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6187
6229
  Unknown execution type "${task.taskType}"
6188
6230
 
6189
6231
  ${block(pipelineIdentification)}
@@ -6256,14 +6298,10 @@
6256
6298
  });
6257
6299
  }
6258
6300
  finally {
6259
- if (!isJokerAttempt &&
6260
- task.taskType === 'PROMPT_TASK' &&
6261
- $ongoingTaskResult.$prompt
6262
- // <- Note: [2] When some expected parameter is not defined, error will occur in templateParameters
6263
- // In that case we don’t want to make a report about it because it’s not a llm execution error
6264
- ) {
6265
- // TODO: [🧠] Maybe put other taskTypes into report
6266
- $executionReport.promptExecutions.push({
6301
+ if (!isJokerAttempt && task.taskType === 'PROMPT_TASK' && $ongoingTaskResult.$prompt) {
6302
+ // Note: [2] When some expected parameter is not defined, error will occur in templateParameters
6303
+ // In that case we don’t want to make a report about it because it’s not a llm execution error
6304
+ const executionPromptReport = {
6267
6305
  prompt: {
6268
6306
  ...$ongoingTaskResult.$prompt,
6269
6307
  // <- TODO: [🧠] How to pick everyhing except `pipelineUrl`
@@ -6272,13 +6310,20 @@
6272
6310
  error: $ongoingTaskResult.$expectError === null
6273
6311
  ? undefined
6274
6312
  : serializeError($ongoingTaskResult.$expectError),
6275
- });
6313
+ };
6314
+ $executionReport.promptExecutions.push(executionPromptReport);
6315
+ if (logLlmCall) {
6316
+ logLlmCall({
6317
+ modelName: 'model' /* <- TODO: How to get model name from the report */,
6318
+ report: executionPromptReport,
6319
+ });
6320
+ }
6276
6321
  }
6277
6322
  }
6278
6323
  if ($ongoingTaskResult.$expectError !== null && attemptIndex === maxAttempts - 1) {
6279
6324
  // Note: Create a summary of all failures
6280
6325
  const failuresSummary = $ongoingTaskResult.$failedResults
6281
- .map((failure) => spaceTrim.spaceTrim((block) => {
6326
+ .map((failure) => spaceTrim$1.spaceTrim((block) => {
6282
6327
  var _a, _b;
6283
6328
  return `
6284
6329
  Attempt ${failure.attemptIndex + 1}:
@@ -6288,14 +6333,14 @@
6288
6333
  Result:
6289
6334
  ${block(failure.result === null
6290
6335
  ? 'null'
6291
- : spaceTrim.spaceTrim(failure.result)
6336
+ : spaceTrim$1.spaceTrim(failure.result)
6292
6337
  .split('\n')
6293
6338
  .map((line) => `> ${line}`)
6294
6339
  .join('\n'))}
6295
6340
  `;
6296
6341
  }))
6297
6342
  .join('\n\n---\n\n');
6298
- throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => {
6343
+ throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => {
6299
6344
  var _a;
6300
6345
  return `
6301
6346
  LLM execution failed ${maxExecutionAttempts}x
@@ -6315,7 +6360,7 @@
6315
6360
  }
6316
6361
  }
6317
6362
  if ($ongoingTaskResult.$resultString === null) {
6318
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6363
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6319
6364
  Something went wrong and prompt result is null
6320
6365
 
6321
6366
  ${block(pipelineIdentification)}
@@ -6337,9 +6382,9 @@
6337
6382
  * @private internal utility of `createPipelineExecutor`
6338
6383
  */
6339
6384
  async function executeFormatSubvalues(options) {
6340
- const { task, jokerParameterNames, parameters, priority, csvSettings, onProgress, pipelineIdentification } = options;
6385
+ const { task, jokerParameterNames, parameters, priority, csvSettings, onProgress, logLlmCall, pipelineIdentification, } = options;
6341
6386
  if (task.foreach === undefined) {
6342
- return /* not await */ executeAttempts(options);
6387
+ return /* not await */ executeAttempts({ ...options, logLlmCall });
6343
6388
  }
6344
6389
  if (jokerParameterNames.length !== 0) {
6345
6390
  throw new UnexpectedError(spaceTrim__default["default"]((block) => `
@@ -6545,7 +6590,7 @@
6545
6590
  },
6546
6591
  content: task.content,
6547
6592
  parameters,
6548
- };
6593
+ }; /* <- Note: [🤛] */
6549
6594
  const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
6550
6595
  const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
6551
6596
  const { index } = knowledgePiece;
@@ -6621,7 +6666,7 @@
6621
6666
  // Note: Doublecheck that ALL reserved parameters are defined:
6622
6667
  for (const parameterName of RESERVED_PARAMETER_NAMES) {
6623
6668
  if (reservedParameters[parameterName] === undefined) {
6624
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6669
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6625
6670
  Reserved parameter {${parameterName}} is not defined
6626
6671
 
6627
6672
  ${block(pipelineIdentification)}
@@ -6640,14 +6685,14 @@
6640
6685
  * @private internal utility of `createPipelineExecutor`
6641
6686
  */
6642
6687
  async function executeTask(options) {
6643
- const { currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSuppressed, } = options;
6688
+ const { currentTask, preparedPipeline, parametersToPass, tools, onProgress, logLlmCall, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSuppressed, } = options;
6644
6689
  const priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
6645
6690
  // Note: Check consistency of used and dependent parameters which was also done in `validatePipeline`, but it’s good to doublecheck
6646
6691
  const usedParameterNames = extractParameterNamesFromTask(currentTask);
6647
6692
  const dependentParameterNames = new Set(currentTask.dependentParameterNames);
6648
6693
  // TODO: [👩🏾‍🤝‍👩🏻] Use here `mapAvailableToExpectedParameters`
6649
6694
  if (difference(union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)), new Set(RESERVED_PARAMETER_NAMES)).size !== 0) {
6650
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6695
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6651
6696
  Dependent parameters are not consistent with used parameters:
6652
6697
 
6653
6698
  Dependent parameters:
@@ -6691,7 +6736,7 @@
6691
6736
  else if (!definedParameterNames.has(parameterName) && usedParameterNames.has(parameterName)) {
6692
6737
  // Houston, we have a problem
6693
6738
  // Note: Checking part is also done in `validatePipeline`, but it’s good to doublecheck
6694
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6739
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6695
6740
  Parameter \`{${parameterName}}\` is NOT defined
6696
6741
  BUT used in task "${currentTask.title || currentTask.name}"
6697
6742
 
@@ -6719,6 +6764,7 @@
6719
6764
  tools,
6720
6765
  $executionReport,
6721
6766
  onProgress,
6767
+ logLlmCall,
6722
6768
  pipelineIdentification,
6723
6769
  maxExecutionAttempts,
6724
6770
  maxParallelCount,
@@ -6759,9 +6805,32 @@
6759
6805
  for (const parameter of preparedPipeline.parameters.filter(({ isOutput }) => isOutput)) {
6760
6806
  if (parametersToPass[parameter.name] === undefined) {
6761
6807
  // [4]
6762
- $warnings.push(new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6808
+ $warnings.push(new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6763
6809
  Parameter \`{${parameter.name}}\` should be an output parameter, but it was not generated during pipeline execution
6764
6810
 
6811
+ Note: This is a warning which happened after the pipeline was executed, and \`{${parameter.name}}\` was not for some reason defined in output parameters
6812
+
6813
+ All parameters:
6814
+ ${block(preparedPipeline.parameters
6815
+ .map(({ name, isInput, isOutput, description }) => {
6816
+ let line = `\`{${name}}\``;
6817
+ if (isInput) {
6818
+ line += ' `[input parameter]`';
6819
+ }
6820
+ if (isOutput) {
6821
+ line += ' `[output parameter]`';
6822
+ }
6823
+ if (parametersToPass[name] === undefined) {
6824
+ line += ` <- Warning: Should be in the output but its not |`;
6825
+ }
6826
+ if (description) {
6827
+ line += ` ${description}`;
6828
+ }
6829
+ return line;
6830
+ })
6831
+ .map((line, index) => `${index + 1}) ${line}`)
6832
+ .join('\n'))}
6833
+
6765
6834
  ${block(pipelineIdentification)}
6766
6835
  `)));
6767
6836
  continue;
@@ -6782,7 +6851,7 @@
6782
6851
  * @private internal utility of `createPipelineExecutor`
6783
6852
  */
6784
6853
  async function executePipeline(options) {
6785
- const { inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname, isVerbose, } = options;
6854
+ const { inputParameters, tools, onProgress, logLlmCall, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname, isVerbose, } = options;
6786
6855
  let { preparedPipeline } = options;
6787
6856
  if (preparedPipeline === undefined) {
6788
6857
  preparedPipeline = await preparePipeline(pipeline, tools, {
@@ -6844,7 +6913,7 @@
6844
6913
  for (const parameterName of Object.keys(inputParameters)) {
6845
6914
  const parameter = preparedPipeline.parameters.find(({ name }) => name === parameterName);
6846
6915
  if (parameter === undefined) {
6847
- warnings.push(new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6916
+ warnings.push(new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6848
6917
  Extra parameter {${parameterName}} is being passed which is not part of the pipeline.
6849
6918
 
6850
6919
  ${block(pipelineIdentification)}
@@ -6859,7 +6928,7 @@
6859
6928
  // TODO: [🧠] This should be also non-critical error
6860
6929
  return exportJson({
6861
6930
  name: 'pipelineExecutorResult',
6862
- message: spaceTrim.spaceTrim((block) => `
6931
+ message: spaceTrim$1.spaceTrim((block) => `
6863
6932
  Unsuccessful PipelineExecutorResult (with extra parameter {${parameter.name}}) PipelineExecutorResult
6864
6933
 
6865
6934
  ${block(pipelineIdentification)}
@@ -6868,7 +6937,7 @@
6868
6937
  value: {
6869
6938
  isSuccessful: false,
6870
6939
  errors: [
6871
- new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
6940
+ new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6872
6941
  Parameter \`{${parameter.name}}\` is passed as input parameter but it is not input
6873
6942
 
6874
6943
  ${block(pipelineIdentification)}
@@ -6895,7 +6964,7 @@
6895
6964
  while (unresovedTasks.length > 0) {
6896
6965
  if (loopLimit-- < 0) {
6897
6966
  // Note: Really UnexpectedError not LimitReachedError - this should be catched during validatePipeline
6898
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
6967
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6899
6968
  Loop limit reached during resolving parameters pipeline execution
6900
6969
 
6901
6970
  ${block(pipelineIdentification)}
@@ -6905,7 +6974,7 @@
6905
6974
  if (!currentTask && resolving.length === 0) {
6906
6975
  throw new UnexpectedError(
6907
6976
  // TODO: [🐎] DRY
6908
- spaceTrim.spaceTrim((block) => `
6977
+ spaceTrim$1.spaceTrim((block) => `
6909
6978
  Can not resolve some parameters:
6910
6979
 
6911
6980
  ${block(pipelineIdentification)}
@@ -6945,7 +7014,7 @@
6945
7014
  tools,
6946
7015
  onProgress(newOngoingResult) {
6947
7016
  if (isReturned) {
6948
- throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
7017
+ throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
6949
7018
  Can not call \`onProgress\` after pipeline execution is finished
6950
7019
 
6951
7020
  ${block(pipelineIdentification)}
@@ -6960,8 +7029,9 @@
6960
7029
  onProgress(newOngoingResult);
6961
7030
  }
6962
7031
  },
7032
+ logLlmCall,
6963
7033
  $executionReport: executionReport,
6964
- pipelineIdentification: spaceTrim.spaceTrim((block) => `
7034
+ pipelineIdentification: spaceTrim$1.spaceTrim((block) => `
6965
7035
  ${block(pipelineIdentification)}
6966
7036
  Task name: ${currentTask.name}
6967
7037
  Task title: ${currentTask.title}
@@ -7070,7 +7140,7 @@
7070
7140
  preparedPipeline = pipeline;
7071
7141
  }
7072
7142
  else if (isNotPreparedWarningSuppressed !== true) {
7073
- console.warn(spaceTrim.spaceTrim((block) => `
7143
+ console.warn(spaceTrim$1.spaceTrim((block) => `
7074
7144
  Pipeline is not prepared
7075
7145
 
7076
7146
  ${block(pipelineIdentification)}
@@ -7083,7 +7153,7 @@
7083
7153
  // <- TODO: [🏮] Some standard way how to transform errors into warnings and how to handle non-critical fails during the tasks
7084
7154
  }
7085
7155
  let runCount = 0;
7086
- const pipelineExecutorWithCallback = async (inputParameters, onProgress) => {
7156
+ const pipelineExecutorWithCallback = async (inputParameters, onProgress, logLlmCall) => {
7087
7157
  runCount++;
7088
7158
  return /* not await */ executePipeline({
7089
7159
  pipeline,
@@ -7094,7 +7164,8 @@
7094
7164
  inputParameters,
7095
7165
  tools,
7096
7166
  onProgress,
7097
- pipelineIdentification: spaceTrim.spaceTrim((block) => `
7167
+ logLlmCall,
7168
+ pipelineIdentification: spaceTrim$1.spaceTrim((block) => `
7098
7169
  ${block(pipelineIdentification)}
7099
7170
  ${runCount === 1 ? '' : `Run #${runCount}`}
7100
7171
  `),
@@ -7255,7 +7326,7 @@
7255
7326
  }
7256
7327
  const llmTools = getSingleLlmExecutionTools(llm);
7257
7328
  // TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
7258
- const collection = createCollectionFromJson(...PipelineCollection);
7329
+ const collection = createPipelineCollectionFromJson(...PipelineCollection);
7259
7330
  const prepareKnowledgeFromMarkdownExecutor = createPipelineExecutor({
7260
7331
  pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book'),
7261
7332
  tools: {