@promptbook/remote-server 0.105.0-12 → 0.105.0-15
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 +52 -15
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +10 -0
- package/esm/typings/src/_packages/types.index.d.ts +4 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +2 -7
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +1 -6
- package/esm/typings/src/book-components/Chat/Chat/ClockIcon.d.ts +9 -0
- package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +10 -37
- package/esm/typings/src/book-components/Chat/utils/getToolCallChipletText.d.ts +2 -5
- package/esm/typings/src/book-components/Chat/utils/toolCallParsing.d.ts +41 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +1 -0
- package/esm/typings/src/commitments/USE_TIME/USE_TIME.d.ts +2 -0
- package/esm/typings/src/commitments/_base/formatOptionalInstructionBlock.d.ts +6 -0
- package/esm/typings/src/constants.d.ts +125 -0
- package/esm/typings/src/execution/PromptResult.d.ts +2 -19
- package/esm/typings/src/types/ToolCall.d.ts +37 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +3 -2
- package/umd/index.umd.js +56 -19
- package/umd/index.umd.js.map +1 -1
|
@@ -75,6 +75,11 @@ import { MODEL_TRUST_LEVELS } from '../constants';
|
|
|
75
75
|
import { MODEL_ORDERS } from '../constants';
|
|
76
76
|
import { ORDER_OF_PIPELINE_JSON } from '../constants';
|
|
77
77
|
import { RESERVED_PARAMETER_NAMES } from '../constants';
|
|
78
|
+
import { LIMITS } from '../constants';
|
|
79
|
+
import { TIME_INTERVALS } from '../constants';
|
|
80
|
+
import { NETWORK_LIMITS } from '../constants';
|
|
81
|
+
import { COLOR_CONSTANTS } from '../constants';
|
|
82
|
+
import { HTTP_STATUS_CODES } from '../constants';
|
|
78
83
|
import { compilePipeline } from '../conversion/compilePipeline';
|
|
79
84
|
import { parsePipeline } from '../conversion/parsePipeline';
|
|
80
85
|
import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
|
|
@@ -275,6 +280,11 @@ export { MODEL_TRUST_LEVELS };
|
|
|
275
280
|
export { MODEL_ORDERS };
|
|
276
281
|
export { ORDER_OF_PIPELINE_JSON };
|
|
277
282
|
export { RESERVED_PARAMETER_NAMES };
|
|
283
|
+
export { LIMITS };
|
|
284
|
+
export { TIME_INTERVALS };
|
|
285
|
+
export { NETWORK_LIMITS };
|
|
286
|
+
export { COLOR_CONSTANTS };
|
|
287
|
+
export { HTTP_STATUS_CODES };
|
|
278
288
|
export { compilePipeline };
|
|
279
289
|
export { parsePipeline };
|
|
280
290
|
export { pipelineJsonToString };
|
|
@@ -17,6 +17,7 @@ import type { MockedChatDelayConfig } from '../book-components/Chat/MockedChat/M
|
|
|
17
17
|
import type { MockedChatProps } from '../book-components/Chat/MockedChat/MockedChat';
|
|
18
18
|
import type { ChatSaveFormatDefinition } from '../book-components/Chat/save/_common/ChatSaveFormatDefinition';
|
|
19
19
|
import type { string_chat_format_name } from '../book-components/Chat/save/_common/string_chat_format_name';
|
|
20
|
+
import type { ChatToolCall } from '../book-components/Chat/types/ChatMessage';
|
|
20
21
|
import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
|
|
21
22
|
import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
|
|
22
23
|
import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
|
|
@@ -213,6 +214,7 @@ import type { SpeechRecognitionStartOptions } from '../types/SpeechRecognition';
|
|
|
213
214
|
import type { SpeechRecognitionState } from '../types/SpeechRecognition';
|
|
214
215
|
import type { SpeechRecognitionEvent } from '../types/SpeechRecognition';
|
|
215
216
|
import type { TaskType } from '../types/TaskType';
|
|
217
|
+
import type { ToolCall } from '../types/ToolCall';
|
|
216
218
|
import type { string_char_emoji } from '../types/typeAliasEmoji';
|
|
217
219
|
import type { string_business_category_name } from '../types/typeAliases';
|
|
218
220
|
import type { string_model_name } from '../types/typeAliases';
|
|
@@ -397,6 +399,7 @@ export type { MockedChatDelayConfig };
|
|
|
397
399
|
export type { MockedChatProps };
|
|
398
400
|
export type { ChatSaveFormatDefinition };
|
|
399
401
|
export type { string_chat_format_name };
|
|
402
|
+
export type { ChatToolCall };
|
|
400
403
|
export type { ChatMessage };
|
|
401
404
|
export type { ChatParticipant };
|
|
402
405
|
export type { MessageButton };
|
|
@@ -593,6 +596,7 @@ export type { SpeechRecognitionStartOptions };
|
|
|
593
596
|
export type { SpeechRecognitionState };
|
|
594
597
|
export type { SpeechRecognitionEvent };
|
|
595
598
|
export type { TaskType };
|
|
599
|
+
export type { ToolCall };
|
|
596
600
|
export type { string_char_emoji };
|
|
597
601
|
export type { string_business_category_name };
|
|
598
602
|
export type { string_model_name };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { id } from '../../../types/typeAliases';
|
|
3
|
-
import type { TODO_any } from '../../../utils/organization/TODO_any';
|
|
4
3
|
import type { ChatMessage } from '../types/ChatMessage';
|
|
5
4
|
import type { ChatParticipant } from '../types/ChatParticipant';
|
|
6
5
|
import type { ChatProps } from './ChatProps';
|
|
@@ -42,16 +41,12 @@ type ChatMessageItemProps = Pick<ChatProps, 'onMessage' | 'participants'> & {
|
|
|
42
41
|
/**
|
|
43
42
|
* Called when a tool call chiplet is clicked.
|
|
44
43
|
*/
|
|
45
|
-
onToolCallClick?: (toolCall:
|
|
46
|
-
name: string;
|
|
47
|
-
arguments?: TODO_any;
|
|
48
|
-
result?: TODO_any;
|
|
49
|
-
}) => void;
|
|
44
|
+
onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
|
|
50
45
|
};
|
|
51
46
|
/**
|
|
52
47
|
* Renders a single chat message item with avatar, content, buttons, and rating.
|
|
53
48
|
*
|
|
54
49
|
* @private internal subcomponent of `<Chat>` component
|
|
55
50
|
*/
|
|
56
|
-
export declare const ChatMessageItem: import("react").MemoExoticComponent<(
|
|
51
|
+
export declare const ChatMessageItem: import("react").MemoExoticComponent<(props: ChatMessageItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
57
52
|
export {};
|
|
@@ -3,7 +3,6 @@ import type { Promisable } from 'type-fest';
|
|
|
3
3
|
import { Color } from '../../../_packages/color.index';
|
|
4
4
|
import { SpeechRecognition } from '../../../types/SpeechRecognition';
|
|
5
5
|
import { string_color } from '../../../types/typeAliases';
|
|
6
|
-
import type { TODO_any } from '../../../utils/organization/TODO_any';
|
|
7
6
|
import type { string_chat_format_name } from '../save/_common/string_chat_format_name';
|
|
8
7
|
import type { ChatMessage } from '../types/ChatMessage';
|
|
9
8
|
import type { ChatParticipant } from '../types/ChatParticipant';
|
|
@@ -198,11 +197,7 @@ export type ChatProps = {
|
|
|
198
197
|
/**
|
|
199
198
|
* Called when a tool call chiplet is clicked.
|
|
200
199
|
*/
|
|
201
|
-
onToolCallClick?: (toolCall:
|
|
202
|
-
name: string;
|
|
203
|
-
arguments?: TODO_any;
|
|
204
|
-
result?: TODO_any;
|
|
205
|
-
}) => void;
|
|
200
|
+
onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
|
|
206
201
|
/**
|
|
207
202
|
* Visual style of the chat component
|
|
208
203
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Message } from '../../../types/Message';
|
|
2
|
+
import type { ToolCall } from '../../../types/ToolCall';
|
|
2
3
|
import type { id, string_markdown } from '../../../types/typeAliases';
|
|
3
|
-
|
|
4
|
+
export type ChatToolCall = ToolCall;
|
|
4
5
|
/**
|
|
5
6
|
* Represents a single message within a chat interface.
|
|
6
7
|
*
|
|
@@ -37,45 +38,17 @@ export type ChatMessage = Omit<Message<id>, 'direction' | 'recipients' | 'thread
|
|
|
37
38
|
/**
|
|
38
39
|
* Optional tool calls made during the execution
|
|
39
40
|
*/
|
|
40
|
-
readonly ongoingToolCalls?: ReadonlyArray<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Arguments for the tool call
|
|
47
|
-
*/
|
|
48
|
-
readonly arguments?: string | Record<string, TODO_any>;
|
|
49
|
-
/**
|
|
50
|
-
* Result of the tool call
|
|
51
|
-
*/
|
|
52
|
-
readonly result?: TODO_any;
|
|
53
|
-
/**
|
|
54
|
-
* Raw tool call from the model
|
|
55
|
-
*/
|
|
56
|
-
readonly rawToolCall?: TODO_any;
|
|
57
|
-
}>;
|
|
41
|
+
readonly ongoingToolCalls?: ReadonlyArray<ChatToolCall>;
|
|
42
|
+
/**
|
|
43
|
+
* Optional tool calls used to produce this message.
|
|
44
|
+
*/
|
|
45
|
+
readonly toolCalls?: ReadonlyArray<ChatToolCall>;
|
|
58
46
|
/**
|
|
59
47
|
* Optional tool calls that have been completed
|
|
48
|
+
*
|
|
49
|
+
* @deprecated Use `toolCalls` instead.
|
|
60
50
|
*/
|
|
61
|
-
readonly completedToolCalls?: ReadonlyArray<
|
|
62
|
-
/**
|
|
63
|
-
* Name of the tool
|
|
64
|
-
*/
|
|
65
|
-
readonly name: string;
|
|
66
|
-
/**
|
|
67
|
-
* Arguments for the tool call
|
|
68
|
-
*/
|
|
69
|
-
readonly arguments?: string | Record<string, TODO_any>;
|
|
70
|
-
/**
|
|
71
|
-
* Result of the tool call
|
|
72
|
-
*/
|
|
73
|
-
readonly result?: TODO_any;
|
|
74
|
-
/**
|
|
75
|
-
* Raw tool call from the model
|
|
76
|
-
*/
|
|
77
|
-
readonly rawToolCall?: TODO_any;
|
|
78
|
-
}>;
|
|
51
|
+
readonly completedToolCalls?: ReadonlyArray<ChatToolCall>;
|
|
79
52
|
/**
|
|
80
53
|
* Optional file attachments
|
|
81
54
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToolCall } from '../../../types/ToolCall';
|
|
2
2
|
/**
|
|
3
3
|
* Utility to format tool call information for user-friendly display.
|
|
4
4
|
*/
|
|
@@ -16,7 +16,4 @@ export declare const TOOL_TITLES: Record<string, {
|
|
|
16
16
|
*
|
|
17
17
|
* @private [🧠] Maybe public?
|
|
18
18
|
*/
|
|
19
|
-
export declare function getToolCallChipletText(toolCall:
|
|
20
|
-
name: string;
|
|
21
|
-
arguments?: string | Record<string, TODO_any>;
|
|
22
|
-
}): string;
|
|
19
|
+
export declare function getToolCallChipletText(toolCall: ToolCall): string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ToolCall } from '../../../types/ToolCall';
|
|
2
|
+
import type { TODO_any } from '../../../utils/organization/TODO_any';
|
|
3
|
+
/**
|
|
4
|
+
* @@@
|
|
5
|
+
*
|
|
6
|
+
* @private utility of `<Chat/>` component
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseToolCallArguments(toolCall: Pick<ToolCall, 'arguments'>): Record<string, TODO_any>;
|
|
9
|
+
/**
|
|
10
|
+
* @@@
|
|
11
|
+
*
|
|
12
|
+
* @private utility of `<Chat/>` component
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseToolCallResult(result: ToolCall['result']): TODO_any;
|
|
15
|
+
type SearchResultsExtraction = {
|
|
16
|
+
results: Array<TODO_any>;
|
|
17
|
+
rawText: string | null;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @@@
|
|
21
|
+
*
|
|
22
|
+
* @private utility of `<Chat/>` component
|
|
23
|
+
*/
|
|
24
|
+
export declare function extractSearchResults(resultRaw: TODO_any): SearchResultsExtraction;
|
|
25
|
+
/**
|
|
26
|
+
* @@@
|
|
27
|
+
*
|
|
28
|
+
* @private utility of `<Chat/>` component
|
|
29
|
+
*/
|
|
30
|
+
export declare function getToolCallTimestamp(toolCall: Pick<ToolCall, 'createdAt'>): Date | null;
|
|
31
|
+
/**
|
|
32
|
+
* @@@
|
|
33
|
+
*
|
|
34
|
+
* @private utility of `<Chat/>` component
|
|
35
|
+
*/
|
|
36
|
+
export declare function getToolCallResultDate(result: ToolCall['result']): Date | null;
|
|
37
|
+
export {};
|
|
38
|
+
/**
|
|
39
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
40
|
+
* <- TODO: But maybe split into multiple files later?
|
|
41
|
+
*/
|
|
@@ -21,6 +21,7 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
21
21
|
*/
|
|
22
22
|
export declare class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition<'USE SEARCH ENGINE'> {
|
|
23
23
|
constructor();
|
|
24
|
+
get requiresContent(): boolean;
|
|
24
25
|
/**
|
|
25
26
|
* Short one-line description of USE SEARCH ENGINE.
|
|
26
27
|
*/
|
|
@@ -11,12 +11,14 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
11
11
|
*
|
|
12
12
|
* ```book
|
|
13
13
|
* USE TIME
|
|
14
|
+
* USE TIME Prefer the user's local timezone.
|
|
14
15
|
* ```
|
|
15
16
|
*
|
|
16
17
|
* @private [🪔] Maybe export the commitments through some package
|
|
17
18
|
*/
|
|
18
19
|
export declare class UseTimeCommitmentDefinition extends BaseCommitmentDefinition<'USE TIME'> {
|
|
19
20
|
constructor();
|
|
21
|
+
get requiresContent(): boolean;
|
|
20
22
|
/**
|
|
21
23
|
* Short one-line description of USE TIME.
|
|
22
24
|
*/
|
|
@@ -71,6 +71,131 @@ export declare const RESERVED_PARAMETER_RESTRICTED: string;
|
|
|
71
71
|
* @public exported from `@promptbook/core`
|
|
72
72
|
*/
|
|
73
73
|
export declare const RESERVED_PARAMETER_NAMES: readonly ["content", "context", "knowledge", "examples", "modelName", "currentDate"];
|
|
74
|
+
/**
|
|
75
|
+
* Limits for IDs, names, and other strings
|
|
76
|
+
*
|
|
77
|
+
* @public exported from `@promptbook/core`
|
|
78
|
+
*/
|
|
79
|
+
export declare const LIMITS: {
|
|
80
|
+
/**
|
|
81
|
+
* Minimum length of a name (e.g. agent name, persona name)
|
|
82
|
+
*/
|
|
83
|
+
readonly NAME_MIN_LENGTH: 3;
|
|
84
|
+
/**
|
|
85
|
+
* Recommended maximum length of a name
|
|
86
|
+
*/
|
|
87
|
+
readonly NAME_MAX_LENGTH: 20;
|
|
88
|
+
/**
|
|
89
|
+
* Maximum length of a short description or a hash
|
|
90
|
+
*/
|
|
91
|
+
readonly SHORT_TEXT_MAX_LENGTH: 30;
|
|
92
|
+
/**
|
|
93
|
+
* Gone
|
|
94
|
+
*/
|
|
95
|
+
readonly GONE: 410;
|
|
96
|
+
/**
|
|
97
|
+
* Gateway timeout
|
|
98
|
+
*/
|
|
99
|
+
readonly GATEWAY_TIMEOUT: 504;
|
|
100
|
+
/**
|
|
101
|
+
* Too many requests
|
|
102
|
+
*/
|
|
103
|
+
readonly TOO_MANY_REQUESTS: 429;
|
|
104
|
+
/**
|
|
105
|
+
* Maximum length of a file path segment
|
|
106
|
+
*/
|
|
107
|
+
readonly FILE_PATH_SEGMENT_MAX_LENGTH: 8;
|
|
108
|
+
/**
|
|
109
|
+
* Default length of a short name (e.g. for default agent names)
|
|
110
|
+
*/
|
|
111
|
+
readonly SHORT_NAME_LENGTH: 6;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Common time intervals in milliseconds
|
|
115
|
+
*
|
|
116
|
+
* @public exported from `@promptbook/core`
|
|
117
|
+
*/
|
|
118
|
+
export declare const TIME_INTERVALS: {
|
|
119
|
+
/**
|
|
120
|
+
* One second in milliseconds
|
|
121
|
+
*/
|
|
122
|
+
readonly SECOND: 1000;
|
|
123
|
+
/**
|
|
124
|
+
* Two seconds in milliseconds
|
|
125
|
+
*/
|
|
126
|
+
readonly TWO_SECONDS: 2000;
|
|
127
|
+
/**
|
|
128
|
+
* One minute in milliseconds
|
|
129
|
+
*/
|
|
130
|
+
readonly MINUTE: 60000;
|
|
131
|
+
/**
|
|
132
|
+
* Thirty seconds in milliseconds
|
|
133
|
+
*/
|
|
134
|
+
readonly THIRTY_SECONDS: 30000;
|
|
135
|
+
/**
|
|
136
|
+
* Five seconds in milliseconds
|
|
137
|
+
*/
|
|
138
|
+
readonly FIVE_SECONDS: 5000;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Common ports and network limits
|
|
142
|
+
*
|
|
143
|
+
* @public exported from `@promptbook/core`
|
|
144
|
+
*/
|
|
145
|
+
export declare const NETWORK_LIMITS: {
|
|
146
|
+
/**
|
|
147
|
+
* Maximum valid port number
|
|
148
|
+
*/
|
|
149
|
+
readonly MAX_PORT: 65535;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Common color and image constants
|
|
153
|
+
*
|
|
154
|
+
* @public exported from `@promptbook/core`
|
|
155
|
+
*/
|
|
156
|
+
export declare const COLOR_CONSTANTS: {
|
|
157
|
+
/**
|
|
158
|
+
* Maximum value for a color channel (0-255)
|
|
159
|
+
*/
|
|
160
|
+
readonly MAX_CHANNEL_VALUE: 255;
|
|
161
|
+
/**
|
|
162
|
+
* Number of possible colors in 24-bit color (0xFFFFFF)
|
|
163
|
+
*/
|
|
164
|
+
readonly MAX_24BIT_COLOR: 16777215;
|
|
165
|
+
/**
|
|
166
|
+
* Base for hexadecimal strings
|
|
167
|
+
*/
|
|
168
|
+
readonly HEX_BASE: 16;
|
|
169
|
+
/**
|
|
170
|
+
* Length of a hex color without alpha (e.g. "FF0000")
|
|
171
|
+
*/
|
|
172
|
+
readonly HEX_COLOR_LENGTH: 6;
|
|
173
|
+
/**
|
|
174
|
+
* Full circle in degrees
|
|
175
|
+
*/
|
|
176
|
+
readonly FULL_CIRCLE_DEGREES: 360;
|
|
177
|
+
/**
|
|
178
|
+
* Half circle in degrees
|
|
179
|
+
*/
|
|
180
|
+
readonly HALF_CIRCLE_DEGREES: 180;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* HTTP Status Codes
|
|
184
|
+
*
|
|
185
|
+
* @public exported from `@promptbook/core`
|
|
186
|
+
*/
|
|
187
|
+
export declare const HTTP_STATUS_CODES: {
|
|
188
|
+
readonly OK: 200;
|
|
189
|
+
readonly CREATED: 201;
|
|
190
|
+
readonly BAD_REQUEST: 400;
|
|
191
|
+
readonly UNAUTHORIZED: 401;
|
|
192
|
+
readonly NOT_FOUND: 404;
|
|
193
|
+
readonly INTERNAL_SERVER_ERROR: 500;
|
|
194
|
+
readonly BAD_GATEWAY: 502;
|
|
195
|
+
readonly SERVICE_UNAVAILABLE: 503;
|
|
196
|
+
readonly GATEWAY_TIMEOUT: 504;
|
|
197
|
+
readonly TOO_MANY_REQUESTS: 429;
|
|
198
|
+
};
|
|
74
199
|
/**
|
|
75
200
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
76
201
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { ToolCall } from '../types/ToolCall';
|
|
1
2
|
import type { string_date_iso8601, string_model_name, string_prompt } from '../types/typeAliases';
|
|
2
|
-
import type { TODO_any } from '../utils/organization/TODO_any';
|
|
3
3
|
import type { TODO_object } from '../utils/organization/TODO_object';
|
|
4
4
|
import type { EmbeddingVector } from './EmbeddingVector';
|
|
5
5
|
import type { Usage } from './Usage';
|
|
@@ -26,24 +26,7 @@ export type ChatPromptResult = CommonPromptResult & {
|
|
|
26
26
|
/**
|
|
27
27
|
* Optional tool calls made during the execution
|
|
28
28
|
*/
|
|
29
|
-
readonly toolCalls?: ReadonlyArray<
|
|
30
|
-
/**
|
|
31
|
-
* Name of the tool
|
|
32
|
-
*/
|
|
33
|
-
readonly name: string;
|
|
34
|
-
/**
|
|
35
|
-
* Arguments of the tool call
|
|
36
|
-
*/
|
|
37
|
-
readonly arguments: string;
|
|
38
|
-
/**
|
|
39
|
-
* Result of the tool call
|
|
40
|
-
*/
|
|
41
|
-
readonly result: string;
|
|
42
|
-
/**
|
|
43
|
-
* Raw tool call from the model
|
|
44
|
-
*/
|
|
45
|
-
readonly rawToolCall: TODO_any;
|
|
46
|
-
}>;
|
|
29
|
+
readonly toolCalls?: ReadonlyArray<ToolCall>;
|
|
47
30
|
};
|
|
48
31
|
/**
|
|
49
32
|
* Image prompt result
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { string_date_iso8601 } from './typeAliases';
|
|
2
|
+
import type { TODO_any } from '../utils/organization/TODO_any';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a single tool call with its inputs, outputs, and timing.
|
|
5
|
+
*
|
|
6
|
+
* Note: This is fully serializable as JSON.
|
|
7
|
+
*/
|
|
8
|
+
export type ToolCall = {
|
|
9
|
+
/**
|
|
10
|
+
* Name of the tool.
|
|
11
|
+
*/
|
|
12
|
+
readonly name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Arguments for the tool call.
|
|
15
|
+
*/
|
|
16
|
+
readonly arguments?: string | Record<string, TODO_any>;
|
|
17
|
+
/**
|
|
18
|
+
* Result of the tool call.
|
|
19
|
+
*/
|
|
20
|
+
readonly result?: TODO_any;
|
|
21
|
+
/**
|
|
22
|
+
* Raw tool call payload from the model.
|
|
23
|
+
*/
|
|
24
|
+
readonly rawToolCall?: TODO_any;
|
|
25
|
+
/**
|
|
26
|
+
* Timestamp when the tool call was initiated.
|
|
27
|
+
*/
|
|
28
|
+
readonly createdAt?: string_date_iso8601;
|
|
29
|
+
/**
|
|
30
|
+
* Errors thrown during tool execution.
|
|
31
|
+
*/
|
|
32
|
+
readonly errors?: ReadonlyArray<TODO_any>;
|
|
33
|
+
/**
|
|
34
|
+
* Warnings reported during tool execution.
|
|
35
|
+
*/
|
|
36
|
+
readonly warnings?: ReadonlyArray<TODO_any>;
|
|
37
|
+
};
|
|
@@ -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.105.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.105.0-14`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-server",
|
|
3
|
-
"version": "0.105.0-
|
|
3
|
+
"version": "0.105.0-15",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
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/remote-server.index.d.ts",
|
|
97
97
|
"peerDependencies": {
|
|
98
|
-
"@promptbook/core": "0.105.0-
|
|
98
|
+
"@promptbook/core": "0.105.0-15"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
101
|
"colors": "1.4.0",
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"crypto-js": "4.2.0",
|
|
104
104
|
"express": "4.21.2",
|
|
105
105
|
"express-openapi-validator": "5.4.9",
|
|
106
|
+
"moment": "2.30.1",
|
|
106
107
|
"papaparse": "5.4.1",
|
|
107
108
|
"react": "18.2.0",
|
|
108
109
|
"rxjs": "7.8.2",
|
package/umd/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('path'), require('child_process'), require('colors'), require('spacetrim'), require('waitasecond'), require('express'), require('express-openapi-validator'), require('http'), require('socket.io'), require('swagger-ui-express'), require('crypto'), require('fs/promises'), require('rxjs'), require('crypto-js/enc-hex'), require('crypto-js/sha256'), require('crypto-js'), require('mime-types'), require('papaparse'), require('react'), require('react-dom/server')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'path', 'child_process', 'colors', 'spacetrim', 'waitasecond', 'express', 'express-openapi-validator', 'http', 'socket.io', 'swagger-ui-express', 'crypto', 'fs/promises', 'rxjs', 'crypto-js/enc-hex', 'crypto-js/sha256', 'crypto-js', 'mime-types', 'papaparse', 'react', 'react-dom/server'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-remote-server"] = {}, global.path, global.child_process, global.colors, global.spaceTrim$1, global.waitasecond, global.express, global.OpenApiValidator, global.http, global.socket_io, global.swaggerUi, global.crypto, global.promises, global.rxjs, global.hexEncoder, global.sha256, global.cryptoJs, global.mimeTypes, global.papaparse, global.react, global.server));
|
|
5
|
-
})(this, (function (exports, path, child_process, colors, spaceTrim$1, waitasecond, express, OpenApiValidator, http, socket_io, swaggerUi, crypto, promises, rxjs, hexEncoder, sha256, cryptoJs, mimeTypes, papaparse, react, server) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('path'), require('child_process'), require('colors'), require('spacetrim'), require('waitasecond'), require('express'), require('express-openapi-validator'), require('http'), require('socket.io'), require('swagger-ui-express'), require('crypto'), require('fs/promises'), require('rxjs'), require('crypto-js/enc-hex'), require('crypto-js/sha256'), require('crypto-js'), require('mime-types'), require('papaparse'), require('moment'), require('react'), require('react-dom/server')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'path', 'child_process', 'colors', 'spacetrim', 'waitasecond', 'express', 'express-openapi-validator', 'http', 'socket.io', 'swagger-ui-express', 'crypto', 'fs/promises', 'rxjs', 'crypto-js/enc-hex', 'crypto-js/sha256', 'crypto-js', 'mime-types', 'papaparse', 'moment', 'react', 'react-dom/server'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-remote-server"] = {}, global.path, global.child_process, global.colors, global.spaceTrim$1, global.waitasecond, global.express, global.OpenApiValidator, global.http, global.socket_io, global.swaggerUi, global.crypto, global.promises, global.rxjs, global.hexEncoder, global.sha256, global.cryptoJs, global.mimeTypes, global.papaparse, global.moment, global.react, global.server));
|
|
5
|
+
})(this, (function (exports, path, child_process, colors, spaceTrim$1, waitasecond, express, OpenApiValidator, http, socket_io, swaggerUi, crypto, promises, rxjs, hexEncoder, sha256, cryptoJs, mimeTypes, papaparse, moment, react, server) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
var swaggerUi__default = /*#__PURE__*/_interopDefaultLegacy(swaggerUi);
|
|
33
33
|
var hexEncoder__default = /*#__PURE__*/_interopDefaultLegacy(hexEncoder);
|
|
34
34
|
var sha256__default = /*#__PURE__*/_interopDefaultLegacy(sha256);
|
|
35
|
+
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
35
36
|
|
|
36
37
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
37
38
|
/**
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
* @generated
|
|
48
49
|
* @see https://github.com/webgptorg/promptbook
|
|
49
50
|
*/
|
|
50
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.105.0-
|
|
51
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.105.0-15';
|
|
51
52
|
/**
|
|
52
53
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
53
54
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -11769,6 +11770,25 @@
|
|
|
11769
11770
|
}
|
|
11770
11771
|
}
|
|
11771
11772
|
|
|
11773
|
+
/**
|
|
11774
|
+
* @@@
|
|
11775
|
+
*
|
|
11776
|
+
* @private utility for commitments
|
|
11777
|
+
*/
|
|
11778
|
+
function formatOptionalInstructionBlock(label, content) {
|
|
11779
|
+
const trimmedContent = spaceTrim$1.spaceTrim(content);
|
|
11780
|
+
if (!trimmedContent) {
|
|
11781
|
+
return '';
|
|
11782
|
+
}
|
|
11783
|
+
return spaceTrim$1.spaceTrim((block) => `
|
|
11784
|
+
- ${label}:
|
|
11785
|
+
${block(trimmedContent
|
|
11786
|
+
.split('\n')
|
|
11787
|
+
.map((line) => `- ${line}`)
|
|
11788
|
+
.join('\n'))}
|
|
11789
|
+
`);
|
|
11790
|
+
}
|
|
11791
|
+
|
|
11772
11792
|
/**
|
|
11773
11793
|
* USE SEARCH ENGINE commitment definition
|
|
11774
11794
|
*
|
|
@@ -11790,6 +11810,9 @@
|
|
|
11790
11810
|
constructor() {
|
|
11791
11811
|
super('USE SEARCH ENGINE', ['USE SEARCH']);
|
|
11792
11812
|
}
|
|
11813
|
+
get requiresContent() {
|
|
11814
|
+
return false;
|
|
11815
|
+
}
|
|
11793
11816
|
/**
|
|
11794
11817
|
* Short one-line description of USE SEARCH ENGINE.
|
|
11795
11818
|
*/
|
|
@@ -11838,6 +11861,7 @@
|
|
|
11838
11861
|
`);
|
|
11839
11862
|
}
|
|
11840
11863
|
applyToAgentModelRequirements(requirements, content) {
|
|
11864
|
+
const extraInstructions = formatOptionalInstructionBlock('Search instructions', content);
|
|
11841
11865
|
// Get existing tools array or create new one
|
|
11842
11866
|
const existingTools = requirements.tools || [];
|
|
11843
11867
|
// Add 'web_search' to tools if not already present
|
|
@@ -11896,13 +11920,14 @@
|
|
|
11896
11920
|
...requirements.metadata,
|
|
11897
11921
|
useSearchEngine: content || true,
|
|
11898
11922
|
},
|
|
11899
|
-
}, spaceTrim$1.spaceTrim(`
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11923
|
+
}, spaceTrim$1.spaceTrim((block) => `
|
|
11924
|
+
Tool:
|
|
11925
|
+
- You have access to the web search engine via the tool "web_search".
|
|
11926
|
+
- Use it to find up-to-date information or facts that you don't know.
|
|
11927
|
+
- When you need to know some information from the internet, use the tool provided to you.
|
|
11928
|
+
- Do not make up information when you can search for it.
|
|
11929
|
+
- Do not tell the user you cannot search for information, YOU CAN.
|
|
11930
|
+
${block(extraInstructions)}
|
|
11906
11931
|
`));
|
|
11907
11932
|
}
|
|
11908
11933
|
/**
|
|
@@ -11954,6 +11979,7 @@
|
|
|
11954
11979
|
*
|
|
11955
11980
|
* ```book
|
|
11956
11981
|
* USE TIME
|
|
11982
|
+
* USE TIME Prefer the user's local timezone.
|
|
11957
11983
|
* ```
|
|
11958
11984
|
*
|
|
11959
11985
|
* @private [🪔] Maybe export the commitments through some package
|
|
@@ -11962,6 +11988,9 @@
|
|
|
11962
11988
|
constructor() {
|
|
11963
11989
|
super('USE TIME', ['CURRENT TIME', 'TIME', 'DATE']);
|
|
11964
11990
|
}
|
|
11991
|
+
get requiresContent() {
|
|
11992
|
+
return false;
|
|
11993
|
+
}
|
|
11965
11994
|
/**
|
|
11966
11995
|
* Short one-line description of USE TIME.
|
|
11967
11996
|
*/
|
|
@@ -11988,6 +12017,7 @@
|
|
|
11988
12017
|
- This tool won't receive any input.
|
|
11989
12018
|
- It outputs the current date and time as an ISO 8601 string.
|
|
11990
12019
|
- Allows the agent to answer questions about the current time or date.
|
|
12020
|
+
- The content following \`USE TIME\` is an arbitrary text that the agent should know (e.g. timezone preference).
|
|
11991
12021
|
|
|
11992
12022
|
## Examples
|
|
11993
12023
|
|
|
@@ -11997,9 +12027,17 @@
|
|
|
11997
12027
|
PERSONA You are a helpful assistant who knows the current time.
|
|
11998
12028
|
USE TIME
|
|
11999
12029
|
\`\`\`
|
|
12030
|
+
|
|
12031
|
+
\`\`\`book
|
|
12032
|
+
Travel Assistant
|
|
12033
|
+
|
|
12034
|
+
PERSONA You help travelers with planning.
|
|
12035
|
+
USE TIME Prefer the user's local timezone.
|
|
12036
|
+
\`\`\`
|
|
12000
12037
|
`);
|
|
12001
12038
|
}
|
|
12002
12039
|
applyToAgentModelRequirements(requirements, content) {
|
|
12040
|
+
const extraInstructions = formatOptionalInstructionBlock('Time instructions', content);
|
|
12003
12041
|
// Get existing tools array or create new one
|
|
12004
12042
|
const existingTools = requirements.tools || [];
|
|
12005
12043
|
// Add 'get_current_time' to tools if not already present
|
|
@@ -12030,13 +12068,12 @@
|
|
|
12030
12068
|
metadata: {
|
|
12031
12069
|
...requirements.metadata,
|
|
12032
12070
|
},
|
|
12033
|
-
}, spaceTrim$1.spaceTrim(`
|
|
12034
|
-
|
|
12035
|
-
|
|
12036
|
-
|
|
12037
|
-
|
|
12038
|
-
|
|
12039
|
-
`));
|
|
12071
|
+
}, spaceTrim$1.spaceTrim((block) => `
|
|
12072
|
+
Time and date context:
|
|
12073
|
+
- It is ${moment__default["default"]().format('MMMM YYYY')} now.
|
|
12074
|
+
- If you need more precise current time information, use the tool "get_current_time".
|
|
12075
|
+
${block(extraInstructions)}
|
|
12076
|
+
`));
|
|
12040
12077
|
}
|
|
12041
12078
|
/**
|
|
12042
12079
|
* Gets human-readable titles for tool functions provided by this commitment.
|