@promptbook/remote-server 0.14.0 → 0.16.0

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,3 +1,4 @@
1
+ import { ExecutionType } from './ExecutionTypes';
1
2
  import { string_name, string_title } from './typeAliases';
2
3
  /**
3
4
  * TaskProgress represents the progress of a PromptTemplatePipeline execution.
@@ -14,7 +15,7 @@ export interface TaskProgress {
14
15
  * Title of the task.
15
16
  *
16
17
  * Note: This is supposed to be displayed to the user.
17
- * Note: This is trimmed and stripped of HTML tags and emojis with "🖋" prefix
18
+ * Note: This is trimmed and stripped of HTML tags and emojis
18
19
  */
19
20
  readonly title: string_title;
20
21
  /**
@@ -25,6 +26,11 @@ export interface TaskProgress {
25
26
  * Is task done?
26
27
  */
27
28
  readonly isDone: boolean;
29
+ /**
30
+ * The type of the execution.
31
+ * Note: The Promptbook library reports everything, in the app level you can filter out the execution types that you don't want to show to the user.
32
+ */
33
+ readonly executionType: ExecutionType;
28
34
  /**
29
35
  * The parameter name that is being processed.
30
36
  */
@@ -1,3 +1,22 @@
1
+ /**
2
+ * Additional options for `unwrapResult`
3
+ */
4
+ interface UnwrapResultOptions {
5
+ /**
6
+ * If true, the text is trimmed before processing
7
+ */
8
+ isTrimmed?: boolean;
9
+ /**
10
+ * If true, the introduce sentence is removed
11
+ *
12
+ * For example:
13
+ * - If `true`> 'Hello, "world"' -> 'world'
14
+ * - If `false`> 'Hello, "world"' -> 'Hello, "world"'
15
+ *
16
+ * @default true
17
+ */
18
+ isIntroduceSentenceRemoved?: boolean;
19
+ }
1
20
  /**
2
21
  * Removes quotes and optional introduce text from a string
3
22
  *
@@ -10,4 +29,8 @@
10
29
  * @param text optionally quoted text
11
30
  * @returns text without quotes
12
31
  */
13
- export declare function unwrapResult(text: string): string;
32
+ export declare function unwrapResult(text: string, options?: UnwrapResultOptions): string;
33
+ export {};
34
+ /**
35
+ * TODO: [🧠] Should this also unwrap the (parenthesis)
36
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/remote-server",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "Library to supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -38,7 +38,7 @@
38
38
  "spacetrim": "0.9.2"
39
39
  },
40
40
  "peerDependencies": {
41
- "@promptbook/core": "0.14.0"
41
+ "@promptbook/core": "0.16.0"
42
42
  },
43
43
  "main": "./umd/index.umd.js",
44
44
  "module": "./esm/index.es.js",
@@ -1,3 +1,4 @@
1
+ import { ExecutionType } from './ExecutionTypes';
1
2
  import { string_name, string_title } from './typeAliases';
2
3
  /**
3
4
  * TaskProgress represents the progress of a PromptTemplatePipeline execution.
@@ -14,7 +15,7 @@ export interface TaskProgress {
14
15
  * Title of the task.
15
16
  *
16
17
  * Note: This is supposed to be displayed to the user.
17
- * Note: This is trimmed and stripped of HTML tags and emojis with "🖋" prefix
18
+ * Note: This is trimmed and stripped of HTML tags and emojis
18
19
  */
19
20
  readonly title: string_title;
20
21
  /**
@@ -25,6 +26,11 @@ export interface TaskProgress {
25
26
  * Is task done?
26
27
  */
27
28
  readonly isDone: boolean;
29
+ /**
30
+ * The type of the execution.
31
+ * Note: The Promptbook library reports everything, in the app level you can filter out the execution types that you don't want to show to the user.
32
+ */
33
+ readonly executionType: ExecutionType;
28
34
  /**
29
35
  * The parameter name that is being processed.
30
36
  */
@@ -1,3 +1,22 @@
1
+ /**
2
+ * Additional options for `unwrapResult`
3
+ */
4
+ interface UnwrapResultOptions {
5
+ /**
6
+ * If true, the text is trimmed before processing
7
+ */
8
+ isTrimmed?: boolean;
9
+ /**
10
+ * If true, the introduce sentence is removed
11
+ *
12
+ * For example:
13
+ * - If `true`> 'Hello, "world"' -> 'world'
14
+ * - If `false`> 'Hello, "world"' -> 'Hello, "world"'
15
+ *
16
+ * @default true
17
+ */
18
+ isIntroduceSentenceRemoved?: boolean;
19
+ }
1
20
  /**
2
21
  * Removes quotes and optional introduce text from a string
3
22
  *
@@ -10,4 +29,8 @@
10
29
  * @param text optionally quoted text
11
30
  * @returns text without quotes
12
31
  */
13
- export declare function unwrapResult(text: string): string;
32
+ export declare function unwrapResult(text: string, options?: UnwrapResultOptions): string;
33
+ export {};
34
+ /**
35
+ * TODO: [🧠] Should this also unwrap the (parenthesis)
36
+ */