@redhat-cloud-services/ai-client-common 0.12.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[];
|
|
@@ -54,8 +54,6 @@ declare class IAIClient<AP extends Record<string, unknown> = Record<string, unkn
|
|
|
54
54
|
options?: ISendMessageOptions<T, R>
|
|
55
55
|
): Promise<IMessageResponse<AP>>;
|
|
56
56
|
|
|
57
|
-
getDefaultStreamingHandler<TChunk = unknown>(): IStreamingHandler<TChunk> | undefined;
|
|
58
|
-
|
|
59
57
|
getConversationHistory(conversationId: string, options?: IRequestOptions): Promise<IConversationHistoryResponse<AP>>;
|
|
60
58
|
|
|
61
59
|
healthCheck(options?: IRequestOptions): Promise<unknown>;
|
|
@@ -97,8 +95,7 @@ import { IBaseClientConfig } from '@redhat-cloud-services/ai-client-common';
|
|
|
97
95
|
|
|
98
96
|
const config: IBaseClientConfig = {
|
|
99
97
|
baseUrl: 'https://your-ai-service.com',
|
|
100
|
-
fetchFunction: customFetch
|
|
101
|
-
defaultStreamingHandler: new CustomStreamingHandler() // Optional
|
|
98
|
+
fetchFunction: customFetch // Optional - defaults to native fetch
|
|
102
99
|
};
|
|
103
100
|
```
|
|
104
101
|
|
|
@@ -143,7 +140,7 @@ function isInitErrorResponse(obj: unknown): obj is IInitErrorResponse;
|
|
|
143
140
|
|
|
144
141
|
### Streaming Support
|
|
145
142
|
|
|
146
|
-
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.
|
|
147
144
|
|
|
148
145
|
#### IStreamChunk Interface
|
|
149
146
|
|
|
@@ -153,6 +150,7 @@ import { IStreamChunk } from '@redhat-cloud-services/ai-client-common';
|
|
|
153
150
|
interface IStreamChunk<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
154
151
|
answer: string;
|
|
155
152
|
messageId: string;
|
|
153
|
+
conversationId: string;
|
|
156
154
|
additionalAttributes: T;
|
|
157
155
|
}
|
|
158
156
|
```
|
|
@@ -160,15 +158,15 @@ interface IStreamChunk<T extends Record<string, unknown> = Record<string, unknow
|
|
|
160
158
|
#### Implementing a Custom Streaming Handler
|
|
161
159
|
|
|
162
160
|
```typescript
|
|
163
|
-
import { IStreamingHandler,
|
|
161
|
+
import { IStreamingHandler, HandleChunkCallback, IStreamChunk } from '@redhat-cloud-services/ai-client-common';
|
|
164
162
|
|
|
165
163
|
class CustomStreamingHandler<TChunk = unknown> implements IStreamingHandler<TChunk> {
|
|
166
|
-
onChunk(chunk: TChunk,
|
|
164
|
+
onChunk(chunk: TChunk, handleChunk?: HandleChunkCallback): void {
|
|
167
165
|
console.log('Received chunk:', chunk);
|
|
168
166
|
|
|
169
|
-
// Process the chunk and call
|
|
170
|
-
if (
|
|
171
|
-
|
|
167
|
+
// Process the chunk and call handleChunk with standardized format
|
|
168
|
+
if (handleChunk) {
|
|
169
|
+
handleChunk({
|
|
172
170
|
answer: extractAnswer(chunk), // Extract answer from chunk
|
|
173
171
|
additionalAttributes: extractAttributes(chunk) // Extract additional data
|
|
174
172
|
});
|
|
@@ -203,9 +201,11 @@ const streamingOptions: ISendMessageOptions = {
|
|
|
203
201
|
stream: true,
|
|
204
202
|
headers: { 'Custom-Header': 'value' },
|
|
205
203
|
signal: abortController.signal,
|
|
206
|
-
|
|
204
|
+
handleChunk: (chunk: IStreamChunk) => {
|
|
207
205
|
// Process each standardized chunk as it arrives
|
|
208
206
|
console.log('Answer:', chunk.answer);
|
|
207
|
+
console.log('Message ID:', chunk.messageId);
|
|
208
|
+
console.log('Conversation ID:', chunk.conversationId);
|
|
209
209
|
console.log('Additional data:', chunk.additionalAttributes);
|
|
210
210
|
updateUI(chunk.answer);
|
|
211
211
|
}
|
|
@@ -234,7 +234,7 @@ export interface ISendMessageOptions<
|
|
|
234
234
|
R extends Record<string, unknown> = never
|
|
235
235
|
> extends IRequestOptions {
|
|
236
236
|
stream?: boolean;
|
|
237
|
-
|
|
237
|
+
handleChunk?: HandleChunkCallback<T>;
|
|
238
238
|
requestPayload?: R extends never ? never : R;
|
|
239
239
|
}
|
|
240
240
|
|
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
|
|
@@ -79,12 +73,6 @@ declare class IAIClient<AP extends Record<string, unknown> = Record<string, unkn
|
|
|
79
73
|
* @returns Promise that resolves to the AI's response
|
|
80
74
|
*/
|
|
81
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>>;
|
|
82
|
-
/**
|
|
83
|
-
* Get the default streaming handler for this client
|
|
84
|
-
* All AI clients must implement this method to provide consistent streaming behavior
|
|
85
|
-
* @returns The default streaming handler or undefined if not configured
|
|
86
|
-
*/
|
|
87
|
-
getDefaultStreamingHandler<TChunk = unknown>(): IStreamingHandler<TChunk> | undefined;
|
|
88
76
|
/**
|
|
89
77
|
* Get the conversation history for a specific conversation
|
|
90
78
|
* @param conversationId - The conversation ID to retrieve history for
|
|
@@ -151,7 +139,7 @@ export interface IStreamingHandler<TChunk = unknown> {
|
|
|
151
139
|
/**
|
|
152
140
|
* Handle a single chunk of streaming data
|
|
153
141
|
*/
|
|
154
|
-
onChunk(chunk: TChunk,
|
|
142
|
+
onChunk(chunk: TChunk, handleChunk?: (chunk: IStreamChunk) => void): void;
|
|
155
143
|
/**
|
|
156
144
|
* Called when the stream starts
|
|
157
145
|
*/
|
|
@@ -169,6 +157,30 @@ export interface IStreamingHandler<TChunk = unknown> {
|
|
|
169
157
|
*/
|
|
170
158
|
onAbort?(): void;
|
|
171
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 };
|
|
172
184
|
/**
|
|
173
185
|
* Streaming request options for clients that support streaming
|
|
174
186
|
*/
|
|
@@ -251,7 +263,7 @@ export interface IStreamChunk<T extends Record<string, unknown> = Record<string,
|
|
|
251
263
|
conversationId: string;
|
|
252
264
|
additionalAttributes: T;
|
|
253
265
|
}
|
|
254
|
-
export type
|
|
266
|
+
export type HandleChunkCallback<T extends Record<string, unknown> = Record<string, unknown>> = (chunk: IStreamChunk<T>) => void;
|
|
255
267
|
/**
|
|
256
268
|
* Options for sending messages, supporting both streaming and non-streaming modes
|
|
257
269
|
*/
|
|
@@ -261,7 +273,7 @@ export interface ISendMessageOptions<T extends Record<string, unknown> = Record<
|
|
|
261
273
|
* When true, the client's default streaming handler will be used
|
|
262
274
|
*/
|
|
263
275
|
stream?: boolean;
|
|
264
|
-
|
|
276
|
+
handleChunk?: HandleChunkCallback<T>;
|
|
265
277
|
/**
|
|
266
278
|
* Additional request payload data specific to the client implementation
|
|
267
279
|
* Only available when R is not 'never'
|
|
@@ -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,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AAC;AAErC;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAClC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,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"}
|