@promptbook/pdf 0.85.0-9 → 0.86.0-10
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 +9 -25
- package/esm/index.es.js +11 -59
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/cli/promptbookCli.d.ts +1 -1
- package/esm/typings/src/collection/collectionToJson.test.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +3 -3
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +2 -2
- package/esm/typings/src/types/Prompt.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +2 -2
- package/esm/typings/src/utils/editable/utils/stringifyPipelineJson.d.ts +1 -1
- package/esm/typings/src/wizzard/wizzard.d.ts +6 -6
- package/package.json +3 -3
- package/umd/index.umd.js +11 -59
- package/umd/index.umd.js.map +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function promptbookCli(): Promise<void>;
|
|
7
7
|
/**
|
|
8
|
-
* TODO: [🧠] Maybe `run` command the default, instead of `ptbk run ./foo.book
|
|
8
|
+
* TODO: [🧠] Maybe `run` command the default, instead of `ptbk run ./foo.book` -> `ptbk ./foo.book`
|
|
9
9
|
* TODO: [🥠] Do not export, its just for CLI script
|
|
10
10
|
* TODO: [🕌] When more functionalities, rename
|
|
11
11
|
* Note: 11:11
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export {};
|
|
2
2
|
/**
|
|
3
|
-
* Note: [🐠] For example here URL https://example.com/pipeline.book
|
|
3
|
+
* Note: [🐠] For example here URL https://example.com/pipeline.book is not valid
|
|
4
4
|
* because it is on private network BUT its very hard to debug because
|
|
5
5
|
* there is no error message and false return (the error) happen deep in:
|
|
6
6
|
* `isValidPipelineUrl` -> `isValidPipelineUrl` -> `isUrlOnPrivateNetwork`
|
|
@@ -6,7 +6,7 @@ import type { PipelineCollection } from '../PipelineCollection';
|
|
|
6
6
|
/**
|
|
7
7
|
* Options for `createCollectionFromDirectory` function
|
|
8
8
|
*
|
|
9
|
-
* Note: `rootDirname` is not needed because it is the folder in which `.book
|
|
9
|
+
* Note: `rootDirname` is not needed because it is the folder in which `.book` or `.book` file is located
|
|
10
10
|
* This is not same as `path` which is the first argument of `createCollectionFromDirectory` - it can be a subfolder
|
|
11
11
|
*/
|
|
12
12
|
type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions, 'rootDirname'> & {
|
|
@@ -51,13 +51,13 @@ type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions
|
|
|
51
51
|
*
|
|
52
52
|
* Note: Works only in Node.js environment because it reads the file system
|
|
53
53
|
*
|
|
54
|
-
* @param
|
|
54
|
+
* @param rootPath - path to the directory with pipelines
|
|
55
55
|
* @param tools - Execution tools to be used for pipeline preparation if needed - If not provided, `$provideExecutionToolsForNode` will be used
|
|
56
56
|
* @param options - Options for the collection creation
|
|
57
57
|
* @returns PipelineCollection
|
|
58
58
|
* @public exported from `@promptbook/node`
|
|
59
59
|
*/
|
|
60
|
-
export declare function createCollectionFromDirectory(
|
|
60
|
+
export declare function createCollectionFromDirectory(rootPath: string_dirname, tools?: Pick<ExecutionTools, 'llm' | 'fs' | 'scrapers'>, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
|
|
61
61
|
export {};
|
|
62
62
|
/**
|
|
63
63
|
* TODO: [🖇] What about symlinks? Maybe option isSymlinksFollowed
|
|
@@ -3,7 +3,7 @@ import type { ForeachCommand } from './ForeachCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the foreach command
|
|
5
5
|
*
|
|
6
|
-
* Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book
|
|
6
|
+
* Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @public exported from `@promptbook/editable`
|
|
@@ -3,7 +3,7 @@ import type { FormfactorCommand } from './FormfactorCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the formfactor command
|
|
5
5
|
*
|
|
6
|
-
* Note: @@@ This command is used as formfactor for new commands - it should NOT be used in any `.book
|
|
6
|
+
* Note: @@@ This command is used as formfactor for new commands - it should NOT be used in any `.book` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @public exported from `@promptbook/editable`
|
|
@@ -3,7 +3,7 @@ import type { BoilerplateCommand } from './BoilerplateCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the boilerplate command
|
|
5
5
|
*
|
|
6
|
-
* Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.book
|
|
6
|
+
* Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.book` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @private within the commands folder
|
|
@@ -2,7 +2,7 @@ import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
|
2
2
|
import type { PipelineString } from '../../pipeline/PipelineString';
|
|
3
3
|
import type { string_json } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
|
-
* Import the pipeline.book
|
|
5
|
+
* Import the pipeline.book or pipeline.book.json file
|
|
6
6
|
*
|
|
7
7
|
* Note: Using here custom import to work in jest tests
|
|
8
8
|
* Note: Using sync version is 💩 in the production code, but it's ok here in tests
|
|
@@ -10,7 +10,7 @@ import type { string_json } from '../../types/typeAliases';
|
|
|
10
10
|
* @param path - The path to the file relative to examples/pipelines directory
|
|
11
11
|
* @private internal function of tests
|
|
12
12
|
*/
|
|
13
|
-
export declare function importPipelineWithoutPreparation(path: `${string}.book
|
|
13
|
+
export declare function importPipelineWithoutPreparation(path: `${string}.book`): PipelineString;
|
|
14
14
|
export declare function importPipelineWithoutPreparation(path: `${string}.book.json`): PipelineJson;
|
|
15
15
|
/**
|
|
16
16
|
* Import the pipeline.book.json file as parsed JSON
|
|
@@ -29,12 +29,12 @@ export type PipelineJson = {
|
|
|
29
29
|
* Note: It must be unique across all pipeline collections
|
|
30
30
|
* Note: It must use HTTPs URL
|
|
31
31
|
* Tip: You can do versioning in the URL
|
|
32
|
-
* For example: https://promptbook.studio/webgpt/write-website-content-cs.book
|
|
32
|
+
* For example: https://promptbook.studio/webgpt/write-website-content-cs.book@1.0.0
|
|
33
33
|
* Warning: Do not hash part of the URL, hash part is used for identification of the task in the pipeline
|
|
34
34
|
*/
|
|
35
35
|
readonly pipelineUrl?: string_pipeline_url;
|
|
36
36
|
/**
|
|
37
|
-
* Internal helper for tracking the source `.book
|
|
37
|
+
* Internal helper for tracking the source `.book` file of the pipeline
|
|
38
38
|
*/
|
|
39
39
|
readonly sourceFile?: string_filename;
|
|
40
40
|
/**
|
|
@@ -95,7 +95,7 @@ export type CommonPrompt = {
|
|
|
95
95
|
/**
|
|
96
96
|
* Unique identifier of the pipeline with specific task name as hash
|
|
97
97
|
*
|
|
98
|
-
* @example https://promptbook.studio/webgpt/write-website-content-cs.book
|
|
98
|
+
* @example https://promptbook.studio/webgpt/write-website-content-cs.book#keywords
|
|
99
99
|
*/
|
|
100
100
|
readonly pipelineUrl?: string_pipeline_url_with_task_hash;
|
|
101
101
|
/**
|
|
@@ -328,13 +328,13 @@ export type string_pipeline_root_url = string;
|
|
|
328
328
|
/**
|
|
329
329
|
* Semantic helper
|
|
330
330
|
*
|
|
331
|
-
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.book
|
|
331
|
+
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.book"`
|
|
332
332
|
*/
|
|
333
333
|
export type string_pipeline_url = string;
|
|
334
334
|
/**
|
|
335
335
|
* Semantic helper
|
|
336
336
|
*
|
|
337
|
-
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.book
|
|
337
|
+
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.book#keywords"`
|
|
338
338
|
*/
|
|
339
339
|
export type string_pipeline_url_with_task_hash = string;
|
|
340
340
|
/**
|
|
@@ -9,7 +9,7 @@ import type { string_json } from '../../../types/typeAliases';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function stringifyPipelineJson<TType>(pipeline: TType): string_json<TType>;
|
|
11
11
|
/**
|
|
12
|
-
* TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book
|
|
12
|
+
* TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book
|
|
13
13
|
* TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
|
|
14
14
|
* TODO: [🧠] Maybe more elegant solution than replacing via regex
|
|
15
15
|
* TODO: [🍙] Make some standard order of json properties
|
|
@@ -19,9 +19,9 @@ declare class Wizzard {
|
|
|
19
19
|
* Run the book
|
|
20
20
|
*
|
|
21
21
|
* It can be loaded from:
|
|
22
|
-
* 1) As a file ./books/write-cv.book
|
|
23
|
-
* 2) As a URL https://promptbook.studio/hejny/write-cv.book
|
|
24
|
-
* 2) As a URL https://promptbook.studio/hejny/write-cv.book
|
|
22
|
+
* 1) As a file ./books/write-cv.book
|
|
23
|
+
* 2) As a URL https://promptbook.studio/hejny/write-cv.book found in ./books folder recursively
|
|
24
|
+
* 2) As a URL https://promptbook.studio/hejny/write-cv.book fetched from the internet
|
|
25
25
|
* 3) As a string
|
|
26
26
|
*
|
|
27
27
|
* Note: This works simmilar to the `ptbk run` command
|
|
@@ -43,9 +43,9 @@ declare class Wizzard {
|
|
|
43
43
|
* Load book from the source
|
|
44
44
|
*
|
|
45
45
|
* Pipelines can be loaded from:
|
|
46
|
-
* 1) As a file ./books/write-cv.book
|
|
47
|
-
* 2) As a URL https://promptbook.studio/hejny/write-cv.book
|
|
48
|
-
* 2) As a URL https://promptbook.studio/hejny/write-cv.book
|
|
46
|
+
* 1) As a file ./books/write-cv.book
|
|
47
|
+
* 2) As a URL https://promptbook.studio/hejny/write-cv.book found in ./books folder recursively
|
|
48
|
+
* 2) As a URL https://promptbook.studio/hejny/write-cv.book fetched from the internet
|
|
49
49
|
* 3) As a string
|
|
50
50
|
*
|
|
51
51
|
* @param pipelineSource
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/pdf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.0-10",
|
|
4
4
|
"description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"bugs": {
|
|
43
43
|
"url": "https://github.com/webgptorg/promptbook/issues"
|
|
44
44
|
},
|
|
45
|
-
"homepage": "https://
|
|
45
|
+
"homepage": "https://ptbk.io/",
|
|
46
46
|
"main": "./umd/index.umd.js",
|
|
47
47
|
"module": "./esm/index.es.js",
|
|
48
48
|
"typings": "./esm/typings/src/_packages/pdf.index.d.ts",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@promptbook/core": "0.
|
|
50
|
+
"@promptbook/core": "0.86.0-10"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"crypto": "^1.0.1",
|
package/umd/index.umd.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* @generated
|
|
26
26
|
* @see https://github.com/webgptorg/promptbook
|
|
27
27
|
*/
|
|
28
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
28
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.86.0-9';
|
|
29
29
|
/**
|
|
30
30
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
31
31
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -963,7 +963,7 @@
|
|
|
963
963
|
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
964
964
|
*/
|
|
965
965
|
|
|
966
|
-
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"}];
|
|
966
|
+
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:"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`\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"},{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"}];
|
|
967
967
|
|
|
968
968
|
/**
|
|
969
969
|
* Checks if value is valid email
|
|
@@ -1650,57 +1650,6 @@
|
|
|
1650
1650
|
return true;
|
|
1651
1651
|
}
|
|
1652
1652
|
|
|
1653
|
-
/**
|
|
1654
|
-
* Checks if an URL is reserved for private networks or localhost.
|
|
1655
|
-
*
|
|
1656
|
-
* Note: There are two simmilar functions:
|
|
1657
|
-
* - `isUrlOnPrivateNetwork` which tests full URL
|
|
1658
|
-
* - `isHostnameOnPrivateNetwork` *(this one)* which tests just hostname
|
|
1659
|
-
*
|
|
1660
|
-
* @public exported from `@promptbook/utils`
|
|
1661
|
-
*/
|
|
1662
|
-
function isHostnameOnPrivateNetwork(hostname) {
|
|
1663
|
-
if (hostname === 'example.com' ||
|
|
1664
|
-
hostname === 'localhost' ||
|
|
1665
|
-
hostname.endsWith('.localhost') ||
|
|
1666
|
-
hostname.endsWith('.local') ||
|
|
1667
|
-
hostname.endsWith('.test') ||
|
|
1668
|
-
hostname === '127.0.0.1' ||
|
|
1669
|
-
hostname === '::1') {
|
|
1670
|
-
return true;
|
|
1671
|
-
}
|
|
1672
|
-
if (hostname.includes(':')) {
|
|
1673
|
-
// IPv6
|
|
1674
|
-
var ipParts = hostname.split(':');
|
|
1675
|
-
return ipParts[0] === 'fc00' || ipParts[0] === 'fd00' || ipParts[0] === 'fe80';
|
|
1676
|
-
}
|
|
1677
|
-
else {
|
|
1678
|
-
// IPv4
|
|
1679
|
-
var ipParts = hostname.split('.').map(function (part) { return Number.parseInt(part, 10); });
|
|
1680
|
-
return (ipParts[0] === 10 ||
|
|
1681
|
-
(ipParts[0] === 172 && ipParts[1] >= 16 && ipParts[1] <= 31) ||
|
|
1682
|
-
(ipParts[0] === 192 && ipParts[1] === 168));
|
|
1683
|
-
}
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
|
-
/**
|
|
1687
|
-
* Checks if an IP address or hostname is reserved for private networks or localhost.
|
|
1688
|
-
*
|
|
1689
|
-
* Note: There are two simmilar functions:
|
|
1690
|
-
* - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
|
|
1691
|
-
* - `isHostnameOnPrivateNetwork` which tests just hostname
|
|
1692
|
-
*
|
|
1693
|
-
* @param {string} ipAddress - The IP address to check.
|
|
1694
|
-
* @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
|
|
1695
|
-
* @public exported from `@promptbook/utils`
|
|
1696
|
-
*/
|
|
1697
|
-
function isUrlOnPrivateNetwork(url) {
|
|
1698
|
-
if (typeof url === 'string') {
|
|
1699
|
-
url = new URL(url);
|
|
1700
|
-
}
|
|
1701
|
-
return isHostnameOnPrivateNetwork(url.hostname);
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
1653
|
/**
|
|
1705
1654
|
* Tests if given string is valid pipeline URL URL.
|
|
1706
1655
|
*
|
|
@@ -1714,16 +1663,19 @@
|
|
|
1714
1663
|
if (!isValidUrl(url)) {
|
|
1715
1664
|
return false;
|
|
1716
1665
|
}
|
|
1717
|
-
if (!url.startsWith('https://')) {
|
|
1666
|
+
if (!url.startsWith('https://') && !url.startsWith('http://') /* <- Note: [👣] */) {
|
|
1718
1667
|
return false;
|
|
1719
1668
|
}
|
|
1720
1669
|
if (url.includes('#')) {
|
|
1721
1670
|
// TODO: [🐠]
|
|
1722
1671
|
return false;
|
|
1723
1672
|
}
|
|
1673
|
+
/*
|
|
1674
|
+
Note: [👣][🧠] Is it secure to allow pipeline URLs on private and unsecured networks?
|
|
1724
1675
|
if (isUrlOnPrivateNetwork(url)) {
|
|
1725
1676
|
return false;
|
|
1726
1677
|
}
|
|
1678
|
+
*/
|
|
1727
1679
|
return true;
|
|
1728
1680
|
}
|
|
1729
1681
|
/**
|
|
@@ -3224,7 +3176,7 @@
|
|
|
3224
3176
|
collection = createCollectionFromJson.apply(void 0, __spreadArray([], __read(PipelineCollection), false));
|
|
3225
3177
|
_b = createPipelineExecutor;
|
|
3226
3178
|
_c = {};
|
|
3227
|
-
return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-persona.book
|
|
3179
|
+
return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-persona.book')];
|
|
3228
3180
|
case 1:
|
|
3229
3181
|
preparePersonaExecutor = _b.apply(void 0, [(_c.pipeline = _d.sent(),
|
|
3230
3182
|
_c.tools = tools,
|
|
@@ -4034,7 +3986,7 @@
|
|
|
4034
3986
|
collection = createCollectionFromJson.apply(void 0, __spreadArray([], __read(PipelineCollection), false));
|
|
4035
3987
|
_c = createPipelineExecutor;
|
|
4036
3988
|
_d = {};
|
|
4037
|
-
return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-title.book
|
|
3989
|
+
return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-title.book')];
|
|
4038
3990
|
case 1:
|
|
4039
3991
|
prepareTitleExecutor = _c.apply(void 0, [(_d.pipeline = _e.sent(),
|
|
4040
3992
|
_d.tools = tools,
|
|
@@ -6266,7 +6218,7 @@
|
|
|
6266
6218
|
collection = createCollectionFromJson.apply(void 0, __spreadArray([], __read(PipelineCollection), false));
|
|
6267
6219
|
_d = createPipelineExecutor;
|
|
6268
6220
|
_g = {};
|
|
6269
|
-
return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book
|
|
6221
|
+
return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book')];
|
|
6270
6222
|
case 1:
|
|
6271
6223
|
prepareKnowledgeFromMarkdownExecutor = _d.apply(void 0, [(_g.pipeline = _k.sent(),
|
|
6272
6224
|
_g.tools = {
|
|
@@ -6275,7 +6227,7 @@
|
|
|
6275
6227
|
_g)]);
|
|
6276
6228
|
_e = createPipelineExecutor;
|
|
6277
6229
|
_h = {};
|
|
6278
|
-
return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-knowledge-title.book
|
|
6230
|
+
return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-knowledge-title.book')];
|
|
6279
6231
|
case 2:
|
|
6280
6232
|
prepareTitleExecutor = _e.apply(void 0, [(_h.pipeline = _k.sent(),
|
|
6281
6233
|
_h.tools = {
|
|
@@ -6284,7 +6236,7 @@
|
|
|
6284
6236
|
_h)]);
|
|
6285
6237
|
_f = createPipelineExecutor;
|
|
6286
6238
|
_j = {};
|
|
6287
|
-
return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-knowledge-keywords.book
|
|
6239
|
+
return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-knowledge-keywords.book')];
|
|
6288
6240
|
case 3:
|
|
6289
6241
|
prepareKeywordsExecutor = _f.apply(void 0, [(_j.pipeline = _k.sent(),
|
|
6290
6242
|
_j.tools = {
|