Skip to content

Commit

Permalink
update GPT4-1106
Browse files Browse the repository at this point in the history
  • Loading branch information
PlexPt committed Nov 9, 2023
1 parent c3f9ae1 commit c8852b3
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 11 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ OpenAI ChatGPT 的SDK。觉得不错请右上角Star

### QQ群:645132635

### 免费5刀的帐号已被限速

### GPT4.0 API 权限帐号[购买](https://fk.fq.mk?code=YT0xJmI9Mjc%3D)
### GPT API 帐号[购买](https://fk.fq.mk?code=YT0xJmI9Mjc%3D)

# 中文语料库

Expand All @@ -25,7 +24,7 @@ OpenAI ChatGPT 的SDK。觉得不错请右上角Star

点击👇🏻传送链接,购买云服务器炼丹:

- [**阿里云服务器**](https://51015.cn/ss/3vpds)
- [**阿里云服务器特惠**](https://51015.cn/ss/3vpds)
- [**【腾讯云】云服务器,低至4.2元/月**](https://url.cn/B7m0OYnG)

# 功能特性
Expand Down Expand Up @@ -67,13 +66,13 @@ maven
<dependency>
<groupId>com.github.plexpt</groupId>
<artifactId>chatgpt</artifactId>
<version>4.1.2</version>
<version>4.2.0</version>
</dependency>
```

gradle
```
implementation group: 'com.github.plexpt', name: 'chatgpt', version: '4.1.2'
implementation group: 'com.github.plexpt', name: 'chatgpt', version: '4.2.0'
```


Expand Down
4 changes: 2 additions & 2 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ SDK for OpenAI ChatGPT. If you find it helpful, please give it a star in the upp
<dependency>
<groupId>com.github.plexpt</groupId>
<artifactId>chatgpt</artifactId>
<version>4.0.1</version>
<version>4.2.0</version>
</dependency>
```

#### gradle

```
implementation group: 'com.github.plexpt', name: 'chatgpt', version: '4.0.1'
implementation group: 'com.github.plexpt', name: 'chatgpt', version: '4.2.0'
```

### Quick Start
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.github.plexpt</groupId>
<artifactId>chatgpt</artifactId>
<version>4.1.2</version>
<version>4.2.0</version>
<name>chatgpt</name>
<description>ChatGPT4.0、 ChatGPT Java SDK.</description>
<url>https://chat.plexpt.com</url>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/plexpt/chatgpt/entity/BaseResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

/**
* @author plexpt
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class BaseResponse<T> {
private String object;
private List<T> data;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/plexpt/chatgpt/entity/chat/ChatChoice.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.plexpt.chatgpt.entity.chat;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;
Expand All @@ -8,6 +9,7 @@
* @author plexpt
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class ChatChoice {
private long index;
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.plexpt.chatgpt.entity.chat;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.plexpt.chatgpt.util.TokensUtil;
Expand Down Expand Up @@ -27,6 +28,7 @@
@AllArgsConstructor
@NoArgsConstructor(force = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ChatCompletion implements Serializable {

@NonNull
Expand Down Expand Up @@ -115,10 +117,14 @@ public enum Model {
* 临时模型,不建议使用
*/
GPT_3_5_TURBO_0301("gpt-3.5-turbo-0301"),
GPT_3_5_TURBO_1106("gpt-3.5-turbo-1106"),
GPT_3_5_TURBO_INSTRUCT("gpt-3.5-turbo-instruct"),
/**
* GPT4.0
*/
GPT_4("gpt-4"),
GPT4Turbo("gpt-4-1106-preview"),
GPT_4VP("gpt-4-vision-preview"),
/**
* 临时模型,不建议使用
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
package com.plexpt.chatgpt.entity.chat;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.plexpt.chatgpt.entity.billing.Usage;
import lombok.Data;

import java.util.List;

import lombok.Data;

/**
* chat答案类
*
* @author plexpt
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class ChatCompletionResponse {
private String id;
private String object;
private long created;
private String model;
@JsonProperty("system_fingerprint")
private String systemFingerprint;
private List<ChatChoice> choices;
private Usage usage;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.plexpt.chatgpt.entity.chat;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;
Expand All @@ -15,6 +16,7 @@
@NoArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ChatFunction {

String name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.plexpt.chatgpt.entity.chat;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FunctionCallResult {

String name;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/plexpt/chatgpt/entity/chat/Message.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.plexpt.chatgpt.entity.chat;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

Expand All @@ -17,6 +18,7 @@
@NoArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class Message {
/**
* 目前支持三种角色参考官网,进行情景输入:https://platform.openai.com/docs/guides/chat/introduction
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/plexpt/chatgpt/entity/images/Edits.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.plexpt.chatgpt.entity.images;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.plexpt.chatgpt.entity.images.enums.ResponseFormat;
import okhttp3.MediaType;
import okhttp3.RequestBody;
Expand All @@ -12,7 +13,7 @@
* @Date 2023/8/25 11:45
* @Description: TODO
*/

@JsonIgnoreProperties(ignoreUnknown = true)
public class Edits extends HashMap<String, RequestBody> {

public Edits(String prompt, int n, String size,String response_format){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.plexpt.chatgpt.entity.images;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.plexpt.chatgpt.entity.images.enums.ResponseFormat;
import lombok.AllArgsConstructor;
Expand All @@ -17,6 +18,7 @@
@NoArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class Generations {
private String prompt;
private int n;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.plexpt.chatgpt.entity.images;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.util.List;
Expand All @@ -10,6 +11,7 @@
* @Description: TODO
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class ImagesRensponse {

private String code;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.plexpt.chatgpt.entity.images;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.plexpt.chatgpt.entity.images.enums.ResponseFormat;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
Expand All @@ -15,6 +16,7 @@
* @Description: TODO
*/

@JsonIgnoreProperties(ignoreUnknown = true)
public class Variations extends HashMap<String, RequestBody> {

public Variations(int n, String size, String response_format){
Expand Down

0 comments on commit c8852b3

Please sign in to comment.