This repository has been archived by the owner on Jan 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(collection): introduce
collection
component (#353)
Because - Users may need to perform data declaration or manipulation. This commit - Introduces the `collection` component with `TASK_ASSIGN` and `TASK_APPEND_ARRAY` tasks. - `TASK_ASSIGN` is used to assign a data. - `TASK_APPEND_ARRAY` is used to append data to an existing array.
- Loading branch information
Showing
12 changed files
with
362 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// TODO: chuang8511 | ||
package universalai | ||
package universalai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -436,4 +436,4 @@ | |
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
--- | ||
title: "Collection" | ||
lang: "en-US" | ||
draft: false | ||
description: "Learn about how to set up a VDP Collection component https://github.com/instill-ai/instill-core" | ||
--- | ||
|
||
The Collection component is a generic component that allows users to manipulate collection-type data. | ||
It can carry out the following tasks: | ||
|
||
- [Assign](#assign) | ||
- [Append Array](#append-array) | ||
|
||
|
||
|
||
## Release Stage | ||
|
||
`Alpha` | ||
|
||
|
||
|
||
## Configuration | ||
|
||
The component configuration is defined and maintained [here](https://github.com/instill-ai/component/blob/main/generic/collection/v0/config/definition.json). | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
## Supported Tasks | ||
|
||
### Assign | ||
|
||
Assign the data. | ||
|
||
|
||
| Input | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Task ID (required) | `task` | string | `TASK_ASSIGN` | | ||
| Data (required) | `data` | any | Specify the data you want to assign. | | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
| Output | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Data | `data` | any | The data you assign. | | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
### Append Array | ||
|
||
Add data to the end of an array. | ||
|
||
|
||
| Input | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Task ID (required) | `task` | string | `TASK_APPEND_ARRAY` | | ||
| Array (required) | `array` | array | Specify the array you want to append to. | | ||
| Data (required) | `element` | any | Specify the data you want to append. | | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
| Output | ID | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| Array | `array` | array | A updated array with the specified data appended to the end of it. | | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"availableTasks": [ | ||
"TASK_ASSIGN", | ||
"TASK_APPEND_ARRAY" | ||
], | ||
"custom": false, | ||
"documentationUrl": "https://www.instill.tech/docs/component/generic/collection", | ||
"icon": "assets/collection.svg", | ||
"iconUrl": "", | ||
"id": "collection", | ||
"public": true, | ||
"spec": {}, | ||
"title": "Collection", | ||
"type": "COMPONENT_TYPE_GENERIC", | ||
"uid": "eb611e31-fbe6-43ad-8671-5b9a2e351638", | ||
"version": "0.1.0", | ||
"sourceUrl": "https://github.com/instill-ai/component/blob/main/generic/collection/v0", | ||
"description": "Manipulate collection-type data", | ||
"releaseStage": "RELEASE_STAGE_ALPHA" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
{ | ||
"TASK_ASSIGN": { | ||
"instillShortDescription": "Assign the data.", | ||
"input": { | ||
"description": "Input", | ||
"instillEditOnNodeFields": [ | ||
"data" | ||
], | ||
"instillUIOrder": 0, | ||
"properties": { | ||
"data": { | ||
"description": "Specify the data you want to assign.", | ||
"instillAcceptFormats": [ | ||
"*" | ||
], | ||
"instillUIMultiline": true, | ||
"instillUIOrder": 0, | ||
"instillUpstreamTypes": [ | ||
"value", | ||
"reference", | ||
"template" | ||
], | ||
"required": [], | ||
"title": "Data" | ||
} | ||
}, | ||
"required": [ | ||
"data" | ||
], | ||
"title": "Input", | ||
"type": "object" | ||
}, | ||
"output": { | ||
"description": "Output", | ||
"instillEditOnNodeFields": [ | ||
"data" | ||
], | ||
"instillUIOrder": 0, | ||
"properties": { | ||
"data": { | ||
"description": "The data you assign.", | ||
"instillEditOnNodeFields": [], | ||
"instillFormat": "*", | ||
"instillUIOrder": 0, | ||
"required": [], | ||
"title": "Data" | ||
} | ||
}, | ||
"required": [ | ||
"data" | ||
], | ||
"title": "Output", | ||
"type": "object" | ||
} | ||
}, | ||
"TASK_APPEND_ARRAY": { | ||
"instillShortDescription": "Add data to the end of an array.", | ||
"input": { | ||
"description": "Input", | ||
"instillEditOnNodeFields": [ | ||
"array", | ||
"element" | ||
], | ||
"instillUIOrder": 0, | ||
"properties": { | ||
"array": { | ||
"description": "Specify the array you want to append to.", | ||
"instillAcceptFormats": [ | ||
"array:*" | ||
], | ||
"instillUIMultiline": true, | ||
"instillUIOrder": 0, | ||
"instillUpstreamTypes": [ | ||
"value", | ||
"reference", | ||
"template" | ||
], | ||
"items": {}, | ||
"required": [], | ||
"title": "Array", | ||
"type": "array" | ||
}, | ||
"element": { | ||
"description": "Specify the data you want to append.", | ||
"instillAcceptFormats": [ | ||
"*" | ||
], | ||
"instillUIMultiline": true, | ||
"instillUIOrder": 0, | ||
"instillUpstreamTypes": [ | ||
"value", | ||
"reference", | ||
"template" | ||
], | ||
"required": [], | ||
"title": "Data" | ||
} | ||
}, | ||
"required": [ | ||
"array", | ||
"element" | ||
], | ||
"title": "Input", | ||
"type": "object" | ||
}, | ||
"output": { | ||
"description": "Output", | ||
"instillEditOnNodeFields": [ | ||
"array" | ||
], | ||
"instillUIOrder": 0, | ||
"properties": { | ||
"array": { | ||
"description": "A updated array with the specified data appended to the end of it.", | ||
"instillEditOnNodeFields": [], | ||
"instillFormat": "array:*", | ||
"instillUIOrder": 0, | ||
"required": [], | ||
"title": "Array", | ||
"type": "array" | ||
} | ||
}, | ||
"required": [ | ||
"array" | ||
], | ||
"title": "Output", | ||
"type": "object" | ||
} | ||
} | ||
} |
Oops, something went wrong.