@promptbook/pdf 0.103.0-9 → 0.104.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -35
- package/esm/index.es.js +260 -171
- package/esm/index.es.js.map +1 -1
- package/esm/typings/books/index.d.ts +0 -81
- package/esm/typings/servers.d.ts +9 -7
- package/esm/typings/src/_packages/browser.index.d.ts +6 -0
- package/esm/typings/src/_packages/cli.index.d.ts +4 -0
- package/esm/typings/src/_packages/components.index.d.ts +22 -8
- package/esm/typings/src/_packages/core.index.d.ts +58 -18
- package/esm/typings/src/_packages/node.index.d.ts +2 -2
- package/esm/typings/src/_packages/remote-server.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +70 -8
- package/esm/typings/src/_packages/utils.index.d.ts +6 -0
- package/esm/typings/src/_packages/wizard.index.d.ts +4 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +20 -5
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +17 -1
- package/esm/typings/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +3 -2
- package/esm/typings/src/book-2.0/agent-source/computeAgentHash.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +3 -3
- package/esm/typings/src/book-2.0/agent-source/createDefaultAgentName.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.d.ts +9 -0
- package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +18 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +1 -1
- package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +3 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +6 -1
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +85 -14
- package/esm/typings/src/book-components/BookEditor/BookEditorActionbar.d.ts +18 -0
- package/esm/typings/src/book-components/BookEditor/BookEditorMonaco.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +17 -0
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +13 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +16 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +15 -0
- package/esm/typings/src/book-components/Chat/MockedChat/MockedChat.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +1 -0
- package/esm/typings/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +4 -0
- package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +67 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +23 -0
- package/esm/typings/src/book-components/Qr/BrandedQrCode.d.ts +18 -0
- package/esm/typings/src/book-components/Qr/GenericQrCode.d.ts +10 -0
- package/esm/typings/src/book-components/Qr/PromptbookQrCode.d.ts +18 -0
- package/esm/typings/src/book-components/Qr/useQrCode.d.ts +15 -0
- package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +15 -0
- package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +12 -0
- package/esm/typings/src/book-components/_common/Modal/Modal.d.ts +2 -2
- package/esm/typings/src/book-components/_common/Tooltip/Tooltip.d.ts +47 -0
- package/esm/typings/src/book-components/icons/AboutIcon.d.ts +9 -0
- package/esm/typings/src/book-components/icons/CameraIcon.d.ts +11 -0
- package/esm/typings/src/book-components/icons/CloseIcon.d.ts +4 -8
- package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +9 -0
- package/esm/typings/src/book-components/icons/ExitFullscreenIcon.d.ts +7 -0
- package/esm/typings/src/book-components/icons/FullscreenIcon.d.ts +7 -0
- package/esm/typings/src/book-components/icons/MenuIcon.d.ts +12 -0
- package/esm/typings/src/book-components/icons/MicIcon.d.ts +8 -0
- package/esm/typings/src/book-components/icons/SendIcon.d.ts +3 -0
- package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/about.d.ts +3 -1
- package/esm/typings/src/cli/cli-commands/hello.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/list-models.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/login.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/make.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/run.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/{start-server.d.ts → start-agents-server.d.ts} +3 -2
- package/esm/typings/src/cli/cli-commands/start-pipelines-server.d.ts +15 -0
- package/esm/typings/src/cli/cli-commands/test-command.d.ts +2 -1
- package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +2 -1
- package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +12 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +75 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +10 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +154 -0
- package/esm/typings/src/collection/{PipelineCollection.d.ts → pipeline-collection/PipelineCollection.d.ts} +7 -3
- package/esm/typings/src/collection/{SimplePipelineCollection.d.ts → pipeline-collection/SimplePipelineCollection.d.ts} +5 -5
- package/esm/typings/src/collection/{constructors/createCollectionFromDirectory.d.ts → pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts} +8 -11
- package/esm/typings/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +13 -0
- package/esm/typings/src/collection/{constructors/createCollectionFromPromise.d.ts → pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts} +6 -5
- package/esm/typings/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.test.d.ts +1 -0
- package/esm/typings/src/collection/{constructors/createCollectionFromUrl.d.ts → pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts} +3 -3
- package/esm/typings/src/collection/{constructors/createSubcollection.d.ts → pipeline-collection/constructors/createPipelineSubcollection.d.ts} +3 -3
- package/esm/typings/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +13 -0
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -5
- package/esm/typings/src/{book-2.0/commitments → commitments}/ACTION/ACTION.d.ts +5 -1
- package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +39 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.test.d.ts +4 -0
- package/esm/typings/src/commitments/COMPONENT/COMPONENT.d.ts +28 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/DELETE/DELETE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/FORMAT/FORMAT.d.ts +5 -1
- package/esm/typings/src/commitments/FROM/FROM.d.ts +34 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/GOAL/GOAL.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/KNOWLEDGE/KNOWLEDGE.d.ts +5 -5
- package/esm/typings/src/commitments/LANGUAGE/LANGUAGE.d.ts +35 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/MEMORY/MEMORY.d.ts +5 -1
- package/esm/typings/src/commitments/MESSAGE/AgentMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/commitments/MESSAGE/InitialMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/MESSAGE/MESSAGE.d.ts +5 -1
- package/esm/typings/src/commitments/MESSAGE/UserMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/META/META.d.ts +5 -1
- package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +48 -0
- package/esm/typings/src/commitments/META_FONT/META_FONT.d.ts +42 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/META_IMAGE/META_IMAGE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/META_LINK/META_LINK.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/MODEL/MODEL.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/NOTE/NOTE.d.ts +5 -1
- package/esm/typings/src/commitments/OPEN/OPEN.d.ts +35 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/PERSONA/PERSONA.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/RULE/RULE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/SAMPLE/SAMPLE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/SCENARIO/SCENARIO.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/STYLE/STYLE.d.ts +5 -1
- package/esm/typings/src/commitments/USE/USE.d.ts +53 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +42 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_MCP/USE_MCP.d.ts +37 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +38 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BaseCommitmentDefinition.d.ts +14 -2
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/CommitmentDefinition.d.ts +6 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/NotYetImplementedCommitmentDefinition.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/createEmptyAgentModelRequirements.d.ts +1 -1
- package/esm/typings/src/commitments/index.d.ts +93 -0
- package/esm/typings/src/config.d.ts +24 -3
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +2 -0
- package/esm/typings/src/errors/0-index.d.ts +6 -0
- package/esm/typings/src/errors/DatabaseError.d.ts +12 -0
- package/esm/typings/src/errors/NotAllowed.d.ts +9 -0
- package/esm/typings/src/errors/WrappedError.d.ts +2 -2
- package/esm/typings/src/execution/AvailableModel.d.ts +1 -0
- package/esm/typings/src/execution/Executables.d.ts +3 -0
- package/esm/typings/src/execution/ExecutionTask.d.ts +12 -3
- package/esm/typings/src/execution/ExecutionTools.d.ts +5 -0
- package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +26 -2
- package/esm/typings/src/execution/PromptResult.d.ts +7 -1
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +5 -0
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +5 -0
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +5 -0
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +5 -0
- package/esm/typings/src/execution/utils/usage-constants.d.ts +4 -124
- package/esm/typings/src/execution/utils/validatePromptResult.d.ts +2 -0
- package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +2 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +2 -1
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/assertUniqueModels.d.ts +12 -0
- package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +72 -0
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +26 -4
- package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +19 -0
- package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +17 -0
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +50 -0
- package/esm/typings/src/llm-providers/agent/RemoteAgentOptions.d.ts +11 -0
- package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +1 -19
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/ollama/OllamaExecutionTools.d.ts +4 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +60 -2
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionToolsOptions.d.ts +7 -1
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +13 -1
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +4 -0
- package/esm/typings/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +6 -6
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.test.d.ts +4 -0
- package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +1 -1
- package/esm/typings/src/pipeline/validatePipelineString.d.ts +2 -0
- package/esm/typings/src/playground/permanent/_boilerplate.d.ts +5 -0
- package/esm/typings/src/playground/permanent/agent-with-browser-playground.d.ts +5 -0
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +1 -0
- package/esm/typings/src/remote-server/startAgentServer.d.ts +26 -0
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +4 -1
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +3 -8
- package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/markitdown/createMarkitdownScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/markitdown/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -9
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -0
- package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +2 -1
- package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +33 -0
- package/esm/typings/src/transpilers/_common/BookTranspilerOptions.d.ts +18 -0
- package/esm/typings/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +15 -0
- package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +16 -0
- package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +15 -0
- package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +16 -0
- package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.test.d.ts +1 -0
- package/esm/typings/src/transpilers/openai-sdk/playground/playground.d.ts +5 -0
- package/esm/typings/src/transpilers/openai-sdk/register.d.ts +15 -0
- package/esm/typings/src/types/LlmCall.d.ts +20 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +13 -1
- package/esm/typings/src/types/ModelVariant.d.ts +1 -1
- package/esm/typings/src/types/Prompt.d.ts +13 -1
- package/esm/typings/src/types/Updatable.d.ts +19 -0
- package/esm/typings/src/types/typeAliases.d.ts +38 -2
- package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
- package/esm/typings/src/utils/color/Color.d.ts +16 -1
- package/esm/typings/src/utils/color/Color.test.d.ts +1 -0
- package/esm/typings/src/utils/color/css-colors.d.ts +1 -0
- package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +0 -3
- package/esm/typings/src/utils/color/operators/darken.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/grayscale.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/lighten.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/saturate.d.ts +1 -1
- package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +16 -0
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -2
- package/esm/typings/src/utils/execCommand/$execCommand.d.ts +2 -1
- package/esm/typings/src/utils/execCommand/$execCommands.d.ts +2 -1
- package/esm/typings/src/utils/files/$induceBookDownload.d.ts +13 -0
- package/esm/typings/src/utils/files/$induceFileDownload.d.ts +13 -0
- package/esm/typings/src/utils/files/ObjectUrl.d.ts +46 -0
- package/esm/typings/src/utils/files/listAllFiles.d.ts +2 -3
- package/esm/typings/src/utils/misc/aboutPromptbookInformation.d.ts +27 -0
- package/esm/typings/src/utils/misc/computeHash.d.ts +11 -0
- package/esm/typings/src/utils/misc/computeHash.test.d.ts +1 -0
- package/esm/typings/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +1 -0
- package/esm/typings/src/utils/misc/xAboutPromptbookInformation.d.ts +13 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -0
- package/esm/typings/src/utils/normalization/normalizeMessageText.d.ts +9 -0
- package/esm/typings/src/utils/normalization/normalizeMessageText.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +3 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -0
- package/esm/typings/src/utils/normalization/titleToName.d.ts +2 -0
- package/esm/typings/src/utils/organization/$sideEffect.d.ts +2 -2
- package/esm/typings/src/utils/organization/$side_effect.d.ts +7 -0
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +2 -2
- package/esm/typings/src/utils/organization/keepUnused.d.ts +2 -2
- package/esm/typings/src/utils/organization/preserve.d.ts +3 -3
- package/esm/typings/src/utils/organization/really_any.d.ts +7 -0
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +31 -0
- package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
- package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
- package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
- package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
- package/esm/typings/src/utils/random/$randomToken.d.ts +2 -0
- package/esm/typings/src/utils/random/CzechNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/EnglishNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/NamePool.d.ts +17 -0
- package/esm/typings/src/utils/random/getNamePool.d.ts +10 -0
- package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +2 -1
- package/esm/typings/src/utils/serialization/asSerializable.d.ts +2 -2
- package/esm/typings/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -2
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +2 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/esm/typings/src/wizard/$getCompiledBook.d.ts +1 -2
- package/package.json +8 -8
- package/umd/index.umd.js +285 -196
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-2.0/commitments/index.d.ts +0 -60
- package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +0 -5
- package/esm/typings/src/book-components/BookEditor/BookEditorWrapper.d.ts +0 -9
- package/esm/typings/src/book-components/BookEditor/config.d.ts +0 -10
- package/esm/typings/src/book-components/Chat/utils/renderMarkdown.d.ts +0 -21
- package/esm/typings/src/collection/collectionToJson.d.ts +0 -13
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +0 -13
- /package/esm/typings/src/{book-components/Chat/utils/renderMarkdown.test.d.ts → book-2.0/agent-source/computeAgentHash.test.d.ts} +0 -0
- /package/esm/typings/src/{collection/constructors/createCollectionFromDirectory.test.d.ts → book-2.0/agent-source/normalizeAgentName.test.d.ts} +0 -0
- /package/esm/typings/src/{collection/constructors/createCollectionFromJson.test.d.ts → book-components/Chat/AgentChat/AgentChat.test.d.ts} +0 -0
- /package/esm/typings/src/collection/{constructors/createCollectionFromPromise.test.d.ts → pipeline-collection/constructors/createPipelineCollectionFromDirectory.test.d.ts} +0 -0
- /package/esm/typings/src/{commands/_common/parseCommand.test.d.ts → collection/pipeline-collection/constructors/createPipelineCollectionFromJson.test.d.ts} +0 -0
- /package/esm/typings/src/collection/{collectionToJson.test.d.ts → pipeline-collection/pipelineCollectionToJson.test.d.ts} +0 -0
- /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BookCommitment.d.ts +0 -0
- /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/ParsedCommitment.d.ts +0 -0
package/umd/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('fs/promises'), require('spacetrim'), require('crypto-js'), require('crypto-js/enc-hex'), require('path'), require('crypto'), require('rxjs'), require('waitasecond'), require('crypto-js/sha256'), require('mime-types'), require('papaparse')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'fs/promises', 'spacetrim', 'crypto-js', 'crypto-js/enc-hex', 'path', 'crypto', 'rxjs', 'waitasecond', 'crypto-js/sha256', 'mime-types', 'papaparse'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-pdf"] = {}, global.promises, global.spaceTrim, global.cryptoJs, global.hexEncoder, global.path, global.crypto, global.rxjs, global.waitasecond, global.sha256, global.mimeTypes, global.papaparse));
|
|
5
|
-
})(this, (function (exports, promises, spaceTrim, cryptoJs, hexEncoder, path, crypto, rxjs, waitasecond, sha256, mimeTypes, papaparse) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-pdf"] = {}, global.promises, global.spaceTrim$1, global.cryptoJs, global.hexEncoder, global.path, global.crypto, global.rxjs, global.waitasecond, global.sha256, global.mimeTypes, global.papaparse));
|
|
5
|
+
})(this, (function (exports, promises, spaceTrim$1, cryptoJs, hexEncoder, path, crypto, rxjs, waitasecond, sha256, mimeTypes, papaparse) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
-
var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim);
|
|
9
|
+
var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim$1);
|
|
10
10
|
var hexEncoder__default = /*#__PURE__*/_interopDefaultLegacy(hexEncoder);
|
|
11
11
|
var sha256__default = /*#__PURE__*/_interopDefaultLegacy(sha256);
|
|
12
12
|
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
* @generated
|
|
18
18
|
* @see https://github.com/webgptorg/book
|
|
19
19
|
*/
|
|
20
|
-
const BOOK_LANGUAGE_VERSION = '
|
|
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.
|
|
27
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-0';
|
|
28
28
|
/**
|
|
29
29
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
30
30
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -47,6 +47,17 @@
|
|
|
47
47
|
function keepUnused(...valuesToKeep) {
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Trims string from all 4 sides
|
|
52
|
+
*
|
|
53
|
+
* Note: This is a re-exported function from the `spacetrim` package which is
|
|
54
|
+
* Developed by same author @hejny as this package
|
|
55
|
+
*
|
|
56
|
+
* @public exported from `@promptbook/utils`
|
|
57
|
+
* @see https://github.com/hejny/spacetrim#usage
|
|
58
|
+
*/
|
|
59
|
+
const spaceTrim = spaceTrim$1.spaceTrim;
|
|
60
|
+
|
|
50
61
|
/**
|
|
51
62
|
* Just marks a place of place where should be something implemented
|
|
52
63
|
* No side effects.
|
|
@@ -108,6 +119,7 @@
|
|
|
108
119
|
* @public exported from `@promptbook/color`
|
|
109
120
|
*/
|
|
110
121
|
const CSS_COLORS = {
|
|
122
|
+
promptbook: '#79EAFD',
|
|
111
123
|
transparent: 'rgba(0,0,0,0)',
|
|
112
124
|
aliceblue: '#f0f8ff',
|
|
113
125
|
antiquewhite: '#faebd7',
|
|
@@ -289,9 +301,6 @@
|
|
|
289
301
|
throw new Error(`${channelName} channel is greater than 255, it is ${value}`);
|
|
290
302
|
}
|
|
291
303
|
}
|
|
292
|
-
/**
|
|
293
|
-
* TODO: [🧠][🚓] Is/which combination it better to use asserts/check, validate or is utility function?
|
|
294
|
-
*/
|
|
295
304
|
|
|
296
305
|
/**
|
|
297
306
|
* Color object represents an RGB color with alpha channel
|
|
@@ -311,21 +320,61 @@
|
|
|
311
320
|
* @param color
|
|
312
321
|
* @returns Color object
|
|
313
322
|
*/
|
|
314
|
-
static from(color) {
|
|
315
|
-
if (color
|
|
323
|
+
static from(color, _isSingleValue = false) {
|
|
324
|
+
if (color === '') {
|
|
325
|
+
throw new Error(`Can not create color from empty string`);
|
|
326
|
+
}
|
|
327
|
+
else if (color instanceof Color) {
|
|
316
328
|
return take(color);
|
|
317
329
|
}
|
|
318
330
|
else if (Color.isColor(color)) {
|
|
319
331
|
return take(color);
|
|
320
332
|
}
|
|
321
333
|
else if (typeof color === 'string') {
|
|
322
|
-
|
|
334
|
+
try {
|
|
335
|
+
return Color.fromString(color);
|
|
336
|
+
}
|
|
337
|
+
catch (error) {
|
|
338
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
339
|
+
if (_isSingleValue) {
|
|
340
|
+
throw error;
|
|
341
|
+
}
|
|
342
|
+
const parts = color.split(/[\s+,;|]/);
|
|
343
|
+
if (parts.length > 0) {
|
|
344
|
+
return Color.from(parts[0].trim(), true);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
throw new Error(`Can not create color from given string "${color}"`);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
323
350
|
}
|
|
324
351
|
else {
|
|
325
352
|
console.error({ color });
|
|
326
353
|
throw new Error(`Can not create color from given object`);
|
|
327
354
|
}
|
|
328
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* Creates a new Color instance from miscellaneous formats
|
|
358
|
+
* It just does not throw error when it fails, it returns PROMPTBOOK_COLOR instead
|
|
359
|
+
*
|
|
360
|
+
* @param color
|
|
361
|
+
* @returns Color object
|
|
362
|
+
*/
|
|
363
|
+
static fromSafe(color) {
|
|
364
|
+
try {
|
|
365
|
+
return Color.from(color);
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
369
|
+
console.warn(spaceTrim((block) => `
|
|
370
|
+
Color.fromSafe error:
|
|
371
|
+
${block(error.message)}
|
|
372
|
+
|
|
373
|
+
Returning default PROMPTBOOK_COLOR.
|
|
374
|
+
`));
|
|
375
|
+
return Color.fromString('promptbook');
|
|
376
|
+
}
|
|
377
|
+
}
|
|
329
378
|
/**
|
|
330
379
|
* Creates a new Color instance from miscellaneous string formats
|
|
331
380
|
*
|
|
@@ -393,6 +442,9 @@
|
|
|
393
442
|
if (hex.length === 3) {
|
|
394
443
|
return Color.fromHex3(hex);
|
|
395
444
|
}
|
|
445
|
+
if (hex.length === 4) {
|
|
446
|
+
return Color.fromHex4(hex);
|
|
447
|
+
}
|
|
396
448
|
if (hex.length === 6) {
|
|
397
449
|
return Color.fromHex6(hex);
|
|
398
450
|
}
|
|
@@ -413,6 +465,19 @@
|
|
|
413
465
|
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
414
466
|
return take(new Color(r, g, b));
|
|
415
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
|
|
470
|
+
*
|
|
471
|
+
* @param color in hex for example `09df`
|
|
472
|
+
* @returns Color object
|
|
473
|
+
*/
|
|
474
|
+
static fromHex4(hex) {
|
|
475
|
+
const r = parseInt(hex.substr(0, 1), 16) * 16;
|
|
476
|
+
const g = parseInt(hex.substr(1, 1), 16) * 16;
|
|
477
|
+
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
478
|
+
const a = parseInt(hex.substr(3, 1), 16) * 16;
|
|
479
|
+
return take(new Color(r, g, b, a));
|
|
480
|
+
}
|
|
416
481
|
/**
|
|
417
482
|
* Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
|
|
418
483
|
*
|
|
@@ -603,7 +668,8 @@
|
|
|
603
668
|
* @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
|
|
604
669
|
*/
|
|
605
670
|
static isHexColorString(value) {
|
|
606
|
-
return typeof value === 'string' &&
|
|
671
|
+
return (typeof value === 'string' &&
|
|
672
|
+
/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value));
|
|
607
673
|
}
|
|
608
674
|
/**
|
|
609
675
|
* Creates new Color object
|
|
@@ -718,6 +784,23 @@
|
|
|
718
784
|
* TODO: Maybe connect with textures
|
|
719
785
|
*/
|
|
720
786
|
|
|
787
|
+
/**
|
|
788
|
+
* Makes color transformer which returns a grayscale version of the color
|
|
789
|
+
*
|
|
790
|
+
* @param amount from 0 to 1
|
|
791
|
+
*
|
|
792
|
+
* @public exported from `@promptbook/color`
|
|
793
|
+
*/
|
|
794
|
+
function grayscale(amount) {
|
|
795
|
+
return ({ red, green, blue, alpha }) => {
|
|
796
|
+
const average = (red + green + blue) / 3;
|
|
797
|
+
red = Math.round(average * amount + red * (1 - amount));
|
|
798
|
+
green = Math.round(average * amount + green * (1 - amount));
|
|
799
|
+
blue = Math.round(average * amount + blue * (1 - amount));
|
|
800
|
+
return Color.fromValues(red, green, blue, alpha);
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
|
|
721
804
|
/**
|
|
722
805
|
* Converts HSL values to RGB values
|
|
723
806
|
*
|
|
@@ -833,102 +916,6 @@
|
|
|
833
916
|
* TODO: Maybe implement by mix+hsl
|
|
834
917
|
*/
|
|
835
918
|
|
|
836
|
-
/**
|
|
837
|
-
* Calculates distance between two colors
|
|
838
|
-
*
|
|
839
|
-
* @param color1 first color
|
|
840
|
-
* @param color2 second color
|
|
841
|
-
*
|
|
842
|
-
* Note: This function is inefficient. Use colorDistanceSquared instead if possible.
|
|
843
|
-
*
|
|
844
|
-
* @public exported from `@promptbook/color`
|
|
845
|
-
*/
|
|
846
|
-
/**
|
|
847
|
-
* Calculates distance between two colors without square root
|
|
848
|
-
*
|
|
849
|
-
* @param color1 first color
|
|
850
|
-
* @param color2 second color
|
|
851
|
-
*
|
|
852
|
-
* @public exported from `@promptbook/color`
|
|
853
|
-
*/
|
|
854
|
-
function colorDistanceSquared(color1, color2) {
|
|
855
|
-
const rmean = (color1.red + color2.red) / 2;
|
|
856
|
-
const r = color1.red - color2.red;
|
|
857
|
-
const g = color1.green - color2.green;
|
|
858
|
-
const b = color1.blue - color2.blue;
|
|
859
|
-
const weightR = 2 + rmean / 256;
|
|
860
|
-
const weightG = 4.0;
|
|
861
|
-
const weightB = 2 + (255 - rmean) / 256;
|
|
862
|
-
const distance = weightR * r * r + weightG * g * g + weightB * b * b;
|
|
863
|
-
return distance;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
/**
|
|
867
|
-
* Makes color transformer which finds the nearest color from the given list
|
|
868
|
-
*
|
|
869
|
-
* @param colors array of colors to choose from
|
|
870
|
-
*
|
|
871
|
-
* @public exported from `@promptbook/color`
|
|
872
|
-
*/
|
|
873
|
-
function nearest(...colors) {
|
|
874
|
-
return (color) => {
|
|
875
|
-
const distances = colors.map((c) => colorDistanceSquared(c, color));
|
|
876
|
-
const minDistance = Math.min(...distances);
|
|
877
|
-
const minIndex = distances.indexOf(minDistance);
|
|
878
|
-
const nearestColor = colors[minIndex];
|
|
879
|
-
return nearestColor;
|
|
880
|
-
};
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
/**
|
|
884
|
-
* Color transformer which returns the negative color
|
|
885
|
-
*
|
|
886
|
-
* @public exported from `@promptbook/color`
|
|
887
|
-
*/
|
|
888
|
-
function negative(color) {
|
|
889
|
-
const r = 255 - color.red;
|
|
890
|
-
const g = 255 - color.green;
|
|
891
|
-
const b = 255 - color.blue;
|
|
892
|
-
return Color.fromValues(r, g, b, color.alpha);
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
/**
|
|
896
|
-
* Makes color transformer which finds the furthest color from the given list
|
|
897
|
-
*
|
|
898
|
-
* @param colors array of colors to choose from
|
|
899
|
-
*
|
|
900
|
-
* @public exported from `@promptbook/color`
|
|
901
|
-
*/
|
|
902
|
-
function furthest(...colors) {
|
|
903
|
-
return (color) => {
|
|
904
|
-
const furthestColor = negative(nearest(...colors.map(negative))(color));
|
|
905
|
-
return furthestColor;
|
|
906
|
-
};
|
|
907
|
-
}
|
|
908
|
-
/**
|
|
909
|
-
* Makes color transformer which finds the best text color (black or white) for the given background color
|
|
910
|
-
*
|
|
911
|
-
* @public exported from `@promptbook/color`
|
|
912
|
-
*/
|
|
913
|
-
furthest(Color.get('white'), Color.from('black'));
|
|
914
|
-
|
|
915
|
-
/**
|
|
916
|
-
* Makes color transformer which returns a grayscale version of the color
|
|
917
|
-
*
|
|
918
|
-
* @param amount from 0 to 1
|
|
919
|
-
*
|
|
920
|
-
* @public exported from `@promptbook/color`
|
|
921
|
-
*/
|
|
922
|
-
function grayscale(amount) {
|
|
923
|
-
return ({ red, green, blue, alpha }) => {
|
|
924
|
-
const average = (red + green + blue) / 3;
|
|
925
|
-
red = Math.round(average * amount + red * (1 - amount));
|
|
926
|
-
green = Math.round(average * amount + green * (1 - amount));
|
|
927
|
-
blue = Math.round(average * amount + blue * (1 - amount));
|
|
928
|
-
return Color.fromValues(red, green, blue, alpha);
|
|
929
|
-
};
|
|
930
|
-
}
|
|
931
|
-
|
|
932
919
|
/**
|
|
933
920
|
* Makes color transformer which saturate the given color
|
|
934
921
|
*
|
|
@@ -997,16 +984,32 @@
|
|
|
997
984
|
*
|
|
998
985
|
* @public exported from `@promptbook/core`
|
|
999
986
|
*/
|
|
1000
|
-
const PROMPTBOOK_COLOR = Color.
|
|
1001
|
-
// <- TODO: [🧠] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
987
|
+
const PROMPTBOOK_COLOR = Color.fromString('promptbook');
|
|
988
|
+
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
1002
989
|
/**
|
|
1003
|
-
*
|
|
990
|
+
* Colors for syntax highlighting in the `<BookEditor/>`
|
|
991
|
+
*
|
|
992
|
+
* TODO: [🗽] Unite branding and make single place for it
|
|
993
|
+
*
|
|
994
|
+
* @public exported from `@promptbook/core`
|
|
995
|
+
*/
|
|
996
|
+
({
|
|
997
|
+
TITLE: Color.fromHex('#244EA8'),
|
|
998
|
+
LINE: Color.fromHex('#eeeeee'),
|
|
999
|
+
SEPARATOR: Color.fromHex('#cccccc'),
|
|
1000
|
+
COMMITMENT: Color.fromHex('#DA0F78'),
|
|
1001
|
+
PARAMETER: Color.fromHex('#8e44ad'),
|
|
1002
|
+
});
|
|
1003
|
+
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
1004
|
+
/**
|
|
1005
|
+
* Chat color of the Promptbook (in chat)
|
|
1004
1006
|
*
|
|
1005
1007
|
* TODO: [🗽] Unite branding and make single place for it
|
|
1006
1008
|
*
|
|
1007
1009
|
* @public exported from `@promptbook/core`
|
|
1008
1010
|
*/
|
|
1009
1011
|
PROMPTBOOK_COLOR.then(lighten(0.1)).then(saturate(0.9)).then(grayscale(0.9));
|
|
1012
|
+
// <- TODO: [🧠][🈵] Using `Color` and `lighten`, `saturate`,... here increases the package size approx 3kb, maybe remove it
|
|
1010
1013
|
/**
|
|
1011
1014
|
* Color of the user (in chat)
|
|
1012
1015
|
*
|
|
@@ -1015,6 +1018,7 @@
|
|
|
1015
1018
|
* @public exported from `@promptbook/core`
|
|
1016
1019
|
*/
|
|
1017
1020
|
Color.fromHex('#1D4ED8');
|
|
1021
|
+
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
1018
1022
|
/**
|
|
1019
1023
|
* When the title is not provided, the default title is used
|
|
1020
1024
|
*
|
|
@@ -1101,7 +1105,7 @@
|
|
|
1101
1105
|
* @public exported from `@promptbook/core`
|
|
1102
1106
|
*/
|
|
1103
1107
|
const DEFAULT_MAX_EXECUTION_ATTEMPTS = 7; // <- TODO: [🤹♂️]
|
|
1104
|
-
// <- TODO: [🕝] Make also `
|
|
1108
|
+
// <- TODO: [🕝] Make also `AGENTS_DIRNAME_ALTERNATIVES`
|
|
1105
1109
|
// TODO: Just `.promptbook` in config, hardcode subfolders like `download-cache` or `execution-cache`
|
|
1106
1110
|
/**
|
|
1107
1111
|
* Where to store the temporary downloads
|
|
@@ -1247,7 +1251,7 @@
|
|
|
1247
1251
|
*/
|
|
1248
1252
|
class UnexpectedError extends Error {
|
|
1249
1253
|
constructor(message) {
|
|
1250
|
-
super(spaceTrim.spaceTrim((block) => `
|
|
1254
|
+
super(spaceTrim$1.spaceTrim((block) => `
|
|
1251
1255
|
${block(message)}
|
|
1252
1256
|
|
|
1253
1257
|
Note: This error should not happen.
|
|
@@ -1583,6 +1587,8 @@
|
|
|
1583
1587
|
/**
|
|
1584
1588
|
* Converts a given text to kebab-case format.
|
|
1585
1589
|
*
|
|
1590
|
+
* Note: [🔂] This function is idempotent.
|
|
1591
|
+
*
|
|
1586
1592
|
* @param text The text to be converted.
|
|
1587
1593
|
* @returns The kebab-case formatted string.
|
|
1588
1594
|
* @example 'hello-world'
|
|
@@ -1738,6 +1744,8 @@
|
|
|
1738
1744
|
/**
|
|
1739
1745
|
* Converts a title string into a normalized name.
|
|
1740
1746
|
*
|
|
1747
|
+
* Note: [🔂] This function is idempotent.
|
|
1748
|
+
*
|
|
1741
1749
|
* @param value The title string to be converted to a name.
|
|
1742
1750
|
* @returns A normalized name derived from the input title.
|
|
1743
1751
|
* @example 'Hello World!' -> 'hello-world'
|
|
@@ -1829,7 +1837,7 @@
|
|
|
1829
1837
|
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
1830
1838
|
*/
|
|
1831
1839
|
|
|
1832
|
-
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-8",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"}];
|
|
1840
|
+
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"}];
|
|
1833
1841
|
|
|
1834
1842
|
/**
|
|
1835
1843
|
* Checks if value is valid email
|
|
@@ -1871,7 +1879,7 @@
|
|
|
1871
1879
|
constructor(whatWasThrown) {
|
|
1872
1880
|
const tag = `[🤮]`;
|
|
1873
1881
|
console.error(tag, whatWasThrown);
|
|
1874
|
-
super(spaceTrim.spaceTrim(`
|
|
1882
|
+
super(spaceTrim$1.spaceTrim(`
|
|
1875
1883
|
Non-Error object was thrown
|
|
1876
1884
|
|
|
1877
1885
|
Note: Look for ${tag} in the console for more details
|
|
@@ -1936,6 +1944,8 @@
|
|
|
1936
1944
|
* Function `validatePipelineString` will validate the if the string is a valid pipeline string
|
|
1937
1945
|
* 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.
|
|
1938
1946
|
*
|
|
1947
|
+
* Note: [🔂] This function is idempotent.
|
|
1948
|
+
*
|
|
1939
1949
|
* @param {string} pipelineString the candidate for a pipeline string
|
|
1940
1950
|
* @returns {PipelineString} the same string as input, but validated as valid
|
|
1941
1951
|
* @throws {ParseError} if the string is not a valid pipeline string
|
|
@@ -2320,7 +2330,7 @@
|
|
|
2320
2330
|
TODO: [🧠] Is there a better implementation?
|
|
2321
2331
|
> const propertyNames = Object.getOwnPropertyNames(objectValue);
|
|
2322
2332
|
> for (const propertyName of propertyNames) {
|
|
2323
|
-
> const value = (objectValue as
|
|
2333
|
+
> const value = (objectValue as chococake)[propertyName];
|
|
2324
2334
|
> if (value && typeof value === 'object') {
|
|
2325
2335
|
> deepClone(value);
|
|
2326
2336
|
> }
|
|
@@ -2525,6 +2535,8 @@
|
|
|
2525
2535
|
* - if it is valid json
|
|
2526
2536
|
* - if it is meaningful
|
|
2527
2537
|
*
|
|
2538
|
+
* Note: [🔂] This function is idempotent.
|
|
2539
|
+
*
|
|
2528
2540
|
* @param pipeline valid or invalid PipelineJson
|
|
2529
2541
|
* @returns the same pipeline if it is logically valid
|
|
2530
2542
|
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
@@ -2542,7 +2554,7 @@
|
|
|
2542
2554
|
if (!(error instanceof PipelineLogicError)) {
|
|
2543
2555
|
throw error;
|
|
2544
2556
|
}
|
|
2545
|
-
console.error(spaceTrim.spaceTrim((block) => `
|
|
2557
|
+
console.error(spaceTrim$1.spaceTrim((block) => `
|
|
2546
2558
|
Pipeline is not valid but logic errors are temporarily disabled via \`IS_PIPELINE_LOGIC_VALIDATED\`
|
|
2547
2559
|
|
|
2548
2560
|
${block(error.message)}
|
|
@@ -2569,7 +2581,7 @@
|
|
|
2569
2581
|
})();
|
|
2570
2582
|
if (pipeline.pipelineUrl !== undefined && !isValidPipelineUrl(pipeline.pipelineUrl)) {
|
|
2571
2583
|
// <- Note: [🚲]
|
|
2572
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2584
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2573
2585
|
Invalid promptbook URL "${pipeline.pipelineUrl}"
|
|
2574
2586
|
|
|
2575
2587
|
${block(pipelineIdentification)}
|
|
@@ -2577,7 +2589,7 @@
|
|
|
2577
2589
|
}
|
|
2578
2590
|
if (pipeline.bookVersion !== undefined && !isValidPromptbookVersion(pipeline.bookVersion)) {
|
|
2579
2591
|
// <- Note: [🚲]
|
|
2580
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2592
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2581
2593
|
Invalid Promptbook Version "${pipeline.bookVersion}"
|
|
2582
2594
|
|
|
2583
2595
|
${block(pipelineIdentification)}
|
|
@@ -2586,7 +2598,7 @@
|
|
|
2586
2598
|
// TODO: [🧠] Maybe do here some proper JSON-schema / ZOD checking
|
|
2587
2599
|
if (!Array.isArray(pipeline.parameters)) {
|
|
2588
2600
|
// TODO: [🧠] what is the correct error tp throw - maybe PromptbookSchemaError
|
|
2589
|
-
throw new ParseError(spaceTrim.spaceTrim((block) => `
|
|
2601
|
+
throw new ParseError(spaceTrim$1.spaceTrim((block) => `
|
|
2590
2602
|
Pipeline is valid JSON but with wrong structure
|
|
2591
2603
|
|
|
2592
2604
|
\`PipelineJson.parameters\` expected to be an array, but got ${typeof pipeline.parameters}
|
|
@@ -2597,7 +2609,7 @@
|
|
|
2597
2609
|
// TODO: [🧠] Maybe do here some proper JSON-schema / ZOD checking
|
|
2598
2610
|
if (!Array.isArray(pipeline.tasks)) {
|
|
2599
2611
|
// TODO: [🧠] what is the correct error tp throw - maybe PromptbookSchemaError
|
|
2600
|
-
throw new ParseError(spaceTrim.spaceTrim((block) => `
|
|
2612
|
+
throw new ParseError(spaceTrim$1.spaceTrim((block) => `
|
|
2601
2613
|
Pipeline is valid JSON but with wrong structure
|
|
2602
2614
|
|
|
2603
2615
|
\`PipelineJson.tasks\` expected to be an array, but got ${typeof pipeline.tasks}
|
|
@@ -2623,7 +2635,7 @@
|
|
|
2623
2635
|
// Note: Check each parameter individually
|
|
2624
2636
|
for (const parameter of pipeline.parameters) {
|
|
2625
2637
|
if (parameter.isInput && parameter.isOutput) {
|
|
2626
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2638
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2627
2639
|
|
|
2628
2640
|
Parameter \`{${parameter.name}}\` can not be both input and output
|
|
2629
2641
|
|
|
@@ -2634,7 +2646,7 @@
|
|
|
2634
2646
|
if (!parameter.isInput &&
|
|
2635
2647
|
!parameter.isOutput &&
|
|
2636
2648
|
!pipeline.tasks.some((task) => task.dependentParameterNames.includes(parameter.name))) {
|
|
2637
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2649
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2638
2650
|
Parameter \`{${parameter.name}}\` is created but not used
|
|
2639
2651
|
|
|
2640
2652
|
You can declare {${parameter.name}} as output parameter by adding in the header:
|
|
@@ -2646,7 +2658,7 @@
|
|
|
2646
2658
|
}
|
|
2647
2659
|
// Note: Testing that parameter is either input or result of some task
|
|
2648
2660
|
if (!parameter.isInput && !pipeline.tasks.some((task) => task.resultingParameterName === parameter.name)) {
|
|
2649
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2661
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2650
2662
|
Parameter \`{${parameter.name}}\` is declared but not defined
|
|
2651
2663
|
|
|
2652
2664
|
You can do one of these:
|
|
@@ -2662,14 +2674,14 @@
|
|
|
2662
2674
|
// Note: Checking each task individually
|
|
2663
2675
|
for (const task of pipeline.tasks) {
|
|
2664
2676
|
if (definedParameters.has(task.resultingParameterName)) {
|
|
2665
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2677
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2666
2678
|
Parameter \`{${task.resultingParameterName}}\` is defined multiple times
|
|
2667
2679
|
|
|
2668
2680
|
${block(pipelineIdentification)}
|
|
2669
2681
|
`));
|
|
2670
2682
|
}
|
|
2671
2683
|
if (RESERVED_PARAMETER_NAMES.includes(task.resultingParameterName)) {
|
|
2672
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2684
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2673
2685
|
Parameter name {${task.resultingParameterName}} is reserved, please use different name
|
|
2674
2686
|
|
|
2675
2687
|
${block(pipelineIdentification)}
|
|
@@ -2679,7 +2691,7 @@
|
|
|
2679
2691
|
if (task.jokerParameterNames && task.jokerParameterNames.length > 0) {
|
|
2680
2692
|
if (!task.format &&
|
|
2681
2693
|
!task.expectations /* <- TODO: Require at least 1 -> min <- expectation to use jokers */) {
|
|
2682
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2694
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2683
2695
|
Joker parameters are used for {${task.resultingParameterName}} but no expectations are defined
|
|
2684
2696
|
|
|
2685
2697
|
${block(pipelineIdentification)}
|
|
@@ -2687,7 +2699,7 @@
|
|
|
2687
2699
|
}
|
|
2688
2700
|
for (const joker of task.jokerParameterNames) {
|
|
2689
2701
|
if (!task.dependentParameterNames.includes(joker)) {
|
|
2690
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2702
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2691
2703
|
Parameter \`{${joker}}\` is used for {${task.resultingParameterName}} as joker but not in \`dependentParameterNames\`
|
|
2692
2704
|
|
|
2693
2705
|
${block(pipelineIdentification)}
|
|
@@ -2698,21 +2710,21 @@
|
|
|
2698
2710
|
if (task.expectations) {
|
|
2699
2711
|
for (const [unit, { min, max }] of Object.entries(task.expectations)) {
|
|
2700
2712
|
if (min !== undefined && max !== undefined && min > max) {
|
|
2701
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2713
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2702
2714
|
Min expectation (=${min}) of ${unit} is higher than max expectation (=${max})
|
|
2703
2715
|
|
|
2704
2716
|
${block(pipelineIdentification)}
|
|
2705
2717
|
`));
|
|
2706
2718
|
}
|
|
2707
2719
|
if (min !== undefined && min < 0) {
|
|
2708
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2720
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2709
2721
|
Min expectation of ${unit} must be zero or positive
|
|
2710
2722
|
|
|
2711
2723
|
${block(pipelineIdentification)}
|
|
2712
2724
|
`));
|
|
2713
2725
|
}
|
|
2714
2726
|
if (max !== undefined && max <= 0) {
|
|
2715
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2727
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2716
2728
|
Max expectation of ${unit} must be positive
|
|
2717
2729
|
|
|
2718
2730
|
${block(pipelineIdentification)}
|
|
@@ -2734,7 +2746,7 @@
|
|
|
2734
2746
|
while (unresovedTasks.length > 0) {
|
|
2735
2747
|
if (loopLimit-- < 0) {
|
|
2736
2748
|
// Note: Really UnexpectedError not LimitReachedError - this should not happen and be caught below
|
|
2737
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
2749
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
2738
2750
|
Loop limit reached during detection of circular dependencies in \`validatePipeline\`
|
|
2739
2751
|
|
|
2740
2752
|
${block(pipelineIdentification)}
|
|
@@ -2744,7 +2756,7 @@
|
|
|
2744
2756
|
if (currentlyResovedTasks.length === 0) {
|
|
2745
2757
|
throw new PipelineLogicError(
|
|
2746
2758
|
// TODO: [🐎] DRY
|
|
2747
|
-
spaceTrim.spaceTrim((block) => `
|
|
2759
|
+
spaceTrim$1.spaceTrim((block) => `
|
|
2748
2760
|
|
|
2749
2761
|
Can not resolve some parameters:
|
|
2750
2762
|
Either you are using a parameter that is not defined, or there are some circular dependencies.
|
|
@@ -2891,7 +2903,7 @@
|
|
|
2891
2903
|
* Library of pipelines that groups together pipelines for an application.
|
|
2892
2904
|
* This implementation is a very thin wrapper around the Array / Map of pipelines.
|
|
2893
2905
|
*
|
|
2894
|
-
* @private internal function of `
|
|
2906
|
+
* @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
|
|
2895
2907
|
* @see https://github.com/webgptorg/pipeline#pipeline-collection
|
|
2896
2908
|
*/
|
|
2897
2909
|
class SimplePipelineCollection {
|
|
@@ -2901,14 +2913,14 @@
|
|
|
2901
2913
|
* @param pipelines Array of pipeline JSON objects to include in the collection
|
|
2902
2914
|
*
|
|
2903
2915
|
* Note: During the construction logic of all pipelines are validated
|
|
2904
|
-
* Note: It is not recommended to use this constructor directly, use `
|
|
2916
|
+
* Note: It is not recommended to use this constructor directly, use `createPipelineCollectionFromJson` *(or other variant)* instead
|
|
2905
2917
|
*/
|
|
2906
2918
|
constructor(...pipelines) {
|
|
2907
2919
|
this.collection = new Map();
|
|
2908
2920
|
for (const pipeline of pipelines) {
|
|
2909
2921
|
// TODO: [👠] DRY
|
|
2910
2922
|
if (pipeline.pipelineUrl === undefined) {
|
|
2911
|
-
throw new PipelineUrlError(spaceTrim.spaceTrim(`
|
|
2923
|
+
throw new PipelineUrlError(spaceTrim$1.spaceTrim(`
|
|
2912
2924
|
Pipeline with name "${pipeline.title}" does not have defined URL
|
|
2913
2925
|
|
|
2914
2926
|
File:
|
|
@@ -2930,7 +2942,7 @@
|
|
|
2930
2942
|
pipelineJsonToString(unpreparePipeline(pipeline)) !==
|
|
2931
2943
|
pipelineJsonToString(unpreparePipeline(this.collection.get(pipeline.pipelineUrl)))) {
|
|
2932
2944
|
const existing = this.collection.get(pipeline.pipelineUrl);
|
|
2933
|
-
throw new PipelineUrlError(spaceTrim.spaceTrim(`
|
|
2945
|
+
throw new PipelineUrlError(spaceTrim$1.spaceTrim(`
|
|
2934
2946
|
Pipeline with URL ${pipeline.pipelineUrl} is already in the collection 🍎
|
|
2935
2947
|
|
|
2936
2948
|
Conflicting files:
|
|
@@ -2962,13 +2974,13 @@
|
|
|
2962
2974
|
const pipeline = this.collection.get(url);
|
|
2963
2975
|
if (!pipeline) {
|
|
2964
2976
|
if (this.listPipelines().length === 0) {
|
|
2965
|
-
throw new NotFoundError(spaceTrim.spaceTrim(`
|
|
2977
|
+
throw new NotFoundError(spaceTrim$1.spaceTrim(`
|
|
2966
2978
|
Pipeline with url "${url}" not found
|
|
2967
2979
|
|
|
2968
2980
|
No pipelines available
|
|
2969
2981
|
`));
|
|
2970
2982
|
}
|
|
2971
|
-
throw new NotFoundError(spaceTrim.spaceTrim((block) => `
|
|
2983
|
+
throw new NotFoundError(spaceTrim$1.spaceTrim((block) => `
|
|
2972
2984
|
Pipeline with url "${url}" not found
|
|
2973
2985
|
|
|
2974
2986
|
Available pipelines:
|
|
@@ -2989,16 +3001,16 @@
|
|
|
2989
3001
|
}
|
|
2990
3002
|
|
|
2991
3003
|
/**
|
|
2992
|
-
* Creates PipelineCollection from array of PipelineJson or PipelineString
|
|
3004
|
+
* Creates `PipelineCollection` from array of PipelineJson or PipelineString
|
|
2993
3005
|
*
|
|
2994
|
-
* Note: Functions `
|
|
3006
|
+
* Note: Functions `pipelineCollectionToJson` and `createPipelineCollectionFromJson` are complementary
|
|
2995
3007
|
* Note: Syntax, parsing, and logic consistency checks are performed on all sources during build
|
|
2996
3008
|
*
|
|
2997
3009
|
* @param promptbookSources
|
|
2998
3010
|
* @returns PipelineCollection
|
|
2999
3011
|
* @public exported from `@promptbook/core`
|
|
3000
3012
|
*/
|
|
3001
|
-
function
|
|
3013
|
+
function createPipelineCollectionFromJson(...promptbooks) {
|
|
3002
3014
|
return new SimplePipelineCollection(...promptbooks);
|
|
3003
3015
|
}
|
|
3004
3016
|
|
|
@@ -3009,7 +3021,7 @@
|
|
|
3009
3021
|
*/
|
|
3010
3022
|
class MissingToolsError extends Error {
|
|
3011
3023
|
constructor(message) {
|
|
3012
|
-
super(spaceTrim.spaceTrim((block) => `
|
|
3024
|
+
super(spaceTrim$1.spaceTrim((block) => `
|
|
3013
3025
|
${block(message)}
|
|
3014
3026
|
|
|
3015
3027
|
Note: You have probably forgot to provide some tools for pipeline execution or preparation
|
|
@@ -3023,6 +3035,7 @@
|
|
|
3023
3035
|
/**
|
|
3024
3036
|
* Generates random token
|
|
3025
3037
|
*
|
|
3038
|
+
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
|
|
3026
3039
|
* Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
|
|
3027
3040
|
*
|
|
3028
3041
|
* @private internal helper function
|
|
@@ -3032,6 +3045,7 @@
|
|
|
3032
3045
|
return crypto.randomBytes(randomness).toString('hex');
|
|
3033
3046
|
}
|
|
3034
3047
|
/**
|
|
3048
|
+
* TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
3035
3049
|
* TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
3036
3050
|
*/
|
|
3037
3051
|
|
|
@@ -3150,6 +3164,22 @@
|
|
|
3150
3164
|
}
|
|
3151
3165
|
}
|
|
3152
3166
|
|
|
3167
|
+
/**
|
|
3168
|
+
* This error indicates error from the database
|
|
3169
|
+
*
|
|
3170
|
+
* @public exported from `@promptbook/core`
|
|
3171
|
+
*/
|
|
3172
|
+
class DatabaseError extends Error {
|
|
3173
|
+
constructor(message) {
|
|
3174
|
+
super(message);
|
|
3175
|
+
this.name = 'DatabaseError';
|
|
3176
|
+
Object.setPrototypeOf(this, DatabaseError.prototype);
|
|
3177
|
+
}
|
|
3178
|
+
}
|
|
3179
|
+
/**
|
|
3180
|
+
* TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
3181
|
+
*/
|
|
3182
|
+
|
|
3153
3183
|
/**
|
|
3154
3184
|
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
3155
3185
|
*
|
|
@@ -3179,6 +3209,19 @@
|
|
|
3179
3209
|
}
|
|
3180
3210
|
}
|
|
3181
3211
|
|
|
3212
|
+
/**
|
|
3213
|
+
* This error indicates that promptbook operation is not allowed
|
|
3214
|
+
*
|
|
3215
|
+
* @public exported from `@promptbook/core`
|
|
3216
|
+
*/
|
|
3217
|
+
class NotAllowed extends Error {
|
|
3218
|
+
constructor(message) {
|
|
3219
|
+
super(message);
|
|
3220
|
+
this.name = 'NotAllowed';
|
|
3221
|
+
Object.setPrototypeOf(this, NotAllowed.prototype);
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3182
3225
|
/**
|
|
3183
3226
|
* This error type indicates that some part of the code is not implemented yet
|
|
3184
3227
|
*
|
|
@@ -3186,7 +3229,7 @@
|
|
|
3186
3229
|
*/
|
|
3187
3230
|
class NotYetImplementedError extends Error {
|
|
3188
3231
|
constructor(message) {
|
|
3189
|
-
super(spaceTrim.spaceTrim((block) => `
|
|
3232
|
+
super(spaceTrim$1.spaceTrim((block) => `
|
|
3190
3233
|
${block(message)}
|
|
3191
3234
|
|
|
3192
3235
|
Note: This feature is not implemented yet but it will be soon.
|
|
@@ -3239,6 +3282,8 @@
|
|
|
3239
3282
|
PromptbookFetchError,
|
|
3240
3283
|
UnexpectedError,
|
|
3241
3284
|
WrappedError,
|
|
3285
|
+
NotAllowed,
|
|
3286
|
+
DatabaseError,
|
|
3242
3287
|
// TODO: [🪑]> VersionMismatchError,
|
|
3243
3288
|
};
|
|
3244
3289
|
/**
|
|
@@ -3423,11 +3468,11 @@
|
|
|
3423
3468
|
throw deserializeError(errors[0]);
|
|
3424
3469
|
}
|
|
3425
3470
|
else {
|
|
3426
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
3471
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
3427
3472
|
Multiple errors occurred during Promptbook execution
|
|
3428
3473
|
|
|
3429
3474
|
${block(errors
|
|
3430
|
-
.map(({ name, stack, message }, index) => spaceTrim.spaceTrim((block) => `
|
|
3475
|
+
.map(({ name, stack, message }, index) => spaceTrim$1.spaceTrim((block) => `
|
|
3431
3476
|
${name} ${index + 1}:
|
|
3432
3477
|
${block(stack || message)}
|
|
3433
3478
|
`))
|
|
@@ -3454,6 +3499,7 @@
|
|
|
3454
3499
|
let updatedAt = createdAt;
|
|
3455
3500
|
const errors = [];
|
|
3456
3501
|
const warnings = [];
|
|
3502
|
+
const llmCalls = [];
|
|
3457
3503
|
let currentValue = {};
|
|
3458
3504
|
let customTldr = null;
|
|
3459
3505
|
const partialResultSubject = new rxjs.Subject();
|
|
@@ -3469,6 +3515,9 @@
|
|
|
3469
3515
|
}, (tldrInfo) => {
|
|
3470
3516
|
customTldr = tldrInfo;
|
|
3471
3517
|
updatedAt = new Date();
|
|
3518
|
+
}, (llmCall) => {
|
|
3519
|
+
llmCalls.push(llmCall);
|
|
3520
|
+
updatedAt = new Date();
|
|
3472
3521
|
});
|
|
3473
3522
|
finalResultPromise
|
|
3474
3523
|
.catch((error) => {
|
|
@@ -3591,7 +3640,7 @@
|
|
|
3591
3640
|
}
|
|
3592
3641
|
return {
|
|
3593
3642
|
percent: percent,
|
|
3594
|
-
message,
|
|
3643
|
+
message: message + ' (!!!fallback)',
|
|
3595
3644
|
};
|
|
3596
3645
|
},
|
|
3597
3646
|
get createdAt() {
|
|
@@ -3614,6 +3663,10 @@
|
|
|
3614
3663
|
return warnings;
|
|
3615
3664
|
// <- Note: [1] --||--
|
|
3616
3665
|
},
|
|
3666
|
+
get llmCalls() {
|
|
3667
|
+
return [...llmCalls, { foo: '!!! bar' }];
|
|
3668
|
+
// <- Note: [1] --||--
|
|
3669
|
+
},
|
|
3617
3670
|
get currentValue() {
|
|
3618
3671
|
return currentValue;
|
|
3619
3672
|
// <- Note: [1] --||--
|
|
@@ -4067,6 +4120,7 @@
|
|
|
4067
4120
|
return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
|
|
4068
4121
|
}
|
|
4069
4122
|
/**
|
|
4123
|
+
* TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
4070
4124
|
* TODO: [👷♂️] @@@ Manual about construction of llmTools
|
|
4071
4125
|
*/
|
|
4072
4126
|
|
|
@@ -4083,6 +4137,7 @@
|
|
|
4083
4137
|
return llmTools;
|
|
4084
4138
|
}
|
|
4085
4139
|
/**
|
|
4140
|
+
* TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
4086
4141
|
* TODO: [👷♂️] @@@ Manual about construction of llmTools
|
|
4087
4142
|
*/
|
|
4088
4143
|
|
|
@@ -4098,7 +4153,7 @@
|
|
|
4098
4153
|
throw new MissingToolsError('LLM tools are required for preparing persona');
|
|
4099
4154
|
}
|
|
4100
4155
|
// TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
|
|
4101
|
-
const collection =
|
|
4156
|
+
const collection = createPipelineCollectionFromJson(...PipelineCollection);
|
|
4102
4157
|
const preparePersonaExecutor = createPipelineExecutor({
|
|
4103
4158
|
pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-persona.book'),
|
|
4104
4159
|
tools,
|
|
@@ -4816,7 +4871,7 @@
|
|
|
4816
4871
|
if (task.taskType === 'PROMPT_TASK' &&
|
|
4817
4872
|
knowledgePiecesCount > 0 &&
|
|
4818
4873
|
!dependentParameterNames.includes('knowledge')) {
|
|
4819
|
-
preparedContent = spaceTrim.spaceTrim(`
|
|
4874
|
+
preparedContent = spaceTrim$1.spaceTrim(`
|
|
4820
4875
|
{content}
|
|
4821
4876
|
|
|
4822
4877
|
## Knowledge
|
|
@@ -4902,7 +4957,7 @@
|
|
|
4902
4957
|
let title = pipeline.title;
|
|
4903
4958
|
if (title === undefined || title === '' || title === DEFAULT_BOOK_TITLE) {
|
|
4904
4959
|
// TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
|
|
4905
|
-
const collection =
|
|
4960
|
+
const collection = createPipelineCollectionFromJson(...PipelineCollection);
|
|
4906
4961
|
const prepareTitleExecutor = createPipelineExecutor({
|
|
4907
4962
|
pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-title.book'),
|
|
4908
4963
|
tools,
|
|
@@ -5129,7 +5184,7 @@
|
|
|
5129
5184
|
}
|
|
5130
5185
|
catch (error) {
|
|
5131
5186
|
assertsError(error);
|
|
5132
|
-
throw new ParseError(spaceTrim.spaceTrim((block) => `
|
|
5187
|
+
throw new ParseError(spaceTrim$1.spaceTrim((block) => `
|
|
5133
5188
|
Can not extract variables from the script
|
|
5134
5189
|
${block(error.stack || error.message)}
|
|
5135
5190
|
|
|
@@ -5814,10 +5869,13 @@
|
|
|
5814
5869
|
* @public exported from `@promptbook/utils`
|
|
5815
5870
|
*/
|
|
5816
5871
|
function countLines(text) {
|
|
5872
|
+
if (text === '') {
|
|
5873
|
+
return 0;
|
|
5874
|
+
}
|
|
5817
5875
|
text = text.replace('\r\n', '\n');
|
|
5818
5876
|
text = text.replace('\r', '\n');
|
|
5819
5877
|
const lines = text.split('\n');
|
|
5820
|
-
return lines.reduce((count, line) => count + Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 0);
|
|
5878
|
+
return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
|
|
5821
5879
|
}
|
|
5822
5880
|
/**
|
|
5823
5881
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
@@ -5942,6 +6000,8 @@
|
|
|
5942
6000
|
* This function provides a common abstraction for result validation that can be used
|
|
5943
6001
|
* by both execution logic and caching logic to ensure consistency.
|
|
5944
6002
|
*
|
|
6003
|
+
* Note: [🔂] This function is idempotent.
|
|
6004
|
+
*
|
|
5945
6005
|
* @param options - The validation options including result string, expectations, and format
|
|
5946
6006
|
* @returns Validation result with processed string and validity status
|
|
5947
6007
|
* @private internal function of `createPipelineExecutor` and `cacheLlmTools`
|
|
@@ -5961,7 +6021,7 @@
|
|
|
5961
6021
|
}
|
|
5962
6022
|
catch (error) {
|
|
5963
6023
|
keepUnused(error);
|
|
5964
|
-
throw new ExpectError(spaceTrim.spaceTrim((block) => `
|
|
6024
|
+
throw new ExpectError(spaceTrim$1.spaceTrim((block) => `
|
|
5965
6025
|
Expected valid JSON string
|
|
5966
6026
|
|
|
5967
6027
|
The expected JSON text:
|
|
@@ -6010,7 +6070,7 @@
|
|
|
6010
6070
|
*/
|
|
6011
6071
|
async function executeAttempts(options) {
|
|
6012
6072
|
const { jokerParameterNames, priority, maxAttempts, // <- Note: [💂]
|
|
6013
|
-
preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, } = options;
|
|
6073
|
+
preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, logLlmCall, } = options;
|
|
6014
6074
|
const $ongoingTaskResult = {
|
|
6015
6075
|
$result: null,
|
|
6016
6076
|
$resultString: null,
|
|
@@ -6024,7 +6084,7 @@
|
|
|
6024
6084
|
const jokerParameterName = jokerParameterNames[jokerParameterNames.length + attemptIndex];
|
|
6025
6085
|
// TODO: [🧠][🍭] JOKERS, EXPECTATIONS, POSTPROCESSING and FOREACH
|
|
6026
6086
|
if (isJokerAttempt && !jokerParameterName) {
|
|
6027
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6087
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6028
6088
|
Joker not found in attempt ${attemptIndex}
|
|
6029
6089
|
|
|
6030
6090
|
${block(pipelineIdentification)}
|
|
@@ -6035,7 +6095,7 @@
|
|
|
6035
6095
|
$ongoingTaskResult.$expectError = null;
|
|
6036
6096
|
if (isJokerAttempt) {
|
|
6037
6097
|
if (parameters[jokerParameterName] === undefined) {
|
|
6038
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6098
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6039
6099
|
Joker parameter {${jokerParameterName}} not defined
|
|
6040
6100
|
|
|
6041
6101
|
${block(pipelineIdentification)}
|
|
@@ -6093,7 +6153,7 @@
|
|
|
6093
6153
|
$ongoingTaskResult.$resultString = $ongoingTaskResult.$completionResult.content;
|
|
6094
6154
|
break variant;
|
|
6095
6155
|
case 'EMBEDDING':
|
|
6096
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6156
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6097
6157
|
Embedding model can not be used in pipeline
|
|
6098
6158
|
|
|
6099
6159
|
This should be catched during parsing
|
|
@@ -6104,7 +6164,7 @@
|
|
|
6104
6164
|
break variant;
|
|
6105
6165
|
// <- case [🤖]:
|
|
6106
6166
|
default:
|
|
6107
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6167
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6108
6168
|
Unknown model variant "${task.modelRequirements.modelVariant}"
|
|
6109
6169
|
|
|
6110
6170
|
${block(pipelineIdentification)}
|
|
@@ -6115,14 +6175,14 @@
|
|
|
6115
6175
|
break;
|
|
6116
6176
|
case 'SCRIPT_TASK':
|
|
6117
6177
|
if (arrayableToArray(tools.script).length === 0) {
|
|
6118
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6178
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6119
6179
|
No script execution tools are available
|
|
6120
6180
|
|
|
6121
6181
|
${block(pipelineIdentification)}
|
|
6122
6182
|
`));
|
|
6123
6183
|
}
|
|
6124
6184
|
if (!task.contentLanguage) {
|
|
6125
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6185
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6126
6186
|
Script language is not defined for SCRIPT TASK "${task.name}"
|
|
6127
6187
|
|
|
6128
6188
|
${block(pipelineIdentification)}
|
|
@@ -6153,7 +6213,7 @@
|
|
|
6153
6213
|
throw $ongoingTaskResult.$scriptPipelineExecutionErrors[0];
|
|
6154
6214
|
}
|
|
6155
6215
|
else {
|
|
6156
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6216
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6157
6217
|
Script execution failed ${$ongoingTaskResult.$scriptPipelineExecutionErrors.length}x
|
|
6158
6218
|
|
|
6159
6219
|
${block(pipelineIdentification)}
|
|
@@ -6167,7 +6227,7 @@
|
|
|
6167
6227
|
break taskType;
|
|
6168
6228
|
case 'DIALOG_TASK':
|
|
6169
6229
|
if (tools.userInterface === undefined) {
|
|
6170
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6230
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6171
6231
|
User interface tools are not available
|
|
6172
6232
|
|
|
6173
6233
|
${block(pipelineIdentification)}
|
|
@@ -6185,7 +6245,7 @@
|
|
|
6185
6245
|
break taskType;
|
|
6186
6246
|
// <- case: [🅱]
|
|
6187
6247
|
default:
|
|
6188
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6248
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6189
6249
|
Unknown execution type "${task.taskType}"
|
|
6190
6250
|
|
|
6191
6251
|
${block(pipelineIdentification)}
|
|
@@ -6258,14 +6318,10 @@
|
|
|
6258
6318
|
});
|
|
6259
6319
|
}
|
|
6260
6320
|
finally {
|
|
6261
|
-
if (!isJokerAttempt &&
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
// In that case we don’t want to make a report about it because it’s not a llm execution error
|
|
6266
|
-
) {
|
|
6267
|
-
// TODO: [🧠] Maybe put other taskTypes into report
|
|
6268
|
-
$executionReport.promptExecutions.push({
|
|
6321
|
+
if (!isJokerAttempt && task.taskType === 'PROMPT_TASK' && $ongoingTaskResult.$prompt) {
|
|
6322
|
+
// Note: [2] When some expected parameter is not defined, error will occur in templateParameters
|
|
6323
|
+
// In that case we don’t want to make a report about it because it’s not a llm execution error
|
|
6324
|
+
const executionPromptReport = {
|
|
6269
6325
|
prompt: {
|
|
6270
6326
|
...$ongoingTaskResult.$prompt,
|
|
6271
6327
|
// <- TODO: [🧠] How to pick everyhing except `pipelineUrl`
|
|
@@ -6274,13 +6330,20 @@
|
|
|
6274
6330
|
error: $ongoingTaskResult.$expectError === null
|
|
6275
6331
|
? undefined
|
|
6276
6332
|
: serializeError($ongoingTaskResult.$expectError),
|
|
6277
|
-
}
|
|
6333
|
+
};
|
|
6334
|
+
$executionReport.promptExecutions.push(executionPromptReport);
|
|
6335
|
+
if (logLlmCall) {
|
|
6336
|
+
logLlmCall({
|
|
6337
|
+
modelName: 'model' /* <- TODO: How to get model name from the report */,
|
|
6338
|
+
report: executionPromptReport,
|
|
6339
|
+
});
|
|
6340
|
+
}
|
|
6278
6341
|
}
|
|
6279
6342
|
}
|
|
6280
6343
|
if ($ongoingTaskResult.$expectError !== null && attemptIndex === maxAttempts - 1) {
|
|
6281
6344
|
// Note: Create a summary of all failures
|
|
6282
6345
|
const failuresSummary = $ongoingTaskResult.$failedResults
|
|
6283
|
-
.map((failure) => spaceTrim.spaceTrim((block) => {
|
|
6346
|
+
.map((failure) => spaceTrim$1.spaceTrim((block) => {
|
|
6284
6347
|
var _a, _b;
|
|
6285
6348
|
return `
|
|
6286
6349
|
Attempt ${failure.attemptIndex + 1}:
|
|
@@ -6290,14 +6353,14 @@
|
|
|
6290
6353
|
Result:
|
|
6291
6354
|
${block(failure.result === null
|
|
6292
6355
|
? 'null'
|
|
6293
|
-
: spaceTrim.spaceTrim(failure.result)
|
|
6356
|
+
: spaceTrim$1.spaceTrim(failure.result)
|
|
6294
6357
|
.split('\n')
|
|
6295
6358
|
.map((line) => `> ${line}`)
|
|
6296
6359
|
.join('\n'))}
|
|
6297
6360
|
`;
|
|
6298
6361
|
}))
|
|
6299
6362
|
.join('\n\n---\n\n');
|
|
6300
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => {
|
|
6363
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => {
|
|
6301
6364
|
var _a;
|
|
6302
6365
|
return `
|
|
6303
6366
|
LLM execution failed ${maxExecutionAttempts}x
|
|
@@ -6317,7 +6380,7 @@
|
|
|
6317
6380
|
}
|
|
6318
6381
|
}
|
|
6319
6382
|
if ($ongoingTaskResult.$resultString === null) {
|
|
6320
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6383
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6321
6384
|
Something went wrong and prompt result is null
|
|
6322
6385
|
|
|
6323
6386
|
${block(pipelineIdentification)}
|
|
@@ -6339,9 +6402,9 @@
|
|
|
6339
6402
|
* @private internal utility of `createPipelineExecutor`
|
|
6340
6403
|
*/
|
|
6341
6404
|
async function executeFormatSubvalues(options) {
|
|
6342
|
-
const { task, jokerParameterNames, parameters, priority, csvSettings, onProgress, pipelineIdentification } = options;
|
|
6405
|
+
const { task, jokerParameterNames, parameters, priority, csvSettings, onProgress, logLlmCall, pipelineIdentification, } = options;
|
|
6343
6406
|
if (task.foreach === undefined) {
|
|
6344
|
-
return /* not await */ executeAttempts(options);
|
|
6407
|
+
return /* not await */ executeAttempts({ ...options, logLlmCall });
|
|
6345
6408
|
}
|
|
6346
6409
|
if (jokerParameterNames.length !== 0) {
|
|
6347
6410
|
throw new UnexpectedError(spaceTrim__default["default"]((block) => `
|
|
@@ -6547,7 +6610,7 @@
|
|
|
6547
6610
|
},
|
|
6548
6611
|
content: task.content,
|
|
6549
6612
|
parameters,
|
|
6550
|
-
};
|
|
6613
|
+
}; /* <- Note: [🤛] */
|
|
6551
6614
|
const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
|
|
6552
6615
|
const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
|
|
6553
6616
|
const { index } = knowledgePiece;
|
|
@@ -6623,7 +6686,7 @@
|
|
|
6623
6686
|
// Note: Doublecheck that ALL reserved parameters are defined:
|
|
6624
6687
|
for (const parameterName of RESERVED_PARAMETER_NAMES) {
|
|
6625
6688
|
if (reservedParameters[parameterName] === undefined) {
|
|
6626
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6689
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6627
6690
|
Reserved parameter {${parameterName}} is not defined
|
|
6628
6691
|
|
|
6629
6692
|
${block(pipelineIdentification)}
|
|
@@ -6642,14 +6705,14 @@
|
|
|
6642
6705
|
* @private internal utility of `createPipelineExecutor`
|
|
6643
6706
|
*/
|
|
6644
6707
|
async function executeTask(options) {
|
|
6645
|
-
const { currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSuppressed, } = options;
|
|
6708
|
+
const { currentTask, preparedPipeline, parametersToPass, tools, onProgress, logLlmCall, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSuppressed, } = options;
|
|
6646
6709
|
const priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
|
|
6647
6710
|
// Note: Check consistency of used and dependent parameters which was also done in `validatePipeline`, but it’s good to doublecheck
|
|
6648
6711
|
const usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
6649
6712
|
const dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
6650
6713
|
// TODO: [👩🏾🤝👩🏻] Use here `mapAvailableToExpectedParameters`
|
|
6651
6714
|
if (difference(union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)), new Set(RESERVED_PARAMETER_NAMES)).size !== 0) {
|
|
6652
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6715
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6653
6716
|
Dependent parameters are not consistent with used parameters:
|
|
6654
6717
|
|
|
6655
6718
|
Dependent parameters:
|
|
@@ -6693,7 +6756,7 @@
|
|
|
6693
6756
|
else if (!definedParameterNames.has(parameterName) && usedParameterNames.has(parameterName)) {
|
|
6694
6757
|
// Houston, we have a problem
|
|
6695
6758
|
// Note: Checking part is also done in `validatePipeline`, but it’s good to doublecheck
|
|
6696
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6759
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6697
6760
|
Parameter \`{${parameterName}}\` is NOT defined
|
|
6698
6761
|
BUT used in task "${currentTask.title || currentTask.name}"
|
|
6699
6762
|
|
|
@@ -6721,6 +6784,7 @@
|
|
|
6721
6784
|
tools,
|
|
6722
6785
|
$executionReport,
|
|
6723
6786
|
onProgress,
|
|
6787
|
+
logLlmCall,
|
|
6724
6788
|
pipelineIdentification,
|
|
6725
6789
|
maxExecutionAttempts,
|
|
6726
6790
|
maxParallelCount,
|
|
@@ -6761,9 +6825,32 @@
|
|
|
6761
6825
|
for (const parameter of preparedPipeline.parameters.filter(({ isOutput }) => isOutput)) {
|
|
6762
6826
|
if (parametersToPass[parameter.name] === undefined) {
|
|
6763
6827
|
// [4]
|
|
6764
|
-
$warnings.push(new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6828
|
+
$warnings.push(new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6765
6829
|
Parameter \`{${parameter.name}}\` should be an output parameter, but it was not generated during pipeline execution
|
|
6766
6830
|
|
|
6831
|
+
Note: This is a warning which happened after the pipeline was executed, and \`{${parameter.name}}\` was not for some reason defined in output parameters
|
|
6832
|
+
|
|
6833
|
+
All parameters:
|
|
6834
|
+
${block(preparedPipeline.parameters
|
|
6835
|
+
.map(({ name, isInput, isOutput, description }) => {
|
|
6836
|
+
let line = `\`{${name}}\``;
|
|
6837
|
+
if (isInput) {
|
|
6838
|
+
line += ' `[input parameter]`';
|
|
6839
|
+
}
|
|
6840
|
+
if (isOutput) {
|
|
6841
|
+
line += ' `[output parameter]`';
|
|
6842
|
+
}
|
|
6843
|
+
if (parametersToPass[name] === undefined) {
|
|
6844
|
+
line += ` <- Warning: Should be in the output but its not |`;
|
|
6845
|
+
}
|
|
6846
|
+
if (description) {
|
|
6847
|
+
line += ` ${description}`;
|
|
6848
|
+
}
|
|
6849
|
+
return line;
|
|
6850
|
+
})
|
|
6851
|
+
.map((line, index) => `${index + 1}) ${line}`)
|
|
6852
|
+
.join('\n'))}
|
|
6853
|
+
|
|
6767
6854
|
${block(pipelineIdentification)}
|
|
6768
6855
|
`)));
|
|
6769
6856
|
continue;
|
|
@@ -6784,7 +6871,7 @@
|
|
|
6784
6871
|
* @private internal utility of `createPipelineExecutor`
|
|
6785
6872
|
*/
|
|
6786
6873
|
async function executePipeline(options) {
|
|
6787
|
-
const { inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname, isVerbose, } = options;
|
|
6874
|
+
const { inputParameters, tools, onProgress, logLlmCall, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname, isVerbose, } = options;
|
|
6788
6875
|
let { preparedPipeline } = options;
|
|
6789
6876
|
if (preparedPipeline === undefined) {
|
|
6790
6877
|
preparedPipeline = await preparePipeline(pipeline, tools, {
|
|
@@ -6846,7 +6933,7 @@
|
|
|
6846
6933
|
for (const parameterName of Object.keys(inputParameters)) {
|
|
6847
6934
|
const parameter = preparedPipeline.parameters.find(({ name }) => name === parameterName);
|
|
6848
6935
|
if (parameter === undefined) {
|
|
6849
|
-
warnings.push(new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6936
|
+
warnings.push(new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6850
6937
|
Extra parameter {${parameterName}} is being passed which is not part of the pipeline.
|
|
6851
6938
|
|
|
6852
6939
|
${block(pipelineIdentification)}
|
|
@@ -6861,7 +6948,7 @@
|
|
|
6861
6948
|
// TODO: [🧠] This should be also non-critical error
|
|
6862
6949
|
return exportJson({
|
|
6863
6950
|
name: 'pipelineExecutorResult',
|
|
6864
|
-
message: spaceTrim.spaceTrim((block) => `
|
|
6951
|
+
message: spaceTrim$1.spaceTrim((block) => `
|
|
6865
6952
|
Unsuccessful PipelineExecutorResult (with extra parameter {${parameter.name}}) PipelineExecutorResult
|
|
6866
6953
|
|
|
6867
6954
|
${block(pipelineIdentification)}
|
|
@@ -6870,7 +6957,7 @@
|
|
|
6870
6957
|
value: {
|
|
6871
6958
|
isSuccessful: false,
|
|
6872
6959
|
errors: [
|
|
6873
|
-
new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6960
|
+
new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6874
6961
|
Parameter \`{${parameter.name}}\` is passed as input parameter but it is not input
|
|
6875
6962
|
|
|
6876
6963
|
${block(pipelineIdentification)}
|
|
@@ -6897,7 +6984,7 @@
|
|
|
6897
6984
|
while (unresovedTasks.length > 0) {
|
|
6898
6985
|
if (loopLimit-- < 0) {
|
|
6899
6986
|
// Note: Really UnexpectedError not LimitReachedError - this should be catched during validatePipeline
|
|
6900
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6987
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6901
6988
|
Loop limit reached during resolving parameters pipeline execution
|
|
6902
6989
|
|
|
6903
6990
|
${block(pipelineIdentification)}
|
|
@@ -6907,7 +6994,7 @@
|
|
|
6907
6994
|
if (!currentTask && resolving.length === 0) {
|
|
6908
6995
|
throw new UnexpectedError(
|
|
6909
6996
|
// TODO: [🐎] DRY
|
|
6910
|
-
spaceTrim.spaceTrim((block) => `
|
|
6997
|
+
spaceTrim$1.spaceTrim((block) => `
|
|
6911
6998
|
Can not resolve some parameters:
|
|
6912
6999
|
|
|
6913
7000
|
${block(pipelineIdentification)}
|
|
@@ -6947,7 +7034,7 @@
|
|
|
6947
7034
|
tools,
|
|
6948
7035
|
onProgress(newOngoingResult) {
|
|
6949
7036
|
if (isReturned) {
|
|
6950
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
7037
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6951
7038
|
Can not call \`onProgress\` after pipeline execution is finished
|
|
6952
7039
|
|
|
6953
7040
|
${block(pipelineIdentification)}
|
|
@@ -6962,8 +7049,9 @@
|
|
|
6962
7049
|
onProgress(newOngoingResult);
|
|
6963
7050
|
}
|
|
6964
7051
|
},
|
|
7052
|
+
logLlmCall,
|
|
6965
7053
|
$executionReport: executionReport,
|
|
6966
|
-
pipelineIdentification: spaceTrim.spaceTrim((block) => `
|
|
7054
|
+
pipelineIdentification: spaceTrim$1.spaceTrim((block) => `
|
|
6967
7055
|
${block(pipelineIdentification)}
|
|
6968
7056
|
Task name: ${currentTask.name}
|
|
6969
7057
|
Task title: ${currentTask.title}
|
|
@@ -7072,7 +7160,7 @@
|
|
|
7072
7160
|
preparedPipeline = pipeline;
|
|
7073
7161
|
}
|
|
7074
7162
|
else if (isNotPreparedWarningSuppressed !== true) {
|
|
7075
|
-
console.warn(spaceTrim.spaceTrim((block) => `
|
|
7163
|
+
console.warn(spaceTrim$1.spaceTrim((block) => `
|
|
7076
7164
|
Pipeline is not prepared
|
|
7077
7165
|
|
|
7078
7166
|
${block(pipelineIdentification)}
|
|
@@ -7085,7 +7173,7 @@
|
|
|
7085
7173
|
// <- TODO: [🏮] Some standard way how to transform errors into warnings and how to handle non-critical fails during the tasks
|
|
7086
7174
|
}
|
|
7087
7175
|
let runCount = 0;
|
|
7088
|
-
const pipelineExecutorWithCallback = async (inputParameters, onProgress) => {
|
|
7176
|
+
const pipelineExecutorWithCallback = async (inputParameters, onProgress, logLlmCall) => {
|
|
7089
7177
|
runCount++;
|
|
7090
7178
|
return /* not await */ executePipeline({
|
|
7091
7179
|
pipeline,
|
|
@@ -7096,7 +7184,8 @@
|
|
|
7096
7184
|
inputParameters,
|
|
7097
7185
|
tools,
|
|
7098
7186
|
onProgress,
|
|
7099
|
-
|
|
7187
|
+
logLlmCall,
|
|
7188
|
+
pipelineIdentification: spaceTrim$1.spaceTrim((block) => `
|
|
7100
7189
|
${block(pipelineIdentification)}
|
|
7101
7190
|
${runCount === 1 ? '' : `Run #${runCount}`}
|
|
7102
7191
|
`),
|
|
@@ -7257,7 +7346,7 @@
|
|
|
7257
7346
|
}
|
|
7258
7347
|
const llmTools = getSingleLlmExecutionTools(llm);
|
|
7259
7348
|
// TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
|
|
7260
|
-
const collection =
|
|
7349
|
+
const collection = createPipelineCollectionFromJson(...PipelineCollection);
|
|
7261
7350
|
const prepareKnowledgeFromMarkdownExecutor = createPipelineExecutor({
|
|
7262
7351
|
pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book'),
|
|
7263
7352
|
tools: {
|