Skip to main content

IConversationManager

ug-js-sdk


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 directly
  • isConnected() - Check connection status
  • dispose() - Cleanup resources

Methods that REQUIRE an active WebSocket connection (call initialize() first):

  • initialize() - Establishes the connection
  • startListening() - Start voice input
  • stopListening() - Stop voice input
  • interact() - Send interactions
  • sendText() - Send text messages
  • interrupt() - Interrupt AI response
  • pause() - Pause playback
  • resume() - Resume playback
  • forceInputComplete() - Force end of user input
  • stop() - Stop and disconnect
  • toggleTextOnlyInput() - 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

InteractRequest

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

GenerateImageParams

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

GenerateImageBriaParams

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

GenerateImageReplicateParams

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