@crewdle/web-sdk-types 1.0.21 → 1.0.22
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.
|
@@ -85,6 +85,10 @@ export interface IPromptOptions {
|
|
|
85
85
|
* The functions that can be called by the LLM.
|
|
86
86
|
*/
|
|
87
87
|
functions?: Map<string, IPromptFunction>;
|
|
88
|
+
/**
|
|
89
|
+
* The thread id
|
|
90
|
+
*/
|
|
91
|
+
threadId?: string;
|
|
88
92
|
}
|
|
89
93
|
/**
|
|
90
94
|
* The AI prompt type text
|
|
@@ -127,6 +131,10 @@ export interface IJobParametersAI extends IJobParameters, IPromptOptions {
|
|
|
127
131
|
* The prompt for the AI job.
|
|
128
132
|
*/
|
|
129
133
|
prompt: string;
|
|
134
|
+
/**
|
|
135
|
+
* The thread id, if within a conversation.
|
|
136
|
+
*/
|
|
137
|
+
threadId: string;
|
|
130
138
|
}
|
|
131
139
|
/**
|
|
132
140
|
* The AI job result Interface
|
|
@@ -1,23 +1,43 @@
|
|
|
1
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
|
+
}
|
|
2
29
|
/**
|
|
3
30
|
* Represents a context for a Generative AI service.
|
|
4
31
|
* @category AI
|
|
5
32
|
*/
|
|
6
33
|
export interface IGenerativeAIContext {
|
|
7
34
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @param prompt The prompt to
|
|
10
|
-
* @param options
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
stream(prompt: string, options?: IPromptOptions): AsyncGenerator<IPromptResult>;
|
|
14
|
-
/**
|
|
15
|
-
* Process the response from the AI service.
|
|
16
|
-
* @param prompt The prompt to start processing.
|
|
17
|
-
* @param options Optional parameters for the prompt.
|
|
18
|
-
* @returns A promise that resolves with the response.
|
|
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.
|
|
19
39
|
*/
|
|
20
|
-
|
|
40
|
+
createAIJob(prompt: string, options?: IPromptOptions): IGenerativeAIPromptJob;
|
|
21
41
|
/**
|
|
22
42
|
* Get the data bucket IDs.
|
|
23
43
|
* @returns An array of data bucket IDs.
|