@telnyx/ai-agent-lib 0.4.5 → 0.4.6

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 (2) hide show
  1. package/dist/index.js +8 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4414,8 +4414,14 @@ class hn extends xt {
4414
4414
  */
4415
4415
  async startConversation(e) {
4416
4416
  if (!this.telnyxRTC) {
4417
- X.error("Client is not initialized.");
4418
- return;
4417
+ const c = new Error("Client is not initialized.");
4418
+ throw X.error(c.message), this.emit("agent.error", c), c;
4419
+ }
4420
+ if (!this.authenticated || !this.sessionId) {
4421
+ const c = new Error(
4422
+ "Cannot start AI agent conversation before login is complete."
4423
+ );
4424
+ throw X.warn(c.message), this.emit("agent.error", c), c;
4419
4425
  }
4420
4426
  const n = RTCRtpReceiver.getCapabilities("audio")?.codecs?.find(
4421
4427
  (c) => c.mimeType.toLowerCase().includes("opus")
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@telnyx/ai-agent-lib",
3
3
  "private": false,
4
- "version": "0.4.5",
4
+ "version": "0.4.6",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",