@promptbook/markdown-utils 0.100.0-25 → 0.100.0-28
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 +6 -2
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +6 -1
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +0 -5
- package/esm/typings/src/types/ModelRequirements.d.ts +0 -2
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +6 -2
- package/umd/index.umd.js.map +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { ReadonlyDeep, WritableDeep } from 'type-fest';
|
|
1
|
+
import type { PartialDeep, Promisable, ReadonlyDeep, WritableDeep } from 'type-fest';
|
|
2
2
|
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
3
3
|
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
4
4
|
import type { Parameters } from '../../types/typeAliases';
|
|
5
5
|
import type { string_parameter_name } from '../../types/typeAliases';
|
|
6
6
|
import type { TODO_string } from '../../utils/organization/TODO_string';
|
|
7
7
|
import type { ExecutionReportJson } from '../execution-report/ExecutionReportJson';
|
|
8
|
+
import type { PipelineExecutorResult } from '../PipelineExecutorResult';
|
|
8
9
|
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
|
|
9
10
|
/**
|
|
10
11
|
* Options for executing attempts of a pipeline task, including configuration for jokers, priority,
|
|
@@ -46,6 +47,10 @@ export type ExecuteAttemptsOptions = Required<Omit<CreatePipelineExecutorOptions
|
|
|
46
47
|
* The pipeline structure prepared for execution, as a deeply immutable PipelineJson object.
|
|
47
48
|
*/
|
|
48
49
|
readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
|
|
50
|
+
/**
|
|
51
|
+
* Callback invoked with partial results as the execution progresses.
|
|
52
|
+
*/
|
|
53
|
+
onProgress(newOngoingResult: PartialDeep<PipelineExecutorResult>): Promisable<void>;
|
|
49
54
|
/**
|
|
50
55
|
* The execution report object, which is updated during execution.
|
|
51
56
|
*/
|
|
@@ -2,7 +2,6 @@ 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';
|
|
6
5
|
import type { Prompt } from '../../types/Prompt';
|
|
7
6
|
import type { string_markdown } from '../../types/typeAliases';
|
|
8
7
|
import type { string_markdown_text } from '../../types/typeAliases';
|
|
@@ -42,10 +41,6 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
|
|
|
42
41
|
* Calls Anthropic Claude API to use a chat model.
|
|
43
42
|
*/
|
|
44
43
|
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>;
|
|
49
44
|
/**
|
|
50
45
|
* Get the model that should be used as default
|
|
51
46
|
*/
|
|
@@ -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.100.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.100.0-27`).
|
|
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.100.0-
|
|
28
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.100.0-28';
|
|
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
|
|
@@ -4911,7 +4911,7 @@
|
|
|
4911
4911
|
*/
|
|
4912
4912
|
async function executeAttempts(options) {
|
|
4913
4913
|
const { jokerParameterNames, priority, maxAttempts, // <- Note: [💂]
|
|
4914
|
-
preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, } = options;
|
|
4914
|
+
preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, } = options;
|
|
4915
4915
|
const $ongoingTaskResult = {
|
|
4916
4916
|
$result: null,
|
|
4917
4917
|
$resultString: null,
|
|
@@ -5155,6 +5155,10 @@
|
|
|
5155
5155
|
result: $ongoingTaskResult.$resultString,
|
|
5156
5156
|
error: error,
|
|
5157
5157
|
});
|
|
5158
|
+
// Report failed attempt
|
|
5159
|
+
onProgress({
|
|
5160
|
+
errors: [error],
|
|
5161
|
+
});
|
|
5158
5162
|
}
|
|
5159
5163
|
finally {
|
|
5160
5164
|
if (!isJokerAttempt &&
|