@elastic/elasticsearch 9.0.0-alpha.5 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/lib/api/api/async_search.d.ts +4 -4
  2. package/lib/api/api/autoscaling.d.ts +4 -4
  3. package/lib/api/api/bulk.d.ts +1 -1
  4. package/lib/api/api/cat.d.ts +26 -26
  5. package/lib/api/api/ccr.d.ts +13 -13
  6. package/lib/api/api/clear_scroll.d.ts +1 -1
  7. package/lib/api/api/close_point_in_time.d.ts +1 -1
  8. package/lib/api/api/cluster.d.ts +16 -16
  9. package/lib/api/api/connector.d.ts +30 -30
  10. package/lib/api/api/count.d.ts +1 -1
  11. package/lib/api/api/create.d.ts +1 -1
  12. package/lib/api/api/dangling_indices.d.ts +3 -3
  13. package/lib/api/api/delete.d.ts +1 -1
  14. package/lib/api/api/delete_by_query.d.ts +1 -1
  15. package/lib/api/api/delete_by_query_rethrottle.d.ts +1 -1
  16. package/lib/api/api/delete_script.d.ts +1 -1
  17. package/lib/api/api/enrich.d.ts +5 -5
  18. package/lib/api/api/eql.d.ts +4 -4
  19. package/lib/api/api/esql.d.ts +5 -5
  20. package/lib/api/api/esql.js +1 -3
  21. package/lib/api/api/esql.js.map +1 -1
  22. package/lib/api/api/exists.d.ts +1 -1
  23. package/lib/api/api/exists_source.d.ts +1 -1
  24. package/lib/api/api/explain.d.ts +1 -1
  25. package/lib/api/api/features.d.ts +2 -2
  26. package/lib/api/api/field_caps.d.ts +1 -1
  27. package/lib/api/api/fleet.d.ts +3 -3
  28. package/lib/api/api/get.d.ts +1 -1
  29. package/lib/api/api/get_script.d.ts +1 -1
  30. package/lib/api/api/get_script_context.d.ts +1 -1
  31. package/lib/api/api/get_script_languages.d.ts +1 -1
  32. package/lib/api/api/get_source.d.ts +1 -1
  33. package/lib/api/api/graph.d.ts +1 -1
  34. package/lib/api/api/health_report.d.ts +1 -1
  35. package/lib/api/api/ilm.d.ts +11 -11
  36. package/lib/api/api/index.d.ts +1 -1
  37. package/lib/api/api/indices.d.ts +63 -63
  38. package/lib/api/api/indices.js +2 -1
  39. package/lib/api/api/indices.js.map +1 -1
  40. package/lib/api/api/inference.d.ts +32 -39
  41. package/lib/api/api/inference.js +36 -70
  42. package/lib/api/api/inference.js.map +1 -1
  43. package/lib/api/api/info.d.ts +1 -1
  44. package/lib/api/api/ingest.d.ts +12 -12
  45. package/lib/api/api/knn_search.d.ts +5 -5
  46. package/lib/api/api/knn_search.js +6 -28
  47. package/lib/api/api/knn_search.js.map +1 -1
  48. package/lib/api/api/license.d.ts +7 -7
  49. package/lib/api/api/logstash.d.ts +3 -3
  50. package/lib/api/api/mget.d.ts +1 -1
  51. package/lib/api/api/migration.d.ts +3 -3
  52. package/lib/api/api/ml.d.ts +73 -73
  53. package/lib/api/api/monitoring.d.ts +1 -1
  54. package/lib/api/api/msearch.d.ts +1 -1
  55. package/lib/api/api/msearch_template.d.ts +1 -1
  56. package/lib/api/api/mtermvectors.d.ts +1 -1
  57. package/lib/api/api/nodes.d.ts +7 -7
  58. package/lib/api/api/open_point_in_time.d.ts +1 -1
  59. package/lib/api/api/ping.d.ts +1 -1
  60. package/lib/api/api/profiling.d.ts +4 -4
  61. package/lib/api/api/put_script.d.ts +1 -1
  62. package/lib/api/api/query_rules.d.ts +8 -8
  63. package/lib/api/api/rank_eval.d.ts +1 -1
  64. package/lib/api/api/reindex.d.ts +1 -1
  65. package/lib/api/api/reindex_rethrottle.d.ts +1 -1
  66. package/lib/api/api/render_search_template.d.ts +1 -1
  67. package/lib/api/api/rollup.d.ts +8 -8
  68. package/lib/api/api/scripts_painless_execute.d.ts +1 -1
  69. package/lib/api/api/scroll.d.ts +1 -1
  70. package/lib/api/api/search.d.ts +1 -1
  71. package/lib/api/api/search_application.d.ts +10 -10
  72. package/lib/api/api/search_mvt.d.ts +1 -1
  73. package/lib/api/api/search_shards.d.ts +1 -1
  74. package/lib/api/api/search_template.d.ts +1 -1
  75. package/lib/api/api/searchable_snapshots.d.ts +4 -4
  76. package/lib/api/api/security.d.ts +64 -64
  77. package/lib/api/api/shutdown.d.ts +3 -3
  78. package/lib/api/api/simulate.d.ts +1 -1
  79. package/lib/api/api/slm.d.ts +9 -9
  80. package/lib/api/api/snapshot.d.ts +13 -13
  81. package/lib/api/api/snapshot.js +1 -2
  82. package/lib/api/api/snapshot.js.map +1 -1
  83. package/lib/api/api/sql.d.ts +6 -6
  84. package/lib/api/api/ssl.d.ts +1 -1
  85. package/lib/api/api/synonyms.d.ts +7 -7
  86. package/lib/api/api/tasks.d.ts +3 -3
  87. package/lib/api/api/terms_enum.d.ts +1 -1
  88. package/lib/api/api/termvectors.d.ts +1 -1
  89. package/lib/api/api/text_structure.d.ts +4 -4
  90. package/lib/api/api/transform.d.ts +12 -12
  91. package/lib/api/api/update.d.ts +1 -1
  92. package/lib/api/api/update_by_query.d.ts +1 -1
  93. package/lib/api/api/update_by_query_rethrottle.d.ts +1 -1
  94. package/lib/api/api/watcher.d.ts +13 -13
  95. package/lib/api/api/xpack.d.ts +2 -2
  96. package/lib/api/types.d.ts +143 -196
  97. package/lib/client.js +17 -1
  98. package/lib/client.js.map +1 -1
  99. package/lib/helpers.d.ts +0 -6
  100. package/lib/helpers.js +2 -1
  101. package/lib/helpers.js.map +1 -1
  102. package/package.json +7 -7
