From 98ac11e6092bb24d673bcf06a6b5f2101e03802b Mon Sep 17 00:00:00 2001 From: "Chang, Hui-Tang" Date: Mon, 6 Nov 2023 23:47:23 +0800 Subject: [PATCH] chore(component): fix instillAcceptFormats bug in component schema (#39) Because - the `instillAcceptFormats` didn't correctly reflect the component schema for reference and template This commit - fix `instillAcceptFormats` bug in component schema --- go.mod | 2 +- go.sum | 4 ++-- pkg/huggingface/config/tasks.json | 24 +++++++++---------- pkg/instill/config/tasks.json | 12 +++++----- pkg/numbers/config/tasks.json | 6 ++--- pkg/pinecone/config/tasks.json | 16 ++++++------- pkg/stabilityai/config/tasks.json | 40 +++++++++++++++---------------- 7 files changed, 52 insertions(+), 52 deletions(-) diff --git a/go.mod b/go.mod index c2f7044..729a61a 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/ghodss/yaml v1.0.0 github.com/gofrs/uuid v4.4.0+incompatible github.com/h2non/filetype v1.1.3 - github.com/instill-ai/component v0.6.1-alpha.0.20231106092458-e4a7b537a08e + github.com/instill-ai/component v0.6.1-alpha.0.20231106153938-6032b6ce48ed github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231019202606-71607ddcd93f github.com/santhosh-tekuri/jsonschema/v5 v5.3.0 github.com/stretchr/testify v1.8.4 diff --git a/go.sum b/go.sum index 4bcf31d..2b60727 100644 --- a/go.sum +++ b/go.sum @@ -124,8 +124,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 h1:I/pwhnUln5wbMnTyRbzswA0/JxpK github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2/go.mod h1:lsuH8kb4GlMdSlI4alNIBBSAt5CHJtg3i+0WuN9J5YM= github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= -github.com/instill-ai/component v0.6.1-alpha.0.20231106092458-e4a7b537a08e h1:fEKsQ9ZCGoWLkLm6BBArFUj4zcMU6ngTFj3eNywSLrI= -github.com/instill-ai/component v0.6.1-alpha.0.20231106092458-e4a7b537a08e/go.mod h1:aQfeKtOn74cRQJOxvua1mQGpecasDaD+l46C60ILgdA= +github.com/instill-ai/component v0.6.1-alpha.0.20231106153938-6032b6ce48ed h1:cZfbReRzNeNdMEIFNs7oW+6ewxH87GtHGlEkLdDAEqU= +github.com/instill-ai/component v0.6.1-alpha.0.20231106153938-6032b6ce48ed/go.mod h1:aQfeKtOn74cRQJOxvua1mQGpecasDaD+l46C60ILgdA= github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231019202606-71607ddcd93f h1:hweU93u6qsg8GH/YSogOfa+wOZEnkilGsijcy1xKX7E= github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231019202606-71607ddcd93f/go.mod h1:q/YL5TZXD9nvmJ7Rih4gY3/B2HT2+GiFdxeZp9D+yE4= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= diff --git a/pkg/huggingface/config/tasks.json b/pkg/huggingface/config/tasks.json index 3742e9e..43e4284 100644 --- a/pkg/huggingface/config/tasks.json +++ b/pkg/huggingface/config/tasks.json @@ -137,16 +137,16 @@ "properties": { "generated_responses": { "description": "A list of strings corresponding to the earlier replies from the model.", + "instillAcceptFormats": [ + "array:string", + "array:text/*" + ], "instillUIOrder": 0, "instillUpstreamTypes": [ "value", "reference" ], "items": { - "instillAcceptFormats": [ - "string", - "text/*" - ], "type": "string" }, "title": "Generated Responses", @@ -154,16 +154,16 @@ }, "past_user_inputs": { "description": "A list of strings corresponding to the earlier replies from the user. Should be of the same length of generated_responses.", + "instillAcceptFormats": [ + "array:string", + "array:text/*" + ], "instillUIOrder": 1, "instillUpstreamTypes": [ "value", "reference" ], "items": { - "instillAcceptFormats": [ - "string", - "text/*" - ], "type": "string" }, "title": "Past User Inputs", @@ -831,16 +831,16 @@ "properties": { "sentences": { "description": "A list of strings which will be compared against the source_sentence.", + "instillAcceptFormats": [ + "array:string", + "array:text/*" + ], "instillUIOrder": 0, "instillUpstreamTypes": [ "value", "reference" ], "items": { - "instillAcceptFormats": [ - "string", - "text/*" - ], "type": "string" }, "title": "Sentences", diff --git a/pkg/instill/config/tasks.json b/pkg/instill/config/tasks.json index 0829adc..04b6979 100644 --- a/pkg/instill/config/tasks.json +++ b/pkg/instill/config/tasks.json @@ -67,7 +67,7 @@ "type": "object" }, "output": { - "$ref": "https://raw.githubusercontent.com/instill-ai/component/a7d08f3cab53b870b3d90a6db7b102f9e31860bc/schema.json#/$defs/instill_types/classification", + "$ref": "https://raw.githubusercontent.com/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/classification", "description": "Output", "instillUIOrder": 0, "title": "Output", @@ -80,7 +80,7 @@ "type": "object" }, "output": { - "$ref": "https://raw.githubusercontent.com/instill-ai/component/a7d08f3cab53b870b3d90a6db7b102f9e31860bc/schema.json#/$defs/instill_types/detection", + "$ref": "https://raw.githubusercontent.com/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/detection", "description": "Output", "instillUIOrder": 0, "title": "Output", @@ -93,7 +93,7 @@ "type": "object" }, "output": { - "$ref": "https://raw.githubusercontent.com/instill-ai/component/a7d08f3cab53b870b3d90a6db7b102f9e31860bc/schema.json#/$defs/instill_types/instance_segmentation", + "$ref": "https://raw.githubusercontent.com/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/instance_segmentation", "description": "Output", "instillUIOrder": 0, "title": "Output", @@ -106,7 +106,7 @@ "type": "object" }, "output": { - "$ref": "https://raw.githubusercontent.com/instill-ai/component/a7d08f3cab53b870b3d90a6db7b102f9e31860bc/schema.json#/$defs/instill_types/keypoint", + "$ref": "https://raw.githubusercontent.com/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/keypoint", "description": "Output", "instillUIOrder": 0, "title": "Output", @@ -119,7 +119,7 @@ "type": "object" }, "output": { - "$ref": "https://raw.githubusercontent.com/instill-ai/component/a7d08f3cab53b870b3d90a6db7b102f9e31860bc/schema.json#/$defs/instill_types/ocr", + "$ref": "https://raw.githubusercontent.com/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/ocr", "description": "Output", "instillUIOrder": 0, "title": "Output", @@ -132,7 +132,7 @@ "type": "object" }, "output": { - "$ref": "https://raw.githubusercontent.com/instill-ai/component/a7d08f3cab53b870b3d90a6db7b102f9e31860bc/schema.json#/$defs/instill_types/semantic_segmentation", + "$ref": "https://raw.githubusercontent.com/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/semantic_segmentation", "description": "Output", "instillUIOrder": 0, "title": "Output", diff --git a/pkg/numbers/config/tasks.json b/pkg/numbers/config/tasks.json index f1f8b28..cab932d 100644 --- a/pkg/numbers/config/tasks.json +++ b/pkg/numbers/config/tasks.json @@ -179,15 +179,15 @@ }, "images": { "description": "The images you want to upload to blockchain.", + "instillAcceptFormats": [ + "array:image/*" + ], "instillUIOrder": 0, "instillUpstreamTypes": [ "reference" ], "items": { "contentEncoding": "base64", - "instillAcceptFormats": [ - "image/*" - ], "type": "string" }, "title": "Images", diff --git a/pkg/pinecone/config/tasks.json b/pkg/pinecone/config/tasks.json index eaef8df..1fed75b 100644 --- a/pkg/pinecone/config/tasks.json +++ b/pkg/pinecone/config/tasks.json @@ -75,6 +75,10 @@ }, "vector": { "description": "An array of dimensions for the query vector.", + "instillAcceptFormats": [ + "array:number", + "array:integer" + ], "instillUIOrder": 2, "instillUpstreamTypes": [ "reference" @@ -82,10 +86,6 @@ "items": { "description": "A dimension of the vector", "example": 0.8167237, - "instillAcceptFormats": [ - "number", - "integer" - ], "type": "number" }, "minItems": 1, @@ -187,6 +187,10 @@ }, "values": { "description": "An array of dimensions for the vector to be saved", + "instillAcceptFormats": [ + "array:number", + "array:integer" + ], "instillUIOrder": 1, "instillUpstreamTypes": [ "reference" @@ -194,10 +198,6 @@ "items": { "description": "A dimension of the vector", "example": 0.8167237, - "instillAcceptFormats": [ - "number", - "integer" - ], "type": "number" }, "minItems": 1, diff --git a/pkg/stabilityai/config/tasks.json b/pkg/stabilityai/config/tasks.json index a9fe561..79bd670 100644 --- a/pkg/stabilityai/config/tasks.json +++ b/pkg/stabilityai/config/tasks.json @@ -105,16 +105,16 @@ }, "prompts": { "description": "An array of prompts to use for generation.", + "instillAcceptFormats": [ + "array:string", + "array:text/*" + ], "instillUIOrder": 0, "instillUpstreamTypes": [ "reference" ], "items": { - "$ref": "stabilityai.json#/components/schemas/TextPrompt/properties/text", - "instillAcceptFormats": [ - "string", - "text/*" - ] + "$ref": "stabilityai.json#/components/schemas/TextPrompt/properties/text" }, "minItems": 1, "title": "Prompts", @@ -213,16 +213,16 @@ }, "weights": { "description": "An array of weights to use for generation.", + "instillAcceptFormats": [ + "array:number", + "array:integer" + ], "instillUIOrder": 1, "instillUpstreamTypes": [ "reference" ], "items": { - "$ref": "stabilityai.json#/components/schemas/TextPrompt/properties/weight", - "instillAcceptFormats": [ - "number", - "integer" - ] + "$ref": "stabilityai.json#/components/schemas/TextPrompt/properties/weight" }, "minItems": 1, "title": "Weights", @@ -319,16 +319,16 @@ }, "prompts": { "description": "An array of prompts to use for generation.", + "instillAcceptFormats": [ + "array:string", + "array:text/*" + ], "instillUIOrder": 0, "instillUpstreamTypes": [ "reference" ], "items": { - "$ref": "stabilityai.json#/components/schemas/TextPrompt/properties/text", - "instillAcceptFormats": [ - "string", - "text/*" - ] + "$ref": "stabilityai.json#/components/schemas/TextPrompt/properties/text" }, "minItems": 1, "title": "Prompts", @@ -401,16 +401,16 @@ }, "weights": { "description": "An array of weights to use for generation.", + "instillAcceptFormats": [ + "array:number", + "array:integer" + ], "instillUIOrder": 1, "instillUpstreamTypes": [ "reference" ], "items": { - "$ref": "stabilityai.json#/components/schemas/TextPrompt/properties/weight", - "instillAcceptFormats": [ - "number", - "integer" - ] + "$ref": "stabilityai.json#/components/schemas/TextPrompt/properties/weight" }, "minItems": 1, "title": "Weights",