Class PredictionContent

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

public final class PredictionContent extends Object implements com.azure.json.JsonSerializable<PredictionContent>
Static predicted output content, such as the content of a text file that is being regenerated.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PredictionContent(com.azure.core.util.BinaryData content)
    Creates an instance of PredictionContent class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of PredictionContent from the JsonReader.
    com.azure.core.util.BinaryData
    Get the content property: The content that should be matched when generating a model response.
    Get the type property: The type of the predicted content you want to provide.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • PredictionContent

      public PredictionContent(com.azure.core.util.BinaryData content)
      Creates an instance of PredictionContent class.
      Parameters:
      content - the content value to set.
  • Method Details

    • getType

      public PredictionContentType getType()
      Get the type property: The type of the predicted content you want to provide. This type is currently always `content`.
      Returns:
      the type value.
    • getContent

      public com.azure.core.util.BinaryData getContent()
      Get the content property: The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly.
      Returns:
      the content value.
    • toJson

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

      public static PredictionContent fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of PredictionContent from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of PredictionContent 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 PredictionContent.