All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.theokanning.openai.completion.LogProbResult Maven / Gradle / Ivy

There is a newer version: 0.18.2
Show newest version
package com.theokanning.openai.completion;

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

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

/**
 * Log probabilities of different token options
 * Returned if {@link CompletionRequest#logprobs} is greater than zero
 *
 * https://beta.openai.com/docs/api-reference/create-completion
 */
@Data
public class LogProbResult {

    /**
     * The tokens chosen by the completion api
     */
    List tokens;

    /**
     * The log probability of each token in {@link tokens}
     */
    @JsonProperty("token_logprobs")
    List tokenLogprobs;

    /**
     * A map for each index in the completion result.
     * The map contains the top {@link CompletionRequest#logprobs} tokens and their probabilities
     */
    @JsonProperty("top_logprobs")
    List> topLogprobs;

    /**
     * The character offset from the start of the returned text for each of the chosen tokens.
     */
    List textOffset;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy