-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
41 lines (28 loc) · 1.76 KB
/
Main.java
File metadata and controls
41 lines (28 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import org.Modules.ZukiCall;
class Main{
public static void main(String[] args){
String API_KEY = ""; // Set this value to your API key.
String API_BACKUP_KEY = ""; // Set this value to your backup API key, if you have one (optional).
// The ZukiCall class handles sending and receiving messages to our LLM with the API.
ZukiCall zukiAI = new ZukiCall(API_KEY, API_BACKUP_KEY, "gpt-3.5-turbo");
// By default, the chat model is gpt-3.5 if the second constructor parameter is not defined upon initialization.
// By default, the system prompt (third constructor parameter) is "You are a helpful assistant",
// this can be changed later with .zukiChat.setSystemPrompt().
// To call the unfiltered endpoint, use .zukiChat.sendUnfilteredMessage().
// If you have a backup API endpoint, first set it as a backup using .zukiChat.changeBackupEndpoint("backup-endpoint"),
// then call .zukiChat.sendBackupMessage().
String chatResponse = zukiAI.zukiChat.sendMessage("Sabs", "Hey, how's it going?");
// Response will be printed in the console.
System.out.println("Chat Response: " + chatResponse);
// To change the temperature of the model, call .zukiChat.setTemp().
// The value by default is 0.7.
zukiAI.zukiChat.setTemp(0.5); // Example: set temperature to 0.5
String prompt = "A frustrated Java developer.";
int generations = 1;
String size = "1024x1024";
String model = "sdxl-turbo";
//You can generate images using the .generateImage() method of zukiImage:
String generatedImage = zukiAI.zukiImage.generateImage(API_KEY, prompt, generations, size, model);
System.out.println(generatedImage);
}
}