Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
chore(component): fix instillAcceptFormats bug in component schema (#39)
Browse files Browse the repository at this point in the history
Because

- the `instillAcceptFormats` didn't correctly reflect the component
schema for reference and template

This commit

- fix `instillAcceptFormats` bug in component schema
  • Loading branch information
donch1989 authored Nov 6, 2023
1 parent 0b3582d commit 98ac11e
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
24 changes: 12 additions & 12 deletions pkg/huggingface/config/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,33 +137,33 @@
"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",
"type": "array"
},
"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",
Expand Down Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions pkg/instill/config/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions pkg/numbers/config/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 8 additions & 8 deletions pkg/pinecone/config/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@
},
"vector": {
"description": "An array of dimensions for the query vector.",
"instillAcceptFormats": [
"array:number",
"array:integer"
],
"instillUIOrder": 2,
"instillUpstreamTypes": [
"reference"
],
"items": {
"description": "A dimension of the vector",
"example": 0.8167237,
"instillAcceptFormats": [
"number",
"integer"
],
"type": "number"
},
"minItems": 1,
Expand Down Expand Up @@ -187,17 +187,17 @@
},
"values": {
"description": "An array of dimensions for the vector to be saved",
"instillAcceptFormats": [
"array:number",
"array:integer"
],
"instillUIOrder": 1,
"instillUpstreamTypes": [
"reference"
],
"items": {
"description": "A dimension of the vector",
"example": 0.8167237,
"instillAcceptFormats": [
"number",
"integer"
],
"type": "number"
},
"minItems": 1,
Expand Down
40 changes: 20 additions & 20 deletions pkg/stabilityai/config/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 98ac11e

Please sign in to comment.