Class ContentFilterCompletionTextSpan

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

public final class ContentFilterCompletionTextSpan extends Object implements com.azure.json.JsonSerializable<ContentFilterCompletionTextSpan>
Describes a span within generated completion text. Offset 0 is the first UTF32 code point of the completion text.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of ContentFilterCompletionTextSpan from the JsonReader.
    int
    Get the completionEndOffset property: Offset of the first UTF32 code point which is excluded from the span.
    int
    Get the completionStartOffset property: Offset of the UTF32 code point which begins the span.
    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
  • Method Details

    • getCompletionStartOffset

      public int getCompletionStartOffset()
      Get the completionStartOffset property: Offset of the UTF32 code point which begins the span.
      Returns:
      the completionStartOffset value.
    • getCompletionEndOffset

      public int getCompletionEndOffset()
      Get the completionEndOffset property: Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans.
      Returns:
      the completionEndOffset value.
    • toJson

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

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