From 64a4eef36454d2c01470d5b2dcd749eff22209f4 Mon Sep 17 00:00:00 2001 From: David Kyle Date: Mon, 27 Nov 2023 16:10:17 +0000 Subject: [PATCH] Inherit fields --- output/schema/schema.json | 48 ++++------------------ output/schema/validation-errors.json | 6 +++ output/typescript/types.ts | 5 +-- specification/inference/_types/Services.ts | 14 +------ 4 files changed, 17 insertions(+), 56 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 767e6aea49..0f7ff97c1e 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -127535,6 +127535,12 @@ }, { "description": "Represents a model as returned by the GET API", + "inherits": { + "type": { + "name": "ModelConfig", + "namespace": "inference._types" + } + }, "kind": "interface", "name": { "name": "ModelConfigContainer", @@ -127564,45 +127570,9 @@ "namespace": "inference._types" } } - }, - { - "description": "The service type", - "name": "service", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "Settings specific to the service", - "name": "service_settings", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "ServiceSettings", - "namespace": "inference._types" - } - } - }, - { - "description": "Task settings specific to the service and model", - "name": "task_settings", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "TaskSettings", - "namespace": "inference._types" - } - } } ], - "specLocation": "inference/_types/Services.ts#L41-L65" + "specLocation": "inference/_types/Services.ts#L41-L53" }, { "kind": "type_alias", @@ -127610,7 +127580,7 @@ "name": "ServiceSettings", "namespace": "inference._types" }, - "specLocation": "inference/_types/Services.ts#L67-L67", + "specLocation": "inference/_types/Services.ts#L55-L55", "type": { "kind": "user_defined_value" } @@ -127669,7 +127639,7 @@ "name": "TaskSettings", "namespace": "inference._types" }, - "specLocation": "inference/_types/Services.ts#L69-L69", + "specLocation": "inference/_types/Services.ts#L57-L57", "type": { "kind": "user_defined_value" } diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index af007866fd..3dedea5608 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -897,6 +897,12 @@ "response definition inference.delete_model:Response / body / instance_of - Non-leaf type cannot be used here: '_types:AcknowledgedResponseBase'" ] }, + "inference.put_model": { + "request": [ + "request definition inference.put_model:Request / body / instance_of - Non-leaf type cannot be used here: 'inference._types:ModelConfig'" + ], + "response": [] + }, "ingest.delete_pipeline": { "request": [], "response": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 2cdd027a1c..e0c18ba441 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11446,12 +11446,9 @@ export interface InferenceModelConfig { task_settings: InferenceTaskSettings } -export interface InferenceModelConfigContainer { +export interface InferenceModelConfigContainer extends InferenceModelConfig { model_id: string task_type: InferenceTaskType - service: string - service_settings: InferenceServiceSettings - task_settings: InferenceTaskSettings } export type InferenceServiceSettings = any diff --git a/specification/inference/_types/Services.ts b/specification/inference/_types/Services.ts index e408ee206c..e2d453b416 100644 --- a/specification/inference/_types/Services.ts +++ b/specification/inference/_types/Services.ts @@ -41,7 +41,7 @@ export class ModelConfig { /** * Represents a model as returned by the GET API */ -export class ModelConfigContainer { +export class ModelConfigContainer extends ModelConfig { /** * The model Id */ @@ -50,18 +50,6 @@ export class ModelConfigContainer { * The model's task type */ task_type: TaskType - /** - * The service type - */ - service: string - /** - * Settings specific to the service - */ - service_settings: ServiceSettings - /** - * Task settings specific to the service and model - */ - task_settings: TaskSettings } export type ServiceSettings = UserDefinedValue