Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

反序列化报错 #79

Closed
CCc3120 opened this issue Mar 22, 2023 · 5 comments
Closed

反序列化报错 #79

CCc3120 opened this issue Mar 22, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@CCc3120
Copy link

CCc3120 commented Mar 22, 2023

对象转成json传输后反序列化报错

image
@test
public void testJson() throws JsonProcessingException {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(SerializationFeature.INDENT_OUTPUT, true)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.setTimeZone(TimeZone.getTimeZone("GMT+8"))
.setLocale(Locale.CHINA);

    Completion completion = Completion.builder().prompt("你好啊").build();


    String jsonStr = objectMapper.writeValueAsString(completion);

    Completion completion1 = objectMapper.readValue(jsonStr, Completion.class);

}
@1018987534
Copy link

什么时候可以支持GPT4,目前1.0.6的model还是没有4,.0

@Grt1228
Copy link
Owner

Grt1228 commented Mar 23, 2023

什么时候可以支持GPT4,目前1.0.6的model还是没有4,.0

gpt4目前官方没有开放api。
如果你已经加入了官方的api使用用户列表,那么现在的1.0.6已经支持Gpt-4,只需要在构建Completion或者Completion的时候自定义模型即可
Completion completion = Completion.builder().prompt("你好啊").model("传入gpt4模型").build();
模型参考下面的Model:
https://github.com/Grt1228/chatgpt-java/blob/main/src/main/java/com/unfbx/chatgpt/entity/chat/ChatCompletion.java/

@1018987534
Copy link

什么时候可以支持GPT4,目前1.0.6的model还是没有4,.0

gpt4目前官方没有开放api。 如果你已经加入了官方的api使用用户列表,那么现在的1.0.6已经支持Gpt-4,只需要在构建Completion或者Completion的时候自定义模型即可 Completion completion = Completion.builder().prompt("你好啊").model("传入gpt4模型").build(); 模型参考下面的Model: https://github.com/Grt1228/chatgpt-java/blob/main/src/main/java/com/unfbx/chatgpt/entity/chat/ChatCompletion.java/

通过maven引用的还是只有GPT3.5两个模型,是不是没有发布到中央仓库

@Grt1228
Copy link
Owner

Grt1228 commented Mar 23, 2023

什么时候可以支持GPT4,目前1.0.6的model还是没有4,.0

gpt4目前官方没有开放api。 如果你已经加入了官方的api使用用户列表,那么现在的1.0.6已经支持Gpt-4,只需要在构建Completion或者Completion的时候自定义模型即可 Completion completion = Completion.builder().prompt("你好啊").model("传入gpt4模型").build(); 模型参考下面的Model: https://github.com/Grt1228/chatgpt-java/blob/main/src/main/java/com/unfbx/chatgpt/entity/chat/ChatCompletion.java/

通过maven引用的还是只有GPT3.5两个模型,是不是没有发布到中央仓库

下个版本1.0.7会增加枚举值

@Grt1228 Grt1228 added the bug Something isn't working label Mar 23, 2023
@Grt1228
Copy link
Owner

Grt1228 commented Mar 23, 2023

已修复更新:1.0.7

@Grt1228 Grt1228 closed this as completed Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants