@promptbook/markdown-utils 0.103.0-42 → 0.103.0-44

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.
Files changed (92) hide show
  1. package/README.md +6 -18
  2. package/esm/index.es.js +47 -114
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/core.index.d.ts +6 -0
  5. package/esm/typings/src/_packages/node.index.d.ts +0 -2
  6. package/esm/typings/src/_packages/types.index.d.ts +22 -0
  7. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  8. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -4
  9. package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +1 -1
  10. package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +1 -0
  11. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +6 -1
  12. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +1 -1
  13. package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
  14. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
  15. package/esm/typings/src/book-components/Qr/BrandedQrCode.d.ts +1 -1
  16. package/esm/typings/src/book-components/Qr/useQrCode.d.ts +1 -1
  17. package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +1 -1
  18. package/esm/typings/src/cli/cli-commands/about.d.ts +1 -1
  19. package/esm/typings/src/cli/cli-commands/hello.d.ts +1 -1
  20. package/esm/typings/src/cli/cli-commands/list-models.d.ts +1 -1
  21. package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +1 -1
  22. package/esm/typings/src/cli/cli-commands/login.d.ts +1 -1
  23. package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
  24. package/esm/typings/src/cli/cli-commands/prettify.d.ts +1 -1
  25. package/esm/typings/src/cli/cli-commands/run.d.ts +1 -1
  26. package/esm/typings/src/cli/cli-commands/start-agents-server.d.ts +1 -1
  27. package/esm/typings/src/cli/cli-commands/start-pipelines-server.d.ts +1 -1
  28. package/esm/typings/src/cli/cli-commands/test-command.d.ts +1 -1
  29. package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +1 -1
  30. package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +2 -29
  31. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +107 -0
  32. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +129 -0
  33. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +1 -1
  34. package/esm/typings/src/config.d.ts +1 -1
  35. package/esm/typings/src/errors/0-index.d.ts +3 -0
  36. package/esm/typings/src/errors/DatabaseError.d.ts +12 -0
  37. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -1
  38. package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +1 -1
  39. package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +1 -1
  40. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
  41. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
  42. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
  43. package/esm/typings/src/llm-providers/agent/Agent.d.ts +5 -2
  44. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +1 -1
  45. package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +4 -2
  46. package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +4 -3
  47. package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +1 -1
  48. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  49. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  50. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  51. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +1 -0
  52. package/esm/typings/src/remote-server/startAgentServer.d.ts +2 -2
  53. package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +0 -19
  54. package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +1 -1
  55. package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +5 -1
  56. package/esm/typings/src/transpilers/_common/BookTranspilerOptions.d.ts +1 -1
  57. package/esm/typings/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -1
  58. package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +4 -1
  59. package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +1 -1
  60. package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +4 -1
  61. package/esm/typings/src/transpilers/openai-sdk/register.d.ts +1 -1
  62. package/esm/typings/src/types/typeAliases.d.ts +19 -1
  63. package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
  64. package/esm/typings/src/utils/color/operators/darken.d.ts +1 -1
  65. package/esm/typings/src/utils/color/operators/grayscale.d.ts +1 -1
  66. package/esm/typings/src/utils/color/operators/lighten.d.ts +1 -1
  67. package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +1 -1
  68. package/esm/typings/src/utils/color/operators/saturate.d.ts +1 -1
  69. package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +16 -0
  70. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +1 -1
  71. package/esm/typings/src/utils/execCommand/$execCommands.d.ts +1 -1
  72. package/esm/typings/src/utils/files/$induceBookDownload.d.ts +2 -2
  73. package/esm/typings/src/utils/files/$induceFileDownload.d.ts +2 -2
  74. package/esm/typings/src/utils/files/ObjectUrl.d.ts +1 -1
  75. package/esm/typings/src/utils/misc/aboutPromptbookInformation.d.ts +6 -0
  76. package/esm/typings/src/utils/organization/$side_effect.d.ts +1 -1
  77. package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +25 -0
  78. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
  79. package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
  80. package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
  81. package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
  82. package/esm/typings/src/utils/random/$randomToken.d.ts +2 -0
  83. package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +1 -1
  84. package/esm/typings/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -2
  85. package/esm/typings/src/version.d.ts +1 -1
  86. package/package.json +1 -1
  87. package/umd/index.umd.js +47 -114
  88. package/umd/index.umd.js.map +1 -1
  89. package/esm/typings/src/collection/agent-collection/constructors/AgentCollectionInDirectory.d.ts +0 -89
  90. package/esm/typings/src/collection/agent-collection/constructors/AgentCollectionInDirectory.test.d.ts +0 -1
  91. package/esm/typings/src/commands/_common/parseCommand.test.d.ts +0 -1
  92. package/esm/typings/src/execution/utils/logLlmCall.d.ts +0 -8
