diff --git a/example/src/main/java/example/OpenAiApiFunctionsExample.java b/example/src/main/java/example/OpenAiApiFunctionsExample.java index c9141405..954b9104 100644 --- a/example/src/main/java/example/OpenAiApiFunctionsExample.java +++ b/example/src/main/java/example/OpenAiApiFunctionsExample.java @@ -42,7 +42,7 @@ public static void main(String... args) { String token = System.getenv("OPENAI_TOKEN"); OpenAiService service = new OpenAiService(token); - FunctionExecutor functionExecutor = new FunctionExecutor(List.of(ChatFunction.builder() + FunctionExecutor functionExecutor = new FunctionExecutor(Collections.singletonList(ChatFunction.builder() .name("get_weather") .description("Get the current weather of a location") .executor(Weather.class, w -> new WeatherResponse(w.location, w.unit, new Random().nextInt(50), "sunny")) diff --git a/example/src/main/java/example/OpenAiApiFunctionsWithStreamExample.java b/example/src/main/java/example/OpenAiApiFunctionsWithStreamExample.java index 36dfc796..e6de65b6 100644 --- a/example/src/main/java/example/OpenAiApiFunctionsWithStreamExample.java +++ b/example/src/main/java/example/OpenAiApiFunctionsWithStreamExample.java @@ -16,7 +16,7 @@ public static void main(String... args) { String token = System.getenv("OPENAI_TOKEN"); OpenAiService service = new OpenAiService(token); - FunctionExecutor functionExecutor = new FunctionExecutor(List.of(ChatFunction.builder() + FunctionExecutor functionExecutor = new FunctionExecutor(Collections.singletonList(ChatFunction.builder() .name("get_weather") .description("Get the current weather of a location") .executor(Weather.class, w -> new WeatherResponse(w.location, w.unit, new Random().nextInt(50), "sunny"))