diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c9019c9..2cccd87 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,13 +37,13 @@ jobs: java-version: '17' - name: Build core SDK - run: ./gradlew :rtvi-client-android:assembleRelease + run: ./gradlew :pipecat-client-android:assembleRelease - name: Generate Maven repo - run: ./gradlew :rtvi-client-android:publishAllPublicationsToRTVILocalRepoRepository + run: ./gradlew :pipecat-client-android:publishAllPublicationsToPipecatLocalRepoRepository - name: Upload Maven repo uses: actions/upload-artifact@v4 with: - name: RTVIClientAndroid-Repo - path: build/RTVILocalRepo + name: PipecatClientAndroid-Repo + path: build/PipecatLocalRepo diff --git a/CHANGELOG.md b/CHANGELOG.md index bd7ffd8..bde22ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.3.0 + +- Project renamed to `pipecat-client-android` + # 0.2.1 - Added callbacks: @@ -30,4 +34,4 @@ - Added callbacks - `onBotLLMText()` - `onBotTTSText()` - - `onStorageItemStored()` \ No newline at end of file + - `onStorageItemStored()` diff --git a/README.md b/README.md index 9aa1201..0555512 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# Real-Time Voice Inference Android Client SDK +

+ pipecat +

+ +# Pipecat Android Client SDK [RTVI](https://github.com/rtvi-ai/) is an open standard for Real-Time Voice (and Video) Inference. @@ -6,20 +10,20 @@ This Android library contains the core components and types needed to set up an When building an RTVI application, you should use the transport-specific client library (see [here](https://rtvi.mintlify.app/api-reference/transports/introduction) for available first-party -packages.) The base `VoiceClient` has no transport included. +packages.) The base `RTVIClient` has no transport included. ## Usage Add the following dependency to your `build.gradle` file: ``` -implementation "ai.rtvi:client:0.2.1" +implementation "ai.pipecat:client:0.3.0" ``` -Then instantiate the `VoiceClient` from your code, specifying the backend `baseUrl` and transport. +Then instantiate the `RTVIClient` from your code, specifying the backend `baseUrl` and transport. ```kotlin -val callbacks = object : VoiceEventCallbacks() { +val callbacks = object : RTVIEventCallbacks() { override fun onBackendError(message: String) { Log.e(TAG, "Error from backend: $message") @@ -28,7 +32,7 @@ val callbacks = object : VoiceEventCallbacks() { // ... } -val client = VoiceClient(baseUrl, transport, callbacks) +val client = RTVIClient(transport, callbacks, options) client.start().withCallback { // ... diff --git a/assets/pipecat-android.png b/assets/pipecat-android.png new file mode 100644 index 0000000..a1f1c66 Binary files /dev/null and b/assets/pipecat-android.png differ diff --git a/rtvi-client-android/.gitignore b/pipecat-client-android/.gitignore similarity index 100% rename from rtvi-client-android/.gitignore rename to pipecat-client-android/.gitignore diff --git a/rtvi-client-android/build.gradle.kts b/pipecat-client-android/build.gradle.kts similarity index 70% rename from rtvi-client-android/build.gradle.kts rename to pipecat-client-android/build.gradle.kts index 67e2e61..6b13d18 100644 --- a/rtvi-client-android/build.gradle.kts +++ b/pipecat-client-android/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } android { - namespace = "ai.rtvi.client" + namespace = "ai.pipecat.client" compileSdk = 34 defaultConfig { @@ -51,40 +51,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("release") { - groupId = "ai.rtvi" + groupId = "ai.pipecat" artifactId = "client" - version = "0.2.1" + version = "0.3.0" pom { - name.set("RTVI Client") - description.set("Core RTVI client library for Android") - url.set("https://github.com/rtvi-ai/rtvi-client-android") + name.set("Pipecat Client") + description.set("Core Pipecat client library for Android") + url.set("https://github.com/pipecat-ai/pipecat-client-android") 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/blob/main/LICENSE") + url.set("https://github.com/pipecat-ai/pipecat-client-android/blob/main/LICENSE") } } scm { - connection.set("scm:git:git://github.com/rtvi-ai/rtvi-client-android.git") - developerConnection.set("scm:git:ssh://github.com:rtvi-ai/rtvi-client-android.git") - url.set("https://github.com/rtvi-ai/rtvi-client-android") + connection.set("scm:git:git://github.com/pipecat-ai/pipecat-client-android.git") + developerConnection.set("scm:git:ssh://github.com:pipecat-ai/pipecat-client-android.git") + url.set("https://github.com/pipecat-ai/pipecat-client-android") } } @@ -103,4 +103,4 @@ signing { useInMemoryPgpKeys(signingKey, signingPassphrase) sign(publishing.publications) } -} \ No newline at end of file +} diff --git a/rtvi-client-android/proguard-rules.pro b/pipecat-client-android/proguard-rules.pro similarity index 100% rename from rtvi-client-android/proguard-rules.pro rename to pipecat-client-android/proguard-rules.pro diff --git a/rtvi-client-android/src/main/AndroidManifest.xml b/pipecat-client-android/src/main/AndroidManifest.xml similarity index 100% rename from rtvi-client-android/src/main/AndroidManifest.xml rename to pipecat-client-android/src/main/AndroidManifest.xml diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/RTVIClient.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/RTVIClient.kt similarity index 83% rename from rtvi-client-android/src/main/java/ai/rtvi/client/RTVIClient.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/RTVIClient.kt index cc4c9b1..0030df6 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/RTVIClient.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/RTVIClient.kt @@ -1,37 +1,37 @@ -package ai.rtvi.client - -import ai.rtvi.client.helper.RTVIClientHelper -import ai.rtvi.client.helper.RegisteredRTVIClient -import ai.rtvi.client.result.Future -import ai.rtvi.client.result.Promise -import ai.rtvi.client.result.RTVIError -import ai.rtvi.client.result.RTVIException -import ai.rtvi.client.result.Result -import ai.rtvi.client.result.resolvedPromiseErr -import ai.rtvi.client.result.withPromise -import ai.rtvi.client.result.withTimeout -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.ActionDescription -import ai.rtvi.client.types.Config -import ai.rtvi.client.types.MediaDeviceId -import ai.rtvi.client.types.Option -import ai.rtvi.client.types.RegisteredHelper -import ai.rtvi.client.types.ServiceConfig -import ai.rtvi.client.types.ServiceConfigDescription -import ai.rtvi.client.types.Transcript -import ai.rtvi.client.types.TransportState -import ai.rtvi.client.types.Value -import ai.rtvi.client.utils.ConnectionBundle -import ai.rtvi.client.utils.JSON_INSTANCE -import ai.rtvi.client.utils.ThreadRef -import ai.rtvi.client.utils.parseServerSentEvents -import ai.rtvi.client.utils.post -import ai.rtvi.client.utils.valueFrom +package ai.pipecat.client + +import ai.pipecat.client.helper.RTVIClientHelper +import ai.pipecat.client.helper.RegisteredRTVIClient +import ai.pipecat.client.result.Future +import ai.pipecat.client.result.Promise +import ai.pipecat.client.result.RTVIError +import ai.pipecat.client.result.RTVIException +import ai.pipecat.client.result.Result +import ai.pipecat.client.result.resolvedPromiseErr +import ai.pipecat.client.result.withPromise +import ai.pipecat.client.result.withTimeout +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.ActionDescription +import ai.pipecat.client.types.Config +import ai.pipecat.client.types.MediaDeviceId +import ai.pipecat.client.types.Option +import ai.pipecat.client.types.RegisteredHelper +import ai.pipecat.client.types.ServiceConfig +import ai.pipecat.client.types.ServiceConfigDescription +import ai.pipecat.client.types.Transcript +import ai.pipecat.client.types.TransportState +import ai.pipecat.client.types.Value +import ai.pipecat.client.utils.ConnectionBundle +import ai.pipecat.client.utils.JSON_INSTANCE +import ai.pipecat.client.utils.ThreadRef +import ai.pipecat.client.utils.parseServerSentEvents +import ai.pipecat.client.utils.post +import ai.pipecat.client.utils.valueFrom import android.util.Log import kotlinx.serialization.json.JsonElement import kotlinx.serialization.json.JsonPrimitive @@ -40,7 +40,7 @@ import kotlinx.serialization.json.jsonObject import okhttp3.MediaType.Companion.toMediaType import okhttp3.RequestBody.Companion.toRequestBody -private const val RTVI_PROTOCOL_VERSION = "0.2.0" +private const val RTVI_PROTOCOL_VERSION = "0.3.0" /** * An RTVI client. Connects to an RTVI backend and handles bidirectional audio and video @@ -59,7 +59,7 @@ open class RTVIClient( private var options: RTVIClientOptions, ) { companion object { - private const val TAG = "VoiceClient" + private const val TAG = "RTVIClient" } /** @@ -252,9 +252,6 @@ open class RTVIClient( */ fun initDevices(): Future = transport.initDevices() - @Deprecated("start() renamed to connect()") - fun start() = connect() - /** * Initiate an RTVI session, connecting to the backend. */ @@ -267,42 +264,51 @@ open class RTVIClient( ) } - transport.setState(TransportState.Authorizing) + if (options.params.baseUrl != null && options.params.endpoints.connect != null) { - // Send POST request to the provided base_url to connect and start the bot + transport.setState(TransportState.Authorizing) - val connectionData = ConnectionData.from(options) + // Send POST request to the provided base_url to connect and start the bot - val body = ConnectionBundle( - services = options.services?.associate { it.service to it.value }, - config = connectionData.config - ) - .serializeWithCustomParams(connectionData.requestData) - .toRequestBody("application/json".toMediaType()) + val connectionData = ConnectionData.from(options) - val currentConnection = Connection().apply { connection = this } + val body = ConnectionBundle( + services = options.services?.associate { it.service to it.value }, + config = connectionData.config + ) + .serializeWithCustomParams(connectionData.requestData) + .toRequestBody("application/json".toMediaType()) - return@runOnThreadReturningFuture post( - thread = thread, - url = options.params.baseUrl + options.params.endpoints.connect, - body = body, - customHeaders = connectionData.headers - ) - .mapError { - RTVIError.HttpError(it) - } - .chain { authBundle -> - if (currentConnection == connection) { - transport.connect(AuthBundle(authBundle)) - } else { - resolvedPromiseErr(thread, RTVIError.OperationCancelled) + val currentConnection = Connection().apply { connection = this } + + return@runOnThreadReturningFuture post( + thread = thread, + url = options.params.baseUrl + options.params.endpoints.connect, + body = body, + customHeaders = connectionData.headers + ) + .mapError { + RTVIError.HttpError(it) } - } - .chain { currentConnection.ready } - .withTimeout(30000) - .withErrorCallback { - disconnect() - } + .chain { authBundle -> + if (currentConnection == connection) { + transport.connect(AuthBundle(authBundle)) + } else { + resolvedPromiseErr(thread, RTVIError.OperationCancelled) + } + } + .chain { currentConnection.ready } + .withTimeout(30000) + .withErrorCallback { + disconnect() + } + + } else { + // No connection endpoint + Log.w(TAG, "No connect endpoint specified, skipping auth request") + connection = Connection() + return@runOnThreadReturningFuture transport.connect(null) + } } /** @@ -597,11 +603,10 @@ private class ConnectionData( ) { companion object { fun from(value: RTVIClientOptions) = ConnectionData( - headers = value.customHeaders + value.params.headers, + headers = value.params.headers, requestData = listOf("rtvi_client_version" to Value.Str(RTVI_PROTOCOL_VERSION)) - + value.customBodyParams + value.params.requestData, - config = value.config + value.params.config + config = value.params.config ) } } \ No newline at end of file diff --git a/pipecat-client-android/src/main/java/ai/pipecat/client/RTVIClientOptions.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/RTVIClientOptions.kt new file mode 100644 index 0000000..8157732 --- /dev/null +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/RTVIClientOptions.kt @@ -0,0 +1,35 @@ +package ai.pipecat.client + +import ai.pipecat.client.types.ServiceConfig +import ai.pipecat.client.types.ServiceRegistration +import ai.pipecat.client.types.Value + +/** + * Configuration options when instantiating a [RTVIClient]. + */ +data class RTVIClientOptions( + + /** + * Connection parameters. + */ + val params: RTVIClientParams, + + /** + * Enable the user mic input. + * + * Defaults to true. + */ + val enableMic: Boolean = true, + + /** + * Enable user cam input. + * + * Defaults to false. + */ + val enableCam: Boolean = false, + + /** + * A list of services to use on the backend. + */ + val services: List? = null, +) \ No newline at end of file diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/RTVIClientParams.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/RTVIClientParams.kt similarity index 79% rename from rtvi-client-android/src/main/java/ai/rtvi/client/RTVIClientParams.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/RTVIClientParams.kt index 1c795b4..aa20e8d 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/RTVIClientParams.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/RTVIClientParams.kt @@ -1,8 +1,8 @@ -package ai.rtvi.client +package ai.pipecat.client -import ai.rtvi.client.types.RTVIURLEndpoints -import ai.rtvi.client.types.ServiceConfig -import ai.rtvi.client.types.Value +import ai.pipecat.client.types.RTVIURLEndpoints +import ai.pipecat.client.types.ServiceConfig +import ai.pipecat.client.types.Value /** * Connection options when instantiating a [RTVIClient]. @@ -12,7 +12,7 @@ data class RTVIClientParams( /** * The base URL for the RTVI POST request. */ - val baseUrl: String, + val baseUrl: String?, /** * Custom HTTP headers to be sent with the POST request. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/RTVIEventCallbacks.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/RTVIEventCallbacks.kt similarity index 94% rename from rtvi-client-android/src/main/java/ai/rtvi/client/RTVIEventCallbacks.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/RTVIEventCallbacks.kt index 8d26a67..b3c8253 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/RTVIEventCallbacks.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/RTVIEventCallbacks.kt @@ -1,13 +1,13 @@ -package ai.rtvi.client - -import ai.rtvi.client.transport.MsgServerToClient -import ai.rtvi.client.types.MediaDeviceInfo -import ai.rtvi.client.types.Participant -import ai.rtvi.client.types.PipecatMetrics -import ai.rtvi.client.types.ServiceConfig -import ai.rtvi.client.types.Tracks -import ai.rtvi.client.types.Transcript -import ai.rtvi.client.types.TransportState +package ai.pipecat.client + +import ai.pipecat.client.transport.MsgServerToClient +import ai.pipecat.client.types.MediaDeviceInfo +import ai.pipecat.client.types.Participant +import ai.pipecat.client.types.PipecatMetrics +import ai.pipecat.client.types.ServiceConfig +import ai.pipecat.client.types.Tracks +import ai.pipecat.client.types.Transcript +import ai.pipecat.client.types.TransportState /** * Callbacks invoked when changes occur in the RTVI session. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/helper/LLMHelper.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/helper/LLMHelper.kt similarity index 94% rename from rtvi-client-android/src/main/java/ai/rtvi/client/helper/LLMHelper.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/helper/LLMHelper.kt index d9958f0..089f560 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/helper/LLMHelper.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/helper/LLMHelper.kt @@ -1,14 +1,14 @@ -package ai.rtvi.client.helper - -import ai.rtvi.client.result.Future -import ai.rtvi.client.result.RTVIError -import ai.rtvi.client.result.resolvedPromiseErr -import ai.rtvi.client.transport.MsgClientToServer -import ai.rtvi.client.transport.MsgServerToClient -import ai.rtvi.client.types.Option -import ai.rtvi.client.types.TransportState -import ai.rtvi.client.types.Value -import ai.rtvi.client.utils.JSON_INSTANCE +package ai.pipecat.client.helper + +import ai.pipecat.client.result.Future +import ai.pipecat.client.result.RTVIError +import ai.pipecat.client.result.resolvedPromiseErr +import ai.pipecat.client.transport.MsgClientToServer +import ai.pipecat.client.transport.MsgServerToClient +import ai.pipecat.client.types.Option +import ai.pipecat.client.types.TransportState +import ai.pipecat.client.types.Value +import ai.pipecat.client.utils.JSON_INSTANCE import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonArray diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/helper/RTVIClientHelper.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/helper/RTVIClientHelper.kt similarity index 81% rename from rtvi-client-android/src/main/java/ai/rtvi/client/helper/RTVIClientHelper.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/helper/RTVIClientHelper.kt index 7c55f19..6344b8f 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/helper/RTVIClientHelper.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/helper/RTVIClientHelper.kt @@ -1,13 +1,13 @@ -package ai.rtvi.client.helper +package ai.pipecat.client.helper -import ai.rtvi.client.RTVIClient -import ai.rtvi.client.result.Future -import ai.rtvi.client.result.RTVIError -import ai.rtvi.client.result.RTVIException -import ai.rtvi.client.result.resolvedPromiseErr -import ai.rtvi.client.transport.MsgServerToClient -import ai.rtvi.client.types.Option -import ai.rtvi.client.utils.ThreadRef +import ai.pipecat.client.RTVIClient +import ai.pipecat.client.result.Future +import ai.pipecat.client.result.RTVIError +import ai.pipecat.client.result.RTVIException +import ai.pipecat.client.result.resolvedPromiseErr +import ai.pipecat.client.transport.MsgServerToClient +import ai.pipecat.client.types.Option +import ai.pipecat.client.utils.ThreadRef import java.util.concurrent.atomic.AtomicReference abstract class RTVIClientHelper { diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/result/Callback.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/result/Callback.kt similarity index 77% rename from rtvi-client-android/src/main/java/ai/rtvi/client/result/Callback.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/result/Callback.kt index df82b1e..9f28e99 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/result/Callback.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/result/Callback.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.result +package ai.pipecat.client.result /** * A callback function receiving a value. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/result/Future.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/result/Future.kt similarity index 97% rename from rtvi-client-android/src/main/java/ai/rtvi/client/result/Future.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/result/Future.kt index 78aec24..5765873 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/result/Future.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/result/Future.kt @@ -1,6 +1,6 @@ -package ai.rtvi.client.result +package ai.pipecat.client.result -import ai.rtvi.client.utils.ThreadRef +import ai.pipecat.client.utils.ThreadRef import android.util.Log import kotlin.coroutines.resume import kotlin.coroutines.suspendCoroutine diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/result/HttpError.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/result/HttpError.kt similarity index 96% rename from rtvi-client-android/src/main/java/ai/rtvi/client/result/HttpError.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/result/HttpError.kt index 355105c..747e681 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/result/HttpError.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/result/HttpError.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.result +package ai.pipecat.client.result /** * An error occurring due to an HTTP request failing. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/result/Promise.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/result/Promise.kt similarity index 96% rename from rtvi-client-android/src/main/java/ai/rtvi/client/result/Promise.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/result/Promise.kt index 31edcb3..3ef3ed3 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/result/Promise.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/result/Promise.kt @@ -1,6 +1,6 @@ -package ai.rtvi.client.result +package ai.pipecat.client.result -import ai.rtvi.client.utils.ThreadRef +import ai.pipecat.client.utils.ThreadRef /** * Represents an ongoing asynchronous operation. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/result/RTVIError.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/result/RTVIError.kt similarity index 93% rename from rtvi-client-android/src/main/java/ai/rtvi/client/result/RTVIError.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/result/RTVIError.kt index baac94a..4f33bbc 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/result/RTVIError.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/result/RTVIError.kt @@ -1,6 +1,6 @@ -package ai.rtvi.client.result +package ai.pipecat.client.result -import ai.rtvi.client.types.TransportState +import ai.pipecat.client.types.TransportState /** * An error occurring during an operation. @@ -22,7 +22,7 @@ abstract class RTVIError { /** * Failed to fetch the authentication bundle from the RTVI backend. */ - data class HttpError(val error: ai.rtvi.client.result.HttpError) : RTVIError() { + data class HttpError(val error: ai.pipecat.client.result.HttpError) : RTVIError() { override val description = error.description } diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/result/RTVIException.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/result/RTVIException.kt similarity index 88% rename from rtvi-client-android/src/main/java/ai/rtvi/client/result/RTVIException.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/result/RTVIException.kt index 36fd254..c17c38f 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/result/RTVIException.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/result/RTVIException.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.result +package ai.pipecat.client.result class RTVIException( val error: RTVIError diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/result/Result.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/result/Result.kt similarity index 98% rename from rtvi-client-android/src/main/java/ai/rtvi/client/result/Result.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/result/Result.kt index 3d8e543..c19fe72 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/result/Result.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/result/Result.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.result +package ai.pipecat.client.result /** * The result of an operation: either Result.Ok or Result.Err. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/result/ResultCallback.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/result/ResultCallback.kt similarity index 80% rename from rtvi-client-android/src/main/java/ai/rtvi/client/result/ResultCallback.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/result/ResultCallback.kt index 0b1e524..2fd4f63 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/result/ResultCallback.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/result/ResultCallback.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.result +package ai.pipecat.client.result /** * A callback function receiving a Result value. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/AuthBundle.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/AuthBundle.kt similarity index 77% rename from rtvi-client-android/src/main/java/ai/rtvi/client/transport/AuthBundle.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/transport/AuthBundle.kt index a1cf2c3..62bfc46 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/AuthBundle.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/AuthBundle.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.transport +package ai.pipecat.client.transport /** * A bundle of initialization data received from the RTVI backend. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/MsgClientToServer.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/MsgClientToServer.kt similarity index 92% rename from rtvi-client-android/src/main/java/ai/rtvi/client/transport/MsgClientToServer.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/transport/MsgClientToServer.kt index 5e19fc1..a72da90 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/MsgClientToServer.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/MsgClientToServer.kt @@ -1,8 +1,8 @@ -package ai.rtvi.client.transport +package ai.pipecat.client.transport -import ai.rtvi.client.types.Option -import ai.rtvi.client.types.ServiceConfig -import ai.rtvi.client.utils.JSON_INSTANCE +import ai.pipecat.client.types.Option +import ai.pipecat.client.types.ServiceConfig +import ai.pipecat.client.utils.JSON_INSTANCE import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonElement import kotlinx.serialization.json.encodeToJsonElement diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/MsgServerToClient.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/MsgServerToClient.kt similarity index 92% rename from rtvi-client-android/src/main/java/ai/rtvi/client/transport/MsgServerToClient.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/transport/MsgServerToClient.kt index a538a8b..6717a02 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/MsgServerToClient.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/MsgServerToClient.kt @@ -1,9 +1,9 @@ -package ai.rtvi.client.transport +package ai.pipecat.client.transport -import ai.rtvi.client.types.ActionDescription -import ai.rtvi.client.types.ServiceConfig -import ai.rtvi.client.types.ServiceConfigDescription -import ai.rtvi.client.types.Value +import ai.pipecat.client.types.ActionDescription +import ai.pipecat.client.types.ServiceConfig +import ai.pipecat.client.types.ServiceConfigDescription +import ai.pipecat.client.types.Value import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonElement import kotlinx.serialization.json.JsonNull diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/Transport.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/Transport.kt similarity index 76% rename from rtvi-client-android/src/main/java/ai/rtvi/client/transport/Transport.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/transport/Transport.kt index 848daa4..4d58291 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/Transport.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/Transport.kt @@ -1,11 +1,11 @@ -package ai.rtvi.client.transport +package ai.pipecat.client.transport -import ai.rtvi.client.result.Future -import ai.rtvi.client.result.RTVIError -import ai.rtvi.client.types.MediaDeviceId -import ai.rtvi.client.types.MediaDeviceInfo -import ai.rtvi.client.types.Tracks -import ai.rtvi.client.types.TransportState +import ai.pipecat.client.result.Future +import ai.pipecat.client.result.RTVIError +import ai.pipecat.client.types.MediaDeviceId +import ai.pipecat.client.types.MediaDeviceInfo +import ai.pipecat.client.types.Tracks +import ai.pipecat.client.types.TransportState /** * An RTVI transport. @@ -15,7 +15,7 @@ abstract class Transport { abstract fun initDevices(): Future abstract fun release() - abstract fun connect(authBundle: AuthBundle): Future + abstract fun connect(authBundle: AuthBundle?): Future abstract fun disconnect(): Future diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/TransportContext.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/TransportContext.kt similarity index 64% rename from rtvi-client-android/src/main/java/ai/rtvi/client/transport/TransportContext.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/transport/TransportContext.kt index a55575c..dd1f034 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/TransportContext.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/TransportContext.kt @@ -1,8 +1,8 @@ -package ai.rtvi.client.transport +package ai.pipecat.client.transport -import ai.rtvi.client.RTVIClientOptions -import ai.rtvi.client.RTVIEventCallbacks -import ai.rtvi.client.utils.ThreadRef +import ai.pipecat.client.RTVIClientOptions +import ai.pipecat.client.RTVIEventCallbacks +import ai.pipecat.client.utils.ThreadRef /** * Context for an RTVI transport. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/TransportFactory.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/TransportFactory.kt similarity index 79% rename from rtvi-client-android/src/main/java/ai/rtvi/client/transport/TransportFactory.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/transport/TransportFactory.kt index 7e92b7b..7edd057 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/TransportFactory.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/transport/TransportFactory.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.transport +package ai.pipecat.client.transport /** * A creator of Transport objects. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/types/ActionDescription.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/types/ActionDescription.kt similarity index 86% rename from rtvi-client-android/src/main/java/ai/rtvi/client/types/ActionDescription.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/types/ActionDescription.kt index 7b04d62..2349a85 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/types/ActionDescription.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/types/ActionDescription.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.types +package ai.pipecat.client.types import kotlinx.serialization.Serializable diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/types/Config.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/types/Config.kt similarity index 64% rename from rtvi-client-android/src/main/java/ai/rtvi/client/types/Config.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/types/Config.kt index 3d70c4e..3d361d6 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/types/Config.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/types/Config.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.types +package ai.pipecat.client.types data class Config( val config: List diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/types/MediaDeviceId.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/types/MediaDeviceId.kt similarity index 75% rename from rtvi-client-android/src/main/java/ai/rtvi/client/types/MediaDeviceId.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/types/MediaDeviceId.kt index 66dafae..b04a130 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/types/MediaDeviceId.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/types/MediaDeviceId.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.types +package ai.pipecat.client.types /** * A unique identifier for a media device. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/types/MediaDeviceInfo.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/types/MediaDeviceInfo.kt similarity index 79% rename from rtvi-client-android/src/main/java/ai/rtvi/client/types/MediaDeviceInfo.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/types/MediaDeviceInfo.kt index e46dc08..eadc04d 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/types/MediaDeviceInfo.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/types/MediaDeviceInfo.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.types +package ai.pipecat.client.types /** * Information about a media device. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/types/MediaTrackId.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/types/MediaTrackId.kt similarity index 73% rename from rtvi-client-android/src/main/java/ai/rtvi/client/types/MediaTrackId.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/types/MediaTrackId.kt index f36471e..2734283 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/types/MediaTrackId.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/types/MediaTrackId.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.types +package ai.pipecat.client.types /** * An identifier for a media track. diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/types/Option.kt b/pipecat-client-android/src/main/java/ai/pipecat/client/types/Option.kt similarity index 83% rename from rtvi-client-android/src/main/java/ai/rtvi/client/types/Option.kt rename to pipecat-client-android/src/main/java/ai/pipecat/client/types/Option.kt index 0c4e59f..6a8e6f6 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/types/Option.kt +++ b/pipecat-client-android/src/main/java/ai/pipecat/client/types/Option.kt @@ -1,4 +1,4 @@ -package ai.rtvi.client.types +package ai.pipecat.client.types import kotlinx.serialization.Serializable @@ -19,5 +19,6 @@ data class Option( name = name, value = Value.Object(value) ) +} -} \ No newline at end of file +fun List