@promptbook/markdown-utils 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.
@@ -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-2`).
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/markdown-utils",
3
- "version": "0.104.0-3",
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,
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-3';
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
@@ -3546,6 +3546,15 @@
3546
3546
  return promptResult;
3547
3547
  };
3548
3548
  }
3549
+ if (llmTools.callImageGenerationModel !== undefined) {
3550
+ proxyTools.callImageGenerationModel = async (prompt) => {
3551
+ // console.info('[🚕] callImageGenerationModel through countTotalUsage');
3552
+ const promptResult = await llmTools.callImageGenerationModel(prompt);
3553
+ totalUsage = addUsage(totalUsage, promptResult.usage);
3554
+ spending.next(promptResult.usage);
3555
+ return promptResult;
3556
+ };
3557
+ }
3549
3558
  // <- Note: [🤖]
3550
3559
  return proxyTools;
3551
3560
  }
@@ -3655,6 +3664,12 @@
3655
3664
  callEmbeddingModel(prompt) {
3656
3665
  return this.callCommonModel(prompt);
3657
3666
  }
3667
+ /**
3668
+ * Calls the best available embedding model
3669
+ */
3670
+ callImageGenerationModel(prompt) {
3671
+ return this.callCommonModel(prompt);
3672
+ }
3658
3673
  // <- Note: [🤖]
3659
3674
  /**
3660
3675
  * Calls the best available model
@@ -3681,6 +3696,11 @@
3681
3696
  continue llm;
3682
3697
  }
3683
3698
  return await llmExecutionTools.callEmbeddingModel(prompt);
3699
+ case 'IMAGE_GENERATION':
3700
+ if (llmExecutionTools.callImageGenerationModel === undefined) {
3701
+ continue llm;
3702
+ }
3703
+ return await llmExecutionTools.callImageGenerationModel(prompt);
3684
3704
  // <- case [🤖]:
3685
3705
  default:
3686
3706
  throw new UnexpectedError(`Unknown model variant "${prompt.modelRequirements.modelVariant}" in ${llmExecutionTools.title}`);
@@ -6108,8 +6128,9 @@
6108
6128
  $ongoingTaskResult.$resultString = $ongoingTaskResult.$completionResult.content;
6109
6129
  break variant;
6110
6130
  case 'EMBEDDING':
6131
+ case 'IMAGE_GENERATION':
6111
6132
  throw new PipelineExecutionError(spaceTrim$1.spaceTrim((block) => `
6112
- Embedding model can not be used in pipeline
6133
+ ${modelRequirements.modelVariant} model can not be used in pipeline
6113
6134
 
6114
6135
  This should be catched during parsing
6115
6136