Inference
- class elasticsearch.client.InferenceClient(client)
- Parameters:
client (BaseClient) –
- delete_model(*, task_type, model_id, error_trace=None, filter_path=None, human=None, pretty=None)
Delete model in the Inference API
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-inference-api.html
- Parameters:
- Return type:
ObjectApiResponse[Any]
- get_model(*, task_type, model_id, error_trace=None, filter_path=None, human=None, pretty=None)
Get a model in the Inference API
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-inference-api.html
- Parameters:
- Return type:
ObjectApiResponse[Any]
- inference(*, task_type, model_id, input=None, error_trace=None, filter_path=None, human=None, pretty=None, task_settings=None, body=None)
Perform inference on a model
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/post-inference-api.html
- Parameters:
task_type (Literal['sparse_embedding', 'text_embedding'] | str) – The model task type
model_id (str) – The unique identifier of the inference model.
input (str | Sequence[str] | None) – Text input to the model. Either a string or an array of strings.
task_settings (Any | None) – Optional task settings
error_trace (bool | None) –
human (bool | None) –
pretty (bool | None) –
- Return type:
ObjectApiResponse[Any]
- put_model(*, task_type, model_id, error_trace=None, filter_path=None, human=None, model_config=None, body=None, pretty=None)
Configure a model for use in the Inference API
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/put-inference-api.html