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

Commit

Permalink
优化代码结构
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanyutin753 committed Jan 3, 2024
1 parent f6f1d69 commit f5eff71
Show file tree
Hide file tree
Showing 39 changed files with 519 additions and 606 deletions.
2 changes: 1 addition & 1 deletion rearServer/.idea/compiler.xml

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

10 changes: 9 additions & 1 deletion rearServer/.idea/inspectionProfiles/Project_Default.xml

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

2 changes: 1 addition & 1 deletion rearServer/.idea/misc.xml

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

2 changes: 1 addition & 1 deletion rearServer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<artifactId>netty-common</artifactId>
<version>4.1.97.Final</version>
</dependency>
<!-- plexpt chatGpt依赖-->
<!-- plexpt chatGpt依赖-->
<dependency>
<groupId>com.github.plexpt</groupId>
<artifactId>chatgpt</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
@NoArgsConstructor
public class ChatCompletionResult {

private String id;
private String id;

private String object;
private String object;

private Long created;
private Long created;

private String model;
private String model;

private List<Choice> choices;
private List<Choice> choices;

private Usage usage;
private Usage usage;

private String system_fingerprint;
private String system_fingerprint;

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@AllArgsConstructor
Expand All @@ -25,6 +23,4 @@ public class ContentChoice {
private String finish_reason;




}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class ContentCompletion {


/**
* 仅考虑概率累积最高的 tokens,而忽略其他概率较低的 tokens。
* 仅考虑概率累积最高的 tokens,而忽略其他概率较低的 tokens。
*/
private int top_p;

Expand All @@ -54,13 +54,13 @@ public class ContentCompletion {


/**
* 是否返回每个 token 的对数概率。
* 是否返回每个 token 的对数概率。
*/
private String logprobs;


/**
* 指定在生成文本时的停止条件,即遇到哪个字符串时停止生成。
* 指定在生成文本时的停止条件,即遇到哪个字符串时停止生成。
*/
private String stop;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@NoArgsConstructor
public class Conversation {

private String model;
private String model;

private List<Message> messages;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,4 @@ public class Usage {
private long totalTokens;




}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class apiController {
*/
@Value("${deployWay}")
private String deployWay;

@Value("${pandoara_Ip}")
private String pandoara_Ip;

Expand Down Expand Up @@ -99,8 +100,7 @@ public Result addToken(@RequestBody token token) {
String res = apiService.addToken(token);
if (res.contains("成功")) {
return Result.success(res);
}
else {
} else {
return Result.error(res);
}
} catch (Exception e) {
Expand Down Expand Up @@ -130,18 +130,17 @@ public Result requiredToken(@RequestBody token token) {
}

/**
* @boby token
* @return 通过token用户名,删除(tokens.json)文件里的值
* @boby token
*/
@Log
@PutMapping("deleteToken")
public Result deleteToken(@RequestBody token token) {
try {
String res = apiService.deleteToken(token);
if(res.contains("成功")){
if (res.contains("成功")) {
return Result.success(res);
}
else{
} else {
return Result.error(res);
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public void toUpdateToken() {
* 失效变黄
* 并更新所有access_token和share_token
* 重新组成pool_token
*
* @return
*/
@GetMapping("updateAllToken")
Expand Down
Loading

0 comments on commit f5eff71

Please sign in to comment.