@redhat-cloud-services/ai-client-common 0.11.0 → 0.13.0
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/README.md
CHANGED
|
@@ -28,8 +28,8 @@ All AI clients in this workspace implement the `IAIClient` interface:
|
|
|
28
28
|
```typescript
|
|
29
29
|
import { IAIClient, ClientInitLimitation, IInitErrorResponse } from '@redhat-cloud-services/ai-client-common';
|
|
30
30
|
|
|
31
|
-
declare class IAIClient<AP extends Record<string, unknown> = Record<string, unknown
|
|
32
|
-
constructor(config: IBaseClientConfig
|
|
31
|
+
declare class IAIClient<AP extends Record<string, unknown> = Record<string, unknown>> {
|
|
32
|
+
constructor(config: IBaseClientConfig);
|
|
33
33
|
|
|
34
34
|
init(): Promise<{
|
|
35
35
|
conversations: IConversation[];
|
|
@@ -37,13 +37,22 @@ declare class IAIClient<AP extends Record<string, unknown> = Record<string, unkn
|
|
|
37
37
|
error?: IInitErrorResponse;
|
|
38
38
|
}>;
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
// Basic message sending
|
|
41
|
+
sendMessage<T extends Record<string, unknown> = Record<string, unknown>>(
|
|
41
42
|
conversationId: string,
|
|
42
43
|
message: string,
|
|
43
44
|
options?: ISendMessageOptions<T>
|
|
44
|
-
): Promise<
|
|
45
|
+
): Promise<IMessageResponse<AP>>;
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
// Message sending with custom request payload
|
|
48
|
+
sendMessage<
|
|
49
|
+
T extends Record<string, unknown> = Record<string, unknown>,
|
|
50
|
+
R extends Record<string, unknown> = Record<string, unknown>
|
|
51
|
+
>(
|
|
52
|
+
conversationId: string,
|
|
53
|
+
message: string,
|
|
54
|
+
options?: ISendMessageOptions<T, R>
|
|
55
|
+
): Promise<IMessageResponse<AP>>;
|
|
47
56
|
|
|
48
57
|
getConversationHistory(conversationId: string, options?: IRequestOptions): Promise<IConversationHistoryResponse<AP>>;
|
|
49
58
|
|
|
@@ -86,8 +95,7 @@ import { IBaseClientConfig } from '@redhat-cloud-services/ai-client-common';
|
|
|
86
95
|
|
|
87
96
|
const config: IBaseClientConfig = {
|
|
88
97
|
baseUrl: 'https://your-ai-service.com',
|
|
89
|
-
fetchFunction: customFetch
|
|
90
|
-
defaultStreamingHandler: new CustomStreamingHandler() // Optional
|
|
98
|
+
fetchFunction: customFetch // Optional - defaults to native fetch
|
|
91
99
|
};
|
|
92
100
|
```
|
|
93
101
|
|
|
@@ -132,7 +140,7 @@ function isInitErrorResponse(obj: unknown): obj is IInitErrorResponse;
|
|
|
132
140
|
|
|
133
141
|
### Streaming Support
|
|
134
142
|
|
|
135
|
-
The streaming interface has been updated to standardize chunk handling across all AI clients. The `
|
|
143
|
+
The streaming interface has been updated to standardize chunk handling across all AI clients. The `handleChunk` callback now receives an `IStreamChunk` object with standardized structure.
|
|
136
144
|
|
|
137
145
|
#### IStreamChunk Interface
|
|
138
146
|
|
|
@@ -142,6 +150,7 @@ import { IStreamChunk } from '@redhat-cloud-services/ai-client-common';
|
|
|
142
150
|
interface IStreamChunk<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
143
151
|
answer: string;
|
|
144
152
|
messageId: string;
|
|
153
|
+
conversationId: string;
|
|
145
154
|
additionalAttributes: T;
|
|
146
155
|
}
|
|
147
156
|
```
|
|
@@ -149,15 +158,15 @@ interface IStreamChunk<T extends Record<string, unknown> = Record<string, unknow
|
|
|
149
158
|
#### Implementing a Custom Streaming Handler
|
|
150
159
|
|
|
151
160
|
```typescript
|
|
152
|
-
import { IStreamingHandler,
|
|
161
|
+
import { IStreamingHandler, HandleChunkCallback, IStreamChunk } from '@redhat-cloud-services/ai-client-common';
|
|
153
162
|
|
|
154
163
|
class CustomStreamingHandler<TChunk = unknown> implements IStreamingHandler<TChunk> {
|
|
155
|
-
onChunk(chunk: TChunk,
|
|
164
|
+
onChunk(chunk: TChunk, handleChunk?: HandleChunkCallback): void {
|
|
156
165
|
console.log('Received chunk:', chunk);
|
|
157
166
|
|
|
158
|
-
// Process the chunk and call
|
|
159
|
-
if (
|
|
160
|
-
|
|
167
|
+
// Process the chunk and call handleChunk with standardized format
|
|
168
|
+
if (handleChunk) {
|
|
169
|
+
handleChunk({
|
|
161
170
|
answer: extractAnswer(chunk), // Extract answer from chunk
|
|
162
171
|
additionalAttributes: extractAttributes(chunk) // Extract additional data
|
|
163
172
|
});
|
|
@@ -182,22 +191,69 @@ class CustomStreamingHandler<TChunk = unknown> implements IStreamingHandler<TChu
|
|
|
182
191
|
}
|
|
183
192
|
```
|
|
184
193
|
|
|
185
|
-
####
|
|
194
|
+
#### Send Message Options
|
|
186
195
|
|
|
187
196
|
```typescript
|
|
188
197
|
import { ISendMessageOptions, IStreamChunk } from '@redhat-cloud-services/ai-client-common';
|
|
189
198
|
|
|
199
|
+
// Basic streaming options
|
|
190
200
|
const streamingOptions: ISendMessageOptions = {
|
|
191
201
|
stream: true,
|
|
192
202
|
headers: { 'Custom-Header': 'value' },
|
|
193
203
|
signal: abortController.signal,
|
|
194
|
-
|
|
204
|
+
handleChunk: (chunk: IStreamChunk) => {
|
|
195
205
|
// Process each standardized chunk as it arrives
|
|
196
206
|
console.log('Answer:', chunk.answer);
|
|
207
|
+
console.log('Message ID:', chunk.messageId);
|
|
208
|
+
console.log('Conversation ID:', chunk.conversationId);
|
|
197
209
|
console.log('Additional data:', chunk.additionalAttributes);
|
|
198
210
|
updateUI(chunk.answer);
|
|
199
211
|
}
|
|
200
212
|
};
|
|
213
|
+
|
|
214
|
+
// Options with custom request payload (client-specific)
|
|
215
|
+
const optionsWithPayload: ISendMessageOptions<AdditionalProps, CustomPayload> = {
|
|
216
|
+
stream: false,
|
|
217
|
+
headers: { 'X-Custom': 'value' },
|
|
218
|
+
requestPayload: {
|
|
219
|
+
// Client-specific payload data
|
|
220
|
+
customData: 'value',
|
|
221
|
+
options: { setting: true }
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### Request Payload Support
|
|
227
|
+
|
|
228
|
+
The `ISendMessageOptions` interface supports method overloading to enable client-specific request payloads:
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
// Interface definition
|
|
232
|
+
export interface ISendMessageOptions<
|
|
233
|
+
T extends Record<string, unknown> = Record<string, unknown>,
|
|
234
|
+
R extends Record<string, unknown> = never
|
|
235
|
+
> extends IRequestOptions {
|
|
236
|
+
stream?: boolean;
|
|
237
|
+
handleChunk?: HandleChunkCallback<T>;
|
|
238
|
+
requestPayload?: R extends never ? never : R;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Usage with client-specific payload
|
|
242
|
+
interface MyClientPayload {
|
|
243
|
+
context?: { systemInfo: string };
|
|
244
|
+
skipCache?: boolean;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const response = await client.sendMessage(
|
|
248
|
+
'conversation-id',
|
|
249
|
+
'message',
|
|
250
|
+
{
|
|
251
|
+
requestPayload: {
|
|
252
|
+
context: { systemInfo: 'linux' },
|
|
253
|
+
skipCache: true
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
);
|
|
201
257
|
```
|
|
202
258
|
|
|
203
259
|
## Error Handling
|
|
@@ -272,6 +328,8 @@ This package provides the foundation for:
|
|
|
272
328
|
- **[@redhat-cloud-services/arh-client](../arh-client)** - Intelligent Front Door (IFD) API client
|
|
273
329
|
- **[@redhat-cloud-services/lightspeed-client](../lightspeed-client)** - OpenShift Lightspeed API client
|
|
274
330
|
- **[@redhat-cloud-services/ansible-lightspeed](../ansible-lightspeed)** - Ansible Lightspeed API client
|
|
331
|
+
- **[@redhat-cloud-services/rhel-lightspeed-client](../rhel-lightspeed-client)** - RHEL LightSpeed RAG API client
|
|
332
|
+
- **[@redhat-cloud-services/aai-client](../aai-client)** - Ansible Assisted Installer API client
|
|
275
333
|
- **[@redhat-cloud-services/ai-client-state](../ai-client-state)** - State management for AI conversations
|
|
276
334
|
- **[@redhat-cloud-services/ai-react-state](../ai-react-state)** - React hooks and context for AI state
|
|
277
335
|
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ export interface IFetchFunction {
|
|
|
8
8
|
/**
|
|
9
9
|
* Base configuration interface for all AI clients
|
|
10
10
|
*/
|
|
11
|
-
export interface IBaseClientConfig
|
|
11
|
+
export interface IBaseClientConfig {
|
|
12
12
|
/**
|
|
13
13
|
* The base URL for the API
|
|
14
14
|
*/
|
|
@@ -18,12 +18,6 @@ export interface IBaseClientConfig<TChunk = unknown> {
|
|
|
18
18
|
* Must include authentication headers (Bearer token) if needed
|
|
19
19
|
*/
|
|
20
20
|
fetchFunction?: IFetchFunction;
|
|
21
|
-
/**
|
|
22
|
-
* Default streaming handler for the client
|
|
23
|
-
* Used when sendMessage is called with stream=true but no streamingHandler provided
|
|
24
|
-
* Individual requests can override this by providing their own streamingHandler
|
|
25
|
-
*/
|
|
26
|
-
defaultStreamingHandler?: IStreamingHandler<TChunk>;
|
|
27
21
|
}
|
|
28
22
|
/**
|
|
29
23
|
* Standard request options that can be passed to individual client methods
|
|
@@ -51,8 +45,8 @@ export type ClientInitLimitation = {
|
|
|
51
45
|
* Common interface that all AI clients must implement
|
|
52
46
|
* Provides a standardized way to interact with different AI services
|
|
53
47
|
*/
|
|
54
|
-
declare class IAIClient<AP extends Record<string, unknown> = Record<string, unknown
|
|
55
|
-
constructor(config: IBaseClientConfig
|
|
48
|
+
declare class IAIClient<AP extends Record<string, unknown> = Record<string, unknown>> {
|
|
49
|
+
constructor(config: IBaseClientConfig);
|
|
56
50
|
/**
|
|
57
51
|
* Initialize the client and return existing conversations
|
|
58
52
|
* This method is called once when the client is first used by a state manager
|
|
@@ -72,11 +66,13 @@ declare class IAIClient<AP extends Record<string, unknown> = Record<string, unkn
|
|
|
72
66
|
*/
|
|
73
67
|
sendMessage<T extends Record<string, unknown> = Record<string, unknown>>(conversationId: string, message: string, options?: ISendMessageOptions<T>): Promise<IMessageResponse<AP>>;
|
|
74
68
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* @
|
|
69
|
+
* Send a message to the AI service with custom request payload
|
|
70
|
+
* @param conversationId - The conversation ID to send the message to
|
|
71
|
+
* @param message - The message content to send
|
|
72
|
+
* @param options - Optional configuration for the request with custom payload
|
|
73
|
+
* @returns Promise that resolves to the AI's response
|
|
78
74
|
*/
|
|
79
|
-
|
|
75
|
+
sendMessage<T extends Record<string, unknown> = Record<string, unknown>, R extends Record<string, unknown> = Record<string, unknown>>(conversationId: string, message: string, options?: ISendMessageOptions<T, R>): Promise<IMessageResponse<AP>>;
|
|
80
76
|
/**
|
|
81
77
|
* Get the conversation history for a specific conversation
|
|
82
78
|
* @param conversationId - The conversation ID to retrieve history for
|
|
@@ -143,7 +139,7 @@ export interface IStreamingHandler<TChunk = unknown> {
|
|
|
143
139
|
/**
|
|
144
140
|
* Handle a single chunk of streaming data
|
|
145
141
|
*/
|
|
146
|
-
onChunk(chunk: TChunk,
|
|
142
|
+
onChunk(chunk: TChunk, handleChunk?: (chunk: IStreamChunk) => void): void;
|
|
147
143
|
/**
|
|
148
144
|
* Called when the stream starts
|
|
149
145
|
*/
|
|
@@ -161,6 +157,30 @@ export interface IStreamingHandler<TChunk = unknown> {
|
|
|
161
157
|
*/
|
|
162
158
|
onAbort?(): void;
|
|
163
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Simplified streaming handler interface for cleaner implementation
|
|
162
|
+
* This will eventually replace IStreamingHandler across all clients
|
|
163
|
+
*
|
|
164
|
+
* The simplified approach focuses on:
|
|
165
|
+
* - Processing chunks and building message buffer
|
|
166
|
+
* - Calling callback with current complete message
|
|
167
|
+
* - Simple error handling
|
|
168
|
+
*/
|
|
169
|
+
declare class ISimpleStreamingHandler<TChunk = unknown> {
|
|
170
|
+
/**
|
|
171
|
+
* Process a chunk and return updated message buffer
|
|
172
|
+
* @param chunk - The chunk data (text string or parsed JSON object)
|
|
173
|
+
* @param currentBuffer - The current accumulated message content
|
|
174
|
+
* @param handleChunk - Mandatory callback to execute with current complete message
|
|
175
|
+
* @returns Updated message buffer after processing this chunk
|
|
176
|
+
*/
|
|
177
|
+
processChunk(chunk: TChunk, currentBuffer: string, handleChunk: HandleChunkCallback): string;
|
|
178
|
+
/**
|
|
179
|
+
* Called when an error occurs during streaming
|
|
180
|
+
*/
|
|
181
|
+
onError?(error: Error): void;
|
|
182
|
+
}
|
|
183
|
+
export { ISimpleStreamingHandler };
|
|
164
184
|
/**
|
|
165
185
|
* Streaming request options for clients that support streaming
|
|
166
186
|
*/
|
|
@@ -243,16 +263,21 @@ export interface IStreamChunk<T extends Record<string, unknown> = Record<string,
|
|
|
243
263
|
conversationId: string;
|
|
244
264
|
additionalAttributes: T;
|
|
245
265
|
}
|
|
246
|
-
export type
|
|
266
|
+
export type HandleChunkCallback<T extends Record<string, unknown> = Record<string, unknown>> = (chunk: IStreamChunk<T>) => void;
|
|
247
267
|
/**
|
|
248
268
|
* Options for sending messages, supporting both streaming and non-streaming modes
|
|
249
269
|
*/
|
|
250
|
-
export interface ISendMessageOptions<T extends Record<string, unknown> = Record<string, unknown
|
|
270
|
+
export interface ISendMessageOptions<T extends Record<string, unknown> = Record<string, unknown>, R extends Record<string, unknown> = never> extends IRequestOptions {
|
|
251
271
|
/**
|
|
252
272
|
* Whether to use streaming mode for the response
|
|
253
273
|
* When true, the client's default streaming handler will be used
|
|
254
274
|
*/
|
|
255
275
|
stream?: boolean;
|
|
256
|
-
|
|
276
|
+
handleChunk?: HandleChunkCallback<T>;
|
|
277
|
+
/**
|
|
278
|
+
* Additional request payload data specific to the client implementation
|
|
279
|
+
* Only available when R is not 'never'
|
|
280
|
+
*/
|
|
281
|
+
requestPayload?: R extends never ? never : R;
|
|
257
282
|
}
|
|
258
283
|
//# sourceMappingURL=ai-client-common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-client-common.d.ts","sourceRoot":"","sources":["../../../../../packages/ai-client-common/src/lib/ai-client-common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB
|
|
1
|
+
{"version":3,"file":"ai-client-common.d.ts","sourceRoot":"","sources":["../../../../../packages/ai-client-common/src/lib/ai-client-common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,kBAAkB,CAS3E;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,OAAO,OAAO,SAAS,CACrB,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAEhD,MAAM,EAAE,iBAAiB;IACrC;;;;OAIG;IACH,IAAI,IAAI,OAAO,C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AC3D,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CACzC,SAAQ,eAAe;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;CAC9C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AIClientValidationError = exports.AIClientError = exports.IAIClient = void 0;
|
|
3
|
+
exports.ISimpleStreamingHandler = exports.AIClientValidationError = exports.AIClientError = exports.IAIClient = void 0;
|
|
4
4
|
exports.isInitErrorResponse = isInitErrorResponse;
|
|
5
5
|
function isInitErrorResponse(obj) {
|
|
6
6
|
return (typeof obj === 'object' &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-client-common.js","sourceRoot":"","sources":["../../../../../packages/ai-client-common/src/lib/ai-client-common.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ai-client-common.js","sourceRoot":"","sources":["../../../../../packages/ai-client-common/src/lib/ai-client-common.ts"],"names":[],"mappings":";;;AA4CA,kDASC;AATD,SAAgB,mBAAmB,CAAC,GAAY;IAC9C,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,SAAS,IAAI,GAAG;QAChB,OAAQ,GAA0B,CAAC,OAAO,KAAK,QAAQ;QACvD,QAAQ,IAAI,GAAG;QACf,OAAQ,GAA0B,CAAC,MAAM,KAAK,QAAQ,CACvD,CAAC;AACJ,CAAC;AAyFD;;GAEG;AACH,MAAa,aAAc,SAAQ,KAAK;IACtC,YACS,MAAc,EACd,UAAkB,EACzB,OAAe,EACR,IAAc;QAErB,KAAK,CAAC,OAAO,CAAC,CAAC;QALR,WAAM,GAAN,MAAM,CAAQ;QACd,eAAU,GAAV,UAAU,CAAQ;QAElB,SAAI,GAAJ,IAAI,CAAU;QAGrB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAVD,sCAUC;AAWD,MAAa,uBAAwB,SAAQ,aAAa;IACxD,YAAmB,gBAAoC;QACrD,KAAK,CACH,GAAG,EACH,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,CACjB,CAAC;QANe,qBAAgB,GAAhB,gBAAgB,CAAoB;QAOrD,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAVD,0DAUC"}
|