@promptbook/remote-client 0.59.0-0 โ 0.59.0-1
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/README.md +1 -1
- package/esm/index.es.js +1 -1
- package/esm/typings/conversion/promptbookStringToJson.d.ts +12 -2
- package/esm/typings/knowledge/prepare-knowledge/markdown/playground/markdown-knowledge-playground.d.ts +2 -0
- package/esm/typings/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
- package/esm/typings/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +16 -0
- package/esm/typings/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts +1 -0
- package/esm/typings/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -0
- package/esm/typings/types/typeAliases.d.ts +7 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
- package/umd/typings/conversion/promptbookStringToJson.d.ts +12 -2
- package/umd/typings/knowledge/prepare-knowledge/markdown/playground/markdown-knowledge-playground.d.ts +2 -0
- package/umd/typings/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
- package/umd/typings/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +16 -0
- package/umd/typings/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts +1 -0
- package/umd/typings/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -0
- package/umd/typings/types/typeAliases.d.ts +7 -1
package/README.md
CHANGED
|
@@ -529,7 +529,7 @@ You can define postprocessing functions when creating `JavascriptEvalExecutionTo
|
|
|
529
529
|
|
|
530
530
|
```
|
|
531
531
|
|
|
532
|
-
Additionally there are some usefull string-manipulation build-in functions, which are [listed here](src/
|
|
532
|
+
Additionally there are some usefull string-manipulation build-in functions, which are [listed here](src/scripting/javascript/JavascriptEvalExecutionTools.ts).
|
|
533
533
|
|
|
534
534
|
### Expectations
|
|
535
535
|
|
package/esm/index.es.js
CHANGED
|
@@ -156,7 +156,7 @@ var RemoteLlmExecutionTools = /** @class */ (function () {
|
|
|
156
156
|
/**
|
|
157
157
|
* The version of the Promptbook library
|
|
158
158
|
*/
|
|
159
|
-
var PROMPTBOOK_VERSION = '0.
|
|
159
|
+
var PROMPTBOOK_VERSION = '0.59.0-0';
|
|
160
160
|
|
|
161
161
|
export { PROMPTBOOK_VERSION, RemoteLlmExecutionTools };
|
|
162
162
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
|
|
2
2
|
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
3
3
|
import type { PromptbookString } from '../types/PromptbookString';
|
|
4
|
+
/**
|
|
5
|
+
* Options for promptbookStringToJson
|
|
6
|
+
*/
|
|
7
|
+
type PromptbookStringToJsonOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Tools for processing required for knowledge processing *(not for actual execution)*
|
|
10
|
+
*/
|
|
11
|
+
llmTools?: LlmExecutionTools;
|
|
12
|
+
};
|
|
4
13
|
/**
|
|
5
14
|
* Compile promptbook from string (markdown) format to JSON format
|
|
6
15
|
*
|
|
7
16
|
* @param promptbookString {Promptbook} in string markdown format (.ptbk.md)
|
|
8
|
-
* @param
|
|
17
|
+
* @param options - Options and tools for the compilation
|
|
9
18
|
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
|
|
10
19
|
* @throws {PromptbookSyntaxError} if the promptbook string is not valid
|
|
11
20
|
*
|
|
12
21
|
* Note: This function does not validate logic of the pipeline only the syntax
|
|
13
22
|
* Note: This function acts as compilation process
|
|
14
23
|
*/
|
|
15
|
-
export declare function promptbookStringToJson(promptbookString: PromptbookString,
|
|
24
|
+
export declare function promptbookStringToJson(promptbookString: PromptbookString, options?: PromptbookStringToJsonOptions): Promise<PromptbookJson>;
|
|
25
|
+
export {};
|
|
16
26
|
/**
|
|
17
27
|
* TODO: Report here line/column of error
|
|
18
28
|
* TODO: Use spaceTrim more effectively
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { KnowledgeJson } from '../../../types/PromptbookJson/KnowledgeJson';
|
|
2
1
|
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
|
|
2
|
+
import type { KnowledgeJson } from '../../../types/PromptbookJson/KnowledgeJson';
|
|
3
3
|
import type { string_markdown } from '../../../types/typeAliases';
|
|
4
4
|
export declare function prepareKnowledgeFromMarkdown(options: {
|
|
5
5
|
content: string_markdown;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
|
|
2
|
+
import type { KnowledgeJson } from '../../../types/PromptbookJson/KnowledgeJson';
|
|
3
|
+
import type { string_base64 } from '../../../types/typeAliases';
|
|
4
|
+
type PrepareKnowledgeFromPdfOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* The source of the knowledge in PDF format
|
|
7
|
+
*/
|
|
8
|
+
content: string_base64;
|
|
9
|
+
llmTools: LlmExecutionTools;
|
|
10
|
+
};
|
|
11
|
+
export declare function prepareKnowledgeFromPdf(options: PrepareKnowledgeFromPdfOptions): Promise<KnowledgeJson>;
|
|
12
|
+
export {};
|
|
13
|
+
/**
|
|
14
|
+
* TODO: [๐งบ] In future, content can be alse File or Blob BUT for now for wider compatibility its only base64
|
|
15
|
+
* @see https://stackoverflow.com/questions/14653349/node-js-cant-create-blobs
|
|
16
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -37,6 +37,7 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
|
|
|
37
37
|
listModels(): Array<AvailableModel>;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
+
* TODO: !!!! [๐] JSON mode
|
|
40
41
|
* TODO: [๐ง ] Maybe handle errors via transformAnthropicError (like transformAzureError)
|
|
41
42
|
* TODO: Maybe Create some common util for gptChat and gptComplete
|
|
42
43
|
* TODO: Maybe make custom OpenaiError
|
|
@@ -193,7 +193,13 @@ export type string_promptbook_url_with_hashtemplate = string;
|
|
|
193
193
|
*
|
|
194
194
|
* For example `"data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=="`
|
|
195
195
|
*/
|
|
196
|
-
export type string_data_url =
|
|
196
|
+
export type string_data_url = `data:${string_mime_type};base64,${string_base64}`;
|
|
197
|
+
/**
|
|
198
|
+
* Semantic helper
|
|
199
|
+
*
|
|
200
|
+
* For example `"SGVsbG8sIFdvcmxkIQ=="`
|
|
201
|
+
*/
|
|
202
|
+
export type string_base64 = string;
|
|
197
203
|
/**
|
|
198
204
|
* Semantic helper
|
|
199
205
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-client",
|
|
3
|
-
"version": "0.59.0-
|
|
3
|
+
"version": "0.59.0-1",
|
|
4
4
|
"description": "Library to supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
],
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@promptbook/core": "0.59.0-
|
|
50
|
+
"@promptbook/core": "0.59.0-1"
|
|
51
51
|
},
|
|
52
52
|
"main": "./umd/index.umd.js",
|
|
53
53
|
"module": "./esm/index.es.js",
|
package/umd/index.umd.js
CHANGED
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
/**
|
|
161
161
|
* The version of the Promptbook library
|
|
162
162
|
*/
|
|
163
|
-
var PROMPTBOOK_VERSION = '0.
|
|
163
|
+
var PROMPTBOOK_VERSION = '0.59.0-0';
|
|
164
164
|
|
|
165
165
|
exports.PROMPTBOOK_VERSION = PROMPTBOOK_VERSION;
|
|
166
166
|
exports.RemoteLlmExecutionTools = RemoteLlmExecutionTools;
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
|
|
2
2
|
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
3
3
|
import type { PromptbookString } from '../types/PromptbookString';
|
|
4
|
+
/**
|
|
5
|
+
* Options for promptbookStringToJson
|
|
6
|
+
*/
|
|
7
|
+
type PromptbookStringToJsonOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Tools for processing required for knowledge processing *(not for actual execution)*
|
|
10
|
+
*/
|
|
11
|
+
llmTools?: LlmExecutionTools;
|
|
12
|
+
};
|
|
4
13
|
/**
|
|
5
14
|
* Compile promptbook from string (markdown) format to JSON format
|
|
6
15
|
*
|
|
7
16
|
* @param promptbookString {Promptbook} in string markdown format (.ptbk.md)
|
|
8
|
-
* @param
|
|
17
|
+
* @param options - Options and tools for the compilation
|
|
9
18
|
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
|
|
10
19
|
* @throws {PromptbookSyntaxError} if the promptbook string is not valid
|
|
11
20
|
*
|
|
12
21
|
* Note: This function does not validate logic of the pipeline only the syntax
|
|
13
22
|
* Note: This function acts as compilation process
|
|
14
23
|
*/
|
|
15
|
-
export declare function promptbookStringToJson(promptbookString: PromptbookString,
|
|
24
|
+
export declare function promptbookStringToJson(promptbookString: PromptbookString, options?: PromptbookStringToJsonOptions): Promise<PromptbookJson>;
|
|
25
|
+
export {};
|
|
16
26
|
/**
|
|
17
27
|
* TODO: Report here line/column of error
|
|
18
28
|
* TODO: Use spaceTrim more effectively
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { KnowledgeJson } from '../../../types/PromptbookJson/KnowledgeJson';
|
|
2
1
|
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
|
|
2
|
+
import type { KnowledgeJson } from '../../../types/PromptbookJson/KnowledgeJson';
|
|
3
3
|
import type { string_markdown } from '../../../types/typeAliases';
|
|
4
4
|
export declare function prepareKnowledgeFromMarkdown(options: {
|
|
5
5
|
content: string_markdown;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
|
|
2
|
+
import type { KnowledgeJson } from '../../../types/PromptbookJson/KnowledgeJson';
|
|
3
|
+
import type { string_base64 } from '../../../types/typeAliases';
|
|
4
|
+
type PrepareKnowledgeFromPdfOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* The source of the knowledge in PDF format
|
|
7
|
+
*/
|
|
8
|
+
content: string_base64;
|
|
9
|
+
llmTools: LlmExecutionTools;
|
|
10
|
+
};
|
|
11
|
+
export declare function prepareKnowledgeFromPdf(options: PrepareKnowledgeFromPdfOptions): Promise<KnowledgeJson>;
|
|
12
|
+
export {};
|
|
13
|
+
/**
|
|
14
|
+
* TODO: [๐งบ] In future, content can be alse File or Blob BUT for now for wider compatibility its only base64
|
|
15
|
+
* @see https://stackoverflow.com/questions/14653349/node-js-cant-create-blobs
|
|
16
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -37,6 +37,7 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
|
|
|
37
37
|
listModels(): Array<AvailableModel>;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
+
* TODO: !!!! [๐] JSON mode
|
|
40
41
|
* TODO: [๐ง ] Maybe handle errors via transformAnthropicError (like transformAzureError)
|
|
41
42
|
* TODO: Maybe Create some common util for gptChat and gptComplete
|
|
42
43
|
* TODO: Maybe make custom OpenaiError
|
|
@@ -193,7 +193,13 @@ export type string_promptbook_url_with_hashtemplate = string;
|
|
|
193
193
|
*
|
|
194
194
|
* For example `"data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=="`
|
|
195
195
|
*/
|
|
196
|
-
export type string_data_url =
|
|
196
|
+
export type string_data_url = `data:${string_mime_type};base64,${string_base64}`;
|
|
197
|
+
/**
|
|
198
|
+
* Semantic helper
|
|
199
|
+
*
|
|
200
|
+
* For example `"SGVsbG8sIFdvcmxkIQ=="`
|
|
201
|
+
*/
|
|
202
|
+
export type string_base64 = string;
|
|
197
203
|
/**
|
|
198
204
|
* Semantic helper
|
|
199
205
|
*
|