Class InferenceConfigCreate

java.lang.Object
co.elastic.clients.elasticsearch.ml.InferenceConfigCreate
All Implemented Interfaces:
JsonpSerializable, TaggedUnion<InferenceConfigCreate.Kind,​java.lang.Object>

@JsonpDeserializable
public class InferenceConfigCreate
extends java.lang.Object
implements TaggedUnion<InferenceConfigCreate.Kind,​java.lang.Object>, JsonpSerializable
Inference configuration provided when storing the model config
See Also:
API specification
  • Field Details

  • Constructor Details

  • Method Details

    • _kind

      public final InferenceConfigCreate.Kind _kind()
      Description copied from interface: TaggedUnion
      Get the of the kind of variant held by this object.
      Specified by:
      _kind in interface TaggedUnion<InferenceConfigCreate.Kind,​java.lang.Object>
      Returns:
      the variant kind
    • _get

      public final java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<InferenceConfigCreate.Kind,​java.lang.Object>
    • of

      public static InferenceConfigCreate of​(java.util.function.Function<InferenceConfigCreate.Builder,​ObjectBuilder<InferenceConfigCreate>> fn)
    • isRegression

      public boolean isRegression()
      Is this variant instance of kind regression?
    • regression

      public RegressionInferenceOptions regression()
      Get the regression variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the regression kind.
    • isClassification

      public boolean isClassification()
      Is this variant instance of kind classification?
    • classification

      public ClassificationInferenceOptions classification()
      Get the classification variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the classification kind.
    • isTextClassification

      public boolean isTextClassification()
      Is this variant instance of kind text_classification?
    • textClassification

      public TextClassificationInferenceOptions textClassification()
      Get the text_classification variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the text_classification kind.
    • isZeroShotClassification

      public boolean isZeroShotClassification()
      Is this variant instance of kind zero_shot_classification?
    • zeroShotClassification

      public ZeroShotClassificationInferenceOptions zeroShotClassification()
      Get the zero_shot_classification variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the zero_shot_classification kind.
    • isFillMask

      public boolean isFillMask()
      Is this variant instance of kind fill_mask?
    • fillMask

      public FillMaskInferenceOptions fillMask()
      Get the fill_mask variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the fill_mask kind.
    • isNer

      public boolean isNer()
      Is this variant instance of kind ner?
    • ner

      public NerInferenceOptions ner()
      Get the ner variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the ner kind.
    • isPassThrough

      public boolean isPassThrough()
      Is this variant instance of kind pass_through?
    • passThrough

      public PassThroughInferenceOptions passThrough()
      Get the pass_through variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the pass_through kind.
    • isTextEmbedding

      public boolean isTextEmbedding()
      Is this variant instance of kind text_embedding?
    • textEmbedding

      public TextEmbeddingInferenceOptions textEmbedding()
      Get the text_embedding variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the text_embedding kind.
    • isQuestionAnswering

      public boolean isQuestionAnswering()
      Is this variant instance of kind question_answering?
    • questionAnswering

      public QuestionAnsweringInferenceOptions questionAnswering()
      Get the question_answering variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the question_answering kind.
    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • setupInferenceConfigCreateDeserializer

      protected static void setupInferenceConfigCreateDeserializer​(ObjectDeserializer<InferenceConfigCreate.Builder> op)