@promptbook/markdown-utils 0.92.0-31 → 0.92.0-32
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.
|
@@ -2,6 +2,7 @@ import Anthropic from '@anthropic-ai/sdk';
|
|
|
2
2
|
import type { AvailableModel } from '../../execution/AvailableModel';
|
|
3
3
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
4
4
|
import type { ChatPromptResult } from '../../execution/PromptResult';
|
|
5
|
+
import type { CompletionPromptResult } from '../../execution/PromptResult';
|
|
5
6
|
import type { Prompt } from '../../types/Prompt';
|
|
6
7
|
import type { string_markdown } from '../../types/typeAliases';
|
|
7
8
|
import type { string_markdown_text } from '../../types/typeAliases';
|
|
@@ -19,6 +20,7 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
|
|
|
19
20
|
* Anthropic Claude API client.
|
|
20
21
|
*/
|
|
21
22
|
private client;
|
|
23
|
+
private limiter;
|
|
22
24
|
/**
|
|
23
25
|
* Creates Anthropic Claude Execution Tools.
|
|
24
26
|
*
|
|
@@ -40,6 +42,10 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
|
|
|
40
42
|
* Calls Anthropic Claude API to use a chat model.
|
|
41
43
|
*/
|
|
42
44
|
callChatModel(prompt: Pick<Prompt, 'content' | 'parameters' | 'modelRequirements'>): Promise<ChatPromptResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Calls Anthropic Claude API to use a completion model.
|
|
47
|
+
*/
|
|
48
|
+
callCompletionModel(prompt: Pick<Prompt, 'content' | 'parameters' | 'modelRequirements'>): Promise<CompletionPromptResult>;
|
|
43
49
|
/**
|
|
44
50
|
* Get the model that should be used as default
|
|
45
51
|
*/
|
|
@@ -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.92.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.92.0-31`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* @generated
|
|
26
26
|
* @see https://github.com/webgptorg/promptbook
|
|
27
27
|
*/
|
|
28
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-
|
|
28
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-32';
|
|
29
29
|
/**
|
|
30
30
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
31
31
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2529,23 +2529,17 @@
|
|
|
2529
2529
|
* Check the configuration of all execution tools
|
|
2530
2530
|
*/
|
|
2531
2531
|
async checkConfiguration() {
|
|
2532
|
-
//
|
|
2533
|
-
|
|
2534
|
-
await llmExecutionTools.checkConfiguration();
|
|
2535
|
-
}
|
|
2532
|
+
// Note: Run checks in parallel
|
|
2533
|
+
await Promise.all(this.llmExecutionTools.map((tools) => tools.checkConfiguration()));
|
|
2536
2534
|
}
|
|
2537
2535
|
/**
|
|
2538
2536
|
* List all available models that can be used
|
|
2539
2537
|
* This lists is a combination of all available models from all execution tools
|
|
2540
2538
|
*/
|
|
2541
2539
|
async listModels() {
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
const models = await llmExecutionTools.listModels();
|
|
2546
|
-
availableModels.push(...models);
|
|
2547
|
-
}
|
|
2548
|
-
return availableModels;
|
|
2540
|
+
// Obtain all models in parallel and flatten
|
|
2541
|
+
const modelArrays = await Promise.all(this.llmExecutionTools.map((tools) => tools.listModels()));
|
|
2542
|
+
return modelArrays.flat();
|
|
2549
2543
|
}
|
|
2550
2544
|
/**
|
|
2551
2545
|
* Calls the best available chat model
|