Skip to content

Commit

Permalink
Merge pull request HamaWhiteGG#145 from HamaWhiteGG/dev
Browse files Browse the repository at this point in the history
Fix Bug: Incorrect Type for logprobs Field in CompletionResp Class HamaWhiteGG#144
  • Loading branch information
HamaWhiteGG authored Dec 6, 2023
2 parents 7869715 + 58b8738 commit 9f8ba2c
Show file tree
Hide file tree
Showing 2 changed files with 45 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,44 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

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 9f8ba2c

Please sign in to comment.