Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
PandoraNext-tokensTool v 0.6.6版本
Browse files Browse the repository at this point in the history
优化代码,使用jdk 17
  • Loading branch information
Yanyutin753 committed Jan 15, 2024
1 parent 08d87c3 commit 8f0d1fb
Show file tree
Hide file tree
Showing 86 changed files with 344 additions and 394 deletions.
3 changes: 2 additions & 1 deletion rearServer/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions rearServer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.15</version>
<version>3.2.1</version>
<relativePath/>
</parent>
<groupId>com.yyandywt99</groupId>
Expand All @@ -14,7 +14,7 @@
<name>pandoraNext</name>
<description>pandoraNext</description>
<properties>
<java.version>11</java.version>
<java.version>17</java.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -43,6 +43,12 @@
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<!-- 不然jwt报错依赖-->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<!-- aop-->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -59,11 +65,10 @@
<artifactId>docker-java</artifactId>
<version>3.2.10</version>
</dependency>
<!-- plexpt chatGpt依赖-->
<!-- okhttp依赖-->
<dependency>
<groupId>com.github.plexpt</groupId>
<artifactId>chatgpt</artifactId>
<version>4.3.0</version>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public void recordLog() {
log.info(controller.reloadContainer().toString());
} catch (Exception e) {
e.printStackTrace();
log.info("热重载失败!");
log.error("热重载失败!");
}
} else {
log.info("热重载未开启!");
log.error("热重载未开启!");
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.tokensTool.pandoraNext.chat;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.plexpt.chatgpt.entity.chat.Message;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down
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;
}

}

This file was deleted.

Loading

0 comments on commit 8f0d1fb

Please sign in to comment.