@crewdle/web-sdk-types 1.0.23 → 1.0.24

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.
Files changed (147) hide show
  1. package/dist/core/cluster/Cluster.d.ts +16 -1
  2. package/dist/core/sdk/SDKOptions.d.ts +6 -1
  3. package/dist/core/stream/ContentType.d.ts +5 -1
  4. package/dist/core/stream/ContentType.js +4 -0
  5. package/dist/external-storage/ExternalStorageConnection.d.ts +54 -0
  6. package/dist/external-storage/ExternalStorageConnection.js +10 -0
  7. package/dist/external-storage/ExternalStorageConnectionConnector.d.ts +25 -0
  8. package/dist/external-storage/ExternalStorageConnectionConnectorConstructor.d.ts +6 -0
  9. package/dist/external-storage/ExternalStorageListOptions.d.ts +10 -0
  10. package/dist/external-storage/index.d.ts +4 -0
  11. package/dist/external-storage/index.js +4 -0
  12. package/dist/generative-ai/GenerativeAIContext.d.ts +42 -0
  13. package/dist/generative-ai/GenerativeAIJobType.d.ts +18 -0
  14. package/dist/{ai → generative-ai}/GenerativeAIWorkerConnector.d.ts +3 -1
  15. package/dist/generative-ai/IIndex.d.ts +18 -0
  16. package/dist/generative-ai/IIndex.js +1 -0
  17. package/dist/generative-ai/NLPLibraryConnector.js +1 -0
  18. package/dist/generative-ai/NLPLibraryConnectorConstructor.js +1 -0
  19. package/dist/{ai → generative-ai}/index.d.ts +6 -3
  20. package/dist/{ai → generative-ai}/index.js +6 -3
  21. package/dist/generative-ai/job/JobParametersGenerativeAI.d.ts +15 -0
  22. package/dist/generative-ai/job/JobParametersGenerativeAI.js +1 -0
  23. package/dist/generative-ai/job/JobResultGenerativeAI.d.ts +17 -0
  24. package/dist/generative-ai/job/JobResultGenerativeAI.js +1 -0
  25. package/dist/generative-ai/job/index.d.ts +2 -0
  26. package/dist/generative-ai/job/index.js +2 -0
  27. package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentCreateJobParameters.d.ts +20 -0
  28. package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentCreateJobParameters.js +1 -0
  29. package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentJob.d.ts +25 -0
  30. package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentJob.js +1 -0
  31. package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentResult.d.ts +24 -0
  32. package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentResult.js +1 -0
  33. package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentWorkerParameters.d.ts +20 -0
  34. package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentWorkerParameters.js +1 -0
  35. package/dist/generative-ai/jobs/download-document/index.d.ts +4 -0
  36. package/dist/generative-ai/jobs/download-document/index.js +4 -0
  37. package/dist/generative-ai/jobs/generic/GenerativeAICreateJobParameters.d.ts +11 -0
  38. package/dist/generative-ai/jobs/generic/GenerativeAICreateJobParameters.js +1 -0
  39. package/dist/generative-ai/jobs/generic/GenerativeAIJob.d.ts +10 -0
  40. package/dist/generative-ai/jobs/generic/GenerativeAIJob.js +1 -0
  41. package/dist/generative-ai/jobs/generic/GenerativeAIOptions.d.ts +7 -0
  42. package/dist/generative-ai/jobs/generic/GenerativeAIOptions.js +6 -0
  43. package/dist/generative-ai/jobs/generic/GenerativeAIWorkerConnectorParameters.d.ts +11 -0
  44. package/dist/generative-ai/jobs/generic/GenerativeAIWorkerConnectorParameters.js +1 -0
  45. package/dist/generative-ai/jobs/generic/GenerativeAIWorkerParameters.d.ts +12 -0
  46. package/dist/generative-ai/jobs/generic/GenerativeAIWorkerParameters.js +1 -0
  47. package/dist/generative-ai/jobs/generic/index.d.ts +5 -0
  48. package/dist/generative-ai/jobs/generic/index.js +5 -0
  49. package/dist/generative-ai/jobs/index.d.ts +4 -0
  50. package/dist/generative-ai/jobs/index.js +4 -0
  51. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptCreateJobParameters.d.ts +21 -0
  52. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptCreateJobParameters.js +1 -0
  53. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptJob.d.ts +26 -0
  54. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptJob.js +1 -0
  55. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptOptions.d.ts +33 -0
  56. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptOptions.js +1 -0
  57. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptResult.d.ts +31 -0
  58. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptResult.js +1 -0
  59. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptWorkerConnectorParameters.d.ts +17 -0
  60. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptWorkerConnectorParameters.js +1 -0
  61. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptWorkerParameters.d.ts +20 -0
  62. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptWorkerParameters.js +1 -0
  63. package/dist/generative-ai/jobs/prompt/GenerativeAIWorkerConnectorPromptResult.d.ts +7 -0
  64. package/dist/generative-ai/jobs/prompt/GenerativeAIWorkerConnectorPromptResult.js +1 -0
  65. package/dist/generative-ai/jobs/prompt/index.d.ts +9 -0
  66. package/dist/generative-ai/jobs/prompt/index.js +9 -0
  67. package/dist/generative-ai/jobs/prompt/options/PromptFunction.d.ts +22 -0
  68. package/dist/generative-ai/jobs/prompt/options/PromptFunction.js +1 -0
  69. package/dist/generative-ai/jobs/prompt/options/PromptFunctionParams.d.ts +11 -0
  70. package/dist/generative-ai/jobs/prompt/options/PromptFunctionParams.js +1 -0
  71. package/dist/generative-ai/jobs/prompt/options/PromptFunctionParamsType.d.ts +17 -0
  72. package/dist/generative-ai/jobs/prompt/options/PromptFunctionParamsType.js +18 -0
  73. package/dist/generative-ai/jobs/prompt/options/PromptHistory.d.ts +16 -0
  74. package/dist/generative-ai/jobs/prompt/options/PromptHistory.js +2 -0
  75. package/dist/generative-ai/jobs/prompt/options/PromptSource.d.ts +14 -0
  76. package/dist/generative-ai/jobs/prompt/options/PromptSource.js +16 -0
  77. package/dist/generative-ai/jobs/prompt/options/index.d.ts +5 -0
  78. package/dist/generative-ai/jobs/prompt/options/index.js +5 -0
  79. package/dist/generative-ai/jobs/prompt/result/PromptTypeText.d.ts +4 -0
  80. package/dist/generative-ai/jobs/prompt/result/PromptTypeText.js +1 -0
  81. package/dist/generative-ai/jobs/prompt/result/PromptTypeVector.d.ts +4 -0
  82. package/dist/generative-ai/jobs/prompt/result/PromptTypeVector.js +1 -0
  83. package/dist/generative-ai/jobs/prompt/result/index.d.ts +2 -0
  84. package/dist/generative-ai/jobs/prompt/result/index.js +2 -0
  85. package/dist/generative-ai/jobs/rating/GenerativeAIRating.d.ts +8 -0
  86. package/dist/generative-ai/jobs/rating/GenerativeAIRating.js +9 -0
  87. package/dist/generative-ai/jobs/rating/GenerativeAIRatingCreateJobParameters.d.ts +26 -0
  88. package/dist/generative-ai/jobs/rating/GenerativeAIRatingCreateJobParameters.js +1 -0
  89. package/dist/generative-ai/jobs/rating/GenerativeAIRatingJob.d.ts +25 -0
  90. package/dist/generative-ai/jobs/rating/GenerativeAIRatingJob.js +1 -0
  91. package/dist/generative-ai/jobs/rating/GenerativeAIRatingOptions.d.ts +16 -0
  92. package/dist/generative-ai/jobs/rating/GenerativeAIRatingOptions.js +1 -0
  93. package/dist/generative-ai/jobs/rating/GenerativeAIRatingResult.d.ts +18 -0
  94. package/dist/generative-ai/jobs/rating/GenerativeAIRatingResult.js +1 -0
  95. package/dist/generative-ai/jobs/rating/GenerativeAIRatingStatus.d.ts +8 -0
  96. package/dist/generative-ai/jobs/rating/GenerativeAIRatingStatus.js +9 -0
  97. package/dist/generative-ai/jobs/rating/GenerativeAIRatingWorkerParameters.d.ts +29 -0
  98. package/dist/generative-ai/jobs/rating/GenerativeAIRatingWorkerParameters.js +1 -0
  99. package/dist/generative-ai/jobs/rating/index.d.ts +7 -0
  100. package/dist/generative-ai/jobs/rating/index.js +7 -0
  101. package/dist/generative-ai/search/SearchConnector.js +1 -0
  102. package/dist/generative-ai/search/SearchConnectorConstructor.js +1 -0
  103. package/dist/generative-ai/search/SearchResult.d.ts +19 -0
  104. package/dist/generative-ai/search/SearchResult.js +5 -0
  105. package/dist/generative-ai/search/index.d.ts +3 -0
  106. package/dist/generative-ai/search/index.js +3 -0
  107. package/dist/generative-ai/union-types/CreateAIJobParameters.d.ts +8 -0
  108. package/dist/generative-ai/union-types/CreateAIJobParameters.js +1 -0
  109. package/dist/generative-ai/union-types/GenerativeAIJob.d.ts +8 -0
  110. package/dist/generative-ai/union-types/GenerativeAIJob.js +1 -0
  111. package/dist/generative-ai/union-types/GenerativeAIJobOptions.d.ts +7 -0
  112. package/dist/generative-ai/union-types/GenerativeAIJobOptions.js +1 -0
  113. package/dist/generative-ai/union-types/GenerativeAIJobResult.d.ts +9 -0
  114. package/dist/generative-ai/union-types/GenerativeAIJobResult.js +1 -0
  115. package/dist/generative-ai/union-types/GenerativeAIWorkerConnectorParameters.d.ts +6 -0
  116. package/dist/generative-ai/union-types/GenerativeAIWorkerConnectorParameters.js +1 -0
  117. package/dist/generative-ai/union-types/GenerativeAIWorkerConnectorResult.d.ts +12 -0
  118. package/dist/generative-ai/union-types/GenerativeAIWorkerConnectorResult.js +1 -0
  119. package/dist/generative-ai/union-types/GenerativeAIWorkerParameters.d.ts +8 -0
  120. package/dist/generative-ai/union-types/GenerativeAIWorkerParameters.js +1 -0
  121. package/dist/generative-ai/union-types/index.d.ts +7 -0
  122. package/dist/generative-ai/union-types/index.js +7 -0
  123. package/dist/graph-database/GraphDatabase.d.ts +1 -1
  124. package/dist/graph-database/GraphDatabaseConnector.d.ts +1 -1
  125. package/dist/index.d.ts +2 -1
  126. package/dist/index.js +2 -1
  127. package/dist/object-storage/ObjectStoreBucket.d.ts +1 -1
  128. package/dist/vector-database/VectorDatabase.d.ts +1 -1
  129. package/dist/vector-database/VectorDatabaseConnector.d.ts +1 -1
  130. package/package.json +1 -1
  131. package/dist/ai/GenerativeAI.d.ts +0 -328
  132. package/dist/ai/GenerativeAI.js +0 -53
  133. package/dist/ai/GenerativeAIContext.d.ts +0 -132
  134. /package/dist/{ai/GenerativeAIContext.js → external-storage/ExternalStorageConnectionConnector.js} +0 -0
  135. /package/dist/{ai/GenerativeAIWorker.js → external-storage/ExternalStorageConnectionConnectorConstructor.js} +0 -0
  136. /package/dist/{ai/GenerativeAIWorkerConnectorConstructor.js → external-storage/ExternalStorageListOptions.js} +0 -0
  137. /package/dist/{ai/NLPLibraryConnector.js → generative-ai/GenerativeAIContext.js} +0 -0
  138. /package/dist/{ai/NLPLibraryConnectorConstructor.js → generative-ai/GenerativeAIJobType.js} +0 -0
  139. /package/dist/{ai → generative-ai}/GenerativeAIWorker.d.ts +0 -0
  140. /package/dist/{ai/SearchConnector.js → generative-ai/GenerativeAIWorker.js} +0 -0
  141. /package/dist/{ai → generative-ai}/GenerativeAIWorkerConnector.js +0 -0
  142. /package/dist/{ai → generative-ai}/GenerativeAIWorkerConnectorConstructor.d.ts +0 -0
  143. /package/dist/{ai/SearchConnectorConstructor.js → generative-ai/GenerativeAIWorkerConnectorConstructor.js} +0 -0
  144. /package/dist/{ai → generative-ai}/NLPLibraryConnector.d.ts +0 -0
  145. /package/dist/{ai → generative-ai}/NLPLibraryConnectorConstructor.d.ts +0 -0
  146. /package/dist/{ai → generative-ai/search}/SearchConnector.d.ts +0 -0
  147. /package/dist/{ai → generative-ai/search}/SearchConnectorConstructor.d.ts +0 -0
