A Guide to migrating from a JavaScript RTVIClient to PipecatClient
PipecatClient
in a JavaScript application. The new client introduces simplified configuration and improved client-server messaging. For an overview of the changes, see the top-level RTVIClient Migration Guide.
params
field. The configuration that used to be provided here is no longer supported and endpoint information is now provided directly in the connect()
method.
Old
connect()
was called on the client instance without parameters. Now, you provide connection parameters directly in the connect()
method. This allows for more flexibility and customization of the connection process. For ease of use, you can either provide an object that contains the connection parameters your Transport
requires or a REST endpoint that returns the connection parameters.
Old
PipecatClient
instance.
Old
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 connect()
. 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.
Old
sendClientRequest()
) to wait for a response.
appendToContext()
method on the PipecatClient
instance. This allows for easy, built-in support for text-based context updates without needing to implement custom messaging.
Old
PipecatClient
member functions or client-server messaging.PipecatClient
methods or custom messaging