Skip to content

Commit

Permalink
Updated opensearch-js to reflect the latest OpenSearch API spec (2025…
Browse files Browse the repository at this point in the history
…-01-09)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
nhtruong authored and github-actions[bot] committed Jan 9, 2025
1 parent a1fa1e6 commit 6ec4b3e
Show file tree
Hide file tree
Showing 30 changed files with 1,078 additions and 16 deletions.
51 changes: 48 additions & 3 deletions api/OpenSearchApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -807,22 +807,67 @@ export default class OpenSearchAPI {
registerModel (params: API.Ml_RegisterModel_Request, callback: callbackFn<API.Ml_RegisterModel_Response>): TransportRequestCallback;
registerModel (params: API.Ml_RegisterModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_RegisterModel_Response>): TransportRequestCallback;

registerModelMeta (params?: API.Ml_RegisterModelMeta_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_RegisterModelMeta_Response>;
registerModelMeta (callback: callbackFn<API.Ml_RegisterModelMeta_Response>): TransportRequestCallback;
registerModelMeta (params: API.Ml_RegisterModelMeta_Request, callback: callbackFn<API.Ml_RegisterModelMeta_Response>): TransportRequestCallback;
registerModelMeta (params: API.Ml_RegisterModelMeta_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_RegisterModelMeta_Response>): TransportRequestCallback;

searchModels (params?: API.Ml_SearchModels_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_SearchModels_Response>;
searchModels (callback: callbackFn<API.Ml_SearchModels_Response>): TransportRequestCallback;
searchModels (params: API.Ml_SearchModels_Request, callback: callbackFn<API.Ml_SearchModels_Response>): TransportRequestCallback;
searchModels (params: API.Ml_SearchModels_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_SearchModels_Response>): TransportRequestCallback;

undeployModel (params?: API.Ml_UndeployModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_UndeployModel_Response>;
undeployModel (callback: callbackFn<API.Ml_UndeployModel_Response>): TransportRequestCallback;
undeployModel (params: API.Ml_UndeployModel_Request, callback: callbackFn<API.Ml_UndeployModel_Response>): TransportRequestCallback;
undeployModel (params: API.Ml_UndeployModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_UndeployModel_Response>): TransportRequestCallback;

unloadModel (params?: API.Ml_UnloadModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_UnloadModel_Response>;
unloadModel (callback: callbackFn<API.Ml_UnloadModel_Response>): TransportRequestCallback;
unloadModel (params: API.Ml_UnloadModel_Request, callback: callbackFn<API.Ml_UnloadModel_Response>): TransportRequestCallback;
unloadModel (params: API.Ml_UnloadModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_UnloadModel_Response>): TransportRequestCallback;

uploadModel (params?: API.Ml_UploadModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_UploadModel_Response>;
uploadModel (callback: callbackFn<API.Ml_UploadModel_Response>): TransportRequestCallback;
uploadModel (params: API.Ml_UploadModel_Request, callback: callbackFn<API.Ml_UploadModel_Response>): TransportRequestCallback;
uploadModel (params: API.Ml_UploadModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_UploadModel_Response>): TransportRequestCallback;

deleteModel (params: API.Ml_DeleteModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_DeleteModel_Response>;
deleteModel (params: API.Ml_DeleteModel_Request, callback: callbackFn<API.Ml_DeleteModel_Response>): TransportRequestCallback;
deleteModel (params: API.Ml_DeleteModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_DeleteModel_Response>): TransportRequestCallback;

getModel (params: API.Ml_GetModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_GetModel_Response>;
getModel (params: API.Ml_GetModel_Request, callback: callbackFn<API.Ml_GetModel_Response>): TransportRequestCallback;
getModel (params: API.Ml_GetModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_GetModel_Response>): TransportRequestCallback;

updateModel (params: API.Ml_UpdateModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_UpdateModel_Response>;
updateModel (params: API.Ml_UpdateModel_Request, callback: callbackFn<API.Ml_UpdateModel_Response>): TransportRequestCallback;
updateModel (params: API.Ml_UpdateModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_UpdateModel_Response>): TransportRequestCallback;

deployModel (params: API.Ml_DeployModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_DeployModel_Response>;
deployModel (params: API.Ml_DeployModel_Request, callback: callbackFn<API.Ml_DeployModel_Response>): TransportRequestCallback;
deployModel (params: API.Ml_DeployModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_DeployModel_Response>): TransportRequestCallback;

undeployModel (params: API.Ml_UndeployModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_UndeployModel_Response>;
undeployModel (params: API.Ml_UndeployModel_Request, callback: callbackFn<API.Ml_UndeployModel_Response>): TransportRequestCallback;
undeployModel (params: API.Ml_UndeployModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_UndeployModel_Response>): TransportRequestCallback;
loadModel (params: API.Ml_LoadModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_LoadModel_Response>;
loadModel (params: API.Ml_LoadModel_Request, callback: callbackFn<API.Ml_LoadModel_Response>): TransportRequestCallback;
loadModel (params: API.Ml_LoadModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_LoadModel_Response>): TransportRequestCallback;

predictModel (params: API.Ml_PredictModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_PredictModel_Response>;
predictModel (params: API.Ml_PredictModel_Request, callback: callbackFn<API.Ml_PredictModel_Response>): TransportRequestCallback;
predictModel (params: API.Ml_PredictModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_PredictModel_Response>): TransportRequestCallback;

chunkModel (params: API.Ml_ChunkModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_ChunkModel_Response>;
chunkModel (params: API.Ml_ChunkModel_Request, callback: callbackFn<API.Ml_ChunkModel_Response>): TransportRequestCallback;
chunkModel (params: API.Ml_ChunkModel_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_ChunkModel_Response>): TransportRequestCallback;

uploadChunk (params: API.Ml_UploadChunk_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_UploadChunk_Response>;
uploadChunk (params: API.Ml_UploadChunk_Request, callback: callbackFn<API.Ml_UploadChunk_Response>): TransportRequestCallback;
uploadChunk (params: API.Ml_UploadChunk_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_UploadChunk_Response>): TransportRequestCallback;

createModelMeta (params?: API.Ml_CreateModelMeta_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_CreateModelMeta_Response>;
createModelMeta (callback: callbackFn<API.Ml_CreateModelMeta_Response>): TransportRequestCallback;
createModelMeta (params: API.Ml_CreateModelMeta_Request, callback: callbackFn<API.Ml_CreateModelMeta_Response>): TransportRequestCallback;
createModelMeta (params: API.Ml_CreateModelMeta_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_CreateModelMeta_Response>): TransportRequestCallback;

deleteTask (params: API.Ml_DeleteTask_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_DeleteTask_Response>;
deleteTask (params: API.Ml_DeleteTask_Request, callback: callbackFn<API.Ml_DeleteTask_Response>): TransportRequestCallback;
Expand Down
1 change: 1 addition & 0 deletions api/_core/search.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export interface Search_Request extends Global.Params {
export type Search_RequestBody = {
_source?: Core_Search.SourceConfig;
aggregations?: Record<string, Common_Aggregations.AggregationContainer>;
aggs?: Record<string, Common_Aggregations.AggregationContainer>;
collapse?: Core_Search.FieldCollapse;
docvalue_fields?: Common_QueryDsl.FieldAndFormat[];
explain?: boolean;
Expand Down
2 changes: 2 additions & 0 deletions api/_types/_common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ export type Metadata = Record<string, any>

export type MinimumShouldMatch = number | string

export type ModelFormat = 'ONNX' | 'TORCH_SCRIPT'

export type MultiTermQueryRewrite = 'constant_score' | 'constant_score_boolean' | 'scoring_boolean' | string

export type Name = string
Expand Down
78 changes: 77 additions & 1 deletion api/_types/ml._common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import * as Common from './_common'
import * as Common_Analysis from './_common.analysis'

export type Action = {
action_type?: string;
Expand Down Expand Up @@ -103,6 +104,24 @@ export type GetMessageTracesResponse = {
traces?: Message[];
}

export type Guardrails = {
index_name?: Common.IndexName;
input_guardrail?: GuardrailsInputOutput;
model_id?: string;
output_guardrail?: GuardrailsInputOutput;
regex?: Record<string, any>;
response_filter?: string;
response_validation_regex?: string;
source_fields?: Common.Fields;
stop_words?: Common_Analysis.StopWords;
type?: 'local_regex' | 'model';
}

export type GuardrailsInputOutput = {
model_id?: string;
response_validation_regex?: string;
}

export type Headers = {
content_type?: string;
[key: string]: any;
Expand Down Expand Up @@ -165,6 +184,23 @@ export type Message = {
trace_number?: number;
}

export type Model = {
algorithm?: string;
created_time?: number;
is_hidden?: boolean;
last_registered_time?: number;
last_updated_time?: number;
model_config?: ModelConfig;
model_content_hash_value?: string;
model_content_size_in_bytes?: number;
model_format?: Common.ModelFormat;
model_group_id?: string;
model_state: 'DEPLOYED' | 'DEPLOYING' | 'DEPLOY_FAILED' | 'PARTIALLY_DEPLOYED' | 'REGISTERED' | 'REGISTERING' | 'UNDEPLOYED';
model_version?: string;
name?: string;
total_chunks?: number;
}

export type ModelConfig = {
all_config?: string;
embedding_dimension?: number;
Expand Down Expand Up @@ -223,6 +259,22 @@ export type PredictionResult = {
rows?: Rows[];
}

export type PredictModelOutput = {
byte_buffer?: ByteBuffer;
data: number[];
data_type?: 'BOOLEAN' | 'FLOAT16' | 'FLOAT32' | 'FLOAT64' | 'INT32' | 'INT64' | 'INT8' | 'STRING' | 'UINT8' | 'UNKNOWN';
name?: string;
shape?: number[];
}

export type PredictModelResponse = {
inference_results?: PredictModelResult[];
}

export type PredictModelResult = {
output?: PredictModelOutput[];
}

export type PredictResponse = {
inference_results?: InferenceResults[];
prediction_result?: PredictionResult;
Expand All @@ -242,6 +294,11 @@ export type Range = {
k3?: Key;
}

export type RateLimiter = {
limit: number;
unit: 'DAYS' | 'HOURS' | 'MICROSECONDS' | 'MILLISECONDS' | 'MINUTES' | 'NANOSECONDS' | 'SECONDS';
}

export type Rows = {
values?: Values[];
}
Expand Down Expand Up @@ -360,7 +417,7 @@ export type Source = {
model_config?: ModelConfig;
model_content_hash_value?: string;
model_content_size_in_bytes?: number;
model_format?: string;
model_format?: Common.ModelFormat;
model_group_id?: string;
model_id?: Common.Name;
model_state?: 'DEPLOYED' | 'DEPLOYING' | 'DEPLOY_FAILED' | 'PARTIALLY_DEPLOYED' | 'REGISTERED' | 'REGISTERING' | 'UNDEPLOYED';
Expand Down Expand Up @@ -438,10 +495,29 @@ export type UndeployModelNodeStats = Record<string, any>

export type UndeployModelResponse = Record<string, UndeployModelNode>

export type UnloadModelNode = {
stats?: UnloadModelNodeStats;
}

export type UnloadModelNodeStats = Record<string, any>

export type UnloadModelResponse = Record<string, UnloadModelNode>

export type UpdateModelGroupResponse = {
status?: string;
}

export type UpdateModelResponse = {
_id?: Common.Id;
_index: Common.IndexName;
_primary_term?: number;
_seq_no?: Common.SequenceNumber;
_shards?: Common.ShardStatistics;
_version?: Common.VersionNumber;
forced_refresh?: boolean;
result?: Common.Result;
}

export type Values = {
column_type?: 'BOOLEAN' | 'DOUBLE' | 'INTEGER' | 'STRING';
value?: number;
Expand Down
24 changes: 22 additions & 2 deletions api/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,20 @@ import { Ml_DeleteModelGroup_Request, Ml_DeleteModelGroup_Response, Ml_DeleteMod
import { Ml_GetModelGroup_Request, Ml_GetModelGroup_Response, Ml_GetModelGroup_ResponseBody } from './ml/getModelGroup';
import { Ml_UpdateModelGroup_Request, Ml_UpdateModelGroup_RequestBody, Ml_UpdateModelGroup_Response, Ml_UpdateModelGroup_ResponseBody } from './ml/updateModelGroup';
import { Ml_RegisterModel_Request, Ml_RegisterModel_RequestBody, Ml_RegisterModel_Response, Ml_RegisterModel_ResponseBody } from './ml/registerModel';
import { Ml_RegisterModelMeta_Request, Ml_RegisterModelMeta_RequestBody, Ml_RegisterModelMeta_Response, Ml_RegisterModelMeta_ResponseBody } from './ml/registerModelMeta';
import { Ml_SearchModels_Request, Ml_SearchModels_RequestBody, Ml_SearchModels_Response, Ml_SearchModels_ResponseBody } from './ml/searchModels';
import { Ml_UndeployModel_Request, Ml_UndeployModel_RequestBody, Ml_UndeployModel_Response, Ml_UndeployModel_ResponseBody } from './ml/undeployModel';
import { Ml_UnloadModel_Request, Ml_UnloadModel_RequestBody, Ml_UnloadModel_Response, Ml_UnloadModel_ResponseBody } from './ml/unloadModel';
import { Ml_UploadModel_Request, Ml_UploadModel_RequestBody, Ml_UploadModel_Response, Ml_UploadModel_ResponseBody } from './ml/uploadModel';
import { Ml_DeleteModel_Request, Ml_DeleteModel_Response, Ml_DeleteModel_ResponseBody } from './ml/deleteModel';
import { Ml_GetModel_Request, Ml_GetModel_Response, Ml_GetModel_ResponseBody } from './ml/getModel';
import { Ml_UpdateModel_Request, Ml_UpdateModel_RequestBody, Ml_UpdateModel_Response, Ml_UpdateModel_ResponseBody } from './ml/updateModel';
import { Ml_DeployModel_Request, Ml_DeployModel_Response, Ml_DeployModel_ResponseBody } from './ml/deployModel';
import { Ml_UndeployModel_Request, Ml_UndeployModel_Response, Ml_UndeployModel_ResponseBody } from './ml/undeployModel';
import { Ml_LoadModel_Request, Ml_LoadModel_Response, Ml_LoadModel_ResponseBody } from './ml/loadModel';
import { Ml_PredictModel_Request, Ml_PredictModel_RequestBody, Ml_PredictModel_Response, Ml_PredictModel_ResponseBody } from './ml/predictModel';
import { Ml_ChunkModel_Request, Ml_ChunkModel_RequestBody, Ml_ChunkModel_Response, Ml_ChunkModel_ResponseBody } from './ml/chunkModel';
import { Ml_UploadChunk_Request, Ml_UploadChunk_RequestBody, Ml_UploadChunk_Response, Ml_UploadChunk_ResponseBody } from './ml/uploadChunk';
import { Ml_CreateModelMeta_Request, Ml_CreateModelMeta_RequestBody, Ml_CreateModelMeta_Response, Ml_CreateModelMeta_ResponseBody } from './ml/createModelMeta';
import { Ml_DeleteTask_Request, Ml_DeleteTask_Response, Ml_DeleteTask_ResponseBody } from './ml/deleteTask';
import { Ml_GetTask_Request, Ml_GetTask_Response, Ml_GetTask_ResponseBody } from './ml/getTask';
import { Notifications_ListChannels_Request, Notifications_ListChannels_Response, Notifications_ListChannels_ResponseBody } from './notifications/listChannels';
Expand Down Expand Up @@ -682,10 +692,20 @@ export {
Ml_GetModelGroup_Request, Ml_GetModelGroup_Response, Ml_GetModelGroup_ResponseBody,
Ml_UpdateModelGroup_Request, Ml_UpdateModelGroup_RequestBody, Ml_UpdateModelGroup_Response, Ml_UpdateModelGroup_ResponseBody,
Ml_RegisterModel_Request, Ml_RegisterModel_RequestBody, Ml_RegisterModel_Response, Ml_RegisterModel_ResponseBody,
Ml_RegisterModelMeta_Request, Ml_RegisterModelMeta_RequestBody, Ml_RegisterModelMeta_Response, Ml_RegisterModelMeta_ResponseBody,
Ml_SearchModels_Request, Ml_SearchModels_RequestBody, Ml_SearchModels_Response, Ml_SearchModels_ResponseBody,
Ml_UndeployModel_Request, Ml_UndeployModel_RequestBody, Ml_UndeployModel_Response, Ml_UndeployModel_ResponseBody,
Ml_UnloadModel_Request, Ml_UnloadModel_RequestBody, Ml_UnloadModel_Response, Ml_UnloadModel_ResponseBody,
Ml_UploadModel_Request, Ml_UploadModel_RequestBody, Ml_UploadModel_Response, Ml_UploadModel_ResponseBody,
Ml_DeleteModel_Request, Ml_DeleteModel_Response, Ml_DeleteModel_ResponseBody,
Ml_GetModel_Request, Ml_GetModel_Response, Ml_GetModel_ResponseBody,
Ml_UpdateModel_Request, Ml_UpdateModel_RequestBody, Ml_UpdateModel_Response, Ml_UpdateModel_ResponseBody,
Ml_DeployModel_Request, Ml_DeployModel_Response, Ml_DeployModel_ResponseBody,
Ml_UndeployModel_Request, Ml_UndeployModel_Response, Ml_UndeployModel_ResponseBody,
Ml_LoadModel_Request, Ml_LoadModel_Response, Ml_LoadModel_ResponseBody,
Ml_PredictModel_Request, Ml_PredictModel_RequestBody, Ml_PredictModel_Response, Ml_PredictModel_ResponseBody,
Ml_ChunkModel_Request, Ml_ChunkModel_RequestBody, Ml_ChunkModel_Response, Ml_ChunkModel_ResponseBody,
Ml_UploadChunk_Request, Ml_UploadChunk_RequestBody, Ml_UploadChunk_Response, Ml_UploadChunk_ResponseBody,
Ml_CreateModelMeta_Request, Ml_CreateModelMeta_RequestBody, Ml_CreateModelMeta_Response, Ml_CreateModelMeta_ResponseBody,
Ml_DeleteTask_Request, Ml_DeleteTask_Response, Ml_DeleteTask_ResponseBody,
Ml_GetTask_Request, Ml_GetTask_Response, Ml_GetTask_ResponseBody,
Notifications_ListChannels_Request, Notifications_ListChannels_Response, Notifications_ListChannels_ResponseBody,
Expand Down
Loading

0 comments on commit 6ec4b3e

Please sign in to comment.