A Guide to migrating from RTVIClient to PipecatClient for Android
RTVIClient
to the new PipecatClient
in an Android application. The new client introduces simplified configuration, modern messaging patterns, and improved function call handling. For an overview of the changes, see the top-level RTVIClient Migration Guide.
RTVIClient
constructor accepted a transport factory parameter, whereas in v1.0.0 the transport is passed in directly.
Parameters such as the connection URL are no longer passed in at construction time. These should be given to startBot()
, startBotAndConnect()
, or connect()
.
Old
connect()
method did a POST request to your bot’s HTTP endpoint, which returned the connection details (such as room URL and token), before making the actual connection.
This functionality has been split out into startBot()
, which provides more flexibility in how the request is performed.
A helper method startBotAndConnect()
unifies the two steps and is the equivalent of the original connect()
method. You can call connect()
directly if you wish to skip the POST step.
Old
LLMHelper
have been removed. You now register function call handlers directly on the PipecatClient
.
RTVIClient
constructor, and it was expected to be in a specific format. Now, if you would like to pass any initial pipeline configurations, you do so as requestData
added to the endpoint you provide to startBot()
or startBotAndConnect()
. In both cases, you would need server-side code to parse and apply these settings, but now you can define the structure and what pieces of configuration you want to send.
Check out this section of docs for an example, complete with server-side code showing how to initialize the pipeline configuration at connection time.
appendToContext()
:
sendClientRequest()
) to wait for a response.
getConfig()
, updateConfig()
, describeConfig()
, onConfigUpdated
, onConfigDescribed
, etc.
action()
, describeActions()
, onActionsAvailable
, etc.
appendToContext()
sendClientRequest()
sendClientMessage()
disconnectBot()
registerFunctionCallHandler()
/ unregisterFunctionCallHandler()
/ unregisterAllFunctionCallHandlers()