@crewdle/web-sdk-types 1.0.15 → 1.0.16

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.
@@ -27,6 +27,11 @@ export interface IPromptHistory {
27
27
  */
28
28
  message: string;
29
29
  }
30
+ /**
31
+ * The AI prompt options Interface
32
+ * Represents the options for an AI prompt.
33
+ * @ignore
34
+ */
30
35
  export interface IPromptOptions {
31
36
  /**
32
37
  * The instructions for the AI job.
@@ -39,37 +44,38 @@ export interface IPromptOptions {
39
44
  /**
40
45
  * The context for the AI job.
41
46
  */
42
- context?: IPromptHistory[];
43
- }
44
- /**
45
- * The AI job parameters Interface
46
- * Parameters for AI job type.
47
- * @ignore
48
- */
49
- export interface IJobParametersAI extends IJobParameters {
47
+ history?: IPromptHistory[];
50
48
  /**
51
- * The prompt for the AI job.
49
+ * The maximum number of tokens to generate.
52
50
  */
53
- prompt: string;
51
+ maxTokens?: number;
54
52
  /**
55
- * The instructions for the AI job.
53
+ * The temperature for the LLM.
56
54
  */
57
- instructions?: string;
55
+ temperature?: number;
58
56
  /**
59
- * Whether to use RAG for the AI job.
57
+ * The maximum number of contents to include in the context.
60
58
  */
61
- useRAG?: boolean;
59
+ maxContents?: number;
62
60
  /**
63
- * The context for the AI job.
61
+ * The number of chunks to include in one content.
62
+ */
63
+ maxChunks?: number;
64
+ /**
65
+ * The starting index of the RAG for search.
66
+ */
67
+ ragStartingIndex?: number;
68
+ /**
69
+ * The minimum relevance of the RAG contents.
64
70
  */
65
- context?: IPromptHistory[];
71
+ minRelevance?: number;
66
72
  }
67
73
  /**
68
- * The AI job result Interface
69
- * Represents the result of an AI job.
74
+ * The AI prompt result Interface
75
+ * Represents the result of an AI prompt.
70
76
  * @ignore
71
77
  */
72
- export interface IJobResultAI extends IJobResult {
78
+ export interface IPromptResult {
73
79
  /**
74
80
  * The output of the AI job.
75
81
  */
@@ -82,6 +88,28 @@ export interface IJobResultAI extends IJobResult {
82
88
  * The tokens generated by the AI job.
83
89
  */
84
90
  outputTokens?: number;
91
+ /**
92
+ * The number of contents in the RAG.
93
+ */
94
+ contentSize?: number;
95
+ }
96
+ /**
97
+ * The AI job parameters Interface
98
+ * Parameters for AI job type.
99
+ * @ignore
100
+ */
101
+ export interface IJobParametersAI extends IJobParameters, IPromptOptions {
102
+ /**
103
+ * The prompt for the AI job.
104
+ */
105
+ prompt: string;
106
+ }
107
+ /**
108
+ * The AI job result Interface
109
+ * Represents the result of an AI job.
110
+ * @ignore
111
+ */
112
+ export interface IJobResultAI extends IJobResult, IPromptResult {
85
113
  /**
86
114
  * The index of the output, in case of partial results.
87
115
  */
@@ -1,4 +1,4 @@
1
- import { IPromptOptions } from '.';
1
+ import { IPromptOptions, IPromptResult } from '.';
2
2
  /**
3
3
  * Represents a context for a Generative AI service.
4
4
  * @category AI
@@ -9,13 +9,13 @@ export interface IGenerativeAIContext {
9
9
  * @param prompt The prompt to start processing.
10
10
  * @returns An async generator that yields the response.
11
11
  */
12
- stream(prompt: string, options?: IPromptOptions): AsyncGenerator<string>;
12
+ stream(prompt: string, options?: IPromptOptions): AsyncGenerator<IPromptResult>;
13
13
  /**
14
14
  * Process the response from the AI service.
15
15
  * @param prompt The prompt to start processing.
16
16
  * @returns A promise that resolves with the response.
17
17
  */
18
- prompt(prompt: string, options?: IPromptOptions): Promise<string>;
18
+ prompt(prompt: string, options?: IPromptOptions): Promise<IPromptResult>;
19
19
  /**
20
20
  * Close the Generative AI Context.
21
21
  */
@@ -7,8 +7,11 @@ export interface IVectorDatabaseConnector {
7
7
  * Search for the k nearest vectors.
8
8
  * @param vector The vector to search for.
9
9
  * @param k The number of nearest vectors to return.
10
+ * @param minRelevance The minimum relevance of the vectors.
11
+ * @param startingIndex The starting index of the vectors.
12
+ * @returns The labels of the k nearest vectors.
10
13
  */
11
- search(vector: number[], k: number): number[];
14
+ search(vector: number[], k: number, minRelevance?: number, startingIndex?: number): number[];
12
15
  /**
13
16
  * Insert vectors into the database.
14
17
  * @param vectors The vectors to insert.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewdle/web-sdk-types",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
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",
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  },
25
25
  "devDependencies": {
26
- "typescript": "^5.4.3"
26
+ "typescript": "^5.5.2"
27
27
  },
28
28
  "files": [
29
29
  "dist/"