@elevenlabs/client 0.9.1 → 0.10.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.
@@ -1,6 +1,6 @@
1
- import type { SessionStartedMessage, PartialTranscriptMessage, FinalTranscriptMessage, FinalTranscriptWithTimestampsMessage, ScribeErrorMessage, ScribeAuthErrorMessage } from "@elevenlabs/types";
2
- export type { SessionStartedMessage, PartialTranscriptMessage, FinalTranscriptMessage, FinalTranscriptWithTimestampsMessage, ScribeErrorMessage, ScribeAuthErrorMessage, };
3
- export type WebSocketMessage = SessionStartedMessage | PartialTranscriptMessage | FinalTranscriptMessage | FinalTranscriptWithTimestampsMessage | ScribeErrorMessage | ScribeAuthErrorMessage;
1
+ import type { SessionStartedMessage, PartialTranscriptMessage, CommittedTranscriptMessage, CommittedTranscriptWithTimestampsMessage, ScribeErrorMessage, ScribeAuthErrorMessage } from "@elevenlabs/types";
2
+ export type { SessionStartedMessage, PartialTranscriptMessage, CommittedTranscriptMessage, CommittedTranscriptWithTimestampsMessage, ScribeErrorMessage, ScribeAuthErrorMessage, };
3
+ export type WebSocketMessage = SessionStartedMessage | PartialTranscriptMessage | CommittedTranscriptMessage | CommittedTranscriptWithTimestampsMessage | ScribeErrorMessage | ScribeAuthErrorMessage;
4
4
  /**
5
5
  * Events emitted by the RealtimeConnection.
6
6
  */