@@ -0,0 +1,8 @@
1
+ import { IGenerativeAIDownloadDocumentJob } from '../jobs/download-document';
2
+ import { IGenerativeAIPromptJob } from '../jobs/prompt';
3
+ import { IGenerativeAIRatingJob } from '../jobs/rating';
4
+ /**
5
+ * Represents a Generative AI job.
6
+ * @category AI
7
+ */
8
+ export type GenerativeAIJob = IGenerativeAIPromptJob | IGenerativeAIRatingJob | IGenerativeAIDownloadDocumentJob;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { IGenerativeAIPromptOptions } from '../jobs/prompt';
2
+ import { IGenerativeAIRatingOptions } from '../jobs/rating';
3
+ /**
4
+ * The AI options to parameterize the AI job.
5
+ * @category AI
6
+ */
7
+ export type GenerativeAIJobOptions = IGenerativeAIPromptOptions | IGenerativeAIRatingOptions;
@@ -0,0 +1,9 @@
1
+ import { IGenerativeAIDownloadDocumentResult } from '../jobs/download-document';
2
+ import { IGenerativeAIPromptResult } from '../jobs/prompt';
3
+ import { IGenerativeAIRatingResult } from '../jobs/rating';
4
+ /**
5
+ * Union type for an AI job result.
6
+ * Represents the result of an AI job.
7
+ * @category AI
8
+ */
9
+ export type GenerativeAIJobResult = IGenerativeAIPromptResult | IGenerativeAIRatingResult | IGenerativeAIDownloadDocumentResult;
@@ -0,0 +1,6 @@
1
+ import { IGenerativeAIPromptWorkerConnectorParameters } from '../jobs/prompt/GenerativeAIPromptWorkerConnectorParameters';
2
+ /**
3
+ * Union type for AI worker connector parameters.
4
+ * @category AI
5
+ */
6
+ export type GenerativeAIWorkerConnectorParameters = IGenerativeAIPromptWorkerConnectorParameters;
@@ -0,0 +1,12 @@
1
+ import { IGenerativeAIWorkerConnectorPromptResult } from '../jobs/prompt';
2
+ /**
3
+ * Union type for AI worker connector result.
4
+ * @category AI
5
+ */
6
+ export type GenerativeAIWorkerConnectorResult = IGenerativeAIWorkerConnectorPromptResult;
7
+ /**
8
+ * Helper type for AI worker connector result enum type.
9
+ * This is required in connectors that cannot import the AIJobType enum.
10
+ * @category AI
11
+ */
12
+ export type GenerativeAIWorkerConnectorTypes = GenerativeAIWorkerConnectorResult['type'];
@@ -0,0 +1,8 @@
1
+ import { IGenerativeAIDownloadDocumentWorkerParameters } from '../jobs/download-document';
2
+ import { IGenerativeAIPromptWorkerParameters } from '../jobs/prompt';
3
+ import { IGenerativeAIRatingWorkerParameters } from '../jobs/rating';
4
+ /**
5
+ * Union type for AI job worker parameters.
6
+ * @category AI
7
+ */
8
+ export type GenerativeAIWorkerParameters = IGenerativeAIPromptWorkerParameters | IGenerativeAIRatingWorkerParameters | IGenerativeAIDownloadDocumentWorkerParameters;
@@ -0,0 +1,7 @@
1
+ export * from './CreateAIJobParameters';
2
+ export * from './GenerativeAIJob';
3
+ export * from './GenerativeAIJobOptions';
4
+ export * from './GenerativeAIJobResult';
5
+ export * from './GenerativeAIWorkerConnectorResult';
6
+ export * from './GenerativeAIWorkerConnectorParameters';
7
+ export * from './GenerativeAIWorkerParameters';
@@ -0,0 +1,7 @@
1
+ export * from './CreateAIJobParameters';
2
+ export * from './GenerativeAIJob';
3
+ export * from './GenerativeAIJobOptions';
4
+ export * from './GenerativeAIJobResult';
5
+ export * from './GenerativeAIWorkerConnectorResult';
6
+ export * from './GenerativeAIWorkerConnectorParameters';
7
+ export * from './GenerativeAIWorkerParameters';
@@ -1,4 +1,4 @@
1
- import { IIndex } from '../ai';
1
+ import { IIndex } from '../generative-ai';
2
2
  import { IDataStream } from '../core';
