Record Class OpenAiApi.ChatCompletionRequest.StreamOptions
java.lang.Object
java.lang.Record
org.springframework.ai.openai.api.OpenAiApi.ChatCompletionRequest.StreamOptions
- Record Components:
includeUsage
- If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request, and the choices field will always be an empty array. All other chunks will also include a usage field, but with a null value.
- Enclosing class:
- OpenAiApi.ChatCompletionRequest
public static record OpenAiApi.ChatCompletionRequest.StreamOptions(Boolean includeUsage)
extends Record
Options for streaming response.
-
Field Summary
Modifier and TypeFieldDescription -
Constructor Summary
ConstructorDescriptionStreamOptions
(Boolean includeUsage) Creates an instance of aStreamOptions
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theincludeUsage
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
INCLUDE_USAGE
-
-
Constructor Details
-
StreamOptions
Creates an instance of aStreamOptions
record class.- Parameters:
includeUsage
- the value for theincludeUsage
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
includeUsage
Returns the value of theincludeUsage
record component.- Returns:
- the value of the
includeUsage
record component
-