@promptbook/remote-server 0.81.0-22 → 0.81.0-23
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 +4 -20
- package/esm/index.es.js +6 -6
- package/esm/typings/src/_packages/core.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +2 -0
- package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/run.d.ts +2 -2
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +11 -0
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
- package/esm/typings/src/commands/index.d.ts +1 -1
- package/esm/typings/src/config.d.ts +2 -2
- package/esm/typings/src/conversion/parsePipeline.d.ts +1 -1
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +3 -3
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +7 -7
- package/esm/typings/src/errors/utils/getErrorReportUrl.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +2 -2
- package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +2 -2
- package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +1 -1
- package/esm/typings/src/llm-providers/vercel/playground/playground.d.ts +1 -1
- package/esm/typings/src/other/templates/getBookTemplates.d.ts +1 -1
- package/esm/typings/src/personas/preparePersona.d.ts +4 -4
- package/esm/typings/src/pipeline/PipelineString.d.ts +0 -3
- package/esm/typings/src/pipeline/book-notation.d.ts +0 -1
- package/esm/typings/src/pipeline/isValidPipelineString.d.ts +3 -1
- package/esm/typings/src/pipeline/validatePipelineString.d.ts +14 -0
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +1 -1
- package/esm/typings/src/prepare/prepareTasks.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +8 -2
- package/esm/typings/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
- package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +6 -6
package/README.md
CHANGED
|
@@ -132,32 +132,25 @@ We also have a community of developers and users of **Promptbook**:
|
|
|
132
132
|
- [Landing page `ptbk.io`](https://ptbk.io)
|
|
133
133
|
- [Github discussions](https://github.com/webgptorg/promptbook/discussions)
|
|
134
134
|
- [LinkedIn `Promptbook`](https://linkedin.com/company/promptbook)
|
|
135
|
-
- [Facebook `Promptbook`](https://www.facebook.com/61560776453536)
|
|
135
|
+
- [Facebook `Promptbook`](https://www.facebook.com/61560776453536)
|
|
136
136
|
|
|
137
137
|
And **Promptbook.studio** branded socials:
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
141
139
|
- [Instagram `@promptbook.studio`](https://www.instagram.com/promptbook.studio/)
|
|
142
140
|
|
|
143
|
-
|
|
144
|
-
|
|
145
141
|
And **Promptujeme** sub-brand:
|
|
146
142
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
_/Subbrand for Czech clients/_
|
|
150
144
|
|
|
151
145
|
- [Promptujeme.cz](https://www.promptujeme.cz/)
|
|
152
146
|
- [Facebook `Promptujeme`](https://www.facebook.com/promptujeme/)
|
|
153
147
|
|
|
154
|
-
|
|
155
148
|
And **Promptbook.city** branded socials:
|
|
156
149
|
|
|
157
|
-
|
|
150
|
+
_/Sub-brand for images and graphics generated via Promptbook prompting/_
|
|
158
151
|
|
|
159
152
|
- [Instagram `@promptbook.city`](https://www.instagram.com/promptbook.city/)
|
|
160
|
-
- [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
|
|
153
|
+
- [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
|
|
161
154
|
|
|
162
155
|
|
|
163
156
|
|
|
@@ -291,11 +284,6 @@ Or you can install them separately:
|
|
|
291
284
|
|
|
292
285
|
## 📚 Dictionary
|
|
293
286
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
287
|
### 📚 Dictionary
|
|
300
288
|
|
|
301
289
|
The following glossary is used to clarify certain concepts:
|
|
@@ -311,8 +299,6 @@ The following glossary is used to clarify certain concepts:
|
|
|
311
299
|
- **Retrieval-augmented generation** is a machine learning paradigm where a model generates text by retrieving relevant information from a large database of text. This approach combines the benefits of generative models and retrieval models.
|
|
312
300
|
- **Longtail** refers to non-common or rare events, items, or entities that are not well-represented in the training data of machine learning models. Longtail items are often challenging for models to predict accurately.
|
|
313
301
|
|
|
314
|
-
|
|
315
|
-
|
|
316
302
|
_Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
317
303
|
|
|
318
304
|
#### Promptbook core
|
|
@@ -373,8 +359,6 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
|
|
|
373
359
|
- [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
374
360
|
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
375
361
|
|
|
376
|
-
|
|
377
|
-
|
|
378
362
|
### Terms specific to Promptbook TypeScript implementation
|
|
379
363
|
|
|
380
364
|
- Anonymous mode
|
package/esm/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
17
17
|
* @generated
|
|
18
18
|
* @see https://github.com/webgptorg/promptbook
|
|
19
19
|
*/
|
|
20
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.81.0-
|
|
20
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.81.0-22';
|
|
21
21
|
/**
|
|
22
22
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
23
23
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -442,7 +442,7 @@ var PipelineUrlError = /** @class */ (function (_super) {
|
|
|
442
442
|
/**
|
|
443
443
|
* Make error report URL for the given error
|
|
444
444
|
*
|
|
445
|
-
* @private
|
|
445
|
+
* @private private within the repository
|
|
446
446
|
*/
|
|
447
447
|
function getErrorReportUrl(error) {
|
|
448
448
|
var report = {
|
|
@@ -1271,10 +1271,10 @@ function startRemoteServer(options) {
|
|
|
1271
1271
|
case 1:
|
|
1272
1272
|
_c.trys.push([1, 15, 16, 17]);
|
|
1273
1273
|
if (isAnonymous === true && !isAnonymousModeAllowed) {
|
|
1274
|
-
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main]
|
|
1274
|
+
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!3 Test
|
|
1275
1275
|
}
|
|
1276
1276
|
if (isAnonymous === false && !isApplicationModeAllowed) {
|
|
1277
|
-
throw new PipelineExecutionError("Application mode is not allowed"); // <- TODO: [main]
|
|
1277
|
+
throw new PipelineExecutionError("Application mode is not allowed"); // <- TODO: [main] !!3 Test
|
|
1278
1278
|
}
|
|
1279
1279
|
llmExecutionTools = void 0;
|
|
1280
1280
|
if (!(isAnonymous === true && llmToolsConfiguration !== null)) return [3 /*break*/, 2];
|
|
@@ -1371,10 +1371,10 @@ function startRemoteServer(options) {
|
|
|
1371
1371
|
case 1:
|
|
1372
1372
|
_b.trys.push([1, 6, 7, 8]);
|
|
1373
1373
|
if (isAnonymous === true && !isAnonymousModeAllowed) {
|
|
1374
|
-
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main]
|
|
1374
|
+
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!3 Test
|
|
1375
1375
|
}
|
|
1376
1376
|
if (isAnonymous === false && !isApplicationModeAllowed) {
|
|
1377
|
-
throw new PipelineExecutionError("Application mode is not allowed"); // <- TODO: [main]
|
|
1377
|
+
throw new PipelineExecutionError("Application mode is not allowed"); // <- TODO: [main] !!3 Test
|
|
1378
1378
|
}
|
|
1379
1379
|
llmExecutionTools = void 0;
|
|
1380
1380
|
if (!(isAnonymous === true)) return [3 /*break*/, 2];
|
|
@@ -100,6 +100,7 @@ import { getPipelineInterface } from '../pipeline/PipelineInterface/getPipelineI
|
|
|
100
100
|
import { isPipelineImplementingInterface } from '../pipeline/PipelineInterface/isPipelineImplementingInterface';
|
|
101
101
|
import { isPipelineInterfacesEqual } from '../pipeline/PipelineInterface/isPipelineInterfacesEqual';
|
|
102
102
|
import { EXPECTATION_UNITS } from '../pipeline/PipelineJson/Expectations';
|
|
103
|
+
import { validatePipelineString } from '../pipeline/validatePipelineString';
|
|
103
104
|
import { isPipelinePrepared } from '../prepare/isPipelinePrepared';
|
|
104
105
|
import { preparePipeline } from '../prepare/preparePipeline';
|
|
105
106
|
import { prepareTasks } from '../prepare/prepareTasks';
|
|
@@ -222,6 +223,7 @@ export { getPipelineInterface };
|
|
|
222
223
|
export { isPipelineImplementingInterface };
|
|
223
224
|
export { isPipelineInterfacesEqual };
|
|
224
225
|
export { EXPECTATION_UNITS };
|
|
226
|
+
export { validatePipelineString };
|
|
225
227
|
export { isPipelinePrepared };
|
|
226
228
|
export { preparePipeline };
|
|
227
229
|
export { prepareTasks };
|
|
@@ -172,6 +172,7 @@ import type { string_css_value } from '../types/typeAliases';
|
|
|
172
172
|
import type { string_css_selector } from '../types/typeAliases';
|
|
173
173
|
import type { string_url } from '../types/typeAliases';
|
|
174
174
|
import type { string_base_url } from '../types/typeAliases';
|
|
175
|
+
import type { string_pipeline_root_url } from '../types/typeAliases';
|
|
175
176
|
import type { string_pipeline_url } from '../types/typeAliases';
|
|
176
177
|
import type { string_pipeline_url_with_task_hash } from '../types/typeAliases';
|
|
177
178
|
import type { string_data_url } from '../types/typeAliases';
|
|
@@ -437,6 +438,7 @@ export type { string_css_value };
|
|
|
437
438
|
export type { string_css_selector };
|
|
438
439
|
export type { string_url };
|
|
439
440
|
export type { string_base_url };
|
|
441
|
+
export type { string_pipeline_root_url };
|
|
440
442
|
export type { string_pipeline_url };
|
|
441
443
|
export type { string_pipeline_url_with_task_hash };
|
|
442
444
|
export type { string_data_url };
|
|
@@ -6,7 +6,7 @@ import type { Command as Program } from 'commander';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function initializeMakeCommand(program: Program): void;
|
|
8
8
|
/**
|
|
9
|
-
* TODO: [🥃][main]
|
|
9
|
+
* TODO: [🥃][main] !!3 Allow `ptbk make` without configuring any llm tools
|
|
10
10
|
* TODO: [0] DRY Javascript and typescript - Maybe make ONLY typescript and for javascript just remove types
|
|
11
11
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12
12
|
* Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
|
|
@@ -6,9 +6,9 @@ import type { Command as Program } from 'commander';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function initializeRunCommand(program: Program): void;
|
|
8
8
|
/**
|
|
9
|
-
* TODO:
|
|
9
|
+
* TODO: !!5 Catch and wrap all errors from CLI
|
|
10
10
|
* TODO: [🧠] Pass `maxExecutionAttempts`, `csvSettings`
|
|
11
|
-
* TODO: [🥃][main]
|
|
11
|
+
* TODO: [🥃][main] !!3 Allow `ptbk run` without configuring any llm tools
|
|
12
12
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13
13
|
* Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
|
|
14
14
|
* TODO: [🖇] What about symlinks? Maybe flag --follow-symlinks
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
2
2
|
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
3
3
|
import type { string_dirname } from '../../types/typeAliases';
|
|
4
|
+
import type { string_pipeline_root_url } from '../../types/typeAliases';
|
|
4
5
|
import type { PipelineCollection } from '../PipelineCollection';
|
|
5
6
|
/**
|
|
6
7
|
* Options for `createCollectionFromDirectory` function
|
|
@@ -21,6 +22,16 @@ type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions
|
|
|
21
22
|
* @default false
|
|
22
23
|
*/
|
|
23
24
|
isVerbose?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* This will be used as a root URL for all pipelines in the collection
|
|
27
|
+
*
|
|
28
|
+
* It has 2 purposes:
|
|
29
|
+
* 1) Every pipeline in the collection is checked if it is a child of `rootUrl`
|
|
30
|
+
* 2) If the pipeline does not have a URL, it is created from the `rootUrl` and path to the pipeline
|
|
31
|
+
*
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
rootUrl?: string_pipeline_root_url;
|
|
24
35
|
/**
|
|
25
36
|
* If true, directory will be scanned only when needed not during the construction
|
|
26
37
|
*
|
|
@@ -25,5 +25,5 @@ type CreatePipelineCollectionFromUrlyOptions = {
|
|
|
25
25
|
export declare function createCollectionFromUrl(url: string_url | URL, options: CreatePipelineCollectionFromUrlyOptions): Promise<PipelineCollection>;
|
|
26
26
|
export {};
|
|
27
27
|
/**
|
|
28
|
-
* TODO: [main]
|
|
28
|
+
* TODO: [main] !!4 [🧠] Library precompilation and do not mix markdown and json promptbooks
|
|
29
29
|
*/
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
export declare const COMMANDS: readonly [import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./SECTION/SectionCommand").SectionCommand>, import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./FORMAT/FormatCommand").FormatCommand>, import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./BOOK_VERSION/BookVersionCommand").BookVersionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./FORMFACTOR/FormfactorCommand").FormfactorCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./FOREACH/ForeachCommand").ForeachCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];
|
|
7
7
|
/**
|
|
8
8
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9
|
-
*/
|
|
9
|
+
*/
|
|
@@ -141,14 +141,14 @@ export declare const DEFAULT_MAX_PARALLEL_COUNT = 5;
|
|
|
141
141
|
export declare const DEFAULT_MAX_EXECUTION_ATTEMPTS = 3;
|
|
142
142
|
/**
|
|
143
143
|
* @@@
|
|
144
|
-
* TODO: [🐝][main]
|
|
144
|
+
* TODO: [🐝][main] !!3 Use
|
|
145
145
|
*
|
|
146
146
|
* @public exported from `@promptbook/core`
|
|
147
147
|
*/
|
|
148
148
|
export declare const DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH = 3;
|
|
149
149
|
/**
|
|
150
150
|
* @@@
|
|
151
|
-
* TODO: [🐝][main]
|
|
151
|
+
* TODO: [🐝][main] !!3 Use
|
|
152
152
|
*
|
|
153
153
|
* @public exported from `@promptbook/core`
|
|
154
154
|
*/
|
|
@@ -19,7 +19,7 @@ import type { PipelineString } from '../pipeline/PipelineString';
|
|
|
19
19
|
export declare function parsePipeline(pipelineString: PipelineString): PipelineJson;
|
|
20
20
|
/**
|
|
21
21
|
* TODO: [🧠] Maybe more things here can be refactored as high-level abstractions
|
|
22
|
-
* TODO: [main]
|
|
22
|
+
* TODO: [main] !!4 Warn if used only sync version
|
|
23
23
|
* TODO: [🚞] Report here line/column of error
|
|
24
24
|
* TODO: Use spaceTrim more effectively
|
|
25
25
|
* TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
|
|
@@ -22,9 +22,9 @@ export type renderPipelineMermaidOptions = {
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function renderPromptbookMermaid(pipelineJson: PipelineJson, options?: renderPipelineMermaidOptions): string;
|
|
24
24
|
/**
|
|
25
|
-
* TODO: [🧠]
|
|
26
|
-
* TODO: [🧠]
|
|
27
|
-
* TODO: [🧠]
|
|
25
|
+
* TODO: [🧠] FOREACH in mermaid graph
|
|
26
|
+
* TODO: [🧠] Knowledge in mermaid graph
|
|
27
|
+
* TODO: [🧠] Personas in mermaid graph
|
|
28
28
|
* TODO: Maybe use some Mermaid package instead of string templating
|
|
29
29
|
* TODO: [🕌] When more than 2 functionalities, split into separate functions
|
|
30
30
|
*/
|
|
@@ -18,9 +18,9 @@ export declare function validatePipeline(pipeline: PipelineJson): PipelineJson;
|
|
|
18
18
|
/**
|
|
19
19
|
* @private internal function for `validatePipeline`
|
|
20
20
|
*/
|
|
21
|
-
export declare function
|
|
21
|
+
export declare function validatePipeline_InnerFunction(pipeline: PipelineJson): void;
|
|
22
22
|
/**
|
|
23
|
-
* TODO:
|
|
23
|
+
* TODO: [🧞♀️] Do not allow joker + foreach
|
|
24
24
|
* TODO: [🧠] Work with promptbookVersion
|
|
25
25
|
* TODO: Use here some json-schema, Zod or something similar and change it to:
|
|
26
26
|
* > /**
|
|
@@ -32,11 +32,11 @@ export declare function validatePipelineCore(pipeline: PipelineJson): void;
|
|
|
32
32
|
* > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
|
|
33
33
|
*/
|
|
34
34
|
/**
|
|
35
|
-
* TODO: [🧳][main]
|
|
36
|
-
* TODO: [🧳][🐝][main]
|
|
37
|
-
* TODO: [🧳][main]
|
|
38
|
-
* TODO: [🧳][main]
|
|
39
|
-
* TODO: [🧳][main]
|
|
35
|
+
* TODO: [🧳][main] !!4 Validate that all examples match expectations
|
|
36
|
+
* TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
|
|
37
|
+
* TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
|
|
38
|
+
* TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
|
|
39
|
+
* TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
|
|
40
40
|
* TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
|
|
41
41
|
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
42
42
|
*/
|
|
@@ -16,7 +16,7 @@ export declare const ANTHROPIC_CLAUDE_MODELS: ReadonlyArray<AvailableModel & {
|
|
|
16
16
|
}>;
|
|
17
17
|
/**
|
|
18
18
|
* Note: [🤖] Add models of new variant
|
|
19
|
-
* TODO: [🧠][main]
|
|
19
|
+
* TODO: [🧠][main] !!3 Add embedding models OR Anthropic has only chat+completion models?
|
|
20
20
|
* TODO: [🧠] Some mechanism to propagate unsureness
|
|
21
21
|
* TODO: [🧠][👮♀️] Put here more info like description, isVision, trainingDateCutoff, languages, strengths ( Top-level performance, intelligence, fluency, and understanding), contextWindow,...
|
|
22
22
|
* TODO: [🎰] Some mechanism to auto-update available models
|
package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export declare const createAnthropicClaudeExecutionTools: ((options: AnthropicCl
|
|
|
11
11
|
className: string;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* TODO: [🧠][main]
|
|
15
|
-
* TODO: [🧠][🧱][main]
|
|
14
|
+
* TODO: [🧠][main] !!4 Make anonymous this with all LLM providers
|
|
15
|
+
* TODO: [🧠][🧱][main] !!4 Maybe change all `new AnthropicClaudeExecutionTools` -> `createAnthropicClaudeExecutionTools` in manual
|
|
16
16
|
* TODO: [🧠] Maybe auto-detect usage in browser and determine default value of `isProxied`
|
|
17
17
|
* TODO: [🦺] Is there some way how to put `packageName` and `className` on top and function definition on bottom?
|
|
18
18
|
* TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ts-node
|
|
2
2
|
export {};
|
|
3
3
|
/**
|
|
4
|
-
* TODO: [main]
|
|
5
|
-
* TODO: [main]
|
|
4
|
+
* TODO: [main] !!3 Playground with WebGPT / Promptbook.studio anonymous server
|
|
5
|
+
* TODO: [main] !!3 Test here that `systemMessage`, `temperature` and `seed` are working correctly
|
|
6
6
|
* Note: [⚫] Code in this file should never be published in any package
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env ts-node
|
|
2
2
|
export {};
|
|
3
3
|
/**
|
|
4
|
-
* TODO: [main]
|
|
4
|
+
* TODO: [main] !!3 Test here that `systemMessage`, `temperature` and `seed` are working correctly
|
|
5
5
|
* Note: [⚫] Code in this file should never be published in any package
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env ts-node
|
|
2
2
|
export {};
|
|
3
3
|
/**
|
|
4
|
-
* TODO: [main]
|
|
4
|
+
* TODO: [main] !!3 Test here that `systemMessage`, `temperature` and `seed` are working correctly
|
|
5
5
|
* Note: [⚫] Code in this file should never be published in any package
|
|
6
6
|
*/
|
|
@@ -18,5 +18,5 @@ export declare function getBookTemplates(formfactorName?: string_formfactor_name
|
|
|
18
18
|
/**
|
|
19
19
|
* TODO: Unit test
|
|
20
20
|
* TODO: [🧠] Which is the best place for this function
|
|
21
|
-
* TODO:
|
|
21
|
+
* TODO: !!6 For GENERIC template ensure at least one pipeline is present for typescript in `getBookTemplates`
|
|
22
22
|
*/
|
|
@@ -10,8 +10,8 @@ import type { string_persona_description } from '../types/typeAliases';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function preparePersona(personaDescription: string_persona_description, tools: Pick<ExecutionTools, 'llm'>, options: PrepareAndScrapeOptions): Promise<PersonaPreparedJson['modelRequirements']>;
|
|
12
12
|
/**
|
|
13
|
-
* TODO: [🔃][main]
|
|
14
|
-
* TODO: [🏢]
|
|
15
|
-
* TODO: [🏢]
|
|
16
|
-
* TODO: [🏢]
|
|
13
|
+
* TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
|
|
14
|
+
* TODO: [🏢] Check validity of `modelName` in pipeline
|
|
15
|
+
* TODO: [🏢] Check validity of `systemMessage` in pipeline
|
|
16
|
+
* TODO: [🏢] Check validity of `temperature` in pipeline
|
|
17
17
|
*/
|
|
@@ -9,7 +9,6 @@ import type { PipelineString } from './PipelineString';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function book(strings: TemplateStringsArray, ...values: Array<string>): PipelineString;
|
|
11
11
|
/**
|
|
12
|
-
* TODO: Use ACRY book\`...\ notation instead of as PipelineString
|
|
13
12
|
* TODO: [🧠][🈴] Where is the best location for this file
|
|
14
13
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15
14
|
*/
|
|
@@ -3,9 +3,11 @@ import type { PipelineString } from './PipelineString';
|
|
|
3
3
|
* Function `isValidPipelineString` will validate the if the string is a valid pipeline string
|
|
4
4
|
* It does not check if the string is fully logically correct, but if it is a string that can be a pipeline string or the string looks completely different.
|
|
5
5
|
*
|
|
6
|
+
* @param {string} pipelineString the candidate for a pipeline string
|
|
7
|
+
* @returns {boolean} if the string is a valid pipeline string
|
|
6
8
|
* @public exported from `@promptbook/core`
|
|
7
9
|
*/
|
|
8
|
-
export declare function isValidPipelineString(
|
|
10
|
+
export declare function isValidPipelineString(pipelineString: string): pipelineString is PipelineString;
|
|
9
11
|
/**
|
|
10
12
|
* TODO: [🧠][🈴] Where is the best location for this file
|
|
11
13
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PipelineString } from './PipelineString';
|
|
2
|
+
/**
|
|
3
|
+
* Function `validatePipelineString` will validate the if the string is a valid pipeline string
|
|
4
|
+
* It does not check if the string is fully logically correct, but if it is a string that can be a pipeline string or the string looks completely different.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} pipelineString the candidate for a pipeline string
|
|
7
|
+
* @returns {PipelineString} the same string as input, but validated as valid
|
|
8
|
+
* @throws {ParseError} if the string is not a valid pipeline string
|
|
9
|
+
* @public exported from `@promptbook/core`
|
|
10
|
+
*/
|
|
11
|
+
export declare function validatePipelineString(pipelineString: string): PipelineString;
|
|
12
|
+
/**
|
|
13
|
+
* TODO: [🧠][🈴] Where is the best location for this file
|
|
14
|
+
*/
|
|
@@ -8,7 +8,7 @@ import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function isPipelinePrepared(pipeline: PipelineJson): boolean;
|
|
10
10
|
/**
|
|
11
|
-
* TODO: [🔃][main]
|
|
11
|
+
* TODO: [🔃][main] If the pipeline was prepared with different version or different set of models, prepare it once again
|
|
12
12
|
* TODO: [🐠] Maybe base this on `makeValidator`
|
|
13
13
|
* TODO: [🧊] Pipeline can be partially prepared, this should return true ONLY if fully prepared
|
|
14
14
|
* TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
|
|
@@ -25,7 +25,7 @@ export {};
|
|
|
25
25
|
* TODO: [😂] Adding knowledge should be convert to async high-level abstractions, simmilar thing with expectations to sync high-level abstractions
|
|
26
26
|
* TODO: [🧠] Add context to each task (if missing)
|
|
27
27
|
* TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
|
|
28
|
-
* TODO: [♨][main]
|
|
28
|
+
* TODO: [♨][main] !!3 Prepare index the examples and maybe tasks
|
|
29
29
|
* TODO: Write tests for `preparePipeline`
|
|
30
30
|
* TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
31
31
|
* TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export {};
|
|
2
2
|
/**
|
|
3
|
-
* TODO:
|
|
3
|
+
* TODO: Make shared test between JavascriptEvalExecutionTools and JavascriptExecutionTools to test the same functionality when implemented via vm2
|
|
4
4
|
*/
|
|
@@ -10,5 +10,5 @@ import type { really_any } from '../../../utils/organization/really_any';
|
|
|
10
10
|
export declare function preserve(func: (...params: ReadonlyArray<really_any>) => unknown): void;
|
|
11
11
|
/**
|
|
12
12
|
* TODO: Probbably remove in favour of `keepImported`
|
|
13
|
-
* TODO:
|
|
13
|
+
* TODO: [1] This maybe does memory leak
|
|
14
14
|
*/
|
|
@@ -319,6 +319,12 @@ export type string_url = string;
|
|
|
319
319
|
* For example `"https://collboard.com"`
|
|
320
320
|
*/
|
|
321
321
|
export type string_base_url = string;
|
|
322
|
+
/**
|
|
323
|
+
* Semantic helper
|
|
324
|
+
*
|
|
325
|
+
* For example `"https://promptbook.studio/webgpt/"`
|
|
326
|
+
*/
|
|
327
|
+
export type string_pipeline_root_url = string;
|
|
322
328
|
/**
|
|
323
329
|
* Semantic helper
|
|
324
330
|
*
|
|
@@ -623,8 +629,8 @@ export type number_megabytes = number_positive;
|
|
|
623
629
|
export type number_gigabytes = number_positive;
|
|
624
630
|
export type number_terabytes = number_positive;
|
|
625
631
|
/**.
|
|
626
|
-
* TODO: [main]
|
|
627
|
-
* TODO:
|
|
632
|
+
* TODO: [main] !!3 Change "For example" to @example
|
|
633
|
+
* TODO: Change to branded types
|
|
628
634
|
* TODO: Delete type aliases that are not exported or used internally
|
|
629
635
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
630
636
|
*/
|
|
@@ -40,6 +40,6 @@ export type CheckSerializableAsJsonOptions = {
|
|
|
40
40
|
export declare function checkSerializableAsJson(options: CheckSerializableAsJsonOptions): void;
|
|
41
41
|
/**
|
|
42
42
|
* TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
|
|
43
|
-
* TODO: [🧠][main]
|
|
43
|
+
* TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
|
|
44
44
|
* Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
45
45
|
*/
|
|
@@ -20,6 +20,6 @@ import type { JsonValue } from 'type-fest';
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function isSerializableAsJson(value: unknown): value is JsonValue;
|
|
22
22
|
/**
|
|
23
|
-
* TODO: [🧠][main]
|
|
23
|
+
* TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
|
|
24
24
|
* TODO: [🧠][💺] Can be done this on type-level?
|
|
25
25
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-server",
|
|
3
|
-
"version": "0.81.0-
|
|
3
|
+
"version": "0.81.0-23",
|
|
4
4
|
"description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
|
|
5
5
|
"--note-0": " <- [🐊]",
|
|
6
6
|
"private": false,
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"module": "./esm/index.es.js",
|
|
55
55
|
"typings": "./esm/typings/src/_packages/remote-server.index.d.ts",
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@promptbook/core": "0.81.0-
|
|
57
|
+
"@promptbook/core": "0.81.0-23"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* @generated
|
|
25
25
|
* @see https://github.com/webgptorg/promptbook
|
|
26
26
|
*/
|
|
27
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.81.0-
|
|
27
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.81.0-22';
|
|
28
28
|
/**
|
|
29
29
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
30
30
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -449,7 +449,7 @@
|
|
|
449
449
|
/**
|
|
450
450
|
* Make error report URL for the given error
|
|
451
451
|
*
|
|
452
|
-
* @private
|
|
452
|
+
* @private private within the repository
|
|
453
453
|
*/
|
|
454
454
|
function getErrorReportUrl(error) {
|
|
455
455
|
var report = {
|
|
@@ -1278,10 +1278,10 @@
|
|
|
1278
1278
|
case 1:
|
|
1279
1279
|
_c.trys.push([1, 15, 16, 17]);
|
|
1280
1280
|
if (isAnonymous === true && !isAnonymousModeAllowed) {
|
|
1281
|
-
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main]
|
|
1281
|
+
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!3 Test
|
|
1282
1282
|
}
|
|
1283
1283
|
if (isAnonymous === false && !isApplicationModeAllowed) {
|
|
1284
|
-
throw new PipelineExecutionError("Application mode is not allowed"); // <- TODO: [main]
|
|
1284
|
+
throw new PipelineExecutionError("Application mode is not allowed"); // <- TODO: [main] !!3 Test
|
|
1285
1285
|
}
|
|
1286
1286
|
llmExecutionTools = void 0;
|
|
1287
1287
|
if (!(isAnonymous === true && llmToolsConfiguration !== null)) return [3 /*break*/, 2];
|
|
@@ -1378,10 +1378,10 @@
|
|
|
1378
1378
|
case 1:
|
|
1379
1379
|
_b.trys.push([1, 6, 7, 8]);
|
|
1380
1380
|
if (isAnonymous === true && !isAnonymousModeAllowed) {
|
|
1381
|
-
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main]
|
|
1381
|
+
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!3 Test
|
|
1382
1382
|
}
|
|
1383
1383
|
if (isAnonymous === false && !isApplicationModeAllowed) {
|
|
1384
|
-
throw new PipelineExecutionError("Application mode is not allowed"); // <- TODO: [main]
|
|
1384
|
+
throw new PipelineExecutionError("Application mode is not allowed"); // <- TODO: [main] !!3 Test
|
|
1385
1385
|
}
|
|
1386
1386
|
llmExecutionTools = void 0;
|
|
1387
1387
|
if (!(isAnonymous === true)) return [3 /*break*/, 2];
|