3
3
  /**
4
4
  * The interface for the graph database.
@@ -1,4 +1,4 @@
1
- import { IIndex } from '../ai';
1
+ import { IIndex } from '../generative-ai';
2
2
  /**
3
3
  * The graph database connector interface.
4
4
  * @category Connector
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from './media-stream';
4
4
  export * from './object-storage';
5
5
  export * from './pubsub';
6
6
  export * from './job';
7
- export * from './ai';
7
+ export * from './generative-ai';
8
8
  export * from './vector-database';
9
9
  export * from './graph-database';
10
+ export * from './external-storage';
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ export * from './media-stream';
4
4
  export * from './object-storage';
5
5
  export * from './pubsub';
6
6
  export * from './job';
7
- export * from './ai';
7
+ export * from './generative-ai';
8
8
  export * from './vector-database';
9
9
  export * from './graph-database';
10
+ export * from './external-storage';
@@ -52,7 +52,7 @@ export interface IObjectStoreBucket extends IDataStream {
52
52
  /**
53
53
  * List the objects and folders of the bucket.
54
54
  * @param path The path of the folder.
55
- * @param recursive Whether to list the objects and folders recursively.
55
+ * @param options The optional options for listing the objects and folders.
56
56
  * @returns The list of objects and folders.
57
57
  */
