@telnyx/ai-agent-lib 0.1.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/README.md +3 -0
- package/dist/agent-state.d.ts +3 -0
- package/dist/audio-stream-monitor.d.ts +11 -0
- package/dist/client.d.ts +27 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4795 -0
- package/dist/message.d.ts +45 -0
- package/dist/react/agent-state-auto-update.d.ts +1 -0
- package/dist/react/client-context.d.ts +5 -0
- package/dist/react/connection-state-auto-update.d.ts +1 -0
- package/dist/react/conversation-auto-update.d.ts +1 -0
- package/dist/react/transcript-auto-update.d.ts +1 -0
- package/dist/react/use-agent-state.d.ts +3 -0
- package/dist/react/use-client-connection-state.d.ts +3 -0
- package/dist/react/use-client.d.ts +1 -0
- package/dist/react/use-conversation.d.ts +3 -0
- package/dist/react/use-transcript.d.ts +3 -0
- package/dist/transcript.d.ts +9 -0
- package/dist/types.d.ts +19 -0
- package/dist/util.d.ts +1 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class AudioStreamMonitor {
|
|
2
|
+
private animationFrameId;
|
|
3
|
+
private stream;
|
|
4
|
+
private audioContext;
|
|
5
|
+
private source;
|
|
6
|
+
private analyser;
|
|
7
|
+
private updateAgentState;
|
|
8
|
+
setMonitoredAudioStream(stream: MediaStream): void;
|
|
9
|
+
stopAudioStreamMonitor(): void;
|
|
10
|
+
startAudioStreamMonitor(): void;
|
|
11
|
+
}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Call } from "@telnyx/webrtc";
|
|
2
|
+
import EventEmitter from "eventemitter3";
|
|
3
|
+
import type { AIAgentEvents, TranscriptItem } from "./types";
|
|
4
|
+
export type TelnyxAIAgentConstructorParams = {
|
|
5
|
+
agentId: string;
|
|
6
|
+
versionId?: string;
|
|
7
|
+
environment?: "production" | "development";
|
|
8
|
+
};
|
|
9
|
+
export declare class TelnyxAIAgent extends EventEmitter<AIAgentEvents> {
|
|
10
|
+
private telnyxRTC;
|
|
11
|
+
private transcription;
|
|
12
|
+
agentId: string;
|
|
13
|
+
versionId: string;
|
|
14
|
+
private audioStreamMonitor;
|
|
15
|
+
activeCall: Call | null;
|
|
16
|
+
constructor(params: TelnyxAIAgentConstructorParams);
|
|
17
|
+
connect(): Promise<void>;
|
|
18
|
+
disconnect(): Promise<void>;
|
|
19
|
+
get transcript(): TranscriptItem[];
|
|
20
|
+
startConversation(): Promise<void>;
|
|
21
|
+
endConversation(): void | undefined;
|
|
22
|
+
private onClientReady;
|
|
23
|
+
private onClientOrSocketError;
|
|
24
|
+
private onNotification;
|
|
25
|
+
private onTranscriptItem;
|
|
26
|
+
private onAgentStateChange;
|
|
27
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./client";
|
|
2
|
+
export * from "./react/client-context";
|
|
3
|
+
export * from "./react/use-transcript";
|
|
4
|
+
export * from "./react/use-client-connection-state";
|
|
5
|
+
export * from "./react/use-client";
|
|
6
|
+
export * from "./react/use-conversation";
|
|
7
|
+
export * from "./react/use-agent-state";
|