Class ContentObject.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<ContentObject.Builder>
co.elastic.clients.elasticsearch.inference.ContentObject.Builder
- All Implemented Interfaces:
WithJson<ContentObject.Builder>,ObjectBuilder<ContentObject>
- Enclosing class:
- ContentObject
public static class ContentObject.Builder
extends WithJsonObjectBuilderBase<ContentObject.Builder>
implements ObjectBuilder<ContentObject>
Builder for
ContentObject.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aContentObject.final ContentObject.Builderfile(FileContent value) Required - The file content.final ContentObject.BuilderRequired - The file content.final ContentObject.BuilderRequired - The image content.final ContentObject.BuilderRequired - The image content.protected ContentObject.Builderself()final ContentObject.BuilderRequired - The text content.final ContentObject.Buildertype(ContentType value) Required - The type of content.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
type
Required - The type of content. Must be one oftext,image_urlorfile. Not all services/models support content types other than "text"API name:
type -
text
Required - The text content. Only applicable for thetexttypeAPI name:
text -
imageUrl
Required - The image content. Only applicable for theimage_urltypeAPI name:
image_url -
imageUrl
Required - The image content. Only applicable for theimage_urltypeAPI name:
image_url -
file
Required - The file content. Only applicable for thefiletypeAPI name:
file -
file
public final ContentObject.Builder file(Function<FileContent.Builder, ObjectBuilder<FileContent>> fn) Required - The file content. Only applicable for thefiletypeAPI name:
file -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<ContentObject.Builder>
-
build
Builds aContentObject.- Specified by:
buildin interfaceObjectBuilder<ContentObject>- Throws:
NullPointerException- if some of the required fields are null.
-