Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
410 changes: 334 additions & 76 deletions output/schema/schema.json

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion specification/_doc_ids/table.csv
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ data-stream-update,https://www.elastic.co/docs/api/doc/elasticsearch/operation/o
data-streams,https://www.elastic.co/docs/manage-data/data-store/data-streams,
date-index-name-processor,https://www.elastic.co/docs/reference/enrich-processor/date-index-name-processor,
dcg,https://www.elastic.co/docs/reference/elasticsearch/rest-apis/search-rank-eval#_discounted_cumulative_gain_dcg,
deepseek-api-keys,https://api-docs.deepseek.com/,
defining-roles,https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/defining-roles,
delete-analytics-collection,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete-behavioral-analytics,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-analytics-collection.html
delete-async-sql-search-api,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-delete-async,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-async-sql-search-api.html
Expand Down Expand Up @@ -354,6 +355,7 @@ inference-api-put-anthropic,https://www.elastic.co/docs/api/doc/elasticsearch/op
inference-api-put-azureaistudio,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureaistudio,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-azure-ai-studio.html
inference-api-put-azureopenai,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureopenai,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-azure-openai.html
inference-api-put-cohere,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-cohere,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-cohere.html
inference-api-put-deepseek,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-deepseek,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-deepseek.html
inference-api-put-eis,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-eis,
inference-api-put-elasticsearch,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elasticsearch,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-elasticsearch.html
inference-api-put-elser,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elser,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-elser.html
Expand Down Expand Up @@ -924,4 +926,4 @@ watcher-api-update-settings,https://www.elastic.co/docs/api/doc/elasticsearch/op
watsonx-api-keys,https://cloud.ibm.com/iam/apikeys,
watsonx-api-models,https://www.ibm.com/products/watsonx-ai/foundation-models,
watsonx-api-version,https://cloud.ibm.com/apidocs/watsonx-ai#active-version-dates,
xpack-rollup,https://www.elastic.co/docs/manage-data/lifecycle/rollup,
xpack-rollup,https://www.elastic.co/docs/manage-data/lifecycle/rollup,
33 changes: 33 additions & 0 deletions specification/inference/_types/CommonTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,39 @@ export class EisServiceSettings {
rate_limit?: RateLimitSetting
}

export class DeepSeekServiceSettings {
/**
* A valid API key for your DeepSeek account.
* You can find or create your DeepSeek API keys on the DeepSeek API key page.
*
* IMPORTANT: You need to provide the API key only once, during the inference model creation.
* The get inference endpoint API does not retrieve your API key.
* After creating the inference model, you cannot change the associated API key.
* If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.
* @ext_doc_id deepseek-api-keys
*/
api_key: string
/**
* For a `completion` or `chat_completion` task, the name of the model to use for the inference task.
*
* * For the available `completion` and `chat_completion` models, refer to the [DeepSeek Models & Pricing docs](https://api-docs.deepseek.com/quick_start/pricing).
*/
model_id: string
/**
* The URL endpoint to use for the requests. Defaults to `https://api.deepseek.com/chat/completions`.
*/
url?: string
}

export enum DeepSeekTaskType {
completion,
chat_completion
}

export enum DeepSeekServiceType {
deepseek
}

export enum EisTaskType {
chat_completion
}
Expand Down
12 changes: 12 additions & 0 deletions specification/inference/_types/Services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
TaskTypeAzureAIStudio,
TaskTypeAzureOpenAI,
TaskTypeCohere,
TaskTypeDeepSeek,
TaskTypeElasticsearch,
TaskTypeELSER,
TaskTypeGoogleAIStudio,
Expand Down Expand Up @@ -152,6 +153,17 @@ export class InferenceEndpointInfoCohere extends InferenceEndpoint {
task_type: TaskTypeCohere
}

export class InferenceEndpointInfoDeepSeek extends InferenceEndpoint {
/**
* The inference Id
*/
inference_id: string
/**
* The task type
*/
task_type: TaskTypeDeepSeek
}

