@promptbook/core 0.67.0-3 â 0.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.es.js +6 -3
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/types.index.d.ts +2 -2
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Request.d.ts +1 -6
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Request.d.ts +16 -6
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions.d.ts +12 -3
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +2 -2
- package/esm/typings/src/llm-providers/remote/playground/playground.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +2 -4
- package/package.json +1 -1
- package/umd/index.umd.js +6 -3
- package/umd/index.umd.js.map +1 -1
|
@@ -157,7 +157,7 @@ import type { string_protocol } from '../types/typeAliases';
|
|
|
157
157
|
import type { string_email } from '../types/typeAliases';
|
|
158
158
|
import type { string_emails } from '../types/typeAliases';
|
|
159
159
|
import type { string_uuid } from '../types/typeAliases';
|
|
160
|
-
import type {
|
|
160
|
+
import type { string_user_id } from '../types/typeAliases';
|
|
161
161
|
import type { string_sha256 } from '../types/typeAliases';
|
|
162
162
|
import type { string_semantic_version } from '../types/typeAliases';
|
|
163
163
|
import type { string_version_dependency } from '../types/typeAliases';
|
|
@@ -383,7 +383,7 @@ export type { string_protocol };
|
|
|
383
383
|
export type { string_email };
|
|
384
384
|
export type { string_emails };
|
|
385
385
|
export type { string_uuid };
|
|
386
|
-
export type {
|
|
386
|
+
export type { string_user_id };
|
|
387
387
|
export type { string_sha256 };
|
|
388
388
|
export type { string_semantic_version };
|
|
389
389
|
export type { string_version_dependency };
|
package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Request.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { client_id } from '../../../types/typeAliases';
|
|
2
1
|
import type { LlmToolsConfiguration } from '../../_common/LlmToolsConfiguration';
|
|
3
2
|
/**
|
|
4
3
|
* Socket.io progress for remote text generation
|
|
@@ -11,10 +10,6 @@ export type PromptbookServer_ListModels_CollectionRequest = {
|
|
|
11
10
|
* Collection mode
|
|
12
11
|
*/
|
|
13
12
|
isAnonymous: false;
|
|
14
|
-
/**
|
|
15
|
-
* Client responsible for the requests
|
|
16
|
-
*/
|
|
17
|
-
readonly clientId: client_id;
|
|
18
13
|
};
|
|
19
14
|
export type PromptbookServer_ListModels_AnonymousRequest = {
|
|
20
15
|
/**
|
|
@@ -29,6 +24,6 @@ export type PromptbookServer_ListModels_AnonymousRequest = {
|
|
|
29
24
|
/**
|
|
30
25
|
* TODO: [ðĄ] DRY `PromptbookServer_Prompt_Request` and `PromptbookServer_ListModels_Request`
|
|
31
26
|
* TODO: [ð§ ][ð] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
|
|
32
|
-
* TODO: [ð§ ][ðĪš] Pass `
|
|
27
|
+
* TODO: [ð§ ][ðĪš] Pass `userId` in `PromptbookServer_ListModels_Request`
|
|
33
28
|
* TODO: [ð] Listing models (and checking configuration) probbably should go through REST API not Socket.io
|
|
34
29
|
*/
|
package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Request.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Prompt } from '../../../types/Prompt';
|
|
2
|
-
import type {
|
|
2
|
+
import type { string_user_id } from '../../../types/typeAliases';
|
|
3
3
|
import type { LlmToolsConfiguration } from '../../_common/LlmToolsConfiguration';
|
|
4
4
|
/**
|
|
5
5
|
* Socket.io progress for remote text generation
|
|
@@ -11,11 +11,14 @@ export type PromptbookServer_Prompt_CollectionRequest = {
|
|
|
11
11
|
/**
|
|
12
12
|
* Collection mode
|
|
13
13
|
*/
|
|
14
|
-
isAnonymous: false;
|
|
14
|
+
readonly isAnonymous: false;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Identifier of the end user
|
|
17
|
+
*
|
|
18
|
+
* Note: this is passed to the certain model providers to identify misuse
|
|
19
|
+
* Note: In anonymous mode it is not required to identify
|
|
17
20
|
*/
|
|
18
|
-
readonly
|
|
21
|
+
readonly userId: string_user_id;
|
|
19
22
|
/**
|
|
20
23
|
* The Prompt to execute
|
|
21
24
|
*/
|
|
@@ -25,7 +28,14 @@ export type PromptbookServer_Prompt_AnonymousRequest = {
|
|
|
25
28
|
/**
|
|
26
29
|
* Anonymous mode
|
|
27
30
|
*/
|
|
28
|
-
isAnonymous: true;
|
|
31
|
+
readonly isAnonymous: true;
|
|
32
|
+
/**
|
|
33
|
+
* Identifier of the end user
|
|
34
|
+
*
|
|
35
|
+
* Note: this is passed to the certain model providers to identify misuse
|
|
36
|
+
* Note: In anonymous mode it is not required to identify
|
|
37
|
+
*/
|
|
38
|
+
readonly userId?: string_user_id;
|
|
29
39
|
/**
|
|
30
40
|
* Configuration for the LLM tools
|
|
31
41
|
*/
|
|
@@ -38,4 +48,4 @@ export type PromptbookServer_Prompt_AnonymousRequest = {
|
|
|
38
48
|
/**
|
|
39
49
|
* TODO: [ðĄ] DRY `PromptbookServer_Prompt_Request` and `PromptbookServer_ListModels_Request`
|
|
40
50
|
* TODO: [ð§ ][ð] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
|
|
41
|
-
*/
|
|
51
|
+
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions';
|
|
2
|
-
import type { client_id } from '../../../types/typeAliases';
|
|
3
2
|
import type { string_base_url } from '../../../types/typeAliases';
|
|
4
3
|
import type { string_uri } from '../../../types/typeAliases';
|
|
4
|
+
import type { string_user_id } from '../../../types/typeAliases';
|
|
5
5
|
import type { LlmToolsConfiguration } from '../../_common/LlmToolsConfiguration';
|
|
6
6
|
/**
|
|
7
7
|
* Options for `RemoteLlmExecutionTools`
|
|
@@ -34,15 +34,24 @@ export type RemoteLlmExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
|
34
34
|
* Configuration for the LLM tools
|
|
35
35
|
*/
|
|
36
36
|
readonly llmToolsConfiguration: LlmToolsConfiguration;
|
|
37
|
+
/**
|
|
38
|
+
* Identifier of the end user
|
|
39
|
+
*
|
|
40
|
+
* Note: this is passed to the certain model providers to identify misuse
|
|
41
|
+
* Note: In anonymous mode it is not required to identify
|
|
42
|
+
*/
|
|
43
|
+
readonly userId?: string_user_id;
|
|
37
44
|
} | {
|
|
38
45
|
/**
|
|
39
46
|
* Use anonymous server with client identification and fixed collection
|
|
40
47
|
*/
|
|
41
48
|
isAnonymous: false;
|
|
42
49
|
/**
|
|
43
|
-
*
|
|
50
|
+
* Identifier of the end user
|
|
51
|
+
*
|
|
52
|
+
* Note: this is passed to the certain model providers to identify misuse
|
|
44
53
|
*/
|
|
45
|
-
readonly
|
|
54
|
+
readonly userId: string_user_id;
|
|
46
55
|
});
|
|
47
56
|
/**
|
|
48
57
|
* TODO: [ð§ ][ð] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { PipelineCollection } from '../../../collection/PipelineCollection';
|
|
2
2
|
import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions';
|
|
3
3
|
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
|
|
4
|
-
import type { client_id } from '../../../types/typeAliases';
|
|
5
4
|
import type { string_uri } from '../../../types/typeAliases';
|
|
5
|
+
import type { string_user_id } from '../../../types/typeAliases';
|
|
6
6
|
/**
|
|
7
7
|
* @@@
|
|
8
8
|
*
|
|
@@ -50,7 +50,7 @@ export type CollectionRemoteServerOptions = {
|
|
|
50
50
|
/**
|
|
51
51
|
* Creates llm execution tools for each client
|
|
52
52
|
*/
|
|
53
|
-
createLlmExecutionTools(
|
|
53
|
+
createLlmExecutionTools(userId: string_user_id | undefined): LlmExecutionTools;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
56
|
* TODO: Constrain anonymous mode for specific models / providers
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env ts-node
|
|
2
|
-
|
|
2
|
+
import '../../openai/register-constructor';
|
|
@@ -391,11 +391,9 @@ export type string_uuid = string & {
|
|
|
391
391
|
readonly _type: 'uuid';
|
|
392
392
|
};
|
|
393
393
|
/**
|
|
394
|
-
*
|
|
394
|
+
* End user identifier;
|
|
395
395
|
*/
|
|
396
|
-
export type
|
|
397
|
-
readonly _type: 'client_id';
|
|
398
|
-
};
|
|
396
|
+
export type string_user_id = string;
|
|
399
397
|
/**
|
|
400
398
|
* Semantic helper
|
|
401
399
|
*
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
/**
|
|
17
17
|
* The version of the Promptbook library
|
|
18
18
|
*/
|
|
19
|
-
var PROMPTBOOK_VERSION = '0.67.0-
|
|
19
|
+
var PROMPTBOOK_VERSION = '0.67.0-4';
|
|
20
20
|
// TODO: !!!! List here all the versions and annotate + put into script
|
|
21
21
|
|
|
22
22
|
/*! *****************************************************************************
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
commands.push("PIPELINE URL ".concat(pipelineUrl));
|
|
230
230
|
}
|
|
231
231
|
commands.push("PROMPTBOOK VERSION ".concat(promptbookVersion));
|
|
232
|
-
// TODO:
|
|
232
|
+
// TODO: !!! This increase size of the bundle and is probbably not necessary
|
|
233
233
|
pipelineString = prettifyMarkdown(pipelineString);
|
|
234
234
|
try {
|
|
235
235
|
for (var _g = __values(parameters.filter(function (_a) {
|
|
@@ -1786,7 +1786,7 @@
|
|
|
1786
1786
|
});
|
|
1787
1787
|
}
|
|
1788
1788
|
|
|
1789
|
-
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.67.0-
|
|
1789
|
+
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.67.0-4",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.67.0-4",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.67.0-4",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.67.0-4",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"}];
|
|
1790
1790
|
|
|
1791
1791
|
var defaultDiacriticsRemovalMap = [
|
|
1792
1792
|
{
|
|
@@ -6828,6 +6828,9 @@
|
|
|
6828
6828
|
});
|
|
6829
6829
|
return __assign(__assign({}, metadata), { isMetadataAviailable: isMetadataAviailable, isInstalled: isInstalled });
|
|
6830
6830
|
});
|
|
6831
|
+
if (metadata.length === 0) {
|
|
6832
|
+
return "No LLM providers are available.";
|
|
6833
|
+
}
|
|
6831
6834
|
return spaceTrim__default["default"](function (block) { return "\n Available LLM providers are:\n ".concat(block(metadata
|
|
6832
6835
|
.map(function (_a, i) {
|
|
6833
6836
|
var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
|