-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also inform server of client_version (and api_version), use new transcript messages, expose all data messages, and add tests in CI. This matches fixie-ai/ultravox-client-sdk-flutter#11
- Loading branch information
Showing
6 changed files
with
171 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Test | ||
run: | | ||
chmod +x gradlew | ||
./gradlew test --stacktrace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
ultravox_client/src/test/java/ai/ultravox/ClientVersionCheckTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package ai.ultravox; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotNull; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.JUnit4; | ||
|
||
import java.nio.file.FileSystems; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
@RunWith(JUnit4.class) | ||
public class ClientVersionCheckTest { | ||
private static final Pattern VERSION_LINE_PATTERN = | ||
Pattern.compile("^\\s+version = \"(?<version>[0-9.]+)\"\\s*$"); | ||
|
||
@Test | ||
public void checkSdkVersion_matchesGradle() throws Exception { | ||
Path path = FileSystems.getDefault().getPath("").resolveSibling("build.gradle.kts"); | ||
String gradleSdkVersion = null; | ||
for (String line : Files.readAllLines(path)) { | ||
Matcher matcher = VERSION_LINE_PATTERN.matcher(line); | ||
if (matcher.matches()) { | ||
gradleSdkVersion = matcher.group("version"); | ||
break; | ||
} | ||
} | ||
assertNotNull("Failed to find SDK version from Gradle", gradleSdkVersion); | ||
assertEquals(gradleSdkVersion, UltravoxSession.ULTRAVOX_SDK_VERSION); | ||
} | ||
} |