Inference
- class elasticsearch.client.InferenceClient(client)
- Parameters:
client (BaseClient)
- delete(*, inference_id, task_type=None, error_trace=None, filter_path=None, human=None, pretty=None)
Delete an inference endpoint
https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html
- Parameters:
- Return type:
ObjectApiResponse[Any]
- get(*, task_type=None, inference_id=None, error_trace=None, filter_path=None, human=None, pretty=None)
Get an inference endpoint
https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html
- Parameters:
- Return type:
ObjectApiResponse[Any]
- inference(*, inference_id, input=None, task_type=None, error_trace=None, filter_path=None, human=None, pretty=None, query=None, task_settings=None, timeout=None, body=None)
Perform inference
https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html
- Parameters:
inference_id (str) – The inference Id
input (str | Sequence[str] | None) – Inference input. Either a string or an array of strings.
task_type (Literal['completion', 'rerank', 'sparse_embedding', 'text_embedding'] | str | None) – The task type
query (str | None) – Query input, required for rerank task. Not required for other tasks.
task_settings (Any | None) – Optional task settings
timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Specifies the amount of time to wait for the inference request to complete.
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
ObjectApiResponse[Any]
- put(*, inference_id, inference_config=None, body=None, task_type=None, error_trace=None, filter_path=None, human=None, pretty=None)
Configure an inference endpoint for use in the Inference API
https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html