IConversationManager
ug-js-sdk / IConversationManager
Interface: IConversationManager
Defined in: conversation-manager/types.ts:122
Interface for the ConversationManager class.
Methods are categorized by their connection requirements:
Methods that DO NOT require an active WebSocket connection:
generateImage()- Uses REST API directly (generic, supports both providers)generateImageWithBria()- Uses REST API directly (Bria-specific)generateImageWithReplicate()- Uses REST API directly (Replicate-specific)getAvailableModels()- Uses REST API directlyisConnected()- Check connection statusdispose()- Cleanup resources
Methods that REQUIRE an active WebSocket connection (call initialize() first):
initialize()- Establishes the connectionstartListening()- Start voice inputstopListening()- Stop voice inputinteract()- Send interactionssendText()- Send text messagesinterrupt()- Interrupt AI responsepause()- Pause playbackresume()- Resume playbackforceInputComplete()- Force end of user inputstop()- Stop and disconnecttoggleTextOnlyInput()- Toggle input mode
Methods
initialize()
initialize():
Promise<void>
Defined in: conversation-manager/types.ts:128
Initializes the conversation manager and establishes WebSocket connection. Must be called before using conversation features.
Returns
Promise<void>
Remarks
Requires network connection to be established
startListening()
startListening():
Promise<void>
Defined in: conversation-manager/types.ts:134
Starts listening for voice input from the microphone.
Returns
Promise<void>
Remarks
Requires active WebSocket connection
stopListening()
stopListening():
Promise<void>
Defined in: conversation-manager/types.ts:140
Stops listening for voice input.
Returns
Promise<void>
Remarks
Requires active WebSocket connection
interact()
interact(
request):Promise<void>
Defined in: conversation-manager/types.ts:146
Sends an interaction request to the conversation.
Parameters
request
Returns
Promise<void>
Remarks
Requires active WebSocket connection
sendText()
sendText(
text):Promise<void>
Defined in: conversation-manager/types.ts:152
Sends a text message to the conversation.
Parameters
text
string
Returns
Promise<void>
Remarks
Requires active WebSocket connection
generateImage()
generateImage(
params):Promise<any>
Defined in: conversation-manager/types.ts:158
Generates an image using REST API (generic method supporting both providers). Does NOT require an active WebSocket connection.
Parameters
params
Returns
Promise<any>
generateImageWithBria()
generateImageWithBria(
params):Promise<any>
Defined in: conversation-manager/types.ts:164
Generates an image using Bria via REST API. Does NOT require an active WebSocket connection.
Parameters
params
Returns
Promise<any>
generateImageWithReplicate()
generateImageWithReplicate(
params):Promise<any>
Defined in: conversation-manager/types.ts:170
Generates an image using Replicate via REST API. Does NOT require an active WebSocket connection.
Parameters
params
Returns
Promise<any>
getAvailableModels()
getAvailableModels():
Promise<any>
Defined in: conversation-manager/types.ts:176
Retrieves available image generation models via REST API. Does NOT require an active WebSocket connection.
Returns
Promise<any>
interrupt()
interrupt():
Promise<void>
Defined in: conversation-manager/types.ts:182
Interrupts the current AI response playback.
Returns
Promise<void>
Remarks
Requires active WebSocket connection
pause()
pause():
Promise<void>
Defined in: conversation-manager/types.ts:188
Pauses the current AI response playback.
Returns
Promise<void>
Remarks
Requires active WebSocket connection and 'playing' state
resume()
resume():
Promise<void>
Defined in: conversation-manager/types.ts:194
Resumes paused AI response playback.
Returns
Promise<void>
Remarks
Requires active WebSocket connection and 'paused' state
forceInputComplete()
forceInputComplete():
Promise<void>
Defined in: conversation-manager/types.ts:200
Forces completion of user input, bypassing VAD silence detection.
Returns
Promise<void>
Remarks
Requires active WebSocket connection
stop()
stop():
Promise<void>
Defined in: conversation-manager/types.ts:206
Stops the conversation and disconnects from the server.
Returns
Promise<void>
Remarks
Requires active WebSocket connection
dispose()
dispose():
Promise<void>
Defined in: conversation-manager/types.ts:212
Disposes of all resources and performs complete cleanup. Does NOT require an active connection - safe to call anytime.
Returns
Promise<void>
toggleTextOnlyInput()
toggleTextOnlyInput(
isTextOnly):Promise<void>
Defined in: conversation-manager/types.ts:218
Toggles between text-only and audio input modes.
Parameters
isTextOnly
boolean
Returns
Promise<void>
Remarks
Requires active WebSocket connection for full functionality
isConnected()
isConnected():
boolean
Defined in: conversation-manager/types.ts:224
Checks if the WebSocket connection is currently active and ready. Does NOT require initialization - can be called anytime.
Returns
boolean
on()
on(
event,listener):void
Defined in: conversation-manager/types.ts:229
Subscribes to an event emitted by the conversation manager.
Parameters
event
string
listener
(...args) => void
Returns
void