RTVIClient
to the new PipecatClient
in an iOS (Swift) 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.
Key Changes
1. Package and Class Names
Old2. Client and Transport Configuration
Previously, the client constructor accepted parameters like pipeline or endpoint configuration. Now, the configuration is passed explicitly to thestartBotAndConnect()
or connect()
methods, and the constructor takes only transport options.
Old
3. Connection Method
The connection process is now explicit and supports modern async handling. Old4. Function Call Handling
Helpers likeLLMHelper
have been removed. You now register function call handlers directly on the PipecatClient
.
Old
5. Pipeline Configuration Initialization
Previously, you could provide a pipeline configuration as part of theRTVIClient
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.
6. LLM Context Updates
Previously, context updates were done via helpers. Now, useappendToContext()
:
7. Pipeline Configuration Updates
Previously, the client supported updating the pipeline configuration using a specific method that took a configuration object in a generic format. Dynamic and predefined configuration updates, however, are a security concern, allowing clients to override settings and potentially abuse API keys. For this reason, it has been removed and most configuration updates need to be handled custom by your application. To do so, you should take advantage of the client-server messaging system, which allows you to send messages to the server and handle responses. This way, you can implement your own logic for updating configurations securely. New messaging types replace old action/config helpers:sendClientRequest()
) to wait for a response.
8. Disconnecting
Breaking Changes
- Constructor Params Removed: No pipeline or endpoint config in constructor.
- Helpers Removed: RTVIClientHelper, LLMHelper are gone.
-
Configs Removed: All configuration-related methods, events, and types have been removed:
getConfig()
,updateConfig()
,describeConfig()
,onConfigUpdated
,onConfigDescribed
, etc. -
Actions Removed: All actions-related methods, events, and types have been removed:
action()
,describeActions()
,onActionsAvailable
, etc. -
New Messaging Methods:
appendToContext()
sendClientRequest()
sendClientMessage()
disconnectBot()
registerFunctionCallHandler()
/unregisterFunctionCallHandler()
/unregisterAllFunctionCallHandlers()
Migration Steps
- Update imports to
PipecatClientIOS
andPipecatClientIOSDaily
. - Move connection configuration from constructor to
startBotAndConnect()
orconnect()
methods. - Replace helper-based function calls with
registerFunctionCallHandler()
. - Replace context updates with
appendToContext()
. - Replace all action and config related methods, events, and types with
sendClientMessage()
orsendClientRequest()
for custom messages. - Ensure proper disconnection via
unregisterAllFunctionCallHandlers()
anddisconnect()
.
For detailed examples, see Travel Companion iOS Example.