Module org.elasticsearch.server
Record Class ContentObject.ContentObjectFile.ContentObjectFileFields
java.lang.Object
java.lang.Record
org.elasticsearch.inference.completion.ContentObject.ContentObjectFile.ContentObjectFileFields
- Record Components:
fileData- the data of the filefileId- the ID of the filefilename- the name of the file
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
- Enclosing class:
ContentObject.ContentObjectFile
public static record ContentObject.ContentObjectFile.ContentObjectFileFields(String fileData, String fileId, String filename)
extends Record
implements Writeable, ToXContentObject
Represents the fields of a file content object in a unified completion request.
Includes the file data, file ID, and filename.
The file_id field is not currently supported, but is part of the OpenAI schema,
so it is treated as optional for serialization.
Since file_id is not supported, file_data and filename are effectively required,
even though they are optional in the OpenAI schema.
They are also treated as optional for serialization, to allow future support for file_id
without needing a new transport version or worrying about backward compatibility.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionContentObjectFileFields(String fileData, String fileId, String filename) Creates an instance of aContentObjectFileFieldsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.fileData()Returns the value of thefileDatarecord component.fileId()Returns the value of thefileIdrecord component.filename()Returns the value of thefilenamerecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
Method Details
-
fromMap
public static ContentObject.ContentObjectFile.ContentObjectFileFields fromMap(Map<String, Object> map) -
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
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). -
fileData
Returns the value of thefileDatarecord component.- Returns:
- the value of the
fileDatarecord component
-
fileId
Returns the value of thefileIdrecord component.- Returns:
- the value of the
fileIdrecord component
-
filename
Returns the value of thefilenamerecord component.- Returns:
- the value of the
filenamerecord component
-