@apia/ai 3.0.15 → 3.0.17
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/dist/index.d.ts +96 -5
- package/dist/index.js +700 -160
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, FC, ReactElement } from 'react';
|
|
3
3
|
import * as _apia_util from '@apia/util';
|
|
4
|
-
import { EventEmitter } from '@apia/util';
|
|
4
|
+
import { EventEmitter, AudioRecorder } from '@apia/util';
|
|
5
|
+
import { CollectorField } from '@apia/validations';
|
|
6
|
+
import { TActionDispatcher } from '@apia/dashboard-controller';
|
|
5
7
|
|
|
6
8
|
declare const AutoscrollContainer: ({ children }: {
|
|
7
9
|
children: ReactNode;
|
|
@@ -15,9 +17,10 @@ interface Reactive {
|
|
|
15
17
|
Component: FC<any>;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
declare class AIContent implements Reactive {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
declare class AIContent extends CollectorField implements Reactive {
|
|
21
|
+
type: string;
|
|
22
|
+
content: ReactNode;
|
|
23
|
+
constructor(content?: ReactNode);
|
|
21
24
|
Component: () => react.JSX.Element;
|
|
22
25
|
}
|
|
23
26
|
|
|
@@ -26,9 +29,12 @@ declare class AIMessageAttachments implements Reactive {
|
|
|
26
29
|
role: AIMessageRole;
|
|
27
30
|
content: AIContent;
|
|
28
31
|
id: string;
|
|
32
|
+
customDescription: boolean;
|
|
29
33
|
constructor(role: AIMessageRole, content: AIContent, close?: (() => void) | undefined);
|
|
34
|
+
addDescription: () => Promise<void>;
|
|
30
35
|
Component: (props: {
|
|
31
36
|
closeButton?: boolean;
|
|
37
|
+
canAddDescription?: boolean;
|
|
32
38
|
}) => react.JSX.Element;
|
|
33
39
|
}
|
|
34
40
|
|
|
@@ -121,5 +127,90 @@ declare class ResponseStream extends EventEmitter<{
|
|
|
121
127
|
run(): void;
|
|
122
128
|
}
|
|
123
129
|
|
|
124
|
-
|
|
130
|
+
type RoutinesGenerationState = {
|
|
131
|
+
isLoading: boolean;
|
|
132
|
+
progress: number;
|
|
133
|
+
};
|
|
134
|
+
type TPollProgress = {
|
|
135
|
+
message: string;
|
|
136
|
+
progress: number;
|
|
137
|
+
debug: string;
|
|
138
|
+
streamPart?: string;
|
|
139
|
+
};
|
|
140
|
+
type TPollRoutineResult = {
|
|
141
|
+
status: string;
|
|
142
|
+
payload: unknown | TPollProgress;
|
|
143
|
+
};
|
|
144
|
+
type TGenerateFromImage$1 = {
|
|
145
|
+
base64: string;
|
|
146
|
+
description: string;
|
|
147
|
+
};
|
|
148
|
+
type TRoutineCompletion = Partial<{
|
|
149
|
+
images: TGenerateFromImage$1[];
|
|
150
|
+
parameters: Record<string, string>;
|
|
151
|
+
stream: ResponseStream;
|
|
152
|
+
}> & {
|
|
153
|
+
routineName: string;
|
|
154
|
+
};
|
|
155
|
+
declare class RoutinesGeneration {
|
|
156
|
+
audioRecorder: AudioRecorder;
|
|
157
|
+
private routineId;
|
|
158
|
+
state: RoutinesGenerationState;
|
|
159
|
+
constructor();
|
|
160
|
+
private checkCanGenerate;
|
|
161
|
+
private pollRoutine;
|
|
162
|
+
protected callAudioTranscription(audio: Blob): ReturnType<RoutinesGeneration['callRoutineStart']>;
|
|
163
|
+
protected callRoutinePoll(routineId: string): Promise<TPollRoutineResult>;
|
|
164
|
+
protected callRoutineStart(routineName: string, parameters: Record<string, string>, images: TGenerateFromImage$1[]): Promise<{
|
|
165
|
+
orchestrator: {
|
|
166
|
+
routineId: string;
|
|
167
|
+
};
|
|
168
|
+
} | null>;
|
|
169
|
+
private executeRoutine;
|
|
170
|
+
private resetLoading;
|
|
171
|
+
completion<T>(params: TRoutineCompletion): Promise<T | null>;
|
|
172
|
+
stop(): void;
|
|
173
|
+
transcribeAudio(audio: Blob): Promise<{
|
|
174
|
+
transcription: string;
|
|
175
|
+
} | null>;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare class DashboardsRoutinesGeneration extends RoutinesGeneration {
|
|
179
|
+
protected dispatcher: TActionDispatcher;
|
|
180
|
+
constructor(dispatcher: TActionDispatcher);
|
|
181
|
+
private blobToBase64;
|
|
182
|
+
protected callAudioTranscription(audio: Blob): Promise<{
|
|
183
|
+
orchestrator: {
|
|
184
|
+
routineId: string;
|
|
185
|
+
};
|
|
186
|
+
} | null>;
|
|
187
|
+
protected callRoutinePoll(routineId: string): Promise<TPollRoutineResult>;
|
|
188
|
+
protected callRoutineStart(routineName: string, parameters: Record<string, string>, images: TGenerateFromImage$1[]): Promise<{
|
|
189
|
+
orchestrator: {
|
|
190
|
+
routineId: string;
|
|
191
|
+
};
|
|
192
|
+
} | null>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
type RetrievedImage = {
|
|
196
|
+
base64: string;
|
|
197
|
+
path: string;
|
|
198
|
+
};
|
|
199
|
+
declare function getImageFromDisk(inputProps?: Partial<{
|
|
200
|
+
accept: string;
|
|
201
|
+
}>): Promise<RetrievedImage | null>;
|
|
202
|
+
declare function getImagesFromDisk(inputProps?: Partial<{
|
|
203
|
+
accept: string;
|
|
204
|
+
multiple: string;
|
|
205
|
+
}>): Promise<RetrievedImage[]>;
|
|
206
|
+
|
|
207
|
+
type TGenerateFromImage = {
|
|
208
|
+
base64: string;
|
|
209
|
+
description: string;
|
|
210
|
+
};
|
|
211
|
+
declare function getImagesWithDescription({ multiple, }: {
|
|
212
|
+
multiple?: boolean;
|
|
213
|
+
}): Promise<TGenerateFromImage[]>;
|
|
214
|
+
|
|
215
|
+
export { AIMessageAttachments, AutoscrollContainer, ChatController, ChatMessage, DashboardsRoutinesGeneration, MultipleChoiceMessage, ResponseStream, RoutinesGeneration, type TGenerateFromImage$1 as TGenerateFromImage, type TMessageType, type TMultipleChoiceMessageOption, type TPollRoutineResult, type TRoutineCompletion, getImageFromDisk, getImagesFromDisk, getImagesWithDescription };
|
|
125
216
|
//# sourceMappingURL=index.d.ts.map
|