@promptbook/website-crawler 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 +23 -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 +23 -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/website-crawler",
|
|
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/website-crawler.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
|
"@mozilla/readability": "0.6.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
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-
|
|
27
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-4';
|
|
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
|
|
@@ -4001,6 +4001,15 @@
|
|
|
4001
4001
|
return promptResult;
|
|
4002
4002
|
};
|
|
4003
4003
|
}
|
|
4004
|
+
if (llmTools.callImageGenerationModel !== undefined) {
|
|
4005
|
+
proxyTools.callImageGenerationModel = async (prompt) => {
|
|
4006
|
+
// console.info('[🚕] callImageGenerationModel through countTotalUsage');
|
|
4007
|
+
const promptResult = await llmTools.callImageGenerationModel(prompt);
|
|
4008
|
+
totalUsage = addUsage(totalUsage, promptResult.usage);
|
|
4009
|
+
spending.next(promptResult.usage);
|
|
4010
|
+
return promptResult;
|
|
4011
|
+
};
|
|
4012
|
+
}
|
|
4004
4013
|
// <- Note: [🤖]
|
|
4005
4014
|
return proxyTools;
|
|
4006
4015
|
}
|
|
@@ -4110,6 +4119,12 @@
|
|
|
4110
4119
|
callEmbeddingModel(prompt) {
|
|
4111
4120
|
return this.callCommonModel(prompt);
|
|
4112
4121
|
}
|
|
4122
|
+
/**
|
|
4123
|
+
* Calls the best available embedding model
|
|
4124
|
+
*/
|
|
4125
|
+
callImageGenerationModel(prompt) {
|
|
4126
|
+
return this.callCommonModel(prompt);
|
|
4127
|
+
}
|
|
4113
4128
|
// <- Note: [🤖]
|
|
4114
4129
|
/**
|
|
4115
4130
|
* Calls the best available model
|
|
@@ -4136,6 +4151,11 @@
|
|
|
4136
4151
|
continue llm;
|
|
4137
4152
|
}
|
|
4138
4153
|
return await llmExecutionTools.callEmbeddingModel(prompt);
|
|
4154
|
+
case 'IMAGE_GENERATION':
|
|
4155
|
+
if (llmExecutionTools.callImageGenerationModel === undefined) {
|
|
4156
|
+
continue llm;
|
|
4157
|
+
}
|
|
4158
|
+
return await llmExecutionTools.callImageGenerationModel(prompt);
|
|
4139
4159
|
// <- case [🤖]:
|
|
4140
4160
|
default:
|
|
4141
4161
|
throw new UnexpectedError(`Unknown model variant "${prompt.modelRequirements.modelVariant}" in ${llmExecutionTools.title}`);
|
|
@@ -6151,8 +6171,9 @@
|
|
|
6151
6171
|
$ongoingTaskResult.$resultString = $ongoingTaskResult.$completionResult.content;
|
|
6152
6172
|
break variant;
|
|
6153
6173
|
case 'EMBEDDING':
|
|
6174
|
+
case 'IMAGE_GENERATION':
|
|
6154
6175
|
throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
|
|
6155
|
-
|
|
6176
|
+
${modelRequirements.modelVariant} model can not be used in pipeline
|
|
6156
6177
|
|
|
6157
6178
|
This should be catched during parsing
|
|
6158
6179
|
|