@promptbook/utils 0.46.0 → 0.47.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.
- package/README.md +18 -8
- package/esm/index.es.js +53 -39
- package/esm/index.es.js.map +1 -1
- package/esm/typings/_packages/langtail.index.d.ts +2 -2
- package/esm/typings/_packages/mock.index.d.ts +3 -3
- package/esm/typings/_packages/openai.index.d.ts +2 -2
- package/esm/typings/_packages/remote-client.index.d.ts +4 -4
- package/esm/typings/_packages/remote-server.index.d.ts +2 -2
- package/esm/typings/_packages/types.index.d.ts +2 -2
- package/esm/typings/_packages/utils.index.d.ts +2 -0
- package/esm/typings/conversion/prettify/PrettifyOptions.d.ts +9 -3
- package/esm/typings/conversion/prettify/prettifyPromptbookString.d.ts +1 -1
- package/esm/typings/conversion/prettify/renderPromptbookMermaid.d.ts +11 -0
- package/esm/typings/execution/ExecutionTools.d.ts +5 -2
- package/esm/typings/execution/{NaturalExecutionTools.d.ts → LlmExecutionTools.d.ts} +2 -2
- package/{umd/typings/execution/plugins/natural-execution-tools → esm/typings/execution/plugins/llm-execution-tools}/langtail/LangtailExecutionTools.d.ts +2 -2
- package/{umd/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts → esm/typings/execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools.d.ts} +2 -2
- package/{umd/typings/execution/plugins/natural-execution-tools/mocked/MockedFackedNaturalExecutionTools.d.ts → esm/typings/execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools.d.ts} +2 -2
- package/{umd/typings/execution/plugins/natural-execution-tools → esm/typings/execution/plugins/llm-execution-tools}/mocked/fakeTextToExpectations.d.ts +1 -1
- package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/openai/OpenAiExecutionTools.d.ts +2 -2
- package/esm/typings/execution/plugins/{natural-execution-tools/remote/RemoteNaturalExecutionTools.d.ts → llm-execution-tools/remote/RemoteLlmExecutionTools.d.ts} +5 -5
- package/esm/typings/execution/plugins/{natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts → llm-execution-tools/remote/RemoteLlmExecutionToolsOptions.d.ts} +3 -3
- package/{umd/typings/execution/plugins/natural-execution-tools → esm/typings/execution/plugins/llm-execution-tools}/remote/interfaces/RemoteServerOptions.d.ts +3 -3
- package/esm/typings/types/PromptbookJson/PromptTemplateJson.d.ts +2 -2
- package/package.json +13 -3
- package/umd/index.umd.js +53 -38
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/_packages/langtail.index.d.ts +2 -2
- package/umd/typings/_packages/mock.index.d.ts +3 -3
- package/umd/typings/_packages/openai.index.d.ts +2 -2
- package/umd/typings/_packages/remote-client.index.d.ts +4 -4
- package/umd/typings/_packages/remote-server.index.d.ts +2 -2
- package/umd/typings/_packages/types.index.d.ts +2 -2
- package/umd/typings/_packages/utils.index.d.ts +2 -0
- package/umd/typings/conversion/prettify/PrettifyOptions.d.ts +9 -3
- package/umd/typings/conversion/prettify/prettifyPromptbookString.d.ts +1 -1
- package/umd/typings/conversion/prettify/renderPromptbookMermaid.d.ts +11 -0
- package/umd/typings/execution/ExecutionTools.d.ts +5 -2
- package/umd/typings/execution/{NaturalExecutionTools.d.ts → LlmExecutionTools.d.ts} +2 -2
- package/{esm/typings/execution/plugins/natural-execution-tools → umd/typings/execution/plugins/llm-execution-tools}/langtail/LangtailExecutionTools.d.ts +2 -2
- package/{esm/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts → umd/typings/execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools.d.ts} +2 -2
- package/{esm/typings/execution/plugins/natural-execution-tools/mocked/MockedFackedNaturalExecutionTools.d.ts → umd/typings/execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools.d.ts} +2 -2
- package/{esm/typings/execution/plugins/natural-execution-tools → umd/typings/execution/plugins/llm-execution-tools}/mocked/fakeTextToExpectations.d.ts +1 -1
- package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/openai/OpenAiExecutionTools.d.ts +2 -2
- package/umd/typings/execution/plugins/{natural-execution-tools/remote/RemoteNaturalExecutionTools.d.ts → llm-execution-tools/remote/RemoteLlmExecutionTools.d.ts} +5 -5
- package/umd/typings/execution/plugins/{natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts → llm-execution-tools/remote/RemoteLlmExecutionToolsOptions.d.ts} +3 -3
- package/{esm/typings/execution/plugins/natural-execution-tools → umd/typings/execution/plugins/llm-execution-tools}/remote/interfaces/RemoteServerOptions.d.ts +3 -3
- package/umd/typings/types/PromptbookJson/PromptTemplateJson.d.ts +2 -2
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/langtail/LangtailExecutionToolsOptions.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/mocked/fakeTextToExpectations.test.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/mocked/faked-completion.test.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/mocked/joker.test.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/mocked/mocked-chat.test.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/mocked/mocked-completion.test.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/openai/OpenAiExecutionToolsOptions.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/openai/computeOpenaiUsage.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/remote/interfaces/Promptbook_Server_Error.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/remote/interfaces/Promptbook_Server_Progress.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/remote/interfaces/Promptbook_Server_Request.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/remote/interfaces/Promptbook_Server_Response.d.ts +0 -0
- /package/esm/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/remote/startRemoteServer.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/langtail/LangtailExecutionToolsOptions.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/mocked/fakeTextToExpectations.test.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/mocked/faked-completion.test.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/mocked/joker.test.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/mocked/mocked-chat.test.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/mocked/mocked-completion.test.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/openai/OpenAiExecutionToolsOptions.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/openai/computeOpenaiUsage.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/remote/interfaces/Promptbook_Server_Error.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/remote/interfaces/Promptbook_Server_Progress.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/remote/interfaces/Promptbook_Server_Request.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/remote/interfaces/Promptbook_Server_Response.d.ts +0 -0
- /package/umd/typings/execution/plugins/{natural-execution-tools → llm-execution-tools}/remote/startRemoteServer.d.ts +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Prompt } from '../../../../types/Prompt';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LlmExecutionTools } from '../../../LlmExecutionTools';
|
|
3
3
|
import type { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
|
|
4
4
|
import type { OpenAiExecutionToolsOptions } from './OpenAiExecutionToolsOptions';
|
|
5
5
|
/**
|
|
6
6
|
* Execution Tools for calling OpenAI API.
|
|
7
7
|
*/
|
|
8
|
-
export declare class OpenAiExecutionTools implements
|
|
8
|
+
export declare class OpenAiExecutionTools implements LlmExecutionTools {
|
|
9
9
|
private readonly options;
|
|
10
10
|
/**
|
|
11
11
|
* OpenAI API client.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Prompt } from '../../../../types/Prompt';
|
|
2
|
-
import {
|
|
2
|
+
import { LlmExecutionTools } from '../../../LlmExecutionTools';
|
|
3
3
|
import { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
|
|
4
|
-
import {
|
|
4
|
+
import { RemoteLlmExecutionToolsOptions } from './RemoteLlmExecutionToolsOptions';
|
|
5
5
|
/**
|
|
6
6
|
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
7
7
|
*
|
|
@@ -10,9 +10,9 @@ import { RemoteNaturalExecutionToolsOptions } from './RemoteNaturalExecutionTool
|
|
|
10
10
|
*
|
|
11
11
|
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
12
12
|
*/
|
|
13
|
-
export declare class
|
|
13
|
+
export declare class RemoteLlmExecutionTools implements LlmExecutionTools {
|
|
14
14
|
private readonly options;
|
|
15
|
-
constructor(options:
|
|
15
|
+
constructor(options: RemoteLlmExecutionToolsOptions);
|
|
16
16
|
/**
|
|
17
17
|
* Creates a connection to the remote proxy server.
|
|
18
18
|
*/
|
|
@@ -31,5 +31,5 @@ export declare class RemoteNaturalExecutionTools implements NaturalExecutionTool
|
|
|
31
31
|
private gptCommon;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* TODO: [🤹♂️]
|
|
34
|
+
* TODO: [🤹♂️] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable
|
|
35
35
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { client_id, string_uri } from '
|
|
1
|
+
import type { client_id, string_uri } from '../../../../types/typeAliases';
|
|
2
2
|
import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
3
3
|
/**
|
|
4
|
-
* Options for
|
|
4
|
+
* Options for RemoteLlmExecutionTools
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type RemoteLlmExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
7
7
|
/**
|
|
8
8
|
* URL of the remote PROMPTBOOK server
|
|
9
9
|
* On this server will be connected to the socket.io server
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PromptbookLibrary } from '../../../../../library/PromptbookLibrary';
|
|
2
2
|
import type { client_id, string_uri } from '../../../../../types/typeAliases';
|
|
3
3
|
import type { CommonExecutionToolsOptions } from '../../../../CommonExecutionToolsOptions';
|
|
4
|
-
import type {
|
|
4
|
+
import type { LlmExecutionTools } from '../../../../LlmExecutionTools';
|
|
5
5
|
export type RemoteServerOptions = CommonExecutionToolsOptions & {
|
|
6
6
|
/**
|
|
7
7
|
* Port on which the server will listen
|
|
@@ -21,7 +21,7 @@ export type RemoteServerOptions = CommonExecutionToolsOptions & {
|
|
|
21
21
|
*/
|
|
22
22
|
readonly library: PromptbookLibrary;
|
|
23
23
|
/**
|
|
24
|
-
* Creates
|
|
24
|
+
* Creates llm execution tools for each client
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
createLlmExecutionTools(clientId: client_id): LlmExecutionTools;
|
|
27
27
|
};
|
|
@@ -6,11 +6,11 @@ import type { number_integer, number_positive_or_zero, string_javascript, string
|
|
|
6
6
|
/**
|
|
7
7
|
* Describes one prompt template in the promptbook
|
|
8
8
|
*/
|
|
9
|
-
export type PromptTemplateJson =
|
|
9
|
+
export type PromptTemplateJson = LlmTemplateJson | SimpleTemplateJson | ScriptTemplateJson | PromptDialogJson;
|
|
10
10
|
/**
|
|
11
11
|
* Template for prompt to LLM
|
|
12
12
|
*/
|
|
13
|
-
export type
|
|
13
|
+
export type LlmTemplateJson = PromptTemplateJsonCommon & {
|
|
14
14
|
readonly executionType: 'PROMPT_TEMPLATE';
|
|
15
15
|
/**
|
|
16
16
|
* Requirements for the model
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|