export class InferenceEndpointInfoElasticsearch extends InferenceEndpoint {
/**
* The inference Id
Expand Down
5 changes: 5 additions & 0 deletions specification/inference/_types/TaskType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ export enum TaskTypeCohere {
completion
}

export enum TaskTypeDeepSeek {
completion,
chat_completion
}

export enum TaskTypeElasticsearch {
sparse_embedding,
text_embedding,
Expand Down
1 change: 1 addition & 0 deletions specification/inference/put/PutRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { TaskType } from '@inference/_types/TaskType'
* * Azure AI Studio (`completion`, `text_embedding`)
* * Azure OpenAI (`completion`, `text_embedding`)
* * Cohere (`completion`, `rerank`, `text_embedding`)
* * DeepSeek (`completion`, `chat_completion`)
* * Elasticsearch (`rerank`, `sparse_embedding`, `text_embedding` - this service is for built-in models and models uploaded through Eland)
* * ELSER (`sparse_embedding`)
* * Google AI Studio (`completion`, `text_embedding`)
Expand Down
72 changes: 72 additions & 0 deletions specification/inference/put_deepseek/PutDeepSeekRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* 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 { RequestBase } from '@_types/Base'
import { Id } from '@_types/common'
import {
DeepSeekServiceSettings,
DeepSeekServiceType,
DeepSeekTaskType
} from '@inference/_types/CommonTypes'
import { InferenceChunkingSettings } from '@inference/_types/Services'

/**
* Create a DeepSeek inference endpoint.
*
* Create an inference endpoint to perform an inference task with the `deepseek` service.
* @rest_spec_name inference.put_deepseek
* @availability stack since=9.1.0 stability=stable visibility=public
* @availability serverless stability=stable visibility=public
* @cluster_privileges manage_inference
* @doc_id inference-api-put-deepseek
*/
export interface Request extends RequestBase {
urls: [
{
path: '/_inference/{task_type}/{deepseek_inference_id}'
methods: ['PUT']
}
]
path_parts: {
/**
* The type of the inference task that the model will perform.
*/
task_type: DeepSeekTaskType
/**
* The unique identifier of the inference endpoint.
*/
deepseek_inference_id: Id
}
body: {
/**
* The chunking configuration object.
* @ext_doc_id inference-chunking
*/
chunking_settings?: InferenceChunkingSettings
/**
* The type of service supported for the specified task type. In this case, `deepseek`.
*/
service: DeepSeekServiceType
/**
* Settings used to install the inference model.
* These settings are specific to the `deepseek` service.
*/
service_settings: DeepSeekServiceSettings
}
}
25 changes: 25 additions & 0 deletions specification/inference/put_deepseek/PutDeepSeekResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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 { InferenceEndpointInfoDeepSeek } from '@inference/_types/Services'

export class Response {
/** @codegen_name endpoint_info */
body: InferenceEndpointInfoDeepSeek
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
summary: A completion task
description: Run `PUT _inference/completion/deepseek-completion` to create an inference endpoint that performs a completion task.
method_request: 'PUT _inference/completion/deepseek-completion'
# type: "request"
value: |-
{
"service": "deepseek",
"service_settings": {
"api_key": "DeepSeek-Api-key",
"model_id": "deepseek-chat"
}
}
alternatives:
- language: Python
code: |-
resp = client.inference.put(
task_type="completion",
inference_id="deepseek-completion",
inference_config={
"service": "deepseek",
"service_settings": {
"api_key": "DeepSeek-Api-key",
"model_id": "deepseek-chat"
}
},
)
- language: JavaScript
code: |-
const response = await client.inference.put({
task_type: "completion",
inference_id: "deepseek-completion",
inference_config: {
service: "deepseek",
service_settings: {
api_key: "DeepSeek-Api-key",
model_id: "deepseek-chat"
},
},
});
- language: Ruby
code: |-
response = client.inference.put(
task_type: "completion",
inference_id: "deepseek-completion",
body: {
"service": "deepseek",
"service_settings": {
"api_key": "DeepSeek-Api-key",
"model_id": "deepseek-chat"
}
}
)
- language: PHP
code: |-
$resp = $client->inference()->put([
"task_type" => "completion",
"inference_id" => "deepseek-completion",
"body" => [
"service" => "deepseek",
"service_settings" => [
"api_key" => "DeepSeek-Api-key",
"model_id" => "deepseek-chat"
],
],
]);
- language: curl
code:
'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d
''{"service":"deepseek","service_settings":{"api_key":"DeepSeek-Api-key","model_id":"deepseek-chat"
}'' "$ELASTICSEARCH_URL/_inference/completion/deepseek-completion"'
- language: Java
code: >
client.inference().put(p -> p
.inferenceId("deepseek-completion")
.taskType(TaskType.Completion)
.inferenceConfig(i -> i
.service("deepseek")
.serviceSettings(JsonData.fromJson("{\"api_key\":\"DeepSeek-Api-key\",\"model_id\":\"deepseek-chat\"}"))
)
);
Loading