-
Notifications
You must be signed in to change notification settings - Fork 109
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
[BUG] Incorrect Type for logprobs Field in CompletionResp Class #144
Comments
Thank you for the detailed description. I just submitted the code to fix it. Add Class LogProbs: @Data
public class LogProbs {
List<String> tokens;
@JsonProperty("token_logprobs")
List<Double> tokenLogprobs;
@JsonProperty("top_logprobs")
List<Map<String, Double>> topLogprobs;
@JsonProperty("text_offset")
List<Integer> textOffset;
} |
Fix Bug: Incorrect Type for logprobs Field in CompletionResp Class #144
Thank you for your efforts in updating the code. However, I noticed that the recent changes might still not align with the OpenAI official documentation. According to the OpenAI API documentation, the logprobs field is an integer in the request object but an object in the response. In your latest commit, the LogProbs class seems to be designed with several lists, which may not fully comply with the OpenAI documentation's definition for the request object. I recommend reviewing the OpenAI API documentation again to ensure that the implementation of the logprobs field in the response matches the official documentation. This will help avoid potential serialization or deserialization issues in the future. Thank you for your contribution to the project, and I hope this suggestion is helpful. |
Thank you so much for your prompt and effective resolution to this issue. |
Describe the bug
When I request the /v1/completions api, i got a exception which says the JSON response seems to have logprobs as an object (START_OBJECT token), but the Java code is expecting an integer value (Cannot deserialize instance of java.lang.Integer``).
Log and Stack trace
exception details :
To Reproduce
just request the /v1/completions openai api.
Expected behavior
expeted bahavior is none exception with a success response.
Please complete the following information:
Additional context
this openai api reference snapshot.
The text was updated successfully, but these errors were encountered: