@memberjunction/ai 6.2.0-edge.0 → 6.2.0-edge.2
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 +33 -0
- package/dist/generic/apiKeyDictionary.d.ts.map +1 -1
- package/dist/generic/apiKeyDictionary.js +19 -0
- package/dist/generic/apiKeyDictionary.js.map +1 -1
- package/dist/generic/baseAudio.d.ts +31 -14
- package/dist/generic/baseAudio.d.ts.map +1 -1
- package/dist/generic/baseAudio.js +20 -49
- package/dist/generic/baseAudio.js.map +1 -1
- package/dist/generic/baseDecision.d.ts +125 -0
- package/dist/generic/baseDecision.d.ts.map +1 -0
- package/dist/generic/baseDecision.js +387 -0
- package/dist/generic/baseDecision.js.map +1 -0
- package/dist/generic/baseEmbeddings.d.ts +8 -0
- package/dist/generic/baseEmbeddings.d.ts.map +1 -1
- package/dist/generic/baseEmbeddings.js +10 -0
- package/dist/generic/baseEmbeddings.js.map +1 -1
- package/dist/generic/baseImage.js +10 -10
- package/dist/generic/baseImage.js.map +1 -1
- package/dist/generic/baseLLM.d.ts +55 -1
- package/dist/generic/baseLLM.d.ts.map +1 -1
- package/dist/generic/baseLLM.js +44 -2
- package/dist/generic/baseLLM.js.map +1 -1
- package/dist/generic/baseModel.js +3 -3
- package/dist/generic/baseModel.js.map +1 -1
- package/dist/generic/baseSpeechToText.d.ts +47 -0
- package/dist/generic/baseSpeechToText.d.ts.map +1 -0
- package/dist/generic/baseSpeechToText.js +84 -0
- package/dist/generic/baseSpeechToText.js.map +1 -0
- package/dist/generic/baseTextToSpeech.d.ts +26 -0
- package/dist/generic/baseTextToSpeech.d.ts.map +1 -0
- package/dist/generic/baseTextToSpeech.js +12 -0
- package/dist/generic/baseTextToSpeech.js.map +1 -0
- package/dist/generic/baseVideo.d.ts +15 -1
- package/dist/generic/baseVideo.d.ts.map +1 -1
- package/dist/generic/baseVideo.js.map +1 -1
- package/dist/generic/chat.types.d.ts +28 -0
- package/dist/generic/chat.types.d.ts.map +1 -1
- package/dist/generic/chat.types.js +51 -11
- package/dist/generic/chat.types.js.map +1 -1
- package/dist/generic/classify.types.d.ts +11 -0
- package/dist/generic/classify.types.d.ts.map +1 -1
- package/dist/generic/classify.types.js +11 -0
- package/dist/generic/classify.types.js.map +1 -1
- package/dist/generic/decision.types.d.ts +225 -0
- package/dist/generic/decision.types.d.ts.map +1 -0
- package/dist/generic/decision.types.js +43 -0
- package/dist/generic/decision.types.js.map +1 -0
- package/dist/generic/errorAnalyzer.d.ts +2 -0
- package/dist/generic/errorAnalyzer.d.ts.map +1 -1
- package/dist/generic/errorAnalyzer.js +16 -8
- package/dist/generic/errorAnalyzer.js.map +1 -1
- package/dist/generic/linearTextScan.d.ts +18 -0
- package/dist/generic/linearTextScan.d.ts.map +1 -0
- package/dist/generic/linearTextScan.js +70 -0
- package/dist/generic/linearTextScan.js.map +1 -0
- package/dist/generic/modelConfiguration.d.ts +68 -3
- package/dist/generic/modelConfiguration.d.ts.map +1 -1
- package/dist/generic/modelConfiguration.js +26 -5
- package/dist/generic/modelConfiguration.js.map +1 -1
- package/dist/generic/openAICompatibleTools.d.ts +10 -0
- package/dist/generic/openAICompatibleTools.d.ts.map +1 -1
- package/dist/generic/openAICompatibleTools.js +27 -7
- package/dist/generic/openAICompatibleTools.js.map +1 -1
- package/dist/generic/reranker.types.d.ts +6 -0
- package/dist/generic/reranker.types.d.ts.map +1 -1
- package/dist/generic/summarize.types.d.ts +7 -0
- package/dist/generic/summarize.types.d.ts.map +1 -1
- package/dist/generic/summarize.types.js +7 -0
- package/dist/generic/summarize.types.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/readme.md +12 -6
package/dist/index.js
CHANGED
|
@@ -2,16 +2,20 @@ export * from './generic/baseModel.js';
|
|
|
2
2
|
export * from './generic/baseLLM.js';
|
|
3
3
|
export * from './generic/baseImage.js';
|
|
4
4
|
export * from './generic/baseReranker.js';
|
|
5
|
+
export * from './generic/baseDecision.js';
|
|
5
6
|
export * from './generic/chat.types.js';
|
|
6
7
|
export * from './generic/toolTurnEncoding.js';
|
|
7
8
|
export * from './generic/openAICompatibleTools.js';
|
|
8
9
|
export * from './generic/classify.types.js';
|
|
9
10
|
export * from './generic/summarize.types.js';
|
|
10
11
|
export * from './generic/reranker.types.js';
|
|
12
|
+
export * from './generic/decision.types.js';
|
|
11
13
|
export * from './generic/apiKeyDictionary.js';
|
|
12
14
|
export * from './generic/embed.types.js';
|
|
13
15
|
export * from './generic/baseEmbeddings.js';
|
|
14
16
|
export * from './generic/baseAudio.js';
|
|
17
|
+
export * from './generic/baseTextToSpeech.js';
|
|
18
|
+
export * from './generic/baseSpeechToText.js';
|
|
15
19
|
export * from './generic/baseVideo.js';
|
|
16
20
|
export * from './generic/baseRealtime.js';
|
|
17
21
|
export * from './generic/realtimeUsage.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ai",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.2.0-edge.
|
|
4
|
+
"version": "6.2.0-edge.2",
|
|
5
5
|
"description": "MemberJunction: AI - core components for abstracting LLMs and other AI model types that are usable anywhere without ANY other MJ dependencies past @memberjunction/global which itself has zero additional dependencies.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"author": "MemberJunction.com",
|
|
12
12
|
"license": "BUSL-1.1",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@memberjunction/global": "6.2.0-edge.
|
|
14
|
+
"@memberjunction/global": "6.2.0-edge.2",
|
|
15
15
|
"dotenv": "^17.2.4",
|
|
16
16
|
"rxjs": "^7.8.2"
|
|
17
17
|
},
|
package/readme.md
CHANGED
|
@@ -21,9 +21,12 @@ Every AI capability is represented by an abstract base class. Provider packages
|
|
|
21
21
|
| `BaseLLM` | Chat completions (text generation) | `ChatCompletion()`, `ChatCompletions()` (parallel batch), `GetFileCapabilities()` |
|
|
22
22
|
| `BaseEmbeddings` | Text & multimodal embeddings | `EmbedText()`, `EmbedTexts()`, `EmbedContent()`, `GetFileCapabilities()` |
|
|
23
23
|
| `BaseImageGenerator` | Image generation, editing, variations | `GenerateImage()`, `EditImage()`, `CreateVariation()` |
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
24
|
+
| `BaseTextToSpeech` | Text-to-speech (`TTS` models) | `CreateSpeech()`, `GetVoices()`, `GetModels()`, `GetPronounciationDictionaries()` |
|
|
25
|
+
| `BaseSpeechToText` | Speech-to-text (`Speech to Text` models) | `SpeechToText()`, `GetModels()`; oversized audio via `TranscribeAudioWithSplitting()` |
|
|
26
|
+
| `BaseAudioGenerator` | **Deprecated.** Both of the above on one class. Kept, and still working, for existing drivers and callers; it implements both new classes | `CreateSpeech()`, `SpeechToText()`, `GetVoices()` |
|
|
27
|
+
| `BaseVideoGenerator` | Avatar video generation (`Video` models) | `CreateAvatarVideo()`, `GetAvatars()` |
|
|
26
28
|
| `BaseReranker` | Document reranking for retrieval | `Rerank()` |
|
|
29
|
+
| `BaseDecision` | Typed decisions (Likelihood, Choice, Score) with a probability per answer | `Decide()` |
|
|
27
30
|
| `BaseRealtimeModel` | Live, full-duplex, tool-calling realtime sessions (voice) | `StartSession()`, `CreateClientSession()` |
|
|
28
31
|
|
|
29
32
|
All inherit from `BaseModel`, which manages API key storage and provides the `@RegisterClass` integration point.
|
|
@@ -43,6 +46,7 @@ One additional realtime primitive lives here that is *not* a `BaseModel` capabil
|
|
|
43
46
|
| `StreamingChatCallbacks` | Callbacks for real-time streaming: `OnContent`, `OnComplete`, `OnError` |
|
|
44
47
|
| `ParallelChatCompletionsCallbacks` | Callbacks for batch parallel completions |
|
|
45
48
|
| `ChatMessageRole` | Enum: `system`, `user`, `assistant` |
|
|
49
|
+
| `VolatileStateMessageMetadata` / `TrailingVolatileStateSplit` | The one metadata flag (`volatileState`) drivers and the agent layer agree on for a per-request trailing message, and the `{ head, tail }` split `BaseLLM.splitTrailingVolatileState` returns so a driver can place its cache boundary before the volatile tail (protected seam: `isVolatileStateMessage`, `trailingVolatileStateIndex`, `splitTrailingVolatileState`) |
|
|
46
50
|
|
|
47
51
|
### Embedding Types
|
|
48
52
|
|
|
@@ -57,10 +61,12 @@ One additional realtime primitive lives here that is *not* a `BaseModel` capabil
|
|
|
57
61
|
| Type | Description |
|
|
58
62
|
|------|-------------|
|
|
59
63
|
| `ImageGenerationParams` / `ImageGenerationResult` | Image generation parameters and results |
|
|
60
|
-
| `SummarizeParams` / `SummarizeResult` | Text summarization |
|
|
61
|
-
| `ClassifyParams` / `ClassifyResult` | Text classification |
|
|
64
|
+
| `SummarizeParams` / `SummarizeResult` | Text summarization (deprecated) |
|
|
65
|
+
| `ClassifyParams` / `ClassifyResult` | Text classification (deprecated) |
|
|
62
66
|
| `RerankParams` / `RerankResult` | Document reranking |
|
|
67
|
+
| `DecisionParams` / `DecisionResult` | Typed decision parameters and structured results with probabilities |
|
|
63
68
|
| `ModelUsage` | Token counts and cost tracking (prompt tokens, completion tokens, total cost, currency) |
|
|
69
|
+
| `AIModelConfiguration` / `LLMConfigurationSettings` / `IsPrefixPromptCache` | The model catalog's `ModelConfiguration` JSONType bag (Model Types < Models < the vendor's `Configuration.ModelDefaults` (`AIVendorConfiguration`, parsed by `ParseVendorConfiguration`) < Model Vendors, resolved by `ResolveEffectiveModelConfiguration`). `LLMConfigurationSettings.PrefixPromptCache` (read via `IsPrefixPromptCache`) says whether a serving path's prompt cache is an exact byte-prefix match (OpenAI, xAI — set once under the vendor row's `Configuration.ModelDefaults`, inherited by every model it serves) rather than block/segment based, which decides whether the agent layer appends or replaces its trailing runtime-state message |
|
|
64
70
|
| `BaseResult` | Common result base with success flag, timing, and error info |
|
|
65
71
|
| `FileCapabilities` | Declares which non-text inputs a provider accepts: `SupportedMimeTypes` (e.g. `image/png`, `audio/mp3`, supports `image/*` wildcards), `MaxFileSize`, `MaxFilesPerRequest`, `HasFileAPI`. Returned by `GetFileCapabilities()` on `BaseLLM` (file inputs to chat) and `BaseEmbeddings` (media inputs to `EmbedContent`); `null` means text-only |
|
|
66
72
|
|
|
@@ -184,10 +190,10 @@ export class MyProviderLLM extends BaseLLM {
|
|
|
184
190
|
// Your API call here
|
|
185
191
|
}
|
|
186
192
|
|
|
187
|
-
//
|
|
193
|
+
// Required by BaseLLM but deprecated: new drivers should throw a "not supported" error
|
|
188
194
|
public async ClassifyText(params: ClassifyParams): Promise<ClassifyResult> { /* ... */ }
|
|
189
195
|
|
|
190
|
-
//
|
|
196
|
+
// Required by BaseLLM but deprecated: new drivers should throw a "not supported" error
|
|
191
197
|
public async SummarizeText(params: SummarizeParams): Promise<SummarizeResult> { /* ... */ }
|
|
192
198
|
|
|
193
199
|
// Optional: enable streaming by overriding these
|