@crewdle/web-sdk-types 1.0.22 → 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 (146) 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 +8 -4
  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/{ai/GenerativeAI.js → generative-ai/jobs/prompt/options/PromptSource.js} +0 -1
  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 +6 -1
  124. package/dist/graph-database/GraphDatabaseConnector.d.ts +6 -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 -186
  132. package/dist/ai/GenerativeAIContext.d.ts +0 -50
  133. /package/dist/{ai/GenerativeAIContext.js → external-storage/ExternalStorageConnectionConnector.js} +0 -0
  134. /package/dist/{ai/GenerativeAIWorker.js → external-storage/ExternalStorageConnectionConnectorConstructor.js} +0 -0
  135. /package/dist/{ai/GenerativeAIWorkerConnectorConstructor.js → external-storage/ExternalStorageListOptions.js} +0 -0
  136. /package/dist/{ai/NLPLibraryConnector.js → generative-ai/GenerativeAIContext.js} +0 -0
  137. /package/dist/{ai/NLPLibraryConnectorConstructor.js → generative-ai/GenerativeAIJobType.js} +0 -0
  138. /package/dist/{ai → generative-ai}/GenerativeAIWorker.d.ts +0 -0
  139. /package/dist/{ai/SearchConnector.js → generative-ai/GenerativeAIWorker.js} +0 -0
  140. /package/dist/{ai → generative-ai}/GenerativeAIWorkerConnector.js +0 -0
  141. /package/dist/{ai → generative-ai}/GenerativeAIWorkerConnectorConstructor.d.ts +0 -0
  142. /package/dist/{ai/SearchConnectorConstructor.js → generative-ai/GenerativeAIWorkerConnectorConstructor.js} +0 -0
  143. /package/dist/{ai → generative-ai}/NLPLibraryConnector.d.ts +0 -0
  144. /package/dist/{ai → generative-ai}/NLPLibraryConnectorConstructor.d.ts +0 -0
  145. /package/dist/{ai → generative-ai/search}/SearchConnector.d.ts +0 -0
  146. /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.
