Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 210c25b

Browse filesBrowse files
committed
Update examples to use Collections.singletonList
List.of isn't compatible with java 8
1 parent ccc1024 commit 210c25b
Copy full SHA for 210c25b

File tree

Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed

‎example/src/main/java/example/OpenAiApiFunctionsExample.java

Copy file name to clipboardExpand all lines: example/src/main/java/example/OpenAiApiFunctionsExample.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static void main(String... args) {
4242
String token = System.getenv("OPENAI_TOKEN");
4343
OpenAiService service = new OpenAiService(token);
4444

45-
FunctionExecutor functionExecutor = new FunctionExecutor(List.of(ChatFunction.builder()
45+
FunctionExecutor functionExecutor = new FunctionExecutor(Collections.singletonList(ChatFunction.builder()
4646
.name("get_weather")
4747
.description("Get the current weather of a location")
4848
.executor(Weather.class, w -> new WeatherResponse(w.location, w.unit, new Random().nextInt(50), "sunny"))

‎example/src/main/java/example/OpenAiApiFunctionsWithStreamExample.java

Copy file name to clipboardExpand all lines: example/src/main/java/example/OpenAiApiFunctionsWithStreamExample.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static void main(String... args) {
1616
String token = System.getenv("OPENAI_TOKEN");
1717
OpenAiService service = new OpenAiService(token);
1818

19-
FunctionExecutor functionExecutor = new FunctionExecutor(List.of(ChatFunction.builder()
19+
FunctionExecutor functionExecutor = new FunctionExecutor(Collections.singletonList(ChatFunction.builder()
2020
.name("get_weather")
2121
.description("Get the current weather of a location")
2222
.executor(Weather.class, w -> new WeatherResponse(w.location, w.unit, new Random().nextInt(50), "sunny"))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.