@promptbook/core 0.66.0-4 → 0.66.0-6
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 +59 -17
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/cli.index.d.ts +4 -0
- package/esm/typings/src/_packages/core.index.d.ts +6 -6
- package/esm/typings/src/_packages/types.index.d.ts +4 -0
- package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
- package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -1
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +1 -1
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/{$llmToolsConfigurationBoilerplatesRegister.d.ts → $llmToolsMetadataRegister.d.ts} +2 -4
- package/esm/typings/src/llm-providers/_common/LlmToolsConfiguration.d.ts +5 -3
- package/esm/typings/src/llm-providers/_common/LlmToolsMetadata.d.ts +27 -0
- package/esm/typings/src/llm-providers/_common/LlmToolsOptions.d.ts +7 -0
- package/esm/typings/src/llm-providers/_common/config.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +2 -1
- package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -1
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +1 -1
- package/esm/typings/src/personas/preparePersona.test.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +61 -19
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -14,7 +14,7 @@ import moment from 'moment';
|
|
|
14
14
|
/**
|
|
15
15
|
* The version of the Promptbook library
|
|
16
16
|
*/
|
|
17
|
-
var PROMPTBOOK_VERSION = '0.66.0-
|
|
17
|
+
var PROMPTBOOK_VERSION = '0.66.0-5';
|
|
18
18
|
// TODO: !!!! List here all the versions and annotate + put into script
|
|
19
19
|
|
|
20
20
|
/*! *****************************************************************************
|
|
@@ -1645,7 +1645,7 @@ function forEachAsync(array, options, callbackfunction) {
|
|
|
1645
1645
|
});
|
|
1646
1646
|
}
|
|
1647
1647
|
|
|
1648
|
-
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.66.0-
|
|
1648
|
+
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.66.0-5",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},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}",dependentParameterNames:["knowledgeContent"],resultingParameterName:"knowledgePieces"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",promptbookVersion:"0.66.0-5",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},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}",dependentParameterNames:["knowledgePieceContent"],resultingParameterName:"keywords"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",promptbookVersion:"0.66.0-5",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},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\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"],resultingParameterName:"title"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",promptbookVersion:"0.66.0-5",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}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",modelRequirements:{modelVariant:"CHAT",modelName:"gpt-4-turbo"},content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Sample\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### Option `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Option `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### Option `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}",expectFormat:"JSON",dependentParameterNames:["availableModelNames","personaDescription"],resultingParameterName:"modelRequirements"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
|
|
1649
1649
|
|
|
1650
1650
|
var defaultDiacriticsRemovalMap = [
|
|
1651
1651
|
{
|
|
@@ -6525,7 +6525,7 @@ var Register = /** @class */ (function () {
|
|
|
6525
6525
|
* @singleton Only one instance of each register is created per build, but thare can be more @@@
|
|
6526
6526
|
* @public exported from `@promptbook/core`
|
|
6527
6527
|
*/
|
|
6528
|
-
var $
|
|
6528
|
+
var $llmToolsMetadataRegister = new Register([
|
|
6529
6529
|
// TODO: !!!!!! Take from global scope
|
|
6530
6530
|
]);
|
|
6531
6531
|
|
|
@@ -8078,7 +8078,7 @@ var createOpenAiExecutionTools = Object.assign(function (options) {
|
|
|
8078
8078
|
/**
|
|
8079
8079
|
* @@@
|
|
8080
8080
|
*
|
|
8081
|
-
* TODO: !!!!!!
|
|
8081
|
+
* TODO: !!!!!! Remove EXECUTION_TOOLS_CLASSES and use $llmToolsRegister instead
|
|
8082
8082
|
*
|
|
8083
8083
|
* @private internal type for `createLlmToolsFromConfiguration`
|
|
8084
8084
|
*/
|
|
@@ -8361,16 +8361,37 @@ function limitTotalUsage(llmTools, options) {
|
|
|
8361
8361
|
* Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
|
|
8362
8362
|
*
|
|
8363
8363
|
* @public exported from `@promptbook/core`
|
|
8364
|
+
* @public exported from `@promptbook/cli`
|
|
8364
8365
|
*/
|
|
8365
|
-
var
|
|
8366
|
+
var _AnthropicClaudeMetadataRegistration = $llmToolsMetadataRegister.register({
|
|
8366
8367
|
title: 'Anthropic Claude',
|
|
8367
8368
|
packageName: '@promptbook/anthropic-claude',
|
|
8368
8369
|
className: 'AnthropicClaudeExecutionTools',
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8370
|
+
getBoilerplateConfiguration: function () {
|
|
8371
|
+
return {
|
|
8372
|
+
title: 'Anthropic Claude (boilerplate)',
|
|
8373
|
+
packageName: '@promptbook/anthropic-claude',
|
|
8374
|
+
className: 'AnthropicClaudeExecutionTools',
|
|
8375
|
+
options: {
|
|
8376
|
+
apiKey: 'sk-ant-api03-',
|
|
8377
|
+
isProxied: true,
|
|
8378
|
+
remoteUrl: DEFAULT_REMOTE_URL,
|
|
8379
|
+
path: DEFAULT_REMOTE_URL_PATH,
|
|
8380
|
+
},
|
|
8381
|
+
};
|
|
8382
|
+
},
|
|
8383
|
+
createConfigurationFromEnv: function (env) {
|
|
8384
|
+
if (typeof env.ANTHROPIC_CLAUDE_API_KEY === 'string') {
|
|
8385
|
+
return {
|
|
8386
|
+
title: 'Claude (from env)',
|
|
8387
|
+
packageName: '@promptbook/antrhopic-claude',
|
|
8388
|
+
className: 'AnthropicClaudeExecutionTools',
|
|
8389
|
+
options: {
|
|
8390
|
+
apiKey: process.env.ANTHROPIC_CLAUDE_API_KEY,
|
|
8391
|
+
},
|
|
8392
|
+
};
|
|
8393
|
+
}
|
|
8394
|
+
return null;
|
|
8374
8395
|
},
|
|
8375
8396
|
});
|
|
8376
8397
|
|
|
@@ -8380,13 +8401,34 @@ var _AnthropicClaudeConfigurationRegistration = $llmToolsConfigurationBoilerplat
|
|
|
8380
8401
|
* Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
|
|
8381
8402
|
*
|
|
8382
8403
|
* @public exported from `@promptbook/core`
|
|
8404
|
+
* @public exported from `@promptbook/cli`
|
|
8383
8405
|
*/
|
|
8384
|
-
var
|
|
8385
|
-
title: '
|
|
8386
|
-
packageName: '@promptbook/
|
|
8387
|
-
className: '
|
|
8388
|
-
|
|
8389
|
-
|
|
8406
|
+
var _OpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
|
|
8407
|
+
title: 'Anthropic Claude',
|
|
8408
|
+
packageName: '@promptbook/anthropic-claude',
|
|
8409
|
+
className: 'AnthropicClaudeExecutionTools',
|
|
8410
|
+
getBoilerplateConfiguration: function () {
|
|
8411
|
+
return {
|
|
8412
|
+
title: 'Open AI (boilerplate)',
|
|
8413
|
+
packageName: '@promptbook/openai',
|
|
8414
|
+
className: 'OpenAiExecutionTools',
|
|
8415
|
+
options: {
|
|
8416
|
+
apiKey: 'sk-',
|
|
8417
|
+
},
|
|
8418
|
+
};
|
|
8419
|
+
},
|
|
8420
|
+
createConfigurationFromEnv: function (env) {
|
|
8421
|
+
if (typeof env.OPENAI_API_KEY === 'string') {
|
|
8422
|
+
return {
|
|
8423
|
+
title: 'Open AI (from env)',
|
|
8424
|
+
packageName: '@promptbook/openai',
|
|
8425
|
+
className: 'OpenAiExecutionTools',
|
|
8426
|
+
options: {
|
|
8427
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
8428
|
+
},
|
|
8429
|
+
};
|
|
8430
|
+
}
|
|
8431
|
+
return null;
|
|
8390
8432
|
},
|
|
8391
8433
|
});
|
|
8392
8434
|
|
|
@@ -8740,5 +8782,5 @@ function executionReportJsonToString(executionReportJson, options) {
|
|
|
8740
8782
|
* TODO: [🧠] Should be in generated file GENERATOR_WARNING
|
|
8741
8783
|
*/
|
|
8742
8784
|
|
|
8743
|
-
export { $
|
|
8785
|
+
export { $llmToolsMetadataRegister, $llmToolsRegister, BlockTypes, CLAIM, CallbackInterfaceTools, CollectionError, DEFAULT_REMOTE_URL, DEFAULT_REMOTE_URL_PATH, EXECUTIONS_CACHE_DIRNAME, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, LimitReachedError, MAX_EXECUTION_ATTEMPTS, MAX_FILENAME_LENGTH, MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, MAX_PARALLEL_COUNT, MODEL_VARIANTS, MemoryStorage, NotFoundError, NotYetImplementedError, PIPELINE_COLLECTION_BASE_FILENAME, PROMPTBOOK_VERSION, ParsingError, PipelineExecutionError, PipelineLogicError, PrefixStorage, RESERVED_PARAMETER_NAMES, ReferenceError$1 as ReferenceError, UnexpectedError, VersionMismatchError, ZERO_USAGE, _AnthropicClaudeMetadataRegistration, _OpenAiMetadataRegistration, addUsage, assertsExecutionSuccessful, cacheLlmTools, collectionToJson, countTotalUsage, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createLlmToolsFromConfiguration, createPipelineExecutor, createSubcollection, embeddingVectorToString, executionReportJsonToString, isPassingExpectations, isPipelinePrepared, joinLlmExecutionTools, limitTotalUsage, pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, prepareKnowledgeFromMarkdown, prepareKnowledgePieces, preparePersona, preparePipeline, prepareTemplates, prettifyPipelineString, stringifyPipelineJson, unpreparePipeline, usageToHuman, usageToWorktime, validatePipeline };
|
|
8744
8786
|
//# sourceMappingURL=index.es.js.map
|