package/README.md CHANGED
@@ -9,8 +9,8 @@ Turn your company's scattered knowledge into AI ready Books
9
9
 
10
10
 
11
11
 
12
- [![NPM Version of ![Promptbook logo - cube with letters P and B](./design/logo-h1.png) Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
13
- [![Quality of package ![Promptbook logo - cube with letters P and B](./design/logo-h1.png) Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
12
+ [![NPM Version of ![Promptbook logo](./design/logo-h1.png) Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
13
+ [![Quality of package ![Promptbook logo](./design/logo-h1.png) Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
14
14
  [![Known Vulnerabilities](https://snyk.io/test/github/webgptorg/promptbook/badge.svg)](https://snyk.io/test/github/webgptorg/promptbook)
15
15
  [![🧪 Test Books](https://github.com/webgptorg/promptbook/actions/workflows/test-books.yml/badge.svg)](https://github.com/webgptorg/promptbook/actions/workflows/test-books.yml)
16
16
  [![🧪 Test build](https://github.com/webgptorg/promptbook/actions/workflows/test-build.yml/badge.svg)](https://github.com/webgptorg/promptbook/actions/workflows/test-build.yml)
@@ -23,11 +23,7 @@ Turn your company's scattered knowledge into AI ready Books
23
23
 
24
24
  ## 🌟 New Features
25
25
 
26
- - 🚀 **GPT-5 Support** - Now includes OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window
27
- - 💡 VS Code support for `.book` files with syntax highlighting and IntelliSense
28
- - 🐳 Official Docker image (`hejny/promptbook`) for seamless containerized usage
29
- - 🔥 Native support for OpenAI `o3-mini`, GPT-4 and other leading LLMs
30
- - 🔍 DeepSeek integration for advanced knowledge search
26
+ - **Gemini 3 Support**
31
27
 
32
28
 
33
29
 
@@ -202,7 +198,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
202
198
  Your job is to provide legal advice and support to the company and its employees.<br/>
203
199
  You are knowledgeable, professional, and detail-oriented.<br/>
204
200
  <br/>
205
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
201
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
206
202
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
207
203
 
208
204
  </td></tr></table>
@@ -224,7 +220,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
224
220
  **RULE** Always ensure compliance with laws and regulations.<br/>
225
221
  **RULE** Never provide legal advice outside your area of expertise.<br/>
226
222
  **RULE** Never provide legal advice about criminal law.<br/>
227
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
223
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
228
224
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
229
225
 
230
226
  </td></tr></table>
@@ -244,7 +240,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
244
240
  **RULE** Always ensure compliance with laws and regulations.<br/>
245
241
  **RULE** Never provide legal advice outside your area of expertise.<br/>
246
242
  **RULE** Never provide legal advice about criminal law.<br/>
247
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
243
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
248
244
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
249
245
  **ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
250
246
 
@@ -295,14 +291,10 @@ Now you want to use it. There are several ways how to write your first book:
295
291
 
296
292
  We have written ai asistant in book who can help you with writing your first book.
297
293
 
298
-
299
-
300
294
  #### Your AI twin
301
295
 
302
296
  Copy your own behavior, personality, and knowledge into book and create your AI twin. It can help you with your work, personal life, or any other task.
303
297
 
304
-
305
-
306
298
  #### AI persona workpool
307
299
 
308
300
  Or you can pick from our library of pre-written books for various roles and tasks. You can find books for customer support, coding, marketing, sales, HR, legal, and many other roles.
@@ -422,8 +414,6 @@ Join our growing community of developers and users:
422
414
 
423
415
 
424
416
 
425
-
426
-
427
417
  ## 📚 Documentation
428
418
 
429
419
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -500,8 +490,6 @@ The following glossary is used to clarify certain concepts:
500
490
 
501
491
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
502
492
 
503
-
504
-
505
493
  ### 💯 Core concepts
506
494
 
507
495
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
package/esm/index.es.js CHANGED
@@ -16,14 +16,14 @@ import { parse, unparse } from 'papaparse';
16
16
  * @generated
17
17
  * @see https://github.com/webgptorg/book
18
18
  */
19
- const BOOK_LANGUAGE_VERSION = '1.0.0';
19
+ const BOOK_LANGUAGE_VERSION = '2.0.0';
20
20
  /**
21
21
  * The version of the Promptbook engine
22
22
  *
23
23
  * @generated
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-42';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-44';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -830,6 +830,23 @@ class Color {
830
830
  * TODO: Maybe connect with textures
831
831
  */
832
832
 
833
+ /**
834
+ * Makes color transformer which returns a grayscale version of the color
835
+ *
836
+ * @param amount from 0 to 1
837
+ *
838
+ * @public exported from `@promptbook/color`
839
+ */
840
+ function grayscale(amount) {
841
+ return ({ red, green, blue, alpha }) => {
842
+ const average = (red + green + blue) / 3;
843
+ red = Math.round(average * amount + red * (1 - amount));
844
+ green = Math.round(average * amount + green * (1 - amount));
845
+ blue = Math.round(average * amount + blue * (1 - amount));
846
+ return Color.fromValues(red, green, blue, alpha);
847
+ };
848
+ }
849
+
833
850
  /**
834
851
  * Converts HSL values to RGB values
835
852
  *
@@ -945,102 +962,6 @@ function lighten(amount) {
945
962
  * TODO: Maybe implement by mix+hsl
946
963
  */
947
964
 
948
- /**
949
- * Calculates distance between two colors
950
- *
951
- * @param color1 first color
952
- * @param color2 second color
953
- *
954
- * Note: This function is inefficient. Use colorDistanceSquared instead if possible.
955
- *
956
- * @public exported from `@promptbook/color`
957
- */
958
- /**
959
- * Calculates distance between two colors without square root
960
- *
961
- * @param color1 first color
962
- * @param color2 second color
963
- *
964
- * @public exported from `@promptbook/color`
965
- */
966
- function colorDistanceSquared(color1, color2) {
967
- const rmean = (color1.red + color2.red) / 2;
968
- const r = color1.red - color2.red;
969
- const g = color1.green - color2.green;
970
- const b = color1.blue - color2.blue;
971
- const weightR = 2 + rmean / 256;
972
- const weightG = 4.0;
973
- const weightB = 2 + (255 - rmean) / 256;
974
- const distance = weightR * r * r + weightG * g * g + weightB * b * b;
975
- return distance;
976
- }
977
-
978
- /**
979
- * Makes color transformer which finds the nearest color from the given list
980
- *
981
- * @param colors array of colors to choose from
982
- *
983
- * @public exported from `@promptbook/color`
984
- */
985
- function nearest(...colors) {
986
- return (color) => {
987
- const distances = colors.map((c) => colorDistanceSquared(c, color));
988
- const minDistance = Math.min(...distances);
989
- const minIndex = distances.indexOf(minDistance);
990
- const nearestColor = colors[minIndex];
991
- return nearestColor;
992
- };
993
- }
994
-
995
- /**
996
- * Color transformer which returns the negative color
997
- *
998
- * @public exported from `@promptbook/color`
999
- */
1000
- function negative(color) {
1001
- const r = 255 - color.red;
1002
- const g = 255 - color.green;
1003
- const b = 255 - color.blue;
1004
- return Color.fromValues(r, g, b, color.alpha);
1005
- }
1006
-
1007
- /**
1008
- * Makes color transformer which finds the furthest color from the given list
1009
- *
1010
- * @param colors array of colors to choose from
1011
- *
1012
- * @public exported from `@promptbook/color`
1013
- */
1014
- function furthest(...colors) {
1015
- return (color) => {
1016
- const furthestColor = negative(nearest(...colors.map(negative))(color));
1017
- return furthestColor;
1018
- };
1019
- }
1020
- /**
1021
- * Makes color transformer which finds the best text color (black or white) for the given background color
1022
- *
1023
- * @public exported from `@promptbook/color`
1024
- */
1025
- furthest(Color.get('white'), Color.from('black'));
1026
-
1027
- /**
1028
- * Makes color transformer which returns a grayscale version of the color
1029
- *
1030
- * @param amount from 0 to 1
1031
- *
1032
- * @public exported from `@promptbook/color`
1033
- */
1034
- function grayscale(amount) {
1035
- return ({ red, green, blue, alpha }) => {
1036
- const average = (red + green + blue) / 3;
1037
- red = Math.round(average * amount + red * (1 - amount));
1038
- green = Math.round(average * amount + green * (1 - amount));
1039
- blue = Math.round(average * amount + blue * (1 - amount));
1040
- return Color.fromValues(red, green, blue, alpha);
1041
- };
1042
- }
1043
-
1044
965
  /**
1045
966
  * Makes color transformer which saturate the given color
1046
967
  *
@@ -2678,6 +2599,7 @@ class MissingToolsError extends Error {
2678
2599
  /**
2679
2600
  * Generates random token
2680
2601
  *
2602
+ * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
2681
2603
  * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
2682
2604
  *
2683
2605
  * @private internal helper function
@@ -2687,6 +2609,7 @@ function $randomToken(randomness) {
2687
2609
  return randomBytes(randomness).toString('hex');
2688
2610
  }
2689
2611
  /**
2612
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
2690
2613
  * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
2691
2614
  */
2692
2615
 
@@ -2805,6 +2728,22 @@ class CollectionError extends Error {
2805
2728
  }
2806
2729
  }
2807
2730
 
2731
+ /**
2732
+ * This error indicates error from the database
2733
+ *
2734
+ * @public exported from `@promptbook/core`
2735
+ */
2736
+ class DatabaseError extends Error {
2737
+ constructor(message) {
2738
+ super(message);
2739
+ this.name = 'DatabaseError';
2740
+ Object.setPrototypeOf(this, DatabaseError.prototype);
2741
+ }
2742
+ }
2743
+ /**
2744
+ * TODO: !!!! Explain that NotFoundError (!!! and other specific errors) has priority over DatabaseError in some contexts
2745
+ */
2746
+
2808
2747
  /**
2809
2748
  * This error type indicates that you try to use a feature that is not available in the current environment
2810
2749
  *
@@ -2934,6 +2873,7 @@ const PROMPTBOOK_ERRORS = {
2934
2873
  UnexpectedError,
2935
2874
  WrappedError,
2936
2875
  NotAllowed,
2876
+ DatabaseError,
2937
2877
  // TODO: [🪑]> VersionMismatchError,
2938
2878
  };
2939
2879
  /**
@@ -3770,6 +3710,7 @@ function joinLlmExecutionTools(title, ...llmExecutionTools) {
3770
3710
  return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
3771
3711
  }
3772
3712
  /**
3713
+ * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
3773
3714
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
3774
3715
  */
3775
3716
 
@@ -3786,6 +3727,7 @@ function getSingleLlmExecutionTools(oneOrMoreLlmExecutionTools) {
3786
3727
  return llmTools;
3787
3728
  }
3788
3729
  /**
3730
+ * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
3789
3731
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
3790
3732
  */
3791
3733
 
@@ -5762,18 +5704,6 @@ function templateParameters(template, parameters) {
5762
5704
  return replacedTemplates;
5763
5705
  }
5764
5706
 
5765
- /**
5766
- * Logs an LLM call with the given report.
5767
- *
5768
- * @private internal utility of `createPipelineExecutor`
5769
- */
5770
- function logLlmCall(logLlmCall, report) {
5771
- logLlmCall({
5772
- modelName: 'model' /* <- TODO: How to get model name from the report */,
5773
- report,
5774
- });
5775
- }
5776
-
5777
5707
  /**
5778
5708
  * Counts number of characters in the text
5779
5709
  *
@@ -6017,7 +5947,7 @@ function validatePromptResult(options) {
6017
5947
  */
6018
5948
  async function executeAttempts(options) {
6019
5949
  const { jokerParameterNames, priority, maxAttempts, // <- Note: [💂]
6020
- preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, logLlmCall: logLlmCall$1, } = options;
5950
+ preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, logLlmCall, } = options;
6021
5951
  const $ongoingTaskResult = {
6022
5952
  $result: null,
6023
5953
  $resultString: null,
@@ -6279,8 +6209,11 @@ async function executeAttempts(options) {
6279
6209
  : serializeError($ongoingTaskResult.$expectError),
6280
6210
  };
6281
6211
  $executionReport.promptExecutions.push(executionPromptReport);
6282
- if (logLlmCall$1) {
6283
- logLlmCall(logLlmCall$1, executionPromptReport);
6212
+ if (logLlmCall) {
6213
+ logLlmCall({
6214
+ modelName: 'model' /* <- TODO: How to get model name from the report */,
6215
+ report: executionPromptReport,
6216
+ });
6284
6217
  }
6285
6218
  }
6286
6219
  }
@@ -6554,7 +6487,7 @@ async function getKnowledgeForTask(options) {
6554
6487
  },
6555
6488
  content: task.content,
6556
6489
  parameters,
6557
- };
6490
+ }; /* <- Note: [🤛] */
6558
6491
  const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
6559
6492
  const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
6560
6493
  const { index } = knowledgePiece;