@promptbook/openai 0.67.0-3 → 0.67.0-4

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 CHANGED
@@ -6,7 +6,7 @@ import spaceTrim$1, { spaceTrim } from 'spacetrim';
6
6
  /**
7
7
  * The version of the Promptbook library
8
8
  */
9
- var PROMPTBOOK_VERSION = '0.67.0-2';
9
+ var PROMPTBOOK_VERSION = '0.67.0-3';
10
10
  // TODO: !!!! List here all the versions and annotate + put into script
11
11
 
12
12
  /*! *****************************************************************************
@@ -157,7 +157,7 @@ import type { string_protocol } from '../types/typeAliases';
157
157
  import type { string_email } from '../types/typeAliases';
158
158
  import type { string_emails } from '../types/typeAliases';
159
159
  import type { string_uuid } from '../types/typeAliases';
160
- import type { client_id } from '../types/typeAliases';
160
+ import type { string_user_id } from '../types/typeAliases';
161
161
  import type { string_sha256 } from '../types/typeAliases';
162
162
  import type { string_semantic_version } from '../types/typeAliases';
163
163
  import type { string_version_dependency } from '../types/typeAliases';
@@ -383,7 +383,7 @@ export type { string_protocol };
383
383
  export type { string_email };
384
384
  export type { string_emails };
385
385
  export type { string_uuid };
386
- export type { client_id };
386
+ export type { string_user_id };
387
387
  export type { string_sha256 };
388
388
  export type { string_semantic_version };
389
389
  export type { string_version_dependency };
@@ -1,4 +1,3 @@
1
- import type { client_id } from '../../../types/typeAliases';
2
1
  import type { LlmToolsConfiguration } from '../../_common/LlmToolsConfiguration';
3
2
  /**
4
3
  * Socket.io progress for remote text generation
@@ -11,10 +10,6 @@ export type PromptbookServer_ListModels_CollectionRequest = {
11
10
  * Collection mode
12
11
  */
13
12
  isAnonymous: false;
14
- /**
15
- * Client responsible for the requests
16
- */
17
- readonly clientId: client_id;
18
13
  };
