@memberjunction/ai 5.40.2 → 5.42.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memberjunction/ai",
3
3
  "type": "module",
4
- "version": "5.40.2",
4
+ "version": "5.42.0",
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",
@@ -17,7 +17,7 @@
17
17
  "author": "MemberJunction.com",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
- "@memberjunction/global": "5.40.2",
20
+ "@memberjunction/global": "5.42.0",
21
21
  "dotenv": "^17.2.4",
22
22
  "rxjs": "^7.8.2"
23
23
  },
package/readme.md CHANGED
@@ -18,15 +18,18 @@ Every AI capability is represented by an abstract base class. Provider packages
18
18
 
19
19
  | Class | Purpose | Key Methods |
20
20
  |-------|---------|-------------|
21
- | `BaseLLM` | Chat completions (text generation) | `ChatCompletion()`, `ChatCompletions()` (parallel batch) |
22
- | `BaseEmbeddings` | Text-to-vector embeddings | `EmbedText()`, `EmbedTexts()` |
21
+ | `BaseLLM` | Chat completions (text generation) | `ChatCompletion()`, `ChatCompletions()` (parallel batch), `GetFileCapabilities()` |
22
+ | `BaseEmbeddings` | Text & multimodal embeddings | `EmbedText()`, `EmbedTexts()`, `EmbedContent()`, `GetFileCapabilities()` |
23
23
  | `BaseImageGenerator` | Image generation, editing, variations | `GenerateImage()`, `EditImage()`, `CreateVariation()` |
24
24
  | `BaseAudio` | Text-to-speech and speech-to-text | `TextToSpeech()`, `SpeechToText()` |
25
25
  | `BaseVideo` | Video generation from text/images | `GenerateVideo()` |
26
26
  | `BaseReranker` | Document reranking for retrieval | `Rerank()` |
27
+ | `BaseRealtimeModel` | Live, full-duplex, tool-calling realtime sessions (voice) | `StartSession()`, `CreateClientSession()` |
27
28
 
28
29
  All inherit from `BaseModel`, which manages API key storage and provides the `@RegisterClass` integration point.
29
30
 
31
+ One additional realtime primitive lives here that is *not* a `BaseModel` capability: `BaseRealtimeChannelServer` — the server half of the realtime **interactive-channel** plugin contract (`MJ: AI Agent Channels.ServerPluginClass`), mirroring the client half (`BaseRealtimeChannelClient` in the Angular conversations package). Concrete plugins register via `@RegisterClass(BaseRealtimeChannelServer, '<key>')` and are resolved per session by `RealtimeChannelServerHost` in `@memberjunction/ai-agents`. See [guides/REALTIME_CO_AGENTS_GUIDE.md](../../../guides/REALTIME_CO_AGENTS_GUIDE.md) §5.
32
+
30
33
  ## Type Definitions
31
34
 
32
35
  ### Chat Types
@@ -47,6 +50,7 @@ All inherit from `BaseModel`, which manages API key storage and provides the `@R
47
50
  |------|-------------|
48
51
  | `EmbedTextParams` / `EmbedTextResult` | Single text embedding request and response |
49
52
  | `EmbedTextsParams` / `EmbedTextsResult` | Batch text embedding request and response |
53
+ | `EmbedContentParams` / `EmbedContentResult` | Multimodal embedding request (text and/or interleaved media blocks fused into one vector) and response. `EmbedContent()` is non-abstract — it defaults to `EmbedText` for text-only content; multimodal providers override it. Supported media is declared per provider via `GetFileCapabilities()` |
50
54
 
51
55
  ### Other Types
52
56
 
@@ -58,6 +62,7 @@ All inherit from `BaseModel`, which manages API key storage and provides the `@R
58
62
  | `RerankParams` / `RerankResult` | Document reranking |
59
63
  | `ModelUsage` | Token counts and cost tracking (prompt tokens, completion tokens, total cost, currency) |
60
64
  | `BaseResult` | Common result base with success flag, timing, and error info |
65
+ | `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 |
61
66
 
62
67
  ## Utilities
63
68