Fix OpenAiApi changes and VertexAiIT
This commit is contained in:
@@ -528,12 +528,63 @@ public class OpenAiApi {
|
||||
* @param finishReason The reason the model stopped generating tokens.
|
||||
* @param index The index of the choice in the list of choices.
|
||||
* @param delta A chat completion delta generated by streamed model responses.
|
||||
* @param logprobs Log probability information for the choice.
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public record ChunkChoice(
|
||||
@JsonProperty("finish_reason") ChatCompletionFinishReason finishReason,
|
||||
@JsonProperty("index") Integer index,
|
||||
@JsonProperty("delta") ChatCompletionMessage delta) {
|
||||
@JsonProperty("delta") ChatCompletionMessage delta,
|
||||
@JsonProperty("logprobs") LogProbs logprobs) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Log probability information for the choice.
|
||||
*
|
||||
* @param content A list of message content tokens with log probability information.
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public record LogProbs(
|
||||
@JsonProperty("content") List<Content> content) {
|
||||
|
||||
/**
|
||||
* Message content tokens with log probability information.
|
||||
*
|
||||
* @param token The token.
|
||||
* @param logprob The log probability of the token.
|
||||
* @param probBytes A list of integers representing the UTF-8 bytes representation
|
||||
* of the token. Useful in instances where characters are represented by multiple
|
||||
* tokens and their byte representations must be combined to generate the correct
|
||||
* text representation. Can be null if there is no bytes representation for the token.
|
||||
* @param topLogprobs List of the most likely tokens and their log probability,
|
||||
* at this token position. In rare cases, there may be fewer than the number of
|
||||
* requested top_logprobs returned.
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public record Content(
|
||||
@JsonProperty("token") String token,
|
||||
@JsonProperty("logprob") Float logprob,
|
||||
@JsonProperty("bytes") List<Integer> probBytes,
|
||||
@JsonProperty("top_logprobs") List<TopLogProbs> topLogprobs
|
||||
) {
|
||||
|
||||
/**
|
||||
* The most likely tokens and their log probability, at this token position.
|
||||
*
|
||||
* @param token The token.
|
||||
* @param logprob The log probability of the token.
|
||||
* @param probBytes A list of integers representing the UTF-8 bytes representation
|
||||
* of the token. Useful in instances where characters are represented by multiple
|
||||
* tokens and their byte representations must be combined to generate the correct
|
||||
* text representation. Can be null if there is no bytes representation for the token.
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public record TopLogProbs(
|
||||
@JsonProperty("token") String token,
|
||||
@JsonProperty("logprob") Float logprob,
|
||||
@JsonProperty("bytes") List<Integer> probBytes) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ public class VertexAiApiIT {
|
||||
|
||||
System.out.println(model);
|
||||
assertThat(model).isNotNull();
|
||||
assertThat(model.displayName()).isEqualTo("Chat Bison");
|
||||
assertThat(model.displayName()).isEqualTo("PaLM 2 Chat (Legacy)");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user