Package com.azure.ai.inference.models
Class StreamingChatCompletionsUpdate
java.lang.Object
com.azure.ai.inference.models.StreamingChatCompletionsUpdate
- All Implemented Interfaces:
com.azure.json.JsonSerializable<StreamingChatCompletionsUpdate>
public final class StreamingChatCompletionsUpdate
extends Object
implements com.azure.json.JsonSerializable<StreamingChatCompletionsUpdate>
Represents a response update to a chat completions request, when the service is streaming updates
using Server Sent Events (SSE).
Completions support a wide variety of tasks and generate text that continues from or "completes"
provided prompt data.
-
Method Summary
Modifier and TypeMethodDescriptionfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of StreamingChatCompletionsUpdate from the JsonReader.Get the choice property: The chat choice associated with this completion response.Get the choices property: An update to the collection of completion choices associated with this completions response.Get the created property: The first timestamp associated with generation activity for this completions response, represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970.getId()Get the id property: A unique identifier associated with this chat completions response.getModel()Get the model property: The model used for the chat completion.getUsage()Get the usage property: Usage information for tokens processed and generated as part of this completions operation.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Method Details
-
getId
Get the id property: A unique identifier associated with this chat completions response.- Returns:
- the id value.
-
getCreated
Get the created property: The first timestamp associated with generation activity for this completions response, represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970.- Returns:
- the created value.
-
getModel
Get the model property: The model used for the chat completion.- Returns:
- the model value.
-
getUsage
Get the usage property: Usage information for tokens processed and generated as part of this completions operation.- Returns:
- the usage value.
-
getChoices
Get the choices property: An update to the collection of completion choices associated with this completions response. 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.- Returns:
- the choices value.
-
getChoice
Get the choice property: The chat choice associated with this completion response.- Returns:
- the choice value.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<StreamingChatCompletionsUpdate>- Throws:
IOException
-
fromJson
public static StreamingChatCompletionsUpdate fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of StreamingChatCompletionsUpdate from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of StreamingChatCompletionsUpdate 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 StreamingChatCompletionsUpdate.
-