Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename to pipecat-client-android-transports #8

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
java-version: '17'

- name: Build Daily transport
run: ./gradlew :rtvi-client-android-daily:assembleRelease
run: ./gradlew :pipecat-client-android-daily:assembleRelease

- name: Generate Maven repo
run: ./gradlew :rtvi-client-android-daily:publishAllPublicationsToRTVILocalRepoRepository
run: ./gradlew :pipecat-client-android-daily:publishAllPublicationsToPipecatLocalRepoRepository

- name: Upload Maven repo
uses: actions/upload-artifact@v4
with:
name: RTVIClientAndroidDaily-Repo
path: build/RTVILocalRepo
name: PipecatClientAndroidDaily-Repo
path: build/PipecatLocalRepo
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Real-Time Voice Inference Android Client SDK: Daily Transport
# Pipecat Android Client SDK: Transports

[RTVI](https://github.com/rtvi-ai/) is an open standard for Real-Time Voice (and Video) Inference.

This Android library exposes the `DailyVoiceClient` class, to connect to a Daily Bots backend.

## Usage
## Daily Websocket Transport

Add the following dependency to your `build.gradle` file:

```
implementation "ai.rtvi:rtvi-client-android-daily:0.2.1"
implementation "ai.pipecat:daily-transport:0.3.0"
```

Instantiate from your code:

```kotlin
val callbacks = object : VoiceEventCallbacks() {
val callbacks = object : RTVIEventCallbacks() {

override fun onBackendError(message: String) {
Log.e(TAG, "Error from backend: $message")
Expand All @@ -24,7 +22,9 @@ val callbacks = object : VoiceEventCallbacks() {
// ...
}

val client = DailyVoiceClient(context, baseUrl, callbacks)
val transport = DailyTransport.Factory(context)

val client = RTVIClient(transport, callbacks, options)

client.start().withCallback {
// ...
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[versions]
agp = "8.5.2"
daily-android-client = "0.24.0"
daily-android-client = "0.27.0"
kotlin = "2.0.20"
coreKtx = "1.13.1"
kotlinxCoroutinesTest = "1.8.1"
kotlinxSerializationJson = "1.7.1"
kotlinxSerializationPlugin = "2.0.20"
dokka = "1.9.20"
androidxTest = "1.6.1"
rtviClient = "0.2.1"
pipecatClient = "0.3.0"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
Expand All @@ -17,7 +17,7 @@ androidx-runner = { module = "androidx.test:runner", version.ref = "androidxTest
daily-android-client = { module = "co.daily:client", version.ref = "daily-android-client" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesTest" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
rtvi-client = { module = "ai.rtvi:client", version.ref = "rtviClient" }
pipecat-client = { module = "ai.pipecat:client", version.ref = "pipecatClient" }

[plugins]
android-library = { id = "com.android.library", version.ref = "agp" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

android {
namespace = "ai.rtvi.client.daily"
namespace = "ai.pipecat.client.daily"
compileSdk = 34

defaultConfig {
Expand Down Expand Up @@ -45,7 +45,7 @@ dependencies {
implementation(libs.kotlinx.serialization.json)

api(libs.daily.android.client)
api(libs.rtvi.client)
api(libs.pipecat.client)

androidTestImplementation(libs.androidx.runner)
androidTestImplementation(libs.androidx.rules)
Expand All @@ -55,40 +55,40 @@ dependencies {
publishing {
repositories {
maven {
url = rootProject.layout.buildDirectory.dir("RTVILocalRepo").get().asFile.toURI()
name = "RTVILocalRepo"
url = rootProject.layout.buildDirectory.dir("PipecatLocalRepo").get().asFile.toURI()
name = "PipecatLocalRepo"
}
}

publications {
register<MavenPublication>("release") {
groupId = "ai.rtvi"
artifactId = "client-daily"
version = "0.2.1"
groupId = "ai.pipecat"
artifactId = "daily-transport"
version = "0.3.0"

pom {
name.set("RTVI Client Daily Transport")
description.set("Daily RTVI client library for Android")
url.set("https://github.com/rtvi-ai/rtvi-client-android-daily")
name.set("Pipecat Client Daily Transport")
description.set("Daily Pipecat transport for Android")
url.set("https://github.com/pipecat-ai/pipecat-client-android-transports")

developers {
developer {
id.set("rtvi.ai")
name.set("rtvi.ai")
id.set("pipecat.ai")
name.set("pipecat.ai")
}
}

licenses {
license {
name.set("BSD 2-Clause License")
url.set("https://github.com/rtvi-ai/rtvi-client-android-daily/blob/main/LICENSE")
url.set("https://github.com/pipecat-ai/pipecat-client-android-transports/blob/main/LICENSE")
}
}

scm {
connection.set("scm:git:git://github.com/rtvi-ai/rtvi-client-android-daily.git")
developerConnection.set("scm:git:ssh://github.com:rtvi-ai/rtvi-client-android-daily.git")
url.set("https://github.com/rtvi-ai/rtvi-client-android-daily")
connection.set("scm:git:git://github.com/pipecat-ai/pipecat-client-android-transports.git")
developerConnection.set("scm:git:ssh://github.com:pipecat-ai/pipecat-client-android-transports.git")
url.set("https://github.com/pipecat-ai/pipecat-client-android-transports")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</application>

<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="ai.rtvi.client.daily"
android:targetPackage="ai.pipecat.client.daily"
android:label="DailyVoiceClient tests"/>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
package ai.rtvi.client.daily

import ai.rtvi.client.RTVIClientOptions
import ai.rtvi.client.RTVIClientParams
import ai.rtvi.client.RTVIEventCallbacks
import ai.rtvi.client.helper.LLMContext
import ai.rtvi.client.helper.LLMContextMessage
import ai.rtvi.client.helper.LLMHelper
import ai.rtvi.client.result.RTVIError
import ai.rtvi.client.result.Result
import ai.rtvi.client.types.ActionDescription
import ai.rtvi.client.types.Config
import ai.rtvi.client.types.Option
import ai.rtvi.client.types.OptionDescription
import ai.rtvi.client.types.ServiceConfig
import ai.rtvi.client.types.ServiceConfigDescription
import ai.rtvi.client.types.ServiceRegistration
import ai.rtvi.client.types.TransportState
import ai.rtvi.client.types.Type
import ai.rtvi.client.types.Value
package ai.pipecat.client.daily

import ai.pipecat.client.RTVIClient
import ai.pipecat.client.RTVIClientOptions
import ai.pipecat.client.RTVIClientParams
import ai.pipecat.client.RTVIEventCallbacks
import ai.pipecat.client.helper.LLMContext
import ai.pipecat.client.helper.LLMContextMessage
import ai.pipecat.client.helper.LLMHelper
import ai.pipecat.client.result.RTVIError
import ai.pipecat.client.result.Result
import ai.pipecat.client.types.ActionDescription
import ai.pipecat.client.types.Config
import ai.pipecat.client.types.Option
import ai.pipecat.client.types.OptionDescription
import ai.pipecat.client.types.ServiceConfig
import ai.pipecat.client.types.ServiceConfigDescription
import ai.pipecat.client.types.ServiceRegistration
import ai.pipecat.client.types.TransportState
import ai.pipecat.client.types.Type
import ai.pipecat.client.types.Value
import androidx.test.filters.LargeTest
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -60,7 +61,7 @@ class MainTests {
)

private class TestContext(
val client: DailyVoiceClient,
val client: RTVIClient,
val llmHelper: LLMHelper
)

Expand All @@ -69,8 +70,8 @@ class MainTests {
) = runBlocking(Dispatchers.Main) {
val context = InstrumentationRegistry.getInstrumentation().context

val client = DailyVoiceClient(
context = context,
val client = RTVIClient(
transport = DailyTransport.Factory(context),
callbacks = object : RTVIEventCallbacks() {
override fun onBackendError(message: String) {
throw Exception("onBackendError: $message")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package ai.rtvi.client.daily

import ai.rtvi.client.result.Future
import ai.rtvi.client.result.RTVIError
import ai.rtvi.client.result.resolvedPromiseErr
import ai.rtvi.client.result.resolvedPromiseOk
import ai.rtvi.client.result.withPromise
import ai.rtvi.client.transport.AuthBundle
import ai.rtvi.client.transport.MsgClientToServer
import ai.rtvi.client.transport.MsgServerToClient
import ai.rtvi.client.transport.Transport
import ai.rtvi.client.transport.TransportContext
import ai.rtvi.client.transport.TransportFactory
import ai.rtvi.client.types.MediaDeviceId
import ai.rtvi.client.types.MediaDeviceInfo
import ai.rtvi.client.types.Participant
import ai.rtvi.client.types.ParticipantId
import ai.rtvi.client.types.ParticipantTracks
import ai.rtvi.client.types.Tracks
import ai.rtvi.client.types.TransportState
package ai.pipecat.client.daily

import ai.pipecat.client.result.Future
import ai.pipecat.client.result.RTVIError
import ai.pipecat.client.result.resolvedPromiseErr
import ai.pipecat.client.result.resolvedPromiseOk
import ai.pipecat.client.result.withPromise
import ai.pipecat.client.transport.AuthBundle
import ai.pipecat.client.transport.MsgClientToServer
import ai.pipecat.client.transport.MsgServerToClient
import ai.pipecat.client.transport.Transport
import ai.pipecat.client.transport.TransportContext
import ai.pipecat.client.transport.TransportFactory
import ai.pipecat.client.types.MediaDeviceId
import ai.pipecat.client.types.MediaDeviceInfo
import ai.pipecat.client.types.Participant
import ai.pipecat.client.types.ParticipantId
import ai.pipecat.client.types.ParticipantTracks
import ai.pipecat.client.types.Tracks
import ai.pipecat.client.types.TransportState
import android.content.Context
import android.util.Log
import co.daily.CallClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ai.rtvi.client.daily
package ai.pipecat.client.daily

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package ai.rtvi.client.daily

import ai.rtvi.client.result.Promise
import ai.rtvi.client.result.RTVIError
import ai.rtvi.client.types.MediaDeviceId
import ai.rtvi.client.types.MediaDeviceInfo
import ai.rtvi.client.types.MediaTrackId
import ai.rtvi.client.types.Participant
import ai.rtvi.client.types.ParticipantId
package ai.pipecat.client.daily

import ai.pipecat.client.result.Promise
import ai.pipecat.client.result.RTVIError
import ai.pipecat.client.types.MediaDeviceId
import ai.pipecat.client.types.MediaDeviceInfo
import ai.pipecat.client.types.MediaTrackId
import ai.pipecat.client.types.Participant
import ai.pipecat.client.types.ParticipantId
import co.daily.model.RequestError
import co.daily.model.RequestResult
import kotlinx.serialization.json.Json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ai.rtvi.client.daily
package ai.pipecat.client.daily

import ai.rtvi.client.types.MediaTrackId
import ai.pipecat.client.types.MediaTrackId
import android.content.Context
import android.util.AttributeSet
import co.daily.model.MediaStreamTrack
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ dependencyResolutionManagement {
}
}

rootProject.name = "RTVI Daily Client Transport"
include(":rtvi-client-android-daily")
rootProject.name = "Pipecat Client Transports"
include(":pipecat-client-android-daily")
Loading