@promptbook/markitdown 0.104.0-2 → 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/_packages/types.index.d.ts +2 -0
- package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +7 -11
- 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/types/Message.d.ts +49 -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
package/esm/index.es.js
CHANGED
|
@@ -24,7 +24,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
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
|
|
@@ -3872,6 +3872,15 @@ function countUsage(llmTools) {
|
|
|
3872
3872
|
return promptResult;
|
|
3873
3873
|
};
|
|
3874
3874
|
}
|
|
3875
|
+
if (llmTools.callImageGenerationModel !== undefined) {
|
|
3876
|
+
proxyTools.callImageGenerationModel = async (prompt) => {
|
|
3877
|
+
// console.info('[🚕] callImageGenerationModel through countTotalUsage');
|
|
3878
|
+
const promptResult = await llmTools.callImageGenerationModel(prompt);
|
|
3879
|
+
totalUsage = addUsage(totalUsage, promptResult.usage);
|
|
3880
|
+
spending.next(promptResult.usage);
|
|
3881
|
+
return promptResult;
|
|
3882
|
+
};
|
|
3883
|
+
}
|
|
3875
3884
|
// <- Note: [🤖]
|
|
3876
3885
|
return proxyTools;
|
|
3877
3886
|
}
|
|
@@ -3981,6 +3990,12 @@ class MultipleLlmExecutionTools {
|
|
|
3981
3990
|
callEmbeddingModel(prompt) {
|
|
3982
3991
|
return this.callCommonModel(prompt);
|
|
3983
3992
|
}
|
|
3993
|
+
/**
|
|
3994
|
+
* Calls the best available embedding model
|
|
3995
|
+
*/
|
|
3996
|
+
callImageGenerationModel(prompt) {
|
|
3997
|
+
return this.callCommonModel(prompt);
|
|
3998
|
+
}
|
|
3984
3999
|
// <- Note: [🤖]
|
|
3985
4000
|
/**
|
|
3986
4001
|
* Calls the best available model
|
|
@@ -4007,6 +4022,11 @@ class MultipleLlmExecutionTools {
|
|
|
4007
4022
|
continue llm;
|
|
4008
4023
|
}
|
|
4009
4024
|
return await llmExecutionTools.callEmbeddingModel(prompt);
|
|
4025
|
+
case 'IMAGE_GENERATION':
|
|
4026
|
+
if (llmExecutionTools.callImageGenerationModel === undefined) {
|
|
4027
|
+
continue llm;
|
|
4028
|
+
}
|
|
4029
|
+
return await llmExecutionTools.callImageGenerationModel(prompt);
|
|
4010
4030
|
// <- case [🤖]:
|
|
4011
4031
|
default:
|
|
4012
4032
|
throw new UnexpectedError(`Unknown model variant "${prompt.modelRequirements.modelVariant}" in ${llmExecutionTools.title}`);
|
|
@@ -6141,8 +6161,9 @@ async function executeAttempts(options) {
|
|
|
6141
6161
|
$ongoingTaskResult.$resultString = $ongoingTaskResult.$completionResult.content;
|
|
6142
6162
|
break variant;
|
|
6143
6163
|
case 'EMBEDDING':
|
|
6164
|
+
case 'IMAGE_GENERATION':
|
|
6144
6165
|
throw new PipelineExecutionError(spaceTrim$1((block) => `
|
|
6145
|
-
|
|
6166
|
+
${modelRequirements.modelVariant} model can not be used in pipeline
|
|
6146
6167
|
|
|
6147
6168
|
This should be catched during parsing
|
|
6148
6169
|
|