Class CustomServiceSettings.Builder
- All Implemented Interfaces:
WithJson<CustomServiceSettings.Builder>,ObjectBuilder<CustomServiceSettings>
- Enclosing class:
- CustomServiceSettings
CustomServiceSettings.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the batch size used for the semantic_text field.build()Builds aCustomServiceSettings.Specifies the HTTP header parameters – such asAuthorizationorContent-Type– that are required to access the custom service.Specifies the HTTP header parameters – such asAuthorizationorContent-Type– that are required to access the custom service.inputType(CustomServiceInputType key, String value) Specifies the input type translation values that are used to replace the${input_type}template in the request body.Specifies the input type translation values that are used to replace the${input_type}template in the request body.queryParameters(List<String> value, List<String>... values) Specifies the query parameters as a list of tuples.queryParameters(List<List<String>> list) Specifies the query parameters as a list of tuples.request(CustomRequestParams value) Required - The request configuration object.Required - The request configuration object.response(CustomResponseParams value) Required - The response configuration object.Required - The response configuration object.secretParameters(String key, String value) Required - Specifies secret parameters, likeapi_keyorapi_token, that are required to access the custom service.secretParameters(Map<String, String> map) Required - Specifies secret parameters, likeapi_keyorapi_token, that are required to access the custom service.protected CustomServiceSettings.Builderself()The URL endpoint to use for the requests.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
-
batchSize
Specifies the batch size used for the semantic_text field. If the field is not provided, the default is 10. The batch size is the maximum number of inputs in a single request to the upstream service. The chunk within the batch are controlled by the selected chunking strategy for the semantic_text field.API name:
batch_size -
headers
Specifies the HTTP header parameters – such asAuthorizationorContent-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:
headersAdds all entries of
maptoheaders. -
headers
Specifies the HTTP header parameters – such asAuthorizationorContent-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:
headersAdds an entry to
headers. -
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
searchkey will be used and the template will be replaced withdo_search. If it comes from the ingest contextdo_ingestis 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.translationcan be:classificationclusteringingestsearch
API name:
input_typeAdds all entries of
maptoinputType. -
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
searchkey will be used and the template will be replaced withdo_search. If it comes from the ingest contextdo_ingestis 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.translationcan be:classificationclusteringingestsearch
API name:
input_typeAdds an entry to
inputType. -
queryParameters
Specifies the query parameters as a list of tuples. The arrays inside thequery_parametersmust 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.coit results in:https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value.API name:
query_parametersAdds all elements of
listtoqueryParameters. -
queryParameters
public final CustomServiceSettings.Builder queryParameters(List<String> value, List<String>... values) Specifies the query parameters as a list of tuples. The arrays inside thequery_parametersmust 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.coit results in:https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value.API name:
query_parametersAdds one or more values to
queryParameters. -
request
Required - The request configuration object.API name:
request -
request
public final CustomServiceSettings.Builder request(Function<CustomRequestParams.Builder, ObjectBuilder<CustomRequestParams>> fn) Required - The request configuration object.API name:
request -
response
Required - The response configuration object.API name:
response -
response
public final CustomServiceSettings.Builder response(Function<CustomResponseParams.Builder, ObjectBuilder<CustomResponseParams>> fn) Required - The response configuration object.API name:
response -
secretParameters
Required - Specifies secret parameters, likeapi_keyorapi_token, that are required to access the custom service. For example:"secret_parameters":{ "api_key":"<api_key>" }API name:
secret_parametersAdds all entries of
maptosecretParameters. -
secretParameters
Required - Specifies secret parameters, likeapi_keyorapi_token, that are required to access the custom service. For example:"secret_parameters":{ "api_key":"<api_key>" }API name:
secret_parametersAdds an entry to
secretParameters. -
url
The URL endpoint to use for the requests.API name:
url -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<CustomServiceSettings.Builder>
-
build
Builds aCustomServiceSettings.- Specified by:
buildin interfaceObjectBuilder<CustomServiceSettings>- Throws:
NullPointerException- if some of the required fields are null.
-