19
14
  export type PromptbookServer_ListModels_AnonymousRequest = {
20
15
  /**
@@ -29,6 +24,6 @@ export type PromptbookServer_ListModels_AnonymousRequest = {
29
24
  /**
30
25
  * TODO: [ðŸ‘Ą] DRY `PromptbookServer_Prompt_Request` and `PromptbookServer_ListModels_Request`
31
26
  * TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
32
- * TODO: [🧠][ðŸĪš] Pass `clientId` in `PromptbookServer_ListModels_Request`
27
+ * TODO: [🧠][ðŸĪš] Pass `userId` in `PromptbookServer_ListModels_Request`
33
28
  * TODO: [👒] Listing models (and checking configuration) probbably should go through REST API not Socket.io
34
29
  */
@@ -1,5 +1,5 @@
1
1
  import type { Prompt } from '../../../types/Prompt';
2
- import type { client_id } from '../../../types/typeAliases';
2
+ import type { string_user_id } from '../../../types/typeAliases';
3
3
  import type { LlmToolsConfiguration } from '../../_common/LlmToolsConfiguration';
4
4
  /**
5
5
  * Socket.io progress for remote text generation
@@ -11,11 +11,14 @@ export type PromptbookServer_Prompt_CollectionRequest = {
11
11
  /**
12
12
  * Collection mode
13
13
  */
14
- isAnonymous: false;
14
+ readonly isAnonymous: false;
15
15
  /**
16
- * Client responsible for the requests
16
+ * Identifier of the end user
17
+ *
18
+ * Note: this is passed to the certain model providers to identify misuse
19
+ * Note: In anonymous mode it is not required to identify
17
20
  */
18
- readonly clientId: client_id;
21
+ readonly userId: string_user_id;
19
22
  /**
20
23
  * The Prompt to execute
21
24
  */
@@ -25,7 +28,14 @@ export type PromptbookServer_Prompt_AnonymousRequest = {
25
28
  /**
26
29
  * Anonymous mode
27
30
  */
28
- isAnonymous: true;
31
+ readonly isAnonymous: true;
32
+ /**
33
+ * Identifier of the end user
34
+ *
35
+ * Note: this is passed to the certain model providers to identify misuse
36
+ * Note: In anonymous mode it is not required to identify
37
+ */
38
+ readonly userId?: string_user_id;
29
39
  /**
30
40
  * Configuration for the LLM tools
31
41
  */
@@ -38,4 +48,4 @@ export type PromptbookServer_Prompt_AnonymousRequest = {
38
48
  /**
39
49
  * TODO: [ðŸ‘Ą] DRY `PromptbookServer_Prompt_Request` and `PromptbookServer_ListModels_Request`
40
50
  * TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
41
- */
51
+ */
@@ -1,7 +1,7 @@
1
1
  import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions';
2
- import type { client_id } from '../../../types/typeAliases';
3
2
  import type { string_base_url } from '../../../types/typeAliases';
4
3
  import type { string_uri } from '../../../types/typeAliases';
4
+ import type { string_user_id } from '../../../types/typeAliases';
5
5
  import type { LlmToolsConfiguration } from '../../_common/LlmToolsConfiguration';
6
6
  /**
7
7
  * Options for `RemoteLlmExecutionTools`
@@ -34,15 +34,24 @@ export type RemoteLlmExecutionToolsOptions = CommonExecutionToolsOptions & {
34
34
  * Configuration for the LLM tools
35
35
  */
36
36
  readonly llmToolsConfiguration: LlmToolsConfiguration;
37
+ /**
38
+ * Identifier of the end user
39
+ *
40
+ * Note: this is passed to the certain model providers to identify misuse
41
+ * Note: In anonymous mode it is not required to identify
42
+ */
43
+ readonly userId?: string_user_id;
37
44
  } | {
38
45
  /**
39
46
  * Use anonymous server with client identification and fixed collection
40
47
  */
41
48
  isAnonymous: false;
42
49
  /**
43
- * Your client ID
50
+ * Identifier of the end user
51
+ *
52
+ * Note: this is passed to the certain model providers to identify misuse
44
53
  */
45
- readonly clientId: client_id;
54
+ readonly userId: string_user_id;
46
55
  });
47
56
  /**
48
57
  * TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
@@ -1,8 +1,8 @@
1
1
  import type { PipelineCollection } from '../../../collection/PipelineCollection';
2
2
  import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions';
3
3
  import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
4
- import type { client_id } from '../../../types/typeAliases';
5
4
  import type { string_uri } from '../../../types/typeAliases';
5
+ import type { string_user_id } from '../../../types/typeAliases';
6
6
  /**
7
7
  * @@@
8
8
  *
@@ -50,7 +50,7 @@ export type CollectionRemoteServerOptions = {
50
50
  /**
51
51
  * Creates llm execution tools for each client
52
52
  */
53
- createLlmExecutionTools(clientId: client_id): LlmExecutionTools;
53
+ createLlmExecutionTools(userId: string_user_id | undefined): LlmExecutionTools;
54
54
  };
55
55
  /**
56
56
  * TODO: Constrain anonymous mode for specific models / providers
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env ts-node
2
- export {};
2
+ import '../../openai/register-constructor';
@@ -391,11 +391,9 @@ export type string_uuid = string & {
391
391
  readonly _type: 'uuid';
392
392
  };
393
393
  /**
394
- * Branded type client id
394
+ * End user identifier;
395
395
  */
396
- export type client_id = string & {
397
- readonly _type: 'client_id';
398
- };
396
+ export type string_user_id = string;
399
397
  /**
400
398
  * Semantic helper
401
399
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/openai",
3
- "version": "0.67.0-3",
3
+ "version": "0.67.0-4",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -47,7 +47,7 @@
47
47
  "module": "./esm/index.es.js",
48
48
  "typings": "./esm/typings/src/_packages/openai.index.d.ts",
49
49
  "peerDependencies": {
50
- "@promptbook/core": "0.67.0-3"
50
+ "@promptbook/core": "0.67.0-4"
51
51
  },
52
52
  "dependencies": {
53
53
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -14,7 +14,7 @@
14
14
  /**
15
15
  * The version of the Promptbook library
16
16
  */
17
- var PROMPTBOOK_VERSION = '0.67.0-2';
17
+ var PROMPTBOOK_VERSION = '0.67.0-3';
18
18
  // TODO: !!!! List here all the versions and annotate + put into script
19
19
 
20
20
  /*! *****************************************************************************