@hamsa-ai/voice-agents-sdk 0.4.1-beta.7 → 0.4.1
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/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/main.d.ts +32 -0
package/package.json
CHANGED
package/types/main.d.ts
CHANGED
|
@@ -882,6 +882,37 @@ declare class HamsaVoiceAgent extends EventEmitter {
|
|
|
882
882
|
* ```
|
|
883
883
|
*/
|
|
884
884
|
getRoom(): Room | null;
|
|
885
|
+
/**
|
|
886
|
+
* Gets the remote audio track from the voice agent for visualization
|
|
887
|
+
*
|
|
888
|
+
* Provides access to the agent's audio track for use with LiveKit React
|
|
889
|
+
* visualization components like BarVisualizer. Returns undefined if not
|
|
890
|
+
* connected or no remote audio track is available.
|
|
891
|
+
*
|
|
892
|
+
* @returns RemoteTrack | undefined - The agent's audio track or undefined if not available
|
|
893
|
+
*
|
|
894
|
+
* @example With LiveKit BarVisualizer
|
|
895
|
+
* ```typescript
|
|
896
|
+
* import { BarVisualizer } from '@livekit/components-react';
|
|
897
|
+
*
|
|
898
|
+
* function AgentVisualizer({ agent }) {
|
|
899
|
+
* const [audioTrack, setAudioTrack] = useState();
|
|
900
|
+
*
|
|
901
|
+
* useEffect(() => {
|
|
902
|
+
* agent.on('trackSubscribed', ({ track }) => {
|
|
903
|
+
* if (track.kind === 'audio') {
|
|
904
|
+
* setAudioTrack(track);
|
|
905
|
+
* }
|
|
906
|
+
* });
|
|
907
|
+
* }, [agent]);
|
|
908
|
+
*
|
|
909
|
+
* if (!audioTrack) return null;
|
|
910
|
+
*
|
|
911
|
+
* return <BarVisualizer trackRef={{ track: audioTrack, source: 'microphone' }} />;
|
|
912
|
+
* }
|
|
913
|
+
* ```
|
|
914
|
+
*/
|
|
915
|
+
getRemoteAudioTrack(): RemoteTrack | undefined;
|
|
885
916
|
}
|
|
886
917
|
/**
|
|
887
918
|
* Declaration merging: Add type-safe event methods to HamsaVoiceAgent
|
|
@@ -925,5 +956,6 @@ interface HamsaVoiceAgent {
|
|
|
925
956
|
}
|
|
926
957
|
export { HamsaVoiceAgent, HamsaApiError };
|
|
927
958
|
export default HamsaVoiceAgent;
|
|
959
|
+
export type { LocalTrack, RemoteParticipant, RemoteTrack, RemoteTrackPublication, Room, } from 'livekit-client';
|
|
928
960
|
export type { AudioLevelsResult, CallAnalyticsResult, ConnectionStatsResult, ParticipantData, PerformanceMetricsResult, TrackStatsResult, } from './classes/livekit-manager';
|
|
929
961
|
export type { HamsaVoiceAgentEvents, StartOptions, Tool, JobDetails };
|