Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,60 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.4.0] - 2025-10-06

### Added

- Introduced `onBotStarted`/`'botStarted'` callbacks for `startBot()`, providing a way for clients to use callbacks to get the return value from the startBot REST endpoint whether calling `startBot()` directly or via `startBotAndConnect()`. As a part of this, `startBot()` will also now trigger the `error` callbacks, reporting `fatal: true` when `startBot()` fails for any reason.
- Added new `sendText()` method to support the new RTVI `send-text` event. The method takes a string, along with an optional set of options to control whether the bot should respond immediately and/or whether the bot should respond with audio (vs. text only). Note: This is a replacement for the current `appendToContext()` method and changes the default of `run_immediately` to `True`.
- Add rest_helpers and utils to client-js library
- Added support for registering a generic callback for LLM function call events to maintain consistency and flexibility.
- Added two new `RTVIError` types:
- `BotAlreadyStartedError`: thrown when a `startBot()`, `connect()`, or `startBotAndConnect()` are called after having already started/connected.
- `InvalidTransportParamsError`: thrown on `connect()` when the provided `TransportConnectionParams` are invalid.
- Added `unregisterFunctionCallHandler()` and `unregisterAllFunctionCallHandlers()` for, well, unregistering registered function call handlers :).

### Deprecated

- Deprecated `appendToContext()` in lieu of the new `sendText()` method. This sets a standard for future methods like `sendImage()`.

### Fixed

- Fixed issue where devices would not initialize automatically when using `startBotAndConnect()`

## [1.2.0] - 2025-08-13

- Improved flexibility and clarity around `connect()`:
- Renamed `ConnectionEndpoint` to `APIRequest` for clarity.
- Deprecated use of `connect()` with a `ConnectionEndpoint` params type in favor of separating out the authorization step from the connection step. Uses of `connect()` with a `ConnectionEndpoint` should be updated to call `startBotAndConnect()` instead. See below. `connect()` now performs only the portion of the logic for connecting the transport. If called with a `ConnectionEndpoint`, it will call `startBotAndConnect()` under the hood.
- Introduced `startBot()` for performing just the endpoint POST for kicking off a bot process and optionally returning connection parameters required by the transport.
- Introduced `startBotAndConnect()` which takes an `APIRequest` and calls both `startBot()` and `connect()`, passing any data returned from the `startBot()` endpoint to `connect()` as transport parameters.

- RTVI 1.0 Protocol Updates:
- client-ready/bot-ready messages now both include a version and about section
- action-related messages have been removed (deprecated) in lieu of client-server messages and some built-in types
- service configuration message have been removed (security concerns. should be replaced with custom client-server messages)
- new client-message and server-response messages for custom messaging
- new append-to-context message
- All RTVI base types have moved to the new `rtvi` folder
- RTVIClient is now PipecatClient w/ changes to support the above RTVI Protocol updates
- The constructor no longer takes `params` with pipeline configuration information or endpoint configuration
- `connect()` now takes a set of parameters defined and needed by the transport in use. Or, alternatively, it takes an endpoint configuration to obtain the transport params.
- REMOVED:
- All actions-related methods and types: `action()`, `describeActions()`, `onActionsAvailable`, etc.
- All configuration-related methods and types: `getConfig()`, `updateConfig()`, `describeConfig()`, `onConfig`, `onConfigDescribe`, etc.
- All helper-related methods, types and files: `RTVIClientHelper`, `registerHelper`, `LLMHelper`, etc.
- `transportExpiry()`
- NEW:
- built-in function call handling: `registerFunctionCallHandler()`
- built-in ability to append to llm context: `appendToContext()`
- ability to send a message and wait for a response: `sendClientRequest()`
- added rtvi version and an about section to `client-ready` with information about the client platform, browser, etc.
- `UnsupportedFeatureError`: A new error transports can throw for features they have not implemented or cannot support.
- CHANGED:
- sending a client message (send and forget style): `sendMessage()` -> `sendClientMessage()`
- Added warning log on `bot-ready` if the server version < 1.0.0, indicating that rtvi communication problems are likely

