@promptbook/wizard 0.100.0-44 → 0.100.0-46
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 +214 -129
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +14 -0
- package/esm/typings/src/_packages/core.index.d.ts +4 -0
- package/esm/typings/src/_packages/types.index.d.ts +8 -0
- package/esm/typings/src/book-2.0/commitments/_misc/AgentModelRequirements.d.ts +1 -1
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +26 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource.d.ts +19 -0
- package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +15 -0
- package/esm/typings/src/book-components/Chat/Chat/Chat.d.ts +128 -0
- package/esm/typings/src/book-components/Chat/interfaces/ChatMessage.d.ts +16 -0
- package/esm/typings/src/book-components/Chat/interfaces/ChatParticipant.d.ts +12 -0
- package/esm/typings/src/book-components/Chat/utils/ExportFormat.d.ts +4 -0
- package/esm/typings/src/book-components/Chat/utils/addUtmParamsToUrl.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/createShortLinkForChat.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/downloadFile.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/utils/exportChatHistory.d.ts +11 -0
- package/esm/typings/src/book-components/Chat/utils/generatePdfContent.d.ts +10 -0
- package/esm/typings/src/book-components/Chat/utils/generateQrDataUrl.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/getPromptbookBranding.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToHtml.d.ts +10 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToJson.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToMarkdown.d.ts +10 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToText.d.ts +10 -0
- package/esm/typings/src/config.d.ts +13 -0
- package/esm/typings/src/execution/ExecutionTask.d.ts +12 -13
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +8 -0
- package/esm/typings/src/playground/permanent/error-handling-playground.d.ts +5 -0
- package/esm/typings/src/utils/organization/preserve.d.ts +21 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -3
- package/umd/index.umd.js +218 -133
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +0 -14
@@ -3,14 +3,28 @@ import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChi
|
|
3
3
|
import { AvatarChip } from '../book-components/AvatarProfile/AvatarChip/AvatarChip';
|
4
4
|
import type { AvatarChipFromSourceProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
|
5
5
|
import { AvatarChipFromSource } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
|
6
|
+
import type { AvatarProfileProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
|
7
|
+
import { AvatarProfile } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
|
8
|
+
import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
|
9
|
+
import { AvatarProfileFromSource } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
|
6
10
|
import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
|
7
11
|
import { BookEditor } from '../book-components/BookEditor/BookEditor';
|
8
12
|
import { DEFAULT_BOOK_FONT_CLASS } from '../book-components/BookEditor/config';
|
13
|
+
import { Chat } from '../book-components/Chat/Chat/Chat';
|
14
|
+
import type { ChatMessage } from '../book-components/Chat/interfaces/ChatMessage';
|
15
|
+
import type { ChatParticipant } from '../book-components/Chat/interfaces/ChatParticipant';
|
9
16
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
10
17
|
export type { AvatarChipProps };
|
11
18
|
export { AvatarChip };
|
12
19
|
export type { AvatarChipFromSourceProps };
|
13
20
|
export { AvatarChipFromSource };
|
21
|
+
export type { AvatarProfileProps };
|
22
|
+
export { AvatarProfile };
|
23
|
+
export type { AvatarProfileFromSourceProps };
|
24
|
+
export { AvatarProfileFromSource };
|
14
25
|
export type { BookEditorProps };
|
15
26
|
export { BookEditor };
|
16
27
|
export { DEFAULT_BOOK_FONT_CLASS };
|
28
|
+
export { Chat };
|
29
|
+
export type { ChatMessage };
|
30
|
+
export type { ChatParticipant };
|
@@ -49,6 +49,8 @@ import { DEFAULT_IS_AUTO_INSTALLED } from '../config';
|
|
49
49
|
import { DEFAULT_TASK_SIMULATED_DURATION_MS } from '../config';
|
50
50
|
import { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME } from '../config';
|
51
51
|
import { DEFAULT_MAX_REQUESTS_PER_MINUTE } from '../config';
|
52
|
+
import { API_REQUEST_TIMEOUT } from '../config';
|
53
|
+
import { PROMPTBOOK_LOGO_URL } from '../config';
|
52
54
|
import { MODEL_TRUST_LEVELS } from '../constants';
|
53
55
|
import { MODEL_ORDERS } from '../constants';
|
54
56
|
import { ORDER_OF_PIPELINE_JSON } from '../constants';
|
@@ -211,6 +213,8 @@ export { DEFAULT_IS_AUTO_INSTALLED };
|
|
211
213
|
export { DEFAULT_TASK_SIMULATED_DURATION_MS };
|
212
214
|
export { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME };
|
213
215
|
export { DEFAULT_MAX_REQUESTS_PER_MINUTE };
|
216
|
+
export { API_REQUEST_TIMEOUT };
|
217
|
+
export { PROMPTBOOK_LOGO_URL };
|
214
218
|
export { MODEL_TRUST_LEVELS };
|
215
219
|
export { MODEL_ORDERS };
|
216
220
|
export { ORDER_OF_PIPELINE_JSON };
|
@@ -13,7 +13,11 @@ import type { RetrievalResult } from '../book-2.0/commitments/KNOWLEDGE/types';
|
|
13
13
|
import type { RAGConfig } from '../book-2.0/commitments/KNOWLEDGE/types';
|
14
14
|
import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChip';
|
15
15
|
import type { AvatarChipFromSourceProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
|
16
|
+
import type { AvatarProfileProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
|
17
|
+
import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
|
16
18
|
import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
|
19
|
+
import type { ChatMessage } from '../book-components/Chat/interfaces/ChatMessage';
|
20
|
+
import type { ChatParticipant } from '../book-components/Chat/interfaces/ChatParticipant';
|
17
21
|
import type { PipelineCollection } from '../collection/PipelineCollection';
|
18
22
|
import type { Command } from '../commands/_common/types/Command';
|
19
23
|
import type { CommandParser } from '../commands/_common/types/CommandParser';
|
@@ -334,7 +338,11 @@ export type { RetrievalResult };
|
|
334
338
|
export type { RAGConfig };
|
335
339
|
export type { AvatarChipProps };
|
336
340
|
export type { AvatarChipFromSourceProps };
|
341
|
+
export type { AvatarProfileProps };
|
342
|
+
export type { AvatarProfileFromSourceProps };
|
337
343
|
export type { BookEditorProps };
|
344
|
+
export type { ChatMessage };
|
345
|
+
export type { ChatParticipant };
|
338
346
|
export type { PipelineCollection };
|
339
347
|
export type { Command };
|
340
348
|
export type { CommandParser };
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import type { AgentBasicInformation } from '../../../book-2.0/agent-source/parseAgentSource';
|
2
|
+
import type { string_css_class } from '../../../types/typeAliases';
|
3
|
+
/**
|
4
|
+
* Props of `AvatarProfile`
|
5
|
+
*
|
6
|
+
* @public exported from `@promptbook/components`
|
7
|
+
*/
|
8
|
+
export type AvatarProfileProps = {
|
9
|
+
/**
|
10
|
+
* Agent to be shown
|
11
|
+
*/
|
12
|
+
readonly agent: AgentBasicInformation & {
|
13
|
+
agentTitle?: string;
|
14
|
+
agentDescription?: string;
|
15
|
+
};
|
16
|
+
/**
|
17
|
+
* Optional CSS class name which will be added to root <div> element
|
18
|
+
*/
|
19
|
+
readonly className?: string_css_class;
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
* Shows a box with user avatar, name and description
|
23
|
+
*
|
24
|
+
* @public exported from `@promptbook/components`
|
25
|
+
*/
|
26
|
+
export declare function AvatarProfile(props: AvatarProfileProps): import("react/jsx-runtime").JSX.Element;
|
package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource.d.ts
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
import type { string_book } from '../../../book-2.0/agent-source/string_book';
|
2
|
+
import type { AvatarProfileProps } from './AvatarProfile';
|
3
|
+
/**
|
4
|
+
* Props of `AvatarProfileFromSource`
|
5
|
+
*
|
6
|
+
* @public exported from `@promptbook/components`
|
7
|
+
*/
|
8
|
+
export type AvatarProfileFromSourceProps = Omit<AvatarProfileProps, 'agent'> & {
|
9
|
+
/**
|
10
|
+
* Agent source to be shown
|
11
|
+
*/
|
12
|
+
readonly agentSource: string_book;
|
13
|
+
};
|
14
|
+
/**
|
15
|
+
* Shows a box with user avatar, name and description from a string source
|
16
|
+
*
|
17
|
+
* @public exported from `@promptbook/components`
|
18
|
+
*/
|
19
|
+
export declare function AvatarProfileFromSource(props: AvatarProfileFromSourceProps): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
2
|
+
/**
|
3
|
+
* @private util of `<BookEditor />`
|
4
|
+
*/
|
5
|
+
export type BookEditorInnerProps = {
|
6
|
+
className?: string;
|
7
|
+
fontClassName?: string;
|
8
|
+
value?: string_book;
|
9
|
+
onChange?(value: string_book): void;
|
10
|
+
isVerbose?: boolean;
|
11
|
+
};
|
12
|
+
/**
|
13
|
+
* @private util of `<BookEditor />`
|
14
|
+
*/
|
15
|
+
export declare function BookEditorInner(props: BookEditorInnerProps): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,128 @@
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
2
|
+
import type { Promisable } from 'type-fest';
|
3
|
+
import type { ChatMessage } from '../interfaces/ChatMessage';
|
4
|
+
import type { ChatParticipant } from '../interfaces/ChatParticipant';
|
5
|
+
/**
|
6
|
+
* @deprecated use `isComplete` instead
|
7
|
+
* @private util of `<Chat />`
|
8
|
+
*/
|
9
|
+
export declare const LOADING_INTERACTIVE_IMAGE = "Loading...";
|
10
|
+
interface ChatProps {
|
11
|
+
/**
|
12
|
+
* Optional callback to create a new agent from the template.
|
13
|
+
* If provided, renders the [Use this template] button.
|
14
|
+
*/
|
15
|
+
onUseTemplate?(): void;
|
16
|
+
/**
|
17
|
+
* Messages to render - they are rendered as they are
|
18
|
+
*/
|
19
|
+
readonly messages: ReadonlyArray<ChatMessage>;
|
20
|
+
/**
|
21
|
+
* Called every time the user types or dictated a message
|
22
|
+
*/
|
23
|
+
onChange?(messageContent: string): void;
|
24
|
+
/**
|
25
|
+
* Called when user sends a message
|
26
|
+
*
|
27
|
+
* Note: You must handle the message yourself and add it to the `messages` array
|
28
|
+
*/
|
29
|
+
onMessage(messageContent: string): Promisable<void>;
|
30
|
+
/**
|
31
|
+
* Optional callback, when set, button for resetting chat will be shown
|
32
|
+
*/
|
33
|
+
onReset?(): Promisable<void>;
|
34
|
+
/**
|
35
|
+
* Determines whether the voice recognition button is rendered
|
36
|
+
*/
|
37
|
+
readonly isVoiceRecognitionButtonShown?: boolean;
|
38
|
+
/**
|
39
|
+
* The language code to use for voice recognition
|
40
|
+
*/
|
41
|
+
readonly voiceLanguage?: string;
|
42
|
+
/**
|
43
|
+
* Optional placeholder message for the textarea
|
44
|
+
*
|
45
|
+
* @default "Write a message"
|
46
|
+
*/
|
47
|
+
readonly placeholderMessageContent?: string;
|
48
|
+
/**
|
49
|
+
* Optional preset message in chat
|
50
|
+
*/
|
51
|
+
readonly defaultMessage?: string;
|
52
|
+
/**
|
53
|
+
* List of tasks that are currently in progress that should be displayed
|
54
|
+
*/
|
55
|
+
readonly tasksProgress?: Array<{
|
56
|
+
id: string;
|
57
|
+
name: string;
|
58
|
+
progress?: number;
|
59
|
+
}>;
|
60
|
+
/**
|
61
|
+
* Content to be shown inside the chat bar in head
|
62
|
+
* If not provided, the chat bar will not be rendered
|
63
|
+
*/
|
64
|
+
readonly children?: ReactNode;
|
65
|
+
/**
|
66
|
+
* Optional CSS class name which will be added to root <div/> element
|
67
|
+
*/
|
68
|
+
readonly className?: string;
|
69
|
+
/**
|
70
|
+
* Optional CSS style which will be added to root <div/> element
|
71
|
+
*/
|
72
|
+
readonly style?: CSSProperties;
|
73
|
+
/**
|
74
|
+
* Voice call props - when provided, voice call button will be shown
|
75
|
+
*/
|
76
|
+
readonly voiceCallProps?: {
|
77
|
+
selectedModel: string;
|
78
|
+
providerClients: Map<string, unknown>;
|
79
|
+
currentPersonaContent?: string;
|
80
|
+
onVoiceMessage?: (content: string, isVoiceCall: boolean) => void;
|
81
|
+
onAssistantVoiceResponse?: (content: string, isVoiceCall: boolean) => void;
|
82
|
+
onVoiceCallStateChange?: (isVoiceCalling: boolean) => void;
|
83
|
+
};
|
84
|
+
/**
|
85
|
+
* Indicates whether a voice call is currently active
|
86
|
+
*/
|
87
|
+
readonly isVoiceCalling?: boolean;
|
88
|
+
/**
|
89
|
+
* Whether experimental features are enabled (required for voice calling)
|
90
|
+
*/
|
91
|
+
readonly isExperimental?: boolean;
|
92
|
+
/**
|
93
|
+
* Whether the save button is enabled and shown
|
94
|
+
*/
|
95
|
+
readonly isSaveButtonEnabled?: boolean;
|
96
|
+
/**
|
97
|
+
* Optional markdown header to include at the top of exported files.
|
98
|
+
* Example: "## Discussion Topic\n\nSome topic here"
|
99
|
+
*/
|
100
|
+
readonly exportHeaderMarkdown?: string;
|
101
|
+
/**
|
102
|
+
* Optional mapping of participant IDs (message.from) to display metadata for exports.
|
103
|
+
* Keys should match ChatMessage.from values (e.g., 'USER', 'AGENT_{id}', etc.)
|
104
|
+
*/
|
105
|
+
readonly participants?: ReadonlyArray<ChatParticipant>;
|
106
|
+
}
|
107
|
+
/**
|
108
|
+
* Renders a chat with messages and input for new messages
|
109
|
+
*
|
110
|
+
* Note: 🔇 This component does NOT have speak functionality, it just allows to trigger voice recognition
|
111
|
+
*
|
112
|
+
* Note: There are multiple chat components:
|
113
|
+
* - <Chat/> renders chat as it is without any logic
|
114
|
+
* - <SimpleChat/> with callback function after each message 🔵->🟢->🔵->🟢->🔵->🟢->...
|
115
|
+
* - <WorkerChat/> with continuously running worker function on background which binds on dialogues queue 🔵->🟢->🔵->🟢->🔵->🟢->...
|
116
|
+
* - <SignalChat/> fully controlled by signal that is passed in 🔵->🟢->🟢->🟢->🔵->🟢->...
|
117
|
+
* - <LlmChat/> connected to LLM Execution Tools of Promptbook
|
118
|
+
* - <AgentChat/> direct OpenAI API integration with streaming responses and model selection
|
119
|
+
* - <ChatbotMiniapp/> Fully working chatbot miniapp created from book
|
120
|
+
* - <AssistantChatPage/> page for assistant chat with welcome message and avatar
|
121
|
+
* - <ModelAwareChat/> wrapper around <Chat/> that provides model-aware avatars
|
122
|
+
*
|
123
|
+
* Use <WorkerChat/> or <SignalChat/> in most cases.
|
124
|
+
*
|
125
|
+
* @public exported from `@promptbook/components`
|
126
|
+
*/
|
127
|
+
export declare function Chat(props: ChatProps): import("react/jsx-runtime").JSX.Element;
|
128
|
+
export {};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import type { string_markdown } from '../../../types/typeAliases';
|
2
|
+
import type { string_name } from '../../../types/typeAliases';
|
3
|
+
/**
|
4
|
+
* A message in the chat
|
5
|
+
*
|
6
|
+
* @public exported from `@promptbook/components`
|
7
|
+
*/
|
8
|
+
export type ChatMessage = {
|
9
|
+
id: string;
|
10
|
+
date: Date;
|
11
|
+
from: string_name;
|
12
|
+
content: string_markdown;
|
13
|
+
isComplete?: boolean;
|
14
|
+
expectedAnswer?: string;
|
15
|
+
isVoiceCall?: boolean;
|
16
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { string_name } from '../../../types/typeAliases';
|
2
|
+
import type { string_url_image } from '../../../types/typeAliases';
|
3
|
+
/**
|
4
|
+
* A participant in the chat
|
5
|
+
*
|
6
|
+
* @public exported from `@promptbook/components`
|
7
|
+
*/
|
8
|
+
export type ChatParticipant = {
|
9
|
+
name: string_name;
|
10
|
+
avatarUrl?: string_url_image;
|
11
|
+
color: string;
|
12
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { ChatMessage } from '../interfaces/ChatMessage';
|
2
|
+
import type { ExportFormat } from './ExportFormat';
|
3
|
+
/**
|
4
|
+
* Exports chat messages in the specified format
|
5
|
+
*
|
6
|
+
* @private utility of `<Chat/>` component
|
7
|
+
*/
|
8
|
+
export declare function exportChatHistory(messages: ChatMessage[], format: ExportFormat, headerMarkdown?: string, participants?: Record<string, {
|
9
|
+
name: string;
|
10
|
+
avatarUrl?: string;
|
11
|
+
}>): Promise<void>;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { ChatMessage } from '../interfaces/ChatMessage';
|
2
|
+
/**
|
3
|
+
* Generates PDF content using HTML and triggers print dialog
|
4
|
+
*
|
5
|
+
* @private utility of `<Chat/>` component
|
6
|
+
*/
|
7
|
+
export declare function generatePdfContent(messages: ChatMessage[], shareUrl: string, qrDataUrl?: string | null, headerMarkdown?: string, participants?: Record<string, {
|
8
|
+
name: string;
|
9
|
+
avatarUrl?: string;
|
10
|
+
}>): void;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { ChatMessage } from '../interfaces/ChatMessage';
|
2
|
+
/**
|
3
|
+
* Converts chat messages to HTML format
|
4
|
+
*
|
5
|
+
* @private utility of `<Chat/>` component
|
6
|
+
*/
|
7
|
+
export declare function messagesToHtml(messages: ChatMessage[], shareUrl: string, qrDataUrl?: string | null, headerMarkdown?: string, participants?: Record<string, {
|
8
|
+
name: string;
|
9
|
+
avatarUrl?: string;
|
10
|
+
}>): string;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { ChatMessage } from '../interfaces/ChatMessage';
|
2
|
+
/**
|
3
|
+
* Converts chat messages to Markdown format
|
4
|
+
*
|
5
|
+
* @private utility of `<Chat/>` component
|
6
|
+
*/
|
7
|
+
export declare function messagesToMarkdown(messages: ChatMessage[], shareUrl: string, qrDataUrl?: string | null, headerMarkdown?: string, participants?: Record<string, {
|
8
|
+
name: string;
|
9
|
+
avatarUrl?: string;
|
10
|
+
}>): string;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { ChatMessage } from '../interfaces/ChatMessage';
|
2
|
+
/**
|
3
|
+
* Converts chat messages to plain text format
|
4
|
+
*
|
5
|
+
* @private utility of `<Chat/>` component
|
6
|
+
*/
|
7
|
+
export declare function messagesToText(messages: ChatMessage[], shareUrl: string, headerMarkdown?: string, participants?: Record<string, {
|
8
|
+
name: string;
|
9
|
+
avatarUrl?: string;
|
10
|
+
}>): string;
|
@@ -301,6 +301,19 @@ export declare const DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME = "getPipelin
|
|
301
301
|
* @public exported from `@promptbook/core`
|
302
302
|
*/
|
303
303
|
export declare const DEFAULT_MAX_REQUESTS_PER_MINUTE = 60;
|
304
|
+
/**
|
305
|
+
* API request timeout in milliseconds
|
306
|
+
* Can be overridden via API_REQUEST_TIMEOUT environment variable
|
307
|
+
*
|
308
|
+
* @public exported from `@promptbook/core`
|
309
|
+
*/
|
310
|
+
export declare const API_REQUEST_TIMEOUT: number;
|
311
|
+
/**
|
312
|
+
* URL of the Promptbook logo
|
313
|
+
*
|
314
|
+
* @public exported from `@promptbook/core`
|
315
|
+
*/
|
316
|
+
export declare const PROMPTBOOK_LOGO_URL = "https://promptbook.studio/logos/logo-blue-white-256.png";
|
304
317
|
/**
|
305
318
|
* Indicates whether pipeline logic validation is enabled. When true, the pipeline logic is checked for consistency.
|
306
319
|
*
|
@@ -20,7 +20,8 @@ type CreateTaskOptions<TTaskResult extends AbstractTaskResult> = {
|
|
20
20
|
readonly title: AbstractTask<TTaskResult>['title'];
|
21
21
|
/**
|
22
22
|
* Callback that processes the task and updates the ongoing result
|
23
|
-
* @param
|
23
|
+
* @param updateOngoingResult Function to update the partial result of the task processing
|
24
|
+
* @param updateTldr Function to update tldr progress information
|
24
25
|
* @returns The final task result
|
25
26
|
*/
|
26
27
|
taskProcessCallback(updateOngoingResult: (newOngoingResult: PartialDeep<TTaskResult> & {
|
@@ -28,20 +29,10 @@ type CreateTaskOptions<TTaskResult extends AbstractTaskResult> = {
|
|
28
29
|
* Optional update of the task title
|
29
30
|
*/
|
30
31
|
readonly title?: AbstractTask<TTaskResult>['title'];
|
31
|
-
}) => void
|
32
|
-
/**
|
33
|
-
* Optional callback to provide custom tldr information
|
34
|
-
* @param createdAt When the task was created
|
35
|
-
* @param status Current task status
|
36
|
-
* @param currentValue Current partial result
|
37
|
-
* @param errors Current errors
|
38
|
-
* @param warnings Current warnings
|
39
|
-
* @returns Custom tldr information
|
40
|
-
*/
|
41
|
-
tldrProvider?(createdAt: Date, status: task_status, currentValue: PartialDeep<TTaskResult>, errors: Array<Error>, warnings: Array<Error>): {
|
32
|
+
}) => void, updateTldr: (tldrInfo: {
|
42
33
|
readonly percent: number_percent;
|
43
34
|
readonly message: string;
|
44
|
-
}
|
35
|
+
}) => void): Promise<TTaskResult>;
|
45
36
|
};
|
46
37
|
/**
|
47
38
|
* Helper to create a new task
|
@@ -119,6 +110,14 @@ export type AbstractTask<TTaskResult extends AbstractTaskResult> = {
|
|
119
110
|
* Gets a promise that resolves with the task result
|
120
111
|
*/
|
121
112
|
asPromise(options?: {
|
113
|
+
/**
|
114
|
+
* Do the task throws on error
|
115
|
+
*
|
116
|
+
* - If `true` when error occurs the returned promise will rejects
|
117
|
+
* - If `false` the promise will resolve with object with all listed errors and warnings and partial result
|
118
|
+
*
|
119
|
+
* @default true
|
120
|
+
*/
|
122
121
|
readonly isCrashedOnError?: boolean;
|
123
122
|
}): Promise<TTaskResult>;
|
124
123
|
/**
|
@@ -82,6 +82,14 @@ export declare abstract class OpenAiCompatibleExecutionTools implements LlmExecu
|
|
82
82
|
* Default model for completion variant.
|
83
83
|
*/
|
84
84
|
protected abstract getDefaultEmbeddingModel(): AvailableModel;
|
85
|
+
/**
|
86
|
+
* Makes a request with retry logic for network errors like ECONNRESET
|
87
|
+
*/
|
88
|
+
private makeRequestWithRetry;
|
89
|
+
/**
|
90
|
+
* Determines if an error is retryable (network-related errors)
|
91
|
+
*/
|
92
|
+
private isRetryableNetworkError;
|
85
93
|
}
|
86
94
|
/**
|
87
95
|
* TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import type { really_any } from './really_any';
|
2
|
+
/**
|
3
|
+
* Does nothing, but preserves the function in the bundle
|
4
|
+
* Compiler is tricked into thinking the function is used
|
5
|
+
*
|
6
|
+
* @param value any function to preserve
|
7
|
+
* @returns nothing
|
8
|
+
* @private within the repository
|
9
|
+
*/
|
10
|
+
export declare function $preserve(...value: Array<really_any>): void;
|
11
|
+
/**
|
12
|
+
* DO NOT USE THIS FUNCTION
|
13
|
+
* Only purpose of this function is to trick the compiler and javascript engine
|
14
|
+
* that `_preserved` array can be used in the future and should not be garbage collected
|
15
|
+
*
|
16
|
+
* @private internal for `preserve`
|
17
|
+
*/
|
18
|
+
export declare function __DO_NOT_USE_getPreserved(): Array<really_any>;
|
19
|
+
/**
|
20
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
21
|
+
*/
|
@@ -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-45`).
|
19
19
|
*
|
20
20
|
* @generated
|
21
21
|
*/
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@promptbook/wizard",
|
3
|
-
"version": "0.100.0-
|
3
|
+
"version": "0.100.0-46",
|
4
4
|
"description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
|
5
5
|
"private": false,
|
6
6
|
"sideEffects": false,
|
@@ -95,7 +95,7 @@
|
|
95
95
|
"module": "./esm/index.es.js",
|
96
96
|
"typings": "./esm/typings/src/_packages/wizard.index.d.ts",
|
97
97
|
"peerDependencies": {
|
98
|
-
"@promptbook/core": "0.100.0-
|
98
|
+
"@promptbook/core": "0.100.0-46"
|
99
99
|
},
|
100
100
|
"dependencies": {
|
101
101
|
"@ai-sdk/deepseek": "0.1.6",
|
@@ -113,7 +113,6 @@
|
|
113
113
|
"markitdown-ts": "0.0.4",
|
114
114
|
"openai": "4.63.0",
|
115
115
|
"papaparse": "5.4.1",
|
116
|
-
"prettier": "2.8.1",
|
117
116
|
"rxjs": "7.8.1",
|
118
117
|
"showdown": "2.1.0",
|
119
118
|
"socket.io-client": "4.7.2",
|