diff --git a/model-hub/model_hub_test.json b/model-hub/model_hub_test.json index 72e26189..d459f870 100644 --- a/model-hub/model_hub_test.json +++ b/model-hub/model_hub_test.json @@ -25,19 +25,6 @@ "version": "latest", "configuration": {} }, - { - "id": "dummy-image-to-image", - "owner_type": "users", - "owner_id": "admin", - "description": "A image to image model for integration-test", - "model_definition": "model-definitions/container", - "visibility": "VISIBILITY_PUBLIC", - "task": "TASK_IMAGE_TO_IMAGE", - "region": "REGION_LOCAL", - "hardware": "CPU", - "version": "latest", - "configuration": {} - }, { "id": "dummy-instance-segmentation", "owner_type": "users", @@ -78,26 +65,26 @@ "configuration": {} }, { - "id": "dummy-text-generation", + "id": "dummy-completion", "owner_type": "users", "owner_id": "admin", - "description": "A text generation model for integration-test", + "description": "A completion model for integration-test", "model_definition": "model-definitions/container", "visibility": "VISIBILITY_PUBLIC", - "task": "TASK_TEXT_GENERATION", + "task": "TASK_COMPLETION", "region": "REGION_LOCAL", "hardware": "CPU", "version": "latest", "configuration": {} }, { - "id": "dummy-text-generation-chat", + "id": "dummy-chat", "owner_type": "users", "owner_id": "admin", - "description": "A text generation chat model for integration-test", + "description": "A chat model for integration-test", "model_definition": "model-definitions/container", "visibility": "VISIBILITY_PUBLIC", - "task": "TASK_TEXT_GENERATION_CHAT", + "task": "TASK_CHAT", "region": "REGION_LOCAL", "hardware": "CPU", "version": "latest", @@ -117,13 +104,26 @@ "configuration": {} }, { - "id": "dummy-visual-question-answering", + "id": "dummy-multimodal-chat", + "owner_type": "users", + "owner_id": "admin", + "description": "A multimodal chat model for integration-test", + "model_definition": "model-definitions/container", + "visibility": "VISIBILITY_PUBLIC", + "task": "TASK_CHAT", + "region": "REGION_LOCAL", + "hardware": "CPU", + "version": "latest", + "configuration": {} + }, + { + "id": "dummy-text-embedding", "owner_type": "users", "owner_id": "admin", - "description": "A visual question answering model for integration-test", + "description": "A embedding model for integration-test", "model_definition": "model-definitions/container", "visibility": "VISIBILITY_PUBLIC", - "task": "TASK_VISUAL_QUESTION_ANSWERING", + "task": "TASK_EMBEDDING", "region": "REGION_LOCAL", "hardware": "CPU", "version": "latest", diff --git a/schema/ai-tasks.json b/schema/ai-tasks.json new file mode 100644 index 00000000..36774a6d --- /dev/null +++ b/schema/ai-tasks.json @@ -0,0 +1,1424 @@ +{ + "TASK_EMBEDDING": { + "title": "Embedding", + "instillShortDescription": "Generate embeddings based on input data", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Embedding input", + "description": "Input schema of the embedding task", + "instillShortDescription": "Input schema of the embedding task", + "type": "object", + "properties": { + "data": { + "description": "Input data", + "instillShortDescription": "Input data", + "type": "object", + "properties": { + "model": { + "description": "The model to be used for generating embeddings.", + "instillShortDescription": "The model to be used.", + "instillAcceptFormats": [ + "string" + ], + "title": "Model Name", + "type": "string" + }, + "input": { + "title": "Embedding Input", + "type": "array", + "items": { + "type": "object", + "properties": { + "content": { + "description": "The content to be embedded.", + "instillShortDescription": "The content to be embedded.", + "title": "Content", + "type": "array", + "items": { + "type": "object", + "oneOf": [ + { + "type": "object", + "properties": { + "text": { + "title": "Text content", + "description": "Text content to be embedded", + "instillShortDescription": "Text content", + "instillAcceptFormats": [ + "string" + ], + "type": "string" + }, + "type": { + "title": "Content type", + "description": "Input content type.", + "instillShortDescription": "Input content type.", + "instillAcceptFormats": [ + "string" + ], + "type": "string", + "const": "text" + } + }, + "required": [ + "text", + "type" + ] + }, + { + "type": "object", + "properties": { + "image-url": { + "title": "Image url", + "description": "Image content with URL.", + "instillShortDescription": "Image content 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 content with base64 encoded string.", + "instillShortDescription": "Image content with base64 encoded string.", + "instillAcceptFormats": [ + "image/*" + ], + "type": "string" + }, + "type": { + "title": "Content type", + "description": "Input content type", + "instillShortDescription": "Input content type", + "instillAcceptFormats": [ + "string" + ], + "type": "string", + "const": "image-base64" + } + }, + "required": [ + "image-base64", + "type" + ] + } + ] + } + } + }, + "required": [ + "content" + ] + } + } + }, + "required": [ + "model", + "input" + ] + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": { + "format": { + "title": "Data format", + "type": "string", + "description": "The data format of the embeddings. Defaults to float.", + "instillShortDescription": "Data format", + "instillAcceptFormats": [ + "string" + ], + "enum": [ + "float", + "base64" + ], + "default": "float" + }, + "dimensions": { + "title": "Dimensions", + "type": "integer", + "description": "Number of dimensions in the output embedding vectors.", + "instillShortDescription": "Number of dimensions", + "instillAcceptFormats": [ + "integer" + ], + "default": 512 + }, + "input-type": { + "title": "Input type", + "type": "string", + "description": "The type of input data to be embedded (e.g., query, document).", + "instillShortDescription": "Type of input data", + "instillAcceptFormats": [ + "string" + ] + }, + "truncate": { + "title": "Truncate", + "type": "string", + "description": "How to handle inputs longer than the max token length. Defaults to 'End'.", + "instillShortDescription": "Truncation handling", + "instillAcceptFormats": [ + "string" + ], + "enum": [ + "None", + "End", + "Start" + ], + "default": "End" + } + } + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Embedding output", + "description": "Output schema of the embedding task", + "instillShortDescription": "Output schema of the embedding task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "properties": { + "embeddings": { + "title": "Embeddings", + "type": "array", + "description": "List of generated embeddings.", + "instillShortDescription": "List of embeddings", + "instillFormat": "array", + "items": { + "type": "object", + "properties": { + "index": { + "title": "Index", + "type": "integer", + "description": "The index of the embedding vector in the array.", + "instillShortDescription": "Index in the array", + "instillFormat": "integer" + }, + "vector": { + "title": "Embedding Vector", + "type": "array", + "description": "The embedding vector.", + "instillShortDescription": "Embedding vector", + "instillFormat": "array" + }, + "created": { + "title": "Created", + "type": "integer", + "description": "The Unix timestamp (in seconds) of when the embedding was created.", + "instillShortDescription": "Timestamp of creation", + "instillFormat": "integer" + } + }, + "required": [ + "index", + "vector", + "created" + ] + } + } + }, + "required": [ + "embeddings" + ] + } + } + } + }, + "TASK_CHAT": { + "title": "Chat", + "instillShortDescription": "Generate response base on conversation input", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Chat input", + "description": "Input schema of the chat task", + "instillShortDescription": "Input schema of the chat task", + "type": "object", + "properties": { + "data": { + "description": "Input data", + "instillShortDescription": "Input data", + "type": "object", + "properties": { + "model": { + "description": "The model to be used.", + "instillShortDescription": "The model to be used.", + "instillAcceptFormats": [ + "string" + ], + "title": "Model Name", + "type": "string" + }, + "messages": { + "title": "Chat Messages", + "type": "array", + "items": { + "type": "object", + "properties": { + "content": { + "description": "The message content", + "instillShortDescription": "The message content", + "title": "Content", + "type": "array", + "items": { + "type": "object", + "oneOf": [ + { + "type": "object", + "properties": { + "text": { + "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", + "type" + ] + }, + { + "type": "object", + "properties": { + "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": [ + "image/*" + ], + "type": "string" + }, + "type": { + "title": "Content type", + "description": "Input content type", + "instillShortDescription": "Input content type", + "instillAcceptFormats": [ + "string" + ], + "type": "string", + "const": "image-base64" + } + }, + "required": [ + "image-base64", + "type" + ] + } + ] + } + }, + "role": { + "description": "The message role, i.e. 'system', 'user' or 'assistant'", + "instillShortDescription": "The message role, i.e. 'system', 'user' or 'assistant'", + "instillAcceptFormats": [ + "string" + ], + "title": "Role", + "type": "string", + "enum": [ + "system", + "user", + "assistant" + ] + }, + "name": { + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", + "instillShortDescription": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", + "instillAcceptFormats": [ + "string" + ], + "title": "Name", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + } + } + }, + "required": [ + "model", + "messages" + ] + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": { + "max-tokens": { + "title": "Max new tokens", + "type": "integer", + "description": "The maximum number of tokens for model to generate", + "instillShortDescription": "The maximum number of tokens for model to generate", + "instillAcceptFormats": [ + "integer" + ], + "default": 50 + }, + "seed": { + "title": "Seed", + "type": "integer", + "description": "The seed, default is 0", + "instillShortDescription": "The seed, default is 0", + "instillAcceptFormats": [ + "integer" + ], + "default": 0 + }, + "n": { + "title": "Number of choices", + "type": "integer", + "description": "How many chat completion choices to generate for each input message.", + "instillShortDescription": "How many chat completion choices to generate for each input message.", + "instillAcceptFormats": [ + "integer" + ], + "default": 1 + }, + "temperature": { + "title": "Temperature", + "type": "number", + "description": "The temperature for sampling", + "instillShortDescription": "The temperature for sampling", + "instillAcceptFormats": [ + "number" + ], + "default": 0.7 + }, + "top-p": { + "title": "Top P", + "type": "number", + "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.", + "instillShortDescription": "Nucleus sampling", + "instillAcceptFormats": [ + "number" + ], + "default": 1 + }, + "stream": { + "title": "Stream", + "type": "boolean", + "description": "If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events as they become available.", + "instillShortDescription": "If set, partial message deltas will be sent", + "instillAcceptFormats": [ + "boolean" + ], + "default": false + } + } + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Chat output", + "description": "Output schema of the chat task", + "instillShortDescription": "Output schema of the chat task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "properties": { + "choices": { + "title": "Choices", + "type": "array", + "description": "List of chat completion choices", + "instillShortDescription": "List of chat completion choices", + "instillFormat": "array", + "items": { + "type": "object", + "properties": { + "finish-reason": { + "title": "Finish reason", + "type": "string", + "description": "The reason the model stopped generating tokens.", + "instillShortDescription": "The reason the model stopped generating tokens.", + "instillFormat": "string", + "enum": [ + "stop", + "length" + ] + }, + "index": { + "title": "Index", + "type": "integer", + "description": "The index of the choice in the list of choices.", + "instillShortDescription": "The index of the choice in the list of choices.", + "instillFormat": "integer" + }, + "message": { + "title": "Message", + "type": "object", + "description": "A chat message generated by the model.", + "instillShortDescription": "A chat message generated by the model.", + "properties": { + "content": { + "title": "Content", + "type": "string", + "description": "The contents of the message.", + "instillShortDescription": "The contents of the message.", + "instillFormat": "string" + }, + "role": { + "title": "Role", + "type": "string", + "description": "The role of the author of this message.", + "instillShortDescription": "The role of the author of this message.", + "instillFormat": "string" + } + } + }, + "created": { + "title": "Created", + "type": "integer", + "description": "The Unix timestamp (in seconds) of when the chat completion was created.", + "instillShortDescription": "The Unix timestamp (in seconds) of when the chat completion was created.", + "instillFormat": "integer" + } + }, + "required": [ + "finish-reason", + "index", + "message", + "created" + ] + } + } + }, + "required": [ + "choices" + ] + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": { + "usage": { + "description": "Usage statistics for the request.", + "instillShortDescription": "Usage statistics for the request.", + "type": "object", + "properties": { + "completion-tokens": { + "title": "Completion tokens", + "type": "integer", + "description": "Number of tokens in the generated response.", + "instillShortDescription": "Number of tokens in the generated response.", + "instillFormat": "integer" + }, + "prompt-tokens": { + "title": "Prompt tokens", + "type": "integer", + "description": "Number of tokens in the prompt.", + "instillShortDescription": "Number of tokens in the prompt.", + "instillFormat": "integer" + }, + "total-tokens": { + "title": "Total tokens", + "type": "integer", + "description": "Total number of tokens used in the request (prompt + completion).", + "instillShortDescription": "Total number of tokens used in the request (prompt + completion).", + "instillFormat": "integer" + } + }, + "required": [ + "completion-tokens", + "prompt-tokens", + "total-tokens" + ] + } + } + } + }, + "required": [ + "data" + ] + } + }, + "TASK_COMPLETION": { + "title": "Completion", + "instillShortDescription": "Generate text response base on input", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Completion input", + "description": "Input schema of the completion task", + "instillShortDescription": "Input schema of the completion task", + "type": "object", + "properties": { + "data": { + "description": "Input data", + "instillShortDescription": "Input data", + "type": "object", + "properties": { + "model": { + "description": "The model to be used.", + "instillShortDescription": "The model to be used.", + "instillAcceptFormats": [ + "string" + ], + "title": "Model Name", + "type": "string" + }, + "system-message": { + "title": "System message", + "type": "string", + "description": "The contents of the system message.", + "instillShortDescription": "The contents of the system message.", + "instillAcceptFormats": [ + "string" + ] + }, + "prompt": { + "title": "Input prompt", + "type": "string", + "description": "The input prompt to generate text on.", + "instillShortDescription": "The input prompt to generate text on.", + "instillAcceptFormats": [ + "string" + ] + } + }, + "required": [ + "model", + "prompt" + ] + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": { + "max-tokens": { + "title": "Max new tokens", + "type": "integer", + "description": "The maximum number of tokens for model to generate", + "instillShortDescription": "The maximum number of tokens for model to generate", + "instillAcceptFormats": [ + "integer" + ], + "default": 50 + }, + "seed": { + "title": "Seed", + "type": "integer", + "description": "The seed, default is 0", + "instillShortDescription": "The seed, default is 0", + "instillAcceptFormats": [ + "integer" + ], + "default": 0 + }, + "n": { + "title": "Number of choices", + "type": "integer", + "description": "How many chat completion choices to generate for each input message.", + "instillShortDescription": "How many chat completion choices to generate for each input message.", + "instillAcceptFormats": [ + "integer" + ], + "default": 1 + }, + "temperature": { + "title": "Temperature", + "type": "number", + "description": "The temperature for sampling", + "instillShortDescription": "The temperature for sampling", + "instillAcceptFormats": [ + "number" + ], + "default": 0.7 + }, + "top-p": { + "title": "Top P", + "type": "number", + "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.", + "instillShortDescription": "Nucleus sampling", + "instillAcceptFormats": [ + "number" + ], + "default": 1 + }, + "stream": { + "title": "Stream", + "type": "boolean", + "description": "If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events as they become available.", + "instillShortDescription": "If set, partial message deltas will be sent", + "instillAcceptFormats": [ + "boolean" + ], + "default": false + } + } + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Chat output", + "description": "Output schema of the chat task", + "instillShortDescription": "Output schema of the chat task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "properties": { + "choices": { + "title": "Choices", + "type": "array", + "description": "List of chat completion choices", + "instillShortDescription": "List of chat completion choices", + "instillFormat": "array", + "items": { + "type": "object", + "properties": { + "finish-reason": { + "title": "Finish reason", + "type": "string", + "description": "The reason the model stopped generating tokens.", + "instillShortDescription": "The reason the model stopped generating tokens.", + "instillFormat": "string", + "enum": [ + "stop", + "length" + ] + }, + "index": { + "title": "Index", + "type": "integer", + "description": "The index of the choice in the list of choices.", + "instillShortDescription": "The index of the choice in the list of choices.", + "instillFormat": "integer" + }, + "content": { + "title": "Content", + "type": "string", + "description": "The contents generated by the model.", + "instillShortDescription": "The contents generated by the model.", + "instillFormat": "string" + }, + "created": { + "title": "Created", + "type": "integer", + "description": "The Unix timestamp (in seconds) of when the chat completion was created.", + "instillShortDescription": "The Unix timestamp (in seconds) of when the chat completion was created.", + "instillFormat": "integer" + } + }, + "required": [ + "finish-reason", + "index", + "content", + "created" + ] + } + } + }, + "required": [ + "choices" + ] + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": { + "usage": { + "description": "Usage statistics for the request.", + "instillShortDescription": "Usage statistics for the request.", + "type": "object", + "properties": { + "completion-tokens": { + "title": "Completion tokens", + "type": "integer", + "description": "Number of tokens in the generated response.", + "instillShortDescription": "Number of tokens in the generated response.", + "instillFormat": "integer" + }, + "prompt-tokens": { + "title": "Prompt tokens", + "type": "integer", + "description": "Number of tokens in the prompt.", + "instillShortDescription": "Number of tokens in the prompt.", + "instillFormat": "integer" + }, + "total-tokens": { + "title": "Total tokens", + "type": "integer", + "description": "Total number of tokens used in the request (prompt + completion).", + "instillShortDescription": "Total number of tokens used in the request (prompt + completion).", + "instillFormat": "integer" + } + }, + "required": [ + "completion-tokens", + "prompt-tokens", + "total-tokens" + ] + } + } + } + }, + "required": [ + "data" + ] + } + }, + "TASK_TEXT_TO_IMAGE": { + "title": "Completion", + "instillShortDescription": "Generate text response base on input", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Completion input", + "description": "Input schema of the completion task", + "instillShortDescription": "Input schema of the completion task", + "type": "object", + "properties": { + "data": { + "description": "Input data", + "instillShortDescription": "Input data", + "type": "object", + "properties": { + "model": { + "description": "The model to be used.", + "instillShortDescription": "The model to be used.", + "instillAcceptFormats": [ + "string" + ], + "title": "Model Name", + "type": "string" + }, + "prompt": { + "title": "Input prompt", + "type": "string", + "description": "What you wish to see in the output image. A strong, descriptive prompt that clearly defines elements, colors, and subjects will lead to better results.", + "instillShortDescription": "Descriptive prompt.", + "instillAcceptFormats": [ + "string" + ] + } + }, + "required": [ + "model", + "prompt" + ] + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": { + "aspect-ratio": { + "title": "Aspect ratio", + "type": "string", + "description": "Controls the aspect ratio of the generated image. Defaults to 1:1.", + "instillShortDescription": "Controls the aspect ratio of the generated image. Defaults to 1:1.", + "instillAcceptFormats": [ + "string" + ], + "default": "1:1", + "enum": [ + "16:9", + "1:1", + "21:9", + "2:3", + "3:2", + "4:5", + "5:4", + "9:16", + "9:21" + ] + }, + "negative-prompt": { + "title": "Aspect ratio", + "type": "string", + "description": "Keywords of what you do not wish to see in the output image.", + "instillShortDescription": "Keywords of what you do not wish to see in the output image.", + "instillAcceptFormats": [ + "string" + ], + "default": "1:1" + }, + "n": { + "title": "Number of choices", + "type": "integer", + "description": "How many samples to generate for each input prompt.", + "instillShortDescription": "How many samples to generate for each input prompt.", + "instillAcceptFormats": [ + "integer" + ], + "default": 1 + }, + "seed": { + "title": "Seed", + "type": "integer", + "description": "The seed, default is 0", + "instillShortDescription": "The seed, default is 0", + "instillAcceptFormats": [ + "integer" + ], + "default": 0 + } + } + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Chat output", + "description": "Output schema of the chat task", + "instillShortDescription": "Output schema of the chat task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "properties": { + "choices": { + "title": "Choices", + "type": "array", + "description": "List of generated sample images", + "instillShortDescription": "List of generated sample images", + "instillFormat": "array", + "items": { + "type": "object", + "properties": { + "finish-reason": { + "title": "Finish reason", + "type": "string", + "description": "The reason the model stopped generating tokens.", + "instillShortDescription": "The reason the model stopped generating tokens.", + "instillFormat": "string", + "enum": [ + "content_filtered", + "success" + ] + }, + "image": { + "title": "Image", + "type": "string", + "description": "The generated image, encoded to base64.", + "instillShortDescription": "The generated image, encoded to base64.", + "instillFormat": "string" + } + }, + "required": [ + "finish-reason", + "image" + ] + } + } + }, + "required": [ + "choices" + ] + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": { + "usage": { + "description": "Usage statistics for the request.", + "instillShortDescription": "Usage statistics for the request.", + "type": "object", + "properties": {}, + "required": [] + } + } + } + }, + "required": [ + "data" + ] + } + }, + "TASK_CLASSIFICATION": { + "title": "Classification", + "instillShortDescription": "Classify images into predefined categories.", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Classification input", + "description": "Input schema of the classification task", + "instillShortDescription": "Input schema of the classification task", + "type": "object", + "properties": { + "data": { + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/vision-input", + "type": "object" + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": {} + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Classification output", + "description": "Output schema of the classification task", + "instillShortDescription": "Output schema of the classification task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/classification" + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": { + "usage": { + "description": "Usage statistics for the request.", + "instillShortDescription": "Usage statistics for the request.", + "type": "object", + "properties": {}, + "required": [] + } + } + } + }, + "required": [ + "data" + ] + } + }, + "TASK_DETECTION": { + "title": "Detection", + "instillShortDescription": "Detect and localize multiple objects in images.", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Detection input", + "description": "Input schema of the detection task", + "instillShortDescription": "Input schema of the detection task", + "type": "object", + "properties": { + "data": { + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/vision-input", + "type": "object" + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": {} + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Detection output", + "description": "Output schema of the detection task", + "instillShortDescription": "Output schema of the detection task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/detection" + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": { + "usage": { + "description": "Usage statistics for the request.", + "instillShortDescription": "Usage statistics for the request.", + "type": "object", + "properties": {}, + "required": [] + } + } + } + }, + "required": [ + "data" + ] + } + }, + "TASK_KEYPOINT": { + "title": "Keypoint", + "instillShortDescription": "Detect and localize multiple keypoints of objects in images.", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Keypoint input", + "description": "Input schema of the keypoint task", + "instillShortDescription": "Input schema of the keypoint task", + "type": "object", + "properties": { + "data": { + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/vision-input", + "type": "object" + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": {} + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Keypoint output", + "description": "Output schema of the keypoint task", + "instillShortDescription": "Output schema of the keypoint task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/keypoint" + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": { + "usage": { + "description": "Usage statistics for the request.", + "instillShortDescription": "Usage statistics for the request.", + "type": "object", + "properties": {}, + "required": [] + } + } + } + }, + "required": [ + "data" + ] + } + }, + "TASK_OCR": { + "title": "OCR", + "instillShortDescription": "Detect and recognize text in images.", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OCR input", + "description": "Input schema of the OCR task", + "instillShortDescription": "Input schema of the OCR task", + "type": "object", + "properties": { + "data": { + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/vision-input", + "type": "object" + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": {} + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OCR output", + "description": "Output schema of the OCR task", + "instillShortDescription": "Output schema of the OCR task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/ocr" + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": { + "usage": { + "description": "Usage statistics for the request.", + "instillShortDescription": "Usage statistics for the request.", + "type": "object", + "properties": {}, + "required": [] + } + } + } + }, + "required": [ + "data" + ] + } + }, + "TASK_SEMANTIC_SEGMENTATION": { + "title": "Semantic Segmentation", + "instillShortDescription": "Classify image pixels into predefined categories.", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Semantic segmentation input", + "description": "Input schema of the semantic segmentation task", + "instillShortDescription": "Input schema of the semantic segmentation task", + "type": "object", + "properties": { + "data": { + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/vision-input", + "type": "object" + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": {} + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Semantic segmentation output", + "description": "Output schema of the semantic segmentation task", + "instillShortDescription": "Output schema of the semantic segmentation task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/semantic-segmentation" + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": { + "usage": { + "description": "Usage statistics for the request.", + "instillShortDescription": "Usage statistics for the request.", + "type": "object", + "properties": {}, + "required": [] + } + } + } + }, + "required": [ + "data" + ] + } + }, + "TASK_INSTANCE_SEGMENTATION": { + "title": "Instance Segmentation", + "instillShortDescription": "Detect, localize and delineate multiple objects in images.", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Instance segmentation input", + "description": "Input schema of the instance segmentation task", + "instillShortDescription": "Input schema of the instance segmentation task", + "type": "object", + "properties": { + "data": { + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/vision-input", + "type": "object" + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": {} + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Instance segmentation output", + "description": "Output schema of the Instance segmentation task", + "instillShortDescription": "Output schema of the Instance segmentation task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "$ref": "https://raw.githubusercontent.com/instill-ai/instill-core/62743c4/schema/schema.json#/$defs/instill-types/instance-segmentation" + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": { + "usage": { + "description": "Usage statistics for the request.", + "instillShortDescription": "Usage statistics for the request.", + "type": "object", + "properties": {}, + "required": [] + } + } + } + }, + "required": [ + "data" + ] + } + }, + "TASK_CUSTOM": { + "title": "Custom", + "instillShortDescription": "Custom, with arbitrary input/output data", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Custom input", + "description": "Input schema of the custom task", + "instillShortDescription": "Input schema of the custom task", + "type": "object", + "properties": { + "data": { + "description": "Input data", + "instillShortDescription": "Input data", + "type": "object", + "properties": {} + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": {} + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Custom output", + "description": "Output schema of the custom task", + "instillShortDescription": "Output schema of the custom task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "properties": {} + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": {} + } + }, + "required": [ + "data" + ] + } + } +} \ No newline at end of file diff --git a/schema/schema.json b/schema/schema.json new file mode 100644 index 00000000..c046551b --- /dev/null +++ b/schema/schema.json @@ -0,0 +1,403 @@ +{ + "$defs": { + "instill-types": { + "vision-input": { + "description": "Input data", + "instillShortDescription": "Input data", + "type": "object", + "oneOf": [ + { + "type": "object", + "properties": { + "model": { + "description": "The model to be used.", + "instillShortDescription": "The model to be used.", + "instillAcceptFormats": [ + "string" + ], + "title": "Model Name", + "type": "string" + }, + "image-url": { + "title": "Input image url", + "description": "Input image url.", + "instillShortDescription": "Input image url.", + "instillAcceptFormats": [ + "string" + ], + "type": "string" + }, + "type": { + "title": "URL", + "description": "Image url type.", + "instillShortDescription": "Image url type.", + "instillAcceptFormats": [ + "string" + ], + "type": "string", + "const": "image-url" + } + }, + "required": [ + "model", + "image-url", + "type" + ] + }, + { + "type": "object", + "properties": { + "model": { + "description": "The model to be used.", + "instillShortDescription": "The model to be used.", + "instillAcceptFormats": [ + "string" + ], + "title": "Model Name", + "type": "string" + }, + "image-base64": { + "title": "Input image file", + "description": "Input image file.", + "instillShortDescription": "Input image file.", + "instillAcceptFormats": [ + "image/*" + ], + "type": "string" + }, + "type": { + "title": "file", + "description": "Image base64 type.", + "instillShortDescription": "Image base64 type.", + "instillAcceptFormats": [ + "string" + ], + "type": "string", + "const": "image-base64" + } + }, + "required": [ + "model", + "image-base64", + "type" + ] + } + ] + }, + "bounding-box": { + "additionalProperties": false, + "description": "The detected bounding box in (left, top, width, height) format.", + "instillFormat": "structured/bounding-box", + "properties": { + "height": { + "description": "Bounding box height value", + "instillFormat": "number", + "title": "Height", + "type": "number" + }, + "left": { + "description": "Bounding box left x-axis value", + "instillFormat": "number", + "title": "Left", + "type": "number" + }, + "top": { + "description": "Bounding box top y-axis value", + "instillFormat": "number", + "title": "Top", + "type": "number" + }, + "width": { + "description": "Bounding box width value", + "instillFormat": "number", + "title": "Width", + "type": "number" + } + }, + "required": [ + "left", + "top", + "width", + "height" + ], + "title": "Bounding Box", + "type": "object" + }, + "classification": { + "additionalProperties": false, + "properties": { + "category": { + "description": "The predicted category of the input.", + "instillFormat": "string", + "title": "Category", + "type": "string" + }, + "score": { + "description": "The confidence score of the predicted category of the input.", + "instillFormat": "number", + "title": "Score", + "type": "number" + } + }, + "required": [ + "category", + "score" + ], + "type": "object" + }, + "detection": { + "additionalProperties": false, + "properties": { + "objects": { + "description": "A list of detected objects.", + "instillFormat": "array:structured/detection-object", + "items": { + "additionalProperties": false, + "instillFormat": "structured/detection-object", + "properties": { + "bounding-box": { + "$ref": "#/$defs/instill-types/bounding-box", + "title": "Bounding box" + }, + "category": { + "description": "The predicted category of the bounding box.", + "instillFormat": "string", + "title": "Category", + "type": "string" + }, + "score": { + "description": "The confidence score of the predicted category of the bounding box.", + "instillFormat": "number", + "title": "Score", + "type": "number" + } + }, + "required": [ + "bounding-box", + "category", + "score" + ], + "title": "Object", + "type": "object" + }, + "title": "Objects", + "type": "array" + } + }, + "required": [ + "objects" + ], + "type": "object" + }, + "embedding": { + "instillFormat": "array:number", + "items": { + "instillFormat": "number", + "title": "Embedding", + "type": "number" + }, + "title": "Embedding", + "type": "array" + }, + "instance-segmentation": { + "additionalProperties": false, + "properties": { + "objects": { + "description": "A list of detected instance bounding boxes.", + "instillFormat": "array:structured/instance-segmentation-object", + "items": { + "instillFormat": "structured/instance-segmentation-object", + "properties": { + "bounding-box": { + "$ref": "#/$defs/instill-types/bounding-box", + "title": "Bounding Box" + }, + "category": { + "description": "The predicted category of the bounding box.", + "instillFormat": "string", + "title": "Category", + "type": "string" + }, + "rle": { + "description": "Run Length Encoding (RLE) of instance mask within the bounding box.", + "instillFormat": "string", + "title": "RLE", + "type": "string" + }, + "score": { + "description": "The confidence score of the predicted instance object.", + "instillFormat": "number", + "title": "Score", + "type": "number" + } + }, + "required": [ + "rle", + "bounding-box", + "category", + "score" + ], + "title": "Object", + "type": "object" + }, + "title": "Objects", + "type": "array" + } + }, + "required": [ + "objects" + ], + "type": "object" + }, + "keypoint": { + "additionalProperties": false, + "properties": { + "objects": { + "description": "A list of keypoint objects, a keypoint object includes all the pre-defined keypoints of a detected object.", + "instillFormat": "array:structured/keypoint-object", + "items": { + "instillFormat": "structured/keypoint-object", + "properties": { + "bounding-box": { + "$ref": "#/$defs/instill-types/bounding-box", + "title": "Bounding Box" + }, + "keypoints": { + "description": "A keypoint group is composed of a list of pre-defined keypoints of a detected object.", + "items": { + "properties": { + "v": { + "description": "visibility score of the keypoint.", + "instillFormat": "number", + "type": "number" + }, + "x": { + "description": "x coordinate of the keypoint.", + "instillFormat": "number", + "type": "number" + }, + "y": { + "description": "y coordinate of the keypoint.", + "instillFormat": "number", + "type": "number" + } + }, + "required": [ + "x", + "y", + "v" + ], + "title": "Keypoints", + "type": "object" + }, + "title": "Keypoints", + "type": "array" + }, + "score": { + "description": "The confidence score of the predicted object.", + "instillFormat": "number", + "title": "Score", + "type": "number" + } + }, + "required": [ + "keypoints", + "score", + "bounding-box" + ], + "title": "Object", + "type": "object" + }, + "title": "Objects", + "type": "array" + } + }, + "required": [ + "objects" + ], + "type": "object" + }, + "ocr": { + "additionalProperties": false, + "properties": { + "objects": { + "description": "A list of detected bounding boxes.", + "instillFormat": "array:structured/ocr-object", + "items": { + "instillFormat": "structured/ocr-object", + "properties": { + "bounding-box": { + "$ref": "#/$defs/instill-types/bounding-box", + "title": "Bounding Box" + }, + "score": { + "description": "The confidence score of the predicted object.", + "instillFormat": "number", + "title": "Score", + "type": "number" + }, + "text": { + "description": "Text string recognised per bounding box.", + "instillFormat": "string", + "title": "Text", + "type": "string" + } + }, + "required": [ + "bounding-box", + "text", + "score" + ], + "title": "Object", + "type": "object" + }, + "title": "Objects", + "type": "array" + } + }, + "required": [ + "objects" + ], + "type": "object" + }, + "semantic-segmentation": { + "additionalProperties": false, + "properties": { + "stuffs": { + "description": "A list of RLE binary masks.", + "instillFormat": "array:structured/semantic-segmentation-stuff", + "items": { + "instillFormat": "structured/semantic-segmentation-stuff", + "properties": { + "category": { + "description": "Category text string corresponding to each stuff mask.", + "instillFormat": "string", + "title": "Category", + "type": "string" + }, + "rle": { + "description": "Run Length Encoding (RLE) of each stuff mask within the image.", + "instillFormat": "string", + "title": "RLE", + "type": "string" + } + }, + "required": [ + "rle", + "category" + ], + "title": "Object", + "type": "object" + }, + "title": "Stuffs", + "type": "array" + } + }, + "required": [ + "stuffs" + ], + "type": "object" + } + } + } +} \ No newline at end of file