@promptbook/website-crawler 0.104.0-13 → 0.104.0-15
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 +25 -17
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +0 -6
- package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +4 -1
- package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +5 -1
- package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +4 -0
- package/esm/typings/src/book-components/icons/AboutIcon.d.ts +5 -1
- package/esm/typings/src/book-components/icons/AttachmentIcon.d.ts +6 -2
- package/esm/typings/src/book-components/icons/CameraIcon.d.ts +6 -2
- package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +5 -1
- package/esm/typings/src/book-components/icons/MenuIcon.d.ts +5 -1
- package/esm/typings/src/book-components/icons/SaveIcon.d.ts +6 -2
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +7 -5
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +7 -3
- package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +11 -7
- package/esm/typings/src/remote-server/ui/ServerApp.d.ts +5 -1
- package/esm/typings/src/types/typeAliasEmoji.d.ts +2 -2
- package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +4 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +25 -17
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -27,7 +27,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
27
27
|
* @generated
|
|
28
28
|
* @see https://github.com/webgptorg/promptbook
|
|
29
29
|
*/
|
|
30
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-
|
|
30
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-15';
|
|
31
31
|
/**
|
|
32
32
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
33
33
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1746,8 +1746,8 @@ for (let i = 0; i < defaultDiacriticsRemovalMap.length; i++) {
|
|
|
1746
1746
|
*/
|
|
1747
1747
|
function removeDiacritics(input) {
|
|
1748
1748
|
/*eslint no-control-regex: "off"*/
|
|
1749
|
-
return input.replace(/[^\u0000-\u007E]/g, (
|
|
1750
|
-
return DIACRITIC_VARIANTS_LETTERS[
|
|
1749
|
+
return input.replace(/[^\u0000-\u007E]/g, (character) => {
|
|
1750
|
+
return DIACRITIC_VARIANTS_LETTERS[character] || character;
|
|
1751
1751
|
});
|
|
1752
1752
|
}
|
|
1753
1753
|
/**
|
|
@@ -3886,7 +3886,7 @@ async function forEachAsync(array, options, callbackfunction) {
|
|
|
3886
3886
|
tasks.push(task);
|
|
3887
3887
|
runningTasks.push(task);
|
|
3888
3888
|
/* not await */ Promise.resolve(task).then(() => {
|
|
3889
|
-
runningTasks = runningTasks.filter((
|
|
3889
|
+
runningTasks = runningTasks.filter((runningTask) => runningTask !== task);
|
|
3890
3890
|
});
|
|
3891
3891
|
if (maxParallelCount < runningTasks.length) {
|
|
3892
3892
|
await Promise.race(runningTasks);
|
|
@@ -3943,10 +3943,14 @@ function addUsage(...usageItems) {
|
|
|
3943
3943
|
}
|
|
3944
3944
|
|
|
3945
3945
|
/**
|
|
3946
|
-
* Intercepts LLM tools and counts total usage of the tools
|
|
3946
|
+
* Intercepts LLM tools and counts total usage of the tools.
|
|
3947
3947
|
*
|
|
3948
|
-
*
|
|
3949
|
-
*
|
|
3948
|
+
* This function wraps the provided `LlmExecutionTools` with a proxy that tracks the cumulative
|
|
3949
|
+
* usage (tokens, cost, etc.) across all model calls. It provides a way to monitor spending
|
|
3950
|
+
* in real-time through an observable.
|
|
3951
|
+
*
|
|
3952
|
+
* @param llmTools - The LLM tools to be intercepted and tracked
|
|
3953
|
+
* @returns An augmented version of the tools that includes usage tracking capabilities
|
|
3950
3954
|
* @public exported from `@promptbook/core`
|
|
3951
3955
|
*/
|
|
3952
3956
|
function countUsage(llmTools) {
|
|
@@ -4211,17 +4215,21 @@ class MultipleLlmExecutionTools {
|
|
|
4211
4215
|
*/
|
|
4212
4216
|
|
|
4213
4217
|
/**
|
|
4214
|
-
* Joins multiple LLM Execution Tools into one
|
|
4218
|
+
* Joins multiple LLM Execution Tools into one.
|
|
4215
4219
|
*
|
|
4216
|
-
*
|
|
4220
|
+
* This function takes a list of `LlmExecutionTools` and returns a single unified
|
|
4221
|
+
* `MultipleLlmExecutionTools` object. It provides failover and aggregation logic:
|
|
4217
4222
|
*
|
|
4218
|
-
*
|
|
4219
|
-
*
|
|
4220
|
-
* 2
|
|
4221
|
-
* 3
|
|
4223
|
+
* 1. **Failover**: When a model call is made, it tries providers in the order they were provided.
|
|
4224
|
+
* If the first provider doesn't support the requested model or fails, it tries the next one.
|
|
4225
|
+
* 2. **Aggregation**: `listModels` returns a combined list of all models available from all providers.
|
|
4226
|
+
* 3. **Empty case**: If no tools are provided, it logs a warning (as Promptbook requires LLMs to function).
|
|
4222
4227
|
*
|
|
4228
|
+
* @param title - A descriptive title for this collection of joined tools
|
|
4229
|
+
* @param llmExecutionTools - An array of execution tools to be joined
|
|
4230
|
+
* @returns A single unified execution tool wrapper
|
|
4223
4231
|
*
|
|
4224
|
-
* Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools
|
|
4232
|
+
* Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
|
|
4225
4233
|
*
|
|
4226
4234
|
* @public exported from `@promptbook/core`
|
|
4227
4235
|
*/
|
|
@@ -6636,7 +6644,7 @@ async function getKnowledgeForTask(options) {
|
|
|
6636
6644
|
const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
|
|
6637
6645
|
const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
|
|
6638
6646
|
const { index } = knowledgePiece;
|
|
6639
|
-
const knowledgePieceIndex = index.find((
|
|
6647
|
+
const knowledgePieceIndex = index.find((knowledgePieceIndex) => knowledgePieceIndex.modelName === firstKnowledgeIndex.modelName);
|
|
6640
6648
|
// <- TODO: Do not use just first knowledge piece and first index to determine embedding model
|
|
6641
6649
|
if (knowledgePieceIndex === undefined) {
|
|
6642
6650
|
return {
|
|
@@ -7084,7 +7092,7 @@ async function executePipeline(options) {
|
|
|
7084
7092
|
resovedParameterNames = [...resovedParameterNames, currentTask.resultingParameterName];
|
|
7085
7093
|
})
|
|
7086
7094
|
.then(() => {
|
|
7087
|
-
resolving = resolving.filter((
|
|
7095
|
+
resolving = resolving.filter((workItem) => workItem !== work);
|
|
7088
7096
|
});
|
|
7089
7097
|
// <- Note: Errors are catched here [3]
|
|
7090
7098
|
// TODO: BUT if in multiple tasks are errors, only the first one is catched so maybe we should catch errors here and save them to errors array here
|
|
@@ -7250,7 +7258,7 @@ function createPipelineExecutor(options) {
|
|
|
7250
7258
|
// Calculate and update tldr based on pipeline progress
|
|
7251
7259
|
const cv = newOngoingResult;
|
|
7252
7260
|
// Calculate progress based on parameters resolved vs total parameters
|
|
7253
|
-
const totalParameters = pipeline.parameters.filter((
|
|
7261
|
+
const totalParameters = pipeline.parameters.filter((parameter) => !parameter.isInput).length;
|
|
7254
7262
|
let resolvedParameters = 0;
|
|
7255
7263
|
let currentTaskTitle = '';
|
|
7256
7264
|
// Get the resolved parameters from output parameters
|