Class StreamingChatChoiceUpdate

java.lang.Object
com.azure.ai.inference.models.StreamingChatChoiceUpdate
All Implemented Interfaces:
com.azure.json.JsonSerializable<StreamingChatChoiceUpdate>

public final class StreamingChatChoiceUpdate extends Object implements com.azure.json.JsonSerializable<StreamingChatChoiceUpdate>
Represents an update to a single prompt completion when the service is streaming updates using Server Sent Events (SSE). Generally, `n` choices are generated per provided prompt with a default value of 1. Token limits and other settings may limit the number of choices generated.
  • Method Details

    • getIndex

      public int getIndex()
      Get the index property: The ordered index associated with this chat completions choice.
      Returns:
      the index value.
    • getFinishReason

      public CompletionsFinishReason getFinishReason()
      Get the finishReason property: The reason that this chat completions choice completed its generated.
      Returns:
      the finishReason value.
    • getDelta

      Get the delta property: An update to the chat message for a given chat completions prompt.
      Returns:
      the delta value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<StreamingChatChoiceUpdate>
      Throws:
      IOException
    • fromJson

      public static StreamingChatChoiceUpdate fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of StreamingChatChoiceUpdate from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of StreamingChatChoiceUpdate if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the StreamingChatChoiceUpdate.