@@ -18,196 +18,189 @@ export default class Inference {
18
18
  constructor(transport: Transport);
19
19
  /**
20
20
  * Perform chat completion inference
21
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-unified-inference | Elasticsearch API documentation}
21
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-unified-inference | Elasticsearch API documentation}
22
22
  */
23
23
  chatCompletionUnified(this: That, params: T.InferenceChatCompletionUnifiedRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceChatCompletionUnifiedResponse>;
24
24
  chatCompletionUnified(this: That, params: T.InferenceChatCompletionUnifiedRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceChatCompletionUnifiedResponse, unknown>>;
25
25
  chatCompletionUnified(this: That, params: T.InferenceChatCompletionUnifiedRequest, options?: TransportRequestOptions): Promise<T.InferenceChatCompletionUnifiedResponse>;
26
26
  /**
27
27
  * Perform completion inference on the service
28
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference | Elasticsearch API documentation}
28
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-inference | Elasticsearch API documentation}
29
29
  */
30
30
  completion(this: That, params: T.InferenceCompletionRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceCompletionResponse>;
31
31
  completion(this: That, params: T.InferenceCompletionRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceCompletionResponse, unknown>>;
32
32
  completion(this: That, params: T.InferenceCompletionRequest, options?: TransportRequestOptions): Promise<T.InferenceCompletionResponse>;
33
33
  /**
34
34
  * Delete an inference endpoint
35
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-delete | Elasticsearch API documentation}
35
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-delete | Elasticsearch API documentation}
36
36
  */
37
37
  delete(this: That, params: T.InferenceDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceDeleteResponse>;
38
38
  delete(this: That, params: T.InferenceDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceDeleteResponse, unknown>>;
39
39
  delete(this: That, params: T.InferenceDeleteRequest, options?: TransportRequestOptions): Promise<T.InferenceDeleteResponse>;
40
40
  /**
41
41
  * Get an inference endpoint
42
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-get | Elasticsearch API documentation}
42
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-get | Elasticsearch API documentation}
43
43
  */
44
44
  get(this: That, params?: T.InferenceGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceGetResponse>;
45
45
  get(this: That, params?: T.InferenceGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceGetResponse, unknown>>;
46
46
  get(this: That, params?: T.InferenceGetRequest, options?: TransportRequestOptions): Promise<T.InferenceGetResponse>;
47
47
  /**
48
- * Perform a chat completion task through the Elastic Inference Service (EIS). Perform a chat completion inference task with the `elastic` service.
49
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis-chat-completion | Elasticsearch API documentation}
48
+ * Perform inference on the service. This API enables you to use machine learning models to perform specific tasks on data that you provide as an input. It returns a response with the results of the tasks. The inference endpoint you use can perform one specific task that has been defined when the endpoint was created with the create inference API. For details about using this API with a service, such as Amazon Bedrock, Anthropic, or HuggingFace, refer to the service-specific documentation. > info > The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.
49
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-inference | Elasticsearch API documentation}
50
50
  */
51
- postEisChatCompletion(this: That, params: T.InferencePostEisChatCompletionRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePostEisChatCompletionResponse>;
52
- postEisChatCompletion(this: That, params: T.InferencePostEisChatCompletionRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePostEisChatCompletionResponse, unknown>>;
53
- postEisChatCompletion(this: That, params: T.InferencePostEisChatCompletionRequest, options?: TransportRequestOptions): Promise<T.InferencePostEisChatCompletionResponse>;
51
+ inference(this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceInferenceResponse>;
52
+ inference(this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceInferenceResponse, unknown>>;
53
+ inference(this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptions): Promise<T.InferenceInferenceResponse>;
54
54
  /**
55
55
  * Create an inference endpoint. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.
56
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put | Elasticsearch API documentation}
56
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put | Elasticsearch API documentation}
57
57
  */
58
58
  put(this: That, params: T.InferencePutRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutResponse>;
59
59
  put(this: That, params: T.InferencePutRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutResponse, unknown>>;
60
60
  put(this: That, params: T.InferencePutRequest, options?: TransportRequestOptions): Promise<T.InferencePutResponse>;
61
61
  /**
62
62
  * Create an AlibabaCloud AI Search inference endpoint. Create an inference endpoint to perform an inference task with the `alibabacloud-ai-search` service. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
63
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-alibabacloud | Elasticsearch API documentation}
63
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-alibabacloud | Elasticsearch API documentation}
64
64
  */
65
65
  putAlibabacloud(this: That, params: T.InferencePutAlibabacloudRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutAlibabacloudResponse>;
66
66
  putAlibabacloud(this: That, params: T.InferencePutAlibabacloudRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutAlibabacloudResponse, unknown>>;
67
67
  putAlibabacloud(this: That, params: T.InferencePutAlibabacloudRequest, options?: TransportRequestOptions): Promise<T.InferencePutAlibabacloudResponse>;
68
68
  /**
69
69
  * Create an Amazon Bedrock inference endpoint. Creates an inference endpoint to perform an inference task with the `amazonbedrock` service. >info > You need to provide the access and secret keys only once, during the inference model creation. The get inference API does not retrieve your access or secret keys. After creating the inference model, you cannot change the associated key pairs. If you want to use a different access and secret key pair, delete the inference model and recreate it with the same name and the updated keys. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
70
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonbedrock | Elasticsearch API documentation}
70
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-amazonbedrock | Elasticsearch API documentation}
71
71
  */
72
72
  putAmazonbedrock(this: That, params: T.InferencePutAmazonbedrockRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutAmazonbedrockResponse>;
73
73
  putAmazonbedrock(this: That, params: T.InferencePutAmazonbedrockRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutAmazonbedrockResponse, unknown>>;
74
74
  putAmazonbedrock(this: That, params: T.InferencePutAmazonbedrockRequest, options?: TransportRequestOptions): Promise<T.InferencePutAmazonbedrockResponse>;
75
75
  /**
76
76
  * Create an Anthropic inference endpoint. Create an inference endpoint to perform an inference task with the `anthropic` service. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
77
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-anthropic | Elasticsearch API documentation}
77
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-anthropic | Elasticsearch API documentation}
78
78
  */
79
79
  putAnthropic(this: That, params: T.InferencePutAnthropicRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutAnthropicResponse>;
80
80
  putAnthropic(this: That, params: T.InferencePutAnthropicRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutAnthropicResponse, unknown>>;
81
81
  putAnthropic(this: That, params: T.InferencePutAnthropicRequest, options?: TransportRequestOptions): Promise<T.InferencePutAnthropicResponse>;
82
82
  /**
83
83
  * Create an Azure AI studio inference endpoint. Create an inference endpoint to perform an inference task with the `azureaistudio` service. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
84
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureaistudio | Elasticsearch API documentation}
84
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-azureaistudio | Elasticsearch API documentation}
85
85
  */
86
86
  putAzureaistudio(this: That, params: T.InferencePutAzureaistudioRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutAzureaistudioResponse>;
87
87
  putAzureaistudio(this: That, params: T.InferencePutAzureaistudioRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutAzureaistudioResponse, unknown>>;
88
88
  putAzureaistudio(this: That, params: T.InferencePutAzureaistudioRequest, options?: TransportRequestOptions): Promise<T.InferencePutAzureaistudioResponse>;
89
89
  /**
90
90
  * Create an Azure OpenAI inference endpoint. Create an inference endpoint to perform an inference task with the `azureopenai` service. The list of chat completion models that you can choose from in your Azure OpenAI deployment include: * [GPT-4 and GPT-4 Turbo models](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions#gpt-4-and-gpt-4-turbo-models) * [GPT-3.5](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions#gpt-35) The list of embeddings models that you can choose from in your deployment can be found in the [Azure models documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions#embeddings). When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
91
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureopenai | Elasticsearch API documentation}
91
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-azureopenai | Elasticsearch API documentation}
92
92
  */
93
93
  putAzureopenai(this: That, params: T.InferencePutAzureopenaiRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutAzureopenaiResponse>;
94
94
  putAzureopenai(this: That, params: T.InferencePutAzureopenaiRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutAzureopenaiResponse, unknown>>;
95
95
  putAzureopenai(this: That, params: T.InferencePutAzureopenaiRequest, options?: TransportRequestOptions): Promise<T.InferencePutAzureopenaiResponse>;
96
96
  /**
97
97
  * Create a Cohere inference endpoint. Create an inference endpoint to perform an inference task with the `cohere` service. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
98
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-cohere | Elasticsearch API documentation}
98
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-cohere | Elasticsearch API documentation}
99
99
  */
100
100
  putCohere(this: That, params: T.InferencePutCohereRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutCohereResponse>;
101
101
  putCohere(this: That, params: T.InferencePutCohereRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutCohereResponse, unknown>>;
102
102
  putCohere(this: That, params: T.InferencePutCohereRequest, options?: TransportRequestOptions): Promise<T.InferencePutCohereResponse>;
103
- /**
104
- * Create an Elastic Inference Service (EIS) inference endpoint. Create an inference endpoint to perform an inference task through the Elastic Inference Service (EIS).
105
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-eis | Elasticsearch API documentation}
106
- */
107
- putEis(this: That, params: T.InferencePutEisRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutEisResponse>;
108
- putEis(this: That, params: T.InferencePutEisRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutEisResponse, unknown>>;
109
- putEis(this: That, params: T.InferencePutEisRequest, options?: TransportRequestOptions): Promise<T.InferencePutEisResponse>;
110
103
  /**
111
104
  * Create an Elasticsearch inference endpoint. Create an inference endpoint to perform an inference task with the `elasticsearch` service. > info > Your Elasticsearch deployment contains preconfigured ELSER and E5 inference endpoints, you only need to create the enpoints using the API if you want to customize the settings. If you use the ELSER or the E5 model through the `elasticsearch` service, the API request will automatically download and deploy the model if it isn't downloaded yet. > info > You might see a 502 bad gateway error in the response when using the Kibana Console. This error usually just reflects a timeout, while the model downloads in the background. You can check the download progress in the Machine Learning UI. If using the Python client, you can set the timeout parameter to a higher value. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
112
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elasticsearch | Elasticsearch API documentation}
105
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-elasticsearch | Elasticsearch API documentation}
113
106
  */
114
107
  putElasticsearch(this: That, params: T.InferencePutElasticsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutElasticsearchResponse>;
115
108
  putElasticsearch(this: That, params: T.InferencePutElasticsearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutElasticsearchResponse, unknown>>;
116
109
  putElasticsearch(this: That, params: T.InferencePutElasticsearchRequest, options?: TransportRequestOptions): Promise<T.InferencePutElasticsearchResponse>;
117
110
  /**
118
111
  * Create an ELSER inference endpoint. Create an inference endpoint to perform an inference task with the `elser` service. You can also deploy ELSER by using the Elasticsearch inference integration. > info > Your Elasticsearch deployment contains a preconfigured ELSER inference endpoint, you only need to create the enpoint using the API if you want to customize the settings. The API request will automatically download and deploy the ELSER model if it isn't already downloaded. > info > You might see a 502 bad gateway error in the response when using the Kibana Console. This error usually just reflects a timeout, while the model downloads in the background. You can check the download progress in the Machine Learning UI. If using the Python client, you can set the timeout parameter to a higher value. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
119
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elser | Elasticsearch API documentation}
112
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-elser | Elasticsearch API documentation}
120
113
  */
121
114
  putElser(this: That, params: T.InferencePutElserRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutElserResponse>;
122
115
  putElser(this: That, params: T.InferencePutElserRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutElserResponse, unknown>>;
123
116
  putElser(this: That, params: T.InferencePutElserRequest, options?: TransportRequestOptions): Promise<T.InferencePutElserResponse>;
124
117
  /**
125
118
  * Create an Google AI Studio inference endpoint. Create an inference endpoint to perform an inference task with the `googleaistudio` service. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
126
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-googleaistudio | Elasticsearch API documentation}
119
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-googleaistudio | Elasticsearch API documentation}
127
120
  */
128
121
  putGoogleaistudio(this: That, params: T.InferencePutGoogleaistudioRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutGoogleaistudioResponse>;
129
122
  putGoogleaistudio(this: That, params: T.InferencePutGoogleaistudioRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutGoogleaistudioResponse, unknown>>;
130
123
  putGoogleaistudio(this: That, params: T.InferencePutGoogleaistudioRequest, options?: TransportRequestOptions): Promise<T.InferencePutGoogleaistudioResponse>;
131
124
  /**
132
125
  * Create a Google Vertex AI inference endpoint. Create an inference endpoint to perform an inference task with the `googlevertexai` service. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
133
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-googlevertexai | Elasticsearch API documentation}
126
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-googlevertexai | Elasticsearch API documentation}
134
127
  */
135
128
  putGooglevertexai(this: That, params: T.InferencePutGooglevertexaiRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutGooglevertexaiResponse>;
136
129
  putGooglevertexai(this: That, params: T.InferencePutGooglevertexaiRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutGooglevertexaiResponse, unknown>>;
137
130
  putGooglevertexai(this: That, params: T.InferencePutGooglevertexaiRequest, options?: TransportRequestOptions): Promise<T.InferencePutGooglevertexaiResponse>;
138
131
  /**
139
132
  * Create a Hugging Face inference endpoint. Create an inference endpoint to perform an inference task with the `hugging_face` service. You must first create an inference endpoint on the Hugging Face endpoint page to get an endpoint URL. Select the model you want to use on the new endpoint creation page (for example `intfloat/e5-small-v2`), then select the sentence embeddings task under the advanced configuration section. Create the endpoint and copy the URL after the endpoint initialization has been finished. The following models are recommended for the Hugging Face service: * `all-MiniLM-L6-v2` * `all-MiniLM-L12-v2` * `all-mpnet-base-v2` * `e5-base-v2` * `e5-small-v2` * `multilingual-e5-base` * `multilingual-e5-small` When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
140
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-hugging-face | Elasticsearch API documentation}
133
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-hugging-face | Elasticsearch API documentation}
141
134
  */
142
135
  putHuggingFace(this: That, params: T.InferencePutHuggingFaceRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutHuggingFaceResponse>;
143
136
  putHuggingFace(this: That, params: T.InferencePutHuggingFaceRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutHuggingFaceResponse, unknown>>;
144
137
  putHuggingFace(this: That, params: T.InferencePutHuggingFaceRequest, options?: TransportRequestOptions): Promise<T.InferencePutHuggingFaceResponse>;
145
138
  /**
146
139
  * Create an JinaAI inference endpoint. Create an inference endpoint to perform an inference task with the `jinaai` service. To review the available `rerank` models, refer to <https://jina.ai/reranker>. To review the available `text_embedding` models, refer to the <https://jina.ai/embeddings/>. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
147
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-jinaai | Elasticsearch API documentation}
140
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-jinaai | Elasticsearch API documentation}
148
141
  */
149
142
  putJinaai(this: That, params: T.InferencePutJinaaiRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutJinaaiResponse>;
150
143
  putJinaai(this: That, params: T.InferencePutJinaaiRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutJinaaiResponse, unknown>>;
151
144
  putJinaai(this: That, params: T.InferencePutJinaaiRequest, options?: TransportRequestOptions): Promise<T.InferencePutJinaaiResponse>;
152
145
  /**
153
146
  * Create a Mistral inference endpoint. Creates an inference endpoint to perform an inference task with the `mistral` service. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
154
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-mistral | Elasticsearch API documentation}
147
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-mistral | Elasticsearch API documentation}
155
148
  */
156
149
  putMistral(this: That, params: T.InferencePutMistralRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutMistralResponse>;
157
150
  putMistral(this: That, params: T.InferencePutMistralRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutMistralResponse, unknown>>;
158
151
  putMistral(this: That, params: T.InferencePutMistralRequest, options?: TransportRequestOptions): Promise<T.InferencePutMistralResponse>;
159
152
  /**
160
- * Create an OpenAI inference endpoint. Create an inference endpoint to perform an inference task with the `openai` service or `openai` compatible APIs. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
161
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-openai | Elasticsearch API documentation}
153
+ * Create an OpenAI inference endpoint. Create an inference endpoint to perform an inference task with the `openai` service. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
154
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-openai | Elasticsearch API documentation}
162
155
  */
163
156
  putOpenai(this: That, params: T.InferencePutOpenaiRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutOpenaiResponse>;
164
157
  putOpenai(this: That, params: T.InferencePutOpenaiRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutOpenaiResponse, unknown>>;
165
158
  putOpenai(this: That, params: T.InferencePutOpenaiRequest, options?: TransportRequestOptions): Promise<T.InferencePutOpenaiResponse>;
166
159
  /**
167
160
  * Create a VoyageAI inference endpoint. Create an inference endpoint to perform an inference task with the `voyageai` service. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
168
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-voyageai | Elasticsearch API documentation}
161
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-voyageai | Elasticsearch API documentation}
169
162
  */
170
163
  putVoyageai(this: That, params: T.InferencePutVoyageaiRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutVoyageaiResponse>;
171
164
  putVoyageai(this: That, params: T.InferencePutVoyageaiRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutVoyageaiResponse, unknown>>;
172
165
  putVoyageai(this: That, params: T.InferencePutVoyageaiRequest, options?: TransportRequestOptions): Promise<T.InferencePutVoyageaiResponse>;
173
166
  /**
174
167
  * Create a Watsonx inference endpoint. Create an inference endpoint to perform an inference task with the `watsonxai` service. You need an IBM Cloud Databases for Elasticsearch deployment to use the `watsonxai` inference service. You can provision one through the IBM catalog, the Cloud Databases CLI plug-in, the Cloud Databases API, or Terraform. When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for `"state": "fully_allocated"` in the response and ensure that the `"allocation_count"` matches the `"target_allocation_count"`. Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
175
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-watsonx | Elasticsearch API documentation}
168
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put-watsonx | Elasticsearch API documentation}
176
169
  */
177
170
  putWatsonx(this: That, params: T.InferencePutWatsonxRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferencePutWatsonxResponse>;
178
171
  putWatsonx(this: That, params: T.InferencePutWatsonxRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferencePutWatsonxResponse, unknown>>;
179
172
  putWatsonx(this: That, params: T.InferencePutWatsonxRequest, options?: TransportRequestOptions): Promise<T.InferencePutWatsonxResponse>;
180
173
  /**
181
174
  * Perform rereanking inference on the service
182
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference | Elasticsearch API documentation}
175
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-inference | Elasticsearch API documentation}
183
176
  */
184
177
  rerank(this: That, params: T.InferenceRerankRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceRerankResponse>;
185
178
  rerank(this: That, params: T.InferenceRerankRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceRerankResponse, unknown>>;
186
179
  rerank(this: That, params: T.InferenceRerankRequest, options?: TransportRequestOptions): Promise<T.InferenceRerankResponse>;
187
180
  /**
188
181
  * Perform sparse embedding inference on the service
189
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference | Elasticsearch API documentation}
182
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-inference | Elasticsearch API documentation}
190
183
  */
191
184
  sparseEmbedding(this: That, params: T.InferenceSparseEmbeddingRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceSparseEmbeddingResponse>;
192
185
  sparseEmbedding(this: That, params: T.InferenceSparseEmbeddingRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceSparseEmbeddingResponse, unknown>>;
193
186
  sparseEmbedding(this: That, params: T.InferenceSparseEmbeddingRequest, options?: TransportRequestOptions): Promise<T.InferenceSparseEmbeddingResponse>;
194
187
  /**
195
188
  * Perform streaming inference. Get real-time responses for completion tasks by delivering answers incrementally, reducing response times during computation. This API works only with the completion task type. IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs. This API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege). You must use a client that supports streaming.
196
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-stream-inference | Elasticsearch API documentation}
189
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-stream-inference | Elasticsearch API documentation}
197
190
  */
198
191
  streamCompletion(this: That, params: T.InferenceStreamCompletionRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceStreamCompletionResponse>;
199
192
  streamCompletion(this: That, params: T.InferenceStreamCompletionRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceStreamCompletionResponse, unknown>>;
200
193
  streamCompletion(this: That, params: T.InferenceStreamCompletionRequest, options?: TransportRequestOptions): Promise<T.InferenceStreamCompletionResponse>;
201
194
  /**
202
195
  * Perform text embedding inference on the service
203
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference | Elasticsearch API documentation}
196
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-inference | Elasticsearch API documentation}
204
197
  */
205
198
  textEmbedding(this: That, params: T.InferenceTextEmbeddingRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceTextEmbeddingResponse>;
206
199
  textEmbedding(this: That, params: T.InferenceTextEmbeddingRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceTextEmbeddingResponse, unknown>>;
207
200
  textEmbedding(this: That, params: T.InferenceTextEmbeddingRequest, options?: TransportRequestOptions): Promise<T.InferenceTextEmbeddingResponse>;
208
201
  /**
209
202
  * Update an inference endpoint. Modify `task_settings`, secrets (within `service_settings`), or `num_allocations` for an inference endpoint, depending on the specific endpoint service and `task_type`. IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.
210
- * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-update | Elasticsearch API documentation}
203
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-update | Elasticsearch API documentation}
211
204
  */
212
205
  update(this: That, params: T.InferenceUpdateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceUpdateResponse>;
213
206
  update(this: That, params: T.InferenceUpdateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.InferenceUpdateResponse, unknown>>;
@@ -63,14 +63,19 @@ class Inference {
63
63
  body: [],
64
64
  query: []
65
65
  },
66
- 'inference.post_eis_chat_completion': {
66
+ 'inference.inference': {
67
67
  path: [
68
- 'eis_inference_id'
68
+ 'task_type',
69
+ 'inference_id'
69
70
  ],
70
71
  body: [
71
- 'chat_completion_request'
72
+ 'query',
73
+ 'input',
74
+ 'task_settings'
72
75
  ],
73
- query: []
76
+ query: [
77
+ 'timeout'
78
+ ]
74
79
  },
75
80
  'inference.put': {
76
81
  path: [
@@ -160,17 +165,6 @@ class Inference {
160
165
  ],
161
166
  query: []
162
167
  },
163
- 'inference.put_eis': {
164
- path: [
165
- 'task_type',
166
- 'eis_inference_id'
167
- ],
168
- body: [
169
- 'service',
170
- 'service_settings'
171
- ],
172
- query: []
173
- },
174
168
  'inference.put_elasticsearch': {
175
169
  path: [
176
170
  'task_type',
@@ -524,16 +518,25 @@ class Inference {
524
518
  };
525
519
  return await this.transport.request({ path, method, querystring, body, meta }, options);
526
520
  }
527
- async postEisChatCompletion(params, options) {
528
- var _a;
529
- const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.post_eis_chat_completion'];
521
+ async inference(params, options) {
522
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.inference'];
530
523
  const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
531
524
  const querystring = userQuery != null ? { ...userQuery } : {};
532
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
525
+ let body;
526
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
527
+ if (userBody != null) {
528
+ if (typeof userBody === 'string') {
529
+ body = userBody;
530
+ }
531
+ else {
532
+ body = { ...userBody };
533
+ }
534
+ }
533
535
  for (const key in params) {
534
536
  if (acceptedBody.includes(key)) {
537
+ body = body !== null && body !== void 0 ? body : {};
535
538
  // @ts-expect-error
536
- body = params[key];
539
+ body[key] = params[key];
537
540
  }
538
541
  else if (acceptedPath.includes(key)) {
539
542
  continue;
@@ -550,12 +553,21 @@ class Inference {
550
553
  }
551
554
  }
552
555
  }
553
- const method = 'POST';
554
- const path = `/_inference/chat_completion/${encodeURIComponent(params.eis_inference_id.toString())}/_stream`;
556
+ let method = '';
557
+ let path = '';
558
+ if (params.task_type != null && params.inference_id != null) {
559
+ method = 'POST';
560
+ path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}`;
561
+ }
562
+ else {
563
+ method = 'POST';
564
+ path = `/_inference/${encodeURIComponent(params.inference_id.toString())}`;
565
+ }
555
566
  const meta = {
556
- name: 'inference.post_eis_chat_completion',
567
+ name: 'inference.inference',
557
568
  pathParts: {
558
- eis_inference_id: params.eis_inference_id
569
+ task_type: params.task_type,
570
+ inference_id: params.inference_id
559
571
  }
560
572
  };
561
573
  return await this.transport.request({ path, method, querystring, body, meta }, options);
@@ -881,52 +893,6 @@ class Inference {
881
893
  };
882
894
  return await this.transport.request({ path, method, querystring, body, meta }, options);
883
895
  }
884
- async putEis(params, options) {
885
- const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_eis'];
886
- const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
887
- const querystring = userQuery != null ? { ...userQuery } : {};
888
- let body;
889
- const userBody = params === null || params === void 0 ? void 0 : params.body;
890
- if (userBody != null) {
891
- if (typeof userBody === 'string') {
892
- body = userBody;
893
- }
894
- else {
895
- body = { ...userBody };
896
- }
897
- }
898
- for (const key in params) {
899
- if (acceptedBody.includes(key)) {
900
- body = body !== null && body !== void 0 ? body : {};
901
- // @ts-expect-error
902
- body[key] = params[key];
903
- }
904
- else if (acceptedPath.includes(key)) {
905
- continue;
906
- }
907
- else if (key !== 'body' && key !== 'querystring') {
908
- if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
909
- // @ts-expect-error
910
- querystring[key] = params[key];
911
- }
912
- else {
913
- body = body !== null && body !== void 0 ? body : {};
914
- // @ts-expect-error
915
- body[key] = params[key];
916
- }
917
- }
918
- }
919
- const method = 'PUT';
920
- const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.eis_inference_id.toString())}`;
921
- const meta = {
922
- name: 'inference.put_eis',
923
- pathParts: {
924
- task_type: params.task_type,
925
- eis_inference_id: params.eis_inference_id
926
- }
927
- };
928
- return await this.transport.request({ path, method, querystring, body, meta }, options);
929
- }
930
896
  async putElasticsearch(params, options) {
931
897
  const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_elasticsearch'];
932
898
  const userQuery = params === null || params === void 0 ? void 0 : params.querystring;