@telnyx/webrtc 2.27.2 → 2.27.4-beta.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.
@@ -4,5 +4,6 @@ declare abstract class BaseMessage {
4
4
  response: any;
5
5
  targetNodeId: string;
6
6
  buildRequest(params: any): void;
7
+ buildNotification(params: any): void;
7
8
  }
8
9
  export default BaseMessage;
@@ -0,0 +1,6 @@
1
+ import BaseMessage from '../BaseMessage';
2
+ import type { FunctionCallOutputItem } from '../../webrtc/AIConversationTypes';
3
+ declare class AIConversationMessage extends BaseMessage {
4
+ constructor(item: FunctionCallOutputItem);
5
+ }
6
+ export { AIConversationMessage };
@@ -56,5 +56,6 @@ export declare enum SwEvent {
56
56
  Calls = "telnyx.calls",
57
57
  MediaError = "telnyx.rtc.mediaError",
58
58
  PeerConnectionFailureError = "telnyx.rtc.peerConnectionFailureError",
59
- PeerConnectionSignalingStateClosed = "telnyx.rtc.peerConnectionSignalingStateClosed"
59
+ PeerConnectionSignalingStateClosed = "telnyx.rtc.peerConnectionSignalingStateClosed",
60
+ AIConversationMessage = "telnyx.ai.conversation"
60
61
  }
@@ -0,0 +1,33 @@
1
+ export declare type FunctionCallItem = {
2
+ type: 'function_call';
3
+ call_id: string;
4
+ name: string;
5
+ arguments: string;
6
+ };
7
+ export declare type FunctionCallOutputItem = {
8
+ type: 'function_call_output';
9
+ call_id: string;
10
+ output: string;
11
+ };
12
+ export declare type AIConversationFunctionCallParams = {
13
+ type: 'conversation.item.created';
14
+ item: FunctionCallItem;
15
+ };
16
+ export declare type AIConversationFunctionCallOutputParams = {
17
+ type: 'conversation.item.create';
18
+ item: FunctionCallOutputItem;
19
+ };
20
+ export declare type AIConversationParams = AIConversationFunctionCallParams | AIConversationFunctionCallOutputParams | {
21
+ type: string;
22
+ [key: string]: unknown;
23
+ };
24
+ export declare type IAIConversationMessageEvent = {
25
+ method: 'ai_conversation';
26
+ params: AIConversationParams;
27
+ voice_sdk_id?: string;
28
+ };
29
+ export declare type ISendAIConversationMessageOptions = {
30
+ item: FunctionCallOutputItem;
31
+ };
32
+ export declare function isFunctionCallParams(params: AIConversationParams): params is AIConversationFunctionCallParams;
33
+ export declare function isFunctionCallOutputParams(params: AIConversationParams): params is AIConversationFunctionCallOutputParams;
@@ -1,5 +1,6 @@
1
1
  import BaseCall from './BaseCall';
2
2
  import { IVertoCallOptions } from './interfaces';
3
+ import type { FunctionCallOutputItem } from './AIConversationTypes';
3
4
  export declare class Call extends BaseCall {
4
5
  screenShare: Call;
5
6
  private _statsInterval;
@@ -7,6 +8,7 @@ export declare class Call extends BaseCall {
7
8
  startScreenShare(opts?: IVertoCallOptions): Promise<Call>;
8
9
  stopScreenShare(): Promise<void>;
9
10
  sendConversationMessage: (message: string, attachments?: string[]) => Promise<any>;
11
+ sendAIConversationMessage: (item: FunctionCallOutputItem) => void;
10
12
  setAudioOutDevice(deviceId: string): Promise<boolean>;
11
13
  protected _finalize(): void;
12
14
  private _stats;
@@ -140,6 +140,9 @@ export interface IWebRTCCall {
140
140
  stopScreenShare?: () => Promise<void>;
141
141
  setAudioOutDevice?: (deviceId: string) => Promise<boolean>;
142
142
  setSpeakerPhone?: (flag: boolean) => void;
143
+ sendConversationMessage?: (message: string, attachments?: string[]) => void;
144
+ sendAIConversationMessage?: (item: import('./AIConversationTypes').FunctionCallOutputItem) => void;
145
+ recordSessionWarning?: (code: string, name: string, message: string, activeCallIds?: string[]) => void;
143
146
  }
144
147
  export interface IWebRTCInfo {
145
148
  browserInfo: any;
@@ -9,3 +9,5 @@ export { TELNYX_ERROR_CODES, TELNYX_WARNING_CODES, } from './Modules/Verto/util/
9
9
  export type { ITelnyxError, ITelnyxMediaError, ITelnyxErrorEvent, ITelnyxMediaRecoveryErrorEvent, ITelnyxStandardErrorEvent, TelnyxMediaErrorCode, } from './Modules/Verto/util/errors';
10
10
  export type { ITelnyxWarning, ITelnyxWarningEvent, } from './Modules/Verto/util/constants/warnings';
11
11
  export * from './PreCallDiagnosis';
12
+ export type { FunctionCallItem, FunctionCallOutputItem, AIConversationParams, AIConversationFunctionCallParams, AIConversationFunctionCallOutputParams, IAIConversationMessageEvent, ISendAIConversationMessageOptions, } from './Modules/Verto/webrtc/AIConversationTypes';
13
+ export { isFunctionCallParams, isFunctionCallOutputParams, } from './Modules/Verto/webrtc/AIConversationTypes';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telnyx/webrtc",
3
- "version": "2.27.2",
3
+ "version": "2.27.4-beta.0",
4
4
  "description": "Telnyx WebRTC Client",
5
5
  "keywords": [
6
6
  "telnyx",