From a65b73d62d48fd31c84794738399544da6603508 Mon Sep 17 00:00:00 2001 From: Heiru Wu Date: Mon, 12 Aug 2024 20:41:11 +0800 Subject: [PATCH] chore: update oneof --- schema/ai-tasks.json | 66 +++++++++++++++++++++++++++++++++++++++----- schema/schema.json | 55 ++++++++++++++---------------------- 2 files changed, 79 insertions(+), 42 deletions(-) diff --git a/schema/ai-tasks.json b/schema/ai-tasks.json index 7f7e3f10..28c09654 100644 --- a/schema/ai-tasks.json +++ b/schema/ai-tasks.json @@ -40,32 +40,84 @@ "type": "object", "properties": { "text": { - "description": "Text message", - "instillShortDescription": "Text message", + "title": "Text message", + "description": "Text message.", + "instillShortDescription": "Text message.", "instillAcceptFormats": [ "string" ], "type": "string" + }, + "type": { + "title": "Content type", + "description": "Input content type.", + "instillShortDescription": "Input content type.", + "instillAcceptFormats": [ + "string" + ], + "type": "string", + "const": "text" } }, "required": [ - "text" + "text", + "type" ] }, { "type": "object", "properties": { - "datauri": { - "description": "Image message with either url or base64 encoded string", - "instillShortDescription": "Image message with either url or base64 encoded string", + "image-url": { + "title": "Image url", + "description": "Image message url.", + "instillShortDescription": "Image message url.", "instillAcceptFormats": [ "string" ], "type": "string" + }, + "type": { + "title": "Content type", + "description": "Input content type", + "instillShortDescription": "Input content type", + "instillAcceptFormats": [ + "string" + ], + "type": "string", + "const": "image-url" + } + }, + "required": [ + "image-url", + "type" + ] + }, + { + "type": "object", + "properties": { + "image-base64": { + "title": "Image base64", + "description": "Image base64 encoded string.", + "instillShortDescription": "Image base64 encoded string.", + "instillAcceptFormats": [ + "string" + ], + "type": "string" + }, + "type": { + "title": "Content type", + "description": "Input content type", + "instillShortDescription": "Input content type", + "instillAcceptFormats": [ + "string" + ], + "type": "string", + "const": "image-base64" } }, "required": [ - "datauri" + "image-base64", + "type" ] } ] diff --git a/schema/schema.json b/schema/schema.json index b0070a34..e2c8f88a 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -17,46 +17,31 @@ }, "image": { "title": "Input image", - "type": "object", - "oneOf": [ - { - "type": "object", - "properties": { - "image-url": { - "description": "Image url", - "instillShortDescription": "Image url", - "instillAcceptFormats": [ - "string" - ], - "type": "string" - } - }, - "required": [ - "image-url" - ] - }, - { - "type": "object", - "properties": { - "image-base64": { - "description": "Image base64 encoded string", - "instillShortDescription": "Image base64 encoded string", - "instillAcceptFormats": [ - "string" - ], - "type": "string" - } - }, - "required": [ - "image-base64" - ] - } + "description": "Input image data.", + "instillShortDescription": "Input image data.", + "instillAcceptFormats": [ + "string" + ], + "type": "string" + }, + "type": { + "title": "Input image type", + "description": "Image url or image base64.", + "instillShortDescription": "Image url or image base64.", + "instillAcceptFormats": [ + "string" + ], + "type": "string", + "enum": [ + "url", + "base64" ] } }, "required": [ "model", - "image" + "image", + "type" ] }, "bounding-box": {