@memberjunction/ai 3.4.0 → 4.0.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/dist/generic/apiKeyDictionary.d.ts +22 -0
- package/dist/generic/apiKeyDictionary.d.ts.map +1 -1
- package/dist/generic/apiKeyDictionary.js +20 -13
- package/dist/generic/apiKeyDictionary.js.map +1 -1
- package/dist/generic/baseAudio.d.ts +107 -2
- package/dist/generic/baseAudio.d.ts.map +1 -1
- package/dist/generic/baseAudio.js +26 -20
- package/dist/generic/baseAudio.js.map +1 -1
- package/dist/generic/baseDiffusion.d.ts +5 -1
- package/dist/generic/baseDiffusion.d.ts.map +1 -1
- package/dist/generic/baseDiffusion.js +5 -17
- package/dist/generic/baseDiffusion.js.map +1 -1
- package/dist/generic/baseEmbeddings.d.ts +25 -2
- package/dist/generic/baseEmbeddings.d.ts.map +1 -1
- package/dist/generic/baseEmbeddings.js +26 -8
- package/dist/generic/baseEmbeddings.js.map +1 -1
- package/dist/generic/baseImage.d.ts +262 -2
- package/dist/generic/baseImage.d.ts.map +1 -1
- package/dist/generic/baseImage.js +83 -20
- package/dist/generic/baseImage.js.map +1 -1
- package/dist/generic/baseLLM.d.ts +100 -4
- package/dist/generic/baseLLM.d.ts.map +1 -1
- package/dist/generic/baseLLM.js +122 -14
- package/dist/generic/baseLLM.js.map +1 -1
- package/dist/generic/baseModel.d.ts +91 -0
- package/dist/generic/baseModel.d.ts.map +1 -1
- package/dist/generic/baseModel.js +37 -11
- package/dist/generic/baseModel.js.map +1 -1
- package/dist/generic/baseReranker.d.ts +81 -2
- package/dist/generic/baseReranker.d.ts.map +1 -1
- package/dist/generic/baseReranker.js +73 -6
- package/dist/generic/baseReranker.js.map +1 -1
- package/dist/generic/baseVideo.d.ts +24 -1
- package/dist/generic/baseVideo.d.ts.map +1 -1
- package/dist/generic/baseVideo.js +11 -14
- package/dist/generic/baseVideo.js.map +1 -1
- package/dist/generic/chat.types.d.ts +291 -2
- package/dist/generic/chat.types.d.ts.map +1 -1
- package/dist/generic/chat.types.js +105 -32
- package/dist/generic/chat.types.js.map +1 -1
- package/dist/generic/classify.types.d.ts +5 -2
- package/dist/generic/classify.types.d.ts.map +1 -1
- package/dist/generic/classify.types.js +8 -11
- package/dist/generic/classify.types.js.map +1 -1
- package/dist/generic/embed.types.d.ts +1 -1
- package/dist/generic/embed.types.js +1 -2
- package/dist/generic/errorAnalyzer.d.ts +94 -0
- package/dist/generic/errorAnalyzer.d.ts.map +1 -1
- package/dist/generic/errorAnalyzer.js +160 -28
- package/dist/generic/errorAnalyzer.js.map +1 -1
- package/dist/generic/errorTypes.d.ts +116 -0
- package/dist/generic/errorTypes.d.ts.map +1 -1
- package/dist/generic/errorTypes.js +1 -2
- package/dist/generic/reranker.types.d.ts +74 -0
- package/dist/generic/reranker.types.d.ts.map +1 -1
- package/dist/generic/reranker.types.js +10 -2
- package/dist/generic/reranker.types.js.map +1 -1
- package/dist/generic/summarize.types.d.ts +5 -2
- package/dist/generic/summarize.types.d.ts.map +1 -1
- package/dist/generic/summarize.types.js +8 -9
- package/dist/generic/summarize.types.js.map +1 -1
- package/dist/index.d.ts +15 -15
- package/dist/index.js +15 -31
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
|
@@ -1,7 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an API key configuration for AI services.
|
|
3
|
+
* Used to provide API keys at runtime for specific AI driver classes.
|
|
4
|
+
*/
|
|
1
5
|
export interface AIAPIKey {
|
|
6
|
+
/**
|
|
7
|
+
* The driver class name (e.g., 'OpenAILLM', 'AnthropicLLM', 'GroqLLM')
|
|
8
|
+
* This should match the exact driver class name used by the AI provider
|
|
9
|
+
*/
|
|
2
10
|
driverClass: string;
|
|
11
|
+
/**
|
|
12
|
+
* The API key value for the specified driver class
|
|
13
|
+
*/
|
|
3
14
|
apiKey: string;
|
|
4
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Default AI API Key Dictionary. You can override this with a custom implementation by creating a sub-class of this class and doing whatever you want in that class
|
|
18
|
+
* Make sure any sub-class implementation is registered with the RegisterClass decorator and a priority higher than 1.
|
|
19
|
+
*/
|
|
5
20
|
export declare class AIAPIKeys {
|
|
6
21
|
private static readonly _apiKeyPrefix;
|
|
7
22
|
protected static _cachedAPIKeys: {
|
|
@@ -12,6 +27,13 @@ export declare class AIAPIKeys {
|
|
|
12
27
|
GetAPIKey(AIDriverName: string): string;
|
|
13
28
|
protected getEnvVariableCaseInsensitive(name: string): string | undefined;
|
|
14
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Helper function that gets the API Key for a given AI Driver Name using the AIAPIKeys class or any registered sub-class of AIAPIKeys
|
|
32
|
+
* @param AIDriverName
|
|
33
|
+
* @param apiKeys - optional array of AIAPIKey objects to check first before falling back to the global AIAPIKeys class
|
|
34
|
+
* @param verbose - optional flag to enable verbose logging
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
15
37
|
export declare function GetAIAPIKey(AIDriverName: string, apiKeys?: AIAPIKey[], verbose?: boolean): string;
|
|
16
38
|
export declare function GetAIAPIKeyGlobal(AIDriverName: string): string;
|
|
17
39
|
//# sourceMappingURL=apiKeyDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiKeyDictionary.d.ts","sourceRoot":"","sources":["../../src/generic/apiKeyDictionary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apiKeyDictionary.d.ts","sourceRoot":"","sources":["../../src/generic/apiKeyDictionary.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACrB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,qBAAa,SAAS;IAClB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAyB;IAG9D,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAM;IAChE,SAAS,CAAC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAKvD,SAAS,CAAC,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAKtD,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAmB9C,SAAS,CAAC,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAK5E;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAmBjG;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAM9D"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { MJGlobal } from '@memberjunction/global';
|
|
2
|
+
/**
|
|
3
|
+
* Default AI API Key Dictionary. You can override this with a custom implementation by creating a sub-class of this class and doing whatever you want in that class
|
|
4
|
+
* Make sure any sub-class implementation is registered with the RegisterClass decorator and a priority higher than 1.
|
|
5
|
+
*/
|
|
6
|
+
export class AIAPIKeys {
|
|
7
|
+
static { this._apiKeyPrefix = 'AI_VENDOR_API_KEY__'; }
|
|
8
|
+
// cache the result to not go back to the env package as much
|
|
9
|
+
static { this._cachedAPIKeys = {}; }
|
|
6
10
|
GetCachedAPIKey(AIDriverName) {
|
|
7
11
|
const normalizedKey = AIDriverName.toUpperCase();
|
|
8
12
|
return AIAPIKeys._cachedAPIKeys[normalizedKey];
|
|
@@ -18,6 +22,7 @@ class AIAPIKeys {
|
|
|
18
22
|
return cached;
|
|
19
23
|
}
|
|
20
24
|
else {
|
|
25
|
+
// Adjust the way we build the env key to ensure it's normalized
|
|
21
26
|
const envKey = AIAPIKeys._apiKeyPrefix + normalizedKey;
|
|
22
27
|
const value = this.getEnvVariableCaseInsensitive(envKey);
|
|
23
28
|
if (value) {
|
|
@@ -34,10 +39,14 @@ class AIAPIKeys {
|
|
|
34
39
|
return envKey ? process.env[envKey] : undefined;
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
|
-
|
|
38
|
-
AIAPIKeys
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Helper function that gets the API Key for a given AI Driver Name using the AIAPIKeys class or any registered sub-class of AIAPIKeys
|
|
44
|
+
* @param AIDriverName
|
|
45
|
+
* @param apiKeys - optional array of AIAPIKey objects to check first before falling back to the global AIAPIKeys class
|
|
46
|
+
* @param verbose - optional flag to enable verbose logging
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export function GetAIAPIKey(AIDriverName, apiKeys, verbose) {
|
|
41
50
|
let apiKey;
|
|
42
51
|
if (apiKeys && apiKeys.length > 0) {
|
|
43
52
|
const localKey = apiKeys.find(k => k.driverClass === AIDriverName);
|
|
@@ -59,13 +68,11 @@ function GetAIAPIKey(AIDriverName, apiKeys, verbose) {
|
|
|
59
68
|
}
|
|
60
69
|
return apiKey;
|
|
61
70
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const obj = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(AIAPIKeys);
|
|
71
|
+
export function GetAIAPIKeyGlobal(AIDriverName) {
|
|
72
|
+
const obj = MJGlobal.Instance.ClassFactory.CreateInstance(AIAPIKeys); // get an instance of the above or a sub-class, whatever is registered with highest priority
|
|
65
73
|
if (obj)
|
|
66
74
|
return obj.GetAPIKey(AIDriverName);
|
|
67
75
|
else
|
|
68
76
|
throw new Error('Could not instantiate AIAPIKeys class');
|
|
69
77
|
}
|
|
70
|
-
exports.GetAIAPIKeyGlobal = GetAIAPIKeyGlobal;
|
|
71
78
|
//# sourceMappingURL=apiKeyDictionary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiKeyDictionary.js","sourceRoot":"","sources":["../../src/generic/apiKeyDictionary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apiKeyDictionary.js","sourceRoot":"","sources":["../../src/generic/apiKeyDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAmBlD;;;GAGG;AACH,MAAM,OAAO,SAAS;aACM,kBAAa,GAAG,qBAAqB,CAAC;IAE9D,6DAA6D;aAC5C,mBAAc,GAA8B,EAAE,CAAC;IACtD,eAAe,CAAC,YAAoB;QAC1C,MAAM,aAAa,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;QACjD,OAAO,SAAS,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;IACnD,CAAC;IAES,eAAe,CAAC,YAAoB,EAAE,KAAa;QACzD,MAAM,aAAa,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;QACjD,SAAS,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;IACpD,CAAC;IAEM,SAAS,CAAC,YAAoB;QACjC,MAAM,aAAa,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;QACnD,IAAI,MAAM,EAAE,CAAC;YACT,OAAO,MAAM,CAAC;QAClB,CAAC;aACI,CAAC;YACF,gEAAgE;YAChE,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,GAAG,aAAa,CAAC;YACvD,MAAM,KAAK,GAAG,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;YACzD,IAAI,KAAK,EAAE,CAAC;gBACR,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;gBAC3C,OAAO,KAAK,CAAC;YACjB,CAAC;;gBAEG,OAAO,SAAS,CAAC;QACzB,CAAC;IACL,CAAC;IAES,6B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Ac,CAAY,SAAS,CAAC,CAAC,CAAC,4FAA4F;IAC7K,IAAI,GAAG;QACH,OAAO,GAAG,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;;QAEnC,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { BaseModel, BaseParams } from "./baseModel.js";
|
|
2
|
+
/**
|
|
3
|
+
* Base class for all audio generation models. Each AI model will have a sub-class implementing the abstract methods in this base class. Not all
|
|
4
|
+
* sub-classes will support all methods. If a method is not supported an exception will be thrown, use the GetSupportedMethods method to determine
|
|
5
|
+
* what methods are supported by a specific sub-class.
|
|
6
|
+
*/
|
|
3
7
|
export declare abstract class BaseAudioGenerator extends BaseModel {
|
|
4
8
|
abstract CreateSpeech(params: TextToSpeechParams): Promise<SpeechResult>;
|
|
5
9
|
abstract SpeechToText(params: SpeechToTextParams): Promise<SpeechResult>;
|
|
@@ -8,51 +12,119 @@ export declare abstract class BaseAudioGenerator extends BaseModel {
|
|
|
8
12
|
abstract GetPronounciationDictionaries(): Promise<PronounciationDictionary[]>;
|
|
9
13
|
abstract GetSupportedMethods(): Promise<string[]>;
|
|
10
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Return payload for each CreateSpeech request
|
|
17
|
+
*/
|
|
11
18
|
export declare class SpeechResult {
|
|
19
|
+
/**
|
|
20
|
+
* True if the request was successful, false otherwise
|
|
21
|
+
*/
|
|
12
22
|
success: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If the request failed, this will contain the error message
|
|
25
|
+
*/
|
|
13
26
|
errorMessage?: string;
|
|
27
|
+
/**
|
|
28
|
+
* If the request was successful, this will contain the results. For CreateSpeech requests, an audio file in a base 64 encoded string and for
|
|
29
|
+
* SpeechToText requests, the text that was transcribed.
|
|
30
|
+
*/
|
|
14
31
|
content: string;
|
|
15
32
|
data?: Buffer;
|
|
16
33
|
}
|
|
17
34
|
export declare class SpeechToTextParams extends BaseParams {
|
|
35
|
+
/**
|
|
36
|
+
* Base 64 encoded audio file to convert to text
|
|
37
|
+
*/
|
|
18
38
|
audioFile: string;
|
|
19
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Interface defining voice configuration settings for text-to-speech generation
|
|
42
|
+
*/
|
|
20
43
|
export interface VoiceSettings {
|
|
44
|
+
/** Stability of the voice (0-1), higher values result in more consistent/stable voice output */
|
|
21
45
|
stability: number;
|
|
46
|
+
/** Similarity boost to original voice (0-1), higher values make the voice more similar to the original */
|
|
22
47
|
similarity_boost: number;
|
|
48
|
+
/** Style parameter (0-1) affecting the speech style characteristics */
|
|
23
49
|
style: number;
|
|
50
|
+
/** Whether to enhance speaker clarity and target voice characteristics */
|
|
24
51
|
use_speaker_boost: boolean;
|
|
52
|
+
/** Speed of speech (0-1), higher values result in faster speech */
|
|
25
53
|
speed: number;
|
|
26
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Parameters for text-to-speech generation requests
|
|
57
|
+
*/
|
|
27
58
|
export interface TextToSpeechParams {
|
|
59
|
+
/** Voice ID or name to use for speech generation */
|
|
28
60
|
voice: string;
|
|
61
|
+
/** Text content to convert to speech */
|
|
29
62
|
text: string;
|
|
63
|
+
/** Model ID to use, defaults to "eleven_monolingual_v1" */
|
|
30
64
|
model_id?: string;
|
|
65
|
+
/** Whether to stream the response */
|
|
31
66
|
stream?: boolean;
|
|
67
|
+
/** Voice configuration settings */
|
|
32
68
|
voice_settings?: VoiceSettings;
|
|
69
|
+
/** Output format specified as codec_samplerate_bitrate (e.g., "mp3_44100_128") */
|
|
33
70
|
output_format?: string;
|
|
71
|
+
/** Optimization level (0-4), where 0 is no optimization and 4 is maximum optimization */
|
|
34
72
|
latency?: number;
|
|
73
|
+
/** Text that came before this generation, used for maintaining continuity */
|
|
35
74
|
previous_text?: string;
|
|
75
|
+
/** ID of the previous generation request */
|
|
36
76
|
previous_request_id?: string;
|
|
77
|
+
/** Array of IDs for next generations */
|
|
37
78
|
next_request_ids?: string[];
|
|
79
|
+
/** ISO 639-1 language code for the speech generation */
|
|
38
80
|
language_code?: string;
|
|
81
|
+
/** Text normalization setting to control how numbers and special characters are handled */
|
|
39
82
|
apply_text_normalization?: "auto" | "on" | "off";
|
|
83
|
+
/** Array of pronunciation dictionary locators for custom word pronunciations */
|
|
40
84
|
pronunciation_dictionary_locators?: any[];
|
|
85
|
+
/** Special instructions for the voice generation */
|
|
41
86
|
instructions?: string;
|
|
42
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Contains information about a specific voice that can be used for audio generation
|
|
90
|
+
*/
|
|
43
91
|
export declare class VoiceInfo {
|
|
92
|
+
/**
|
|
93
|
+
* The ID of the voice
|
|
94
|
+
*/
|
|
44
95
|
id: string;
|
|
96
|
+
/**
|
|
97
|
+
* The name of the voice
|
|
98
|
+
*/
|
|
45
99
|
name: string;
|
|
100
|
+
/**
|
|
101
|
+
* Detailed text description of the voice
|
|
102
|
+
*/
|
|
46
103
|
description?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Optional, array of labels for the voice
|
|
106
|
+
*/
|
|
47
107
|
labels?: object[];
|
|
108
|
+
/**
|
|
109
|
+
* User defined category for managing voices
|
|
110
|
+
*/
|
|
48
111
|
category?: string;
|
|
49
112
|
stability?: number;
|
|
50
113
|
similarityBoost?: number;
|
|
51
114
|
style?: number;
|
|
52
115
|
useSpeakerBoost?: number;
|
|
116
|
+
/**
|
|
117
|
+
* An optional array of samples audio for the voice
|
|
118
|
+
*/
|
|
53
119
|
samples?: VoiceSample[];
|
|
120
|
+
/**
|
|
121
|
+
* The URL to a preview of the voice
|
|
122
|
+
*/
|
|
54
123
|
previewUrl?: string;
|
|
55
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Information about an individual voice sample associated with a voice
|
|
127
|
+
*/
|
|
56
128
|
export declare class VoiceSample {
|
|
57
129
|
id: string;
|
|
58
130
|
fileName: string;
|
|
@@ -61,19 +133,52 @@ export declare class VoiceSample {
|
|
|
61
133
|
hash: string;
|
|
62
134
|
}
|
|
63
135
|
export declare class AudioModel {
|
|
136
|
+
/**
|
|
137
|
+
* The ID of the model
|
|
138
|
+
*/
|
|
64
139
|
id: string;
|
|
140
|
+
/**
|
|
141
|
+
* The name of the model
|
|
142
|
+
*/
|
|
65
143
|
name: string;
|
|
144
|
+
/**
|
|
145
|
+
* Determines if the model supports text-to-speech
|
|
146
|
+
*/
|
|
66
147
|
supportsTextToSpeech: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Determines if the model supports voice conversion
|
|
150
|
+
*/
|
|
67
151
|
supportsVoiceConversion: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Determines if the model supports style adjustment
|
|
154
|
+
*/
|
|
68
155
|
supportsStyle: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Determines if the model supports speaker boost
|
|
158
|
+
*/
|
|
69
159
|
supportsSpeakerBoost: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Determines if the model supports fine tuning
|
|
162
|
+
*/
|
|
70
163
|
supportsFineTuning: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Optional, array of supported languages for the model
|
|
166
|
+
*/
|
|
71
167
|
languages?: AudioLanguage[];
|
|
72
168
|
}
|
|
73
169
|
export declare class AudioLanguage {
|
|
170
|
+
/**
|
|
171
|
+
* The ID of the language
|
|
172
|
+
*/
|
|
74
173
|
id: string;
|
|
174
|
+
/**
|
|
175
|
+
* The name of the language
|
|
176
|
+
*/
|
|
75
177
|
name: string;
|
|
76
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Some models support using pronounciation dictionaries to provide audio generation cues for specific words and phrases
|
|
181
|
+
*/
|
|
77
182
|
export declare class PronounciationDictionary {
|
|
78
183
|
id: string;
|
|
79
184
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseAudio.d.ts","sourceRoot":"","sources":["../../src/generic/baseAudio.ts"],"names":[],"mappings":"
|
|
1
|
+
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CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,UAAU;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,uBAAuB,EAAE,OAAO,CAAA;IAChC;;OAEG;IACH,aAAa,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAA;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,aAAa,EAAE,CAAA;CAC9B;AAED,qBAAa,aAAa;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,wBAAwB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { BaseModel, BaseParams } from "./baseModel.js";
|
|
2
|
+
/**
|
|
3
|
+
* Base class for all audio generation models. Each AI model will have a sub-class implementing the abstract methods in this base class. Not all
|
|
4
|
+
* sub-classes will support all methods. If a method is not supported an exception will be thrown, use the GetSupportedMethods method to determine
|
|
5
|
+
* what methods are supported by a specific sub-class.
|
|
6
|
+
*/
|
|
7
|
+
export class BaseAudioGenerator extends BaseModel {
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Return payload for each CreateSpeech request
|
|
11
|
+
*/
|
|
12
|
+
export class SpeechResult {
|
|
9
13
|
}
|
|
10
|
-
|
|
11
|
-
class SpeechToTextParams extends baseModel_1.BaseParams {
|
|
14
|
+
export class SpeechToTextParams extends BaseParams {
|
|
12
15
|
}
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Contains information about a specific voice that can be used for audio generation
|
|
18
|
+
*/
|
|
19
|
+
export class VoiceInfo {
|
|
15
20
|
}
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Information about an individual voice sample associated with a voice
|
|
23
|
+
*/
|
|
24
|
+
export class VoiceSample {
|
|
18
25
|
}
|
|
19
|
-
|
|
20
|
-
class AudioModel {
|
|
26
|
+
export class AudioModel {
|
|
21
27
|
}
|
|
22
|
-
|
|
23
|
-
class AudioLanguage {
|
|
28
|
+
export class AudioLanguage {
|
|
24
29
|
}
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Some models support using pronounciation dictionaries to provide audio generation cues for specific words and phrases
|
|
32
|
+
*/
|
|
33
|
+
export class PronounciationDictionary {
|
|
27
34
|
}
|
|
28
|
-
exports.PronounciationDictionary = PronounciationDictionary;
|
|
29
35
|
//# sourceMappingURL=baseAudio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseAudio.js","sourceRoot":"","sources":["../../src/generic/baseAudio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"baseAudio.js","sourceRoot":"","sources":["../../src/generic/baseAudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGpD;;;;GAIG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,SAAS;CAOzD;AAED;;GAEG;AACH,MAAM,OAAO,YAAY;CAexB;AAED,MAAM,OAAO,kBAAmB,SAAQ,UAAU;CAKjD;AAqDD;;GAEG;AACH,MAAM,OAAO,SAAS;CAwCrB;AAED;;GAEG;AACH,MAAM,OAAO,WAAW;CAMvB;AAED,MAAM,OAAO,UAAU;CAmCtB;AAED,MAAM,OAAO,aAAa;CASzB;AAED;;GAEG;AACH,MAAM,OAAO,wBAAwB;CAOpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseDiffusion.d.ts","sourceRoot":"","sources":["../../src/generic/baseDiffusion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"baseDiffusion.d.ts","sourceRoot":"","sources":["../../src/generic/baseDiffusion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,aAAa,CAAC"}
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./baseImage"), exports);
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated This module is deprecated. Use './baseImage' instead.
|
|
3
|
+
* This file is kept for backward compatibility only.
|
|
4
|
+
*/
|
|
5
|
+
export * from './baseImage.js';
|
|
18
6
|
//# sourceMappingURL=baseDiffusion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseDiffusion.js","sourceRoot":"","sources":["../../src/generic/baseDiffusion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"baseDiffusion.js","sourceRoot":"","sources":["../../src/generic/baseDiffusion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,aAAa,CAAC"}
|
|
@@ -1,14 +1,37 @@
|
|
|
1
|
-
import { BaseModel } from "./baseModel";
|
|
2
|
-
import { EmbedTextParams, EmbedTextResult, EmbedTextsParams, EmbedTextsResult } from "./embed.types";
|
|
1
|
+
import { BaseModel } from "./baseModel.js";
|
|
2
|
+
import { EmbedTextParams, EmbedTextResult, EmbedTextsParams, EmbedTextsResult } from "./embed.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Base class for all embedding model implementations
|
|
5
|
+
*/
|
|
3
6
|
export declare abstract class BaseEmbeddings extends BaseModel {
|
|
7
|
+
/**
|
|
8
|
+
* Protected property to store additional provider-specific settings
|
|
9
|
+
*/
|
|
4
10
|
protected _additionalSettings: Record<string, any>;
|
|
11
|
+
/**
|
|
12
|
+
* Get the current additional settings
|
|
13
|
+
*/
|
|
5
14
|
get AdditionalSettings(): Record<string, any>;
|
|
15
|
+
/**
|
|
16
|
+
* Set additional provider-specific settings
|
|
17
|
+
* Subclasses should override this method to validate required settings
|
|
18
|
+
*
|
|
19
|
+
* @param settings Provider-specific settings
|
|
20
|
+
*/
|
|
6
21
|
SetAdditionalSettings(settings: Record<string, any>): void;
|
|
22
|
+
/**
|
|
23
|
+
* Clear all additional settings
|
|
24
|
+
* This is useful for resetting the state of the provider
|
|
25
|
+
* or when switching between different configurations.
|
|
26
|
+
*/
|
|
7
27
|
ClearAdditionalSettings(): void;
|
|
8
28
|
abstract EmbedText(params: EmbedTextParams): Promise<EmbedTextResult>;
|
|
9
29
|
abstract EmbedTexts(params: EmbedTextsParams): Promise<EmbedTextsResult>;
|
|
10
30
|
abstract GetEmbeddingModels(): Promise<any>;
|
|
11
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use BaseEmbeddings instead - will be removed in a future release
|
|
34
|
+
*/
|
|
12
35
|
export declare abstract class Embeddings extends BaseEmbeddings {
|
|
13
36
|
}
|
|
14
37
|
//# sourceMappingURL=baseEmbeddings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseEmbeddings.d.ts","sourceRoot":"","sources":["../../src/generic/baseEmbeddings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"baseEmbeddings.d.ts","sourceRoot":"","sources":["../../src/generic/baseEmbeddings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAErG;;GAEG;AACH,8BAAsB,cAAe,SAAQ,SAAS;IAClD;;OAEG;IACH,SAAS,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAExD;;OAEG;IACH,IAAW,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAEnD;IAED;;;;;OAKG;IACI,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAIjE;;;;OAIG;IACI,uBAAuB,IAAI,IAAI;aAItB,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;aAC5D,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;aAC/D,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC;CACrD;AAED;;GAEG;AACH,8BAAsB,UAAW,SAAQ,cAAc;CAAG"}
|
|
@@ -1,24 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class BaseEmbeddings extends
|
|
1
|
+
import { BaseModel } from "./baseModel.js";
|
|
2
|
+
/**
|
|
3
|
+
* Base class for all embedding model implementations
|
|
4
|
+
*/
|
|
5
|
+
export class BaseEmbeddings extends BaseModel {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
+
/**
|
|
9
|
+
* Protected property to store additional provider-specific settings
|
|
10
|
+
*/
|
|
8
11
|
this._additionalSettings = {};
|
|
9
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Get the current additional settings
|
|
15
|
+
*/
|
|
10
16
|
get AdditionalSettings() {
|
|
11
17
|
return this._additionalSettings;
|
|
12
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Set additional provider-specific settings
|
|
21
|
+
* Subclasses should override this method to validate required settings
|
|
22
|
+
*
|
|
23
|
+
* @param settings Provider-specific settings
|
|
24
|
+
*/
|
|
13
25
|
SetAdditionalSettings(settings) {
|
|
14
26
|
this._additionalSettings = { ...this._additionalSettings, ...settings };
|
|
15
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Clear all additional settings
|
|
30
|
+
* This is useful for resetting the state of the provider
|
|
31
|
+
* or when switching between different configurations.
|
|
32
|
+
*/
|
|
16
33
|
ClearAdditionalSettings() {
|
|
17
34
|
this._additionalSettings = {};
|
|
18
35
|
}
|
|
19
36
|
}
|
|
20
|
-
|
|
21
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use BaseEmbeddings instead - will be removed in a future release
|
|
39
|
+
*/
|
|
40
|
+
export class Embeddings extends BaseEmbeddings {
|
|
22
41
|
}
|
|
23
|
-
exports.Embeddings = Embeddings;
|
|
24
42
|
//# sourceMappingURL=baseEmbeddings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseEmbeddings.js","sourceRoot":"","sources":["../../src/generic/baseEmbeddings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"baseEmbeddings.js","sourceRoot":"","sources":["../../src/generic/baseEmbeddings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;GAEG;AACH,MAAM,OAAgB,cAAe,SAAQ,SAAS;IAAtD;;QACI;;WAEG;QACO,wBAAmB,GAAwB,EAAE,CAAC;IA+B5D,CAAC;IA7BG;;OAEG;IACH,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACI,qBAAqB,CAAC,QAA6B;QACtD,IAAI,CAAC,mBAAmB,GAAG,EAAC,GAAG,IAAI,CAAC,mBAAmB,EAAE,GAAG,QAAQ,EAAC,CAAC;IAC1E,CAAC;IAED;;;;OAIG;IACI,uBAAuB;QAC1B,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC;IAClC,CAAC;CAKJ;AAED;;GAEG;AACH,MAAM,OAAgB,UAAW,SAAQ,cAAc;CAAG"}
|