Package com.azure.ai.openai.models
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 TypeMethodDescriptionfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ContentFilterCompletionTextSpan from the JsonReader.intGet the completionEndOffset property: Offset of the first UTF32 code point which is excluded from the span.intGet the completionStartOffset property: Offset of the UTF32 code point which begins the span.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
-
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
- Specified by:
toJsonin interfacecom.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.
-