@memberjunction/ai-heygen 6.2.0-edge.7 → 6.2.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +161 -0
- package/package.json +4 -4
- package/readme.md +0 -95
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,166 @@
|
|
|
1
1
|
# @memberjunction/ai-heygen
|
|
2
2
|
|
|
3
|
+
## 6.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 79279f2: Text-to-speech, speech-to-text and video now have runners, like chat, embeddings and images.
|
|
8
|
+
- **`AITextToSpeechRunner`** (`TTS` models), **`AISpeechToTextRunner`** (`Speech to Text` models) and **`AIVideoRunner`** (`Video` models) select a model from a carrier prompt's bindings, or a pinned `ModelID`, resolve its credential, fail over, and record every call as an AI Prompt Run. The run row never holds audio or video. Text-to-speech records the characters sent in the `Characters` measure unless the driver reports its own quantity; speech-to-text records the audio's seconds when the provider reports them; video records seconds only when a driver reports them, which HeyGen's does not. They share their lifecycle through a new `BaseMediaRunner`.
|
|
9
|
+
- New metadata: the `Default Text To Speech`, `Default Speech To Text` and `Default Video Generation` prompts, which the runners use when no prompt is named.
|
|
10
|
+
- **`BaseAudioGenerator` is split** into `BaseTextToSpeech` and `BaseSpeechToText`. `BaseAudioGenerator` is deprecated but keeps working: it implements both, and every driver still extends it and stays registered against it under the same key. `OpenAIAudioGenerator` also registers against both new classes, `ElevenLabsAudioGenerator` against `BaseTextToSpeech`, and `GroqAudioGenerator` against `BaseSpeechToText`. The split-and-join transcription loop is also exported as `TranscribeAudioWithSplitting`.
|
|
11
|
+
- `VideoResult` gains an optional `usage`, for a driver that reports the video's length.
|
|
12
|
+
- `SpeechResult` and `VideoResult` gain an optional `errorInfo`. The OpenAI, ElevenLabs, Groq and HeyGen audio and video drivers now fill it from the error their SDK threw, keeping its HTTP status, so a caller can tell a rejected request from an outage. The runners fail over on it: a 400 or 422 no longer fails over to every other candidate.
|
|
13
|
+
- The media runners take `TimeoutMS` and `CancellationToken`, which bound each driver call as `timeoutMS` and `cancellationToken` bound a chat call.
|
|
14
|
+
- `BaseModelRunner` gains `ResolveUsageToRecord` and `ApplyUsageToRunRecord`, which the image runner now uses too, so every non-chat runner records units the same way.
|
|
15
|
+
|
|
16
|
+
Nothing called the audio or video drivers before, so no existing caller changes behavior.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 4e4c82d: A cancelled model call now stops where it is: it is never failed over or retried, a call cancelled in flight is reported as `Cancelled` (a non-chat call cancelled before it starts is refused before a run row exists), and the cancellation reaches the vendor's SDK so the request is torn down rather than abandoned (#5548, #3132).
|
|
21
|
+
|
|
22
|
+
**Prompts and agents (#5548)**
|
|
23
|
+
- **No failover walk after a cancel.** `ExecuteWithFailover` stops before each candidate once the caller's token is aborted, and after any attempt that fails while it is aborted or that reports a cancellation. Before, one abort walked every model candidate (113 real driver calls in a live test) and logged an `[ERROR] [ModelExecution]` with a stack trace for each. Real failures before the cancel are still recorded as failover attempts. A timeout is not a cancellation and still fails over.
|
|
24
|
+
- **Logged once, recorded as cancelled.** One info line instead of an error per candidate. The prompt run is saved `Cancelled` / `user_requested`, and the `AIPromptRunResult` carries `status: 'Cancelled'` and `cancelled: true`.
|
|
25
|
+
- **Agent runs end Cancelled.** `BaseAgent` checks the token before treating a failed prompt as a failure, and before counting a failed step toward the consecutive-failure limit, so a run cancelled mid-prompt no longer ends `Failed`. A final answer that had already finished when Stop landed still completes the run.
|
|
26
|
+
- **Failover fields persist.** A prompt run's `FailoverAttempts`, `FailoverErrors`, `FailoverDurations`, `TotalFailoverDuration` and failed-over `ModelID` / `VendorID` were written while its `Running` INSERT could still be in flight, and the INSERT's reload reset them, so a run that failed over could be saved with `FailoverAttempts = 0`. They are now set again in the queued finalize update, after the reload. This affected every runner, not only cancellation.
|
|
27
|
+
|
|
28
|
+
**Cancellation in `@memberjunction/ai` (#3132)**
|
|
29
|
+
- **`AIErrorType` has `'Cancelled'`**: Fatal and never failed over. `ErrorAnalyzer` on its own classifies an error named `AbortError`, `APIUserAbortError` or `RequestAbortedError` as `Cancelled`. The signal-aware helpers that `BaseLLM`, `BaseDecision` and every runner use (`BuildCancellationErrorInfo`) decide by why the signal was aborted, so an abort caused by a timeout stays a retriable `NetworkError`. A timeout is recognized by the abort reason's type — a `TimeoutError`, or a reason flagged `IsTimeout` (new `TimeoutAbortReason`; `AIPromptTimeoutError` sets it) — never by the words of a caller's reason.
|
|
30
|
+
- **Shared helpers** (exported): `IsAbortError`, `IsTimeoutAbort`, `IsRequestAborted`, `BuildCancellationErrorInfo`, `IsCancellationErrorInfo`, `DescribeCancellation`, `CreateCancellationError`, `ThrowIfAborted`, `AbortableDelay`, and the `REQUEST_CANCELLED_CODE` / `REQUEST_TIMEOUT_CODE` codes.
|
|
31
|
+
- **`BaseLLM` owns chat cancellation, per request.** It answers an already-aborted request without calling the driver, turns an abort (thrown, or a failed result while the signal is aborted) into one cancelled result, and decides a streaming cancellation from the request's own signal, so drivers no longer keep cancellation state on a shared instance. New protected `BuildCancelledChatResult`, `IsCancellationError` and the `IsProviderAbortError` hook. A pre-aborted streaming request now resolves cancelled on every driver instead of rejecting with a generic error.
|
|
32
|
+
- **Every chat driver uses it.** The duplicated cancelled-result builders, predicates and stream-cancel flags are gone from Anthropic, Azure, Bedrock, Betty, BettyBot, Cerebras, Fireworks, Gemini (and Vertex), Groq, Inception, LMStudio, Mistral, Ollama and OpenAI (and its subclasses). Anthropic, Bedrock, Gemini, Mistral and Ollama used to report a cancel as a retriable `Unknown` error. Cancel messages now read "Request was cancelled[: reason]".
|
|
33
|
+
- **Bedrock streaming** iterated the response envelope instead of its body, so every streaming call failed with "stream is not async iterable". Fixed.
|
|
34
|
+
- `BaseDecision` and the decision runner classify an aborted decision by its signal, so a timeout fails over and a cancel does not.
|
|
35
|
+
|
|
36
|
+
**Non-chat models**
|
|
37
|
+
- **Media** (text-to-speech, speech-to-text, video): the driver params carry `CancellationToken`, the runner passes the call's bound signal, and the OpenAI, Groq, ElevenLabs and HeyGen drivers forward it. `MediaOperation.Invoke` takes the signal as a third argument.
|
|
38
|
+
- **Embeddings, rerank and image generation** gain timeout and cancellation: `TimeoutMS` / `CancellationToken` on their run options, a pre-aborted run refused before a run row exists, a cancelled run recorded `Cancelled` and not failed over, and a timeout failed over. The param types gain `CancellationToken`, and the OpenAI, Azure, Bedrock, Cohere, Gemini, Mistral, Ollama and local embedding drivers, the Cohere, LLM and decision rerankers, and the OpenAI, Gemini and FLUX image drivers forward it. A cancelled `BaseEmbeddings.EmbedTexts` now throws a cancellation error instead of returning an empty result. The local embedding model can only stop between texts or batches.
|
|
39
|
+
|
|
40
|
+
**Testing**
|
|
41
|
+
- `TestLLM` gains a `hangUntilAborted` outcome. The LLM conformance suite drops `PreAbortedStreamingBehavior`: every driver must resolve a pre-aborted request as `Cancelled`.
|
|
42
|
+
- New integration bundle **IT122 - Agent Prompt Cancellation**: a real agent run cancelled mid-call stops at that call and is recorded cancelled throughout.
|
|
43
|
+
|
|
44
|
+
- Updated dependencies [0d81c53]
|
|
45
|
+
- Updated dependencies [1419ba7]
|
|
46
|
+
- Updated dependencies [d17de94]
|
|
47
|
+
- Updated dependencies [7ada797]
|
|
48
|
+
- Updated dependencies [ff3097d]
|
|
49
|
+
- Updated dependencies [79279f2]
|
|
50
|
+
- Updated dependencies [38c4a81]
|
|
51
|
+
- Updated dependencies [e51296c]
|
|
52
|
+
- Updated dependencies [a50948e]
|
|
53
|
+
- Updated dependencies [2552b1e]
|
|
54
|
+
- Updated dependencies [25bb295]
|
|
55
|
+
- Updated dependencies [432cb73]
|
|
56
|
+
- Updated dependencies [3080e83]
|
|
57
|
+
- Updated dependencies [4c6a28b]
|
|
58
|
+
- Updated dependencies [c93c0f8]
|
|
59
|
+
- Updated dependencies [293c316]
|
|
60
|
+
- Updated dependencies [b518dfa]
|
|
61
|
+
- Updated dependencies [ecf36eb]
|
|
62
|
+
- Updated dependencies [709de1a]
|
|
63
|
+
- Updated dependencies [155aa45]
|
|
64
|
+
- Updated dependencies [6cd23e1]
|
|
65
|
+
- Updated dependencies [51634e7]
|
|
66
|
+
- Updated dependencies [1d6e3e8]
|
|
67
|
+
- Updated dependencies [de2dc2f]
|
|
68
|
+
- Updated dependencies [15a4333]
|
|
69
|
+
- Updated dependencies [dfe40a4]
|
|
70
|
+
- Updated dependencies [1da00cb]
|
|
71
|
+
- Updated dependencies [b699a37]
|
|
72
|
+
- Updated dependencies [a4b23b7]
|
|
73
|
+
- Updated dependencies [29b16ee]
|
|
74
|
+
- Updated dependencies [a6a4656]
|
|
75
|
+
- Updated dependencies [961d529]
|
|
76
|
+
- Updated dependencies [10c2311]
|
|
77
|
+
- Updated dependencies [5da3ad2]
|
|
78
|
+
- Updated dependencies [8f370b3]
|
|
79
|
+
- Updated dependencies [1090caa]
|
|
80
|
+
- Updated dependencies [81aea34]
|
|
81
|
+
- Updated dependencies [e1dd673]
|
|
82
|
+
- Updated dependencies [f3c6161]
|
|
83
|
+
- Updated dependencies [5148534]
|
|
84
|
+
- Updated dependencies [c261eb8]
|
|
85
|
+
- Updated dependencies [59e32e0]
|
|
86
|
+
- Updated dependencies [ce1a5c3]
|
|
87
|
+
- Updated dependencies [4283a82]
|
|
88
|
+
- Updated dependencies [914e6ff]
|
|
89
|
+
- Updated dependencies [4889fb2]
|
|
90
|
+
- Updated dependencies [b87e4ac]
|
|
91
|
+
- Updated dependencies [b2441c3]
|
|
92
|
+
- Updated dependencies [69e19c5]
|
|
93
|
+
- Updated dependencies [7316ac3]
|
|
94
|
+
- Updated dependencies [8ef5e86]
|
|
95
|
+
- Updated dependencies [596855c]
|
|
96
|
+
- Updated dependencies [fdf6669]
|
|
97
|
+
- Updated dependencies [4c682c1]
|
|
98
|
+
- Updated dependencies [f325baa]
|
|
99
|
+
- Updated dependencies [2274f42]
|
|
100
|
+
- Updated dependencies [4c0eaec]
|
|
101
|
+
- Updated dependencies [1d43161]
|
|
102
|
+
- Updated dependencies [08a4cfc]
|
|
103
|
+
- Updated dependencies [b09fe34]
|
|
104
|
+
- Updated dependencies [29b6ec3]
|
|
105
|
+
- Updated dependencies [1141164]
|
|
106
|
+
- Updated dependencies [230cdad]
|
|
107
|
+
- Updated dependencies [8bac4d6]
|
|
108
|
+
- Updated dependencies [575bfae]
|
|
109
|
+
- Updated dependencies [c018cb9]
|
|
110
|
+
- Updated dependencies [80905a1]
|
|
111
|
+
- Updated dependencies [4e4c82d]
|
|
112
|
+
- Updated dependencies [5a3de97]
|
|
113
|
+
- Updated dependencies [0d0ba18]
|
|
114
|
+
- Updated dependencies [b6fcb30]
|
|
115
|
+
- Updated dependencies [f73e192]
|
|
116
|
+
- Updated dependencies [8704df6]
|
|
117
|
+
- Updated dependencies [5345e3d]
|
|
118
|
+
- Updated dependencies [22c9074]
|
|
119
|
+
- Updated dependencies [6b0de38]
|
|
120
|
+
- Updated dependencies [aee2d53]
|
|
121
|
+
- Updated dependencies [279b93e]
|
|
122
|
+
- Updated dependencies [5dc3752]
|
|
123
|
+
- Updated dependencies [6c8798b]
|
|
124
|
+
- Updated dependencies [4ef13d6]
|
|
125
|
+
- Updated dependencies [72dd65c]
|
|
126
|
+
- Updated dependencies [25f7b82]
|
|
127
|
+
- Updated dependencies [8b90b41]
|
|
128
|
+
- Updated dependencies [35ed7b5]
|
|
129
|
+
- Updated dependencies [d853bf8]
|
|
130
|
+
- Updated dependencies [e293b68]
|
|
131
|
+
- Updated dependencies [6a5fb64]
|
|
132
|
+
- Updated dependencies [0e93e1f]
|
|
133
|
+
- Updated dependencies [afe9eb4]
|
|
134
|
+
- Updated dependencies [4d647e6]
|
|
135
|
+
- Updated dependencies [bea2386]
|
|
136
|
+
- Updated dependencies [17a4137]
|
|
137
|
+
- Updated dependencies [36a3f9e]
|
|
138
|
+
- Updated dependencies [d2cb42e]
|
|
139
|
+
- Updated dependencies [cbddadb]
|
|
140
|
+
- Updated dependencies [c4645bc]
|
|
141
|
+
- Updated dependencies [5b41d48]
|
|
142
|
+
- Updated dependencies [4b9542c]
|
|
143
|
+
- Updated dependencies [ba00ac7]
|
|
144
|
+
- Updated dependencies [e962151]
|
|
145
|
+
- Updated dependencies [1ba9315]
|
|
146
|
+
- Updated dependencies [b8a9e5e]
|
|
147
|
+
- Updated dependencies [e8258a1]
|
|
148
|
+
- Updated dependencies [6b487b8]
|
|
149
|
+
- Updated dependencies [b0b2cc9]
|
|
150
|
+
- Updated dependencies [fc3da91]
|
|
151
|
+
- @memberjunction/ai@6.2.0
|
|
152
|
+
- @memberjunction/global@6.2.0
|
|
153
|
+
- @memberjunction/network-utils@6.2.0
|
|
154
|
+
|
|
155
|
+
## 6.2.0-edge.8
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- Updated dependencies [59e32e0]
|
|
160
|
+
- @memberjunction/global@6.2.0-edge.8
|
|
161
|
+
- @memberjunction/ai@6.2.0-edge.8
|
|
162
|
+
- @memberjunction/network-utils@6.2.0-edge.8
|
|
163
|
+
|
|
3
164
|
## 6.2.0-edge.7
|
|
4
165
|
|
|
5
166
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ai-heygen",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.2.0
|
|
4
|
+
"version": "6.2.0",
|
|
5
5
|
"description": "MemberJunction Wrapper for HeyGen Video Generation",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"author": "MemberJunction.com",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@elevenlabs/elevenlabs-js": "^2.34.0",
|
|
15
|
-
"@memberjunction/ai": "6.2.0
|
|
16
|
-
"@memberjunction/global": "6.2.0
|
|
17
|
-
"@memberjunction/network-utils": "6.2.0
|
|
15
|
+
"@memberjunction/ai": "6.2.0",
|
|
16
|
+
"@memberjunction/global": "6.2.0",
|
|
17
|
+
"@memberjunction/network-utils": "6.2.0"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
package/readme.md
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# @memberjunction/ai-heygen
|
|
2
|
-
|
|
3
|
-
MemberJunction AI provider for HeyGen's AI video generation platform. This package implements the `BaseVideoGenerator` interface to create avatar-based videos with customizable characters, voices, and backgrounds.
|
|
4
|
-
|
|
5
|
-
## Architecture
|
|
6
|
-
|
|
7
|
-
```mermaid
|
|
8
|
-
graph TD
|
|
9
|
-
A["HeyGenVideoGenerator<br/>(Provider)"] -->|extends| B["BaseVideoGenerator<br/>(@memberjunction/ai)"]
|
|
10
|
-
A -->|uses| C["Axios HTTP Client"]
|
|
11
|
-
A -->|calls| D["HeyGen Video API<br/>(api.heygen.com/v2)"]
|
|
12
|
-
D -->|generates| E["Avatar Videos"]
|
|
13
|
-
A -->|queries| F["HeyGen Avatars API"]
|
|
14
|
-
F -->|returns| G["Available Avatars"]
|
|
15
|
-
B -->|registered via| H["@RegisterClass"]
|
|
16
|
-
|
|
17
|
-
style A fill:#7c5295,stroke:#563a6b,color:#fff
|
|
18
|
-
style B fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
19
|
-
style C fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
20
|
-
style D fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
21
|
-
style E fill:#b8762f,stroke:#8a5722,color:#fff
|
|
22
|
-
style F fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
23
|
-
style G fill:#b8762f,stroke:#8a5722,color:#fff
|
|
24
|
-
style H fill:#b8762f,stroke:#8a5722,color:#fff
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Features
|
|
28
|
-
|
|
29
|
-
- **Avatar Video Generation**: Create videos with AI avatars synchronized to audio
|
|
30
|
-
- **Avatar Management**: Browse available avatars with preview images and videos
|
|
31
|
-
- **Customizable Layout**: Control avatar scale, position (offset X/Y), and style
|
|
32
|
-
- **Custom Backgrounds**: Use image assets as video backgrounds
|
|
33
|
-
- **Audio Integration**: Sync avatar lip movements with audio assets
|
|
34
|
-
- **Resolution Control**: Set custom output width and height
|
|
35
|
-
|
|
36
|
-
## Installation
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
npm install @memberjunction/ai-heygen
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Usage
|
|
43
|
-
|
|
44
|
-
### Create Avatar Video
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
import { HeyGenVideoGenerator } from '@memberjunction/ai-heygen';
|
|
48
|
-
|
|
49
|
-
const generator = new HeyGenVideoGenerator('your-heygen-api-key');
|
|
50
|
-
|
|
51
|
-
const result = await generator.CreateAvatarVideo({
|
|
52
|
-
avatarId: 'avatar-id',
|
|
53
|
-
avatarStyle: 'normal',
|
|
54
|
-
scale: 1.0,
|
|
55
|
-
offsetX: 0,
|
|
56
|
-
offsetY: 0,
|
|
57
|
-
audioAssetId: 'audio-asset-id',
|
|
58
|
-
imageAssetId: 'background-asset-id',
|
|
59
|
-
outputWidth: 1920,
|
|
60
|
-
outputHeight: 1080
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
if (result.success) {
|
|
64
|
-
console.log('Video ID:', result.videoId);
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
`CreateAvatarVideo` submits a render job and returns its ID as soon as HeyGen accepts it; the video renders afterward and is fetched from HeyGen by that ID. To run it with model selection, failover and an `MJ: AI Prompt Runs` row, use `AIVideoRunner.RunAvatarVideo` from `@memberjunction/ai-prompts`, which resolves this driver as `HeyGenVideoGenerator` for `Video` models.
|
|
69
|
-
|
|
70
|
-
### List Avatars
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
const avatars = await generator.GetAvatars();
|
|
74
|
-
for (const avatar of avatars) {
|
|
75
|
-
console.log(`${avatar.name} (${avatar.gender}): ${avatar.previewImageUrl}`);
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Supported Methods
|
|
80
|
-
|
|
81
|
-
| Method | Description |
|
|
82
|
-
|--------|-------------|
|
|
83
|
-
| `CreateAvatarVideo` | Generate an avatar video with audio and background |
|
|
84
|
-
| `GetAvatars` | List available avatars with preview media |
|
|
85
|
-
| `CreateVideoTranslation` | Translate existing video (not yet implemented) |
|
|
86
|
-
|
|
87
|
-
## Class Registration
|
|
88
|
-
|
|
89
|
-
Registered as `HeyGenVideoGenerator` via `@RegisterClass(BaseVideoGenerator, 'HeyGenVideoGenerator')`.
|
|
90
|
-
|
|
91
|
-
## Dependencies
|
|
92
|
-
|
|
93
|
-
- `@memberjunction/ai` - Core AI abstractions (BaseVideoGenerator)
|
|
94
|
-
- `@memberjunction/global` - Class registration
|
|
95
|
-
- `axios` - HTTP client for API communication
|