@memberjunction/ai 3.4.0 → 4.1.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.
Files changed (67) hide show
  1. package/README.md +242 -0
  2. package/dist/generic/apiKeyDictionary.d.ts +22 -0
  3. package/dist/generic/apiKeyDictionary.d.ts.map +1 -1
  4. package/dist/generic/apiKeyDictionary.js +20 -13
  5. package/dist/generic/apiKeyDictionary.js.map +1 -1
  6. package/dist/generic/baseAudio.d.ts +107 -2
  7. package/dist/generic/baseAudio.d.ts.map +1 -1
  8. package/dist/generic/baseAudio.js +26 -20
  9. package/dist/generic/baseAudio.js.map +1 -1
  10. package/dist/generic/baseDiffusion.d.ts +5 -1
  11. package/dist/generic/baseDiffusion.d.ts.map +1 -1
  12. package/dist/generic/baseDiffusion.js +5 -17
  13. package/dist/generic/baseDiffusion.js.map +1 -1
  14. package/dist/generic/baseEmbeddings.d.ts +25 -2
  15. package/dist/generic/baseEmbeddings.d.ts.map +1 -1
  16. package/dist/generic/baseEmbeddings.js +26 -8
  17. package/dist/generic/baseEmbeddings.js.map +1 -1
  18. package/dist/generic/baseImage.d.ts +262 -2
  19. package/dist/generic/baseImage.d.ts.map +1 -1
  20. package/dist/generic/baseImage.js +83 -20
  21. package/dist/generic/baseImage.js.map +1 -1
  22. package/dist/generic/baseLLM.d.ts +100 -4
  23. package/dist/generic/baseLLM.d.ts.map +1 -1
  24. package/dist/generic/baseLLM.js +122 -14
  25. package/dist/generic/baseLLM.js.map +1 -1
  26. package/dist/generic/baseModel.d.ts +91 -0
  27. package/dist/generic/baseModel.d.ts.map +1 -1
  28. package/dist/generic/baseModel.js +37 -11
  29. package/dist/generic/baseModel.js.map +1 -1
  30. package/dist/generic/baseReranker.d.ts +81 -2
  31. package/dist/generic/baseReranker.d.ts.map +1 -1
  32. package/dist/generic/baseReranker.js +73 -6
  33. package/dist/generic/baseReranker.js.map +1 -1
  34. package/dist/generic/baseVideo.d.ts +24 -1
  35. package/dist/generic/baseVideo.d.ts.map +1 -1
  36. package/dist/generic/baseVideo.js +11 -14
  37. package/dist/generic/baseVideo.js.map +1 -1
  38. package/dist/generic/chat.types.d.ts +291 -2
  39. package/dist/generic/chat.types.d.ts.map +1 -1
  40. package/dist/generic/chat.types.js +105 -32
  41. package/dist/generic/chat.types.js.map +1 -1
  42. package/dist/generic/classify.types.d.ts +5 -2
  43. package/dist/generic/classify.types.d.ts.map +1 -1
  44. package/dist/generic/classify.types.js +8 -11
  45. package/dist/generic/classify.types.js.map +1 -1
  46. package/dist/generic/embed.types.d.ts +1 -1
  47. package/dist/generic/embed.types.js +1 -2
  48. package/dist/generic/errorAnalyzer.d.ts +94 -0
  49. package/dist/generic/errorAnalyzer.d.ts.map +1 -1
  50. package/dist/generic/errorAnalyzer.js +160 -28
  51. package/dist/generic/errorAnalyzer.js.map +1 -1
  52. package/dist/generic/errorTypes.d.ts +116 -0
  53. package/dist/generic/errorTypes.d.ts.map +1 -1
  54. package/dist/generic/errorTypes.js +1 -2
  55. package/dist/generic/reranker.types.d.ts +74 -0
  56. package/dist/generic/reranker.types.d.ts.map +1 -1
  57. package/dist/generic/reranker.types.js +10 -2
  58. package/dist/generic/reranker.types.js.map +1 -1
  59. package/dist/generic/summarize.types.d.ts +5 -2
  60. package/dist/generic/summarize.types.d.ts.map +1 -1
  61. package/dist/generic/summarize.types.js +8 -9
  62. package/dist/generic/summarize.types.js.map +1 -1
  63. package/dist/index.d.ts +15 -15
  64. package/dist/index.js +15 -31
  65. package/dist/index.js.map +1 -1
  66. package/package.json +8 -7
  67. package/readme.md +167 -967
