Skip to content

Commit

Permalink
Fix Bug: Incorrect Type for logprobs Field in CompletionResp Class Ha…
Browse files Browse the repository at this point in the history
  • Loading branch information
HamaWhiteGG committed Dec 6, 2023
1 parent 9965a78 commit 2a580b8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Choice {

private Integer index;

private Integer logprobs;
private LogProbs logprobs;

@JsonProperty("finish_reason")
private String finishReason;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.hw.openai.entity.completions;

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

import java.util.List;
import java.util.Map;

/**
* @author HamaWhite
*/
@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;
}

0 comments on commit 2a580b8

Please sign in to comment.