Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-generated code for 8.18 #2680

Merged
merged 1 commit into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Auto-generated API code
  • Loading branch information
elasticmachine committed Mar 24, 2025
commit b7a6b32e7a0c5783a32977d06ef1d251ad3afe48
13 changes: 12 additions & 1 deletion docs/reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7283,7 +7283,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
Expand Down Expand Up @@ -8093,6 +8093,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.
Expand Down
33 changes: 33 additions & 0 deletions src/api/api/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.18/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.18/infer-service-openai.html | Elasticsearch API documentation}
Expand Down