Class CustomServiceSettings

java.lang.Object
co.elastic.clients.elasticsearch.inference.CustomServiceSettings
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class CustomServiceSettings extends Object implements JsonpSerializable
See Also:
  • Field Details

  • Method Details

    • of

    • headers

      @Nullable public final JsonData headers()
      Specifies the HTTPS header parameters – such as Authentication or Contet-Type – that are required to access the custom service. For example:
       "headers":{
         "Authorization": "Bearer ${api_key}",
         "Content-Type": "application/json;charset=utf-8"
       }
       
       

      API name: headers

    • inputType

      @Nullable public final JsonData inputType()
      Specifies the input type translation values that are used to replace the ${input_type} template in the request body. For example:
       "input_type": {
         "translation": {
           "ingest": "do_ingest",
           "search": "do_search"
         },
         "default": "a_default"
       },
       
       

      If the subsequent inference requests come from a search context, the search key will be used and the template will be replaced with do_search. If it comes from the ingest context do_ingest is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used. translation can be:

      • classification
      • clustering
      • ingest
      • search

      API name: input_type

    • queryParameters

      @Nullable public final JsonData queryParameters()
      Specifies the query parameters as a list of tuples. The arrays inside the query_parameters must have two items, a key and a value. For example:
       "query_parameters":[
         ["param_key", "some_value"],
         ["param_key", "another_value"],
         ["other_key", "other_value"]
       ]
       
       

      If the base url is https://www.elastic.co it results in: https://www.elastic.co?param_key=some_value&param_key=another_value&other_key=other_value.

      API name: query_parameters

    • request

      public final CustomRequestParams request()
      Required - The request configuration object.

      API name: request

    • response

      public final CustomResponseParams response()
      Required - The response configuration object.

      API name: response

    • secretParameters

      public final JsonData secretParameters()
      Required - Specifies secret parameters, like api_key or api_token, that are required to access the custom service. For example:
       "secret_parameters":{
         "api_key":"<api_key>"
       }
       
       

      API name: secret_parameters

    • url

      @Nullable public final String url()
      The URL endpoint to use for the requests.

      API name: url

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setupCustomServiceSettingsDeserializer

      protected static void setupCustomServiceSettingsDeserializer(ObjectDeserializer<CustomServiceSettings.Builder> op)