@promptbook/openai 0.35.0 → 0.36.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 +10 -10
- package/esm/index.es.js.map +1 -1
- package/esm/typings/_packages/core.index.d.ts +8 -8
- package/esm/typings/_packages/remote-server.index.d.ts +2 -2
- package/esm/typings/_packages/types.index.d.ts +8 -8
- package/esm/typings/classes/PromptbookLibrary.d.ts +61 -0
- package/esm/typings/conversion/_importPromptbook.d.ts +12 -0
- package/esm/typings/conversion/promptbookStringToJson.d.ts +13 -0
- package/esm/typings/conversion/validatePromptbookJson.d.ts +26 -0
- package/{umd/typings/execution/PtpExecutor.d.ts → esm/typings/execution/PromptbookExecutor.d.ts} +5 -5
- package/esm/typings/execution/assertsExecutionSuccessful.d.ts +2 -2
- package/esm/typings/execution/createPromptbookExecutor.d.ts +40 -0
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +1 -1
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +1 -1
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +1 -1
- package/esm/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Error.d.ts → Promptbook_Server_Error.d.ts} +1 -1
- package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Progress.d.ts → Promptbook_Server_Progress.d.ts} +1 -1
- package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Request.d.ts → Promptbook_Server_Request.d.ts} +2 -2
- package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Response.d.ts → Promptbook_Server_Response.d.ts} +2 -2
- package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +3 -3
- package/{umd/typings/execution/plugins/natural-execution-tools/remote/runRemoteServer.d.ts → esm/typings/execution/plugins/natural-execution-tools/remote/startRemoteServer.d.ts} +2 -2
- package/esm/typings/types/Command.d.ts +12 -12
- package/esm/typings/types/Parameters.d.ts +3 -3
- package/esm/typings/types/Prompt.d.ts +5 -5
- package/{umd/typings/types/PromptTemplatePipelineJson → esm/typings/types/PromptbookJson}/PromptTemplateJson.d.ts +4 -4
- package/esm/typings/types/{PromptTemplatePipelineJson → PromptbookJson}/PromptTemplateParameterJson.d.ts +2 -2
- package/{umd/typings/types/PromptTemplatePipelineJson/PromptTemplatePipelineJson.d.ts → esm/typings/types/PromptbookJson/PromptbookJson.d.ts} +11 -15
- package/esm/typings/types/PromptbookString.d.ts +12 -0
- package/esm/typings/types/TaskProgress.d.ts +1 -1
- package/esm/typings/types/execution-report/ExecutionReportJson.d.ts +10 -10
- package/esm/typings/types/typeAliases.d.ts +4 -4
- package/esm/typings/utils/expectation-counters/countCharacters.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/countLines.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/countPages.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/countParagraphs.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/countSentences.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/countWords.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/index.d.ts +1 -1
- package/esm/typings/utils/isRunningInWhatever.d.ts +12 -0
- package/esm/typings/utils/markdown/addAutoGeneratedSection.d.ts +10 -0
- package/esm/typings/utils/markdown/createMarkdownChart.d.ts +4 -0
- package/esm/typings/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +10 -10
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/_packages/core.index.d.ts +8 -8
- package/umd/typings/_packages/remote-server.index.d.ts +2 -2
- package/umd/typings/_packages/types.index.d.ts +8 -8
- package/umd/typings/classes/PromptbookLibrary.d.ts +61 -0
- package/umd/typings/conversion/_importPromptbook.d.ts +12 -0
- package/umd/typings/conversion/promptbookStringToJson.d.ts +13 -0
- package/umd/typings/conversion/validatePromptbookJson.d.ts +26 -0
- package/umd/typings/conversion/validatePromptbookJson.test.d.ts +1 -0
- package/{esm/typings/execution/PtpExecutor.d.ts → umd/typings/execution/PromptbookExecutor.d.ts} +5 -5
- package/umd/typings/execution/assertsExecutionSuccessful.d.ts +2 -2
- package/umd/typings/execution/createPromptbookExecutor.d.ts +40 -0
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +1 -1
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +1 -1
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +1 -1
- package/umd/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +1 -1
- package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Error.d.ts → Promptbook_Server_Error.d.ts} +1 -1
- package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Progress.d.ts → Promptbook_Server_Progress.d.ts} +1 -1
- package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Request.d.ts → Promptbook_Server_Request.d.ts} +2 -2
- package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Response.d.ts → Promptbook_Server_Response.d.ts} +2 -2
- package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +3 -3
- package/{esm/typings/execution/plugins/natural-execution-tools/remote/runRemoteServer.d.ts → umd/typings/execution/plugins/natural-execution-tools/remote/startRemoteServer.d.ts} +2 -2
- package/umd/typings/types/Command.d.ts +12 -12
- package/umd/typings/types/Parameters.d.ts +3 -3
- package/umd/typings/types/Prompt.d.ts +5 -5
- package/{esm/typings/types/PromptTemplatePipelineJson → umd/typings/types/PromptbookJson}/PromptTemplateJson.d.ts +4 -4
- package/umd/typings/types/{PromptTemplatePipelineJson → PromptbookJson}/PromptTemplateParameterJson.d.ts +2 -2
- package/{esm/typings/types/PromptTemplatePipelineJson/PromptTemplatePipelineJson.d.ts → umd/typings/types/PromptbookJson/PromptbookJson.d.ts} +11 -15
- package/umd/typings/types/PromptbookString.d.ts +12 -0
- package/umd/typings/types/TaskProgress.d.ts +1 -1
- package/umd/typings/types/execution-report/ExecutionReportJson.d.ts +10 -10
- package/umd/typings/types/typeAliases.d.ts +4 -4
- package/umd/typings/utils/expectation-counters/countCharacters.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/countLines.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/countPages.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/countParagraphs.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/countSentences.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/countWords.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/index.d.ts +1 -1
- package/umd/typings/utils/isRunningInWhatever.d.ts +12 -0
- package/umd/typings/utils/markdown/addAutoGeneratedSection.d.ts +10 -0
- package/umd/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
- package/umd/typings/utils/markdown/createMarkdownChart.d.ts +4 -0
- package/umd/typings/version.d.ts +1 -1
- package/esm/typings/classes/PromptTemplatePipelineLibrary.d.ts +0 -71
- package/esm/typings/config.d.ts +0 -12
- package/esm/typings/conversion/_importPtp.d.ts +0 -12
- package/esm/typings/conversion/promptTemplatePipelineStringToJson.d.ts +0 -13
- package/esm/typings/conversion/validatePromptTemplatePipelineJson.d.ts +0 -26
- package/esm/typings/execution/createPtpExecutor.d.ts +0 -40
- package/esm/typings/types/PromptTemplatePipelineString.d.ts +0 -16
- package/umd/typings/classes/PromptTemplatePipelineLibrary.d.ts +0 -71
- package/umd/typings/config.d.ts +0 -12
- package/umd/typings/conversion/_importPtp.d.ts +0 -12
- package/umd/typings/conversion/promptTemplatePipelineStringToJson.d.ts +0 -13
- package/umd/typings/conversion/validatePromptTemplatePipelineJson.d.ts +0 -26
- package/umd/typings/execution/createPtpExecutor.d.ts +0 -40
- package/umd/typings/types/PromptTemplatePipelineString.d.ts +0 -16
- /package/esm/typings/conversion/{promptTemplatePipelineStringToJson-syntaxErrors.test.d.ts → promptbookStringToJson-syntaxErrors.test.d.ts} +0 -0
- /package/esm/typings/conversion/{promptTemplatePipelineStringToJson.test.d.ts → promptbookStringToJson.test.d.ts} +0 -0
- /package/esm/typings/conversion/{validatePromptTemplatePipelineJson-logicErrors.test.d.ts → validatePromptbookJson-logicErrors.test.d.ts} +0 -0
- /package/esm/typings/conversion/{validatePromptTemplatePipelineJson.test.d.ts → validatePromptbookJson.test.d.ts} +0 -0
- /package/{umd/typings/conversion/promptTemplatePipelineStringToJson-syntaxErrors.test.d.ts → esm/typings/utils/markdown/addAutoGeneratedSection.test.d.ts} +0 -0
- /package/umd/typings/conversion/{promptTemplatePipelineStringToJson.test.d.ts → promptbookStringToJson-syntaxErrors.test.d.ts} +0 -0
- /package/umd/typings/conversion/{validatePromptTemplatePipelineJson-logicErrors.test.d.ts → promptbookStringToJson.test.d.ts} +0 -0
- /package/umd/typings/conversion/{validatePromptTemplatePipelineJson.test.d.ts → validatePromptbookJson-logicErrors.test.d.ts} +0 -0
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import type { string_markdown_text, string_name, string_version } from '.././types/typeAliases';
|
|
2
2
|
import type { ExecutionType } from './ExecutionTypes';
|
|
3
3
|
import type { ModelRequirements } from './ModelRequirements';
|
|
4
|
-
import type { ExpectationAmount, ExpectationUnit } from './
|
|
4
|
+
import type { ExpectationAmount, ExpectationUnit } from './PromptbookJson/PromptTemplateJson';
|
|
5
5
|
/**
|
|
6
6
|
* Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.
|
|
7
7
|
* It is parsed from the markdown from ul/ol items - one command per one item.
|
|
8
8
|
*/
|
|
9
|
-
export type Command =
|
|
9
|
+
export type Command = PromptbookUrlCommand | PromptbookVersionCommand | ExecuteCommand | ModelCommand | JokerCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* PromptbookVersion command tells which version is .promptbook file using
|
|
12
12
|
*
|
|
13
13
|
* - It is used for backward compatibility
|
|
14
|
-
* - It is defined per whole .
|
|
14
|
+
* - It is defined per whole .promptbook file in the header
|
|
15
15
|
*/
|
|
16
|
-
export interface
|
|
17
|
-
readonly type: '
|
|
18
|
-
readonly
|
|
16
|
+
export interface PromptbookUrlCommand {
|
|
17
|
+
readonly type: 'PROMPTBOOK_URL';
|
|
18
|
+
readonly promptbookUrl: URL;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* PromptbookVersion command tells which version is .promptbook file using
|
|
22
22
|
*
|
|
23
23
|
* - It is used for backward compatibility
|
|
24
|
-
* - It is defined per whole .
|
|
24
|
+
* - It is defined per whole .promptbook file in the header
|
|
25
25
|
*/
|
|
26
|
-
export interface
|
|
27
|
-
readonly type: '
|
|
28
|
-
readonly
|
|
26
|
+
export interface PromptbookVersionCommand {
|
|
27
|
+
readonly type: 'PROMPTBOOK_VERSION';
|
|
28
|
+
readonly promptbookVersion: string_version;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Execute command tells how to execute the section
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Parameters of the prompt template (pipeline)
|
|
3
3
|
*
|
|
4
4
|
* There are three types of parameters:
|
|
5
|
-
* - **INPUT
|
|
6
|
-
* - **Intermediate parameters** are used internally in the
|
|
7
|
-
* - **OUTPUT PARAMETERs** are not used internally in the
|
|
5
|
+
* - **INPUT PARAMETERs** are required to execute the pipeline.
|
|
6
|
+
* - **Intermediate parameters** are used internally in the pipeline.
|
|
7
|
+
* - **OUTPUT PARAMETERs** are not used internally in the pipeline, but are returned as the result of the pipeline execution.
|
|
8
8
|
*
|
|
9
9
|
* @see https://github.com/webgptorg/promptbook#parameters
|
|
10
10
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { string_name, string_prompt,
|
|
1
|
+
import type { string_name, string_prompt, string_promptbook_url_with_hashtemplate, string_title } from '.././types/typeAliases';
|
|
2
2
|
import type { ModelRequirements } from './ModelRequirements';
|
|
3
3
|
/**
|
|
4
4
|
* Prompt in a text along with model requirements, but without any execution or templating logic.
|
|
@@ -24,15 +24,15 @@ export interface Prompt {
|
|
|
24
24
|
*/
|
|
25
25
|
readonly modelRequirements: ModelRequirements;
|
|
26
26
|
/**
|
|
27
|
-
* Unique identifier of the
|
|
27
|
+
* Unique identifier of the promptbook with specific template name as hash
|
|
28
28
|
*
|
|
29
|
-
* @example https://
|
|
29
|
+
* @example https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords
|
|
30
30
|
*/
|
|
31
|
-
readonly
|
|
31
|
+
readonly promptbookUrl: string_promptbook_url_with_hashtemplate;
|
|
32
32
|
/**
|
|
33
33
|
* Parameters used in the prompt
|
|
34
34
|
*
|
|
35
|
-
* Note: This is redundant (same information is in
|
|
35
|
+
* Note: This is redundant (same information is in promptbookUrl+content) but useful for logging and debugging
|
|
36
36
|
*/
|
|
37
37
|
readonly parameters: Record<string_name, string>;
|
|
38
38
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { number_integer, number_positive_or_zero, string_javascript, string_javascript_name, string_markdown, string_name, string_prompt, string_template } from '../.././types/typeAliases';
|
|
2
1
|
import { ExpectFormatCommand } from '../Command';
|
|
3
2
|
import { ExecutionType } from '../ExecutionTypes';
|
|
4
3
|
import { ModelRequirements } from '../ModelRequirements';
|
|
5
4
|
import { ScriptLanguage } from '../ScriptLanguage';
|
|
5
|
+
import { number_integer, number_positive_or_zero, string_javascript, string_javascript_name, string_markdown, string_name, string_prompt, string_template } from '../typeAliases';
|
|
6
6
|
/**
|
|
7
|
-
* Describes one prompt template in the
|
|
7
|
+
* Describes one prompt template in the promptbook
|
|
8
8
|
*/
|
|
9
9
|
export type PromptTemplateJson = NaturalTemplateJson | SimpleTemplateJson | ScriptTemplateJson | PromptDialogJson;
|
|
10
10
|
/**
|
|
@@ -16,7 +16,7 @@ export interface NaturalTemplateJson extends PromptTemplateJsonCommon {
|
|
|
16
16
|
* Requirements for the model
|
|
17
17
|
* - This is required only for executionType PROMPT_TEMPLATE
|
|
18
18
|
*/
|
|
19
|
-
readonly modelRequirements
|
|
19
|
+
readonly modelRequirements: ModelRequirements;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Units of text measurement
|
|
@@ -62,7 +62,7 @@ interface PromptTemplateJsonCommon {
|
|
|
62
62
|
* Name of the template
|
|
63
63
|
* - It must be unique across the pipeline
|
|
64
64
|
* - It should start uppercase and contain letters and numbers
|
|
65
|
-
* - The
|
|
65
|
+
* - The promptbookUrl together with hash and name are used to identify the prompt template in the pipeline
|
|
66
66
|
*/
|
|
67
67
|
readonly name: string_name;
|
|
68
68
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { string_name } from '
|
|
1
|
+
import { string_name } from '../typeAliases';
|
|
2
2
|
/**
|
|
3
|
-
* Describes one parameter of the
|
|
3
|
+
* Describes one parameter of the promptbook
|
|
4
4
|
*/
|
|
5
5
|
export interface PromptTemplateParameterJson {
|
|
6
6
|
/**
|
|
@@ -1,38 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { string_promptbook_url, string_version } from '../typeAliases';
|
|
2
2
|
import { PromptTemplateJson } from './PromptTemplateJson';
|
|
3
3
|
import { PromptTemplateParameterJson } from './PromptTemplateParameterJson';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Promptbook is the **core concept of this library**.
|
|
6
6
|
* It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* - **.ptbk.md file** in custom markdown format described above
|
|
10
|
-
* - _(this)_ **JSON** format, parsed from the .ptbk.md file
|
|
11
|
-
*
|
|
12
|
-
* @see https://github.com/webgptorg/promptbook#prompt-template-pipeline
|
|
8
|
+
* @see https://github.com/webgptorg/promptbook#promptbook
|
|
13
9
|
*/
|
|
14
|
-
export interface
|
|
10
|
+
export interface PromptbookJson {
|
|
15
11
|
/**
|
|
16
|
-
* Unique identifier of the
|
|
12
|
+
* Unique identifier of the promptbook
|
|
17
13
|
*
|
|
18
|
-
* Note: It must be unique across all
|
|
14
|
+
* Note: It must be unique across all promptbooks libraries
|
|
19
15
|
* Note: It must use HTTPs URL
|
|
20
16
|
* Tip: You can do versioning in the URL
|
|
21
|
-
* For example: https://
|
|
17
|
+
* For example: https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@1.0.0
|
|
22
18
|
* Warning: Do not hash part of the URL, hash part is used for identification of the prompt template in the pipeline
|
|
23
19
|
*/
|
|
24
|
-
readonly
|
|
20
|
+
readonly promptbookUrl?: string_promptbook_url;
|
|
25
21
|
/**
|
|
26
|
-
* Title of the
|
|
22
|
+
* Title of the promptbook
|
|
27
23
|
* -It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
28
24
|
*/
|
|
29
25
|
readonly title: string;
|
|
30
26
|
/**
|
|
31
27
|
* Version of the .ptbk.json file
|
|
32
28
|
*/
|
|
33
|
-
readonly
|
|
29
|
+
readonly promptbookVersion: string_version;
|
|
34
30
|
/**
|
|
35
|
-
* Description of the
|
|
31
|
+
* Description of the promptbook
|
|
36
32
|
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
37
33
|
*/
|
|
38
34
|
readonly description?: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Promptbook is the **core concept of this library**.
|
|
3
|
+
* It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/webgptorg/promptbook#promptbook
|
|
6
|
+
*/
|
|
7
|
+
export type PromptbookString = string & {
|
|
8
|
+
readonly _type: 'Promptbook';
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* TODO: !! Better validation (validatePromptbookString) or remove branded type and make it just string
|
|
12
|
+
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExecutionType } from './ExecutionTypes';
|
|
2
2
|
import { string_markdown_text, string_name } from './typeAliases';
|
|
3
3
|
/**
|
|
4
|
-
* TaskProgress represents the progress of a
|
|
4
|
+
* TaskProgress represents the progress of a Promptbook execution.
|
|
5
5
|
*/
|
|
6
6
|
export interface TaskProgress {
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PromptResult } from '../../execution/PromptResult';
|
|
2
2
|
import type { Prompt } from '../Prompt';
|
|
3
|
-
import type {
|
|
3
|
+
import type { string_promptbook_url, string_version } from '../typeAliases';
|
|
4
4
|
/**
|
|
5
5
|
* ExecutionReport is result of executing one promptbook
|
|
6
6
|
* It is kind of a variant of the promptbook usefull for debugging, logging and transparency for users.
|
|
@@ -13,23 +13,23 @@ import type { string_ptbk_url, string_version } from '../typeAliases';
|
|
|
13
13
|
*/
|
|
14
14
|
export type ExecutionReportJson = {
|
|
15
15
|
/**
|
|
16
|
-
* Unique identifier of the
|
|
16
|
+
* Unique identifier of the promptbook from promptbook which was executed
|
|
17
17
|
*/
|
|
18
|
-
readonly
|
|
18
|
+
readonly promptbookUrl?: string_promptbook_url;
|
|
19
19
|
/**
|
|
20
|
-
* Title of from
|
|
20
|
+
* Title of from promptbook which was executed
|
|
21
21
|
*/
|
|
22
22
|
readonly title?: string;
|
|
23
23
|
/**
|
|
24
|
-
* Version from
|
|
24
|
+
* Version from promptbook which was executed
|
|
25
25
|
*/
|
|
26
|
-
readonly
|
|
26
|
+
readonly promptbookUsedVersion: string_version;
|
|
27
27
|
/**
|
|
28
|
-
* Version from
|
|
28
|
+
* Version from promptbook which was requested by promptbook
|
|
29
29
|
*/
|
|
30
|
-
readonly
|
|
30
|
+
readonly promptbookRequestedVersion?: string_version;
|
|
31
31
|
/**
|
|
32
|
-
* Description of the
|
|
32
|
+
* Description of the promptbook which was executed
|
|
33
33
|
*/
|
|
34
34
|
readonly description?: string;
|
|
35
35
|
/**
|
|
@@ -39,7 +39,7 @@ export type ExecutionReportJson = {
|
|
|
39
39
|
/**
|
|
40
40
|
* The prompt wich was executed
|
|
41
41
|
*/
|
|
42
|
-
prompt: Omit<Prompt, '
|
|
42
|
+
prompt: Omit<Prompt, 'promptbookUrl' | 'parameters'>;
|
|
43
43
|
/**
|
|
44
44
|
* Result of the prompt execution (if not failed during LLM execution)
|
|
45
45
|
*/
|
|
@@ -179,15 +179,15 @@ export type string_url = string;
|
|
|
179
179
|
/**
|
|
180
180
|
* Semantic helper
|
|
181
181
|
*
|
|
182
|
-
* For example `"https://
|
|
182
|
+
* For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15"`
|
|
183
183
|
*/
|
|
184
|
-
export type
|
|
184
|
+
export type string_promptbook_url = string;
|
|
185
185
|
/**
|
|
186
186
|
* Semantic helper
|
|
187
187
|
*
|
|
188
|
-
* For example `"https://
|
|
188
|
+
* For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords"`
|
|
189
189
|
*/
|
|
190
|
-
export type
|
|
190
|
+
export type string_promptbook_url_with_hashtemplate = string;
|
|
191
191
|
/**
|
|
192
192
|
* Semantic helper
|
|
193
193
|
*
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects if the code is running in a browser environment in main thread (Not in a web worker)
|
|
3
|
+
*/
|
|
4
|
+
export declare const isRunningInBrowser: Function;
|
|
5
|
+
/**
|
|
6
|
+
* Detects if the code is running in a Node.js environment
|
|
7
|
+
*/
|
|
8
|
+
export declare const isRunningInNode: Function;
|
|
9
|
+
/**
|
|
10
|
+
* Detects if the code is running in a web worker
|
|
11
|
+
*/
|
|
12
|
+
export declare const isRunningInWebWorker: Function;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { string_markdown, string_name } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Add or modify an auto-generated section in a markdown file
|
|
4
|
+
*
|
|
5
|
+
* @private within the library
|
|
6
|
+
*/
|
|
7
|
+
export declare function addAutoGeneratedSection(content: string_markdown, options: {
|
|
8
|
+
sectionName: string_name;
|
|
9
|
+
sectionContent: string_markdown;
|
|
10
|
+
}): string_markdown;
|
|
@@ -35,3 +35,7 @@ type CreateMarkdownChartOptions = {
|
|
|
35
35
|
*/
|
|
36
36
|
export declare function createMarkdownChart(options: CreateMarkdownChartOptions): string_markdown;
|
|
37
37
|
export {};
|
|
38
|
+
/**
|
|
39
|
+
* TODO: Maybe use Mermain Gant Diagrams
|
|
40
|
+
* @see https://jojozhuang.github.io/tutorial/mermaid-cheat-sheet/
|
|
41
|
+
*/
|
package/esm/typings/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/openai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.1",
|
|
4
4
|
"description": "Library to supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"openai": "4.2.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@promptbook/core": "0.
|
|
40
|
+
"@promptbook/core": "0.36.1"
|
|
41
41
|
},
|
|
42
42
|
"main": "./umd/index.umd.js",
|
|
43
43
|
"module": "./esm/index.es.js",
|
package/umd/index.umd.js
CHANGED
|
@@ -85,13 +85,13 @@
|
|
|
85
85
|
function computeOpenaiUsage(rawResponse) {
|
|
86
86
|
var _a, _b;
|
|
87
87
|
if (rawResponse.usage === undefined) {
|
|
88
|
-
throw new Error('The usage is not defined in the response from
|
|
88
|
+
throw new Error('The usage is not defined in the response from OpenAI');
|
|
89
89
|
}
|
|
90
90
|
if (((_a = rawResponse.usage) === null || _a === void 0 ? void 0 : _a.prompt_tokens) === undefined) {
|
|
91
|
-
throw new Error('In
|
|
91
|
+
throw new Error('In OpenAI response `usage.prompt_tokens` not defined');
|
|
92
92
|
}
|
|
93
93
|
if (((_b = rawResponse.usage) === null || _b === void 0 ? void 0 : _b.completion_tokens) === undefined) {
|
|
94
|
-
throw new Error('In
|
|
94
|
+
throw new Error('In OpenAI response `usage.completion_tokens` not defined');
|
|
95
95
|
}
|
|
96
96
|
var inputTokens = rawResponse.usage.prompt_tokens;
|
|
97
97
|
var outputTokens = rawResponse.usage.completion_tokens;
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
completion: 0.002,
|
|
102
102
|
},
|
|
103
103
|
'gpt-4-0613': {
|
|
104
|
-
// TODO:
|
|
104
|
+
// TODO: Not sure if this is correct
|
|
105
105
|
prompt: 0.01,
|
|
106
106
|
completion: 0.03,
|
|
107
107
|
},
|
|
@@ -178,18 +178,18 @@
|
|
|
178
178
|
console.error(chalk__default["default"].bgGray('rawResponse'), JSON.stringify(rawResponse, null, 4));
|
|
179
179
|
}
|
|
180
180
|
if (!rawResponse.choices[0]) {
|
|
181
|
-
throw new Error('No choises from
|
|
181
|
+
throw new Error('No choises from OpenAI');
|
|
182
182
|
}
|
|
183
183
|
if (rawResponse.choices.length > 1) {
|
|
184
184
|
// TODO: This should be maybe only warning
|
|
185
|
-
throw new Error('More than one choise from
|
|
185
|
+
throw new Error('More than one choise from OpenAI');
|
|
186
186
|
}
|
|
187
187
|
resultContent = rawResponse.choices[0].message.content;
|
|
188
188
|
// eslint-disable-next-line prefer-const
|
|
189
189
|
complete = getCurrentIsoDate();
|
|
190
190
|
usage = computeOpenaiUsage(rawResponse);
|
|
191
191
|
if (!resultContent) {
|
|
192
|
-
throw new Error('No response message from
|
|
192
|
+
throw new Error('No response message from OpenAI');
|
|
193
193
|
}
|
|
194
194
|
return [2 /*return*/, {
|
|
195
195
|
content: resultContent,
|
|
@@ -241,18 +241,18 @@
|
|
|
241
241
|
console.error(chalk__default["default"].bgGray('rawResponse'), JSON.stringify(rawResponse, null, 4));
|
|
242
242
|
}
|
|
243
243
|
if (!rawResponse.choices[0]) {
|
|
244
|
-
throw new Error('No choises from
|
|
244
|
+
throw new Error('No choises from OpenAI');
|
|
245
245
|
}
|
|
246
246
|
if (rawResponse.choices.length > 1) {
|
|
247
247
|
// TODO: This should be maybe only warning
|
|
248
|
-
throw new Error('More than one choise from
|
|
248
|
+
throw new Error('More than one choise from OpenAI');
|
|
249
249
|
}
|
|
250
250
|
resultContent = rawResponse.choices[0].text;
|
|
251
251
|
// eslint-disable-next-line prefer-const
|
|
252
252
|
complete = getCurrentIsoDate();
|
|
253
253
|
usage = computeOpenaiUsage(rawResponse);
|
|
254
254
|
if (!resultContent) {
|
|
255
|
-
throw new Error('No response message from
|
|
255
|
+
throw new Error('No response message from OpenAI');
|
|
256
256
|
}
|
|
257
257
|
return [2 /*return*/, {
|
|
258
258
|
content: resultContent,
|
package/umd/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../src/utils/getCurrentIsoDate.ts","../../../src/execution/plugins/natural-execution-tools/openai/computeOpenaiUsage.ts","../../../src/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null],"names":["OpenAI","chalk"],"mappings":";;;;;;;;;;;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AAiBA;IACO,IAAI,QAAQ,GAAG,WAAW;IACjC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CAAC,CAAC,EAAE;IACrD,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC7D,YAAY,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC7B,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACzF,SAAS;IACT,QAAQ,OAAO,CAAC,CAAC;IACjB,MAAK;IACL,IAAI,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3C,EAAC;AA4BD;IACO,SAAS,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;IAC7D,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,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K,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;4BAE9C,IAAI,CAAC,aAAa,EAAE;gCAChB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;6BACvD;4BAED,sBAAO;oCACH,OAAO,EAAE,aAAa;oCACtB,KAAK,OAAA;oCACL,MAAM,EAAE;wCACJ,KAAK,OAAA;wCACL,QAAQ,UAAA;qCACX;oCACD,KAAK,OAAA;oCACL,WAAW,aAAA;;iCAEd,EAAC;;;;SACL;QACL,2BAAC;IAAD,CAAC,IAAA;IAED;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../src/utils/getCurrentIsoDate.ts","../../../src/execution/plugins/natural-execution-tools/openai/computeOpenaiUsage.ts","../../../src/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value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iCAEd,EAAC;;;;SACL;QACL,2BAAC;IAAD,CAAC,IAAA;IAED;;;;;;;;;;;;;;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { createPtpExecutor } from '../execution/createPtpExecutor';
|
|
1
|
+
import { PromptbookLibrary } from '../classes/PromptbookLibrary';
|
|
2
|
+
import { promptbookStringToJson } from '../conversion/promptbookStringToJson';
|
|
3
|
+
import { validatePromptbookJson } from '../conversion/validatePromptbookJson';
|
|
4
|
+
import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
|
|
6
5
|
import { MockedEchoNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools';
|
|
7
6
|
import { CallbackInterfaceTools } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools';
|
|
8
7
|
import { CallbackInterfaceToolsOptions } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions';
|
|
9
8
|
import { SimplePromptInterfaceTools } from '../execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools';
|
|
10
9
|
import { ExecutionTypes } from '../types/ExecutionTypes';
|
|
11
|
-
|
|
10
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
11
|
+
export { ExecutionTypes, PROMPTBOOK_VERSION, PromptbookLibrary };
|
|
12
12
|
export { SimplePromptInterfaceTools };
|
|
13
|
-
export {
|
|
13
|
+
export { promptbookStringToJson, validatePromptbookJson };
|
|
14
14
|
export { MockedEchoNaturalExecutionTools };
|
|
15
|
-
export {
|
|
15
|
+
export { createPromptbookExecutor };
|
|
16
16
|
export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RemoteServerOptions } from '../execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions';
|
|
2
|
-
import {
|
|
3
|
-
export { RemoteServerOptions,
|
|
2
|
+
import { startRemoteServer } from '../execution/plugins/natural-execution-tools/remote/startRemoteServer';
|
|
3
|
+
export { RemoteServerOptions, startRemoteServer };
|