@promptbook/remote-server 0.82.0-0 → 0.82.0-2
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 +6136 -807
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/remote-client.index.d.ts +9 -3
- package/esm/typings/src/_packages/remote-server.index.d.ts +8 -2
- package/esm/typings/src/_packages/types.index.d.ts +16 -26
- package/esm/typings/src/collection/PipelineCollection.d.ts +2 -0
- package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +6 -3
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +2 -2
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +3 -7
- package/esm/typings/src/other/templates/getBookTemplates.d.ts +5 -3
- package/esm/typings/src/prepare/preparePipelineOnRemoteServer.d.ts +5 -2
- package/esm/typings/src/remote-server/createRemoteClient.d.ts +10 -0
- package/esm/typings/src/remote-server/{interfaces → socket-types/_common}/PromptbookServer_Error.d.ts +3 -3
- package/esm/typings/src/remote-server/socket-types/_common/PromptbookServer_Progress.d.ts +10 -0
- package/esm/typings/src/remote-server/socket-types/_subtypes/PromptbookServer_Identification.d.ts +49 -0
- package/esm/typings/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Request.d.ts +17 -0
- package/esm/typings/src/remote-server/{interfaces → socket-types/listModels}/PromptbookServer_ListModels_Response.d.ts +4 -2
- package/esm/typings/src/remote-server/socket-types/prepare/PromptbookServer_PreparePipeline_Request.d.ts +17 -0
- package/esm/typings/src/remote-server/socket-types/prepare/PromptbookServer_PreparePipeline_Response.d.ts +12 -0
- package/esm/typings/src/remote-server/socket-types/prompt/PromptbookServer_Prompt_Request.d.ts +17 -0
- package/esm/typings/src/remote-server/{interfaces → socket-types/prompt}/PromptbookServer_Prompt_Response.d.ts +3 -3
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +3 -2
- package/esm/typings/src/remote-server/types/RemoteClientOptions.d.ts +32 -0
- package/esm/typings/src/types/Arrayable.d.ts +1 -0
- package/esm/typings/src/types/NonEmptyArray.d.ts +8 -0
- package/package.json +8 -3
- package/umd/index.umd.js +6131 -811
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/remote-server/interfaces/PromptbookServer_ListModels_Request.d.ts +0 -38
- package/esm/typings/src/remote-server/interfaces/PromptbookServer_Prompt_Progress.d.ts +0 -12
- package/esm/typings/src/remote-server/interfaces/PromptbookServer_Prompt_Request.d.ts +0 -45
- package/esm/typings/src/remote-server/interfaces/RemoteLlmExecutionToolsOptions.d.ts +0 -54
- /package/esm/typings/src/remote-server/{interfaces → types}/RemoteServerOptions.d.ts +0 -0
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { LlmToolsConfiguration } from '../../llm-providers/_common/register/LlmToolsConfiguration';
|
|
2
|
-
import type { string_user_id } from '../../types/typeAliases';
|
|
3
|
-
import type { ApplicationRemoteServerClientOptions } from './RemoteServerOptions';
|
|
4
|
-
/**
|
|
5
|
-
* Socket.io progress for remote text generation
|
|
6
|
-
*
|
|
7
|
-
* This is a request from client to server
|
|
8
|
-
*/
|
|
9
|
-
export type PromptbookServer_ListModels_Request<TCustomOptions> = PromptbookServer_ListModels_CollectionRequest<TCustomOptions> | PromptbookServer_ListModels_AnonymousRequest;
|
|
10
|
-
export type PromptbookServer_ListModels_CollectionRequest<TCustomOptions> = ApplicationRemoteServerClientOptions<TCustomOptions> & {
|
|
11
|
-
/**
|
|
12
|
-
* Application mode
|
|
13
|
-
*/
|
|
14
|
-
readonly isAnonymous: false;
|
|
15
|
-
};
|
|
16
|
-
export type PromptbookServer_ListModels_AnonymousRequest = {
|
|
17
|
-
/**
|
|
18
|
-
* Anonymous mode
|
|
19
|
-
*/
|
|
20
|
-
readonly isAnonymous: true;
|
|
21
|
-
/**
|
|
22
|
-
* Identifier of the end user
|
|
23
|
-
*
|
|
24
|
-
* Note: this is passed to the certain model providers to identify misuse
|
|
25
|
-
* Note: In anonymous mode, there is no need to identify yourself, nor does it change the actual configuration of LLM Tools (unlike in application mode)
|
|
26
|
-
*/
|
|
27
|
-
readonly userId?: string_user_id;
|
|
28
|
-
/**
|
|
29
|
-
* Configuration for the LLM tools
|
|
30
|
-
*/
|
|
31
|
-
readonly llmToolsConfiguration: LlmToolsConfiguration;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* TODO: [👡] DRY `PromptbookServer_Prompt_Request` and `PromptbookServer_ListModels_Request`
|
|
35
|
-
* TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
|
|
36
|
-
* TODO: [🧠][🤺] Maybe allow overriding of `userId` for each prompt - Pass `userId` in `PromptbookServer_ListModels_Request`
|
|
37
|
-
* TODO: [👒] Listing models (and checking configuration) probbably should go through REST API not Socket.io
|
|
38
|
-
*/
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { TaskProgress } from '../../types/TaskProgress';
|
|
2
|
-
/**
|
|
3
|
-
* Socket.io progress for remote text generation
|
|
4
|
-
*
|
|
5
|
-
* This is sent from server to client arbitrarily and may be sent multiple times
|
|
6
|
-
*/
|
|
7
|
-
export type PromptbookServer_Prompt_Progress = {
|
|
8
|
-
/**
|
|
9
|
-
* The progress of text generation
|
|
10
|
-
*/
|
|
11
|
-
readonly taskProgress: TaskProgress;
|
|
12
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { LlmToolsConfiguration } from '../../llm-providers/_common/register/LlmToolsConfiguration';
|
|
2
|
-
import type { Prompt } from '../../types/Prompt';
|
|
3
|
-
import type { string_user_id } from '../../types/typeAliases';
|
|
4
|
-
import type { ApplicationRemoteServerClientOptions } from './RemoteServerOptions';
|
|
5
|
-
/**
|
|
6
|
-
* Socket.io progress for remote text generation
|
|
7
|
-
*
|
|
8
|
-
* This is a request from client to server
|
|
9
|
-
*/
|
|
10
|
-
export type PromptbookServer_Prompt_Request<TCustomOptions> = PromptbookServer_Prompt_CollectionRequest<TCustomOptions> | PromptbookServer_Prompt_AnonymousRequest;
|
|
11
|
-
export type PromptbookServer_Prompt_CollectionRequest<TCustomOptions> = ApplicationRemoteServerClientOptions<TCustomOptions> & {
|
|
12
|
-
/**
|
|
13
|
-
* Application mode
|
|
14
|
-
*/
|
|
15
|
-
readonly isAnonymous: false;
|
|
16
|
-
/**
|
|
17
|
-
* The Prompt to execute
|
|
18
|
-
*/
|
|
19
|
-
readonly prompt: Prompt;
|
|
20
|
-
};
|
|
21
|
-
export type PromptbookServer_Prompt_AnonymousRequest = {
|
|
22
|
-
/**
|
|
23
|
-
* Anonymous mode
|
|
24
|
-
*/
|
|
25
|
-
readonly isAnonymous: true;
|
|
26
|
-
/**
|
|
27
|
-
* Identifier of the end user
|
|
28
|
-
*
|
|
29
|
-
* Note: this is passed to the certain model providers to identify misuse
|
|
30
|
-
* Note: In anonymous mode, there is no need to identify yourself, nor does it change the actual configuration of LLM Tools (unlike in application mode)
|
|
31
|
-
*/
|
|
32
|
-
readonly userId?: string_user_id;
|
|
33
|
-
/**
|
|
34
|
-
* Configuration for the LLM tools
|
|
35
|
-
*/
|
|
36
|
-
readonly llmToolsConfiguration: LlmToolsConfiguration;
|
|
37
|
-
/**
|
|
38
|
-
* The Prompt to execute
|
|
39
|
-
*/
|
|
40
|
-
readonly prompt: Prompt;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* TODO: [👡] DRY `PromptbookServer_Prompt_Request` and `PromptbookServer_ListModels_Request`
|
|
44
|
-
* TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
|
|
45
|
-
*/
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
2
|
-
import type { LlmToolsConfiguration } from '../../llm-providers/_common/register/LlmToolsConfiguration';
|
|
3
|
-
import type { string_base_url } from '../../types/typeAliases';
|
|
4
|
-
import type { string_uri } from '../../types/typeAliases';
|
|
5
|
-
import type { string_user_id } from '../../types/typeAliases';
|
|
6
|
-
import type { ApplicationRemoteServerClientOptions } from './RemoteServerOptions';
|
|
7
|
-
/**
|
|
8
|
-
* Options for `RemoteLlmExecutionTools`
|
|
9
|
-
*
|
|
10
|
-
* @public exported from `@promptbook/remote-client`
|
|
11
|
-
*/
|
|
12
|
-
export type RemoteLlmExecutionToolsOptions<TCustomOptions> = CommonToolsOptions & {
|
|
13
|
-
/**
|
|
14
|
-
* URL of the remote PROMPTBOOK server
|
|
15
|
-
* On this server will be connected to the socket.io server
|
|
16
|
-
*/
|
|
17
|
-
readonly remoteUrl: string_base_url;
|
|
18
|
-
/**
|
|
19
|
-
* Path for the Socket.io server to listen
|
|
20
|
-
*
|
|
21
|
-
* @default '/socket.io'
|
|
22
|
-
* @example '/promptbook/socket.io'
|
|
23
|
-
*/
|
|
24
|
-
readonly path: string_uri;
|
|
25
|
-
/**
|
|
26
|
-
* Mode of the server to connect to
|
|
27
|
-
*/
|
|
28
|
-
isAnonymous: boolean;
|
|
29
|
-
} & ({
|
|
30
|
-
/**
|
|
31
|
-
* Use anonymous server with anonymous mode
|
|
32
|
-
*/
|
|
33
|
-
readonly isAnonymous: true;
|
|
34
|
-
/**
|
|
35
|
-
* Configuration for the LLM tools
|
|
36
|
-
*/
|
|
37
|
-
readonly llmToolsConfiguration: LlmToolsConfiguration;
|
|
38
|
-
/**
|
|
39
|
-
* Identifier of the end user
|
|
40
|
-
*
|
|
41
|
-
* Note: This is passed to the certain model providers to identify misuse
|
|
42
|
-
* Note: In anonymous mode, there is no need to identify yourself, nor does it change the actual configuration of LLM Tools (unlike in application mode).
|
|
43
|
-
*/
|
|
44
|
-
readonly userId?: string_user_id;
|
|
45
|
-
} | ({
|
|
46
|
-
/**
|
|
47
|
-
* Use anonymous server with client identification and fixed collection
|
|
48
|
-
*/
|
|
49
|
-
readonly isAnonymous: false;
|
|
50
|
-
} & ApplicationRemoteServerClientOptions<TCustomOptions>));
|
|
51
|
-
/**
|
|
52
|
-
* TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
|
|
53
|
-
* TODO: [🧠][🧜♂️] Maybe join remoteUrl and path into single value
|
|
54
|
-
*/
|
|
File without changes
|