@promptbook/wizard 0.104.0-3 → 0.104.0-4
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 +32 -2
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +6 -2
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +32 -2
- package/umd/index.umd.js.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ChatParticipant } from '../../book-components/Chat/types/ChatParticipant';
|
|
2
2
|
import type { AvailableModel } from '../../execution/AvailableModel';
|
|
3
3
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
4
|
-
import type { ChatPromptResult, CompletionPromptResult, EmbeddingPromptResult, PromptResult } from '../../execution/PromptResult';
|
|
5
|
-
import type { ChatPrompt, CompletionPrompt, EmbeddingPrompt, Prompt } from '../../types/Prompt';
|
|
4
|
+
import type { ChatPromptResult, CompletionPromptResult, EmbeddingPromptResult, ImagePromptResult, PromptResult } from '../../execution/PromptResult';
|
|
5
|
+
import type { ChatPrompt, CompletionPrompt, EmbeddingPrompt, ImagePrompt, Prompt } from '../../types/Prompt';
|
|
6
6
|
import type { string_markdown, string_markdown_text, string_title } from '../../types/typeAliases';
|
|
7
7
|
/**
|
|
8
8
|
* Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
|
|
@@ -43,6 +43,10 @@ export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
|
|
|
43
43
|
* Calls the best available embedding model
|
|
44
44
|
*/
|
|
45
45
|
callEmbeddingModel(prompt: EmbeddingPrompt): Promise<EmbeddingPromptResult>;
|
|
46
|
+
/**
|
|
47
|
+
* Calls the best available embedding model
|
|
48
|
+
*/
|
|
49
|
+
callImageGenerationModel(prompt: ImagePrompt): Promise<ImagePromptResult>;
|
|
46
50
|
/**
|
|
47
51
|
* Calls the best available model
|
|
48
52
|
*
|
|
@@ -46,6 +46,7 @@ export declare class RemoteLlmExecutionTools<TCustomOptions = undefined> impleme
|
|
|
46
46
|
private callCommonModel;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
+
* TODO: !!!! Deprecate pipeline server and all of its components
|
|
49
50
|
* TODO: Maybe use `$exportJson`
|
|
50
51
|
* TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
|
|
51
52
|
* TODO: [🍓] Allow to list compatible models with each variant
|
|
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
15
15
|
export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
|
|
16
16
|
/**
|
|
17
17
|
* Represents the version string of the Promptbook engine.
|
|
18
|
-
* It follows semantic versioning (e.g., `0.104.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.104.0-3`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/wizard",
|
|
3
|
-
"version": "0.104.0-
|
|
3
|
+
"version": "0.104.0-4",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"module": "./esm/index.es.js",
|
|
96
96
|
"typings": "./esm/typings/src/_packages/wizard.index.d.ts",
|
|
97
97
|
"peerDependencies": {
|
|
98
|
-
"@promptbook/core": "0.104.0-
|
|
98
|
+
"@promptbook/core": "0.104.0-4"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
101
|
"@ai-sdk/deepseek": "0.1.17",
|
package/umd/index.umd.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* @generated
|
|
49
49
|
* @see https://github.com/webgptorg/promptbook
|
|
50
50
|
*/
|
|
51
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-
|
|
51
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-4';
|
|
52
52
|
/**
|
|
53
53
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
54
54
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2538,6 +2538,7 @@
|
|
|
2538
2538
|
}
|
|
2539
2539
|
}
|
|
2540
2540
|
/**
|
|
2541
|
+
* TODO: !!!! Deprecate pipeline server and all of its components
|
|
2541
2542
|
* TODO: Maybe use `$exportJson`
|
|
2542
2543
|
* TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
|
|
2543
2544
|
* TODO: [🍓] Allow to list compatible models with each variant
|
|
@@ -9429,6 +9430,15 @@
|
|
|
9429
9430
|
return promptResult;
|
|
9430
9431
|
};
|
|
9431
9432
|
}
|
|
9433
|
+
if (llmTools.callImageGenerationModel !== undefined) {
|
|
9434
|
+
proxyTools.callImageGenerationModel = async (prompt) => {
|
|
9435
|
+
// console.info('[🚕] callImageGenerationModel through countTotalUsage');
|
|
9436
|
+
const promptResult = await llmTools.callImageGenerationModel(prompt);
|
|
9437
|
+
totalUsage = addUsage(totalUsage, promptResult.usage);
|
|
9438
|
+
spending.next(promptResult.usage);
|
|
9439
|
+
return promptResult;
|
|
9440
|
+
};
|
|
9441
|
+
}
|
|
9432
9442
|
// <- Note: [🤖]
|
|
9433
9443
|
return proxyTools;
|
|
9434
9444
|
}
|
|
@@ -9538,6 +9548,12 @@
|
|
|
9538
9548
|
callEmbeddingModel(prompt) {
|
|
9539
9549
|
return this.callCommonModel(prompt);
|
|
9540
9550
|
}
|
|
9551
|
+
/**
|
|
9552
|
+
* Calls the best available embedding model
|
|
9553
|
+
*/
|
|
9554
|
+
callImageGenerationModel(prompt) {
|
|
9555
|
+
return this.callCommonModel(prompt);
|
|
9556
|
+
}
|
|
9541
9557
|
// <- Note: [🤖]
|
|
9542
9558
|
/**
|
|
9543
9559
|
* Calls the best available model
|
|
@@ -9564,6 +9580,11 @@
|
|
|
9564
9580
|
continue llm;
|
|
9565
9581
|
}
|
|
9566
9582
|
return await llmExecutionTools.callEmbeddingModel(prompt);
|
|
9583
|
+
case 'IMAGE_GENERATION':
|
|
9584
|
+
if (llmExecutionTools.callImageGenerationModel === undefined) {
|
|
9585
|
+
continue llm;
|
|
9586
|
+
}
|
|
9587
|
+
return await llmExecutionTools.callImageGenerationModel(prompt);
|
|
9567
9588
|
// <- case [🤖]:
|
|
9568
9589
|
default:
|
|
9569
9590
|
throw new UnexpectedError(`Unknown model variant "${prompt.modelRequirements.modelVariant}" in ${llmExecutionTools.title}`);
|
|
@@ -11267,8 +11288,9 @@
|
|
|
11267
11288
|
$ongoingTaskResult.$resultString = $ongoingTaskResult.$completionResult.content;
|
|
11268
11289
|
break variant;
|
|
11269
11290
|
case 'EMBEDDING':
|
|
11291
|
+
case 'IMAGE_GENERATION':
|
|
11270
11292
|
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
11271
|
-
|
|
11293
|
+
${modelRequirements.modelVariant} model can not be used in pipeline
|
|
11272
11294
|
|
|
11273
11295
|
This should be catched during parsing
|
|
11274
11296
|
|
|
@@ -19121,6 +19143,9 @@
|
|
|
19121
19143
|
case 'EMBEDDING':
|
|
19122
19144
|
promptResult = await llmTools.callEmbeddingModel(prompt);
|
|
19123
19145
|
break variant;
|
|
19146
|
+
case 'IMAGE_GENERATION':
|
|
19147
|
+
promptResult = await llmTools.callImageGenerationModel(prompt);
|
|
19148
|
+
break variant;
|
|
19124
19149
|
// <- case [🤖]:
|
|
19125
19150
|
default:
|
|
19126
19151
|
throw new PipelineExecutionError(`Unknown model variant "${prompt.modelRequirements.modelVariant}"`);
|
|
@@ -19208,6 +19233,11 @@
|
|
|
19208
19233
|
return /* not await */ callCommonModel(prompt);
|
|
19209
19234
|
};
|
|
19210
19235
|
}
|
|
19236
|
+
if (llmTools.callImageGenerationModel !== undefined) {
|
|
19237
|
+
proxyTools.callImageGenerationModel = async (prompt) => {
|
|
19238
|
+
return /* not await */ callCommonModel(prompt);
|
|
19239
|
+
};
|
|
19240
|
+
}
|
|
19211
19241
|
// <- Note: [🤖]
|
|
19212
19242
|
return proxyTools;
|
|
19213
19243
|
}
|