@promptbook/cli 0.82.0-0 → 0.82.0-3
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/esm/index.es.js +74 -73
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +2 -0
- package/esm/typings/src/_packages/remote-client.index.d.ts +9 -3
- package/esm/typings/src/_packages/remote-server.index.d.ts +8 -2
- package/esm/typings/src/_packages/types.index.d.ts +16 -26
- package/esm/typings/src/collection/PipelineCollection.d.ts +2 -0
- package/esm/typings/src/config.d.ts +6 -0
- package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +6 -3
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +2 -2
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +3 -7
- package/esm/typings/src/other/templates/getBookTemplates.d.ts +5 -3
- package/esm/typings/src/prepare/preparePipelineOnRemoteServer.d.ts +5 -2
- package/esm/typings/src/remote-server/createRemoteClient.d.ts +10 -0
- package/esm/typings/src/remote-server/{interfaces → socket-types/_common}/PromptbookServer_Error.d.ts +3 -3
- package/esm/typings/src/remote-server/socket-types/_common/PromptbookServer_Progress.d.ts +10 -0
- package/esm/typings/src/remote-server/socket-types/_subtypes/PromptbookServer_Identification.d.ts +49 -0
- package/esm/typings/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Request.d.ts +17 -0
- package/esm/typings/src/remote-server/{interfaces → socket-types/listModels}/PromptbookServer_ListModels_Response.d.ts +4 -2
- package/esm/typings/src/remote-server/socket-types/prepare/PromptbookServer_PreparePipeline_Request.d.ts +17 -0
- package/esm/typings/src/remote-server/socket-types/prepare/PromptbookServer_PreparePipeline_Response.d.ts +12 -0
- package/esm/typings/src/remote-server/socket-types/prompt/PromptbookServer_Prompt_Request.d.ts +17 -0
- package/esm/typings/src/remote-server/{interfaces → socket-types/prompt}/PromptbookServer_Prompt_Response.d.ts +3 -3
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +3 -2
- package/esm/typings/src/remote-server/types/RemoteClientOptions.d.ts +32 -0
- package/esm/typings/src/types/Arrayable.d.ts +1 -0
- package/esm/typings/src/types/NonEmptyArray.d.ts +8 -0
- package/package.json +1 -1
- package/umd/index.umd.js +74 -73
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/remote-server/interfaces/PromptbookServer_ListModels_Request.d.ts +0 -38
- package/esm/typings/src/remote-server/interfaces/PromptbookServer_Prompt_Progress.d.ts +0 -12
- package/esm/typings/src/remote-server/interfaces/PromptbookServer_Prompt_Request.d.ts +0 -45
- package/esm/typings/src/remote-server/interfaces/RemoteLlmExecutionToolsOptions.d.ts +0 -54
- /package/esm/typings/src/remote-server/{interfaces → types}/RemoteServerOptions.d.ts +0 -0
package/esm/index.es.js
CHANGED
|
@@ -39,7 +39,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
39
39
|
* @generated
|
|
40
40
|
* @see https://github.com/webgptorg/promptbook
|
|
41
41
|
*/
|
|
42
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
42
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.82.0-2';
|
|
43
43
|
/**
|
|
44
44
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
45
45
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -224,6 +224,12 @@ var CLAIM = "It's time for a paradigm shift. The future of software in plain Eng
|
|
|
224
224
|
* @public exported from `@promptbook/core`
|
|
225
225
|
*/
|
|
226
226
|
var DEFAULT_BOOK_TITLE = "\u2728 Untitled Book";
|
|
227
|
+
/**
|
|
228
|
+
* When the title of task is not provided, the default title is used
|
|
229
|
+
*
|
|
230
|
+
* @public exported from `@promptbook/core`
|
|
231
|
+
*/
|
|
232
|
+
var DEFAULT_TASK_TITLE = "Task";
|
|
227
233
|
/**
|
|
228
234
|
* Warning message for the generated sections and files files
|
|
229
235
|
*
|
|
@@ -2782,7 +2788,7 @@ function collectionToJson(collection) {
|
|
|
2782
2788
|
* TODO: [🧠] Maybe clear `sourceFile` or clear when exposing through API or remote server
|
|
2783
2789
|
*/
|
|
2784
2790
|
|
|
2785
|
-
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book.md",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.md`\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.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.book.md",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.md`\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.md"},{title:"Prepare Knowledge-piece Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.book.md",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- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\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.md`\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- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\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.md"},{title:"Prepare Persona",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.book.md",formfactorName:"GENERIC",parameters:[{name:"availableModelNames",description:"List of available model names separated by comma (,)",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-model-requirements",title:"Make modelRequirements",content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Example\n\n```json\n{\n\"modelName\": \"gpt-4o\",\n\"systemMessage\": \"You are experienced AI engineer and helpfull assistant.\",\n\"temperature\": 0.7\n}\n```\n\n## Instructions\n\n- Your output format is JSON object\n- Write just the JSON object, no other text should be present\n- It contains the 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\nPick from the following models:\n\n- {availableModelNames}\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:"modelRequirements",format:"JSON",dependentParameterNames:["availableModelNames","personaDescription"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Persona\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-persona.book.md`\n- INPUT PARAMETER `{availableModelNames}` List of available model names separated by comma (,)\n- INPUT PARAMETER `{personaDescription}` Description of the persona\n- OUTPUT PARAMETER `{modelRequirements}` Specific requirements for the model\n\n## Make modelRequirements\n\n- FORMAT JSON\n\n```markdown\nYou are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Example\n\n\\`\\`\\`json\n{\n\"modelName\": \"gpt-4o\",\n\"systemMessage\": \"You are experienced AI engineer and helpfull assistant.\",\n\"temperature\": 0.7\n}\n\\`\\`\\`\n\n## Instructions\n\n- Your output format is JSON object\n- Write just the JSON object, no other text should be present\n- It contains the 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\nPick from the following models:\n\n- {availableModelNames}\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`-> {modelRequirements}`\n"}],sourceFile:"./books/prepare-persona.book.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-title.book.md",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 task:\n\n> {book}\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear\n- Title starts with emoticon",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.md`\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 task:\n\n> {book}\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear\n- Title starts with emoticon\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-title.book.md"}];
|
|
2791
|
+
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book.md",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.md`\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.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.book.md",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.md`\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.md"},{title:"Prepare Knowledge-piece Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.book.md",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.md`\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.md"},{title:"Prepare Persona",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.book.md",formfactorName:"GENERIC",parameters:[{name:"availableModelNames",description:"List of available model names separated by comma (,)",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-model-requirements",title:"Make modelRequirements",content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Example\n\n```json\n{\n\"modelName\": \"gpt-4o\",\n\"systemMessage\": \"You are experienced AI engineer and helpfull assistant.\",\n\"temperature\": 0.7\n}\n```\n\n## Instructions\n\n- Your output format is JSON object\n- Write just the JSON object, no other text should be present\n- It contains the 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\nPick from the following models:\n\n- {availableModelNames}\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:"modelRequirements",format:"JSON",dependentParameterNames:["availableModelNames","personaDescription"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Persona\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-persona.book.md`\n- INPUT PARAMETER `{availableModelNames}` List of available model names separated by comma (,)\n- INPUT PARAMETER `{personaDescription}` Description of the persona\n- OUTPUT PARAMETER `{modelRequirements}` Specific requirements for the model\n\n## Make modelRequirements\n\n- FORMAT JSON\n\n```markdown\nYou are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Example\n\n\\`\\`\\`json\n{\n\"modelName\": \"gpt-4o\",\n\"systemMessage\": \"You are experienced AI engineer and helpfull assistant.\",\n\"temperature\": 0.7\n}\n\\`\\`\\`\n\n## Instructions\n\n- Your output format is JSON object\n- Write just the JSON object, no other text should be present\n- It contains the 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\nPick from the following models:\n\n- {availableModelNames}\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`-> {modelRequirements}`\n"}],sourceFile:"./books/prepare-persona.book.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-title.book.md",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.md`\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.md"}];
|
|
2786
2792
|
|
|
2787
2793
|
/**
|
|
2788
2794
|
* Function isValidJsonString will tell you if the string is valid JSON or not
|
|
@@ -3893,11 +3899,17 @@ var ALL_ERRORS = __assign(__assign({}, PROMPTBOOK_ERRORS), COMMON_JAVASCRIPT_ERR
|
|
|
3893
3899
|
* @public exported from `@promptbook/utils`
|
|
3894
3900
|
*/
|
|
3895
3901
|
function deserializeError(error) {
|
|
3902
|
+
var name = error.name, stack = error.stack;
|
|
3903
|
+
var message = error.message;
|
|
3896
3904
|
var ErrorClass = ALL_ERRORS[error.name];
|
|
3897
3905
|
if (ErrorClass === undefined) {
|
|
3898
|
-
|
|
3906
|
+
ErrorClass = Error;
|
|
3907
|
+
message = "".concat(name, ": ").concat(message);
|
|
3908
|
+
}
|
|
3909
|
+
if (stack !== undefined && stack !== '') {
|
|
3910
|
+
message = spaceTrim(function (block) { return "\n ".concat(block(message), "\n\n Original stack trace:\n ").concat(block(stack || ''), "\n "); });
|
|
3899
3911
|
}
|
|
3900
|
-
return new ErrorClass(
|
|
3912
|
+
return new ErrorClass(message);
|
|
3901
3913
|
}
|
|
3902
3914
|
|
|
3903
3915
|
/**
|
|
@@ -10055,8 +10067,8 @@ function parsePipeline(pipelineString) {
|
|
|
10055
10067
|
isSectionTypeSet: false,
|
|
10056
10068
|
isTask: true,
|
|
10057
10069
|
taskType: undefined /* <- Note: [🍙] Putting here placeholder to keep `taskType` on top at final JSON */,
|
|
10058
|
-
name: getUniqueSectionName(section.title),
|
|
10059
|
-
title: section.title,
|
|
10070
|
+
name: getUniqueSectionName(section.title || DEFAULT_TASK_TITLE),
|
|
10071
|
+
title: section.title || DEFAULT_TASK_TITLE,
|
|
10060
10072
|
description: description_1,
|
|
10061
10073
|
content: content,
|
|
10062
10074
|
// <- TODO: [🍙] Some standard order of properties
|
|
@@ -11773,7 +11785,8 @@ function initializeMakeCommand(program) {
|
|
|
11773
11785
|
console.error(colors.red("Function name \"".concat(functionName, "\" is not valid javascript name")));
|
|
11774
11786
|
return [2 /*return*/, process.exit(1)];
|
|
11775
11787
|
}
|
|
11776
|
-
if (
|
|
11788
|
+
if (rootUrl !== undefined &&
|
|
11789
|
+
!isValidUrl(rootUrl) /* <- Note: Not using `isValidPipelineUrl` because this is root url not book url */) {
|
|
11777
11790
|
console.error(colors.red("Root URL ".concat(rootUrl, " is not valid URL")));
|
|
11778
11791
|
return [2 /*return*/, process.exit(1)];
|
|
11779
11792
|
}
|
|
@@ -13255,6 +13268,39 @@ var _AnthropicClaudeMetadataRegistration = $llmToolsMetadataRegister.register({
|
|
|
13255
13268
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13256
13269
|
*/
|
|
13257
13270
|
|
|
13271
|
+
/**
|
|
13272
|
+
* Creates a connection to the remote proxy server.
|
|
13273
|
+
*
|
|
13274
|
+
* Note: This function creates a connection to the remote server and returns a socket but responsibility of closing the connection is on the caller
|
|
13275
|
+
*
|
|
13276
|
+
* @private internal utility function
|
|
13277
|
+
*/
|
|
13278
|
+
function createRemoteClient(options) {
|
|
13279
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
13280
|
+
var remoteUrl, path;
|
|
13281
|
+
return __generator(this, function (_a) {
|
|
13282
|
+
remoteUrl = options.remoteUrl, path = options.path;
|
|
13283
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
13284
|
+
var socket = io(remoteUrl, {
|
|
13285
|
+
retries: CONNECTION_RETRIES_LIMIT,
|
|
13286
|
+
timeout: CONNECTION_TIMEOUT_MS,
|
|
13287
|
+
path: path,
|
|
13288
|
+
// path: `${this.remoteUrl.pathname}/socket.io`,
|
|
13289
|
+
transports: [/*'websocket', <- TODO: [🌬] Make websocket transport work */ 'polling'],
|
|
13290
|
+
});
|
|
13291
|
+
// console.log('Connecting to', this.options.remoteUrl.href, { socket });
|
|
13292
|
+
socket.on('connect', function () {
|
|
13293
|
+
resolve(socket);
|
|
13294
|
+
});
|
|
13295
|
+
// TODO: [💩] Better timeout handling
|
|
13296
|
+
setTimeout(function () {
|
|
13297
|
+
reject(new Error("Timeout while connecting to ".concat(remoteUrl)));
|
|
13298
|
+
}, CONNECTION_TIMEOUT_MS);
|
|
13299
|
+
})];
|
|
13300
|
+
});
|
|
13301
|
+
});
|
|
13302
|
+
}
|
|
13303
|
+
|
|
13258
13304
|
/**
|
|
13259
13305
|
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
13260
13306
|
*
|
|
@@ -13292,7 +13338,7 @@ var RemoteLlmExecutionTools = /** @class */ (function () {
|
|
|
13292
13338
|
var socket;
|
|
13293
13339
|
return __generator(this, function (_a) {
|
|
13294
13340
|
switch (_a.label) {
|
|
13295
|
-
case 0: return [4 /*yield*/, this.
|
|
13341
|
+
case 0: return [4 /*yield*/, createRemoteClient(this.options)];
|
|
13296
13342
|
case 1:
|
|
13297
13343
|
socket = _a.sent();
|
|
13298
13344
|
socket.disconnect();
|
|
@@ -13309,24 +13355,12 @@ var RemoteLlmExecutionTools = /** @class */ (function () {
|
|
|
13309
13355
|
var socket, promptResult;
|
|
13310
13356
|
return __generator(this, function (_a) {
|
|
13311
13357
|
switch (_a.label) {
|
|
13312
|
-
case 0: return [4 /*yield*/, this.
|
|
13358
|
+
case 0: return [4 /*yield*/, createRemoteClient(this.options)];
|
|
13313
13359
|
case 1:
|
|
13314
13360
|
socket = _a.sent();
|
|
13315
|
-
|
|
13316
|
-
|
|
13317
|
-
|
|
13318
|
-
userId: this.options.userId,
|
|
13319
|
-
llmToolsConfiguration: this.options.llmToolsConfiguration,
|
|
13320
|
-
} /* <- Note: [🤛] */);
|
|
13321
|
-
}
|
|
13322
|
-
else {
|
|
13323
|
-
socket.emit('listModels-request', {
|
|
13324
|
-
isAnonymous: false,
|
|
13325
|
-
appId: this.options.appId,
|
|
13326
|
-
userId: this.options.userId,
|
|
13327
|
-
customOptions: this.options.customOptions,
|
|
13328
|
-
} /* <- Note: [🤛] */);
|
|
13329
|
-
}
|
|
13361
|
+
socket.emit('listModels-request', {
|
|
13362
|
+
identification: this.options.identification,
|
|
13363
|
+
} /* <- Note: [🤛] */);
|
|
13330
13364
|
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
13331
13365
|
socket.on('listModels-response', function (response) {
|
|
13332
13366
|
resolve(response.models);
|
|
@@ -13345,29 +13379,6 @@ var RemoteLlmExecutionTools = /** @class */ (function () {
|
|
|
13345
13379
|
});
|
|
13346
13380
|
});
|
|
13347
13381
|
};
|
|
13348
|
-
/**
|
|
13349
|
-
* Creates a connection to the remote proxy server.
|
|
13350
|
-
*/
|
|
13351
|
-
RemoteLlmExecutionTools.prototype.makeConnection = function () {
|
|
13352
|
-
var _this = this;
|
|
13353
|
-
return new Promise(function (resolve, reject) {
|
|
13354
|
-
var socket = io(_this.options.remoteUrl, {
|
|
13355
|
-
retries: CONNECTION_RETRIES_LIMIT,
|
|
13356
|
-
timeout: CONNECTION_TIMEOUT_MS,
|
|
13357
|
-
path: _this.options.path,
|
|
13358
|
-
// path: `${this.remoteUrl.pathname}/socket.io`,
|
|
13359
|
-
transports: [/*'websocket', <- TODO: [🌬] Make websocket transport work */ 'polling'],
|
|
13360
|
-
});
|
|
13361
|
-
// console.log('Connecting to', this.options.remoteUrl.href, { socket });
|
|
13362
|
-
socket.on('connect', function () {
|
|
13363
|
-
resolve(socket);
|
|
13364
|
-
});
|
|
13365
|
-
// TODO: [💩] Better timeout handling
|
|
13366
|
-
setTimeout(function () {
|
|
13367
|
-
reject(new Error("Timeout while connecting to ".concat(_this.options.remoteUrl)));
|
|
13368
|
-
}, CONNECTION_TIMEOUT_MS);
|
|
13369
|
-
});
|
|
13370
|
-
};
|
|
13371
13382
|
/**
|
|
13372
13383
|
* Calls remote proxy server to use a chat model
|
|
13373
13384
|
*/
|
|
@@ -13404,26 +13415,13 @@ var RemoteLlmExecutionTools = /** @class */ (function () {
|
|
|
13404
13415
|
var socket, promptResult;
|
|
13405
13416
|
return __generator(this, function (_a) {
|
|
13406
13417
|
switch (_a.label) {
|
|
13407
|
-
case 0: return [4 /*yield*/, this.
|
|
13418
|
+
case 0: return [4 /*yield*/, createRemoteClient(this.options)];
|
|
13408
13419
|
case 1:
|
|
13409
13420
|
socket = _a.sent();
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
llmToolsConfiguration: this.options.llmToolsConfiguration,
|
|
13415
|
-
prompt: prompt,
|
|
13416
|
-
} /* <- Note: [🤛] */);
|
|
13417
|
-
}
|
|
13418
|
-
else {
|
|
13419
|
-
socket.emit('prompt-request', {
|
|
13420
|
-
isAnonymous: false,
|
|
13421
|
-
appId: this.options.appId,
|
|
13422
|
-
userId: this.options.userId,
|
|
13423
|
-
customOptions: this.options.customOptions,
|
|
13424
|
-
prompt: prompt,
|
|
13425
|
-
} /* <- Note: [🤛] */);
|
|
13426
|
-
}
|
|
13421
|
+
socket.emit('prompt-request', {
|
|
13422
|
+
identification: this.options.identification,
|
|
13423
|
+
prompt: prompt,
|
|
13424
|
+
} /* <- Note: [🤛] */);
|
|
13427
13425
|
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
13428
13426
|
socket.on('prompt-response', function (response) {
|
|
13429
13427
|
resolve(response.promptResult);
|
|
@@ -13902,14 +13900,17 @@ var AnthropicClaudeExecutionTools = /** @class */ (function () {
|
|
|
13902
13900
|
*/
|
|
13903
13901
|
var createAnthropicClaudeExecutionTools = Object.assign(function (options) {
|
|
13904
13902
|
if (options.isProxied) {
|
|
13905
|
-
return new RemoteLlmExecutionTools(__assign(__assign({}, options), {
|
|
13906
|
-
|
|
13907
|
-
|
|
13908
|
-
|
|
13909
|
-
|
|
13910
|
-
|
|
13911
|
-
|
|
13912
|
-
|
|
13903
|
+
return new RemoteLlmExecutionTools(__assign(__assign({}, options), { identification: {
|
|
13904
|
+
isAnonymous: true,
|
|
13905
|
+
llmToolsConfiguration: [
|
|
13906
|
+
{
|
|
13907
|
+
title: 'Anthropic Claude (proxied)',
|
|
13908
|
+
packageName: '@promptbook/anthropic-claude',
|
|
13909
|
+
className: 'AnthropicClaudeExecutionTools',
|
|
13910
|
+
options: __assign(__assign({}, options), { isProxied: false }),
|
|
13911
|
+
},
|
|
13912
|
+
],
|
|
13913
|
+
} }));
|
|
13913
13914
|
}
|
|
13914
13915
|
return new AnthropicClaudeExecutionTools(options);
|
|
13915
13916
|
}, {
|