@@ -10,9 +10,9 @@ export declare enum RealtimeEvents {
10
10
  /** Emitted when a partial (interim) transcript is available */
11
11
  PARTIAL_TRANSCRIPT = "partial_transcript",
12
12
  /** Emitted when a final transcript is available */
13
- FINAL_TRANSCRIPT = "final_transcript",
13
+ COMMITTED_TRANSCRIPT = "committed_transcript",
14
14
  /** Emitted when a final transcript with timestamps is available */
15
- FINAL_TRANSCRIPT_WITH_TIMESTAMPS = "final_transcript_with_timestamps",
15
+ COMMITTED_TRANSCRIPT_WITH_TIMESTAMPS = "committed_transcript_with_timestamps",
16
16
  /** Emitted when an authentication error occurs */
17
17
  AUTH_ERROR = "auth_error",
18
18
  /** Emitted when an error occurs */
@@ -29,7 +29,7 @@ export declare enum RealtimeEvents {
29
29
  * ```typescript
30
30
  * const connection = await Scribe.connect({
31
31
  * token: "...",
32
- * modelId: "scribe_realtime_v2",
32
+ * modelId: "scribe_v2_realtime",
33
33
  * audioFormat: AudioFormat.PCM_16000,
34
34
  * sampleRate: 16000,
35
35
  * });
@@ -42,7 +42,7 @@ export declare enum RealtimeEvents {
42
42
  * console.log("Partial:", data.transcript);
43
43
  * });
44
44
  *
45
- * connection.on(RealtimeEvents.FINAL_TRANSCRIPT, (data) => {
45
+ * connection.on(RealtimeEvents.COMMITTED_TRANSCRIPT, (data) => {
46
46
  * console.log("Final:", data.transcript);
47
47
  * connection.close();
48
48
  * });
@@ -81,7 +81,7 @@ export declare class RealtimeConnection {
81
81
  * console.log("Partial:", data.transcript);
82
82
  * });
83
83
  *
84
- * connection.on(RealtimeEvents.FINAL_TRANSCRIPT, (data) => {
84
+ * connection.on(RealtimeEvents.COMMITTED_TRANSCRIPT, (data) => {
85
85
  * console.log("Final:", data.transcript);
86
86
  * });
87
87
  * ```
@@ -133,8 +133,8 @@ export declare class RealtimeConnection {
133
133
  sampleRate?: number;
134
134
  }): void;
135
135
  /**
136
- * Commits the transcription, signaling that all audio has been sent.
137
- * This finalizes the transcription and triggers a FINAL_TRANSCRIPT event.
136
+ * Commits the transcription, signaling that a segment of audio has been sent. This clears the buffer and triggers a COMMITTED_TRANSCRIPT event. Context from previous segments is kept.
137
+ * Committing a segment triggers a COMMITTED_TRANSCRIPT event.
138
138
  *
139
139
  * @throws {Error} If the WebSocket connection is not open
140
140
  *
@@ -164,8 +164,8 @@ export declare class RealtimeConnection {
164
164
  *
165
165
  * @example
166
166
  * ```typescript
167
- * connection.on(RealtimeEvents.FINAL_TRANSCRIPT, (data) => {
168
- * console.log("Final:", data.transcript);
167
+ * connection.on(RealtimeEvents.COMMITTED_TRANSCRIPT, (data) => {
168
+ * console.log("Segment committed:", data.transcript);
169
169
  * connection.close();
170
170
  * });
171
171
  * ```
@@ -3,4 +3,4 @@ export { RealtimeConnection } from "./connection";
3
3
  export { AudioFormat, CommitStrategy } from "./scribe";
4
4
  export { RealtimeEvents } from "./connection";
5
5
  export type { AudioOptions, MicrophoneOptions } from "./scribe";
6
- export type { WebSocketMessage, SessionStartedMessage, PartialTranscriptMessage, FinalTranscriptMessage, FinalTranscriptWithTimestampsMessage, ScribeErrorMessage, ScribeAuthErrorMessage, } from "./connection";
6
+ export type { WebSocketMessage, SessionStartedMessage, PartialTranscriptMessage, CommittedTranscriptMessage, CommittedTranscriptWithTimestampsMessage, ScribeErrorMessage, ScribeAuthErrorMessage, } from "./connection";
@@ -96,7 +96,7 @@ export declare class ScribeRealtime {
96
96
  * // Manual audio streaming
97
97
  * const connection = Scribe.connect({
98
98
  * token: "...",
99
- * modelId: "scribe_realtime_v2",
99
+ * modelId: "scribe_v2_realtime",
100
100
  * audioFormat: AudioFormat.PCM_16000,
101
101
  * sampleRate: 16000,
102
102
  * });
@@ -104,7 +104,7 @@ export declare class ScribeRealtime {
104
104
  * // Automatic microphone streaming
105
105
  * const connection = Scribe.connect({
106
106
  * token: "...",
107
- * modelId: "scribe_realtime_v2",
107
+ * modelId: "scribe_v2_realtime",
108
108
  * microphone: {
109
109
  * echoCancellation: true,
110
110
  * noiseSuppression: true
@@ -1 +1,8 @@
1
+ export interface RatingFeedback {
2
+ rating: number;
3
+ comment?: string;
4
+ }
5
+ type Feedback = RatingFeedback;
1
6
  export declare function postOverallFeedback(conversationId: string, like: boolean, origin?: string): Promise<Response>;
7
+ export declare function postOverallFeedback(conversationId: string, feedback: Feedback, origin?: string): Promise<Response>;
8
+ export {};
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.9.1";
1
+ export declare const PACKAGE_VERSION = "0.10.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevenlabs/client",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "ElevenLabs JavaScript Client Library",
5
5
  "main": "./dist/lib.umd.js",
6
6
  "module": "./dist/lib.module.js",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "livekit-client": "^2.11.4",
42
- "@elevenlabs/types": "0.1.1"
42
+ "@elevenlabs/types": "0.2.0"
43
43
  },
44
44
  "scripts": {
45
45
  "generate-version": "printf \"// This file is auto-generated during build\\nexport const PACKAGE_VERSION = \\\"%s\\\";\\n\" \"$npm_package_version\" > src/version.ts",