File tree Expand file tree Collapse file tree 4 files changed +33
-5
lines changed
src/main/java/ai/ultravox Expand file tree Collapse file tree 4 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,23 @@ Android client SDK for [Ultravox](https://ultravox.ai).
7
7
## Usage
8
8
9
9
``` kotlin
10
- val sessionState = session.joinCall(joinText.text.toString())
11
- sessionState.listen(" transcript" ) {
10
+ session.listen(" transcript" ) {
12
11
run {
13
- val last = sessionState .lastTranscript
12
+ val last = session .lastTranscript
14
13
// Do stuff with the transcript
15
14
}
16
15
}
16
+ session.joinCall(joinText.text.toString())
17
17
```
18
18
19
19
See the included example app for a more complete example. To get a ` joinUrl ` , you'll want to
20
20
integrate your server with the [ Ultravox REST API] ( https://fixie-ai.github.io/ultradox/ ) .
21
21
22
+ ## Publishing
23
+
24
+ 1 . Bump the version in ultravox_client's build.gradle.kts
25
+ 2 . Uncomment the "LocalForCentralUpload" maven repository block in the same gradle file
26
+ 3 . Uncomment and properly populate the three signing-related values in gradle.properties
27
+ 4 . Run publishToMaven
28
+ 5 . Compress the output "ai" directory into a zip file
29
+ 6 . Upload that zip to https://central.sonatype.com/publishing and work through the UI to publish
Original file line number Diff line number Diff line change @@ -20,4 +20,10 @@ kotlin.code.style=official
20
20
# Enables namespacing of each library's R class so that its R class includes only the
21
21
# resources declared in the library itself and none from the library's dependencies,
22
22
# thereby reducing the size of the R class for that library
23
- android.nonTransitiveRClass =true
23
+ android.nonTransitiveRClass =true
24
+ # The last 8 digits of your pub key id from gpg. Get with `gpg --list-keys`
25
+ # signing.keyId=
26
+ # The password for your keyring. DO NOT COMMIT
27
+ # signing.password=
28
+ # Path to your exported keyring from `gpg --keyring secring.gpg --export-secret-key $keyId_from_above > ~/tmp/secring.gpg`
29
+ signing.secretKeyRingFile =/home/mike/tmp/secring.gpg
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ publishing {
49
49
register<MavenPublication >(" release" ) {
50
50
groupId = " ai.fixie"
51
51
artifactId = " ultravox-client-sdk"
52
- version = " 0.1.2 "
52
+ version = " 0.1.4 "
53
53
54
54
pom {
55
55
name = " Ultravox Client"
Original file line number Diff line number Diff line change @@ -198,6 +198,20 @@ class UltravoxSession(
198
198
disconnect()
199
199
}
200
200
201
+ /* *
202
+ * Sets the agent's output medium. If the agent is currently speaking, this will take effect at
203
+ * the end of the agent's utterance. Also see [speakerMuted].
204
+ */
205
+ fun setOutputMedium (medium : Transcript .Medium ) {
206
+ if (! status.live) {
207
+ throw RuntimeException (" Cannot set output medium while not connected. Current status is $status ." )
208
+ }
209
+ val message = JSONObject ()
210
+ message.put(" type" , " set_output_medium" )
211
+ message.put(" medium" , medium.name.lowercase())
212
+ sendData(message)
213
+ }
214
+
201
215
/* * Sends a message via text. */
202
216
fun sendText (text : String ) {
203
217
if (! status.live) {
You can’t perform that action at this time.
0 commit comments