58
58
  list(path: string, options?: IObjectStoreListOptions): Promise<ObjectDescriptor[]>;
@@ -1,4 +1,4 @@
1
- import { IIndex, ISearchResult } from '../ai';
1
+ import { IIndex, ISearchResult } from '../generative-ai';
2
2
  import { IDataStream } from '../core';
3
3
  /**
4
4
  * The interface for the vector database.
@@ -1,4 +1,4 @@
1
- import { IIndex, ISearchResult } from '../ai';
1
+ import { IIndex, ISearchResult } from '../generative-ai';
2
2
  /**
3
3
  * The vector database connector interface.
4
4
  * @category Connector
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewdle/web-sdk-types",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "The Crewdle Mist Web SDK public types and interfaces",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,328 +0,0 @@
1
- import { IJobParameters, IJobResult } from '../job';
2
- /**
3
- * The AI prompt rating Enum
4
- * @category AI
5
- */
6
- export declare enum PromptRating {
7
- Up = "up",
8
- Down = "down"
9
- }
10
- /**
11
- * The AI prompt source Enum
12
- * @category AI
13
- */
14
- export declare enum PromptSource {
15
- /**
16
- * The prompt was generated by the AI.
17
- */
18
- AI = "ai",
19
- /**
20
- * The prompt was generated by a human.
21
- */
22
- Human = "human"
23
- }
24
- /**
25
- * The AI prompt history Interface
26
- * Represents the history of a prompt.
27
- * @category AI
28
- */
29
- export interface IPromptHistory {
30
- /**
31
- * The source of the prompt.
32
- */
33
- source: PromptSource;
34
- /**
35
- * The prompt.
36
- */
37
- message: string;
38
- }
39
- /**
40
- * The type of parameters supported for agentic functions
41
- */
42
- export declare enum PromptFunctionParamsType {
43
- /**
44
- * The parameter is a string.
45
- */
46
- String = "string",
47
- /**
48
- * The parameter is a number.
49
- */
50
- Number = "number",
51
- /**
52
- * The parameter is a boolean.
53
- */
54
- Boolean = "boolean"
55
- }
56
- /**
57
- * The AI prompt function parameters Interface
58
- * Represents the parameters for a prompt function.
59
- * @category AI
60
- */
61
- export interface IPromptFunctionParams {
62
- [key: string]: {
63
- type: PromptFunctionParamsType;
64
- };
65
- }
66
- /**
67
- * The AI prompt function Interface
68
- * Represents a function that can be called by the LLM.
69
- * @category AI
70
- */
71
- export interface IPromptFunction {
72
- /**
73
- * The function description.
74
- */
75
- description: string;
76
- /**
77
- * The function parameters.
78
- */
79
- params?: IPromptFunctionParams;
80
- /**
81
- * The function callback.
82
- */
83
- callback: (params?: {
84
- [key: string]: string | number | boolean;
85
- }) => string | Promise<string>;
86
- }
87
- export type AIJobOptions = IPromptOptions | IRatingOptions;
88
- /**
89
- * The AI options Interface
90
- * Represents the options for an AI job.
91
- * @category AI
92
- */
93
- export interface IAIOptions {
94
- /**
95
- * The thread id
96
- */
97
- threadId?: string;
98
- }
99
- /**
100
- * The AI prompt options Interface
101
- * Represents the options for an AI prompt.
102
- * @category AI
103
- */
104
- export interface IPromptOptions extends IAIOptions {
105
- /**
106
- * The instructions for the AI job.
107
- */
108
- instructions?: string;
109
- /**
110
- * The context for the AI job.
111
- */
112
- history?: IPromptHistory[];
113
- /**
114
- * The maximum number of tokens to generate.
115
- */
116
- maxTokens?: number;
117
- /**
118
- * The temperature for the LLM.
119
- */
120
- temperature?: number;
121
- /**
122
- * The functions that can be called by the LLM.
123
- */
124
- functions?: Map<string, IPromptFunction>;
125
- }
126
- /**
127
- * The AI rating options Interface
128
- * Represents the options for an AI rating.
129
- * @category AI
130
- */
131
- export interface IRatingOptions extends IAIOptions {
132
- }
133
- /**
134
- * The AI prompt type text
135
- */
136
- export type PromptTypeText = string | string[];
137
- /**
138
- * The AI prompt type vector
139
- */
140
- export type PromptTypeVector = number[];
141
- /**
142
- * The AI prompt result Interface
143
- * Represents the result of an AI prompt.
144
- * @category AI
145
- */
146
- export interface IGenerativeAIPromptResult extends IJobResultAI {
147
- /**
148
- * The prompt AI job type.
149
- */
150
- type: AIJobType.Prompt;
151
- /**
152
- * The output of the AI job.
153
- */
154
- output?: PromptTypeText | PromptTypeVector;
155
- /**
156
- * The relevant context used by the AI job.
157
- */
158
- context?: ISearchResult[];
159
- /**
160
- * The tokens used by the AI job.
161
- */
162
- inputTokens?: number;
163
- /**
164
- * The tokens generated by the AI job.
165
- */
166
- outputTokens?: number;
167
- }
168
- /**
169
- * The AI rating status Enum
170
- * @category AI
171
- */
172
- export declare enum AIRatingStatus {
173
- Success = "success",
174
- Error = "error"
175
- }
176
- /**
177
- * The AI rating result Interface
178
- * Represents the result of an AI rating.
179
- * @category AI
180
- */
181
- export interface IGenerativeAIRatingResult extends IJobResultAI {
182
- /**
183
- * The rating AI job type.
184
- */
185
- type: AIJobType.Rating;
186
- /**
187
- * The status of the rating.
188
- */
189
- status: AIRatingStatus;
190
- }
191
- export type GenerativeAIJobResult = IGenerativeAIPromptResult | IGenerativeAIRatingResult;
192
- /**
193
- * The AI job result Interface
194
- * Represents the result of an AI job.
195
- * @category AI
196
- */
197
- export interface IJobResultAI extends IJobResult {
198
- /**
199
- * The AI job type.
200
- */
201
- type: AIJobType;
202
- /**
203
- * The index of the output, in case of partial results.
204
- */
205
- index?: number;
206
- }
207
- /**
208
- * The AI job type Enum
209
- * @category AI
210
- */
211
- export declare const enum AIJobType {
212
- /**
213
- * The AI job generates a prompt.
214
- */
215
- Prompt = "prompt",
216
- /**
217
- * The AI job rates a prompt.
218
- */
219
- Rating = "rate"
220
- }
221
- /**
222
- * The AI job parameters Interface
223
- * Parameters for AI job type.
224
- * @category AI
225
- */
226
- export interface IJobParametersGenerativeAI extends IJobParameters, IPromptOptions, IRatingOptions {
227
- /**
228
- * The AI job type.
229
- */
230
- type: AIJobType;
231
- /**
232
- * The thread id, if within a conversation.
233
- */
234
- threadId: string;
235
- }
236
- export type GenerativeAIWorkerParameters = IGenerativeAIPromptWorkerParameters | IGenerativeAIRatingWorkerParameters;
237
- export interface IGenerativeAIWorkerParameters extends IJobParametersGenerativeAI {
238
- /**
239
- * The AI job type.
240
- */
241
- type: AIJobType;
242
- }
243
- export interface IGenerativeAIPromptWorkerParameters extends IGenerativeAIWorkerParameters {
244
- /**
245
- * The AI job type.
246
- */
247
- type: AIJobType.Prompt;
248
- /**
249
- * The prompt for the AI job.
250
- */
251
- prompt: string;
252
- }
253
- export interface IGenerativeAIRatingWorkerParameters extends IGenerativeAIWorkerParameters {
254
- /**
255
- * The AI job type.
256
- */
257
- type: AIJobType.Rating;
258
- /**
259
- * The job ID.
260
- */
261
- jobId: string;
262
- /**
263
- * The rating for the AI prompt.
264
- */
265
- rating: PromptRating;
266
- /**
267
- * The feedback for the AI prompt
268
- */
269
- feedback?: string;
270
- }
271
- export type GenerativeAIWorkerConnectorParameters = IGenerativeAIPromptWorkerConnectorParameters;
272
- export type GenerativeAIWorkerConnectorResult = IGenerativeAIWorkerConnectorPromptResult;
273
- export type GenerativeAIWorkerConnectorTypes = GenerativeAIWorkerConnectorResult['type'];
274
- export interface IGenerativeAIWorkerConnectorPromptResult extends IGenerativeAIPromptResult {
275
- }
276
- export interface IGenerativeAIWorkerConnectorParameters {
277
- /**
278
- * The AI job type.
279
- */
280
- type: AIJobType;
281
- }
282
- export interface IGenerativeAIPromptWorkerConnectorParameters extends IGenerativeAIWorkerConnectorParameters, IPromptOptions {
283
- /**
284
- * The AI job type.
285
- */
286
- type: AIJobType.Prompt;
287
- /**
288
- * The prompt for the AI job.
289
- */
290
- prompt: string;
291
- }
292
- /**
293
- * Represents a search result.
294
- * @category AI
295
- */
296
- export interface ISearchResult {
297
- /**
298
- * The content of the search result.
299
- */
300
- content: string;
301
- /**
302
- * The relevance of the search result.
303
- * The relevance is a number between 0 and 1, where 1 is the most relevant.
304
- */
305
- relevance: number;
306
- /**
307
- * The path name of the document containing the search result.
308
- */
309
- pathName: string;
310
- }
311
- /**
312
- * Represents a content index.
313
- * @category AI
314
- */
315
- export interface IIndex {
316
- /**
317
- * The content of the index.
318
- */
319
- content: string;
320
- /**
321
- * The start index of the content.
322
- */
323
- start: number;
324
- /**
325
- * The length of the content.
326
- */
327
- length: number;
328
- }
@@ -1,53 +0,0 @@
1
- /**
2
- * The AI prompt rating Enum
3
- * @category AI
4
- */
5
- export var PromptRating;
6
- (function (PromptRating) {
7
- PromptRating["Up"] = "up";
8
- PromptRating["Down"] = "down";
9
- })(PromptRating || (PromptRating = {}));
10
- /**
11
- * The AI prompt source Enum
12
- * @category AI
13
- */
14
- export var PromptSource;
15
- (function (PromptSource) {
16
- /**
17
- * The prompt was generated by the AI.
18
- */
19
- PromptSource["AI"] = "ai";
20
- /**
21
- * The prompt was generated by a human.
22
- */
23
- PromptSource["Human"] = "human";
24
- })(PromptSource || (PromptSource = {}));
25
- ;
26
- ;
27
- /**
28
- * The type of parameters supported for agentic functions
29
- */
30
- export var PromptFunctionParamsType;
31
- (function (PromptFunctionParamsType) {
32
- /**
33
- * The parameter is a string.
34
- */
35
- PromptFunctionParamsType["String"] = "string";
36
- /**
37
- * The parameter is a number.
38
- */
39
- PromptFunctionParamsType["Number"] = "number";
40
- /**
41
- * The parameter is a boolean.
42
- */
43
- PromptFunctionParamsType["Boolean"] = "boolean";
44
- })(PromptFunctionParamsType || (PromptFunctionParamsType = {}));
45
- /**
46
- * The AI rating status Enum
47
- * @category AI
48
- */
49
- export var AIRatingStatus;
50
- (function (AIRatingStatus) {
51
- AIRatingStatus["Success"] = "success";
52
- AIRatingStatus["Error"] = "error";
53
- })(AIRatingStatus || (AIRatingStatus = {}));
@@ -1,132 +0,0 @@
1
- import { AIJobType, IPromptOptions, IGenerativeAIPromptResult, IRatingOptions, IGenerativeAIRatingResult, PromptRating } from '.';
2
- /**
3
- * Represents bounded prompt job ready to be run or streamed.
4
- */
5
- export interface IGenerativeAIPromptJob {
6
- /**
7
- * The job ID.
8
- */
9
- id: string;
10
- /**
11
- * The prompt to be processed
12
- */
13
- prompt: string;
14
- /**
15
- * The options for the prompt.
16
- */
17
- options: IPromptOptions;
18
- /**
19
- * Run the prompt job.
20
- * @returns A promise that resolves with the result
21
- */
22
- run: () => Promise<IGenerativeAIPromptResult>;
23
- /**
24
- * Stream the prompt job.
25
- * @returns An async generator that yields the result
26
- */
27
- stream: () => AsyncGenerator<IGenerativeAIPromptResult>;
28
- }
29
- /**
30
- * Represents a Generative AI job.
31
- */
32
- export type GenerativeAIJob = IGenerativeAIPromptJob | IGenerativeAIRatingJob;
33
- /**
34
- * Represents bounded rating job ready to be run or streamed.
35
- */
36
- export interface IGenerativeAIRatingJob {
37
- /**
38
- * The job ID.
39
- */
40
- id: string;
41
- /**
42
- * The rating for the job.
43
- */
44
- rating: PromptRating;
45
- /**
46
- * The feedback for the job.
47
- */
48
- feedback?: string;
49
- /**
50
- * The options for the rating.
51
- */
52
- options: IRatingOptions;
53
- /**
54
- * Run the rating job.
55
- * @returns A promise that resolves with the result
56
- */
57
- rate: () => Promise<IGenerativeAIRatingResult>;
58
- }
59
- /**
60
- * Represents the parameters of an AI job.
61
- */
62
- export type CreateAIJobParameters = IGenerativeAIPromptParameters | IGenerativeAIRatingParameters;
63
- /**
64
- * Represents the parameters of a prompt job.
65
- */
66
- export interface IGenerativeAIPromptParameters {
67
- /**
68
- * The prompt job type.
69
- */
70
- type: AIJobType.Prompt;
71
- /**
72
- * The prompt to be processed.
73
- */
74
- prompt: string;
75
- /**
76
- * The options for the prompt.
77
- */
78
- options?: IPromptOptions;
79
- }
80
- /**
81
- * Represents the parameters of a rating job.
82
- */
83
- export interface IGenerativeAIRatingParameters {
84
- /**
85
- * The rating job type.
86
- */
87
- type: AIJobType.Rating;
88
- /**
89
- * The job ID associated with the message.
90
- */
91
- jobId: string;
92
- /**
93
- * The rating of the prompt.
94
- */
95
- rating: PromptRating;
96
- /**
97
- * The feedback for the prompt.
98
- */
99
- feedback?: string;
100
- /**
101
- * The options for the rating.
102
- */
103
- options?: IRatingOptions;
104
- }
105
- /**
106
- * Represents a context for a Generative AI service.
107
- * @category AI
108
- */
109
- export interface IGenerativeAIContext {
110
- /**
111
- * Create an AI job. The job is bounded to the context.
112
- * @param parameters The parameters of the AI job.
113
- * @returns The job ready to be run or streamed.
114
- */
115
- createAIJob(parameters: IGenerativeAIPromptParameters): IGenerativeAIPromptJob;
116
- createAIJob(parameters: IGenerativeAIRatingParameters): IGenerativeAIRatingJob;
117
- /**
118
- * Rate a prompt.
119
- * @param parameters The parameters of the rating job.
120
- * @returns A promise that resolves with the result.
121
- */
122
- ratePrompt(parameters: IGenerativeAIRatingParameters): Promise<IGenerativeAIRatingResult>;
123
- /**
124
- * Get the data bucket IDs.
125
- * @returns An array of data bucket IDs.
126
- */
127
- getDataBucketIds(): Promise<string[]>;
128
- /**
129
- * Close the Generative AI Context.
130
- */
131
- close(): void;
132
- }