@@ -31,6 +31,11 @@ export interface IGraphDatabase extends IDataStream {
31
31
  * @param to The node to add the edge to.
32
32
  */
33
33
  addEdge(from: string, to: string): void;
34
+ /**
35
+ * Remove content from the database.
36
+ * @param name The name of the content to remove.
37
+ */
38
+ remove(name: string): void;
34
39
  /**
35
40
  * Get the content of the nodes and their neighbors.
36
41
  * @param nodes The nodes to get the content of.
@@ -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
@@ -28,6 +28,11 @@ export interface IGraphDatabaseConnector {
28
28
  getContent(nodes: string[], maxDepth?: number, contentSize?: number): {
29
29
  [key: string]: string[];
30
30
  };
31
+ /**
32
+ * Remove content from the database.
33
+ * @param name The name of the content to remove.
34
+ */
35
+ remove(name: string): void;
31
36
  /**
32
37
  * Get the size of the database
33
38
  * @returns The size of the database.
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.22",
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,186 +0,0 @@
1
- import { IJobParameters, IJobResult } from '../job';
2
- /**
3
- * The AI prompt source Enum
4
- * @category AI
5
- */
6
- export declare enum PromptSource {
7
- /**
8
- * The prompt was generated by the AI.
9
- */
10
- AI = "ai",
11
- /**
12
- * The prompt was generated by a human.
13
- */
14
- Human = "human"
15
- }
16
- /**
17
- * The AI prompt history Interface
18
- * Represents the history of a prompt.
19
- * @category AI
20
- */
21
- export interface IPromptHistory {
22
- /**
23
- * The source of the prompt.
24
- */
25
- source: PromptSource;
26
- /**
27
- * The prompt.
28
- */
29
- message: string;
30
- }
31
- /**
32
- * The AI prompt function parameters Interface
33
- * Represents the parameters for a prompt function.
34
- * @category AI
35
- */
36
- export interface IPromptFunctionParams {
37
- [key: string]: {
38
- type: 'string' | 'number' | 'boolean';
39
- };
40
- }
41
- /**
42
- * The AI prompt function Interface
43
- * Represents a function that can be called by the LLM.
44
- * @category AI
45
- */
46
- export interface IPromptFunction {
47
- /**
48
- * The function description.
49
- */
50
- description: string;
51
- /**
52
- * The function parameters.
53
- */
54
- params?: IPromptFunctionParams;
55
- /**
56
- * The function callback.
57
- */
58
- callback: (params?: {
59
- [key: string]: string | number | boolean;
60
- }) => string | Promise<string>;
61
- }
62
- /**
63
- * The AI prompt options Interface
64
- * Represents the options for an AI prompt.
65
- * @category AI
66
- */
67
- export interface IPromptOptions {
68
- /**
69
- * The instructions for the AI job.
70
- */
71
- instructions?: string;
72
- /**
73
- * The context for the AI job.
74
- */
75
- history?: IPromptHistory[];
76
- /**
77
- * The maximum number of tokens to generate.
78
- */
79
- maxTokens?: number;
80
- /**
81
- * The temperature for the LLM.
82
- */
83
- temperature?: number;
84
- /**
85
- * The functions that can be called by the LLM.
86
- */
87
- functions?: Map<string, IPromptFunction>;
88
- /**
89
- * The thread id
90
- */
91
- threadId?: string;
92
- }
93
- /**
94
- * The AI prompt type text
95
- */
96
- export type PromptTypeText = string | string[];
97
- /**
98
- * The AI prompt type vector
99
- */
100
- export type PromptTypeVector = number[];
101
- /**
102
- * The AI prompt result Interface
103
- * Represents the result of an AI prompt.
104
- * @category AI
105
- */
106
- export interface IPromptResult {
107
- /**
108
- * The output of the AI job.
109
- */
110
- output?: PromptTypeText | PromptTypeVector;
111
- /**
112
- * The relevant context used by the AI job.
113
- */
114
- context?: ISearchResult[];
115
- /**
116
- * The tokens used by the AI job.
117
- */
118
- inputTokens?: number;
119
- /**
120
- * The tokens generated by the AI job.
121
- */
122
- outputTokens?: number;
123
- }
124
- /**
125
- * The AI job parameters Interface
126
- * Parameters for AI job type.
127
- * @category AI
128
- */
129
- export interface IJobParametersAI extends IJobParameters, IPromptOptions {
130
- /**
131
- * The prompt for the AI job.
132
- */
133
- prompt: string;
134
- /**
135
- * The thread id, if within a conversation.
136
- */
137
- threadId: string;
138
- }
139
- /**
140
- * The AI job result Interface
141
- * Represents the result of an AI job.
142
- * @category AI
143
- */
144
- export interface IJobResultAI extends IJobResult, IPromptResult {
145
- /**
146
- * The index of the output, in case of partial results.
147
- */
148
- index?: number;
149
- }
150
- /**
151
- * Represents a search result.
152
- * @category AI
153
- */
154
- export interface ISearchResult {
155
- /**
156
- * The content of the search result.
157
- */
158
- content: string;
159
- /**
160
- * The relevance of the search result.
161
- * The relevance is a number between 0 and 1, where 1 is the most relevant.
162
- */
163
- relevance: number;
164
- /**
165
- * The path name of the document containing the search result.
166
- */
167
- pathName: string;
168
- }
169
- /**
170
- * Represents a content index.
171
- * @category AI
172
- */
173
- export interface IIndex {
174
- /**
175
- * The content of the index.
176
- */
177
- content: string;
178
- /**
179
- * The start index of the content.
180
- */
181
- start: number;
182
- /**
183
- * The length of the content.
184
- */
185
- length: number;
186
- }
@@ -1,50 +0,0 @@
1
- import { IPromptOptions, IPromptResult } 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<IPromptResult>;
23
- /**
24
- * Stream the prompt job.
25
- * @returns An async generator that yields the result
26
- */
27
- stream: () => AsyncGenerator<IPromptResult>;
28
- }
29
- /**
30
- * Represents a context for a Generative AI service.
31
- * @category AI
32
- */
33
- export interface IGenerativeAIContext {
34
- /**
35
- * Create a prompt job. The prompt job is bounded to the context.
36
- * @param prompt The prompt to be processed.
37
- * @param options The options for the prompt job.
38
- * @returns The prompt job ready to be run or streamed.
39
- */
40
- createAIJob(prompt: string, options?: IPromptOptions): IGenerativeAIPromptJob;
41
- /**
42
- * Get the data bucket IDs.
43
- * @returns An array of data bucket IDs.
44
- */
45
- getDataBucketIds(): Promise<string[]>;
46
- /**
47
- * Close the Generative AI Context.
48
- */
49
- close(): void;
50
- }