package/README.md ADDED
@@ -0,0 +1,242 @@
1
+ # @memberjunction/ai
2
+
3
+ Core abstractions and base classes for the MemberJunction AI Framework. This package defines provider-agnostic interfaces for Large Language Models (LLMs), embeddings, image generation, audio, video, reranking, and more. It has **zero MemberJunction dependencies** beyond `@memberjunction/global`, making it suitable for standalone use in any TypeScript/JavaScript project.
4
+
5
+ ## Architecture
6
+
7
+ ```mermaid
8
+ graph TD
9
+ subgraph "@memberjunction/ai"
10
+ BM["BaseModel"]
11
+ style BM fill:#2d6a9f,stroke:#1a4971,color:#fff
12
+
13
+ BLLM["BaseLLM"]
14
+ style BLLM fill:#2d6a9f,stroke:#1a4971,color:#fff
15
+
16
+ BE["BaseEmbeddings"]
17
+ style BE fill:#2d6a9f,stroke:#1a4971,color:#fff
18
+
19
+ BIG["BaseImageGenerator"]
20
+ style BIG fill:#2d6a9f,stroke:#1a4971,color:#fff
21
+
22
+ BA["BaseAudio"]
23
+ style BA fill:#2d6a9f,stroke:#1a4971,color:#fff
24
+
25
+ BV["BaseVideo"]
26
+ style BV fill:#2d6a9f,stroke:#1a4971,color:#fff
27
+
28
+ BR["BaseReranker"]
29
+ style BR fill:#2d6a9f,stroke:#1a4971,color:#fff
30
+
31
+ CT["Chat Types"]
32
+ style CT fill:#7c5295,stroke:#563a6b,color:#fff
33
+
34
+ ET["Embed Types"]
35
+ style ET fill:#7c5295,stroke:#563a6b,color:#fff
36
+
37
+ ERR["ErrorAnalyzer"]
38
+ style ERR fill:#b8762f,stroke:#8a5722,color:#fff
39
+
40
+ AK["AIAPIKeys"]
41
+ style AK fill:#2d8659,stroke:#1a5c3a,color:#fff
42
+
43
+ BM --> BLLM
44
+ BM --> BE
45
+ BM --> BIG
46
+ BM --> BA
47
+ BM --> BV
48
+ BM --> BR
49
+ end
50
+
51
+ P1["OpenAI Provider"]
52
+ style P1 fill:#2d8659,stroke:#1a5c3a,color:#fff
53
+ P2["Anthropic Provider"]
54
+ style P2 fill:#2d8659,stroke:#1a5c3a,color:#fff
55
+ P3["Other Providers"]
56
+ style P3 fill:#2d8659,stroke:#1a5c3a,color:#fff
57
+
58
+ BLLM --> P1
59
+ BLLM --> P2
60
+ BLLM --> P3
61
+ ```
62
+
63
+ ## Installation
64
+
65
+ ```bash
66
+ npm install @memberjunction/ai
67
+ ```
68
+
69
+ ## Key Exports
70
+
71
+ ### Base Classes
72
+
73
+ | Class | Purpose |
74
+ |---|---|
75
+ | `BaseModel` | Root base class for all AI model types; manages API key storage |
76
+ | `BaseLLM` | Abstract base for chat completion providers with streaming, parallel execution, and thinking model support |
77
+ | `BaseEmbeddings` | Abstract base for text embedding providers |
78
+ | `BaseImageGenerator` | Abstract base for image generation, editing, and variation providers |
79
+ | `BaseAudio` | Abstract base for text-to-speech and speech-to-text providers |
80
+ | `BaseVideo` | Abstract base for video generation providers |
81
+ | `BaseReranker` | Abstract base for document reranking providers |
82
+
83
+ ### Type Definitions
84
+
85
+ | Type / Class | Purpose |
86
+ |---|---|
87
+ | `ChatParams` | Parameters for chat completion requests (messages, streaming, sampling controls) |
88
+ | `ChatResult` | Result of a chat completion including choices, usage, and cache info |
89
+ | `ChatMessage` | Individual message with role, content (text or multimodal blocks), and optional metadata |
90
+ | `ChatMessageContentBlock` | Multimodal content block (text, image, video, audio, file) |
91
+ | `StreamingChatCallbacks` | Callbacks for real-time streaming responses |
92
+ | `ParallelChatCompletionsCallbacks` | Callbacks for batch parallel completions |
93
+ | `EmbedTextParams` / `EmbedTextResult` | Parameters and results for single text embedding |
94
+ | `EmbedTextsParams` / `EmbedTextsResult` | Parameters and results for batch text embeddings |
95
+ | `ImageGenerationParams` / `ImageGenerationResult` | Image generation parameters and results |
96
+ | `SummarizeParams` / `SummarizeResult` | Text summarization parameters and results |
97
+ | `ClassifyParams` / `ClassifyResult` | Text classification parameters and results |
98
+ | `RerankParams` / `RerankResult` | Document reranking parameters and results |
99
+
100
+ ### Utilities
101
+
102
+ | Export | Purpose |
103
+ |---|---|
104
+ | `BaseResult` | Common result base with success flag, timing, and error info |
105
+ | `ModelUsage` | Token usage and cost tracking (prompt tokens, completion tokens, cost, currency) |
106
+ | `AIAPIKeys` | API key management via environment variables (`AI_VENDOR_API_KEY__<DRIVER>`) |
107
+ | `GetAIAPIKey()` | Helper to resolve API keys with optional runtime overrides |
108
+ | `ErrorAnalyzer` | Standardized error analysis across all providers with severity and failover hints |
109
+ | `AIErrorInfo` / `AIErrorType` | Structured error types (rate limit, authentication, context length, etc.) |
110
+ | `serializeMessageContent()` / `deserializeMessageContent()` | Content block serialization for database storage |
111
+ | `parseBase64DataUrl()` / `createBase64DataUrl()` | Base64 data URL utilities |
112
+
113
+ ## Usage
114
+
115
+ ### Basic Chat Completion
116
+
117
+ ```typescript
118
+ import { ChatParams, ChatMessageRole } from '@memberjunction/ai';
119
+ import { OpenAILLM } from '@memberjunction/ai-openai';
120
+
121
+ const llm = new OpenAILLM('your-api-key');
122
+
123
+ const params = new ChatParams();
124
+ params.model = 'gpt-4';
125
+ params.messages = [
126
+ { role: ChatMessageRole.user, content: 'What is the capital of France?' }
127
+ ];
128
+
129
+ const result = await llm.ChatCompletion(params);
130
+ console.log(result.data.choices[0].message.content);
131
+ ```
132
+
133
+ ### Streaming Chat Completion
134
+
135
+ ```typescript
136
+ const params = new ChatParams();
137
+ params.model = 'gpt-4';
138
+ params.streaming = true;
139
+ params.messages = [
140
+ { role: ChatMessageRole.user, content: 'Explain quantum computing' }
141
+ ];
142
+ params.streamingCallbacks = {
143
+ OnContent: (chunk, isComplete) => process.stdout.write(chunk),
144
+ OnComplete: (result) => console.log('\nDone!'),
145
+ OnError: (error) => console.error('Stream error:', error)
146
+ };
147
+
148
+ await llm.ChatCompletion(params);
149
+ ```
150
+
151
+ ### Parallel Chat Completions
152
+
153
+ ```typescript
154
+ const paramsArray = [
155
+ { ...baseParams, temperature: 0.3 },
156
+ { ...baseParams, temperature: 0.7 },
157
+ { ...baseParams, temperature: 1.0 }
158
+ ];
159
+
160
+ const results = await llm.ChatCompletions(paramsArray, {
161
+ OnCompletion: (result, index) => console.log(`Completion ${index} done`),
162
+ OnAllCompleted: (results) => console.log(`All ${results.length} done`)
163
+ });
164
+ ```
165
+
166
+ ### Multimodal Content
167
+
168
+ ```typescript
169
+ const params = new ChatParams();
170
+ params.model = 'gpt-4o';
171
+ params.messages = [
172
+ {
173
+ role: ChatMessageRole.user,
174
+ content: [
175
+ { type: 'text', content: 'What is in this image?' },
176
+ { type: 'image_url', content: 'data:image/png;base64,...' }
177
+ ]
178
+ }
179
+ ];
180
+ ```
181
+
182
+ ### Text Embeddings
183
+
184
+ ```typescript
185
+ import { EmbedTextParams } from '@memberjunction/ai';
186
+ import { OpenAIEmbeddings } from '@memberjunction/ai-openai';
187
+
188
+ const embedder = new OpenAIEmbeddings('your-api-key');
189
+ const result = await embedder.EmbedText({
190
+ model: 'text-embedding-ada-002',
191
+ text: 'Sample text to embed'
192
+ });
193
+ console.log(result.embedding); // number[]
194
+ ```
195
+
196
+ ### API Key Management
197
+
198
+ ```typescript
199
+ import { GetAIAPIKey } from '@memberjunction/ai';
200
+
201
+ // Reads from environment: AI_VENDOR_API_KEY__OPENAILLM
202
+ const key = GetAIAPIKey('OpenAILLM');
203
+
204
+ // With runtime override
205
+ const key2 = GetAIAPIKey('AnthropicLLM', [
206
+ { driverClass: 'AnthropicLLM', apiKey: 'sk-ant-...' }
207
+ ]);
208
+ ```
209
+
210
+ ## Provider Implementation
211
+
212
+ To create a new AI provider, extend the appropriate base class:
213
+
214
+ ```typescript
215
+ import { BaseLLM, ChatParams, ChatResult } from '@memberjunction/ai';
216
+
217
+ export class MyProviderLLM extends BaseLLM {
218
+ protected async nonStreamingChatCompletion(params: ChatParams): Promise<ChatResult> {
219
+ // Implement provider-specific chat completion
220
+ }
221
+
222
+ public async ClassifyText(params: ClassifyParams): Promise<ClassifyResult> {
223
+ // Implement or throw if not supported
224
+ }
225
+
226
+ public async SummarizeText(params: SummarizeParams): Promise<SummarizeResult> {
227
+ // Implement or throw if not supported
228
+ }
229
+
230
+ // For streaming support, override these:
231
+ public get SupportsStreaming(): boolean { return true; }
232
+ protected async createStreamingRequest(params: ChatParams): Promise<AsyncIterable<unknown>> { /* ... */ }
233
+ protected processStreamingChunk(chunk: unknown): { content: string } { /* ... */ }
234
+ protected finalizeStreamingResponse(content: string, lastChunk: unknown, usage: unknown): ChatResult { /* ... */ }
235
+ }
236
+ ```
237
+
238
+ ## Dependencies
239
+
240
+ - `@memberjunction/global` -- Class factory and global utilities (zero transitive dependencies)
241
+ - `dotenv` -- Environment variable loading
242
+ - `rxjs` -- Reactive extensions (used internally)
@@ -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":"AAMA,MAAM,WAAW,QAAQ;IAKrB,WAAW,EAAE,MAAM,CAAC;I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,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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetAIAPIKeyGlobal = exports.GetAIAPIKey = exports.AIAPIKeys = void 0;
4
- const global_1 = require("@memberjunction/global");
5
- class AIAPIKeys {
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
- exports.AIAPIKeys = AIAPIKeys;
38
- AIAPIKeys._apiKeyPrefix = 'AI_VENDOR_API_KEY__';
39
- AIAPIKeys._cachedAPIKeys = {};
40
- function GetAIAPIKey(AIDriverName, apiKeys, verbose) {
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
- exports.GetAIAPIKey = GetAIAPIKey;
63
- function GetAIAPIKeyGlobal(AIDriverName) {
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":";;;AAAA,mDAAkD;AAuBlD,MAAa,SAAS;IAKR,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,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,MAAc,CAAC;IACnB,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,YAAY,CAAC,CAAC;QACnE,IAAI,QAAQ,EAAE,CAAC;YACX,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;YACzB,IAAI,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,GAAG,CAAC,4CAA4C,YAAY,EAAE,CAAC,CAAC;YAC5E,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,MAAM,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;YACzC,IAAI,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,GAAG,CAAC,8CAA8C,YAAY,oBAAoB,CAAC,CAAC;YAChG,CAAC;QACL,CAAC;IACD,CAAC;SAAM,CAAC;QACJ,MAAM,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,YAAoB;IAClD,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,cAAc,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
- /// <reference types="node" />
2
- import { BaseModel, BaseParams } from "./baseModel";
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":";AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQpD,8BAAsB,kBAAmB,SAAQ,SAAS;aACtC,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;aAC/D,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;aAC/D,SAAS,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;aACjC,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;aAClC,6BAA6B,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;aACpE,mBAAmB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAC3D;AAKD,qBAAa,YAAY;IAIrB,OAAO,EAAE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;;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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PronounciationDictionary = exports.AudioLanguage = exports.AudioModel = exports.VoiceSample = exports.VoiceInfo = exports.SpeechToTextParams = exports.SpeechResult = exports.BaseAudioGenerator = void 0;
4
- const baseModel_1 = require("./baseModel");
5
- class BaseAudioGenerator extends baseModel_1.BaseModel {
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
- exports.BaseAudioGenerator = BaseAudioGenerator;
8
- class SpeechResult {
9
+ /**
10
+ * Return payload for each CreateSpeech request
11
+ */
12
+ export class SpeechResult {
9
13
  }
10
- exports.SpeechResult = SpeechResult;
11
- class SpeechToTextParams extends baseModel_1.BaseParams {
14
+ export class SpeechToTextParams extends BaseParams {
12
15
  }
13
- exports.SpeechToTextParams = SpeechToTextParams;
14
- class VoiceInfo {
16
+ /**
17
+ * Contains information about a specific voice that can be used for audio generation
18
+ */
19
+ export class VoiceInfo {
15
20
  }
16
- exports.VoiceInfo = VoiceInfo;
17
- class VoiceSample {
21
+ /**
22
+ * Information about an individual voice sample associated with a voice
23
+ */
24
+ export class VoiceSample {
18
25
  }
19
- exports.VoiceSample = VoiceSample;
20
- class AudioModel {
26
+ export class AudioModel {
21
27
  }
22
- exports.AudioModel = AudioModel;
23
- class AudioLanguage {
28
+ export class AudioLanguage {
24
29
  }
25
- exports.AudioLanguage = AudioLanguage;
26
- class PronounciationDictionary {
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":";;;AAAA,2CAAoD;AAQpD,MAAsB,kBAAmB,SAAQ,qBAAS;CAOzD;AAPD,gDAOC;AAKD,MAAa,YAAY;CAexB;AAfD,oCAeC;AAED,MAAa,kBAAmB,SAAQ,sBAAU;CAKjD;AALD,gDAKC;AAwDD,MAAa,SAAS;CAwCrB;AAxCD,8BAwCC;AAKD,MAAa,WAAW;CAMvB;AAND,kCAMC;AAED,MAAa,UAAU;CAmCtB;AAnCD,gCAmCC;AAED,MAAa,aAAa;CASzB;AATD,sCASC;AAKD,MAAa,wBAAwB;CAOpC;AAPD,4DAOC"}
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,2 +1,6 @@
1
- export * from './baseImage';
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';
2
6
  //# sourceMappingURL=baseDiffusion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseDiffusion.d.ts","sourceRoot":"","sources":["../../src/generic/baseDiffusion.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
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
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
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":";;;;;;;;;;;;;;;;AAIA,8CAA4B"}
1
+ {"version":3,"file":"baseDiffusion.js","sourceRoot":"","sources":["../../src/generic/baseDiffusion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,aAAa,CAAC"}