specification/inference/put/PutRequest.ts (21 lines of code) (raw):
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { InferenceEndpoint } from '@inference/_types/Services'
import { TaskType } from '@inference/_types/TaskType'
import { RequestBase } from '@_types/Base'
import { Id } from '@_types/common'
/**
* Create an inference endpoint.
*
* 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.
* @rest_spec_name inference.put
* @availability stack since=8.11.0 stability=stable visibility=public
* @availability serverless stability=stable visibility=public
* @cluster_privileges manage_inference
* @doc_id inference-api-put
*/
export interface Request extends RequestBase {
urls: [
{
path: '/_inference/{inference_id}'
methods: ['PUT']
},
{
path: '/_inference/{task_type}/{inference_id}'
methods: ['PUT']
}
]
path_parts: {
/**
* The task type
*/
task_type?: TaskType
/**
* The inference Id
*/
inference_id: Id
}
/** @codegen_name inference_config */
body: InferenceEndpoint
}