openai-java icon indicating copy to clipboard operation
openai-java copied to clipboard

add empty constructor in ChatCompletionRequest

Open huajiayi opened this issue 2 years ago • 6 comments

image

i encounter a parsing problem when i use jackson, it seems like ChatCompletionRequest should have a empty constructor so that Jackson can correctly parse it. so please add empty constructor in ChatCompletionRequest.

huajiayi avatar Mar 03 '23 14:03 huajiayi

i would like to contribute could you assign this task to me

Akshayp02 avatar Mar 04 '23 16:03 Akshayp02

Just a commment though. lombok.Data should create a no args constructor automagically. I suspect it's not a code problem.

@Data

@huajiayi Can you confirm you have lombok installed correctly in your build environment?

cryptoapebot avatar Mar 04 '23 22:03 cryptoapebot

I'll install it on my env but we have to only add one no args constructor in ChatComplationRequest file

Akshayp02 avatar Mar 05 '23 02:03 Akshayp02

Just a commment though. lombok.Data should create a no args constructor automagically. I suspect it's not a code problem.

@DaTa

@huajiayi Can you confirm you have lombok installed correctly in your build environment?

I have installed the lombok, but actually it doesn't work, so i have to write a MyChatComplationRequest to fix thie problem, but it is only a temporary solution.

huajiayi avatar Mar 05 '23 12:03 huajiayi

Then for permanent solution what to do should I help.

Akshayp02 avatar Mar 05 '23 14:03 Akshayp02

Then for permanent solution what to do should I help.

https://github.com/TheoKanning/openai-java/pull/151 seems like someone have submitted a pr for this issue.

huajiayi avatar Mar 05 '23 14:03 huajiayi