Auto-generated API code (#2678)

This commit is contained in:
Elastic Machine
2025-03-24 19:19:59 +02:00
committed by GitHub
parent e502d2f17a
commit 2d75e0a16c
2 changed files with 45 additions and 1 deletions

View File

@ -7287,7 +7287,7 @@ To unset a version, replace the template without specifying one.
** *`create` (Optional, boolean)*: If true, this request cannot replace or update existing index templates.
** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. If no response is
received before the timeout expires, the request fails and returns an error.
** *`cause` (Optional, string)*
** *`cause` (Optional, string)*: User defined reason for creating/updating the index template
[discrete]
==== recovery
@ -8097,6 +8097,17 @@ NOTE: The `chat_completion` task type only supports streaming and only through t
** *`service` (Enum("elastic"))*: The type of service supported for the specified task type. In this case, `elastic`.
** *`service_settings` ({ model_id, rate_limit })*: Settings used to install the inference model. These settings are specific to the `elastic` service.
[discrete]
==== put_mistral
Configure a Mistral inference endpoint
{ref}/infer-service-mistral.html[Endpoint documentation]
[source,ts]
----
client.inference.putMistral()
----
[discrete]
==== put_openai
Create an OpenAI inference endpoint.

View File

@ -306,6 +306,39 @@ export default class Inference {
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* Configure a Mistral inference endpoint
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.x/infer-service-mistral.html | Elasticsearch API documentation}
*/
async putMistral (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async putMistral (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async putMistral (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async putMistral (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['task_type', 'mistral_inference_id']
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.mistral_inference_id.toString())}`
const meta: TransportRequestMetadata = {
name: 'inference.put_mistral',
pathParts: {
task_type: params.task_type,
mistral_inference_id: params.mistral_inference_id
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}
/**
* 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.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.x/infer-service-openai.html | Elasticsearch API documentation}