Skip to content

Commit 9492411

Browse files
Add AI21 specifications (#5072)
1 parent f1534e2 commit 9492411

File tree

15 files changed

+1011
-148
lines changed

15 files changed

+1011
-148
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 171 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 171 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 423 additions & 124 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_doc_ids/table.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ doc_id,doc_url,previous_version_doc_url,description
22
ack-watch, https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher/actions#example,,
33
apis,https://www.elastic.co/docs/api/doc/elasticsearch,,
44
add-nodes,https://www.elastic.co/docs/deploy-manage/maintenance/add-and-remove-elasticsearch-nodes,,
5+
ai21-api-models,https://docs.ai21.com/docs/jamba-foundation-models,,
6+
ai21-rate-limit,https://docs.ai21.com/reference/api-rate-limits,,
57
alias-update,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-alias,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-add-alias.html,
68
aliases-update,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-update-aliases,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-aliases.html,
79
alibabacloud-api-keys,https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key,,
@@ -356,6 +358,7 @@ inference-api-post,https://www.elastic.co/docs/api/doc/elasticsearch/operation/o
356358
inference-api-post-eis-chat-completion,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis-chat-completion,,
357359
inference-api-put,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-inference-api.html,
358360
inference-api-put-alibabacloud,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-alibabacloud,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-alibabacloud-ai-search.html,
361+
inference-api-put-ai21,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-ai21,,
359362
inference-api-put-amazonbedrock,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonbedrock,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-amazon-bedrock.html,
360363
inference-api-put-amazonsagemaker,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonsagemaker,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-amazon-sagemaker.html,
361364
inference-api-put-anthropic,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-anthropic,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-anthropic.html,
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"inference.put_ai21": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-ai21.html",
5+
"description": "Configure a AI21 inference endpoint"
6+
},
7+
"stability": "stable",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": ["application/json"],
11+
"content_type": ["application/json"]
12+
},
13+
"url": {
14+
"paths": [
15+
{
16+
"path": "/_inference/{task_type}/{ai21_inference_id}",
17+
"methods": ["PUT"],
18+
"parts": {
19+
"task_type": {
20+
"type": "string",
21+
"description": "The task type"
22+
},
23+
"ai21_inference_id": {
24+
"type": "string",
25+
"description": "The inference ID"
26+
}
27+
}
28+
}
29+
]
30+
},
31+
"body": {
32+
"description": "The inference endpoint's task and service settings"
33+
}
34+
}
35+
}

specification/inference/_types/CommonTypes.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,42 @@ export interface CompletionTool {
289289
function: CompletionToolFunction
290290
}
291291

292+
export class Ai21ServiceSettings {
293+
/**
294+
* The name of the model to use for the inference task.
295+
* Refer to the AI21 models documentation for the list of supported models and versions.
296+
* Service has been tested and confirmed to be working for `completion` and `chat_completion` tasks with the following models:
297+
* * `jamba-mini`
298+
* * `jamba-large`
299+
* @ext_doc_id ai21-api-models
300+
*/
301+
model_id: string
302+
/**
303+
* A valid API key for accessing AI21 API.
304+
*
305+
* IMPORTANT: You need to provide the API key only once, during the inference model creation.
306+
* The get inference endpoint API does not retrieve your API key.
307+
* After creating the inference model, you cannot change the associated API key.
308+
* 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.
309+
*/
310+
api_key?: string
311+
/**
312+
* This setting helps to minimize the number of rate limit errors returned from the AI21 API.
313+
* By default, the `ai21` service sets the number of requests allowed per minute to 200. Please refer to AI21 documentation for more details.
314+
* @ext_doc_id ai21-rate-limit
315+
*/
316+
rate_limit?: RateLimitSetting
317+
}
318+
319+
export enum Ai21TaskType {
320+
completion,
321+
chat_completion
322+
}
323+
324+
export enum Ai21ServiceType {
325+
ai21
326+
}
327+
292328
export class AlibabaCloudServiceSettings {
293329
/**
294330
* A valid API key for the AlibabaCloud AI Search API.

specification/inference/_types/Services.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { integer } from '@_types/Numeric'
2121
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
2222
import {
2323
TaskType,
24+
TaskTypeAi21,
2425
TaskTypeAlibabaCloudAI,
2526
TaskTypeAmazonBedrock,
2627
TaskTypeAmazonSageMaker,
@@ -77,6 +78,18 @@ export class InferenceEndpointInfo extends InferenceEndpoint {
7778
*/
7879
task_type: TaskType
7980
}
81+
82+
export class InferenceEndpointInfoAi21 extends InferenceEndpoint {
83+
/**
84+
* The inference Id
85+
*/
86+
inference_id: string
87+
/**
88+
* The task type
89+
*/
90+
task_type: TaskTypeAi21
91+
}
92+
8093
export class InferenceEndpointInfoAlibabaCloudAI extends InferenceEndpoint {
8194
/**
8295
* The inference Id

specification/inference/_types/TaskType.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ export enum TaskTypeJinaAi {
3333
rerank
3434
}
3535

36+
export enum TaskTypeAi21 {
37+
completion,
38+
chat_completion
39+
}
40+
3641
export enum TaskTypeAlibabaCloudAI {
3742
text_embedding,
3843
rerank,

0 commit comments

Comments
 (0)