Skip to content

Commit 3e5e95e

Browse files
committed
🎉
1 parent f75dcad commit 3e5e95e

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/main/java/com/github/plexpt/chatgpt/Chatbot.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ public Chatbot(Map<String, String> config, String conversationId) {
3939
}
4040
}
4141

42+
public Chatbot(String sessionToken) {
43+
Map<String, String> config = new HashMap<>();
44+
config.put("session_token", sessionToken);
45+
this.parentId = UUID.randomUUID().toString();
46+
refreshSession();
47+
}
48+
4249
// Resets the conversation ID and parent ID
4350
public void resetChat() {
4451
this.conversationId = null;
@@ -292,6 +299,10 @@ public Map<String, Object> getChatResponse(String prompt, String output) {
292299
}
293300
}
294301

302+
public Map<String, Object> getChatResponse(String prompt) {
303+
return this.getChatResponse(prompt, "text");
304+
}
305+
295306

296307
@SneakyThrows
297308
public void refreshSession() {

src/main/java/com/github/plexpt/chatgpt/Message.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)