## [0.3.5] - 2025-05-08

### Added
Expand Down
70 changes: 24 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@ Install `@pipecat-ai/react-native-daily-transport` along with its peer dependenc

```bash
npm i @pipecat-ai/react-native-daily-transport
npm i @daily-co/react-native-daily-js@^0.73.0
npm i @daily-co/react-native-webrtc@^118.0.3-daily.2
npm i @react-native-async-storage/async-storage@^1.23.1
npm i @daily-co/react-native-daily-js@^0.81.0
npm i @daily-co/react-native-webrtc@^124.0.6-daily.1
npm i @react-native-async-storage/async-storage@^1.24.0
npm i react-native-background-timer@^2.4.1
npm i react-native-get-random-values@^1.11.0
```

If you are using Expo, you will also need to add the following dependencies:
```bash
npm i @config-plugins/react-native-webrtc@^10.0.0
npm i @daily-co/[email protected]
npm i @daily-co/[email protected]
```

All the details about Expo can be found [here](https://github.com/daily-co/rn-daily-js-expo-config-plugin).
Expand All @@ -44,51 +43,30 @@ A full demo can be found [here](https://github.com/daily-demos/daily-bots-react-
Instantiate an `RTVIClient` instance, wire up the bot's audio, and start the conversation:

```typescript
let voiceClient = new RTVIClient({
let pipecatClient = new PipecatClient({
transport: new RNDailyTransport(),
params: {
baseUrl: url,
config: [
{
service: "tts",
options: [
{ name: "voice", value: "79a125e8-cd45-4c13-8a67-188112f4dd22" },
],
},
{
service: "llm",
options: [
{ name: "model", value: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo" },
{
name: "initial_messages",
value: [
{
role: "system",
content:
"You are a assistant called ExampleBot. You can ask me anything. Keep responses brief and legible. Your responses will converted to audio. Please do not include any special characters in your response other than '!' or '?'. Start by briefly introducing yourself.",
},
],
},
{ name: "run_on_config", value: true },
],
},
],
requestData: {
services: {
llm: "together",
tts: "cartesia",
},
enableMic: true,
enableCam: false,
callbacks: {
onConnected: () => {
setInCall(true);
},
onDisconnected: () => {
setInCall(false);
},
onTransportStateChanged: (state) => {
console.log(`Transport state changed: ${state}`);
setCurrentState(state);
},
onError: (error) => {
console.log('Error:', JSON.stringify(error));
},
endpoints: {
connect: "/start",
action: "/action"
}
},
enableMic: true,
enableCam: false
})
});

await voiceClient.start()
await client?.startBotAndConnect({
endpoint: baseUrl + '/connect',
});
```

> Note: To enable screen sharing on iOS, follow the instructions in the [Daily Framework RN Screen Share extension](https://github.com/daily-co/rn-screen-share-extension/).
Expand Down
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"web": "expo start --web"
},
"dependencies": {
"@daily-co/config-plugin-rn-daily-js": "0.0.9",
"@daily-co/react-native-daily-js": "^0.79.0",
"@daily-co/react-native-webrtc": "^118.0.3-daily.4",
"@daily-co/config-plugin-rn-daily-js": "0.0.10",
"@daily-co/react-native-daily-js": "^0.81.0",
"@daily-co/react-native-webrtc": "^124.0.6-daily.1",
"@react-native-async-storage/async-storage": "1.24.0",
"@react-navigation/native": "^7.0.14",
"expo": "^53.0.8",
Expand Down
92 changes: 74 additions & 18 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -764,38 +764,39 @@
"@babel/helper-string-parser" "^7.27.1"
"@babel/helper-validator-identifier" "^7.27.1"

"@daily-co/[email protected].9":
version "0.0.9"
resolved "https://registry.npmjs.org/@daily-co/config-plugin-rn-daily-js/-/config-plugin-rn-daily-js-0.0.9.tgz"
integrity sha512-NReKE/CFSAUxcPGxco2bD9VlIFKaKPDGlyyNoB8jrLqUI/g2pJxgFO8QzfrjJobpC6fBRhwr19EQivim9scOEg==
"@daily-co/[email protected].10":
version "0.0.10"
resolved "https://registry.yarnpkg.com/@daily-co/config-plugin-rn-daily-js/-/config-plugin-rn-daily-js-0.0.10.tgz#84784b4b177397d75ad6a1bc72d628688d3114c3"
integrity sha512-bZ/sLRuRC1iQEgHvR6/6/KtRYuTt+iQS9HAWteKu/x9GgeTh8D/eL4RyL/wNOwETTf3Xu2gF41pfqVeC1B3XfA==
dependencies:
expo-build-properties "~0.14.6"
"@expo/config-plugins" "^10.1.2"
expo-build-properties "~0.14.8"

"@daily-co/daily-js@^0.82.0":
version "0.82.0"
resolved "https://registry.npmjs.org/@daily-co/daily-js/-/daily-js-0.82.0.tgz"
integrity sha512-Arp+ToyKWjT8alGark5fxem2prDP3qtVvIqwuzdhv76iFdOHaboAapkHy2zDHGq9T3u6//2hbnNPxuxuWIzAIA==
"@daily-co/daily-js@^0.84.0":
version "0.84.0"
resolved "https://registry.yarnpkg.com/@daily-co/daily-js/-/daily-js-0.84.0.tgz#4a1c7c88c8b5c0e3fc0b5b56d52c8c6e6fa9fa98"
integrity sha512-/ynXrMDDkRXhLlHxiFNf9QU5yw4ZGPr56wNARgja/Tiid71UIniundTavCNF5cMb2I1vNoMh7oEJ/q8stg/V7g==
dependencies:
"@babel/runtime" "^7.12.5"
"@sentry/browser" "^8.33.1"
bowser "^2.8.1"
dequal "^2.0.3"
events "^3.1.0"

"@daily-co/react-native-daily-js@^0.79.0":
version "0.79.0"
resolved "https://registry.npmjs.org/@daily-co/react-native-daily-js/-/react-native-daily-js-0.79.0.tgz"
integrity sha512-z3UcZyCgh0tJv9RbSvFN/Ije9slExUsWGnxRKcoB6l6aE2WKuyeL6+54hMnfwZZCgREHg0cxJNDqub/9jIhxSg==
"@daily-co/react-native-daily-js@^0.81.0":
version "0.81.0"
resolved "https://registry.yarnpkg.com/@daily-co/react-native-daily-js/-/react-native-daily-js-0.81.0.tgz#59df7870142e6d0fc4e5b729efb64cbe882e307b"
integrity sha512-vOizJXTfSLSl2tSPtpiwaBByQ9SH0MeCOD2NMj0FpXhZGtfJbaIcndEfk6DNPRtpuzdF7QTM+QJFWavb5IIPvA==
dependencies:
"@daily-co/daily-js" "^0.82.0"
"@daily-co/daily-js" "^0.84.0"
"@types/react-native-background-timer" "^2.0.0"
base-64 "^1.0.0"
react-native-url-polyfill "^1.1.2"

"@daily-co/react-native-webrtc@^118.0.3-daily.4":
version "118.0.3-daily.4"
resolved "https://registry.npmjs.org/@daily-co/react-native-webrtc/-/react-native-webrtc-118.0.3-daily.4.tgz"
integrity sha512-uvF+9aCDJuBap82pCz2UUxF4P4MKuTO6hSHINatDFR8w0ga2Fxk3cnKWLixMS/eS6+QOBT7QQur84I2NLuKSlg==
"@daily-co/react-native-webrtc@^124.0.6-daily.1":
version "124.0.6-daily.1"
resolved "https://registry.yarnpkg.com/@daily-co/react-native-webrtc/-/react-native-webrtc-124.0.6-daily.1.tgz#fbb9ed535b0d89cde3fc70e82e49c27bd2f967fa"
integrity sha512-oI3vl5hUkoXTiw3zMJZC+eIdYXejCAA1JVkn2/r3b1FStnF6A2/MPCHEXPVmZHPy+rdJcSi7P7TtG2pLkmo8Jw==
dependencies:
base64-js "1.5.1"
debug "4.3.4"
Expand Down Expand Up @@ -876,6 +877,26 @@
node-forge "^1.2.1"
nullthrows "^1.1.1"

"@expo/config-plugins@^10.1.2":
version "10.1.2"
resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-10.1.2.tgz#6efa256a3fa2fca116eeb5bef8b22b089e287282"
integrity sha512-IMYCxBOcnuFStuK0Ay+FzEIBKrwW8OVUMc65+v0+i7YFIIe8aL342l7T4F8lR4oCfhXn7d6M5QPgXvjtc/gAcw==
dependencies:
"@expo/config-types" "^53.0.5"
"@expo/json-file" "~9.1.5"
"@expo/plist" "^0.3.5"
"@expo/sdk-runtime-versions" "^1.0.0"
chalk "^4.1.2"
debug "^4.3.5"
getenv "^2.0.0"
glob "^10.4.2"
resolve-from "^5.0.0"
semver "^7.5.4"
slash "^3.0.0"
slugify "^1.6.6"
xcode "^3.0.1"
xml2js "0.6.0"

"@expo/config-plugins@~10.0.2":
version "10.0.2"
resolved "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-10.0.2.tgz"
Expand All @@ -901,6 +922,11 @@
resolved "https://registry.npmjs.org/@expo/config-types/-/config-types-53.0.4.tgz"
integrity sha512-0s+9vFx83WIToEr0Iwy4CcmiUXa5BgwBmEjylBB2eojX5XAMm9mJvw9KpjAb8m7zq2G0Q6bRbeufkzgbipuNQg==

"@expo/config-types@^53.0.5":
version "53.0.5"
resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-53.0.5.tgz#bba7e0712c2c5b1d8963348d68ea96339f858db4"
integrity sha512-kqZ0w44E+HEGBjy+Lpyn0BVL5UANg/tmNixxaRMLS6nf37YsDrLk2VMAmeKMMk5CKG0NmOdVv3ngeUjRQMsy9g==

"@expo/config@~11.0.6", "@expo/config@~11.0.9":
version "11.0.9"
resolved "https://registry.npmjs.org/@expo/config/-/config-11.0.9.tgz"
Expand Down Expand Up @@ -979,6 +1005,14 @@
"@babel/code-frame" "~7.10.4"
json5 "^2.2.3"

"@expo/json-file@~9.1.5":
version "9.1.5"
resolved "https://registry.yarnpkg.com/@expo/json-file/-/json-file-9.1.5.tgz#7d7b2dc4990dc2c2de69a571191aba984b7fb7ed"
integrity sha512-prWBhLUlmcQtvN6Y7BpW2k9zXGd3ySa3R6rAguMJkp1z22nunLN64KYTUWfijFlprFoxm9r2VNnGkcbndAlgKA==
dependencies:
"@babel/code-frame" "~7.10.4"
json5 "^2.2.3"

"@expo/[email protected]", "@expo/metro-config@~0.20.14":
version "0.20.14"
resolved "https://registry.npmjs.org/@expo/metro-config/-/metro-config-0.20.14.tgz"
Expand Down Expand Up @@ -1033,6 +1067,15 @@
base64-js "^1.2.3"
xmlbuilder "^15.1.1"

"@expo/plist@^0.3.5":
version "0.3.5"
resolved "https://registry.yarnpkg.com/@expo/plist/-/plist-0.3.5.tgz#11913c64951936101529cb26d7260ef16970fc31"
integrity sha512-9RYVU1iGyCJ7vWfg3e7c/NVyMFs8wbl+dMWZphtFtsqyN9zppGREU3ctlD3i8KUE0sCUTVnLjCWr+VeUIDep2g==
dependencies:
"@xmldom/xmldom" "^0.8.8"
base64-js "^1.2.3"
xmlbuilder "^15.1.1"

"@expo/prebuild-config@^9.0.5", "@expo/prebuild-config@^9.0.6":
version "9.0.6"
resolved "https://registry.npmjs.org/@expo/prebuild-config/-/prebuild-config-9.0.6.tgz"
Expand Down Expand Up @@ -2430,6 +2473,14 @@ expo-build-properties@~0.14.6:
ajv "^8.11.0"
semver "^7.6.0"

expo-build-properties@~0.14.8:
version "0.14.8"
resolved "https://registry.yarnpkg.com/expo-build-properties/-/expo-build-properties-0.14.8.tgz#03aac5eb297c1f4ad3c5b95d8bf897340104d041"
integrity sha512-GTFNZc5HaCS9RmCi6HspCe2+isleuOWt2jh7UEKHTDQ9tdvzkIoWc7U6bQO9lH3Mefk4/BcCUZD/utl7b1wdqw==
dependencies:
ajv "^8.11.0"
semver "^7.6.0"

expo-constants@~17.1.5, expo-constants@~17.1.6:
version "17.1.6"
resolved "https://registry.npmjs.org/expo-constants/-/expo-constants-17.1.6.tgz"
Expand Down Expand Up @@ -2700,6 +2751,11 @@ getenv@^1.0.0:
resolved "https://registry.npmjs.org/getenv/-/getenv-1.0.0.tgz"
integrity sha512-7yetJWqbS9sbn0vIfliPsFgoXMKn/YMF+Wuiog97x+urnSRRRZ7xB+uVkwGKzRgq9CDFfMQnE9ruL5DHv9c6Xg==

getenv@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/getenv/-/getenv-2.0.0.tgz#b1698c7b0f29588f4577d06c42c73a5b475c69e0"
integrity sha512-VilgtJj/ALgGY77fiLam5iD336eSWi96Q15JSAG1zi8NRBysm3LXKdGnHb4m5cuyxvOLQQKWpBZAT6ni4FI2iQ==

glob@^10.3.10, glob@^10.4.2:
version "10.4.5"
resolved "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz"
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipecat-ai/react-native-daily-transport",
"version": "1.2.0",
"version": "1.4.0",
"license": "BSD-2-Clause",
"description": "React Native library for connecting to RTVI client using Daily",
"source": "./src/index.tsx",
Expand Down Expand Up @@ -105,18 +105,18 @@
]
},
"dependencies": {
"@pipecat-ai/client-js": "^1.2.0"
"@pipecat-ai/client-js": "^1.4.0"
},
"peerDependencies": {
"@daily-co/react-native-webrtc": "^118.0.3-daily.4",
"@daily-co/react-native-daily-js": "^0.79.0",
"@daily-co/react-native-webrtc": "^124.0.6-daily.1",
"@daily-co/react-native-daily-js": "^0.81.0",
"@react-native-async-storage/async-storage": "^1.24.0",
"react-native-get-random-values": "^1.11.0",
"react-native-background-timer": "^2.4.1"
},
"devDependencies": {
"@daily-co/react-native-webrtc": "^118.0.3-daily.4",
"@daily-co/react-native-daily-js": "^0.79.0",
"@daily-co/react-native-webrtc": "^124.0.6-daily.1",
"@daily-co/react-native-daily-js": "^0.81.0",
"@react-native-async-storage/async-storage": "^1.24.0",
"react-native-get-random-values": "^1.11.0",
"@types/base-64": "^1.0.2",
Expand Down
Loading