This repository has been archived by the owner on Apr 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
86 changed files
with
344 additions
and
394 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
rearServer/src/main/java/com/tokensTool/pandoraNext/chat/ChatCompletionResult.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
rearServer/src/main/java/com/tokensTool/pandoraNext/chat/Choice.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
rearServer/src/main/java/com/tokensTool/pandoraNext/chat/ContentChoice.java
This file was deleted.
Oops, something went wrong.
67 changes: 0 additions & 67 deletions
67
rearServer/src/main/java/com/tokensTool/pandoraNext/chat/ContentCompletion.java
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
rearServer/src/main/java/com/tokensTool/pandoraNext/chat/ContentResult.java
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
rearServer/src/main/java/com/tokensTool/pandoraNext/chat/Conversation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
rearServer/src/main/java/com/tokensTool/pandoraNext/chat/Message.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.tokensTool.pandoraNext.chat; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import lombok.*; | ||
|
||
/** | ||
* @author plexpt | ||
*/ | ||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class Message { | ||
/** | ||
* 目前支持三种角色参考官网,进行情景输入:https://platform.openai.com/docs/guides/chat/introduction | ||
*/ | ||
private String role; | ||
private String content; | ||
private String name; | ||
|
||
|
||
public Message(String role, String content) { | ||
this.role = role; | ||
this.content = content; | ||
} | ||
|
||
public static Message of(String content) { | ||
|
||
return new Message(Message.Role.USER.getValue(), content); | ||
} | ||
|
||
public static Message ofSystem(String content) { | ||
|
||
return new Message(Role.SYSTEM.getValue(), content); | ||
} | ||
|
||
public static Message ofAssistant(String content) { | ||
|
||
return new Message(Role.ASSISTANT.getValue(), content); | ||
} | ||
|
||
public static Message ofFunction(String function) { | ||
|
||
return new Message(Role.FUNCTION.getValue(), function); | ||
} | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum Role { | ||
|
||
SYSTEM("system"), | ||
USER("user"), | ||
ASSISTANT("assistant"), | ||
|
||
FUNCTION("function"), | ||
; | ||
private String value; | ||
} | ||
|
||
} |
34 changes: 0 additions & 34 deletions
34
rearServer/src/main/java/com/tokensTool/pandoraNext/chat/Usage.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.