@promptbook/website-crawler 0.103.0-8 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -39
- package/esm/index.es.js +316 -227
- 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 +52 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +14 -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 +7 -7
- 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('spacetrim'), require('@mozilla/readability'), require('jsdom'), require('crypto-js'), require('crypto-js/enc-hex'), require('fs/promises'), require('path'), require('crypto'), require('rxjs'), require('waitasecond'), require('crypto-js/sha256'), require('mime-types'), require('papaparse'), require('showdown')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'spacetrim', '@mozilla/readability', 'jsdom', 'crypto-js', 'crypto-js/enc-hex', 'fs/promises', 'path', 'crypto', 'rxjs', 'waitasecond', 'crypto-js/sha256', 'mime-types', 'papaparse', 'showdown'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-website-crawler"] = {}, global.spaceTrim, global.readability, global.jsdom, global.cryptoJs, global.hexEncoder, global.promises, global.path, global.crypto, global.rxjs, global.waitasecond, global.sha256, global.mimeTypes, global.papaparse, global.showdown));
|
|
5
|
-
})(this, (function (exports, spaceTrim, readability, jsdom, cryptoJs, hexEncoder, promises, path, crypto, rxjs, waitasecond, sha256, mimeTypes, papaparse, showdown) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-website-crawler"] = {}, global.spaceTrim$1, global.readability, global.jsdom, global.cryptoJs, global.hexEncoder, global.promises, global.path, global.crypto, global.rxjs, global.waitasecond, global.sha256, global.mimeTypes, global.papaparse, global.showdown));
|
|
5
|
+
})(this, (function (exports, spaceTrim$1, readability, jsdom, cryptoJs, hexEncoder, promises, path, crypto, rxjs, waitasecond, sha256, mimeTypes, papaparse, showdown) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
-
var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim);
|
|
9
|
+
var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim$1);
|
|
10
10
|
var hexEncoder__default = /*#__PURE__*/_interopDefaultLegacy(hexEncoder);
|
|
11
11
|
var sha256__default = /*#__PURE__*/_interopDefaultLegacy(sha256);
|
|
12
12
|
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
* @generated
|
|
18
18
|
* @see https://github.com/webgptorg/book
|
|
19
19
|
*/
|
|
20
|
-
const BOOK_LANGUAGE_VERSION = '
|
|
20
|
+
const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
21
21
|
/**
|
|
22
22
|
* The version of the Promptbook engine
|
|
23
23
|
*
|
|
24
24
|
* @generated
|
|
25
25
|
* @see https://github.com/webgptorg/promptbook
|
|
26
26
|
*/
|
|
27
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0
|
|
27
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0';
|
|
28
28
|
/**
|
|
29
29
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
30
30
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -74,6 +74,17 @@
|
|
|
74
74
|
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
75
75
|
*/
|
|
76
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Trims string from all 4 sides
|
|
79
|
+
*
|
|
80
|
+
* Note: This is a re-exported function from the `spacetrim` package which is
|
|
81
|
+
* Developed by same author @hejny as this package
|
|
82
|
+
*
|
|
83
|
+
* @public exported from `@promptbook/utils`
|
|
84
|
+
* @see https://github.com/hejny/spacetrim#usage
|
|
85
|
+
*/
|
|
86
|
+
const spaceTrim = spaceTrim$1.spaceTrim;
|
|
87
|
+
|
|
77
88
|
/**
|
|
78
89
|
* @private util of `@promptbook/color`
|
|
79
90
|
* @de
|
|
@@ -122,6 +133,7 @@
|
|
|
122
133
|
* @public exported from `@promptbook/color`
|
|
123
134
|
*/
|
|
124
135
|
const CSS_COLORS = {
|
|
136
|
+
promptbook: '#79EAFD',
|
|
125
137
|
transparent: 'rgba(0,0,0,0)',
|
|
126
138
|
aliceblue: '#f0f8ff',
|
|
127
139
|
antiquewhite: '#faebd7',
|
|
@@ -303,9 +315,6 @@
|
|
|
303
315
|
throw new Error(`${channelName} channel is greater than 255, it is ${value}`);
|
|
304
316
|
}
|
|
305
317
|
}
|
|
306
|
-
/**
|
|
307
|
-
* TODO: [🧠][🚓] Is/which combination it better to use asserts/check, validate or is utility function?
|
|
308
|
-
*/
|
|
309
318
|
|
|
310
319
|
/**
|
|
311
320
|
* Color object represents an RGB color with alpha channel
|
|
@@ -325,21 +334,61 @@
|
|
|
325
334
|
* @param color
|
|
326
335
|
* @returns Color object
|
|
327
336
|
*/
|
|
328
|
-
static from(color) {
|
|
329
|
-
if (color
|
|
337
|
+
static from(color, _isSingleValue = false) {
|
|
338
|
+
if (color === '') {
|
|
339
|
+
throw new Error(`Can not create color from empty string`);
|
|
340
|
+
}
|
|
341
|
+
else if (color instanceof Color) {
|
|
330
342
|
return take(color);
|
|
331
343
|
}
|
|
332
344
|
else if (Color.isColor(color)) {
|
|
333
345
|
return take(color);
|
|
334
346
|
}
|
|
335
347
|
else if (typeof color === 'string') {
|
|
336
|
-
|
|
348
|
+
try {
|
|
349
|
+
return Color.fromString(color);
|
|
350
|
+
}
|
|
351
|
+
catch (error) {
|
|
352
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
353
|
+
if (_isSingleValue) {
|
|
354
|
+
throw error;
|
|
355
|
+
}
|
|
356
|
+
const parts = color.split(/[\s+,;|]/);
|
|
357
|
+
if (parts.length > 0) {
|
|
358
|
+
return Color.from(parts[0].trim(), true);
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
throw new Error(`Can not create color from given string "${color}"`);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
337
364
|
}
|
|
338
365
|
else {
|
|
339
366
|
console.error({ color });
|
|
340
367
|
throw new Error(`Can not create color from given object`);
|
|
341
368
|
}
|
|
342
369
|
}
|
|
370
|
+
/**
|
|
371
|
+
* Creates a new Color instance from miscellaneous formats
|
|
372
|
+
* It just does not throw error when it fails, it returns PROMPTBOOK_COLOR instead
|
|
373
|
+
*
|
|
374
|
+
* @param color
|
|
375
|
+
* @returns Color object
|
|
376
|
+
*/
|
|
377
|
+
static fromSafe(color) {
|
|
378
|
+
try {
|
|
379
|
+
return Color.from(color);
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
383
|
+
console.warn(spaceTrim((block) => `
|
|
384
|
+
Color.fromSafe error:
|
|
385
|
+
${block(error.message)}
|
|
386
|
+
|
|
387
|
+
Returning default PROMPTBOOK_COLOR.
|
|
388
|
+
`));
|
|
389
|
+
return Color.fromString('promptbook');
|
|
390
|
+
}
|
|
391
|
+
}
|
|
343
392
|
/**
|
|
344
393
|
* Creates a new Color instance from miscellaneous string formats
|
|
345
394
|
*
|
|
@@ -407,6 +456,9 @@
|
|
|
407
456
|
if (hex.length === 3) {
|
|
408
457
|
return Color.fromHex3(hex);
|
|
409
458
|
}
|
|
459
|
+
if (hex.length === 4) {
|
|
460
|
+
return Color.fromHex4(hex);
|
|
461
|
+
}
|
|
410
462
|
if (hex.length === 6) {
|
|
411
463
|
return Color.fromHex6(hex);
|
|
412
464
|
}
|
|
@@ -427,6 +479,19 @@
|
|
|
427
479
|
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
428
480
|
return take(new Color(r, g, b));
|
|
429
481
|
}
|
|
482
|
+
/**
|
|
483
|
+
* Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
|
|
484
|
+
*
|
|
485
|
+
* @param color in hex for example `09df`
|
|
486
|
+
* @returns Color object
|
|
487
|
+
*/
|
|
488
|
+
static fromHex4(hex) {
|
|
489
|
+
const r = parseInt(hex.substr(0, 1), 16) * 16;
|
|
490
|
+
const g = parseInt(hex.substr(1, 1), 16) * 16;
|
|
491
|
+
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
492
|
+
const a = parseInt(hex.substr(3, 1), 16) * 16;
|
|
493
|
+
return take(new Color(r, g, b, a));
|
|
494
|
+
}
|
|
430
495
|
/**
|
|
431
496
|
* Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
|
|
432
497
|
*
|
|
@@ -617,7 +682,8 @@
|
|
|
617
682
|
* @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
|
|
618
683
|
*/
|
|
619
684
|
static isHexColorString(value) {
|
|
620
|
-
return typeof value === 'string' &&
|
|
685
|
+
return (typeof value === 'string' &&
|
|
686
|
+
/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value));
|
|
621
687
|
}
|
|
622
688
|
/**
|
|
623
689
|
* Creates new Color object
|
|
@@ -732,6 +798,23 @@
|
|
|
732
798
|
* TODO: Maybe connect with textures
|
|
733
799
|
*/
|
|
734
800
|
|
|
801
|
+
/**
|
|
802
|
+
* Makes color transformer which returns a grayscale version of the color
|
|
803
|
+
*
|
|
804
|
+
* @param amount from 0 to 1
|
|
805
|
+
*
|
|
806
|
+
* @public exported from `@promptbook/color`
|
|
807
|
+
*/
|
|
808
|
+
function grayscale(amount) {
|
|
809
|
+
return ({ red, green, blue, alpha }) => {
|
|
810
|
+
const average = (red + green + blue) / 3;
|
|
811
|
+
red = Math.round(average * amount + red * (1 - amount));
|
|
812
|
+
green = Math.round(average * amount + green * (1 - amount));
|
|
813
|
+
blue = Math.round(average * amount + blue * (1 - amount));
|
|
814
|
+
return Color.fromValues(red, green, blue, alpha);
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
|
|
735
818
|
/**
|
|
736
819
|
* Converts HSL values to RGB values
|
|
737
820
|
*
|
|
@@ -847,102 +930,6 @@
|
|
|
847
930
|
* TODO: Maybe implement by mix+hsl
|
|
848
931
|
*/
|
|
849
932
|
|
|
850
|
-
/**
|
|
851
|
-
* Calculates distance between two colors
|
|
852
|
-
*
|
|
853
|
-
* @param color1 first color
|
|
854
|
-
* @param color2 second color
|
|
855
|
-
*
|
|
856
|
-
* Note: This function is inefficient. Use colorDistanceSquared instead if possible.
|
|
857
|
-
*
|
|
858
|
-
* @public exported from `@promptbook/color`
|
|
859
|
-
*/
|
|
860
|
-
/**
|
|
861
|
-
* Calculates distance between two colors without square root
|
|
862
|
-
*
|
|
863
|
-
* @param color1 first color
|
|
864
|
-
* @param color2 second color
|
|
865
|
-
*
|
|
866
|
-
* @public exported from `@promptbook/color`
|
|
867
|
-
*/
|
|
868
|
-
function colorDistanceSquared(color1, color2) {
|
|
869
|
-
const rmean = (color1.red + color2.red) / 2;
|
|
870
|
-
const r = color1.red - color2.red;
|
|
871
|
-
const g = color1.green - color2.green;
|
|
872
|
-
const b = color1.blue - color2.blue;
|
|
873
|
-
const weightR = 2 + rmean / 256;
|
|
874
|
-
const weightG = 4.0;
|
|
875
|
-
const weightB = 2 + (255 - rmean) / 256;
|
|
876
|
-
const distance = weightR * r * r + weightG * g * g + weightB * b * b;
|
|
877
|
-
return distance;
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* Makes color transformer which finds the nearest color from the given list
|
|
882
|
-
*
|
|
883
|
-
* @param colors array of colors to choose from
|
|
884
|
-
*
|
|
885
|
-
* @public exported from `@promptbook/color`
|
|
886
|
-
*/
|
|
887
|
-
function nearest(...colors) {
|
|
888
|
-
return (color) => {
|
|
889
|
-
const distances = colors.map((c) => colorDistanceSquared(c, color));
|
|
890
|
-
const minDistance = Math.min(...distances);
|
|
891
|
-
const minIndex = distances.indexOf(minDistance);
|
|
892
|
-
const nearestColor = colors[minIndex];
|
|
893
|
-
return nearestColor;
|
|
894
|
-
};
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* Color transformer which returns the negative color
|
|
899
|
-
*
|
|
900
|
-
* @public exported from `@promptbook/color`
|
|
901
|
-
*/
|
|
902
|
-
function negative(color) {
|
|
903
|
-
const r = 255 - color.red;
|
|
904
|
-
const g = 255 - color.green;
|
|
905
|
-
const b = 255 - color.blue;
|
|
906
|
-
return Color.fromValues(r, g, b, color.alpha);
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
/**
|
|
910
|
-
* Makes color transformer which finds the furthest color from the given list
|
|
911
|
-
*
|
|
912
|
-
* @param colors array of colors to choose from
|
|
913
|
-
*
|
|
914
|
-
* @public exported from `@promptbook/color`
|
|
915
|
-
*/
|
|
916
|
-
function furthest(...colors) {
|
|
917
|
-
return (color) => {
|
|
918
|
-
const furthestColor = negative(nearest(...colors.map(negative))(color));
|
|
919
|
-
return furthestColor;
|
|
920
|
-
};
|
|
921
|
-
}
|
|
922
|
-
/**
|
|
923
|
-
* Makes color transformer which finds the best text color (black or white) for the given background color
|
|
924
|
-
*
|
|
925
|
-
* @public exported from `@promptbook/color`
|
|
926
|
-
*/
|
|
927
|
-
furthest(Color.get('white'), Color.from('black'));
|
|
928
|
-
|
|
929
|
-
/**
|
|
930
|
-
* Makes color transformer which returns a grayscale version of the color
|
|
931
|
-
*
|
|
932
|
-
* @param amount from 0 to 1
|
|
933
|
-
*
|
|
934
|
-
* @public exported from `@promptbook/color`
|
|
935
|
-
*/
|
|
936
|
-
function grayscale(amount) {
|
|
937
|
-
return ({ red, green, blue, alpha }) => {
|
|
938
|
-
const average = (red + green + blue) / 3;
|
|
939
|
-
red = Math.round(average * amount + red * (1 - amount));
|
|
940
|
-
green = Math.round(average * amount + green * (1 - amount));
|
|
941
|
-
blue = Math.round(average * amount + blue * (1 - amount));
|
|
942
|
-
return Color.fromValues(red, green, blue, alpha);
|
|
943
|
-
};
|
|
944
|
-
}
|
|
945
|
-
|
|
946
933
|
/**
|
|
947
934
|
* Makes color transformer which saturate the given color
|
|
948
935
|
*
|
|
@@ -1011,16 +998,32 @@
|
|
|
1011
998
|
*
|
|
1012
999
|
* @public exported from `@promptbook/core`
|
|
1013
1000
|
*/
|
|
1014
|
-
const PROMPTBOOK_COLOR = Color.
|
|
1015
|
-
// <- TODO: [🧠] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
1001
|
+
const PROMPTBOOK_COLOR = Color.fromString('promptbook');
|
|
1002
|
+
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
1016
1003
|
/**
|
|
1017
|
-
*
|
|
1004
|
+
* Colors for syntax highlighting in the `<BookEditor/>`
|
|
1005
|
+
*
|
|
1006
|
+
* TODO: [🗽] Unite branding and make single place for it
|
|
1007
|
+
*
|
|
1008
|
+
* @public exported from `@promptbook/core`
|
|
1009
|
+
*/
|
|
1010
|
+
({
|
|
1011
|
+
TITLE: Color.fromHex('#244EA8'),
|
|
1012
|
+
LINE: Color.fromHex('#eeeeee'),
|
|
1013
|
+
SEPARATOR: Color.fromHex('#cccccc'),
|
|
1014
|
+
COMMITMENT: Color.fromHex('#DA0F78'),
|
|
1015
|
+
PARAMETER: Color.fromHex('#8e44ad'),
|
|
1016
|
+
});
|
|
1017
|
+
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
1018
|
+
/**
|
|
1019
|
+
* Chat color of the Promptbook (in chat)
|
|
1018
1020
|
*
|
|
1019
1021
|
* TODO: [🗽] Unite branding and make single place for it
|
|
1020
1022
|
*
|
|
1021
1023
|
* @public exported from `@promptbook/core`
|
|
1022
1024
|
*/
|
|
1023
1025
|
PROMPTBOOK_COLOR.then(lighten(0.1)).then(saturate(0.9)).then(grayscale(0.9));
|
|
1026
|
+
// <- TODO: [🧠][🈵] Using `Color` and `lighten`, `saturate`,... here increases the package size approx 3kb, maybe remove it
|
|
1024
1027
|
/**
|
|
1025
1028
|
* Color of the user (in chat)
|
|
1026
1029
|
*
|
|
@@ -1029,6 +1032,7 @@
|
|
|
1029
1032
|
* @public exported from `@promptbook/core`
|
|
1030
1033
|
*/
|
|
1031
1034
|
Color.fromHex('#1D4ED8');
|
|
1035
|
+
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
1032
1036
|
/**
|
|
1033
1037
|
* When the title is not provided, the default title is used
|
|
1034
1038
|
*
|
|
@@ -1115,7 +1119,7 @@
|
|
|
1115
1119
|
* @public exported from `@promptbook/core`
|
|
1116
1120
|
*/
|
|
1117
1121
|
const DEFAULT_MAX_EXECUTION_ATTEMPTS = 7; // <- TODO: [🤹♂️]
|
|
1118
|
-
// <- TODO: [🕝] Make also `
|
|
1122
|
+
// <- TODO: [🕝] Make also `AGENTS_DIRNAME_ALTERNATIVES`
|
|
1119
1123
|
// TODO: Just `.promptbook` in config, hardcode subfolders like `download-cache` or `execution-cache`
|
|
1120
1124
|
/**
|
|
1121
1125
|
* Where to store the temporary downloads
|
|
@@ -1191,7 +1195,7 @@
|
|
|
1191
1195
|
*/
|
|
1192
1196
|
class NotYetImplementedError extends Error {
|
|
1193
1197
|
constructor(message) {
|
|
1194
|
-
super(spaceTrim.spaceTrim((block) => `
|
|
1198
|
+
super(spaceTrim$1.spaceTrim((block) => `
|
|
1195
1199
|
${block(message)}
|
|
1196
1200
|
|
|
1197
1201
|
Note: This feature is not implemented yet but it will be soon.
|
|
@@ -1258,7 +1262,7 @@
|
|
|
1258
1262
|
*/
|
|
1259
1263
|
class UnexpectedError extends Error {
|
|
1260
1264
|
constructor(message) {
|
|
1261
|
-
super(spaceTrim.spaceTrim((block) => `
|
|
1265
|
+
super(spaceTrim$1.spaceTrim((block) => `
|
|
1262
1266
|
${block(message)}
|
|
1263
1267
|
|
|
1264
1268
|
Note: This error should not happen.
|
|
@@ -1750,6 +1754,8 @@
|
|
|
1750
1754
|
/**
|
|
1751
1755
|
* Converts a given text to kebab-case format.
|
|
1752
1756
|
*
|
|
1757
|
+
* Note: [🔂] This function is idempotent.
|
|
1758
|
+
*
|
|
1753
1759
|
* @param text The text to be converted.
|
|
1754
1760
|
* @returns The kebab-case formatted string.
|
|
1755
1761
|
* @example 'hello-world'
|
|
@@ -1905,6 +1911,8 @@
|
|
|
1905
1911
|
/**
|
|
1906
1912
|
* Converts a title string into a normalized name.
|
|
1907
1913
|
*
|
|
1914
|
+
* Note: [🔂] This function is idempotent.
|
|
1915
|
+
*
|
|
1908
1916
|
* @param value The title string to be converted to a name.
|
|
1909
1917
|
* @returns A normalized name derived from the input title.
|
|
1910
1918
|
* @example 'Hello World!' -> 'hello-world'
|
|
@@ -1996,7 +2004,7 @@
|
|
|
1996
2004
|
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
1997
2005
|
*/
|
|
1998
2006
|
|
|
1999
|
-
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book",formfactorName:"GENERIC",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge from Markdown\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book`\n- INPUT PARAMETER `{knowledgeContent}` Markdown document content\n- OUTPUT PARAMETER `{knowledgePieces}` The knowledge JSON object\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}\n```\n\n`-> {knowledgePieces}`\n"}],sourceFile:"./books/prepare-knowledge-from-markdown.book"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Keywords\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-keywords.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{keywords}` Keywords separated by comma\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}\n```\n\n`-> {keywords}`\n"}],sourceFile:"./books/prepare-knowledge-keywords.book"},{title:"Prepare Knowledge-piece Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge-piece Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-title.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{title}` The title of the document\n\n## Knowledge\n\n- EXPECT MIN 1 WORD\n- EXPECT MAX 8 WORDS\n\n```markdown\nYou are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-knowledge-title.book"},{title:"Prepare Persona",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.book",formfactorName:"GENERIC",parameters:[{name:"availableModels",description:"List of available model names together with their descriptions as JSON",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelsRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-model-requirements",title:"Make modelRequirements",content:"You are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n```json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n```\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n```json\n{availableModels}\n```\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",resultingParameterName:"modelsRequirements",format:"JSON",dependentParameterNames:["availableModels","personaDescription"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Persona\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-persona.book`\n- INPUT PARAMETER `{availableModels}` List of available model names together with their descriptions as JSON\n- INPUT PARAMETER `{personaDescription}` Description of the persona\n- OUTPUT PARAMETER `{modelsRequirements}` Specific requirements for the model\n\n## Make modelRequirements\n\n- FORMAT JSON\n\n```markdown\nYou are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n\\`\\`\\`json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n\\`\\`\\`\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n\\`\\`\\`json\n{availableModels}\n\\`\\`\\`\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}\n```\n\n`-> {modelsRequirements}`\n"}],sourceFile:"./books/prepare-persona.book"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-title.book",formfactorName:"GENERIC",parameters:[{name:"book",description:"The book to prepare the title for",isInput:true,isOutput:false},{name:"title",description:"Best title for the book",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-title",title:"Make title",content:"Make best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}",resultingParameterName:"title",expectations:{words:{min:1,max:8},lines:{min:1,max:1}},dependentParameterNames:["book"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-title.book`\n- INPUT PARAMETER `{book}` The book to prepare the title for\n- OUTPUT PARAMETER `{title}` Best title for the book\n\n## Make title\n\n- EXPECT MIN 1 Word\n- EXPECT MAX 8 Words\n- EXPECT EXACTLY 1 Line\n\n```markdown\nMake best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-title.book"},{title:"📊 Curriculum Audit",pipelineUrl:"https://promptbook.studio/promptbook//examples/lsvp-asistent.book",formfactorName:"GENERIC",parameters:[{name:"result",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"prompt",title:"Prompt",content:"Asistent pro LŠVP\n\nPERSONA Jsi asistent pro RVP Lyceum v rámci Národního pedagogického institutu České Republiky\nMETA IMAGE https://edulk.cz/getFile/id:475818/type:large/02%20zna%C4%8Dka%20npi.jpg\nRULE Pokud jsi nejsi jistý, napiš nevím\nKNOWLEDGE ./241129_Lyceum_final.pdf\nCONTEXT Obecně dokážeš řešit libovolné ŠVP, aktuálně řešíš {Školní vzdělávací program LYCEUM}\nRULE Z {Porovnání RVP a ŠVP - postup} je nejdůležitější fáze 3\nKNOWLEDGE {Školní vzdělávací program LYCEUM} ./ŠVP Lyceum - Finance v digitální době.pdf\nKNOWLEDGE @Slovník\n\n**Interní slovník - RVP/ŠVP**\n\n**RVP**\n\nRámcový vzdělávací program pro obor vzdělání Lyceum je dokument na národní úrovni, který formuluje požadavky na školní vzdělávací programy ve formě především očekávaných výsledků učení, kterých mají žáci absolvováním tohoto programu na dané škole dosáhnout.\n\n**ŠVP**\n\nŠkolní vzdělávací program pro obor vzdělání Lyceum je dokument každé jednotlivé školy, který popisuje v jakých vyučovacích předmětech/ vzdělávacích modulech a v jakých ročnících budou požadované očekávané výsledky učení naplněny. Zároveň formuluje další očekávané výsledky učení, které naplňují disponibilní část vyučovacího času určeného RVP pro tento obor vzdělání.\n\n**Očekávaný výsledek učení (OVU)**\n\nVyjadřuje jednotlivý požadavek na to, co mají žáci umět na konci vzdělávacího programu, tzn. jejich požadované kompetence. Je vyjádřen formulací, která je uvozena činnostním slovesem a dále obsahuje předmět této činnosti. Formulace je konkretizována resp. doplněna zpravidla formou odrážek vymezením dílčích znalostí, dovedností, postojů, jejichž splnění je předpokladem dosažení OVU jako celku.\n\n_Příklad:_\n\n<div class=\"joplin-table-wrapper\"><table><tbody><tr><th><p><strong>Žák/žákyně řídí realizaci jednoduchého projektu</strong></p></th></tr><tr><td><ul><li>naplánuje aktivity projektu</li></ul></td></tr><tr><td><ul><li>navrhne rozpočet projektu vzhledem k navrženým aktivitám</li></ul></td></tr><tr><td><ul><li>stanoví základní ukazatele a sleduje jejich naplňování</li></ul></td></tr><tr><td><ul><li>vede projektový tým</li></ul></td></tr><tr><td><ul><li>uvede, jak by řešil krizové situace v projektu</li></ul></td></tr><tr><td><ul><li>vyhodnotí úspěšnost projektu</li></ul></td></tr></tbody></table></div>\n\n**Vzdělávací oblasti**\n\nOčekávané výsledky učení jsou v **_RVP členěny do 4 vzdělávacích oblastí_**, které tvoří společný všeobecně vzdělávací základ:\n\n- Osobnostní rozvoj, vzdělávání ke zdraví, bezpečí a produktivnímu pracovnímu životu (kariéře)\n- Komunikační a jazykové vzdělávání\n- Aplikované vzdělávání STEM (Science, Technology, Engeneering, Math), tj. přírodní vědy, informatika, technika, matematika\n- Prakticky orientované vzdělávání společenskovědní a humanitní\n\nKaždá vzdělávací oblast se dále člení na okruhy, v jejichž rámci jsou OVU samostatně číslované.\n\n<div class=\"joplin-table-wrapper\"><table><tbody><tr><th rowspan=\"21\"><ul><li>Prakticky orientované vzdělávání společenskovědní a humanitní</li></ul></th><th rowspan=\"21\"><p><strong>Člověk, ekonomie a podnikání</strong></p></th><th rowspan=\"7\"><p><strong>1</strong></p></th><th><p><strong>zpracuje podklady související s podnikáním</strong></p></th></tr><tr><td><p>připraví podnikatelský záměr</p></td></tr><tr><td><p>sestaví zakladatelský rozpočet</p></td></tr><tr><td><p>zkalkuluje cenu zboží nebo služby</p></td></tr><tr><td><p>vysvětlí na příkladu základní povinnosti podnikatele vůči státu a zaměstnancům</p></td></tr><tr><td><p>vede daňovou evidenci</p></td></tr><tr><td><p>vysvětlí na příkladech etiku v podnikání</p></td></tr><tr><td rowspan=\"7\"><p><strong>2</strong></p></td><td><p><strong>řídí realizaci jednoduchého projektu</strong></p></td></tr><tr><td><p>naplánuje aktivity projektu</p></td></tr><tr><td><p>navrhne rozpočet projektu vzhledem k navrženým aktivitám</p></td></tr><tr><td><p>stanoví základní ukazatele a sleduje jejich naplňování</p></td></tr><tr><td><p>vede projektový tým</p></td></tr><tr><td><p>uvede, jak by řešil krizové situace v projektu</p></td></tr><tr><td><p>vyhodnotí úspěšnost projektu</p></td></tr><tr><td rowspan=\"7\"><p><strong>3</strong></p></td><td><p><strong>aplikuje ekonomické teorie v osobním a profesním životě</strong></p></td></tr><tr><td><p>vysvětlí základní ekonomické otázky</p></td></tr><tr><td><p>vysvětí stanovení rovnovážné ceny na dokonalém i nedokonalém trhu</p></td></tr><tr><td><p>charakterizuje výrobní faktory a vysvětlí hranici produkčních možností a náklady obětované příležitosti</p></td></tr><tr><td><p>uvede nejdůležitější makroekonomické pojmy a vliv jejich výše na kvalitu života a podnikání v daném státě</p></td></tr><tr><td><p>vysvětlí podstatu inflace a její důsledky na finanční situaci obyvatel a na příkladu ukáže jak se bránit jejím nepříznivým důsledkům</p></td></tr><tr><td><p>uvede hlavní výhody a nevýhody mezinárodního obchodu a vliv ochranářských opatření na ekonomickou situaci dané země</p></td></tr><tr><td></td><td></td><td><p><strong>4</strong></p></td><td><p>Atd.</p></td></tr></tbody></table></div>\n\n**Vyučovací předmět / vzdělávací modul**\n\nOčekávané výsledky učení jsou v **ŠVP** členěny do vyučovacích předmětů nebo vzdělávacích modulů, které jsou dále zařazeny do jednoho nebo více ročníků 4letého studia. Vyučovací předmět / vzdělávací modul tvoří vyučovací jednotku, kde jsou očekávané výsledky učení dále rozpracovány pro potřeby výuky podle následující šablony\n\n| **A. VSTUPNÍ ČÁST** |\n| --- |\n| **1\\. Název** |\n| **2\\. Kód** (kódy by měly být navázány na obory vzdělání a výsledky učení) |\n| **2a) Kategorie vzdělání** - v případě, že nebude součástí kódu |\n| **3\\. Typ vyučovací jednotky** (modul, předmět, stáž apod.) |\n| **4\\. Délka** (počet hodin - dělitelný čtyřmi (optimální modul 16, 32 hodin = týden výuky) |\n| **5\\. Platnost** (datum, od kterého platí) |\n| **6\\. Vstupní předpoklady** (vymezení požadované úrovně vstupních vědomostí a dovedností, které jsou předpokladem úspěšného studia) |\n| |\n| **B. JÁDRO VYUČOVACÍ JEDNOTKY** |\n| **1\\. Charakteristika** (stručná anotace popisující obecné cíle a pojetí) |\n| **2\\. Očekávané výsledky učení a jejich indikátory (převzaté z RVP nebo dále konkretizované)** |\n| **3\\. Podpora rozvoje klíčových kompetencí a základních gramotností** (které klíčové kompetence jsou v rozvíjeny) |\n| **4\\. Obsah vzdělávání** (rozpis učiva) |\n| **5\\. Vzdělávací strategie** (strategie výuky, resp. učební činnosti žáků, které jsou doporučené pro dosažení výsledků) |\n| |\n| **C. VÝSTUPNÍ ČÁST** |\n| **1\\. Způsob ověřování dosažených výsledků** (ve vazbě na jednotlivé výsledky učení) |\n| **2\\. Kritéria hodnocení** (co znamená splnění výsledků učení, kdy je splněna celá vyučovací jednotka, kritéria pro známky, příp. procentuální, slovní hodnocení) |\n| **3\\. Doporučená studijní literatura, odkazy na ilustrační zdroje** |\n| **4\\. Poznámky** |\n\n**Soulad OVU RVP a ŠVP**\n\nTento soulad je předmětem zjišťování. Soulad nastává, jestliže jsou očekávané výsledky učení z jednotlivých vzdělávacích oblastí RVP **obsaženy** ve vyučovacích předmětech/ vzdělávacích modulech ŠVP jednotlivých škol, tzn. že v ŠVP se objevuje jejich formulace buď v doslovném nebo podobném znění v jednom nebo více vyučovacích předmětech/ vzdělávacích modulech.\n\n_Příklad souladu:_\n\nRVP ŠVP - komunikace a marketing (SŠ obchodní Č.\n\n| **2** | **řídí realizaci jednoduchého projektu** |\n| --- | --- |\n| naplánuje aktivity projektu |\n| navrhne rozpočet projektu vzhledem k navrženým aktivitám |\n| stanoví základní ukazatele a sleduje jejich naplňování |\n| vede projektový tým |\n| uvede, jak by řešil krizové situace v projektu |\n| vyhodnotí úspěšnost projektu |\n\nKNOWLEDGE {Porovnání RVP a ŠVP - postup}\n\n\n# AUDITNÍ PROTOKOL ŠVP-RVP\n\n# (POPIS KONTROLNÍHO ALGORITMU)\n\nMetodika je určena pro **Kvantifikaci Shody** školního vzdělávacího programu (ŠVP) s Rámcovým vzdělávacím programem (RVP).\n\n## FÁZE 1: VALIDACE DOKUMENTACE\n\n**Cíl:** Ověřit platnost, aktuálnost a strukturu zdrojových dokumentů.\n\n- **RVP Verifikace:** Otevřít aktuální verzi RVP (např. RVP ZV/G/SOŠ).\n- **Typová shoda:** Ověřit, že RVP se vztahuje k danému typu školy.\n- **ŠVP Dimenze:** Identifikovat a izolovat relevantní části ŠVP: Profil absolventa, Klíčové kompetence (KK), Vzdělávací oblasti (VO), případně Učební plán (UP).\n- **Verzování:** Potvrdit, že obě verze (RVP a ŠVP) jsou nejnovější a platné (včetně dodatků RVP).\n\n## FÁZE 2: DATABÁZOVÉ MAPOVÁNÍ VÝSTUPŮ (MASTER MATICE)\n\n**Cíl:** Vytvořit systémovou databázi pro křížové porovnání všech povinných komponent RVP se ŠVP.\n\n- **Dekompozice RVP:** Rozložit RVP na základní povinné komponenty: Klíčové kompetence, Vzdělávací oblasti a obory, Očekávané výstupy (OVU), Průřezová témata (PT).\n- **Přiřazovací mapa:** Vytvořit hlavní kontrolní matici (Master Matice) pro záznam vazeb.\n\n| Oblast RVP | Výstup RVP (OVU) | Odpovídající Část ŠVP (Předmět/Ročník) | Konkrétní Tématický Celek v ŠVP | Stav Shody (Protokol) |\n| --- | --- | --- | --- | --- |\n| ... | ... | ... | ... | ... |\n| --- | --- | --- | --- | --- |\n\n## FÁZE 3: ALGORITMICKÁ KONTROLA POKRYTÍ A HLOUBKY\n\n**Cíl:** Posoudit, zda každý povinný výstup RVP je adekvátně reflektován v obsahu ŠVP, a přidělit bodovou hodnotu pro kvantifikaci.\n\n- **Audit OVU:** Projít každý jednotlivý Očekávaný výstup (OVU) z RVP.\n- **Kódování stavu a bodování:** U každého OVU v matici označit stav pokrytí dle následujícího schématu:\n\n| Kód (Protokol) | Popis (Kvalitativní zjištění) | Bodová hodnota (Kvantifikace) |\n| --- | --- | --- |\n| ✅ | Plná shoda (Výstup pokryt v plném rozsahu, odpovídající úrovni RVP) | 1,0 |\n| --- | --- | --- |\n| ⚠️ | Částečná shoda (Formální pokrytí, omezený rozsah, chybná návaznost) | 0,5 |\n| --- | --- | --- |\n| ❌ | Absence (Výstup zcela chybí v obsahu ŠVP) | 0,0 |\n| --- | --- | --- |\n\n- **Defektologie ŠVP:** Identifikovat a zaznamenat deficity ŠVP: Chybějící výstupy (❌), Sémantické překryvy, Přetížení obsahu.\n- **Kvalitativní posun:** Ověřit, zda je formulace výstupů v ŠVP **aktivní, měřitelná a v souladu** s úrovní RVP.\n\n## FÁZE 4: STRUKTURÁLNÍ VERIFIKACE NÁVAZNOSTI (VERTIKÁLA/HORIZONTÁLA)\n\n**Cíl:** Zkontrolovat logickou posloupnost a provázanost učiva v rámci ŠVP.\n\n- **Vertikální Kontrola:** Ověřit posloupnost OVU a učiva uvnitř jednoho předmětu/oblasti (postup od jednodušších ke složitějším konceptům napříč ročníky).\n- **Horizontální Kontrola:** Zkontrolovat logické provázání napříč vzdělávacími oblastmi a předměty (např. fyzika ↔ matematika).\n- **PT Integrace:** Audit reálné integrace Průřezových témat (PT) do konkrétních částí obsahu, metod a projektů.\n\n## FÁZE 5: ANALÝZA ŠKOLNÍ PROFILACE A ROZŠÍŘENÍ RVP\n\n**Cíl:** Validovat, že profilace školy je **v souladu** s RVP a nejedná se o **rozpor**.\n\n- **Nekonfliktnost:** Porovnat definovaný Profil absolventa školy s Klíčovými kompetencemi RVP. Profil ŠVP musí RVP rozvíjet, nikoli mu odporovat.\n- **Modularita:** Zkontrolovat, zda volitelné předměty a rozšiřující moduly logicky navazují na vzdělávací oblasti RVP.\n- **Implementace specializace:** Popisně uvést, jak je školní profilace (např. STEM zaměření, projektová výuka) integrována do OVU a kompetencí definovaných RVP.\n\n## FÁZE 6: GENERÁTOR ZÁVĚREČNÉ ZPRÁVY A KVANTIFIKACE\n\n**Cíl:** Syntetizovat výsledky, kvantifikovat soulad a generovat závazné návrhy na korekce.\n\n### 6.1 Kvantifikace Souladu\n\nVypočítat Index shody (IS) na základě bodového hodnocení (Fáze 3):\n\n### 6.2 Interpretace Indexu Shody (IS)\n\nKlasifikace souladu pro standardizované vyhodnocení:\n\n| Interval IS | Klasifikace souladu | Popis |\n| --- | --- | --- |\n| 95-100 % | Výborný soulad | ŠVP plně odpovídá RVP, pouze stylistické nebo formální rozdíly. |\n| --- | --- | --- |\n| 85-94 % | Dobrá shoda | ŠVP pokrývá všechny klíčové výstupy, menší korekce nutné. |\n| --- | --- | --- |\n| 70-84 % | Částečná shoda | Významné nedostatky v některých oblastech, nutná revize obsahu. |\n| --- | --- | --- |\n| < 70 % | Kritická neshoda | ŠVP neplní rámcové požadavky, ohrožuje legislativní soulad. |\n| --- | --- | --- |\n\n### 6.3 Doplňkové Indexy\n\nVypočítat následující doplňkové indexy pro detailní kvalitativní analýzu:\n\n- **Index kompetenčního souladu (IKS):** Poměr pokrytí klíčových kompetencí RVP v ŠVP.\n- **Index průřezové integrace (IPI):** Míra reálné integrace průřezových témat do výuky.\n- **Index hloubky pokrytí (IHP):** Procento výstupů, které jsou v ŠVP rozvedeny na konkrétní výukové cíle (měřitelné, aktivní formulace).\n- **Index profilové rozšiřitelnosti (IPR):** Kolik rozšiřujících nebo profilových výstupů přesahuje rámec RVP, aniž by narušily jeho strukturu.\n\n### 6.4 Vizuální výstupy\n\nZajistit generování následujících vizualizací pro Závěrečnou zprávu:\n\n- Graf pokrytí po vzdělávacích oblastech (Sloupcový graf IS pro VO).\n- Pavoukový diagram Klíčových kompetencí (RVP vs. ŠVP).\n- Mapa defektů (Vizualizace ❌ a ⚠️ výstupů).\n\n### 6.5 Struktura Závěrečné Zprávy\n\nZpráva musí být strukturována dle standardizovaného formátu:\n\n| Oddíl | Obsah |\n| --- | --- |\n| A. Identifikace | Název školy, IZO, typ školy, datum revize, zpracovatel, verze ŠVP a RVP. |\n| --- | --- |\n| B. Shrnutí výsledků | Celkový Index Shody (IS), hlavní závěry a doporučení. |\n| --- | --- |\n| C. Kvantitativní analýza | Přehled IS v % dle kategorií OVU / VO / kompetencí. |\n| --- | --- |\n| D. Kvalitativní analýza | Slovní zhodnocení kvality souladu (formulace, obtížnost, integrace PT). |\n| --- | --- |\n| E. Rizikové oblasti | Přehled nalezených defektů (chybějící OVU, přetížení, formální shoda). |\n| --- | --- |\n| F. Návrhy opatření (Korekční plán) | Přesné návrhy změn - **Co, Kde, Kdo** má upravit, včetně termínu. |\n| --- | --- |\n| G. Přílohy | Master Matice (Fáze 2-3), revizní tabulka, výstupní grafy a metriky. |\n| --- | --- |\n\n\n\n\n.",resultingParameterName:"result",dependentParameterNames:[]}],personas:[],preparations:[{id:1,promptbookVersion:"0.103.0-7",usage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"Asistent pro LŠVP\n\nPERSONA Jsi asistent pro RVP Lyceum v rámci Národního pedagogického institutu České Republiky\nMETA IMAGE https://edulk.cz/getFile/id:475818/type:large/02%20zna%C4%8Dka%20npi.jpg\nRULE Pokud jsi nejsi jistý, napiš nevím\nKNOWLEDGE ./241129_Lyceum_final.pdf\nCONTEXT Obecně dokážeš řešit libovolné ŠVP, aktuálně řešíš {Školní vzdělávací program LYCEUM}\nRULE Z {Porovnání RVP a ŠVP - postup} je nejdůležitější fáze 3\nKNOWLEDGE {Školní vzdělávací program LYCEUM} ./ŠVP Lyceum - Finance v digitální době.pdf\nKNOWLEDGE @Slovník\n\n**Interní slovník - RVP/ŠVP**\n\n**RVP**\n\nRámcový vzdělávací program pro obor vzdělání Lyceum je dokument na národní úrovni, který formuluje požadavky na školní vzdělávací programy ve formě především očekávaných výsledků učení, kterých mají žáci absolvováním tohoto programu na dané škole dosáhnout.\n\n**ŠVP**\n\nŠkolní vzdělávací program pro obor vzdělání Lyceum je dokument každé jednotlivé školy, který popisuje v jakých vyučovacích předmětech/ vzdělávacích modulech a v jakých ročnících budou požadované očekávané výsledky učení naplněny. Zároveň formuluje další očekávané výsledky učení, které naplňují disponibilní část vyučovacího času určeného RVP pro tento obor vzdělání.\n\n**Očekávaný výsledek učení (OVU)**\n\nVyjadřuje jednotlivý požadavek na to, co mají žáci umět na konci vzdělávacího programu, tzn. jejich požadované kompetence. Je vyjádřen formulací, která je uvozena činnostním slovesem a dále obsahuje předmět této činnosti. Formulace je konkretizována resp. doplněna zpravidla formou odrážek vymezením dílčích znalostí, dovedností, postojů, jejichž splnění je předpokladem dosažení OVU jako celku.\n\n_Příklad:_\n\n<div class=\"joplin-table-wrapper\"><table><tbody><tr><th><p><strong>Žák/žákyně řídí realizaci jednoduchého projektu</strong></p></th></tr><tr><td><ul><li>naplánuje aktivity projektu</li></ul></td></tr><tr><td><ul><li>navrhne rozpočet projektu vzhledem k navrženým aktivitám</li></ul></td></tr><tr><td><ul><li>stanoví základní ukazatele a sleduje jejich naplňování</li></ul></td></tr><tr><td><ul><li>vede projektový tým</li></ul></td></tr><tr><td><ul><li>uvede, jak by řešil krizové situace v projektu</li></ul></td></tr><tr><td><ul><li>vyhodnotí úspěšnost projektu</li></ul></td></tr></tbody></table></div>\n\n**Vzdělávací oblasti**\n\nOčekávané výsledky učení jsou v **_RVP členěny do 4 vzdělávacích oblastí_**, které tvoří společný všeobecně vzdělávací základ:\n\n- Osobnostní rozvoj, vzdělávání ke zdraví, bezpečí a produktivnímu pracovnímu životu (kariéře)\n- Komunikační a jazykové vzdělávání\n- Aplikované vzdělávání STEM (Science, Technology, Engeneering, Math), tj. přírodní vědy, informatika, technika, matematika\n- Prakticky orientované vzdělávání společenskovědní a humanitní\n\nKaždá vzdělávací oblast se dále člení na okruhy, v jejichž rámci jsou OVU samostatně číslované.\n\n<div class=\"joplin-table-wrapper\"><table><tbody><tr><th rowspan=\"21\"><ul><li>Prakticky orientované vzdělávání společenskovědní a humanitní</li></ul></th><th rowspan=\"21\"><p><strong>Člověk, ekonomie a podnikání</strong></p></th><th rowspan=\"7\"><p><strong>1</strong></p></th><th><p><strong>zpracuje podklady související s podnikáním</strong></p></th></tr><tr><td><p>připraví podnikatelský záměr</p></td></tr><tr><td><p>sestaví zakladatelský rozpočet</p></td></tr><tr><td><p>zkalkuluje cenu zboží nebo služby</p></td></tr><tr><td><p>vysvětlí na příkladu základní povinnosti podnikatele vůči státu a zaměstnancům</p></td></tr><tr><td><p>vede daňovou evidenci</p></td></tr><tr><td><p>vysvětlí na příkladech etiku v podnikání</p></td></tr><tr><td rowspan=\"7\"><p><strong>2</strong></p></td><td><p><strong>řídí realizaci jednoduchého projektu</strong></p></td></tr><tr><td><p>naplánuje aktivity projektu</p></td></tr><tr><td><p>navrhne rozpočet projektu vzhledem k navrženým aktivitám</p></td></tr><tr><td><p>stanoví základní ukazatele a sleduje jejich naplňování</p></td></tr><tr><td><p>vede projektový tým</p></td></tr><tr><td><p>uvede, jak by řešil krizové situace v projektu</p></td></tr><tr><td><p>vyhodnotí úspěšnost projektu</p></td></tr><tr><td rowspan=\"7\"><p><strong>3</strong></p></td><td><p><strong>aplikuje ekonomické teorie v osobním a profesním životě</strong></p></td></tr><tr><td><p>vysvětlí základní ekonomické otázky</p></td></tr><tr><td><p>vysvětí stanovení rovnovážné ceny na dokonalém i nedokonalém trhu</p></td></tr><tr><td><p>charakterizuje výrobní faktory a vysvětlí hranici produkčních možností a náklady obětované příležitosti</p></td></tr><tr><td><p>uvede nejdůležitější makroekonomické pojmy a vliv jejich výše na kvalitu života a podnikání v daném státě</p></td></tr><tr><td><p>vysvětlí podstatu inflace a její důsledky na finanční situaci obyvatel a na příkladu ukáže jak se bránit jejím nepříznivým důsledkům</p></td></tr><tr><td><p>uvede hlavní výhody a nevýhody mezinárodního obchodu a vliv ochranářských opatření na ekonomickou situaci dané země</p></td></tr><tr><td></td><td></td><td><p><strong>4</strong></p></td><td><p>Atd.</p></td></tr></tbody></table></div>\n\n**Vyučovací předmět / vzdělávací modul**\n\nOčekávané výsledky učení jsou v **ŠVP** členěny do vyučovacích předmětů nebo vzdělávacích modulů, které jsou dále zařazeny do jednoho nebo více ročníků 4letého studia. Vyučovací předmět / vzdělávací modul tvoří vyučovací jednotku, kde jsou očekávané výsledky učení dále rozpracovány pro potřeby výuky podle následující šablony\n\n| **A. VSTUPNÍ ČÁST** |\n| --- |\n| **1\\. Název** |\n| **2\\. Kód** (kódy by měly být navázány na obory vzdělání a výsledky učení) |\n| **2a) Kategorie vzdělání** - v případě, že nebude součástí kódu |\n| **3\\. Typ vyučovací jednotky** (modul, předmět, stáž apod.) |\n| **4\\. Délka** (počet hodin - dělitelný čtyřmi (optimální modul 16, 32 hodin = týden výuky) |\n| **5\\. Platnost** (datum, od kterého platí) |\n| **6\\. Vstupní předpoklady** (vymezení požadované úrovně vstupních vědomostí a dovedností, které jsou předpokladem úspěšného studia) |\n| |\n| **B. JÁDRO VYUČOVACÍ JEDNOTKY** |\n| **1\\. Charakteristika** (stručná anotace popisující obecné cíle a pojetí) |\n| **2\\. Očekávané výsledky učení a jejich indikátory (převzaté z RVP nebo dále konkretizované)** |\n| **3\\. Podpora rozvoje klíčových kompetencí a základních gramotností** (které klíčové kompetence jsou v rozvíjeny) |\n| **4\\. Obsah vzdělávání** (rozpis učiva) |\n| **5\\. Vzdělávací strategie** (strategie výuky, resp. učební činnosti žáků, které jsou doporučené pro dosažení výsledků) |\n| |\n| **C. VÝSTUPNÍ ČÁST** |\n| **1\\. Způsob ověřování dosažených výsledků** (ve vazbě na jednotlivé výsledky učení) |\n| **2\\. Kritéria hodnocení** (co znamená splnění výsledků učení, kdy je splněna celá vyučovací jednotka, kritéria pro známky, příp. procentuální, slovní hodnocení) |\n| **3\\. Doporučená studijní literatura, odkazy na ilustrační zdroje** |\n| **4\\. Poznámky** |\n\n**Soulad OVU RVP a ŠVP**\n\nTento soulad je předmětem zjišťování. Soulad nastává, jestliže jsou očekávané výsledky učení z jednotlivých vzdělávacích oblastí RVP **obsaženy** ve vyučovacích předmětech/ vzdělávacích modulech ŠVP jednotlivých škol, tzn. že v ŠVP se objevuje jejich formulace buď v doslovném nebo podobném znění v jednom nebo více vyučovacích předmětech/ vzdělávacích modulech.\n\n_Příklad souladu:_\n\nRVP ŠVP - komunikace a marketing (SŠ obchodní Č.\n\n| **2** | **řídí realizaci jednoduchého projektu** |\n| --- | --- |\n| naplánuje aktivity projektu |\n| navrhne rozpočet projektu vzhledem k navrženým aktivitám |\n| stanoví základní ukazatele a sleduje jejich naplňování |\n| vede projektový tým |\n| uvede, jak by řešil krizové situace v projektu |\n| vyhodnotí úspěšnost projektu |\n\nKNOWLEDGE {Porovnání RVP a ŠVP - postup}\n\n\n# AUDITNÍ PROTOKOL ŠVP-RVP\n\n# (POPIS KONTROLNÍHO ALGORITMU)\n\nMetodika je určena pro **Kvantifikaci Shody** školního vzdělávacího programu (ŠVP) s Rámcovým vzdělávacím programem (RVP).\n\n## FÁZE 1: VALIDACE DOKUMENTACE\n\n**Cíl:** Ověřit platnost, aktuálnost a strukturu zdrojových dokumentů.\n\n- **RVP Verifikace:** Otevřít aktuální verzi RVP (např. RVP ZV/G/SOŠ).\n- **Typová shoda:** Ověřit, že RVP se vztahuje k danému typu školy.\n- **ŠVP Dimenze:** Identifikovat a izolovat relevantní části ŠVP: Profil absolventa, Klíčové kompetence (KK), Vzdělávací oblasti (VO), případně Učební plán (UP).\n- **Verzování:** Potvrdit, že obě verze (RVP a ŠVP) jsou nejnovější a platné (včetně dodatků RVP).\n\n## FÁZE 2: DATABÁZOVÉ MAPOVÁNÍ VÝSTUPŮ (MASTER MATICE)\n\n**Cíl:** Vytvořit systémovou databázi pro křížové porovnání všech povinných komponent RVP se ŠVP.\n\n- **Dekompozice RVP:** Rozložit RVP na základní povinné komponenty: Klíčové kompetence, Vzdělávací oblasti a obory, Očekávané výstupy (OVU), Průřezová témata (PT).\n- **Přiřazovací mapa:** Vytvořit hlavní kontrolní matici (Master Matice) pro záznam vazeb.\n\n| Oblast RVP | Výstup RVP (OVU) | Odpovídající Část ŠVP (Předmět/Ročník) | Konkrétní Tématický Celek v ŠVP | Stav Shody (Protokol) |\n| --- | --- | --- | --- | --- |\n| ... | ... | ... | ... | ... |\n| --- | --- | --- | --- | --- |\n\n## FÁZE 3: ALGORITMICKÁ KONTROLA POKRYTÍ A HLOUBKY\n\n**Cíl:** Posoudit, zda každý povinný výstup RVP je adekvátně reflektován v obsahu ŠVP, a přidělit bodovou hodnotu pro kvantifikaci.\n\n- **Audit OVU:** Projít každý jednotlivý Očekávaný výstup (OVU) z RVP.\n- **Kódování stavu a bodování:** U každého OVU v matici označit stav pokrytí dle následujícího schématu:\n\n| Kód (Protokol) | Popis (Kvalitativní zjištění) | Bodová hodnota (Kvantifikace) |\n| --- | --- | --- |\n| ✅ | Plná shoda (Výstup pokryt v plném rozsahu, odpovídající úrovni RVP) | 1,0 |\n| --- | --- | --- |\n| ⚠️ | Částečná shoda (Formální pokrytí, omezený rozsah, chybná návaznost) | 0,5 |\n| --- | --- | --- |\n| ❌ | Absence (Výstup zcela chybí v obsahu ŠVP) | 0,0 |\n| --- | --- | --- |\n\n- **Defektologie ŠVP:** Identifikovat a zaznamenat deficity ŠVP: Chybějící výstupy (❌), Sémantické překryvy, Přetížení obsahu.\n- **Kvalitativní posun:** Ověřit, zda je formulace výstupů v ŠVP **aktivní, měřitelná a v souladu** s úrovní RVP.\n\n## FÁZE 4: STRUKTURÁLNÍ VERIFIKACE NÁVAZNOSTI (VERTIKÁLA/HORIZONTÁLA)\n\n**Cíl:** Zkontrolovat logickou posloupnost a provázanost učiva v rámci ŠVP.\n\n- **Vertikální Kontrola:** Ověřit posloupnost OVU a učiva uvnitř jednoho předmětu/oblasti (postup od jednodušších ke složitějším konceptům napříč ročníky).\n- **Horizontální Kontrola:** Zkontrolovat logické provázání napříč vzdělávacími oblastmi a předměty (např. fyzika ↔ matematika).\n- **PT Integrace:** Audit reálné integrace Průřezových témat (PT) do konkrétních částí obsahu, metod a projektů.\n\n## FÁZE 5: ANALÝZA ŠKOLNÍ PROFILACE A ROZŠÍŘENÍ RVP\n\n**Cíl:** Validovat, že profilace školy je **v souladu** s RVP a nejedná se o **rozpor**.\n\n- **Nekonfliktnost:** Porovnat definovaný Profil absolventa školy s Klíčovými kompetencemi RVP. Profil ŠVP musí RVP rozvíjet, nikoli mu odporovat.\n- **Modularita:** Zkontrolovat, zda volitelné předměty a rozšiřující moduly logicky navazují na vzdělávací oblasti RVP.\n- **Implementace specializace:** Popisně uvést, jak je školní profilace (např. STEM zaměření, projektová výuka) integrována do OVU a kompetencí definovaných RVP.\n\n## FÁZE 6: GENERÁTOR ZÁVĚREČNÉ ZPRÁVY A KVANTIFIKACE\n\n**Cíl:** Syntetizovat výsledky, kvantifikovat soulad a generovat závazné návrhy na korekce.\n\n### 6.1 Kvantifikace Souladu\n\nVypočítat Index shody (IS) na základě bodového hodnocení (Fáze 3):\n\n### 6.2 Interpretace Indexu Shody (IS)\n\nKlasifikace souladu pro standardizované vyhodnocení:\n\n| Interval IS | Klasifikace souladu | Popis |\n| --- | --- | --- |\n| 95-100 % | Výborný soulad | ŠVP plně odpovídá RVP, pouze stylistické nebo formální rozdíly. |\n| --- | --- | --- |\n| 85-94 % | Dobrá shoda | ŠVP pokrývá všechny klíčové výstupy, menší korekce nutné. |\n| --- | --- | --- |\n| 70-84 % | Částečná shoda | Významné nedostatky v některých oblastech, nutná revize obsahu. |\n| --- | --- | --- |\n| < 70 % | Kritická neshoda | ŠVP neplní rámcové požadavky, ohrožuje legislativní soulad. |\n| --- | --- | --- |\n\n### 6.3 Doplňkové Indexy\n\nVypočítat následující doplňkové indexy pro detailní kvalitativní analýzu:\n\n- **Index kompetenčního souladu (IKS):** Poměr pokrytí klíčových kompetencí RVP v ŠVP.\n- **Index průřezové integrace (IPI):** Míra reálné integrace průřezových témat do výuky.\n- **Index hloubky pokrytí (IHP):** Procento výstupů, které jsou v ŠVP rozvedeny na konkrétní výukové cíle (měřitelné, aktivní formulace).\n- **Index profilové rozšiřitelnosti (IPR):** Kolik rozšiřujících nebo profilových výstupů přesahuje rámec RVP, aniž by narušily jeho strukturu.\n\n### 6.4 Vizuální výstupy\n\nZajistit generování následujících vizualizací pro Závěrečnou zprávu:\n\n- Graf pokrytí po vzdělávacích oblastech (Sloupcový graf IS pro VO).\n- Pavoukový diagram Klíčových kompetencí (RVP vs. ŠVP).\n- Mapa defektů (Vizualizace ❌ a ⚠️ výstupů).\n\n### 6.5 Struktura Závěrečné Zprávy\n\nZpráva musí být strukturována dle standardizovaného formátu:\n\n| Oddíl | Obsah |\n| --- | --- |\n| A. Identifikace | Název školy, IZO, typ školy, datum revize, zpracovatel, verze ŠVP a RVP. |\n| --- | --- |\n| B. Shrnutí výsledků | Celkový Index Shody (IS), hlavní závěry a doporučení. |\n| --- | --- |\n| C. Kvantitativní analýza | Přehled IS v % dle kategorií OVU / VO / kompetencí. |\n| --- | --- |\n| D. Kvalitativní analýza | Slovní zhodnocení kvality souladu (formulace, obtížnost, integrace PT). |\n| --- | --- |\n| E. Rizikové oblasti | Přehled nalezených defektů (chybějící OVU, přetížení, formální shoda). |\n| --- | --- |\n| F. Návrhy opatření (Korekční plán) | Přesné návrhy změn - **Co, Kde, Kdo** má upravit, včetně termínu. |\n| --- | --- |\n| G. Přílohy | Master Matice (Fáze 2-3), revizní tabulka, výstupní grafy a metriky. |\n| --- | --- |\n\n\n\n\n.\n"}],sourceFile:"./books/examples/lsvp-asistent.book"}];
|
|
2007
|
+
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book",formfactorName:"GENERIC",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge from Markdown\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book`\n- INPUT PARAMETER `{knowledgeContent}` Markdown document content\n- OUTPUT PARAMETER `{knowledgePieces}` The knowledge JSON object\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}\n```\n\n`-> {knowledgePieces}`\n"}],sourceFile:"./books/prepare-knowledge-from-markdown.book"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Keywords\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-keywords.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{keywords}` Keywords separated by comma\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}\n```\n\n`-> {keywords}`\n"}],sourceFile:"./books/prepare-knowledge-keywords.book"},{title:"Prepare Knowledge-piece Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge-piece Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-title.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{title}` The title of the document\n\n## Knowledge\n\n- EXPECT MIN 1 WORD\n- EXPECT MAX 8 WORDS\n\n```markdown\nYou are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-knowledge-title.book"},{title:"Prepare Persona",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.book",formfactorName:"GENERIC",parameters:[{name:"availableModels",description:"List of available model names together with their descriptions as JSON",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelsRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-model-requirements",title:"Make modelRequirements",content:"You are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n```json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n```\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n```json\n{availableModels}\n```\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",resultingParameterName:"modelsRequirements",format:"JSON",dependentParameterNames:["availableModels","personaDescription"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Persona\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-persona.book`\n- INPUT PARAMETER `{availableModels}` List of available model names together with their descriptions as JSON\n- INPUT PARAMETER `{personaDescription}` Description of the persona\n- OUTPUT PARAMETER `{modelsRequirements}` Specific requirements for the model\n\n## Make modelRequirements\n\n- FORMAT JSON\n\n```markdown\nYou are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n\\`\\`\\`json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n\\`\\`\\`\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n\\`\\`\\`json\n{availableModels}\n\\`\\`\\`\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}\n```\n\n`-> {modelsRequirements}`\n"}],sourceFile:"./books/prepare-persona.book"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-title.book",formfactorName:"GENERIC",parameters:[{name:"book",description:"The book to prepare the title for",isInput:true,isOutput:false},{name:"title",description:"Best title for the book",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-title",title:"Make title",content:"Make best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}",resultingParameterName:"title",expectations:{words:{min:1,max:8},lines:{min:1,max:1}},dependentParameterNames:["book"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-title.book`\n- INPUT PARAMETER `{book}` The book to prepare the title for\n- OUTPUT PARAMETER `{title}` Best title for the book\n\n## Make title\n\n- EXPECT MIN 1 Word\n- EXPECT MAX 8 Words\n- EXPECT EXACTLY 1 Line\n\n```markdown\nMake best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-title.book"}];
|
|
2000
2008
|
|
|
2001
2009
|
/**
|
|
2002
2010
|
* Checks if value is valid email
|
|
@@ -2038,7 +2046,7 @@
|
|
|
2038
2046
|
constructor(whatWasThrown) {
|
|
2039
2047
|
const tag = `[🤮]`;
|
|
2040
2048
|
console.error(tag, whatWasThrown);
|
|
2041
|
-
super(spaceTrim.spaceTrim(`
|
|
2049
|
+
super(spaceTrim$1.spaceTrim(`
|
|
2042
2050
|
Non-Error object was thrown
|
|
2043
2051
|
|
|
2044
2052
|
Note: Look for ${tag} in the console for more details
|
|
@@ -2103,6 +2111,8 @@
|
|
|
2103
2111
|
* Function `validatePipelineString` will validate the if the string is a valid pipeline string
|
|
2104
2112
|
* It does not check if the string is fully logically correct, but if it is a string that can be a pipeline string or the string looks completely different.
|
|
2105
2113
|
*
|
|
2114
|
+
* Note: [🔂] This function is idempotent.
|
|
2115
|
+
*
|
|
2106
2116
|
* @param {string} pipelineString the candidate for a pipeline string
|
|
2107
2117
|
* @returns {PipelineString} the same string as input, but validated as valid
|
|
2108
2118
|
* @throws {ParseError} if the string is not a valid pipeline string
|
|
@@ -2460,7 +2470,7 @@
|
|
|
2460
2470
|
TODO: [🧠] Is there a better implementation?
|
|
2461
2471
|
> const propertyNames = Object.getOwnPropertyNames(objectValue);
|
|
2462
2472
|
> for (const propertyName of propertyNames) {
|
|
2463
|
-
> const value = (objectValue as
|
|
2473
|
+
> const value = (objectValue as chococake)[propertyName];
|
|
2464
2474
|
> if (value && typeof value === 'object') {
|
|
2465
2475
|
> deepClone(value);
|
|
2466
2476
|
> }
|
|
@@ -2665,6 +2675,8 @@
|
|
|
2665
2675
|
* - if it is valid json
|
|
2666
2676
|
* - if it is meaningful
|
|
2667
2677
|
*
|
|
2678
|
+
* Note: [🔂] This function is idempotent.
|
|
2679
|
+
*
|
|
2668
2680
|
* @param pipeline valid or invalid PipelineJson
|
|
2669
2681
|
* @returns the same pipeline if it is logically valid
|
|
2670
2682
|
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
@@ -2682,7 +2694,7 @@
|
|
|
2682
2694
|
if (!(error instanceof PipelineLogicError)) {
|
|
2683
2695
|
throw error;
|
|
2684
2696
|
}
|
|
2685
|
-
console.error(spaceTrim.spaceTrim((block) => `
|
|
2697
|
+
console.error(spaceTrim$1.spaceTrim((block) => `
|
|
2686
2698
|
Pipeline is not valid but logic errors are temporarily disabled via \`IS_PIPELINE_LOGIC_VALIDATED\`
|
|
2687
2699
|
|
|
2688
2700
|
${block(error.message)}
|
|
@@ -2709,7 +2721,7 @@
|
|
|
2709
2721
|
})();
|
|
2710
2722
|
if (pipeline.pipelineUrl !== undefined && !isValidPipelineUrl(pipeline.pipelineUrl)) {
|
|
2711
2723
|
// <- Note: [🚲]
|
|
2712
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2724
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2713
2725
|
Invalid promptbook URL "${pipeline.pipelineUrl}"
|
|
2714
2726
|
|
|
2715
2727
|
${block(pipelineIdentification)}
|
|
@@ -2717,7 +2729,7 @@
|
|
|
2717
2729
|
}
|
|
2718
2730
|
if (pipeline.bookVersion !== undefined && !isValidPromptbookVersion(pipeline.bookVersion)) {
|
|
2719
2731
|
// <- Note: [🚲]
|
|
2720
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2732
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2721
2733
|
Invalid Promptbook Version "${pipeline.bookVersion}"
|
|
2722
2734
|
|
|
2723
2735
|
${block(pipelineIdentification)}
|
|
@@ -2726,7 +2738,7 @@
|
|
|
2726
2738
|
// TODO: [🧠] Maybe do here some proper JSON-schema / ZOD checking
|
|
2727
2739
|
if (!Array.isArray(pipeline.parameters)) {
|
|
2728
2740
|
// TODO: [🧠] what is the correct error tp throw - maybe PromptbookSchemaError
|
|
2729
|
-
throw new ParseError(spaceTrim.spaceTrim((block) => `
|
|
2741
|
+
throw new ParseError(spaceTrim$1.spaceTrim((block) => `
|
|
2730
2742
|
Pipeline is valid JSON but with wrong structure
|
|
2731
2743
|
|
|
2732
2744
|
\`PipelineJson.parameters\` expected to be an array, but got ${typeof pipeline.parameters}
|
|
@@ -2737,7 +2749,7 @@
|
|
|
2737
2749
|
// TODO: [🧠] Maybe do here some proper JSON-schema / ZOD checking
|
|
2738
2750
|
if (!Array.isArray(pipeline.tasks)) {
|
|
2739
2751
|
// TODO: [🧠] what is the correct error tp throw - maybe PromptbookSchemaError
|
|
2740
|
-
throw new ParseError(spaceTrim.spaceTrim((block) => `
|
|
2752
|
+
throw new ParseError(spaceTrim$1.spaceTrim((block) => `
|
|
2741
2753
|
Pipeline is valid JSON but with wrong structure
|
|
2742
2754
|
|
|
2743
2755
|
\`PipelineJson.tasks\` expected to be an array, but got ${typeof pipeline.tasks}
|
|
@@ -2763,7 +2775,7 @@
|
|
|
2763
2775
|
// Note: Check each parameter individually
|
|
2764
2776
|
for (const parameter of pipeline.parameters) {
|
|
2765
2777
|
if (parameter.isInput && parameter.isOutput) {
|
|
2766
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2778
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2767
2779
|
|
|
2768
2780
|
Parameter \`{${parameter.name}}\` can not be both input and output
|
|
2769
2781
|
|
|
@@ -2774,7 +2786,7 @@
|
|
|
2774
2786
|
if (!parameter.isInput &&
|
|
2775
2787
|
!parameter.isOutput &&
|
|
2776
2788
|
!pipeline.tasks.some((task) => task.dependentParameterNames.includes(parameter.name))) {
|
|
2777
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2789
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2778
2790
|
Parameter \`{${parameter.name}}\` is created but not used
|
|
2779
2791
|
|
|
2780
2792
|
You can declare {${parameter.name}} as output parameter by adding in the header:
|
|
@@ -2786,7 +2798,7 @@
|
|
|
2786
2798
|
}
|
|
2787
2799
|
// Note: Testing that parameter is either input or result of some task
|
|
2788
2800
|
if (!parameter.isInput && !pipeline.tasks.some((task) => task.resultingParameterName === parameter.name)) {
|
|
2789
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2801
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2790
2802
|
Parameter \`{${parameter.name}}\` is declared but not defined
|
|
2791
2803
|
|
|
2792
2804
|
You can do one of these:
|
|
@@ -2802,14 +2814,14 @@
|
|
|
2802
2814
|
// Note: Checking each task individually
|
|
2803
2815
|
for (const task of pipeline.tasks) {
|
|
2804
2816
|
if (definedParameters.has(task.resultingParameterName)) {
|
|
2805
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2817
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2806
2818
|
Parameter \`{${task.resultingParameterName}}\` is defined multiple times
|
|
2807
2819
|
|
|
2808
2820
|
${block(pipelineIdentification)}
|
|
2809
2821
|
`));
|
|
2810
2822
|
}
|
|
2811
2823
|
if (RESERVED_PARAMETER_NAMES.includes(task.resultingParameterName)) {
|
|
2812
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2824
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2813
2825
|
Parameter name {${task.resultingParameterName}} is reserved, please use different name
|
|
2814
2826
|
|
|
2815
2827
|
${block(pipelineIdentification)}
|
|
@@ -2819,7 +2831,7 @@
|
|
|
2819
2831
|
if (task.jokerParameterNames && task.jokerParameterNames.length > 0) {
|
|
2820
2832
|
if (!task.format &&
|
|
2821
2833
|
!task.expectations /* <- TODO: Require at least 1 -> min <- expectation to use jokers */) {
|
|
2822
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2834
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2823
2835
|
Joker parameters are used for {${task.resultingParameterName}} but no expectations are defined
|
|
2824
2836
|
|
|
2825
2837
|
${block(pipelineIdentification)}
|
|
@@ -2827,7 +2839,7 @@
|
|
|
2827
2839
|
}
|
|
2828
2840
|
for (const joker of task.jokerParameterNames) {
|
|
2829
2841
|
if (!task.dependentParameterNames.includes(joker)) {
|
|
2830
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2842
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2831
2843
|
Parameter \`{${joker}}\` is used for {${task.resultingParameterName}} as joker but not in \`dependentParameterNames\`
|
|
2832
2844
|
|
|
2833
2845
|
${block(pipelineIdentification)}
|
|
@@ -2838,21 +2850,21 @@
|
|
|
2838
2850
|
if (task.expectations) {
|
|
2839
2851
|
for (const [unit, { min, max }] of Object.entries(task.expectations)) {
|
|
2840
2852
|
if (min !== undefined && max !== undefined && min > max) {
|
|
2841
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2853
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2842
2854
|
Min expectation (=${min}) of ${unit} is higher than max expectation (=${max})
|
|
2843
2855
|
|
|
2844
2856
|
${block(pipelineIdentification)}
|
|
2845
2857
|
`));
|
|
2846
2858
|
}
|
|
2847
2859
|
if (min !== undefined && min < 0) {
|
|
2848
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2860
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2849
2861
|
Min expectation of ${unit} must be zero or positive
|
|
2850
2862
|
|
|
2851
2863
|
${block(pipelineIdentification)}
|
|
2852
2864
|
`));
|
|
2853
2865
|
}
|
|
2854
2866
|
if (max !== undefined && max <= 0) {
|
|
2855
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim((block) => `
|
|
2867
|
+
throw new PipelineLogicError(spaceTrim$1.spaceTrim((block) => `
|
|
2856
2868
|
Max expectation of ${unit} must be positive
|
|
2857
2869
|
|
|
2858
2870
|
${block(pipelineIdentification)}
|
|
@@ -2874,7 +2886,7 @@
|
|
|
2874
2886
|
while (unresovedTasks.length > 0) {
|
|
2875
2887
|
if (loopLimit-- < 0) {
|
|
2876
2888
|
// Note: Really UnexpectedError not LimitReachedError - this should not happen and be caught below
|
|
2877
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
2889
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
2878
2890
|
Loop limit reached during detection of circular dependencies in \`validatePipeline\`
|
|
2879
2891
|
|
|
2880
2892
|
${block(pipelineIdentification)}
|
|
@@ -2884,7 +2896,7 @@
|
|
|
2884
2896
|
if (currentlyResovedTasks.length === 0) {
|
|
2885
2897
|
throw new PipelineLogicError(
|
|
2886
2898
|
// TODO: [🐎] DRY
|
|
2887
|
-
spaceTrim.spaceTrim((block) => `
|
|
2899
|
+
spaceTrim$1.spaceTrim((block) => `
|
|
2888
2900
|
|
|
2889
2901
|
Can not resolve some parameters:
|
|
2890
2902
|
Either you are using a parameter that is not defined, or there are some circular dependencies.
|
|
@@ -3031,7 +3043,7 @@
|
|
|
3031
3043
|
* Library of pipelines that groups together pipelines for an application.
|
|
3032
3044
|
* This implementation is a very thin wrapper around the Array / Map of pipelines.
|
|
3033
3045
|
*
|
|
3034
|
-
* @private internal function of `
|
|
3046
|
+
* @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
|
|
3035
3047
|
* @see https://github.com/webgptorg/pipeline#pipeline-collection
|
|
3036
3048
|
*/
|
|
3037
3049
|
class SimplePipelineCollection {
|
|
@@ -3041,14 +3053,14 @@
|
|
|
3041
3053
|
* @param pipelines Array of pipeline JSON objects to include in the collection
|
|
3042
3054
|
*
|
|
3043
3055
|
* Note: During the construction logic of all pipelines are validated
|
|
3044
|
-
* Note: It is not recommended to use this constructor directly, use `
|
|
3056
|
+
* Note: It is not recommended to use this constructor directly, use `createPipelineCollectionFromJson` *(or other variant)* instead
|
|
3045
3057
|
*/
|
|
3046
3058
|
constructor(...pipelines) {
|
|
3047
3059
|
this.collection = new Map();
|
|
3048
3060
|
for (const pipeline of pipelines) {
|
|
3049
3061
|
// TODO: [👠] DRY
|
|
3050
3062
|
if (pipeline.pipelineUrl === undefined) {
|
|
3051
|
-
throw new PipelineUrlError(spaceTrim.spaceTrim(`
|
|
3063
|
+
throw new PipelineUrlError(spaceTrim$1.spaceTrim(`
|
|
3052
3064
|
Pipeline with name "${pipeline.title}" does not have defined URL
|
|
3053
3065
|
|
|
3054
3066
|
File:
|
|
@@ -3070,7 +3082,7 @@
|
|
|
3070
3082
|
pipelineJsonToString(unpreparePipeline(pipeline)) !==
|
|
3071
3083
|
pipelineJsonToString(unpreparePipeline(this.collection.get(pipeline.pipelineUrl)))) {
|
|
3072
3084
|
const existing = this.collection.get(pipeline.pipelineUrl);
|
|
3073
|
-
throw new PipelineUrlError(spaceTrim.spaceTrim(`
|
|
3085
|
+
throw new PipelineUrlError(spaceTrim$1.spaceTrim(`
|
|
3074
3086
|
Pipeline with URL ${pipeline.pipelineUrl} is already in the collection 🍎
|
|
3075
3087
|
|
|
3076
3088
|
Conflicting files:
|
|
@@ -3102,13 +3114,13 @@
|
|
|
3102
3114
|
const pipeline = this.collection.get(url);
|
|
3103
3115
|
if (!pipeline) {
|
|
3104
3116
|
if (this.listPipelines().length === 0) {
|
|
3105
|
-
throw new NotFoundError(spaceTrim.spaceTrim(`
|
|
3117
|
+
throw new NotFoundError(spaceTrim$1.spaceTrim(`
|
|
3106
3118
|
Pipeline with url "${url}" not found
|
|
3107
3119
|
|
|
3108
3120
|
No pipelines available
|
|
3109
3121
|
`));
|
|
3110
3122
|
}
|
|
3111
|
-
throw new NotFoundError(spaceTrim.spaceTrim((block) => `
|
|
3123
|
+
throw new NotFoundError(spaceTrim$1.spaceTrim((block) => `
|
|
3112
3124
|
Pipeline with url "${url}" not found
|
|
3113
3125
|
|
|
3114
3126
|
Available pipelines:
|
|
@@ -3129,16 +3141,16 @@
|
|
|
3129
3141
|
}
|
|
3130
3142
|
|
|
3131
3143
|
/**
|
|
3132
|
-
* Creates PipelineCollection from array of PipelineJson or PipelineString
|
|
3144
|
+
* Creates `PipelineCollection` from array of PipelineJson or PipelineString
|
|
3133
3145
|
*
|
|
3134
|
-
* Note: Functions `
|
|
3146
|
+
* Note: Functions `pipelineCollectionToJson` and `createPipelineCollectionFromJson` are complementary
|
|
3135
3147
|
* Note: Syntax, parsing, and logic consistency checks are performed on all sources during build
|
|
3136
3148
|
*
|
|
3137
3149
|
* @param promptbookSources
|
|
3138
3150
|
* @returns PipelineCollection
|
|
3139
3151
|
* @public exported from `@promptbook/core`
|
|
3140
3152
|
*/
|
|
3141
|
-
function
|
|
3153
|
+
function createPipelineCollectionFromJson(...promptbooks) {
|
|
3142
3154
|
return new SimplePipelineCollection(...promptbooks);
|
|
3143
3155
|
}
|
|
3144
3156
|
|
|
@@ -3149,7 +3161,7 @@
|
|
|
3149
3161
|
*/
|
|
3150
3162
|
class MissingToolsError extends Error {
|
|
3151
3163
|
constructor(message) {
|
|
3152
|
-
super(spaceTrim.spaceTrim((block) => `
|
|
3164
|
+
super(spaceTrim$1.spaceTrim((block) => `
|
|
3153
3165
|
${block(message)}
|
|
3154
3166
|
|
|
3155
3167
|
Note: You have probably forgot to provide some tools for pipeline execution or preparation
|
|
@@ -3163,6 +3175,7 @@
|
|
|
3163
3175
|
/**
|
|
3164
3176
|
* Generates random token
|
|
3165
3177
|
*
|
|
3178
|
+
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
|
|
3166
3179
|
* Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
|
|
3167
3180
|
*
|
|
3168
3181
|
* @private internal helper function
|
|
@@ -3172,6 +3185,7 @@
|
|
|
3172
3185
|
return crypto.randomBytes(randomness).toString('hex');
|
|
3173
3186
|
}
|
|
3174
3187
|
/**
|
|
3188
|
+
* TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
3175
3189
|
* TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
3176
3190
|
*/
|
|
3177
3191
|
|
|
@@ -3290,6 +3304,22 @@
|
|
|
3290
3304
|
}
|
|
3291
3305
|
}
|
|
3292
3306
|
|
|
3307
|
+
/**
|
|
3308
|
+
* This error indicates error from the database
|
|
3309
|
+
*
|
|
3310
|
+
* @public exported from `@promptbook/core`
|
|
3311
|
+
*/
|
|
3312
|
+
class DatabaseError extends Error {
|
|
3313
|
+
constructor(message) {
|
|
3314
|
+
super(message);
|
|
3315
|
+
this.name = 'DatabaseError';
|
|
3316
|
+
Object.setPrototypeOf(this, DatabaseError.prototype);
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
/**
|
|
3320
|
+
* TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
3321
|
+
*/
|
|
3322
|
+
|
|
3293
3323
|
/**
|
|
3294
3324
|
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
3295
3325
|
*
|
|
@@ -3319,6 +3349,19 @@
|
|
|
3319
3349
|
}
|
|
3320
3350
|
}
|
|
3321
3351
|
|
|
3352
|
+
/**
|
|
3353
|
+
* This error indicates that promptbook operation is not allowed
|
|
3354
|
+
*
|
|
3355
|
+
* @public exported from `@promptbook/core`
|
|
3356
|
+
*/
|
|
3357
|
+
class NotAllowed extends Error {
|
|
3358
|
+
constructor(message) {
|
|
3359
|
+
super(message);
|
|
3360
|
+
this.name = 'NotAllowed';
|
|
3361
|
+
Object.setPrototypeOf(this, NotAllowed.prototype);
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3364
|
+
|
|
3322
3365
|
/**
|
|
3323
3366
|
* Error thrown when a fetch request fails
|
|
3324
3367
|
*
|
|
@@ -3356,6 +3399,8 @@
|
|
|
3356
3399
|
PromptbookFetchError,
|
|
3357
3400
|
UnexpectedError,
|
|
3358
3401
|
WrappedError,
|
|
3402
|
+
NotAllowed,
|
|
3403
|
+
DatabaseError,
|
|
3359
3404
|
// TODO: [🪑]> VersionMismatchError,
|
|
3360
3405
|
};
|
|
3361
3406
|
/**
|
|
@@ -3540,11 +3585,11 @@
|
|
|
3540
3585
|
throw deserializeError(errors[0]);
|
|
3541
3586
|
}
|
|
3542
3587
|
else {
|
|
3543
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
3588
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
3544
3589
|
Multiple errors occurred during Promptbook execution
|
|
3545
3590
|
|
|
3546
3591
|
${block(errors
|
|
3547
|
-
.map(({ name, stack, message }, index) => spaceTrim.spaceTrim((block) => `
|
|
3592
|
+
.map(({ name, stack, message }, index) => spaceTrim$1.spaceTrim((block) => `
|
|
3548
3593
|
${name} ${index + 1}:
|
|
3549
3594
|
${block(stack || message)}
|
|
3550
3595
|
`))
|
|
@@ -3571,6 +3616,7 @@
|
|
|
3571
3616
|
let updatedAt = createdAt;
|
|
3572
3617
|
const errors = [];
|
|
3573
3618
|
const warnings = [];
|
|
3619
|
+
const llmCalls = [];
|
|
3574
3620
|
let currentValue = {};
|
|
3575
3621
|
let customTldr = null;
|
|
3576
3622
|
const partialResultSubject = new rxjs.Subject();
|
|
@@ -3586,6 +3632,9 @@
|
|
|
3586
3632
|
}, (tldrInfo) => {
|
|
3587
3633
|
customTldr = tldrInfo;
|
|
3588
3634
|
updatedAt = new Date();
|
|
3635
|
+
}, (llmCall) => {
|
|
3636
|
+
llmCalls.push(llmCall);
|
|
3637
|
+
updatedAt = new Date();
|
|
3589
3638
|
});
|
|
3590
3639
|
finalResultPromise
|
|
3591
3640
|
.catch((error) => {
|
|
@@ -3708,7 +3757,7 @@
|
|
|
3708
3757
|
}
|
|
3709
3758
|
return {
|
|
3710
3759
|
percent: percent,
|
|
3711
|
-
message,
|
|
3760
|
+
message: message + ' (!!!fallback)',
|
|
3712
3761
|
};
|
|
3713
3762
|
},
|
|
3714
3763
|
get createdAt() {
|
|
@@ -3731,6 +3780,10 @@
|
|
|
3731
3780
|
return warnings;
|
|
3732
3781
|
// <- Note: [1] --||--
|
|
3733
3782
|
},
|
|
3783
|
+
get llmCalls() {
|
|
3784
|
+
return [...llmCalls, { foo: '!!! bar' }];
|
|
3785
|
+
// <- Note: [1] --||--
|
|
3786
|
+
},
|
|
3734
3787
|
get currentValue() {
|
|
3735
3788
|
return currentValue;
|
|
3736
3789
|
// <- Note: [1] --||--
|
|
@@ -4184,6 +4237,7 @@
|
|
|
4184
4237
|
return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
|
|
4185
4238
|
}
|
|
4186
4239
|
/**
|
|
4240
|
+
* TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
4187
4241
|
* TODO: [👷♂️] @@@ Manual about construction of llmTools
|
|
4188
4242
|
*/
|
|
4189
4243
|
|
|
@@ -4200,6 +4254,7 @@
|
|
|
4200
4254
|
return llmTools;
|
|
4201
4255
|
}
|
|
4202
4256
|
/**
|
|
4257
|
+
* TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
4203
4258
|
* TODO: [👷♂️] @@@ Manual about construction of llmTools
|
|
4204
4259
|
*/
|
|
4205
4260
|
|
|
@@ -4215,7 +4270,7 @@
|
|
|
4215
4270
|
throw new MissingToolsError('LLM tools are required for preparing persona');
|
|
4216
4271
|
}
|
|
4217
4272
|
// TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
|
|
4218
|
-
const collection =
|
|
4273
|
+
const collection = createPipelineCollectionFromJson(...PipelineCollection);
|
|
4219
4274
|
const preparePersonaExecutor = createPipelineExecutor({
|
|
4220
4275
|
pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-persona.book'),
|
|
4221
4276
|
tools,
|
|
@@ -4814,7 +4869,7 @@
|
|
|
4814
4869
|
if (task.taskType === 'PROMPT_TASK' &&
|
|
4815
4870
|
knowledgePiecesCount > 0 &&
|
|
4816
4871
|
!dependentParameterNames.includes('knowledge')) {
|
|
4817
|
-
preparedContent = spaceTrim.spaceTrim(`
|
|
4872
|
+
preparedContent = spaceTrim$1.spaceTrim(`
|
|
4818
4873
|
{content}
|
|
4819
4874
|
|
|
4820
4875
|
## Knowledge
|
|
@@ -4900,7 +4955,7 @@
|
|
|
4900
4955
|
let title = pipeline.title;
|
|
4901
4956
|
if (title === undefined || title === '' || title === DEFAULT_BOOK_TITLE) {
|
|
4902
4957
|
// TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
|
|
4903
|
-
const collection =
|
|
4958
|
+
const collection = createPipelineCollectionFromJson(...PipelineCollection);
|
|
4904
4959
|
const prepareTitleExecutor = createPipelineExecutor({
|
|
4905
4960
|
pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-title.book'),
|
|
4906
4961
|
tools,
|
|
@@ -5127,7 +5182,7 @@
|
|
|
5127
5182
|
}
|
|
5128
5183
|
catch (error) {
|
|
5129
5184
|
assertsError(error);
|
|
5130
|
-
throw new ParseError(spaceTrim.spaceTrim((block) => `
|
|
5185
|
+
throw new ParseError(spaceTrim$1.spaceTrim((block) => `
|
|
5131
5186
|
Can not extract variables from the script
|
|
5132
5187
|
${block(error.stack || error.message)}
|
|
5133
5188
|
|
|
@@ -5812,10 +5867,13 @@
|
|
|
5812
5867
|
* @public exported from `@promptbook/utils`
|
|
5813
5868
|
*/
|
|
5814
5869
|
function countLines(text) {
|
|
5870
|
+
if (text === '') {
|
|
5871
|
+
return 0;
|
|
5872
|
+
}
|
|
5815
5873
|
text = text.replace('\r\n', '\n');
|
|
5816
5874
|
text = text.replace('\r', '\n');
|
|
5817
5875
|
const lines = text.split('\n');
|
|
5818
|
-
return lines.reduce((count, line) => count + Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 0);
|
|
5876
|
+
return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
|
|
5819
5877
|
}
|
|
5820
5878
|
/**
|
|
5821
5879
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
@@ -5940,6 +5998,8 @@
|
|
|
5940
5998
|
* This function provides a common abstraction for result validation that can be used
|
|
5941
5999
|
* by both execution logic and caching logic to ensure consistency.
|
|
5942
6000
|
*
|
|
6001
|
+
* Note: [🔂] This function is idempotent.
|
|
6002
|
+
*
|
|
5943
6003
|
* @param options - The validation options including result string, expectations, and format
|
|
5944
6004
|
* @returns Validation result with processed string and validity status
|
|
5945
6005
|
* @private internal function of `createPipelineExecutor` and `cacheLlmTools`
|
|
@@ -5959,7 +6019,7 @@
|
|
|
5959
6019
|
}
|
|
5960
6020
|
catch (error) {
|
|
5961
6021
|
keepUnused(error);
|
|
5962
|
-
throw new ExpectError(spaceTrim.spaceTrim((block) => `
|
|
6022
|
+
throw new ExpectError(spaceTrim$1.spaceTrim((block) => `
|
|
5963
6023
|
Expected valid JSON string
|
|
5964
6024
|
|
|
5965
6025
|
The expected JSON text:
|
|
@@ -6008,7 +6068,7 @@
|
|
|
6008
6068
|
*/
|
|
6009
6069
|
async function executeAttempts(options) {
|
|
6010
6070
|
const { jokerParameterNames, priority, maxAttempts, // <- Note: [💂]
|
|
6011
|
-
preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, } = options;
|
|
6071
|
+
preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, logLlmCall, } = options;
|
|
6012
6072
|
const $ongoingTaskResult = {
|
|
6013
6073
|
$result: null,
|
|
6014
6074
|
$resultString: null,
|
|
@@ -6022,7 +6082,7 @@
|
|
|
6022
6082
|
const jokerParameterName = jokerParameterNames[jokerParameterNames.length + attemptIndex];
|
|
6023
6083
|
// TODO: [🧠][🍭] JOKERS, EXPECTATIONS, POSTPROCESSING and FOREACH
|
|
6024
6084
|
if (isJokerAttempt && !jokerParameterName) {
|
|
6025
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6085
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6026
6086
|
Joker not found in attempt ${attemptIndex}
|
|
6027
6087
|
|
|
6028
6088
|
${block(pipelineIdentification)}
|
|
@@ -6033,7 +6093,7 @@
|
|
|
6033
6093
|
$ongoingTaskResult.$expectError = null;
|
|
6034
6094
|
if (isJokerAttempt) {
|
|
6035
6095
|
if (parameters[jokerParameterName] === undefined) {
|
|
6036
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6096
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6037
6097
|
Joker parameter {${jokerParameterName}} not defined
|
|
6038
6098
|
|
|
6039
6099
|
${block(pipelineIdentification)}
|
|
@@ -6091,7 +6151,7 @@
|
|
|
6091
6151
|
$ongoingTaskResult.$resultString = $ongoingTaskResult.$completionResult.content;
|
|
6092
6152
|
break variant;
|
|
6093
6153
|
case 'EMBEDDING':
|
|
6094
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6154
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6095
6155
|
Embedding model can not be used in pipeline
|
|
6096
6156
|
|
|
6097
6157
|
This should be catched during parsing
|
|
@@ -6102,7 +6162,7 @@
|
|
|
6102
6162
|
break variant;
|
|
6103
6163
|
// <- case [🤖]:
|
|
6104
6164
|
default:
|
|
6105
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6165
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6106
6166
|
Unknown model variant "${task.modelRequirements.modelVariant}"
|
|
6107
6167
|
|
|
6108
6168
|
${block(pipelineIdentification)}
|
|
@@ -6113,14 +6173,14 @@
|
|
|
6113
6173
|
break;
|
|
6114
6174
|
case 'SCRIPT_TASK':
|
|
6115
6175
|
if (arrayableToArray(tools.script).length === 0) {
|
|
6116
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6176
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6117
6177
|
No script execution tools are available
|
|
6118
6178
|
|
|
6119
6179
|
${block(pipelineIdentification)}
|
|
6120
6180
|
`));
|
|
6121
6181
|
}
|
|
6122
6182
|
if (!task.contentLanguage) {
|
|
6123
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6183
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6124
6184
|
Script language is not defined for SCRIPT TASK "${task.name}"
|
|
6125
6185
|
|
|
6126
6186
|
${block(pipelineIdentification)}
|
|
@@ -6151,7 +6211,7 @@
|
|
|
6151
6211
|
throw $ongoingTaskResult.$scriptPipelineExecutionErrors[0];
|
|
6152
6212
|
}
|
|
6153
6213
|
else {
|
|
6154
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6214
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6155
6215
|
Script execution failed ${$ongoingTaskResult.$scriptPipelineExecutionErrors.length}x
|
|
6156
6216
|
|
|
6157
6217
|
${block(pipelineIdentification)}
|
|
@@ -6165,7 +6225,7 @@
|
|
|
6165
6225
|
break taskType;
|
|
6166
6226
|
case 'DIALOG_TASK':
|
|
6167
6227
|
if (tools.userInterface === undefined) {
|
|
6168
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6228
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6169
6229
|
User interface tools are not available
|
|
6170
6230
|
|
|
6171
6231
|
${block(pipelineIdentification)}
|
|
@@ -6183,7 +6243,7 @@
|
|
|
6183
6243
|
break taskType;
|
|
6184
6244
|
// <- case: [🅱]
|
|
6185
6245
|
default:
|
|
6186
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6246
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6187
6247
|
Unknown execution type "${task.taskType}"
|
|
6188
6248
|
|
|
6189
6249
|
${block(pipelineIdentification)}
|
|
@@ -6256,14 +6316,10 @@
|
|
|
6256
6316
|
});
|
|
6257
6317
|
}
|
|
6258
6318
|
finally {
|
|
6259
|
-
if (!isJokerAttempt &&
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
// In that case we don’t want to make a report about it because it’s not a llm execution error
|
|
6264
|
-
) {
|
|
6265
|
-
// TODO: [🧠] Maybe put other taskTypes into report
|
|
6266
|
-
$executionReport.promptExecutions.push({
|
|
6319
|
+
if (!isJokerAttempt && task.taskType === 'PROMPT_TASK' && $ongoingTaskResult.$prompt) {
|
|
6320
|
+
// Note: [2] When some expected parameter is not defined, error will occur in templateParameters
|
|
6321
|
+
// In that case we don’t want to make a report about it because it’s not a llm execution error
|
|
6322
|
+
const executionPromptReport = {
|
|
6267
6323
|
prompt: {
|
|
6268
6324
|
...$ongoingTaskResult.$prompt,
|
|
6269
6325
|
// <- TODO: [🧠] How to pick everyhing except `pipelineUrl`
|
|
@@ -6272,13 +6328,20 @@
|
|
|
6272
6328
|
error: $ongoingTaskResult.$expectError === null
|
|
6273
6329
|
? undefined
|
|
6274
6330
|
: serializeError($ongoingTaskResult.$expectError),
|
|
6275
|
-
}
|
|
6331
|
+
};
|
|
6332
|
+
$executionReport.promptExecutions.push(executionPromptReport);
|
|
6333
|
+
if (logLlmCall) {
|
|
6334
|
+
logLlmCall({
|
|
6335
|
+
modelName: 'model' /* <- TODO: How to get model name from the report */,
|
|
6336
|
+
report: executionPromptReport,
|
|
6337
|
+
});
|
|
6338
|
+
}
|
|
6276
6339
|
}
|
|
6277
6340
|
}
|
|
6278
6341
|
if ($ongoingTaskResult.$expectError !== null && attemptIndex === maxAttempts - 1) {
|
|
6279
6342
|
// Note: Create a summary of all failures
|
|
6280
6343
|
const failuresSummary = $ongoingTaskResult.$failedResults
|
|
6281
|
-
.map((failure) => spaceTrim.spaceTrim((block) => {
|
|
6344
|
+
.map((failure) => spaceTrim$1.spaceTrim((block) => {
|
|
6282
6345
|
var _a, _b;
|
|
6283
6346
|
return `
|
|
6284
6347
|
Attempt ${failure.attemptIndex + 1}:
|
|
@@ -6288,14 +6351,14 @@
|
|
|
6288
6351
|
Result:
|
|
6289
6352
|
${block(failure.result === null
|
|
6290
6353
|
? 'null'
|
|
6291
|
-
: spaceTrim.spaceTrim(failure.result)
|
|
6354
|
+
: spaceTrim$1.spaceTrim(failure.result)
|
|
6292
6355
|
.split('\n')
|
|
6293
6356
|
.map((line) => `> ${line}`)
|
|
6294
6357
|
.join('\n'))}
|
|
6295
6358
|
`;
|
|
6296
6359
|
}))
|
|
6297
6360
|
.join('\n\n---\n\n');
|
|
6298
|
-
throw new PipelineExecutionError(spaceTrim.spaceTrim((block) => {
|
|
6361
|
+
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => {
|
|
6299
6362
|
var _a;
|
|
6300
6363
|
return `
|
|
6301
6364
|
LLM execution failed ${maxExecutionAttempts}x
|
|
@@ -6315,7 +6378,7 @@
|
|
|
6315
6378
|
}
|
|
6316
6379
|
}
|
|
6317
6380
|
if ($ongoingTaskResult.$resultString === null) {
|
|
6318
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6381
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6319
6382
|
Something went wrong and prompt result is null
|
|
6320
6383
|
|
|
6321
6384
|
${block(pipelineIdentification)}
|
|
@@ -6337,9 +6400,9 @@
|
|
|
6337
6400
|
* @private internal utility of `createPipelineExecutor`
|
|
6338
6401
|
*/
|
|
6339
6402
|
async function executeFormatSubvalues(options) {
|
|
6340
|
-
const { task, jokerParameterNames, parameters, priority, csvSettings, onProgress, pipelineIdentification } = options;
|
|
6403
|
+
const { task, jokerParameterNames, parameters, priority, csvSettings, onProgress, logLlmCall, pipelineIdentification, } = options;
|
|
6341
6404
|
if (task.foreach === undefined) {
|
|
6342
|
-
return /* not await */ executeAttempts(options);
|
|
6405
|
+
return /* not await */ executeAttempts({ ...options, logLlmCall });
|
|
6343
6406
|
}
|
|
6344
6407
|
if (jokerParameterNames.length !== 0) {
|
|
6345
6408
|
throw new UnexpectedError(spaceTrim__default["default"]((block) => `
|
|
@@ -6545,7 +6608,7 @@
|
|
|
6545
6608
|
},
|
|
6546
6609
|
content: task.content,
|
|
6547
6610
|
parameters,
|
|
6548
|
-
};
|
|
6611
|
+
}; /* <- Note: [🤛] */
|
|
6549
6612
|
const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
|
|
6550
6613
|
const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
|
|
6551
6614
|
const { index } = knowledgePiece;
|
|
@@ -6621,7 +6684,7 @@
|
|
|
6621
6684
|
// Note: Doublecheck that ALL reserved parameters are defined:
|
|
6622
6685
|
for (const parameterName of RESERVED_PARAMETER_NAMES) {
|
|
6623
6686
|
if (reservedParameters[parameterName] === undefined) {
|
|
6624
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6687
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6625
6688
|
Reserved parameter {${parameterName}} is not defined
|
|
6626
6689
|
|
|
6627
6690
|
${block(pipelineIdentification)}
|
|
@@ -6640,14 +6703,14 @@
|
|
|
6640
6703
|
* @private internal utility of `createPipelineExecutor`
|
|
6641
6704
|
*/
|
|
6642
6705
|
async function executeTask(options) {
|
|
6643
|
-
const { currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSuppressed, } = options;
|
|
6706
|
+
const { currentTask, preparedPipeline, parametersToPass, tools, onProgress, logLlmCall, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSuppressed, } = options;
|
|
6644
6707
|
const priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
|
|
6645
6708
|
// Note: Check consistency of used and dependent parameters which was also done in `validatePipeline`, but it’s good to doublecheck
|
|
6646
6709
|
const usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
6647
6710
|
const dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
6648
6711
|
// TODO: [👩🏾🤝👩🏻] Use here `mapAvailableToExpectedParameters`
|
|
6649
6712
|
if (difference(union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)), new Set(RESERVED_PARAMETER_NAMES)).size !== 0) {
|
|
6650
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6713
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6651
6714
|
Dependent parameters are not consistent with used parameters:
|
|
6652
6715
|
|
|
6653
6716
|
Dependent parameters:
|
|
@@ -6691,7 +6754,7 @@
|
|
|
6691
6754
|
else if (!definedParameterNames.has(parameterName) && usedParameterNames.has(parameterName)) {
|
|
6692
6755
|
// Houston, we have a problem
|
|
6693
6756
|
// Note: Checking part is also done in `validatePipeline`, but it’s good to doublecheck
|
|
6694
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6757
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6695
6758
|
Parameter \`{${parameterName}}\` is NOT defined
|
|
6696
6759
|
BUT used in task "${currentTask.title || currentTask.name}"
|
|
6697
6760
|
|
|
@@ -6719,6 +6782,7 @@
|
|
|
6719
6782
|
tools,
|
|
6720
6783
|
$executionReport,
|
|
6721
6784
|
onProgress,
|
|
6785
|
+
logLlmCall,
|
|
6722
6786
|
pipelineIdentification,
|
|
6723
6787
|
maxExecutionAttempts,
|
|
6724
6788
|
maxParallelCount,
|
|
@@ -6759,9 +6823,32 @@
|
|
|
6759
6823
|
for (const parameter of preparedPipeline.parameters.filter(({ isOutput }) => isOutput)) {
|
|
6760
6824
|
if (parametersToPass[parameter.name] === undefined) {
|
|
6761
6825
|
// [4]
|
|
6762
|
-
$warnings.push(new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6826
|
+
$warnings.push(new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6763
6827
|
Parameter \`{${parameter.name}}\` should be an output parameter, but it was not generated during pipeline execution
|
|
6764
6828
|
|
|
6829
|
+
Note: This is a warning which happened after the pipeline was executed, and \`{${parameter.name}}\` was not for some reason defined in output parameters
|
|
6830
|
+
|
|
6831
|
+
All parameters:
|
|
6832
|
+
${block(preparedPipeline.parameters
|
|
6833
|
+
.map(({ name, isInput, isOutput, description }) => {
|
|
6834
|
+
let line = `\`{${name}}\``;
|
|
6835
|
+
if (isInput) {
|
|
6836
|
+
line += ' `[input parameter]`';
|
|
6837
|
+
}
|
|
6838
|
+
if (isOutput) {
|
|
6839
|
+
line += ' `[output parameter]`';
|
|
6840
|
+
}
|
|
6841
|
+
if (parametersToPass[name] === undefined) {
|
|
6842
|
+
line += ` <- Warning: Should be in the output but its not |`;
|
|
6843
|
+
}
|
|
6844
|
+
if (description) {
|
|
6845
|
+
line += ` ${description}`;
|
|
6846
|
+
}
|
|
6847
|
+
return line;
|
|
6848
|
+
})
|
|
6849
|
+
.map((line, index) => `${index + 1}) ${line}`)
|
|
6850
|
+
.join('\n'))}
|
|
6851
|
+
|
|
6765
6852
|
${block(pipelineIdentification)}
|
|
6766
6853
|
`)));
|
|
6767
6854
|
continue;
|
|
@@ -6782,7 +6869,7 @@
|
|
|
6782
6869
|
* @private internal utility of `createPipelineExecutor`
|
|
6783
6870
|
*/
|
|
6784
6871
|
async function executePipeline(options) {
|
|
6785
|
-
const { inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname, isVerbose, } = options;
|
|
6872
|
+
const { inputParameters, tools, onProgress, logLlmCall, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname, isVerbose, } = options;
|
|
6786
6873
|
let { preparedPipeline } = options;
|
|
6787
6874
|
if (preparedPipeline === undefined) {
|
|
6788
6875
|
preparedPipeline = await preparePipeline(pipeline, tools, {
|
|
@@ -6844,7 +6931,7 @@
|
|
|
6844
6931
|
for (const parameterName of Object.keys(inputParameters)) {
|
|
6845
6932
|
const parameter = preparedPipeline.parameters.find(({ name }) => name === parameterName);
|
|
6846
6933
|
if (parameter === undefined) {
|
|
6847
|
-
warnings.push(new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6934
|
+
warnings.push(new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6848
6935
|
Extra parameter {${parameterName}} is being passed which is not part of the pipeline.
|
|
6849
6936
|
|
|
6850
6937
|
${block(pipelineIdentification)}
|
|
@@ -6859,7 +6946,7 @@
|
|
|
6859
6946
|
// TODO: [🧠] This should be also non-critical error
|
|
6860
6947
|
return exportJson({
|
|
6861
6948
|
name: 'pipelineExecutorResult',
|
|
6862
|
-
message: spaceTrim.spaceTrim((block) => `
|
|
6949
|
+
message: spaceTrim$1.spaceTrim((block) => `
|
|
6863
6950
|
Unsuccessful PipelineExecutorResult (with extra parameter {${parameter.name}}) PipelineExecutorResult
|
|
6864
6951
|
|
|
6865
6952
|
${block(pipelineIdentification)}
|
|
@@ -6868,7 +6955,7 @@
|
|
|
6868
6955
|
value: {
|
|
6869
6956
|
isSuccessful: false,
|
|
6870
6957
|
errors: [
|
|
6871
|
-
new PipelineExecutionError(spaceTrim.spaceTrim((block) => `
|
|
6958
|
+
new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6872
6959
|
Parameter \`{${parameter.name}}\` is passed as input parameter but it is not input
|
|
6873
6960
|
|
|
6874
6961
|
${block(pipelineIdentification)}
|
|
@@ -6895,7 +6982,7 @@
|
|
|
6895
6982
|
while (unresovedTasks.length > 0) {
|
|
6896
6983
|
if (loopLimit-- < 0) {
|
|
6897
6984
|
// Note: Really UnexpectedError not LimitReachedError - this should be catched during validatePipeline
|
|
6898
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
6985
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6899
6986
|
Loop limit reached during resolving parameters pipeline execution
|
|
6900
6987
|
|
|
6901
6988
|
${block(pipelineIdentification)}
|
|
@@ -6905,7 +6992,7 @@
|
|
|
6905
6992
|
if (!currentTask && resolving.length === 0) {
|
|
6906
6993
|
throw new UnexpectedError(
|
|
6907
6994
|
// TODO: [🐎] DRY
|
|
6908
|
-
spaceTrim.spaceTrim((block) => `
|
|
6995
|
+
spaceTrim$1.spaceTrim((block) => `
|
|
6909
6996
|
Can not resolve some parameters:
|
|
6910
6997
|
|
|
6911
6998
|
${block(pipelineIdentification)}
|
|
@@ -6945,7 +7032,7 @@
|
|
|
6945
7032
|
tools,
|
|
6946
7033
|
onProgress(newOngoingResult) {
|
|
6947
7034
|
if (isReturned) {
|
|
6948
|
-
throw new UnexpectedError(spaceTrim.spaceTrim((block) => `
|
|
7035
|
+
throw new UnexpectedError(spaceTrim$1.spaceTrim((block) => `
|
|
6949
7036
|
Can not call \`onProgress\` after pipeline execution is finished
|
|
6950
7037
|
|
|
6951
7038
|
${block(pipelineIdentification)}
|
|
@@ -6960,8 +7047,9 @@
|
|
|
6960
7047
|
onProgress(newOngoingResult);
|
|
6961
7048
|
}
|
|
6962
7049
|
},
|
|
7050
|
+
logLlmCall,
|
|
6963
7051
|
$executionReport: executionReport,
|
|
6964
|
-
pipelineIdentification: spaceTrim.spaceTrim((block) => `
|
|
7052
|
+
pipelineIdentification: spaceTrim$1.spaceTrim((block) => `
|
|
6965
7053
|
${block(pipelineIdentification)}
|
|
6966
7054
|
Task name: ${currentTask.name}
|
|
6967
7055
|
Task title: ${currentTask.title}
|
|
@@ -7070,7 +7158,7 @@
|
|
|
7070
7158
|
preparedPipeline = pipeline;
|
|
7071
7159
|
}
|
|
7072
7160
|
else if (isNotPreparedWarningSuppressed !== true) {
|
|
7073
|
-
console.warn(spaceTrim.spaceTrim((block) => `
|
|
7161
|
+
console.warn(spaceTrim$1.spaceTrim((block) => `
|
|
7074
7162
|
Pipeline is not prepared
|
|
7075
7163
|
|
|
7076
7164
|
${block(pipelineIdentification)}
|
|
@@ -7083,7 +7171,7 @@
|
|
|
7083
7171
|
// <- TODO: [🏮] Some standard way how to transform errors into warnings and how to handle non-critical fails during the tasks
|
|
7084
7172
|
}
|
|
7085
7173
|
let runCount = 0;
|
|
7086
|
-
const pipelineExecutorWithCallback = async (inputParameters, onProgress) => {
|
|
7174
|
+
const pipelineExecutorWithCallback = async (inputParameters, onProgress, logLlmCall) => {
|
|
7087
7175
|
runCount++;
|
|
7088
7176
|
return /* not await */ executePipeline({
|
|
7089
7177
|
pipeline,
|
|
@@ -7094,7 +7182,8 @@
|
|
|
7094
7182
|
inputParameters,
|
|
7095
7183
|
tools,
|
|
7096
7184
|
onProgress,
|
|
7097
|
-
|
|
7185
|
+
logLlmCall,
|
|
7186
|
+
pipelineIdentification: spaceTrim$1.spaceTrim((block) => `
|
|
7098
7187
|
${block(pipelineIdentification)}
|
|
7099
7188
|
${runCount === 1 ? '' : `Run #${runCount}`}
|
|
7100
7189
|
`),
|
|
@@ -7255,7 +7344,7 @@
|
|
|
7255
7344
|
}
|
|
7256
7345
|
const llmTools = getSingleLlmExecutionTools(llm);
|
|
7257
7346
|
// TODO: [🌼] In future use `ptbk make` and made getPipelineCollection
|
|
7258
|
-
const collection =
|
|
7347
|
+
const collection = createPipelineCollectionFromJson(...PipelineCollection);
|
|
7259
7348
|
const prepareKnowledgeFromMarkdownExecutor = createPipelineExecutor({
|
|
7260
7349
|
pipeline: await collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book'),
|
|
7261
7350
|
tools: {
|