diff --git a/README-zh.md b/README-zh.md index 0328362..47ac266 100644 --- a/README-zh.md +++ b/README-zh.md @@ -21,14 +21,14 @@ OpenAi4J是一个非官方的Java库,旨在帮助java开发者与OpenAI的GPT ## 导入依赖 ### Gradle -`implementation 'io.github.lambdua::0.22.92'` +`implementation 'io.github.lambdua::0.22.93'` ### Maven ```xml io.github.lambdua service - 0.22.92 + 0.22.93 ``` @@ -61,7 +61,7 @@ static void simpleChat() { io.github.lambdua api - 0.22.92 + 0.22.93 ``` diff --git a/README.md b/README.md index 2ad7007..e3319a1 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,14 @@ applications effortlessly. ## Import ### Gradle -`implementation 'io.github.lambdua::0.22.92'` +`implementation 'io.github.lambdua::0.22.93'` ### Maven ```xml io.github.lambdua service - 0.22.92 + 0.22.93 ``` @@ -67,7 +67,7 @@ To utilize pojos, import the api module: io.github.lambdua api - 0.22.92 + 0.22.93 ``` diff --git a/api/pom.xml b/api/pom.xml index 2a7a610..2f966c2 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -6,7 +6,7 @@ io.github.lambdua openai-java - 0.22.92 + 0.22.93 jar api diff --git a/api/src/main/java/com/theokanning/openai/audio/CreateSpeechRequest.java b/api/src/main/java/com/theokanning/openai/audio/CreateSpeechRequest.java index 80f9590..9a60f02 100644 --- a/api/src/main/java/com/theokanning/openai/audio/CreateSpeechRequest.java +++ b/api/src/main/java/com/theokanning/openai/audio/CreateSpeechRequest.java @@ -37,4 +37,6 @@ public class CreateSpeechRequest { * The speed of the generated audio. Select a value from 0.25 to 4.0. Defaults to 1.0. */ Double speed; + + String instructions; } diff --git a/client/pom.xml b/client/pom.xml index 86b448b..64ab4ae 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -6,7 +6,7 @@ io.github.lambdua openai-java - 0.22.92 + 0.22.93 jar diff --git a/example/pom.xml b/example/pom.xml index 135176c..65c6d4e 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -6,7 +6,7 @@ io.github.lambdua example - 0.22.92 + 0.22.93 example @@ -17,7 +17,7 @@ io.github.lambdua service - 0.22.92 + 0.22.93 diff --git a/pom.xml b/pom.xml index abf3e05..4137b35 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.github.lambdua openai-java - 0.22.92 + 0.22.93 pom openai java 版本 https://github.com/Lambdua/openai-java diff --git a/service/pom.xml b/service/pom.xml index 7abb611..94cfb96 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -6,7 +6,7 @@ io.github.lambdua openai-java - 0.22.92 + 0.22.93 jar diff --git a/service/src/test/java/com/theokanning/openai/service/AudioTest.java b/service/src/test/java/com/theokanning/openai/service/AudioTest.java index 6371770..956a553 100644 --- a/service/src/test/java/com/theokanning/openai/service/AudioTest.java +++ b/service/src/test/java/com/theokanning/openai/service/AudioTest.java @@ -85,4 +85,19 @@ void createSpeech() throws IOException { assertEquals(MediaType.get("audio/mpeg"), speech.contentType()); assertTrue(speech.bytes().length > 0); } + + @Test + void createSpeechWithInstructions() throws IOException { + CreateSpeechRequest createSpeechRequest = CreateSpeechRequest.builder() + .model("tts-1") + .input("Hello World.") + .voice("alloy") + .instructions("Please read the text in a normal voice.") + .build(); + + final ResponseBody speech = service.createSpeech(createSpeechRequest); + assertNotNull(speech); + assertEquals(MediaType.get("audio/mpeg"), speech.contentType()); + assertTrue(speech.bytes().length > 0); + } }