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 47ee441

Browse filesBrowse files
csoltenbornChristian Soltenborn
and
Christian Soltenborn
authored
added timeout duration to service instantiation for demonstration purposes (TheoKanning#341)
Co-authored-by: Christian Soltenborn <christian.soltenborn@fhdw.de>
1 parent 038e42c commit 47ee441
Copy full SHA for 47ee441

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+2
-1
lines changed

‎example/src/main/java/example/OpenAiApiExample.java

Copy file name to clipboardExpand all lines: example/src/main/java/example/OpenAiApiExample.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
import com.theokanning.openai.completion.CompletionRequest;
88
import com.theokanning.openai.image.CreateImageRequest;
99

10+
import java.time.Duration;
1011
import java.util.ArrayList;
1112
import java.util.HashMap;
1213
import java.util.List;
1314

1415
class OpenAiApiExample {
1516
public static void main(String... args) {
1617
String token = System.getenv("OPENAI_TOKEN");
17-
OpenAiService service = new OpenAiService(token);
18+
OpenAiService service = new OpenAiService(token, Duration.ofSeconds(30));
1819

1920
System.out.println("\nCreating completion...");
2021
CompletionRequest completionRequest = CompletionRequest.builder()

0 commit comments

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