diff --git a/pkg/component/ai/anthropic/v0/README.mdx b/pkg/component/ai/anthropic/v0/README.mdx
index a15c36143..69ced0e4a 100644
--- a/pkg/component/ai/anthropic/v0/README.mdx
+++ b/pkg/component/ai/anthropic/v0/README.mdx
@@ -19,7 +19,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/anthropic/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/anthropic/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/anthropic/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/anthropic/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/anthropic/v0/config/definition.json b/pkg/component/ai/anthropic/v0/config/definition.json
deleted file mode 100644
index e23289848..000000000
--- a/pkg/component/ai/anthropic/v0/config/definition.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "availableTasks": [
- "TASK_TEXT_GENERATION_CHAT"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/ai/anthropic",
- "icon": "assets/anthropic.svg",
- "id": "anthropic",
- "public": true,
- "title": "Anthropic",
- "description": "Connect the AI models served on the Anthropic Platform.",
- "type": "COMPONENT_TYPE_AI",
- "uid": "42bdb620-74ad-486a-82da-25e45431b42c",
- "vendor": "Anthropic",
- "vendorAttributes": {},
- "version": "0.1.1",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/anthropic/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/ai/anthropic/v0/config/definition.yaml b/pkg/component/ai/anthropic/v0/config/definition.yaml
new file mode 100644
index 000000000..4350ae2d2
--- /dev/null
+++ b/pkg/component/ai/anthropic/v0/config/definition.yaml
@@ -0,0 +1,16 @@
+availableTasks:
+- TASK_TEXT_GENERATION_CHAT
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/ai/anthropic
+icon: assets/anthropic.svg
+id: anthropic
+public: true
+title: Anthropic
+description: Connect the AI models served on the Anthropic Platform.
+type: COMPONENT_TYPE_AI
+uid: 42bdb620-74ad-486a-82da-25e45431b42c
+vendor: Anthropic
+vendorAttributes: {}
+version: 0.1.1
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/anthropic/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/ai/anthropic/v0/config/setup.json b/pkg/component/ai/anthropic/v0/config/setup.json
index b6fd13378..a0dbdbbf6 100644
--- a/pkg/component/ai/anthropic/v0/config/setup.json
+++ b/pkg/component/ai/anthropic/v0/config/setup.json
@@ -1,5 +1,4 @@
{
- "$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"api-key": {
diff --git a/pkg/component/ai/anthropic/v0/config/setup.yaml b/pkg/component/ai/anthropic/v0/config/setup.yaml
new file mode 100644
index 000000000..75ac01eed
--- /dev/null
+++ b/pkg/component/ai/anthropic/v0/config/setup.yaml
@@ -0,0 +1,15 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Anthropic API key. To find your keys, visit the Anthropic
+ console page.
+ acceptFormats:
+ - string
+ instillSecret: true
+ instillCredential: true
+ uiOrder: 0
+ title: API Key
+ format: string
+required: []
+title: Anthropic Connection
+format: object
diff --git a/pkg/component/ai/anthropic/v0/config/tasks.json b/pkg/component/ai/anthropic/v0/config/tasks.json
deleted file mode 100644
index 9cde82953..000000000
--- a/pkg/component/ai/anthropic/v0/config/tasks.json
+++ /dev/null
@@ -1,245 +0,0 @@
-{
- "$defs": {
- "multi-modal-content": {
- "items": {
- "properties": {
- "image-url": {
- "properties": {
- "url": {
- "description": "Either a URL of the image or the base64 encoded image data.",
- "title": "URL",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "url"
- ],
- "title": "Image URL",
- "description": "The image URL.",
- "uiOrder": 0,
- "format": "object"
- },
- "text": {
- "description": "The text content.",
- "title": "Text",
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "description": "The type of the content part.",
- "enum": [
- "text",
- "image_url"
- ],
- "title": "Type",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [
- "type"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "chat-message": {
- "properties": {
- "content": {
- "$ref": "#/$defs/multi-modal-content",
- "description": "The message content.",
- "uiOrder": 1,
- "title": "Content"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "uiOrder": 0,
- "title": "Role",
- "format": "string"
- }
- },
- "required": [
- "role",
- "content"
- ],
- "title": "Chat Message",
- "format": "object"
- },
- "usage": {
- "description": "Usage tokens in Anthropic.",
- "uiOrder": 1,
- "properties": {
- "input-tokens": {
- "description": "The input tokens used by Anthropic.",
- "uiOrder": 2,
- "title": "Input Tokens",
- "format": "number"
- },
- "output-tokens": {
- "description": "The output tokens used by Anthropic.",
- "uiOrder": 3,
- "title": "Output Tokens",
- "format": "number"
- }
- },
- "required": [
- "input-tokens",
- "output-tokens"
- ],
- "title": "Usage",
- "format": "object"
- }
- },
- "TASK_TEXT_GENERATION_CHAT": {
- "shortDescription": "Provide text outputs in response to text inputs.",
- "description": "Anthropic's text generation models (often called generative pre-trained transformers or large language models) have been trained to understand natural language, code, and images. The models provide text outputs in response to their inputs. The inputs to these models are also referred to as \"prompts\". Designing a prompt is essentially how you “program” a large language model model, usually by providing instructions or some examples of how to successfully complete a task.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "chat-history": {
- "description": "Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {\"role\": \"The message role, i.e. 'system', 'user' or 'assistant'\", \"content\": \"message content\"}.",
- "acceptFormats": [
- "object"
- ],
- "shortDescription": "Incorporate external chat history, specifically previous messages within the conversation. (Note: Anthropic doesn't support sending images via image-url, use the 'prompt-images' field instead)",
- "uiOrder": 4,
- "items": {
- "$ref": "#/$defs/chat-message"
- },
- "title": "Chat history",
- "format": "array"
- },
- "max-new-tokens": {
- "default": 50,
- "description": "The maximum number of tokens for model to generate.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Max New Tokens",
- "format": "integer"
- },
- "model-name": {
- "enum": [
- "claude-3-5-sonnet-latest",
- "claude-3-5-sonnet-20241022",
- "claude-3-5-sonnet-20240620",
- "claude-3-opus-20240229",
- "claude-3-sonnet-20240229",
- "claude-3-haiku-20240307"
- ],
- "example": "claude-3-5-sonnet-latest",
- "description": "The Anthropic model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "instillCredentialMap": {
- "values": [
- "claude-3-5-sonnet-latest",
- "claude-3-5-sonnet-20241022",
- "claude-3-5-sonnet-20240620",
- "claude-3-opus-20240229",
- "claude-3-sonnet-20240229",
- "claude-3-haiku-20240307"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "title": "Model Name",
- "format": "string"
- },
- "prompt": {
- "description": "The prompt text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Prompt",
- "format": "string"
- },
- "prompt-images": {
- "description": "The prompt images (Note: The prompt images will be injected in the order they are provided to the 'prompt' message. Anthropic doesn't support sending images via image-url, use this field instead).",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "format": "string"
- },
- "title": "Prompt Images",
- "format": "array"
- },
- "seed": {
- "description": "The seed (Note: Not supported by Anthropic Models).",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Seed",
- "format": "integer"
- },
- "system-message": {
- "default": "You are a helpful assistant.",
- "description": "The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is set using a generic message as \"You are a helpful assistant.\".",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The system message helps set the behavior of the assistant",
- "uiOrder": 2,
- "title": "System Message",
- "format": "string"
- },
- "temperature": {
- "default": 0.7,
- "description": "The temperature for sampling.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 5,
- "title": "Temperature",
- "format": "number"
- },
- "top-k": {
- "default": 10,
- "description": "Top k for sampling.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Top K",
- "format": "integer"
- }
- },
- "required": [
- "prompt",
- "model-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "text": {
- "description": "Model Output.",
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- },
- "usage": {
- "$ref": "#/$defs/usage"
- }
- },
- "required": [
- "text"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/anthropic/v0/config/tasks.yaml b/pkg/component/ai/anthropic/v0/config/tasks.yaml
new file mode 100644
index 000000000..4840b66c3
--- /dev/null
+++ b/pkg/component/ai/anthropic/v0/config/tasks.yaml
@@ -0,0 +1,205 @@
+$defs:
+ multi-modal-content:
+ items:
+ properties:
+ image-url:
+ properties:
+ url:
+ description: Either a URL of the image or the base64 encoded image data.
+ title: URL
+ uiOrder: 0
+ format: string
+ required:
+ - url
+ title: Image URL
+ description: The image URL.
+ uiOrder: 0
+ format: object
+ text:
+ description: The text content.
+ title: Text
+ uiOrder: 1
+ format: string
+ type:
+ description: The type of the content part.
+ enum:
+ - text
+ - image_url
+ title: Type
+ uiOrder: 2
+ format: string
+ required:
+ - type
+ format: object
+ format: array
+ chat-message:
+ properties:
+ content:
+ $ref: '#/$defs/multi-modal-content'
+ description: The message content.
+ uiOrder: 1
+ title: Content
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ uiOrder: 0
+ title: Role
+ format: string
+ required:
+ - role
+ - content
+ title: Chat Message
+ format: object
+ usage:
+ description: Usage tokens in Anthropic.
+ uiOrder: 1
+ properties:
+ input-tokens:
+ description: The input tokens used by Anthropic.
+ uiOrder: 2
+ title: Input Tokens
+ format: number
+ output-tokens:
+ description: The output tokens used by Anthropic.
+ uiOrder: 3
+ title: Output Tokens
+ format: number
+ required:
+ - input-tokens
+ - output-tokens
+ title: Usage
+ format: object
+TASK_TEXT_GENERATION_CHAT:
+ shortDescription: Provide text outputs in response to text inputs.
+ description: Anthropic's text generation models (often called generative pre-trained
+ transformers or large language models) have been trained to understand natural
+ language, code, and images. The models provide text outputs in response to their
+ inputs. The inputs to these models are also referred to as "prompts". Designing
+ a prompt is essentially how you “program” a large language model model, usually
+ by providing instructions or some examples of how to successfully complete a task.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ chat-history:
+ description: 'Incorporate external chat history, specifically previous messages
+ within the conversation. Please note that System Message will be ignored
+ and will not have any effect when this field is populated. Each message
+ should adhere to the format: : {"role": "The message role, i.e. ''system'',
+ ''user'' or ''assistant''", "content": "message content"}.'
+ acceptFormats:
+ - object
+ shortDescription: 'Incorporate external chat history, specifically previous
+ messages within the conversation. (Note: Anthropic doesn''t support sending
+ images via image-url, use the ''prompt-images'' field instead)'
+ uiOrder: 4
+ items:
+ $ref: '#/$defs/chat-message'
+ title: Chat history
+ format: array
+ max-new-tokens:
+ default: 50
+ description: The maximum number of tokens for model to generate.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Max New Tokens
+ format: integer
+ model-name:
+ enum:
+ - claude-3-5-sonnet-latest
+ - claude-3-5-sonnet-20241022
+ - claude-3-5-sonnet-20240620
+ - claude-3-opus-20240229
+ - claude-3-sonnet-20240229
+ - claude-3-haiku-20240307
+ example: claude-3-5-sonnet-latest
+ description: The Anthropic model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ instillCredentialMap:
+ values:
+ - claude-3-5-sonnet-latest
+ - claude-3-5-sonnet-20241022
+ - claude-3-5-sonnet-20240620
+ - claude-3-opus-20240229
+ - claude-3-sonnet-20240229
+ - claude-3-haiku-20240307
+ targets:
+ - setup.api-key
+ title: Model Name
+ format: string
+ prompt:
+ description: The prompt text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Prompt
+ format: string
+ prompt-images:
+ description: 'The prompt images (Note: The prompt images will be injected
+ in the order they are provided to the ''prompt'' message. Anthropic doesn''t
+ support sending images via image-url, use this field instead).'
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ format: string
+ title: Prompt Images
+ format: array
+ seed:
+ description: 'The seed (Note: Not supported by Anthropic Models).'
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Seed
+ format: integer
+ system-message:
+ default: You are a helpful assistant.
+ description: The system message helps set the behavior of the assistant. For
+ example, you can modify the personality of the assistant or provide specific
+ instructions about how it should behave throughout the conversation. By
+ default, the model’s behavior is set using a generic message as "You are
+ a helpful assistant.".
+ acceptFormats:
+ - string
+ shortDescription: The system message helps set the behavior of the assistant
+ uiOrder: 2
+ title: System Message
+ format: string
+ temperature:
+ default: 0.7
+ description: The temperature for sampling.
+ acceptFormats:
+ - number
+ uiOrder: 5
+ title: Temperature
+ format: number
+ top-k:
+ default: 10
+ description: Top k for sampling.
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Top K
+ format: integer
+ required:
+ - prompt
+ - model-name
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ text:
+ description: Model Output.
+ uiOrder: 0
+ title: Text
+ format: string
+ usage:
+ $ref: '#/$defs/usage'
+ required:
+ - text
+ title: Output
+ format: object
diff --git a/pkg/component/ai/anthropic/v0/main.go b/pkg/component/ai/anthropic/v0/main.go
index f282584fe..3ca35ae42 100644
--- a/pkg/component/ai/anthropic/v0/main.go
+++ b/pkg/component/ai/anthropic/v0/main.go
@@ -26,12 +26,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -100,7 +100,7 @@ type source struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/cohere/v0/README.mdx b/pkg/component/ai/cohere/v0/README.mdx
index 7914bd8e1..2142e3c88 100644
--- a/pkg/component/ai/cohere/v0/README.mdx
+++ b/pkg/component/ai/cohere/v0/README.mdx
@@ -21,7 +21,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/cohere/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/cohere/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/cohere/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/cohere/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/cohere/v0/config/definition.json b/pkg/component/ai/cohere/v0/config/definition.json
deleted file mode 100644
index 7e1f44423..000000000
--- a/pkg/component/ai/cohere/v0/config/definition.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "availableTasks": [
- "TASK_TEXT_GENERATION_CHAT",
- "TASK_TEXT_EMBEDDINGS",
- "TASK_TEXT_RERANKING"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/ai/cohere",
- "icon": "assets/cohere.svg",
- "id": "cohere",
- "public": true,
- "title": "Cohere",
- "description": "Connect the AI models served on the Cohere Platform.",
- "type": "COMPONENT_TYPE_AI",
- "uid": "11550338-de54-4338-a4ca-4a21c4757817",
- "vendor": "Cohere",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/cohere/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/ai/cohere/v0/config/definition.yaml b/pkg/component/ai/cohere/v0/config/definition.yaml
new file mode 100644
index 000000000..d9d584eac
--- /dev/null
+++ b/pkg/component/ai/cohere/v0/config/definition.yaml
@@ -0,0 +1,17 @@
+availableTasks:
+- TASK_TEXT_GENERATION_CHAT
+- TASK_TEXT_EMBEDDINGS
+- TASK_TEXT_RERANKING
+documentationUrl: https://www.instill.tech/docs/component/ai/cohere
+icon: assets/cohere.svg
+id: cohere
+public: true
+title: Cohere
+description: Connect the AI models served on the Cohere Platform.
+type: COMPONENT_TYPE_AI
+uid: 11550338-de54-4338-a4ca-4a21c4757817
+vendor: Cohere
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/cohere/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/ai/cohere/v0/config/setup.json b/pkg/component/ai/cohere/v0/config/setup.json
deleted file mode 100644
index 9623b1912..000000000
--- a/pkg/component/ai/cohere/v0/config/setup.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Cohere API key. To find your keys, visit the Cohere dashboard page.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "instillCredential": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- }
- },
- "required": [],
- "title": "Cohere Connection",
- "format": "object"
-}
diff --git a/pkg/component/ai/cohere/v0/config/setup.yaml b/pkg/component/ai/cohere/v0/config/setup.yaml
new file mode 100644
index 000000000..4696dc677
--- /dev/null
+++ b/pkg/component/ai/cohere/v0/config/setup.yaml
@@ -0,0 +1,15 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Cohere API key. To find your keys, visit the Cohere
+ dashboard page.
+ acceptFormats:
+ - string
+ instillSecret: true
+ instillCredential: true
+ uiOrder: 0
+ title: API Key
+ format: string
+required: []
+title: Cohere Connection
+format: object
diff --git a/pkg/component/ai/cohere/v0/config/tasks.json b/pkg/component/ai/cohere/v0/config/tasks.json
deleted file mode 100644
index a0e73168a..000000000
--- a/pkg/component/ai/cohere/v0/config/tasks.json
+++ /dev/null
@@ -1,593 +0,0 @@
-{
- "$defs": {
- "multi-modal-content": {
- "items": {
- "properties": {
- "image-url": {
- "properties": {
- "url": {
- "description": "Either a URL of the image or the base64 encoded image data.",
- "title": "URL",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "url"
- ],
- "title": "Image URL",
- "description": "The image URL.",
- "uiOrder": 0,
- "format": "object"
- },
- "text": {
- "description": "The text content.",
- "title": "Text",
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "description": "The type of the content part.",
- "enum": [
- "text",
- "image_url"
- ],
- "title": "Type",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [
- "type"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "chat-message": {
- "properties": {
- "content": {
- "$ref": "#/$defs/multi-modal-content",
- "description": "The message content.",
- "uiOrder": 1,
- "title": "Content"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "uiOrder": 0,
- "title": "Role",
- "format": "string"
- }
- },
- "required": [
- "role",
- "content"
- ],
- "title": "Chat Message",
- "format": "object"
- },
- "common": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "image-base64": {
- "description": "Image base64.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 2,
- "title": "Image",
- "format": "string"
- },
- "model-name": {
- "description": "The Instill Model model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- }
- },
- "required": [
- "image-base64",
- "model-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "citation": {
- "properties": {
- "start": {
- "description": "The start position of the citation.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 0,
- "title": "Start",
- "format": "integer"
- },
- "end": {
- "description": "The end position of the citation.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "title": "End",
- "format": "integer"
- },
- "text": {
- "description": "The text body of the citation.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "start",
- "end",
- "text"
- ],
- "title": "Citation",
- "format": "object"
- },
- "command-usage": {
- "description": "Token Usage on the Cohere Platform Command Models.",
- "uiOrder": 1,
- "properties": {
- "input-tokens": {
- "description": "The input tokens used by Cohere Models.",
- "uiOrder": 2,
- "title": "Input Tokens",
- "format": "number"
- },
- "output-tokens": {
- "description": "The output tokens generated by Cohere Models.",
- "uiOrder": 3,
- "title": "Output Tokens",
- "format": "number"
- }
- },
- "required": [
- "input-tokens",
- "output-tokens"
- ],
- "title": "Usage",
- "format": "object"
- },
- "rerank-usage": {
- "description": "Search Usage on the Cohere Platform Rerank Models.",
- "uiOrder": 1,
- "properties": {
- "search-counts": {
- "description": "The search count used by Cohere Models.",
- "uiOrder": 1,
- "title": "Search Counts",
- "format": "number"
- }
- },
- "required": [
- "search-counts"
- ],
- "title": "Usage",
- "format": "object"
- },
- "embed-usage": {
- "description": "Token usage on the Cohere platform embed models.",
- "uiOrder": 1,
- "properties": {
- "tokens": {
- "description": "The token count used by Cohere Models.",
- "uiOrder": 1,
- "title": "Token Count",
- "format": "number"
- }
- },
- "required": [
- "tokens"
- ],
- "title": "Usage",
- "format": "object"
- }
- },
- "TASK_TEXT_GENERATION_CHAT": {
- "shortDescription": "Provide text outputs in response to text inputs.",
- "description": "Cohere's text generation models (often called generative pre-trained transformers or large language models) have been trained to understand natural language, code, and images. The models provide text outputs in response to their inputs. The inputs to these models are also referred to as \"prompts\". Designing a prompt is essentially how you “program” a large language model model, usually by providing instructions or some examples of how to successfully complete a task.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "chat-history": {
- "description": "Incorporate external chat history, specifically previous messages within the conversation. Each message should adhere to the format: : {\"role\": \"The message role, i.e. 'USER' or 'CHATBOT'\", \"content\": \"message content\"}.",
- "acceptFormats": [
- "object"
- ],
- "shortDescription": "Incorporate external chat history, specifically previous messages within the conversation. (Note: As for 2024-06-24 Cohere models are not multimodal, so images will be ignored.)",
- "uiOrder": 4,
- "items": {
- "$ref": "#/$defs/chat-message"
- },
- "title": "Chat history",
- "format": "array"
- },
- "max-new-tokens": {
- "default": 50,
- "description": "The maximum number of tokens for model to generate (default=50).",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Max New Tokens",
- "format": "integer"
- },
- "model-name": {
- "enum": [
- "command-r-plus",
- "command-r",
- "command",
- "command-nightly",
- "command-light",
- "command-light-nightly"
- ],
- "example": "command-r-plus",
- "description": "The Cohere command model to be used.",
- "acceptFormats": [
- "string"
- ],
- "instillCredentialMap": {
- "values": [
- "command-r-plus",
- "command-r",
- "command",
- "command-light"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- },
- "prompt": {
- "description": "The prompt text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Prompt",
- "format": "string"
- },
- "prompt-images": {
- "description": "The prompt images (Note: As for 2024-06-24 Cohere models are not multimodal, so images will be ignored.).",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "format": "string"
- },
- "title": "Prompt Images",
- "format": "array"
- },
- "seed": {
- "default": 42,
- "description": "The seed (default=42).",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Seed",
- "format": "integer"
- },
- "system-message": {
- "default": "You are a helpful assistant.",
- "description": "The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is using a generic message as \"You are a helpful assistant.\".",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The system message helps set the behavior of the assistant",
- "uiOrder": 2,
- "title": "System Message",
- "format": "string"
- },
- "temperature": {
- "default": 0.7,
- "description": "The temperature for sampling (default=0.7).",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 5,
- "title": "Temperature",
- "format": "number"
- },
- "top-k": {
- "default": 10,
- "description": "Top k for sampling (default=10).",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Top K",
- "format": "integer"
- },
- "documents": {
- "description": "The documents to be used for the model, for optimal performance, the length of each document should be less than 300 words.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "format": "string"
- },
- "title": "Documents",
- "format": "array"
- }
- },
- "required": [
- "prompt",
- "model-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "text": {
- "description": "Model Output.",
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- },
- "citations": {
- "description": "Citations.",
- "uiOrder": 1,
- "acceptFormats": [
- "array"
- ],
- "title": "Citations",
- "items": {
- "$ref": "#/$defs/citation"
- },
- "format": "array"
- },
- "usage": {
- "$ref": "#/$defs/command-usage",
- "uiOrder": 2
- }
- },
- "required": [
- "text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_EMBEDDINGS": {
- "shortDescription": "Turn text into a vector of numbers that capture its meaning, unlocking use cases like semantic search.",
- "description": "An embedding is a list of floating point numbers that captures semantic information about the text that it represents.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "model-name": {
- "enum": [
- "embed-english-v3.0",
- "embed-multilingual-v3.0",
- "embed-english-light-v3.0",
- "embed-multilingual-light-v3.0"
- ],
- "example": "embed-multilingual-v3.0",
- "description": "The Cohere embed model to be used.",
- "acceptFormats": [
- "string"
- ],
- "instillCredentialMap": {
- "values": [
- "embed-english-v3.0",
- "embed-multilingual-v3.0",
- "embed-english-light-v3.0",
- "embed-multilingual-light-v3.0"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- },
- "text": {
- "description": "The text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Text",
- "format": "string"
- },
- "input-type": {
- "enum": [
- "search_document",
- "search_query",
- "classification",
- "clustering"
- ],
- "example": "search_document",
- "description": "Specifies the type of input passed to the model.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Input Type",
- "format": "string"
- },
- "embedding-type": {
- "enum": [
- "float",
- "int8",
- "uint8",
- "binary",
- "ubinary"
- ],
- "example": "float",
- "description": "Specifies the return type of embedding, Note that 'binary'/'ubinary' options means the component will return packed unsigned binary embeddings. The length of each binary embedding is 1/8 the length of the float embeddings of the provided model.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Embedding Type",
- "format": "string"
- }
- },
- "required": [
- "text",
- "model-name",
- "input-type",
- "embedding-type"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "embedding": {
- "items": {
- "title": "Embedding",
- "format": "number"
- },
- "description": "Embedding of the input text.",
- "uiOrder": 0,
- "title": "Embedding",
- "format": "array"
- },
- "usage": {
- "$ref": "#/$defs/embed-usage"
- }
- },
- "required": [
- "embedding"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_RERANKING": {
- "shortDescription": "Sort text inputs by semantic relevance to a specified query.",
- "description": "Rerank models sort text inputs by semantic relevance to a specified query. They are often used to sort search results returned from an existing search solution.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "model-name": {
- "enum": [
- "rerank-english-v3.0",
- "rerank-multilingual-v3.0"
- ],
- "example": "rerank-multilingual-v3.0",
- "description": "The Cohere rerank model to be used.",
- "acceptFormats": [
- "string"
- ],
- "instillCredentialMap": {
- "values": [
- "rerank-english-v3.0",
- "rerank-multilingual-v3.0"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- },
- "query": {
- "description": "The query.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Query",
- "format": "string"
- },
- "documents": {
- "description": "The documents to be used for reranking.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 2,
- "items": {
- "format": "string"
- },
- "title": "Documents",
- "format": "array"
- },
- "top-n": {
- "default": 3,
- "description": "The number of most relevant documents or indices to return. Defaults to the length of the documents (default=3).",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 3,
- "title": "Top N",
- "format": "integer"
- },
- "max-chunks-per-doc": {
- "default": 10,
- "description": "The maximum number of chunks to produce internally from a document (default=10).",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Maximum number of chunks per document",
- "format": "integer"
- }
- },
- "required": [
- "query",
- "model-name",
- "documents"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "ranking": {
- "items": {
- "title": "Documents",
- "format": "string"
- },
- "description": "Reranked documents.",
- "uiOrder": 0,
- "title": "Reranked documents",
- "format": "array"
- },
- "usage": {
- "$ref": "#/$defs/rerank-usage"
- },
- "relevance": {
- "items": {
- "title": "Relevance",
- "format": "number"
- },
- "description": "The relevance scores of the reranked documents.",
- "uiOrder": 0,
- "title": "Reranked documents relevance",
- "format": "array"
- }
- },
- "required": [
- "ranking"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/cohere/v0/config/tasks.yaml b/pkg/component/ai/cohere/v0/config/tasks.yaml
new file mode 100644
index 000000000..0a7249e1b
--- /dev/null
+++ b/pkg/component/ai/cohere/v0/config/tasks.yaml
@@ -0,0 +1,479 @@
+$defs:
+ multi-modal-content:
+ items:
+ properties:
+ image-url:
+ properties:
+ url:
+ description: Either a URL of the image or the base64 encoded image data.
+ title: URL
+ uiOrder: 0
+ format: string
+ required:
+ - url
+ title: Image URL
+ description: The image URL.
+ uiOrder: 0
+ format: object
+ text:
+ description: The text content.
+ title: Text
+ uiOrder: 1
+ format: string
+ type:
+ description: The type of the content part.
+ enum:
+ - text
+ - image_url
+ title: Type
+ uiOrder: 2
+ format: string
+ required:
+ - type
+ format: object
+ format: array
+ chat-message:
+ properties:
+ content:
+ $ref: '#/$defs/multi-modal-content'
+ description: The message content.
+ uiOrder: 1
+ title: Content
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ uiOrder: 0
+ title: Role
+ format: string
+ required:
+ - role
+ - content
+ title: Chat Message
+ format: object
+ common:
+ description: Input.
+ uiOrder: 0
+ properties:
+ image-base64:
+ description: Image base64.
+ acceptFormats:
+ - image/*
+ uiOrder: 2
+ title: Image
+ format: string
+ model-name:
+ description: The Instill Model model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Model Name
+ format: string
+ required:
+ - image-base64
+ - model-name
+ title: Input
+ format: object
+ citation:
+ properties:
+ start:
+ description: The start position of the citation.
+ acceptFormats:
+ - integer
+ uiOrder: 0
+ title: Start
+ format: integer
+ end:
+ description: The end position of the citation.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ title: End
+ format: integer
+ text:
+ description: The text body of the citation.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Text
+ format: string
+ required:
+ - start
+ - end
+ - text
+ title: Citation
+ format: object
+ command-usage:
+ description: Token Usage on the Cohere Platform Command Models.
+ uiOrder: 1
+ properties:
+ input-tokens:
+ description: The input tokens used by Cohere Models.
+ uiOrder: 2
+ title: Input Tokens
+ format: number
+ output-tokens:
+ description: The output tokens generated by Cohere Models.
+ uiOrder: 3
+ title: Output Tokens
+ format: number
+ required:
+ - input-tokens
+ - output-tokens
+ title: Usage
+ format: object
+ rerank-usage:
+ description: Search Usage on the Cohere Platform Rerank Models.
+ uiOrder: 1
+ properties:
+ search-counts:
+ description: The search count used by Cohere Models.
+ uiOrder: 1
+ title: Search Counts
+ format: number
+ required:
+ - search-counts
+ title: Usage
+ format: object
+ embed-usage:
+ description: Token usage on the Cohere platform embed models.
+ uiOrder: 1
+ properties:
+ tokens:
+ description: The token count used by Cohere Models.
+ uiOrder: 1
+ title: Token Count
+ format: number
+ required:
+ - tokens
+ title: Usage
+ format: object
+TASK_TEXT_GENERATION_CHAT:
+ shortDescription: Provide text outputs in response to text inputs.
+ description: Cohere's text generation models (often called generative pre-trained
+ transformers or large language models) have been trained to understand natural
+ language, code, and images. The models provide text outputs in response to their
+ inputs. The inputs to these models are also referred to as "prompts". Designing
+ a prompt is essentially how you “program” a large language model model, usually
+ by providing instructions or some examples of how to successfully complete a task.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ chat-history:
+ description: 'Incorporate external chat history, specifically previous messages
+ within the conversation. Each message should adhere to the format: : {"role":
+ "The message role, i.e. ''USER'' or ''CHATBOT''", "content": "message content"}.'
+ acceptFormats:
+ - object
+ shortDescription: 'Incorporate external chat history, specifically previous
+ messages within the conversation. (Note: As for 2024-06-24 Cohere models
+ are not multimodal, so images will be ignored.)'
+ uiOrder: 4
+ items:
+ $ref: '#/$defs/chat-message'
+ title: Chat history
+ format: array
+ max-new-tokens:
+ default: 50
+ description: The maximum number of tokens for model to generate (default=50).
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Max New Tokens
+ format: integer
+ model-name:
+ enum:
+ - command-r-plus
+ - command-r
+ - command
+ - command-nightly
+ - command-light
+ - command-light-nightly
+ example: command-r-plus
+ description: The Cohere command model to be used.
+ acceptFormats:
+ - string
+ instillCredentialMap:
+ values:
+ - command-r-plus
+ - command-r
+ - command
+ - command-light
+ targets:
+ - setup.api-key
+ uiOrder: 0
+ title: Model Name
+ format: string
+ prompt:
+ description: The prompt text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Prompt
+ format: string
+ prompt-images:
+ description: 'The prompt images (Note: As for 2024-06-24 Cohere models are
+ not multimodal, so images will be ignored.).'
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ format: string
+ title: Prompt Images
+ format: array
+ seed:
+ default: 42
+ description: The seed (default=42).
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Seed
+ format: integer
+ system-message:
+ default: You are a helpful assistant.
+ description: The system message helps set the behavior of the assistant. For
+ example, you can modify the personality of the assistant or provide specific
+ instructions about how it should behave throughout the conversation. By
+ default, the model’s behavior is using a generic message as "You are a helpful
+ assistant.".
+ acceptFormats:
+ - string
+ shortDescription: The system message helps set the behavior of the assistant
+ uiOrder: 2
+ title: System Message
+ format: string
+ temperature:
+ default: 0.7
+ description: The temperature for sampling (default=0.7).
+ acceptFormats:
+ - number
+ uiOrder: 5
+ title: Temperature
+ format: number
+ top-k:
+ default: 10
+ description: Top k for sampling (default=10).
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Top K
+ format: integer
+ documents:
+ description: The documents to be used for the model, for optimal performance,
+ the length of each document should be less than 300 words.
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ format: string
+ title: Documents
+ format: array
+ required:
+ - prompt
+ - model-name
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ text:
+ description: Model Output.
+ uiOrder: 0
+ title: Text
+ format: string
+ citations:
+ description: Citations.
+ uiOrder: 1
+ acceptFormats:
+ - array
+ title: Citations
+ items:
+ $ref: '#/$defs/citation'
+ format: array
+ usage:
+ $ref: '#/$defs/command-usage'
+ uiOrder: 2
+ required:
+ - text
+ title: Output
+ format: object
+TASK_TEXT_EMBEDDINGS:
+ shortDescription: Turn text into a vector of numbers that capture its meaning, unlocking
+ use cases like semantic search.
+ description: An embedding is a list of floating point numbers that captures semantic
+ information about the text that it represents.
+ input:
+ uiOrder: 0
+ properties:
+ model-name:
+ enum:
+ - embed-english-v3.0
+ - embed-multilingual-v3.0
+ - embed-english-light-v3.0
+ - embed-multilingual-light-v3.0
+ example: embed-multilingual-v3.0
+ description: The Cohere embed model to be used.
+ acceptFormats:
+ - string
+ instillCredentialMap:
+ values:
+ - embed-english-v3.0
+ - embed-multilingual-v3.0
+ - embed-english-light-v3.0
+ - embed-multilingual-light-v3.0
+ targets:
+ - setup.api-key
+ uiOrder: 0
+ title: Model Name
+ format: string
+ text:
+ description: The text.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Text
+ format: string
+ input-type:
+ enum:
+ - search_document
+ - search_query
+ - classification
+ - clustering
+ example: search_document
+ description: Specifies the type of input passed to the model.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Input Type
+ format: string
+ embedding-type:
+ enum:
+ - float
+ - int8
+ - uint8
+ - binary
+ - ubinary
+ example: float
+ description: Specifies the return type of embedding, Note that 'binary'/'ubinary'
+ options means the component will return packed unsigned binary embeddings.
+ The length of each binary embedding is 1/8 the length of the float embeddings
+ of the provided model.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Embedding Type
+ format: string
+ required:
+ - text
+ - model-name
+ - input-type
+ - embedding-type
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ embedding:
+ items:
+ title: Embedding
+ format: number
+ description: Embedding of the input text.
+ uiOrder: 0
+ title: Embedding
+ format: array
+ usage:
+ $ref: '#/$defs/embed-usage'
+ required:
+ - embedding
+ title: Output
+ format: object
+TASK_TEXT_RERANKING:
+ shortDescription: Sort text inputs by semantic relevance to a specified query.
+ description: Rerank models sort text inputs by semantic relevance to a specified
+ query. They are often used to sort search results returned from an existing search
+ solution.
+ input:
+ uiOrder: 0
+ properties:
+ model-name:
+ enum:
+ - rerank-english-v3.0
+ - rerank-multilingual-v3.0
+ example: rerank-multilingual-v3.0
+ description: The Cohere rerank model to be used.
+ acceptFormats:
+ - string
+ instillCredentialMap:
+ values:
+ - rerank-english-v3.0
+ - rerank-multilingual-v3.0
+ targets:
+ - setup.api-key
+ uiOrder: 0
+ title: Model Name
+ format: string
+ query:
+ description: The query.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Query
+ format: string
+ documents:
+ description: The documents to be used for reranking.
+ acceptFormats:
+ - array
+ uiOrder: 2
+ items:
+ format: string
+ title: Documents
+ format: array
+ top-n:
+ default: 3
+ description: The number of most relevant documents or indices to return. Defaults
+ to the length of the documents (default=3).
+ acceptFormats:
+ - integer
+ uiOrder: 3
+ title: Top N
+ format: integer
+ max-chunks-per-doc:
+ default: 10
+ description: The maximum number of chunks to produce internally from a document
+ (default=10).
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Maximum number of chunks per document
+ format: integer
+ required:
+ - query
+ - model-name
+ - documents
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ ranking:
+ items:
+ title: Documents
+ format: string
+ description: Reranked documents.
+ uiOrder: 0
+ title: Reranked documents
+ format: array
+ usage:
+ $ref: '#/$defs/rerank-usage'
+ relevance:
+ items:
+ title: Relevance
+ format: number
+ description: The relevance scores of the reranked documents.
+ uiOrder: 0
+ title: Reranked documents relevance
+ format: array
+ required:
+ - ranking
+ title: Output
+ format: object
diff --git a/pkg/component/ai/cohere/v0/main.go b/pkg/component/ai/cohere/v0/main.go
index 919e58892..7b8afa02b 100644
--- a/pkg/component/ai/cohere/v0/main.go
+++ b/pkg/component/ai/cohere/v0/main.go
@@ -23,12 +23,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -48,7 +48,7 @@ type CohereClient interface {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/fireworksai/v0/README.mdx b/pkg/component/ai/fireworksai/v0/README.mdx
index b9a74ec25..701222808 100644
--- a/pkg/component/ai/fireworksai/v0/README.mdx
+++ b/pkg/component/ai/fireworksai/v0/README.mdx
@@ -20,7 +20,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/fireworksai/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/fireworksai/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/fireworksai/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/fireworksai/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/fireworksai/v0/config/definition.json b/pkg/component/ai/fireworksai/v0/config/definition.json
deleted file mode 100644
index 37ed40eb9..000000000
--- a/pkg/component/ai/fireworksai/v0/config/definition.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "availableTasks": [
- "TASK_TEXT_GENERATION_CHAT",
- "TASK_TEXT_EMBEDDINGS"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/ai/fireworks-ai",
- "icon": "assets/fireworks-ai.svg",
- "id": "fireworks-ai",
- "public": true,
- "title": "Fireworks AI",
- "description": "Connect the AI models served on the Fireworks AI Platform.",
- "type": "COMPONENT_TYPE_AI",
- "uid": "09258316-dad7-4b84-be50-41eb76ba9cf0",
- "vendor": "Fireworks AI",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/fireworksai/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/ai/fireworksai/v0/config/definition.yaml b/pkg/component/ai/fireworksai/v0/config/definition.yaml
new file mode 100644
index 000000000..64497f886
--- /dev/null
+++ b/pkg/component/ai/fireworksai/v0/config/definition.yaml
@@ -0,0 +1,17 @@
+availableTasks:
+- TASK_TEXT_GENERATION_CHAT
+- TASK_TEXT_EMBEDDINGS
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/ai/fireworks-ai
+icon: assets/fireworks-ai.svg
+id: fireworks-ai
+public: true
+title: Fireworks AI
+description: Connect the AI models served on the Fireworks AI Platform.
+type: COMPONENT_TYPE_AI
+uid: 09258316-dad7-4b84-be50-41eb76ba9cf0
+vendor: Fireworks AI
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/fireworksai/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/ai/fireworksai/v0/config/setup.json b/pkg/component/ai/fireworksai/v0/config/setup.json
deleted file mode 100644
index 616912942..000000000
--- a/pkg/component/ai/fireworksai/v0/config/setup.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Fireworks AI API key. To find your keys, visit the Fireworks AI API Keys page.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "instillCredential": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- }
- },
- "required": [],
- "title": "Fireworks AI Connection",
- "format": "object"
-}
diff --git a/pkg/component/ai/fireworksai/v0/config/setup.yaml b/pkg/component/ai/fireworksai/v0/config/setup.yaml
new file mode 100644
index 000000000..54277db2a
--- /dev/null
+++ b/pkg/component/ai/fireworksai/v0/config/setup.yaml
@@ -0,0 +1,15 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Fireworks AI API key. To find your keys, visit the Fireworks
+ AI API Keys page.
+ acceptFormats:
+ - string
+ instillSecret: true
+ instillCredential: true
+ uiOrder: 0
+ title: API Key
+ format: string
+required: []
+title: Fireworks AI Connection
+format: object
diff --git a/pkg/component/ai/fireworksai/v0/config/tasks.json b/pkg/component/ai/fireworksai/v0/config/tasks.json
deleted file mode 100644
index adc5297e0..000000000
--- a/pkg/component/ai/fireworksai/v0/config/tasks.json
+++ /dev/null
@@ -1,367 +0,0 @@
-{
- "$defs": {
- "multi-modal-content": {
- "items": {
- "properties": {
- "image-url": {
- "properties": {
- "url": {
- "description": "Either a URL of the image or the base64 encoded image data.",
- "title": "URL",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "url"
- ],
- "title": "Image URL",
- "description": "The image URL.",
- "uiOrder": 0,
- "format": "object"
- },
- "text": {
- "description": "The text content.",
- "title": "Text",
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "description": "The type of the content part.",
- "enum": [
- "text",
- "image_url"
- ],
- "title": "Type",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [
- "type"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "chat-message": {
- "properties": {
- "content": {
- "$ref": "#/$defs/multi-modal-content",
- "description": "The message content.",
- "uiOrder": 1,
- "title": "Content"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "uiOrder": 0,
- "title": "Role",
- "format": "string"
- }
- },
- "required": [
- "role",
- "content"
- ],
- "title": "Chat Message",
- "format": "object"
- },
- "chat-usage": {
- "description": "Token usage on the Fireworks AI platform text generation models.",
- "uiOrder": 1,
- "properties": {
- "input-tokens": {
- "description": "The input tokens used by Fireworks AI models.",
- "uiOrder": 2,
- "title": "Input Tokens",
- "format": "number"
- },
- "output-tokens": {
- "description": "The output tokens generated by Fireworks AI models.",
- "uiOrder": 3,
- "title": "Output Tokens",
- "format": "number"
- }
- },
- "required": [
- "input-tokens",
- "output-tokens"
- ],
- "title": "Usage",
- "format": "object"
- },
- "embedding-usage": {
- "description": "Token usage on the Fireworks AI platform embedding models.",
- "uiOrder": 1,
- "properties": {
- "tokens": {
- "description": "The token count used by Fireworks AI models.",
- "uiOrder": 1,
- "title": "Token Count",
- "format": "number"
- }
- },
- "required": [
- "tokens"
- ],
- "title": "Usage",
- "format": "object"
- }
- },
- "TASK_TEXT_GENERATION_CHAT": {
- "shortDescription": "Provide text outputs in response to text inputs.",
- "description": "Fireworks AI's text generation models (often called generative pre-trained transformers or large language models) have been trained to understand natural language, code, and images. The models provide text outputs in response to their inputs. The inputs to these models are also referred to as \"prompts\". Designing a prompt is essentially how you “program” a large language model model, usually by providing instructions or some examples of how to successfully complete a task.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "chat-history": {
- "description": "Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {\"role\": \"The message role, i.e. 'system', 'user' or 'assistant'\", \"content\": \"message content\"}.",
- "acceptFormats": [
- "object"
- ],
- "shortDescription": "Incorporate external chat history, specifically previous messages within the conversation. (Note: According to Fireworks AI documentation on 2024-07-24, the total number of images included in a single API request should not exceed 30, and all the images should be smaller than 5MB in size)",
- "uiOrder": 4,
- "items": {
- "$ref": "#/$defs/chat-message"
- },
- "title": "Chat history",
- "format": "array"
- },
- "max-new-tokens": {
- "default": 50,
- "description": "The maximum number of tokens for model to generate.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Max New Tokens",
- "format": "integer"
- },
- "model": {
- "enum": [
- "llama-v3p1-405b-instruct",
- "llama-v3p1-70b-instruct",
- "llama-v3p1-8b-instruct",
- "llama-v3-70b-instruct",
- "llama-v3-8b-instruct",
- "firellava-13b",
- "firefunction-v2",
- "deepseek-coder-v2-instruct",
- "deepseek-coder-v2-lite-instruct",
- "starcoder-16b",
- "starcoder-7b",
- "phi-3-vision-128k-instruct",
- "qwen2-72b-instruct",
- "mythomax-l2-13b",
- "yi-large"
- ],
- "example": "llama-v3p1-8b-instruct",
- "description": "The OSS model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "instillCredentialMap": {
- "values": [
- "llama-v3p1-405b-instruct",
- "llama-v3p1-70b-instruct",
- "llama-v3p1-8b-instruct",
- "llama-v3-70b-instruct",
- "llama-v3-8b-instruct",
- "firellava-13b",
- "firefunction-v2",
- "deepseek-coder-v2-lite-instruct",
- "starcoder-16b",
- "starcoder-7b",
- "phi-3-vision-128k-instruct",
- "qwen2-72b-instruct",
- "mythomax-l2-13b",
- "yi-large"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "title": "Model Name",
- "format": "string"
- },
- "prompt": {
- "description": "The prompt text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Prompt",
- "format": "string"
- },
- "prompt-images": {
- "description": "The prompt images (Note: According to Fireworks AI documentation on 2024-07-24, the total number of images included in a single API request should not exceed 30, and all the images should be smaller than 5MB in size).",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "format": "string"
- },
- "title": "Prompt Images",
- "format": "array"
- },
- "seed": {
- "description": "The seed.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Seed",
- "format": "integer"
- },
- "system-message": {
- "default": "You are a helpful assistant.",
- "description": "The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is set using a generic message as \"You are a helpful assistant.\".",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The system message helps set the behavior of the assistant",
- "uiOrder": 2,
- "title": "System Message",
- "format": "string"
- },
- "temperature": {
- "default": 0.7,
- "description": "The temperature for sampling.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 5,
- "title": "Temperature",
- "format": "number"
- },
- "top-k": {
- "default": 10,
- "description": "Integer to define the top tokens considered within the sample operation to create new text.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Top K",
- "format": "integer"
- },
- "top-p": {
- "default": 0.5,
- "description": "Float to define the tokens that are within the sample operation of text generation. Add tokens in the sample for more probable to least probable until the sum of the probabilities is greater than top-p (default=0.5).",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "Float to define the tokens that are within the sample operation of text generation",
- "uiOrder": 6,
- "title": "Top P",
- "format": "number"
- }
- },
- "required": [
- "prompt",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "text": {
- "description": "Model Output.",
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- },
- "usage": {
- "$ref": "#/$defs/chat-usage"
- }
- },
- "required": [
- "text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_EMBEDDINGS": {
- "shortDescription": "Turn text into a vector of numbers that capture its meaning, unlocking use cases like semantic search.",
- "description": "An embedding is a list of floating point numbers that captures semantic information about the text that it represents.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "model": {
- "enum": [
- "nomic-ai/nomic-embed-text-v1.5",
- "nomic-ai/nomic-embed-text-v1",
- "WhereIsAI/UAE-Large-V1",
- "thenlper/gte-large",
- "thenlper/gte-base"
- ],
- "example": "nomic-ai/nomic-embed-text-v1.5",
- "description": "The OSS embedding model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Model Name",
- "instillCredentialMap": {
- "values": [
- "nomic-ai/nomic-embed-text-v1.5",
- "nomic-ai/nomic-embed-text-v1",
- "WhereIsAI/UAE-Large-V1",
- "thenlper/gte-large",
- "thenlper/gte-base"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "format": "string"
- },
- "text": {
- "description": "The text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "text",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "embedding": {
- "items": {
- "title": "Embedding",
- "format": "number"
- },
- "description": "Embedding of the input text.",
- "uiOrder": 0,
- "title": "Embedding",
- "format": "array"
- },
- "usage": {
- "$ref": "#/$defs/embedding-usage"
- }
- },
- "required": [
- "embedding"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/fireworksai/v0/config/tasks.yaml b/pkg/component/ai/fireworksai/v0/config/tasks.yaml
new file mode 100644
index 000000000..3f6b0cc9f
--- /dev/null
+++ b/pkg/component/ai/fireworksai/v0/config/tasks.yaml
@@ -0,0 +1,310 @@
+$defs:
+ multi-modal-content:
+ items:
+ properties:
+ image-url:
+ properties:
+ url:
+ description: Either a URL of the image or the base64 encoded image data.
+ title: URL
+ uiOrder: 0
+ format: string
+ required:
+ - url
+ title: Image URL
+ description: The image URL.
+ uiOrder: 0
+ format: object
+ text:
+ description: The text content.
+ title: Text
+ uiOrder: 1
+ format: string
+ type:
+ description: The type of the content part.
+ enum:
+ - text
+ - image_url
+ title: Type
+ uiOrder: 2
+ format: string
+ required:
+ - type
+ format: object
+ format: array
+ chat-message:
+ properties:
+ content:
+ $ref: '#/$defs/multi-modal-content'
+ description: The message content.
+ uiOrder: 1
+ title: Content
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ uiOrder: 0
+ title: Role
+ format: string
+ required:
+ - role
+ - content
+ title: Chat Message
+ format: object
+ chat-usage:
+ description: Token usage on the Fireworks AI platform text generation models.
+ uiOrder: 1
+ properties:
+ input-tokens:
+ description: The input tokens used by Fireworks AI models.
+ uiOrder: 2
+ title: Input Tokens
+ format: number
+ output-tokens:
+ description: The output tokens generated by Fireworks AI models.
+ uiOrder: 3
+ title: Output Tokens
+ format: number
+ required:
+ - input-tokens
+ - output-tokens
+ title: Usage
+ format: object
+ embedding-usage:
+ description: Token usage on the Fireworks AI platform embedding models.
+ uiOrder: 1
+ properties:
+ tokens:
+ description: The token count used by Fireworks AI models.
+ uiOrder: 1
+ title: Token Count
+ format: number
+ required:
+ - tokens
+ title: Usage
+ format: object
+TASK_TEXT_GENERATION_CHAT:
+ shortDescription: Provide text outputs in response to text inputs.
+ description: Fireworks AI's text generation models (often called generative pre-trained
+ transformers or large language models) have been trained to understand natural
+ language, code, and images. The models provide text outputs in response to their
+ inputs. The inputs to these models are also referred to as "prompts". Designing
+ a prompt is essentially how you “program” a large language model model, usually
+ by providing instructions or some examples of how to successfully complete a task.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ chat-history:
+ description: 'Incorporate external chat history, specifically previous messages
+ within the conversation. Please note that System Message will be ignored
+ and will not have any effect when this field is populated. Each message
+ should adhere to the format: : {"role": "The message role, i.e. ''system'',
+ ''user'' or ''assistant''", "content": "message content"}.'
+ acceptFormats:
+ - object
+ shortDescription: 'Incorporate external chat history, specifically previous
+ messages within the conversation. (Note: According to Fireworks AI documentation
+ on 2024-07-24, the total number of images included in a single API request
+ should not exceed 30, and all the images should be smaller than 5MB in size)'
+ uiOrder: 4
+ items:
+ $ref: '#/$defs/chat-message'
+ title: Chat history
+ format: array
+ max-new-tokens:
+ default: 50
+ description: The maximum number of tokens for model to generate.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Max New Tokens
+ format: integer
+ model:
+ enum:
+ - llama-v3p1-405b-instruct
+ - llama-v3p1-70b-instruct
+ - llama-v3p1-8b-instruct
+ - llama-v3-70b-instruct
+ - llama-v3-8b-instruct
+ - firellava-13b
+ - firefunction-v2
+ - deepseek-coder-v2-instruct
+ - deepseek-coder-v2-lite-instruct
+ - starcoder-16b
+ - starcoder-7b
+ - phi-3-vision-128k-instruct
+ - qwen2-72b-instruct
+ - mythomax-l2-13b
+ - yi-large
+ example: llama-v3p1-8b-instruct
+ description: The OSS model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ instillCredentialMap:
+ values:
+ - llama-v3p1-405b-instruct
+ - llama-v3p1-70b-instruct
+ - llama-v3p1-8b-instruct
+ - llama-v3-70b-instruct
+ - llama-v3-8b-instruct
+ - firellava-13b
+ - firefunction-v2
+ - deepseek-coder-v2-lite-instruct
+ - starcoder-16b
+ - starcoder-7b
+ - phi-3-vision-128k-instruct
+ - qwen2-72b-instruct
+ - mythomax-l2-13b
+ - yi-large
+ targets:
+ - setup.api-key
+ title: Model Name
+ format: string
+ prompt:
+ description: The prompt text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Prompt
+ format: string
+ prompt-images:
+ description: 'The prompt images (Note: According to Fireworks AI documentation
+ on 2024-07-24, the total number of images included in a single API request
+ should not exceed 30, and all the images should be smaller than 5MB in size).'
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ format: string
+ title: Prompt Images
+ format: array
+ seed:
+ description: The seed.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Seed
+ format: integer
+ system-message:
+ default: You are a helpful assistant.
+ description: The system message helps set the behavior of the assistant. For
+ example, you can modify the personality of the assistant or provide specific
+ instructions about how it should behave throughout the conversation. By
+ default, the model’s behavior is set using a generic message as "You are
+ a helpful assistant.".
+ acceptFormats:
+ - string
+ shortDescription: The system message helps set the behavior of the assistant
+ uiOrder: 2
+ title: System Message
+ format: string
+ temperature:
+ default: 0.7
+ description: The temperature for sampling.
+ acceptFormats:
+ - number
+ uiOrder: 5
+ title: Temperature
+ format: number
+ top-k:
+ default: 10
+ description: Integer to define the top tokens considered within the sample
+ operation to create new text.
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Top K
+ format: integer
+ top-p:
+ default: 0.5
+ description: Float to define the tokens that are within the sample operation
+ of text generation. Add tokens in the sample for more probable to least
+ probable until the sum of the probabilities is greater than top-p (default=0.5).
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: Float to define the tokens that are within the sample operation
+ of text generation
+ uiOrder: 6
+ title: Top P
+ format: number
+ required:
+ - prompt
+ - model
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ text:
+ description: Model Output.
+ uiOrder: 0
+ title: Text
+ format: string
+ usage:
+ $ref: '#/$defs/chat-usage'
+ required:
+ - text
+ title: Output
+ format: object
+TASK_TEXT_EMBEDDINGS:
+ shortDescription: Turn text into a vector of numbers that capture its meaning, unlocking
+ use cases like semantic search.
+ description: An embedding is a list of floating point numbers that captures semantic
+ information about the text that it represents.
+ input:
+ uiOrder: 0
+ properties:
+ model:
+ enum:
+ - nomic-ai/nomic-embed-text-v1.5
+ - nomic-ai/nomic-embed-text-v1
+ - WhereIsAI/UAE-Large-V1
+ - thenlper/gte-large
+ - thenlper/gte-base
+ example: nomic-ai/nomic-embed-text-v1.5
+ description: The OSS embedding model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Model Name
+ instillCredentialMap:
+ values:
+ - nomic-ai/nomic-embed-text-v1.5
+ - nomic-ai/nomic-embed-text-v1
+ - WhereIsAI/UAE-Large-V1
+ - thenlper/gte-large
+ - thenlper/gte-base
+ targets:
+ - setup.api-key
+ format: string
+ text:
+ description: The text.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Text
+ format: string
+ required:
+ - text
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ embedding:
+ items:
+ title: Embedding
+ format: number
+ description: Embedding of the input text.
+ uiOrder: 0
+ title: Embedding
+ format: array
+ usage:
+ $ref: '#/$defs/embedding-usage'
+ required:
+ - embedding
+ title: Output
+ format: object
diff --git a/pkg/component/ai/fireworksai/v0/main.go b/pkg/component/ai/fireworksai/v0/main.go
index 899af44da..bc27c1414 100644
--- a/pkg/component/ai/fireworksai/v0/main.go
+++ b/pkg/component/ai/fireworksai/v0/main.go
@@ -21,12 +21,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -40,7 +40,7 @@ type component struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/groq/v0/README.mdx b/pkg/component/ai/groq/v0/README.mdx
index a77ceecc4..8c01090b6 100644
--- a/pkg/component/ai/groq/v0/README.mdx
+++ b/pkg/component/ai/groq/v0/README.mdx
@@ -19,7 +19,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/groq/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/groq/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/groq/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/groq/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/groq/v0/config/definition.json b/pkg/component/ai/groq/v0/config/definition.json
deleted file mode 100644
index 47c23aba6..000000000
--- a/pkg/component/ai/groq/v0/config/definition.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "availableTasks": [
- "TASK_TEXT_GENERATION_CHAT"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/ai/groq",
- "icon": "assets/groq.svg",
- "id": "groq",
- "public": true,
- "title": "Groq",
- "description": "Connect the AI models served on GroqCloud.",
- "type": "COMPONENT_TYPE_AI",
- "uid": "d5e64e5c-2dd2-4358-82dd-0e3a035c2157",
- "vendor": "Groq",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/groq/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/ai/groq/v0/config/definition.yaml b/pkg/component/ai/groq/v0/config/definition.yaml
new file mode 100644
index 000000000..46c5fb10f
--- /dev/null
+++ b/pkg/component/ai/groq/v0/config/definition.yaml
@@ -0,0 +1,15 @@
+availableTasks:
+- TASK_TEXT_GENERATION_CHAT
+documentationUrl: https://www.instill.tech/docs/component/ai/groq
+icon: assets/groq.svg
+id: groq
+public: true
+title: Groq
+description: Connect the AI models served on GroqCloud.
+type: COMPONENT_TYPE_AI
+uid: d5e64e5c-2dd2-4358-82dd-0e3a035c2157
+vendor: Groq
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/groq/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/ai/groq/v0/config/setup.json b/pkg/component/ai/groq/v0/config/setup.json
deleted file mode 100644
index 3b81b2101..000000000
--- a/pkg/component/ai/groq/v0/config/setup.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your GroqCloud API key. To find your keys, visit the GroqCloud API Keys page.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "instillCredential": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- }
- },
- "required": [],
- "title": "GroqCloud Connection",
- "format": "object"
-}
diff --git a/pkg/component/ai/groq/v0/config/setup.yaml b/pkg/component/ai/groq/v0/config/setup.yaml
new file mode 100644
index 000000000..e6ad78a20
--- /dev/null
+++ b/pkg/component/ai/groq/v0/config/setup.yaml
@@ -0,0 +1,15 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your GroqCloud API key. To find your keys, visit the GroqCloud
+ API Keys page.
+ acceptFormats:
+ - string
+ instillSecret: true
+ instillCredential: true
+ uiOrder: 0
+ title: API Key
+ format: string
+required: []
+title: GroqCloud Connection
+format: object
diff --git a/pkg/component/ai/groq/v0/config/tasks.json b/pkg/component/ai/groq/v0/config/tasks.json
deleted file mode 100644
index 126ad5512..000000000
--- a/pkg/component/ai/groq/v0/config/tasks.json
+++ /dev/null
@@ -1,274 +0,0 @@
-{
- "$defs": {
- "multi-modal-content": {
- "items": {
- "properties": {
- "image-url": {
- "properties": {
- "url": {
- "description": "Either a URL of the image or the base64 encoded image data.",
- "title": "URL",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "url"
- ],
- "title": "Image URL",
- "description": "The image URL.",
- "uiOrder": 0,
- "format": "object"
- },
- "text": {
- "description": "The text content.",
- "title": "Text",
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "description": "The type of the content part.",
- "enum": [
- "text",
- "image_url"
- ],
- "title": "Type",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [
- "type"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "chat-message": {
- "properties": {
- "content": {
- "$ref": "#/$defs/multi-modal-content",
- "description": "The message content.",
- "uiOrder": 1,
- "title": "Content"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "uiOrder": 0,
- "title": "Role",
- "format": "string"
- }
- },
- "required": [
- "role",
- "content"
- ],
- "title": "Chat Message",
- "format": "object"
- },
- "chat-usage": {
- "description": "Token usage on the GroqCloud platform text generation models.",
- "uiOrder": 1,
- "properties": {
- "input-tokens": {
- "description": "The input tokens used by GroqCloud OSS models.",
- "uiOrder": 2,
- "title": "Input Tokens",
- "format": "number"
- },
- "output-tokens": {
- "description": "The output tokens generated by GroqCloud OSS models.",
- "uiOrder": 3,
- "title": "Output Tokens",
- "format": "number"
- }
- },
- "required": [
- "input-tokens",
- "output-tokens"
- ],
- "title": "Usage",
- "format": "object"
- }
- },
- "TASK_TEXT_GENERATION_CHAT": {
- "shortDescription": "Provide text outputs in response to text inputs.",
- "description": "Groq serves open source text generation models (often called generative pre-trained transformers or large language models) have been trained to understand natural language, code, and images. The models provide text outputs in response to their inputs. The inputs to these models are also referred to as \"prompts\". Designing a prompt is essentially how you “program” a large language model model, usually by providing instructions or some examples of how to successfully complete a task.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "chat-history": {
- "description": "Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {\"role\": \"The message role, i.e. 'system', 'user' or 'assistant'\", \"content\": \"message content\"}.",
- "acceptFormats": [
- "object"
- ],
- "shortDescription": "Incorporate external chat history, specifically previous messages within the conversation. (Note: Only a subset of OSS models support image inputs)",
- "uiOrder": 4,
- "items": {
- "$ref": "#/$defs/chat-message"
- },
- "title": "Chat history",
- "format": "array"
- },
- "max-new-tokens": {
- "default": 50,
- "description": "The maximum number of tokens for model to generate.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Max New Tokens",
- "format": "integer"
- },
- "model": {
- "enum": [
- "llama-3.1-405b-reasoning",
- "llama-3.1-70b-versatile",
- "llama-3.1-8b-instant",
- "llama3-groq-70b-8192-tool-use-preview",
- "llama3-groq-8b-8192-tool-use-preview",
- "llama3-70b-8192",
- "llama-guard-3-8b",
- "llama3-8b-8192",
- "mixtral-8x7b-32768",
- "gemma2-9b-it",
- "gemma-7b-it"
- ],
- "example": "llama3-8b-8192",
- "description": "The OSS model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "instillCredentialMap": {
- "values": [
- "llama3-groq-70b-8192-tool-use-preview",
- "llama3-groq-8b-8192-tool-use-preview",
- "llama3-70b-8192",
- "llama3-8b-8192",
- "mixtral-8x7b-32768",
- "gemma2-9b-it",
- "gemma-7b-it"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "title": "Model",
- "format": "string"
- },
- "prompt": {
- "description": "The prompt text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Prompt",
- "format": "string"
- },
- "prompt-images": {
- "description": "The prompt images (Note: Only a subset of OSS models support image inputs).",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "format": "string"
- },
- "title": "Prompt Images",
- "format": "array"
- },
- "seed": {
- "description": "The seed.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Seed",
- "format": "integer"
- },
- "system-message": {
- "default": "You are a helpful assistant.",
- "description": "The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is set using a generic message as \"You are a helpful assistant.\".",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The system message helps set the behavior of the assistant",
- "uiOrder": 2,
- "title": "System Message",
- "format": "string"
- },
- "temperature": {
- "default": 0.7,
- "description": "The temperature for sampling.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 5,
- "title": "Temperature",
- "format": "number"
- },
- "top-k": {
- "default": 10,
- "description": "Integer to define the top tokens considered within the sample operation to create new text.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Top K",
- "format": "integer"
- },
- "top-p": {
- "default": 0.5,
- "description": "Float to define the tokens that are within the sample operation of text generation. Add tokens in the sample for more probable to least probable until the sum of the probabilities is greater than top-p (default=0.5).",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "Float to define the tokens that are within the sample operation of text generation",
- "uiOrder": 6,
- "title": "Top P",
- "format": "number"
- },
- "user": {
- "default": "instill-ai",
- "description": "The user name passed to GroqPlatform.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "A unique identifier representing your end-user, which can help Groq monitor and detect abuse.",
- "uiOrder": 7,
- "title": "User",
- "format": "string"
- }
- },
- "required": [
- "prompt",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "text": {
- "description": "Model Output.",
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- },
- "usage": {
- "$ref": "#/$defs/chat-usage"
- }
- },
- "required": [
- "text"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/groq/v0/config/tasks.yaml b/pkg/component/ai/groq/v0/config/tasks.yaml
new file mode 100644
index 000000000..2eaf7edd9
--- /dev/null
+++ b/pkg/component/ai/groq/v0/config/tasks.yaml
@@ -0,0 +1,235 @@
+$defs:
+ multi-modal-content:
+ items:
+ properties:
+ image-url:
+ properties:
+ url:
+ description: Either a URL of the image or the base64 encoded image data.
+ title: URL
+ uiOrder: 0
+ format: string
+ required:
+ - url
+ title: Image URL
+ description: The image URL.
+ uiOrder: 0
+ format: object
+ text:
+ description: The text content.
+ title: Text
+ uiOrder: 1
+ format: string
+ type:
+ description: The type of the content part.
+ enum:
+ - text
+ - image_url
+ title: Type
+ uiOrder: 2
+ format: string
+ required:
+ - type
+ format: object
+ format: array
+ chat-message:
+ properties:
+ content:
+ $ref: '#/$defs/multi-modal-content'
+ description: The message content.
+ uiOrder: 1
+ title: Content
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ uiOrder: 0
+ title: Role
+ format: string
+ required:
+ - role
+ - content
+ title: Chat Message
+ format: object
+ chat-usage:
+ description: Token usage on the GroqCloud platform text generation models.
+ uiOrder: 1
+ properties:
+ input-tokens:
+ description: The input tokens used by GroqCloud OSS models.
+ uiOrder: 2
+ title: Input Tokens
+ format: number
+ output-tokens:
+ description: The output tokens generated by GroqCloud OSS models.
+ uiOrder: 3
+ title: Output Tokens
+ format: number
+ required:
+ - input-tokens
+ - output-tokens
+ title: Usage
+ format: object
+TASK_TEXT_GENERATION_CHAT:
+ shortDescription: Provide text outputs in response to text inputs.
+ description: Groq serves open source text generation models (often called generative
+ pre-trained transformers or large language models) have been trained to understand
+ natural language, code, and images. The models provide text outputs in response
+ to their inputs. The inputs to these models are also referred to as "prompts".
+ Designing a prompt is essentially how you “program” a large language model model,
+ usually by providing instructions or some examples of how to successfully complete
+ a task.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ chat-history:
+ description: 'Incorporate external chat history, specifically previous messages
+ within the conversation. Please note that System Message will be ignored
+ and will not have any effect when this field is populated. Each message
+ should adhere to the format: : {"role": "The message role, i.e. ''system'',
+ ''user'' or ''assistant''", "content": "message content"}.'
+ acceptFormats:
+ - object
+ shortDescription: 'Incorporate external chat history, specifically previous
+ messages within the conversation. (Note: Only a subset of OSS models support
+ image inputs)'
+ uiOrder: 4
+ items:
+ $ref: '#/$defs/chat-message'
+ title: Chat history
+ format: array
+ max-new-tokens:
+ default: 50
+ description: The maximum number of tokens for model to generate.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Max New Tokens
+ format: integer
+ model:
+ enum:
+ - llama-3.1-405b-reasoning
+ - llama-3.1-70b-versatile
+ - llama-3.1-8b-instant
+ - llama3-groq-70b-8192-tool-use-preview
+ - llama3-groq-8b-8192-tool-use-preview
+ - llama3-70b-8192
+ - llama-guard-3-8b
+ - llama3-8b-8192
+ - mixtral-8x7b-32768
+ - gemma2-9b-it
+ - gemma-7b-it
+ example: llama3-8b-8192
+ description: The OSS model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ instillCredentialMap:
+ values:
+ - llama3-groq-70b-8192-tool-use-preview
+ - llama3-groq-8b-8192-tool-use-preview
+ - llama3-70b-8192
+ - llama3-8b-8192
+ - mixtral-8x7b-32768
+ - gemma2-9b-it
+ - gemma-7b-it
+ targets:
+ - setup.api-key
+ title: Model
+ format: string
+ prompt:
+ description: The prompt text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Prompt
+ format: string
+ prompt-images:
+ description: 'The prompt images (Note: Only a subset of OSS models support
+ image inputs).'
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ format: string
+ title: Prompt Images
+ format: array
+ seed:
+ description: The seed.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Seed
+ format: integer
+ system-message:
+ default: You are a helpful assistant.
+ description: The system message helps set the behavior of the assistant. For
+ example, you can modify the personality of the assistant or provide specific
+ instructions about how it should behave throughout the conversation. By
+ default, the model’s behavior is set using a generic message as "You are
+ a helpful assistant.".
+ acceptFormats:
+ - string
+ shortDescription: The system message helps set the behavior of the assistant
+ uiOrder: 2
+ title: System Message
+ format: string
+ temperature:
+ default: 0.7
+ description: The temperature for sampling.
+ acceptFormats:
+ - number
+ uiOrder: 5
+ title: Temperature
+ format: number
+ top-k:
+ default: 10
+ description: Integer to define the top tokens considered within the sample
+ operation to create new text.
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Top K
+ format: integer
+ top-p:
+ default: 0.5
+ description: Float to define the tokens that are within the sample operation
+ of text generation. Add tokens in the sample for more probable to least
+ probable until the sum of the probabilities is greater than top-p (default=0.5).
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: Float to define the tokens that are within the sample operation
+ of text generation
+ uiOrder: 6
+ title: Top P
+ format: number
+ user:
+ default: instill-ai
+ description: The user name passed to GroqPlatform.
+ acceptFormats:
+ - string
+ shortDescription: A unique identifier representing your end-user, which can
+ help Groq monitor and detect abuse.
+ uiOrder: 7
+ title: User
+ format: string
+ required:
+ - prompt
+ - model
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ text:
+ description: Model Output.
+ uiOrder: 0
+ title: Text
+ format: string
+ usage:
+ $ref: '#/$defs/chat-usage'
+ required:
+ - text
+ title: Output
+ format: object
diff --git a/pkg/component/ai/groq/v0/main.go b/pkg/component/ai/groq/v0/main.go
index 3c1a993ab..b3eb0bc54 100644
--- a/pkg/component/ai/groq/v0/main.go
+++ b/pkg/component/ai/groq/v0/main.go
@@ -19,12 +19,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -38,7 +38,7 @@ type component struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/huggingface/v0/README.mdx b/pkg/component/ai/huggingface/v0/README.mdx
index 6fb6ef086..caac5a8d4 100644
--- a/pkg/component/ai/huggingface/v0/README.mdx
+++ b/pkg/component/ai/huggingface/v0/README.mdx
@@ -35,7 +35,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/huggingface/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/huggingface/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/huggingface/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/huggingface/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/huggingface/v0/config/definition.json b/pkg/component/ai/huggingface/v0/config/definition.json
deleted file mode 100644
index 849317849..000000000
--- a/pkg/component/ai/huggingface/v0/config/definition.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "availableTasks": [
- "TASK_TEXT_GENERATION",
- "TASK_FILL_MASK",
- "TASK_SUMMARIZATION",
- "TASK_TEXT_CLASSIFICATION",
- "TASK_TOKEN_CLASSIFICATION",
- "TASK_TRANSLATION",
- "TASK_ZERO_SHOT_CLASSIFICATION",
- "TASK_QUESTION_ANSWERING",
- "TASK_TABLE_QUESTION_ANSWERING",
- "TASK_SENTENCE_SIMILARITY",
- "TASK_CONVERSATIONAL",
- "TASK_IMAGE_CLASSIFICATION",
- "TASK_IMAGE_SEGMENTATION",
- "TASK_OBJECT_DETECTION",
- "TASK_IMAGE_TO_TEXT",
- "TASK_SPEECH_RECOGNITION",
- "TASK_AUDIO_CLASSIFICATION"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/ai/hugging-face",
- "icon": "assets/hugging-face.svg",
- "iconUrl": "",
- "id": "hugging-face",
- "public": true,
- "title": "Hugging Face",
- "description": "Connect the AI models served on the Hugging Face Platform.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_AI",
- "uid": "0255ef87-33ce-4f88-b9db-8897f8c17233",
- "vendor": "Hugging Face",
- "vendorAttributes": {},
- "version": "0.1.1",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/huggingface/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/ai/huggingface/v0/config/definition.yaml b/pkg/component/ai/huggingface/v0/config/definition.yaml
new file mode 100644
index 000000000..bfb1f4833
--- /dev/null
+++ b/pkg/component/ai/huggingface/v0/config/definition.yaml
@@ -0,0 +1,34 @@
+availableTasks:
+- TASK_TEXT_GENERATION
+- TASK_FILL_MASK
+- TASK_SUMMARIZATION
+- TASK_TEXT_CLASSIFICATION
+- TASK_TOKEN_CLASSIFICATION
+- TASK_TRANSLATION
+- TASK_ZERO_SHOT_CLASSIFICATION
+- TASK_QUESTION_ANSWERING
+- TASK_TABLE_QUESTION_ANSWERING
+- TASK_SENTENCE_SIMILARITY
+- TASK_CONVERSATIONAL
+- TASK_IMAGE_CLASSIFICATION
+- TASK_IMAGE_SEGMENTATION
+- TASK_OBJECT_DETECTION
+- TASK_IMAGE_TO_TEXT
+- TASK_SPEECH_RECOGNITION
+- TASK_AUDIO_CLASSIFICATION
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/ai/hugging-face
+icon: assets/hugging-face.svg
+iconUrl: ''
+id: hugging-face
+public: true
+title: Hugging Face
+description: Connect the AI models served on the Hugging Face Platform.
+tombstone: false
+type: COMPONENT_TYPE_AI
+uid: 0255ef87-33ce-4f88-b9db-8897f8c17233
+vendor: Hugging Face
+vendorAttributes: {}
+version: 0.1.1
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/huggingface/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/ai/huggingface/v0/config/setup.json b/pkg/component/ai/huggingface/v0/config/setup.json
deleted file mode 100644
index 706207b06..000000000
--- a/pkg/component/ai/huggingface/v0/config/setup.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Hugging face API token. To find your token, visit here.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- },
- "base-url": {
- "default": "https://api-inference.huggingface.co",
- "description": "Hostname for the endpoint. To use Inference API set to here, for Inference Endpoint set to your custom endpoint.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 1,
- "title": "Base URL",
- "format": "string"
- },
- "is-custom-endpoint": {
- "default": false,
- "description": "Fill true if you are using a custom Inference Endpoint and not the Inference API.",
- "acceptFormats": [
- "boolean"
- ],
- "instillSecret": false,
- "uiOrder": 2,
- "title": "Is Custom Endpoint",
- "format": "boolean"
- }
- },
- "required": [
- "api-key",
- "base-url",
- "is-custom-endpoint"
- ],
- "title": "Hugging Face Connection",
- "format": "object"
-}
diff --git a/pkg/component/ai/huggingface/v0/config/setup.yaml b/pkg/component/ai/huggingface/v0/config/setup.yaml
new file mode 100644
index 000000000..93764ae07
--- /dev/null
+++ b/pkg/component/ai/huggingface/v0/config/setup.yaml
@@ -0,0 +1,37 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Hugging face API token. To find your token, visit here.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: API Key
+ format: string
+ base-url:
+ default: https://api-inference.huggingface.co
+ description: Hostname for the endpoint. To use Inference API set to here,
+ for Inference Endpoint set to your custom endpoint.
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 1
+ title: Base URL
+ format: string
+ is-custom-endpoint:
+ default: false
+ description: Fill true if you are using a custom Inference Endpoint and not the
+ Inference API.
+ acceptFormats:
+ - boolean
+ instillSecret: false
+ uiOrder: 2
+ title: Is Custom Endpoint
+ format: boolean
+required:
+- api-key
+- base-url
+- is-custom-endpoint
+title: Hugging Face Connection
+format: object
diff --git a/pkg/component/ai/huggingface/v0/config/tasks.json b/pkg/component/ai/huggingface/v0/config/tasks.json
deleted file mode 100644
index 69e4f6c45..000000000
--- a/pkg/component/ai/huggingface/v0/config/tasks.json
+++ /dev/null
@@ -1,1670 +0,0 @@
-{
- "$defs": {
- "model": {
- "description": "The Hugging Face model to be used.",
- "acceptFormats": [
- "string"
- ],
- "title": "Model",
- "format": "string"
- },
- "options": {
- "properties": {
- "use-cache": {
- "description": "There is a cache layer on the inference API to speedup requests we have already seen. Most models can use those results as is as models are deterministic (meaning the results will be the same anyway). However if you use a non deterministic model, you can set this parameter to prevent the caching mechanism from being used resulting in a real new query.",
- "acceptFormats": [
- "boolean"
- ],
- "shortDescription": "Enable the cache of inference API",
- "uiOrder": 1,
- "title": "Use Cache",
- "format": "boolean"
- },
- "wait-for-model": {
- "description": "If the model is not ready, wait for it instead of receiving 503. It limits the number of requests required to get your inference done. It is advised to only set this flag to true after receiving a 503 error as it will limit hanging in your application to known places.",
- "acceptFormats": [
- "boolean"
- ],
- "shortDescription": "Wait for model ready",
- "uiOrder": 0,
- "title": "Wait For Model",
- "format": "boolean"
- }
- },
- "required": [],
- "description": "Options for the model.",
- "title": "Options",
- "format": "object"
- },
- "string-input": {
- "description": "String input.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "String Input",
- "format": "string"
- }
- },
- "TASK_AUDIO_CLASSIFICATION": {
- "shortDescription": "Audio classification is the task of assigning a label or class to a given audio.",
- "description": "Audio classification is the task of assigning a label or class to a given audio. It can be used for recognizing which command a user is giving or the emotion of a statement, as well as identifying a speaker.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "audio": {
- "description": "The audio file.",
- "acceptFormats": [
- "audio/*"
- ],
- "uiOrder": 1,
- "title": "Audio",
- "format": "string"
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- }
- },
- "required": [
- "audio",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "classes": {
- "uiOrder": 0,
- "items": {
- "properties": {
- "label": {
- "description": "The label for the class (model specific).",
- "uiOrder": 0,
- "title": "Label",
- "format": "string"
- },
- "score": {
- "description": "A float that represents how likely it is that the audio file belongs to this class.",
- "uiOrder": 1,
- "title": "Score",
- "format": "number"
- }
- },
- "required": [
- "label",
- "score"
- ],
- "description": "Class.",
- "title": "Class",
- "format": "object"
- },
- "description": "Classes.",
- "title": "Classes",
- "format": "array"
- }
- },
- "required": [
- "classes"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CONVERSATIONAL": {
- "shortDescription": "Conversational response modelling is the task of generating conversational text that is relevant, coherent and knowledgable given a prompt.",
- "description": "Conversational response modelling is the task of generating conversational text that is relevant, coherent and knowledgable given a prompt. These models have applications in chatbots, and as a part of voice assistants.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "uiOrder": 1,
- "properties": {
- "generated-responses": {
- "description": "A list of strings corresponding to the earlier replies from the model.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "items": {
- "description": "Items.",
- "format": "string"
- },
- "title": "Generated Responses",
- "format": "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.",
- "acceptFormats": [
- "array"
- ],
- "shortDescription": "A list of strings corresponding to the earlier replies from the user.",
- "uiOrder": 1,
- "items": {
- "description": "Items.",
- "format": "string"
- },
- "title": "Past User Inputs",
- "format": "array"
- },
- "text": {
- "description": "The last input from the user in the conversation.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "text"
- ],
- "description": "Inputs.",
- "title": "Inputs",
- "format": "object"
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 3
- },
- "parameters": {
- "uiOrder": 2,
- "properties": {
- "max-length": {
- "description": "Integer to define the maximum length in tokens of the output summary.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 0,
- "title": "Max Length",
- "format": "integer"
- },
- "max-time": {
- "description": "The amount of time in seconds that the query should take maximum. Network can cause some overhead so it will be a soft limit.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "The amount of time in seconds that the query should take maximum.",
- "uiOrder": 1,
- "maximum": 120.0,
- "minimum": 0.0,
- "title": "Max Time",
- "format": "number"
- },
- "min-length": {
- "description": "Integer to define the minimum length in tokens of the output summary.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "title": "Min Length",
- "format": "integer"
- },
- "repetition-penalty": {
- "description": "The more a token is used within generation the more it is penalized to not be picked in successive generation passes.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 3,
- "maximum": 100.0,
- "minimum": 0.0,
- "title": "Repetition Penalty",
- "format": "number"
- },
- "temperature": {
- "default": 1.0,
- "description": "The temperature of the sampling operation. 1 means regular sampling, 0 means always take the highest score, 100.0 is getting closer to uniform probability.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "The temperature of the sampling operation.",
- "uiOrder": 4,
- "maximum": 100.0,
- "minimum": 0.0,
- "title": "Temperature",
- "format": "number"
- },
- "top-k": {
- "description": "Integer to define the top tokens considered within the sample operation to create new text.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Top K",
- "format": "integer"
- },
- "top-p": {
- "description": "Float to define the tokens that are within the sample operation of text generation. Add tokens in the sample for more probable to least probable until the sum of the probabilities is greater than top-p.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "Float to define the tokens that are within the sample operation of text generation.",
- "uiOrder": 6,
- "title": "Top P",
- "format": "number"
- }
- },
- "required": [],
- "description": "Parameters.",
- "title": "Parameters",
- "format": "object"
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "conversation": {
- "description": "A facility dictionary to send back for the next input (with the new user input addition).",
- "uiOrder": 0,
- "properties": {
- "generated-responses": {
- "description": "List of strings. The last outputs from the model in the conversation, after the model has run.",
- "uiOrder": 0,
- "items": {
- "title": "Generated Response",
- "description": "Generated Response.",
- "format": "string"
- },
- "title": "Generated Responses",
- "format": "array"
- },
- "past-user-inputs": {
- "description": "List of strings. The last inputs from the user in the conversation, after the model has run.",
- "uiOrder": 1,
- "items": {
- "title": "Past User Input",
- "description": "Past User Input.",
- "format": "string"
- },
- "title": "Past User Inputs",
- "format": "array"
- }
- },
- "required": [
- "generated-responses",
- "past-user-inputs"
- ],
- "title": "Conversation",
- "format": "object"
- },
- "generated-text": {
- "description": "The answer of the bot.",
- "uiOrder": 1,
- "title": "Generated Text",
- "format": "string"
- }
- },
- "required": [
- "generated-text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_FILL_MASK": {
- "shortDescription": "Masked language modeling is the task of masking some of the words in a sentence and predicting which words should replace those masks.",
- "description": "Masked language modeling is the task of masking some of the words in a sentence and predicting which words should replace those masks. These models are useful when we want to get a statistical understanding of the language in which the model is trained in.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "$ref": "#/$defs/string-input",
- "description": "a string to be filled from, must contain the [MASK] token (check model card for exact name of the mask).",
- "uiOrder": 1
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 2
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "results": {
- "uiOrder": 0,
- "items": {
- "properties": {
- "score": {
- "description": "The probability for this token.",
- "uiOrder": 0,
- "title": "Score",
- "format": "number"
- },
- "sequence": {
- "description": "The actual sequence of tokens that ran against the model (may contain special tokens).",
- "uiOrder": 1,
- "title": "Sequence",
- "format": "string"
- },
- "token": {
- "description": "The id of the token.",
- "uiOrder": 2,
- "title": "Token",
- "format": "integer"
- },
- "token-str": {
- "description": "The string representation of the token.",
- "uiOrder": 3,
- "title": "Token Str",
- "format": "string"
- }
- },
- "description": "Result.",
- "title": "Result",
- "required": [],
- "format": "object"
- },
- "description": "Results.",
- "title": "Results",
- "format": "array"
- }
- },
- "required": [
- "results"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_IMAGE_CLASSIFICATION": {
- "shortDescription": "Image classification is the task of assigning a label or class to an entire image.",
- "description": "Image classification is the task of assigning a label or class to an entire image. Images are expected to have only one class for each image. Image classification models take an image as input and return a prediction about which class the image belongs to.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "The image file.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 1,
- "title": "Image",
- "format": "string"
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- }
- },
- "required": [
- "image",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "classes": {
- "uiOrder": 0,
- "items": {
- "properties": {
- "label": {
- "description": "The label for the class (model specific).",
- "uiOrder": 0,
- "title": "Label",
- "format": "string"
- },
- "score": {
- "description": "A float that represents how likely it is that the image file belongs to this class.",
- "uiOrder": 0,
- "title": "Score",
- "format": "number"
- }
- },
- "required": [
- "label",
- "score"
- ],
- "description": "Class.",
- "title": "Class",
- "format": "object"
- },
- "description": "Classes.",
- "title": "Classes",
- "format": "array"
- }
- },
- "required": [
- "classes"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_IMAGE_SEGMENTATION": {
- "shortDescription": "Image Segmentation divides an image into segments where each pixel in the image is mapped to an object.",
- "description": "Image Segmentation divides an image into segments where each pixel in the image is mapped to an object. This task has multiple variants such as instance segmentation, panoptic segmentation and semantic segmentation.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "The image file.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 1,
- "title": "Image",
- "format": "string"
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- }
- },
- "required": [
- "image",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "segments": {
- "uiOrder": 0,
- "items": {
- "properties": {
- "label": {
- "description": "The label for the class (model specific) of a segment.",
- "uiOrder": 0,
- "title": "Label",
- "format": "string"
- },
- "mask": {
- "description": "A str (base64 str of a single channel black-and-white img) representing the mask of a segment.",
- "uiOrder": 1,
- "title": "Mask",
- "format": "image/png"
- },
- "score": {
- "description": "A float that represents how likely it is that the segment belongs to the given class.",
- "uiOrder": 2,
- "title": "Score",
- "format": "number"
- }
- },
- "required": [
- "label",
- "mask",
- "score"
- ],
- "description": "Segment.",
- "title": "Segment",
- "format": "object"
- },
- "description": "Segments.",
- "title": "Segments",
- "format": "array"
- }
- },
- "required": [
- "segments"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_IMAGE_TO_TEXT": {
- "shortDescription": "Image to text models output a text from a given image.",
- "description": "Image to text models output a text from a given image. Image captioning or optical character recognition can be considered as the most common applications of image to text.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "The image file.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 1,
- "title": "Image",
- "format": "string"
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- }
- },
- "required": [
- "image",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "text": {
- "description": "Generated text.",
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_OBJECT_DETECTION": {
- "shortDescription": "Object Detection models allow users to identify objects of certain defined classes.",
- "description": "Object Detection models allow users to identify objects of certain defined classes. Object detection models receive an image as input and output the images with bounding boxes and labels on detected objects.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "The image file.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 1,
- "title": "Image",
- "format": "string"
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- }
- },
- "required": [
- "image",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "objects": {
- "uiOrder": 0,
- "items": {
- "properties": {
- "box": {
- "description": "A dict (with keys [xmin,ymin,xmax,ymax]) representing the bounding box of a detected object.",
- "uiOrder": 0,
- "properties": {
- "xmax": {
- "description": "X max.",
- "uiOrder": 0,
- "title": "X Max",
- "format": "number"
- },
- "xmin": {
- "description": "X min.",
- "uiOrder": 1,
- "title": "X Min",
- "format": "number"
- },
- "ymax": {
- "description": "Y Max.",
- "uiOrder": 2,
- "title": "Y Max",
- "format": "number"
- },
- "ymin": {
- "description": "Y min.",
- "uiOrder": 3,
- "title": "Y min",
- "format": "number"
- }
- },
- "required": [
- "xmax",
- "xmin",
- "ymax",
- "ymin"
- ],
- "title": "Box",
- "format": "object"
- },
- "label": {
- "description": "The label for the class (model specific) of a detected object.",
- "uiOrder": 1,
- "title": "Label",
- "format": "string"
- },
- "score": {
- "description": "A float that represents how likely it is that the detected object belongs to the given class.",
- "uiOrder": 2,
- "title": "Score",
- "format": "number"
- }
- },
- "required": [
- "box",
- "label",
- "score"
- ],
- "description": "Object.",
- "title": "Object",
- "format": "object"
- },
- "description": "Objects.",
- "title": "Objects",
- "format": "array"
- }
- },
- "required": [
- "objects"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_QUESTION_ANSWERING": {
- "shortDescription": "Question Answering models can retrieve the answer to a question from a given text, which is useful for searching for an answer in a document.",
- "description": "Question Answering models can retrieve the answer to a question from a given text, which is useful for searching for an answer in a document. Some question answering models can generate answers without context!.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "uiOrder": 1,
- "properties": {
- "context": {
- "description": "The context for answering the question.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Context",
- "format": "string"
- },
- "question": {
- "description": "The question.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Question",
- "format": "string"
- }
- },
- "required": [
- "question",
- "context"
- ],
- "description": "Inputs.",
- "title": "Inputs",
- "format": "object"
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 2
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "answer": {
- "description": "A string that’s the answer within the text.",
- "uiOrder": 0,
- "title": "Answer",
- "format": "string"
- },
- "score": {
- "description": "A float that represents how likely that the answer is correct.",
- "uiOrder": 2,
- "title": "Score",
- "format": "number"
- },
- "start": {
- "description": "The index (string wise) of the start of the answer within context.",
- "uiOrder": 3,
- "title": "Start",
- "format": "integer"
- },
- "stop": {
- "description": "The index (string wise) of the stop of the answer within context.",
- "uiOrder": 1,
- "title": "Stop",
- "format": "integer"
- }
- },
- "required": [
- "answer"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SENTENCE_SIMILARITY": {
- "shortDescription": "Sentence Similarity is the task of determining how similar two texts are.",
- "description": "Sentence Similarity is the task of determining how similar two texts are. Sentence similarity models convert input texts into vectors (embeddings) that capture semantic information and calculate how close (similar) they are between them. This task is particularly useful for information retrieval and clustering/grouping.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "uiOrder": 1,
- "properties": {
- "sentences": {
- "description": "A list of strings which will be compared against the source-sentence.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "items": {
- "description": "Items.",
- "format": "string"
- },
- "title": "Sentences",
- "format": "array"
- },
- "source-sentence": {
- "description": "The string that you wish to compare the other strings with. This can be a phrase, sentence, or longer passage, depending on the model being used.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The string that you wish to compare the other strings with.",
- "uiOrder": 1,
- "title": "Source Sentence",
- "format": "string"
- }
- },
- "required": [
- "source-sentence",
- "sentences"
- ],
- "description": "Inputs.",
- "title": "Inputs",
- "format": "object"
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 2
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "scores": {
- "description": "The associated similarity score for each of the given strings.",
- "uiOrder": 0,
- "items": {
- "description": "The associated similarity score for of the given string.",
- "title": "Score",
- "format": "number"
- },
- "title": "Scores",
- "format": "array"
- }
- },
- "required": [
- "scores"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SPEECH_RECOGNITION": {
- "shortDescription": "Automatic Speech Recognition (ASR), also known as Speech to Text (STT), is the task of transcribing a given audio to text.",
- "description": "Automatic Speech Recognition (ASR), also known as Speech to Text (STT), is the task of transcribing a given audio to text. It has many applications, such as voice user interfaces.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "audio": {
- "description": "The audio file.",
- "acceptFormats": [
- "audio/*"
- ],
- "uiOrder": 1,
- "title": "Audio",
- "format": "string"
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- }
- },
- "required": [
- "audio",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "text": {
- "description": "The string that was recognized within the audio file.",
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SUMMARIZATION": {
- "shortDescription": "Summarization is the task of producing a shorter version of a document while preserving its important information.",
- "description": "Summarization is the task of producing a shorter version of a document while preserving its important information. Some models can extract text from the original input, while other models can generate entirely new text.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "$ref": "#/$defs/string-input",
- "uiOrder": 1
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 3
- },
- "parameters": {
- "uiOrder": 2,
- "properties": {
- "max-length": {
- "description": "Integer to define the maximum length in tokens of the output summary.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 0,
- "title": "Max Length",
- "format": "integer"
- },
- "max-time": {
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 1,
- "maximum": 120.0,
- "minimum": 0.0,
- "description": "The amount of time in seconds that the query should take maximum. Network can cause some overhead so it will be a soft limit.",
- "title": "Max Time",
- "format": "number"
- },
- "min-length": {
- "description": "Integer to define the minimum length in tokens of the output summary.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "title": "Min Length",
- "format": "integer"
- },
- "repetition-penalty": {
- "description": "The more a token is used within generation the more it is penalized to not be picked in successive generation passes.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 3,
- "maximum": 100.0,
- "minimum": 0.0,
- "title": "Repetition Penalty",
- "format": "number"
- },
- "temperature": {
- "default": 1.0,
- "description": "The temperature of the sampling operation. 1 means regular sampling, 0 means always take the highest score, 100.0 is getting closer to uniform probability.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "The temperature of the sampling operation.",
- "uiOrder": 4,
- "maximum": 100.0,
- "minimum": 0.0,
- "title": "Temperature",
- "format": "number"
- },
- "top-k": {
- "description": "Integer to define the top tokens considered within the sample operation to create new text.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Top K",
- "format": "integer"
- },
- "top-p": {
- "description": "Float to define the tokens that are within the sample operation of text generation. Add tokens in the sample for more probable to least probable until the sum of the probabilities is greater than top-p.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "Float to define the tokens that are within the sample operation of text generation.",
- "uiOrder": 6,
- "title": "Top P",
- "format": "number"
- }
- },
- "required": [],
- "description": "Parameters.",
- "title": "Parameters",
- "format": "object"
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "summary-text": {
- "description": "The string after summarization.",
- "uiOrder": 0,
- "title": "Summary Text",
- "format": "string"
- }
- },
- "required": [
- "summary-text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TABLE_QUESTION_ANSWERING": {
- "shortDescription": "Table Question Answering (Table QA) is the answering a question about an information on a given table.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "uiOrder": 1,
- "properties": {
- "query": {
- "description": "The query in plain text that you want to ask the table.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Query",
- "format": "string"
- },
- "table": {
- "description": "A table of data represented as a dict of list where entries are headers and the lists are all the values, all lists must have the same size.",
- "acceptFormats": [
- "*"
- ],
- "uiOrder": 1,
- "required": [],
- "title": "Table",
- "format": "object"
- }
- },
- "required": [
- "query",
- "table"
- ],
- "description": "Inputs.",
- "title": "Inputs",
- "format": "object"
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 2
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "aggregator": {
- "description": "The aggregator used to get the answer.",
- "uiOrder": 0,
- "title": "Aggregator",
- "format": "string"
- },
- "answer": {
- "description": "The plaintext answer.",
- "uiOrder": 1,
- "title": "Answer",
- "format": "string"
- },
- "cells": {
- "description": "a list of coordinates of the cells contents.",
- "uiOrder": 2,
- "items": {
- "description": "coordinate of the cell content.",
- "title": "Cell",
- "format": "string"
- },
- "title": "Cells",
- "format": "array"
- },
- "coordinates": {
- "description": "a list of coordinates of the cells referenced in the answer.",
- "uiOrder": 3,
- "items": {
- "items": {
- "description": "coordinate of the cell referenced in the answer.",
- "title": "Coordinate",
- "format": "integer"
- },
- "format": "array"
- },
- "title": "Coordinates",
- "format": "array"
- }
- },
- "required": [
- "answer"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_CLASSIFICATION": {
- "shortDescription": "Text Classification is the task of assigning a label or class to a given text.",
- "description": "Text Classification is the task of assigning a label or class to a given text. Some use cases are sentiment analysis, natural language inference, and assessing grammatical correctness.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "$ref": "#/$defs/string-input",
- "uiOrder": 1
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 2
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "results": {
- "uiOrder": 0,
- "items": {
- "properties": {
- "label": {
- "description": "The label for the class (model specific).",
- "uiOrder": 0,
- "title": "Label",
- "format": "string"
- },
- "score": {
- "description": "A floats that represents how likely is that the text belongs the this class.",
- "uiOrder": 1,
- "title": "Score",
- "format": "number"
- }
- },
- "required": [
- "label",
- "score"
- ],
- "description": "Result.",
- "title": "Result",
- "format": "object"
- },
- "description": "Results.",
- "title": "Results",
- "format": "array"
- }
- },
- "required": [
- "results"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_GENERATION": {
- "shortDescription": "Generating text is the task of producing new text. These models can, for example, fill in incomplete text or paraphrase.",
- "description": "Generating text is the task of producing new text. These models can, for example, fill in incomplete text or paraphrase.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "$ref": "#/$defs/string-input",
- "uiOrder": 1
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 3
- },
- "parameters": {
- "uiOrder": 2,
- "properties": {
- "do-sample": {
- "description": "Whether or not to use sampling, use greedy decoding otherwise.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 0,
- "title": "Do Sample",
- "format": "boolean"
- },
- "max-new-tokens": {
- "description": "The amount of new tokens to be generated, this does not include the input length it is a estimate of the size of generated text you want. Each new tokens slows down the request, so look for balance between response times and length of text generated.",
- "acceptFormats": [
- "integer"
- ],
- "shortDescription": "The amount of new tokens to be generated.",
- "uiOrder": 1,
- "title": "Max New Tokens",
- "format": "integer"
- },
- "max-time": {
- "description": "The amount of time in seconds that the query should take maximum. Network can cause some overhead so it will be a soft limit. Use that in combination with max-new-tokens for best results.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "The amount of time in seconds that the query should take maximum.",
- "uiOrder": 2,
- "title": "Max Time",
- "format": "number"
- },
- "num-return-sequences": {
- "description": "The number of proposition you want to be returned.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 3,
- "title": "Num Return Sequences",
- "format": "integer"
- },
- "repetition-penalty": {
- "description": "The more a token is used within generation the more it is penalized to not be picked in successive generation passes.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 4,
- "title": "Repetition Penalty",
- "format": "number"
- },
- "return-full-text": {
- "description": "If set to False, the return results will not contain the original query making it easier for prompting.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 5,
- "title": "Return Full Text",
- "format": "boolean"
- },
- "temperature": {
- "description": "The temperature of the sampling operation. 1 means regular sampling, 0 means always take the highest score, 100.0 is getting closer to uniform probability.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "The temperature of the sampling operation.",
- "uiOrder": 6,
- "title": "Temperature",
- "format": "number"
- },
- "top-k": {
- "description": "Integer to define the top tokens considered within the sample operation to create new text.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 7,
- "title": "Top K",
- "format": "integer"
- },
- "top-p": {
- "description": "Float to define the tokens that are within the sample operation of text generation. Add tokens in the sample for more probable to least probable until the sum of the probabilities is greater than top-p.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "Float to define the tokens that are within the sample operation of text generation.",
- "uiOrder": 8,
- "title": "Top P",
- "format": "number"
- }
- },
- "required": [],
- "description": "Parameters.",
- "title": "Parameters",
- "format": "object"
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "generated-text": {
- "description": "The continuated string.",
- "uiOrder": 1,
- "title": "Generated Text",
- "format": "string"
- }
- },
- "required": [
- "generated-text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_TO_IMAGE": {
- "shortDescription": "Generates images from input text.",
- "description": "Generates images from input text. These models can be used to generate and modify images based on text prompts.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "$ref": "#/$defs/string-input",
- "uiOrder": 1
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 3
- },
- "parameters": {
- "uiOrder": 2,
- "properties": {
- "guidance-scale": {
- "description": "Guidance scale.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 0,
- "title": "Guidance Scale",
- "format": "number"
- },
- "height": {
- "description": "Image Height.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "title": "Height",
- "format": "integer"
- },
- "negative-prompt": {
- "description": "Negative prompt for generating the image.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Negative Prompt",
- "format": "string"
- },
- "num-inference-steps": {
- "description": "Number of inference steps.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 3,
- "title": "Num Inference Steps",
- "format": "integer"
- },
- "width": {
- "description": "Image width.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Width",
- "format": "integer"
- }
- },
- "required": [],
- "description": "Parameters.",
- "title": "Parameters",
- "format": "object"
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "image": {
- "uiOrder": 0,
- "description": "Image.",
- "title": "Image",
- "format": "image/jpeg"
- }
- },
- "required": [
- "image"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TOKEN_CLASSIFICATION": {
- "shortDescription": "Token classification is a natural language understanding task in which a label is assigned to some tokens in a text.",
- "description": "Token classification is a natural language understanding task in which a label is assigned to some tokens in a text. Some popular token classification subtasks are Named Entity Recognition (NER) and Part-of-Speech (PoS) tagging. NER models could be trained to identify specific entities in a text, such as dates, individuals and places; and PoS tagging would identify, for example, which words in a text are verbs, nouns, and punctuation marks.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "$ref": "#/$defs/string-input",
- "uiOrder": 1
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 3
- },
- "parameters": {
- "uiOrder": 2,
- "properties": {
- "aggregation-strategy": {
- "description": "There are several aggregation strategies:\nnone: Every token gets classified without further aggregation.\nsimple: Entities are grouped according to the default schema (B-, I- tags get merged when the tag is similar).\nfirst: Same as the simple strategy except words cannot end up with different tags. Words will use the tag of the first token when there is ambiguity.\naverage: Same as the simple strategy except words cannot end up with different tags. Scores are averaged across tokens and then the maximum label is applied.\nmax: Same as the simple strategy except words cannot end up with different tags. Word entity will be the token with the maximum score.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "There are several aggregation strategies: none, simple, first, average, and max.",
- "uiOrder": 0,
- "title": "Aggregation Strategy",
- "format": "string"
- }
- },
- "required": [],
- "description": "Parameters.",
- "title": "Parameters",
- "format": "object"
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "results": {
- "uiOrder": 0,
- "items": {
- "properties": {
- "end": {
- "description": "The offset stringwise where the answer is located. Useful to disambiguate if word occurs multiple times.",
- "uiOrder": 0,
- "title": "End",
- "format": "integer"
- },
- "entity-group": {
- "description": "The type for the entity being recognized (model specific).",
- "uiOrder": 1,
- "title": "Entity Group",
- "format": "string"
- },
- "score": {
- "description": "How likely the entity was recognized.",
- "uiOrder": 2,
- "title": "Score",
- "format": "number"
- },
- "start": {
- "description": "The offset stringwise where the answer is located. Useful to disambiguate if word occurs multiple times.",
- "uiOrder": 3,
- "title": "Start",
- "format": "integer"
- },
- "word": {
- "description": "The string that was captured.",
- "uiOrder": 4,
- "title": "Word",
- "format": "string"
- }
- },
- "required": [],
- "title": "Result",
- "format": "object"
- },
- "description": "Results.",
- "title": "Results",
- "format": "array"
- }
- },
- "required": [
- "results"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TRANSLATION": {
- "shortDescription": "Translation is the task of converting text from one language to another.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "$ref": "#/$defs/string-input",
- "uiOrder": 1
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 2
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "translation-text": {
- "description": "The string after translation.",
- "uiOrder": 0,
- "title": "Translation Text",
- "format": "string"
- }
- },
- "required": [
- "translation-text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_ZERO_SHOT_CLASSIFICATION": {
- "shortDescription": "Zero-shot text classification is a task in natural language processing where a model is trained on a set of labeled examples but is then able to classify new examples from previously unseen classes.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "inputs": {
- "$ref": "#/$defs/string-input",
- "uiOrder": 1
- },
- "model": {
- "$ref": "#/$defs/model",
- "uiOrder": 0
- },
- "options": {
- "$ref": "#/$defs/options",
- "uiOrder": 3
- },
- "parameters": {
- "uiOrder": 2,
- "properties": {
- "candidate-labels": {
- "description": "a list of strings that are potential classes for inputs. (max 10 candidate-labels, for more, simply run multiple requests, results are going to be misleading if using too many candidate-labels anyway. If you want to keep the exact same, you can simply run multi-label=True and do the scaling on your end. ).",
- "shortDescription": "a list of strings that are potential classes for inputs.",
- "uiOrder": 0,
- "items": {
- "description": "a string that are potential class for inputs.",
- "title": "candidate-label",
- "format": "string"
- },
- "title": "Candidate Labels",
- "format": "array"
- },
- "multi-label": {
- "description": "Boolean that is set to True if classes can overlap.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 1,
- "title": "Multi Label",
- "format": "boolean"
- }
- },
- "required": [
- "candidate-labels"
- ],
- "description": "Parameters.",
- "title": "Parameters",
- "format": "object"
- }
- },
- "required": [
- "inputs",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "labels": {
- "description": "The list of strings for labels that you sent (in order).",
- "uiOrder": 1,
- "items": {
- "description": "The string for label that you sent (in order).",
- "title": "Label",
- "format": "string"
- },
- "title": "Labels",
- "format": "array"
- },
- "scores": {
- "description": "a list of floats that correspond the the probability of label, in the same order as labels.",
- "uiOrder": 0,
- "items": {
- "description": "float that correspond the the probability of label.",
- "title": "Score",
- "format": "number"
- },
- "title": "Scores",
- "format": "array"
- },
- "sequence": {
- "description": "The string sent as an input.",
- "uiOrder": 1,
- "title": "Sequence",
- "format": "string"
- }
- },
- "required": [
- "labels",
- "scores"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/huggingface/v0/config/tasks.yaml b/pkg/component/ai/huggingface/v0/config/tasks.yaml
new file mode 100644
index 000000000..8f1b88d17
--- /dev/null
+++ b/pkg/component/ai/huggingface/v0/config/tasks.yaml
@@ -0,0 +1,1416 @@
+$defs:
+ model:
+ description: The Hugging Face model to be used.
+ acceptFormats:
+ - string
+ title: Model
+ format: string
+ options:
+ properties:
+ use-cache:
+ description: There is a cache layer on the inference API to speedup requests
+ we have already seen. Most models can use those results as is as models
+ are deterministic (meaning the results will be the same anyway). However
+ if you use a non deterministic model, you can set this parameter to prevent
+ the caching mechanism from being used resulting in a real new query.
+ acceptFormats:
+ - boolean
+ shortDescription: Enable the cache of inference API
+ uiOrder: 1
+ title: Use Cache
+ format: boolean
+ wait-for-model:
+ description: If the model is not ready, wait for it instead of receiving 503.
+ It limits the number of requests required to get your inference done. It
+ is advised to only set this flag to true after receiving a 503 error as
+ it will limit hanging in your application to known places.
+ acceptFormats:
+ - boolean
+ shortDescription: Wait for model ready
+ uiOrder: 0
+ title: Wait For Model
+ format: boolean
+ required: []
+ description: Options for the model.
+ title: Options
+ format: object
+ string-input:
+ description: String input.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: String Input
+ format: string
+TASK_AUDIO_CLASSIFICATION:
+ shortDescription: Audio classification is the task of assigning a label or class
+ to a given audio.
+ description: Audio classification is the task of assigning a label or class to a
+ given audio. It can be used for recognizing which command a user is giving or
+ the emotion of a statement, as well as identifying a speaker.
+ input:
+ uiOrder: 0
+ properties:
+ audio:
+ description: The audio file.
+ acceptFormats:
+ - audio/*
+ uiOrder: 1
+ title: Audio
+ format: string
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ required:
+ - audio
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ classes:
+ uiOrder: 0
+ items:
+ properties:
+ label:
+ description: The label for the class (model specific).
+ uiOrder: 0
+ title: Label
+ format: string
+ score:
+ description: A float that represents how likely it is that the audio
+ file belongs to this class.
+ uiOrder: 1
+ title: Score
+ format: number
+ required:
+ - label
+ - score
+ description: Class.
+ title: Class
+ format: object
+ description: Classes.
+ title: Classes
+ format: array
+ required:
+ - classes
+ title: Output
+ format: object
+TASK_CONVERSATIONAL:
+ shortDescription: Conversational response modelling is the task of generating conversational
+ text that is relevant, coherent and knowledgable given a prompt.
+ description: Conversational response modelling is the task of generating conversational
+ text that is relevant, coherent and knowledgable given a prompt. These models
+ have applications in chatbots, and as a part of voice assistants.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ uiOrder: 1
+ properties:
+ generated-responses:
+ description: A list of strings corresponding to the earlier replies from
+ the model.
+ acceptFormats:
+ - array
+ uiOrder: 0
+ items:
+ description: Items.
+ format: string
+ title: Generated Responses
+ format: 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.
+ acceptFormats:
+ - array
+ shortDescription: A list of strings corresponding to the earlier replies
+ from the user.
+ uiOrder: 1
+ items:
+ description: Items.
+ format: string
+ title: Past User Inputs
+ format: array
+ text:
+ description: The last input from the user in the conversation.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Text
+ format: string
+ required:
+ - text
+ description: Inputs.
+ title: Inputs
+ format: object
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 3
+ parameters:
+ uiOrder: 2
+ properties:
+ max-length:
+ description: Integer to define the maximum length in tokens of the output
+ summary.
+ acceptFormats:
+ - integer
+ uiOrder: 0
+ title: Max Length
+ format: integer
+ max-time:
+ description: The amount of time in seconds that the query should take
+ maximum. Network can cause some overhead so it will be a soft limit.
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: The amount of time in seconds that the query should
+ take maximum.
+ uiOrder: 1
+ maximum: 120.0
+ minimum: 0.0
+ title: Max Time
+ format: number
+ min-length:
+ description: Integer to define the minimum length in tokens of the output
+ summary.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: Min Length
+ format: integer
+ repetition-penalty:
+ description: The more a token is used within generation the more it is
+ penalized to not be picked in successive generation passes.
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 3
+ maximum: 100.0
+ minimum: 0.0
+ title: Repetition Penalty
+ format: number
+ temperature:
+ default: 1.0
+ description: The temperature of the sampling operation. 1 means regular
+ sampling, 0 means always take the highest score, 100.0 is getting closer
+ to uniform probability.
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: The temperature of the sampling operation.
+ uiOrder: 4
+ maximum: 100.0
+ minimum: 0.0
+ title: Temperature
+ format: number
+ top-k:
+ description: Integer to define the top tokens considered within the sample
+ operation to create new text.
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Top K
+ format: integer
+ top-p:
+ description: Float to define the tokens that are within the sample operation
+ of text generation. Add tokens in the sample for more probable to least
+ probable until the sum of the probabilities is greater than top-p.
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: Float to define the tokens that are within the sample
+ operation of text generation.
+ uiOrder: 6
+ title: Top P
+ format: number
+ required: []
+ description: Parameters.
+ title: Parameters
+ format: object
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ conversation:
+ description: A facility dictionary to send back for the next input (with the
+ new user input addition).
+ uiOrder: 0
+ properties:
+ generated-responses:
+ description: List of strings. The last outputs from the model in the conversation,
+ after the model has run.
+ uiOrder: 0
+ items:
+ title: Generated Response
+ description: Generated Response.
+ format: string
+ title: Generated Responses
+ format: array
+ past-user-inputs:
+ description: List of strings. The last inputs from the user in the conversation,
+ after the model has run.
+ uiOrder: 1
+ items:
+ title: Past User Input
+ description: Past User Input.
+ format: string
+ title: Past User Inputs
+ format: array
+ required:
+ - generated-responses
+ - past-user-inputs
+ title: Conversation
+ format: object
+ generated-text:
+ description: The answer of the bot.
+ uiOrder: 1
+ title: Generated Text
+ format: string
+ required:
+ - generated-text
+ title: Output
+ format: object
+TASK_FILL_MASK:
+ shortDescription: Masked language modeling is the task of masking some of the words
+ in a sentence and predicting which words should replace those masks.
+ description: Masked language modeling is the task of masking some of the words in
+ a sentence and predicting which words should replace those masks. These models
+ are useful when we want to get a statistical understanding of the language in
+ which the model is trained in.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ $ref: '#/$defs/string-input'
+ description: a string to be filled from, must contain the [MASK] token (check
+ model card for exact name of the mask).
+ uiOrder: 1
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 2
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ results:
+ uiOrder: 0
+ items:
+ properties:
+ score:
+ description: The probability for this token.
+ uiOrder: 0
+ title: Score
+ format: number
+ sequence:
+ description: The actual sequence of tokens that ran against the model
+ (may contain special tokens).
+ uiOrder: 1
+ title: Sequence
+ format: string
+ token:
+ description: The id of the token.
+ uiOrder: 2
+ title: Token
+ format: integer
+ token-str:
+ description: The string representation of the token.
+ uiOrder: 3
+ title: Token Str
+ format: string
+ description: Result.
+ title: Result
+ required: []
+ format: object
+ description: Results.
+ title: Results
+ format: array
+ required:
+ - results
+ title: Output
+ format: object
+TASK_IMAGE_CLASSIFICATION:
+ shortDescription: Image classification is the task of assigning a label or class
+ to an entire image.
+ description: Image classification is the task of assigning a label or class to an
+ entire image. Images are expected to have only one class for each image. Image
+ classification models take an image as input and return a prediction about which
+ class the image belongs to.
+ input:
+ uiOrder: 0
+ properties:
+ image:
+ description: The image file.
+ acceptFormats:
+ - image/*
+ uiOrder: 1
+ title: Image
+ format: string
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ required:
+ - image
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ classes:
+ uiOrder: 0
+ items:
+ properties:
+ label:
+ description: The label for the class (model specific).
+ uiOrder: 0
+ title: Label
+ format: string
+ score:
+ description: A float that represents how likely it is that the image
+ file belongs to this class.
+ uiOrder: 0
+ title: Score
+ format: number
+ required:
+ - label
+ - score
+ description: Class.
+ title: Class
+ format: object
+ description: Classes.
+ title: Classes
+ format: array
+ required:
+ - classes
+ title: Output
+ format: object
+TASK_IMAGE_SEGMENTATION:
+ shortDescription: Image Segmentation divides an image into segments where each pixel
+ in the image is mapped to an object.
+ description: Image Segmentation divides an image into segments where each pixel
+ in the image is mapped to an object. This task has multiple variants such as instance
+ segmentation, panoptic segmentation and semantic segmentation.
+ input:
+ uiOrder: 0
+ properties:
+ image:
+ description: The image file.
+ acceptFormats:
+ - image/*
+ uiOrder: 1
+ title: Image
+ format: string
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ required:
+ - image
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ segments:
+ uiOrder: 0
+ items:
+ properties:
+ label:
+ description: The label for the class (model specific) of a segment.
+ uiOrder: 0
+ title: Label
+ format: string
+ mask:
+ description: A str (base64 str of a single channel black-and-white img)
+ representing the mask of a segment.
+ uiOrder: 1
+ title: Mask
+ format: image/png
+ score:
+ description: A float that represents how likely it is that the segment
+ belongs to the given class.
+ uiOrder: 2
+ title: Score
+ format: number
+ required:
+ - label
+ - mask
+ - score
+ description: Segment.
+ title: Segment
+ format: object
+ description: Segments.
+ title: Segments
+ format: array
+ required:
+ - segments
+ title: Output
+ format: object
+TASK_IMAGE_TO_TEXT:
+ shortDescription: Image to text models output a text from a given image.
+ description: Image to text models output a text from a given image. Image captioning
+ or optical character recognition can be considered as the most common applications
+ of image to text.
+ input:
+ uiOrder: 0
+ properties:
+ image:
+ description: The image file.
+ acceptFormats:
+ - image/*
+ uiOrder: 1
+ title: Image
+ format: string
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ required:
+ - image
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ text:
+ description: Generated text.
+ uiOrder: 0
+ title: Text
+ format: string
+ required:
+ - text
+ title: Output
+ format: object
+TASK_OBJECT_DETECTION:
+ shortDescription: Object Detection models allow users to identify objects of certain
+ defined classes.
+ description: Object Detection models allow users to identify objects of certain
+ defined classes. Object detection models receive an image as input and output
+ the images with bounding boxes and labels on detected objects.
+ input:
+ uiOrder: 0
+ properties:
+ image:
+ description: The image file.
+ acceptFormats:
+ - image/*
+ uiOrder: 1
+ title: Image
+ format: string
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ required:
+ - image
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ objects:
+ uiOrder: 0
+ items:
+ properties:
+ box:
+ description: A dict (with keys [xmin,ymin,xmax,ymax]) representing the
+ bounding box of a detected object.
+ uiOrder: 0
+ properties:
+ xmax:
+ description: X max.
+ uiOrder: 0
+ title: X Max
+ format: number
+ xmin:
+ description: X min.
+ uiOrder: 1
+ title: X Min
+ format: number
+ ymax:
+ description: Y Max.
+ uiOrder: 2
+ title: Y Max
+ format: number
+ ymin:
+ description: Y min.
+ uiOrder: 3
+ title: Y min
+ format: number
+ required:
+ - xmax
+ - xmin
+ - ymax
+ - ymin
+ title: Box
+ format: object
+ label:
+ description: The label for the class (model specific) of a detected
+ object.
+ uiOrder: 1
+ title: Label
+ format: string
+ score:
+ description: A float that represents how likely it is that the detected
+ object belongs to the given class.
+ uiOrder: 2
+ title: Score
+ format: number
+ required:
+ - box
+ - label
+ - score
+ description: Object.
+ title: Object
+ format: object
+ description: Objects.
+ title: Objects
+ format: array
+ required:
+ - objects
+ title: Output
+ format: object
+TASK_QUESTION_ANSWERING:
+ shortDescription: Question Answering models can retrieve the answer to a question
+ from a given text, which is useful for searching for an answer in a document.
+ description: Question Answering models can retrieve the answer to a question from
+ a given text, which is useful for searching for an answer in a document. Some
+ question answering models can generate answers without context!.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ uiOrder: 1
+ properties:
+ context:
+ description: The context for answering the question.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Context
+ format: string
+ question:
+ description: The question.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Question
+ format: string
+ required:
+ - question
+ - context
+ description: Inputs.
+ title: Inputs
+ format: object
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 2
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ answer:
+ description: A string that’s the answer within the text.
+ uiOrder: 0
+ title: Answer
+ format: string
+ score:
+ description: A float that represents how likely that the answer is correct.
+ uiOrder: 2
+ title: Score
+ format: number
+ start:
+ description: The index (string wise) of the start of the answer within context.
+ uiOrder: 3
+ title: Start
+ format: integer
+ stop:
+ description: The index (string wise) of the stop of the answer within context.
+ uiOrder: 1
+ title: Stop
+ format: integer
+ required:
+ - answer
+ title: Output
+ format: object
+TASK_SENTENCE_SIMILARITY:
+ shortDescription: Sentence Similarity is the task of determining how similar two
+ texts are.
+ description: Sentence Similarity is the task of determining how similar two texts
+ are. Sentence similarity models convert input texts into vectors (embeddings)
+ that capture semantic information and calculate how close (similar) they are between
+ them. This task is particularly useful for information retrieval and clustering/grouping.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ uiOrder: 1
+ properties:
+ sentences:
+ description: A list of strings which will be compared against the source-sentence.
+ acceptFormats:
+ - array
+ uiOrder: 0
+ items:
+ description: Items.
+ format: string
+ title: Sentences
+ format: array
+ source-sentence:
+ description: The string that you wish to compare the other strings with.
+ This can be a phrase, sentence, or longer passage, depending on the
+ model being used.
+ acceptFormats:
+ - string
+ shortDescription: The string that you wish to compare the other strings
+ with.
+ uiOrder: 1
+ title: Source Sentence
+ format: string
+ required:
+ - source-sentence
+ - sentences
+ description: Inputs.
+ title: Inputs
+ format: object
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 2
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ scores:
+ description: The associated similarity score for each of the given strings.
+ uiOrder: 0
+ items:
+ description: The associated similarity score for of the given string.
+ title: Score
+ format: number
+ title: Scores
+ format: array
+ required:
+ - scores
+ title: Output
+ format: object
+TASK_SPEECH_RECOGNITION:
+ shortDescription: Automatic Speech Recognition (ASR), also known as Speech to Text
+ (STT), is the task of transcribing a given audio to text.
+ description: Automatic Speech Recognition (ASR), also known as Speech to Text (STT),
+ is the task of transcribing a given audio to text. It has many applications, such
+ as voice user interfaces.
+ input:
+ uiOrder: 0
+ properties:
+ audio:
+ description: The audio file.
+ acceptFormats:
+ - audio/*
+ uiOrder: 1
+ title: Audio
+ format: string
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ required:
+ - audio
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ text:
+ description: The string that was recognized within the audio file.
+ uiOrder: 0
+ title: Text
+ format: string
+ required:
+ - text
+ title: Output
+ format: object
+TASK_SUMMARIZATION:
+ shortDescription: Summarization is the task of producing a shorter version of a
+ document while preserving its important information.
+ description: Summarization is the task of producing a shorter version of a document
+ while preserving its important information. Some models can extract text from
+ the original input, while other models can generate entirely new text.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ $ref: '#/$defs/string-input'
+ uiOrder: 1
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 3
+ parameters:
+ uiOrder: 2
+ properties:
+ max-length:
+ description: Integer to define the maximum length in tokens of the output
+ summary.
+ acceptFormats:
+ - integer
+ uiOrder: 0
+ title: Max Length
+ format: integer
+ max-time:
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 1
+ maximum: 120.0
+ minimum: 0.0
+ description: The amount of time in seconds that the query should take
+ maximum. Network can cause some overhead so it will be a soft limit.
+ title: Max Time
+ format: number
+ min-length:
+ description: Integer to define the minimum length in tokens of the output
+ summary.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: Min Length
+ format: integer
+ repetition-penalty:
+ description: The more a token is used within generation the more it is
+ penalized to not be picked in successive generation passes.
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 3
+ maximum: 100.0
+ minimum: 0.0
+ title: Repetition Penalty
+ format: number
+ temperature:
+ default: 1.0
+ description: The temperature of the sampling operation. 1 means regular
+ sampling, 0 means always take the highest score, 100.0 is getting closer
+ to uniform probability.
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: The temperature of the sampling operation.
+ uiOrder: 4
+ maximum: 100.0
+ minimum: 0.0
+ title: Temperature
+ format: number
+ top-k:
+ description: Integer to define the top tokens considered within the sample
+ operation to create new text.
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Top K
+ format: integer
+ top-p:
+ description: Float to define the tokens that are within the sample operation
+ of text generation. Add tokens in the sample for more probable to least
+ probable until the sum of the probabilities is greater than top-p.
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: Float to define the tokens that are within the sample
+ operation of text generation.
+ uiOrder: 6
+ title: Top P
+ format: number
+ required: []
+ description: Parameters.
+ title: Parameters
+ format: object
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ summary-text:
+ description: The string after summarization.
+ uiOrder: 0
+ title: Summary Text
+ format: string
+ required:
+ - summary-text
+ title: Output
+ format: object
+TASK_TABLE_QUESTION_ANSWERING:
+ shortDescription: Table Question Answering (Table QA) is the answering a question
+ about an information on a given table.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ uiOrder: 1
+ properties:
+ query:
+ description: The query in plain text that you want to ask the table.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Query
+ format: string
+ table:
+ description: A table of data represented as a dict of list where entries
+ are headers and the lists are all the values, all lists must have the
+ same size.
+ acceptFormats:
+ - '*'
+ uiOrder: 1
+ required: []
+ title: Table
+ format: object
+ required:
+ - query
+ - table
+ description: Inputs.
+ title: Inputs
+ format: object
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 2
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ aggregator:
+ description: The aggregator used to get the answer.
+ uiOrder: 0
+ title: Aggregator
+ format: string
+ answer:
+ description: The plaintext answer.
+ uiOrder: 1
+ title: Answer
+ format: string
+ cells:
+ description: a list of coordinates of the cells contents.
+ uiOrder: 2
+ items:
+ description: coordinate of the cell content.
+ title: Cell
+ format: string
+ title: Cells
+ format: array
+ coordinates:
+ description: a list of coordinates of the cells referenced in the answer.
+ uiOrder: 3
+ items:
+ items:
+ description: coordinate of the cell referenced in the answer.
+ title: Coordinate
+ format: integer
+ format: array
+ title: Coordinates
+ format: array
+ required:
+ - answer
+ title: Output
+ format: object
+TASK_TEXT_CLASSIFICATION:
+ shortDescription: Text Classification is the task of assigning a label or class
+ to a given text.
+ description: Text Classification is the task of assigning a label or class to a
+ given text. Some use cases are sentiment analysis, natural language inference,
+ and assessing grammatical correctness.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ $ref: '#/$defs/string-input'
+ uiOrder: 1
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 2
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ results:
+ uiOrder: 0
+ items:
+ properties:
+ label:
+ description: The label for the class (model specific).
+ uiOrder: 0
+ title: Label
+ format: string
+ score:
+ description: A floats that represents how likely is that the text belongs
+ the this class.
+ uiOrder: 1
+ title: Score
+ format: number
+ required:
+ - label
+ - score
+ description: Result.
+ title: Result
+ format: object
+ description: Results.
+ title: Results
+ format: array
+ required:
+ - results
+ title: Output
+ format: object
+TASK_TEXT_GENERATION:
+ shortDescription: Generating text is the task of producing new text. These models
+ can, for example, fill in incomplete text or paraphrase.
+ description: Generating text is the task of producing new text. These models can,
+ for example, fill in incomplete text or paraphrase.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ $ref: '#/$defs/string-input'
+ uiOrder: 1
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 3
+ parameters:
+ uiOrder: 2
+ properties:
+ do-sample:
+ description: Whether or not to use sampling, use greedy decoding otherwise.
+ acceptFormats:
+ - boolean
+ uiOrder: 0
+ title: Do Sample
+ format: boolean
+ max-new-tokens:
+ description: The amount of new tokens to be generated, this does not include
+ the input length it is a estimate of the size of generated text you
+ want. Each new tokens slows down the request, so look for balance between
+ response times and length of text generated.
+ acceptFormats:
+ - integer
+ shortDescription: The amount of new tokens to be generated.
+ uiOrder: 1
+ title: Max New Tokens
+ format: integer
+ max-time:
+ description: The amount of time in seconds that the query should take
+ maximum. Network can cause some overhead so it will be a soft limit.
+ Use that in combination with max-new-tokens for best results.
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: The amount of time in seconds that the query should
+ take maximum.
+ uiOrder: 2
+ title: Max Time
+ format: number
+ num-return-sequences:
+ description: The number of proposition you want to be returned.
+ acceptFormats:
+ - integer
+ uiOrder: 3
+ title: Num Return Sequences
+ format: integer
+ repetition-penalty:
+ description: The more a token is used within generation the more it is
+ penalized to not be picked in successive generation passes.
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 4
+ title: Repetition Penalty
+ format: number
+ return-full-text:
+ description: If set to False, the return results will not contain the
+ original query making it easier for prompting.
+ acceptFormats:
+ - boolean
+ uiOrder: 5
+ title: Return Full Text
+ format: boolean
+ temperature:
+ description: The temperature of the sampling operation. 1 means regular
+ sampling, 0 means always take the highest score, 100.0 is getting closer
+ to uniform probability.
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: The temperature of the sampling operation.
+ uiOrder: 6
+ title: Temperature
+ format: number
+ top-k:
+ description: Integer to define the top tokens considered within the sample
+ operation to create new text.
+ acceptFormats:
+ - integer
+ uiOrder: 7
+ title: Top K
+ format: integer
+ top-p:
+ description: Float to define the tokens that are within the sample operation
+ of text generation. Add tokens in the sample for more probable to least
+ probable until the sum of the probabilities is greater than top-p.
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: Float to define the tokens that are within the sample
+ operation of text generation.
+ uiOrder: 8
+ title: Top P
+ format: number
+ required: []
+ description: Parameters.
+ title: Parameters
+ format: object
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ generated-text:
+ description: The continuated string.
+ uiOrder: 1
+ title: Generated Text
+ format: string
+ required:
+ - generated-text
+ title: Output
+ format: object
+TASK_TEXT_TO_IMAGE:
+ shortDescription: Generates images from input text.
+ description: Generates images from input text. These models can be used to generate
+ and modify images based on text prompts.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ $ref: '#/$defs/string-input'
+ uiOrder: 1
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 3
+ parameters:
+ uiOrder: 2
+ properties:
+ guidance-scale:
+ description: Guidance scale.
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 0
+ title: Guidance Scale
+ format: number
+ height:
+ description: Image Height.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ title: Height
+ format: integer
+ negative-prompt:
+ description: Negative prompt for generating the image.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Negative Prompt
+ format: string
+ num-inference-steps:
+ description: Number of inference steps.
+ acceptFormats:
+ - integer
+ uiOrder: 3
+ title: Num Inference Steps
+ format: integer
+ width:
+ description: Image width.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Width
+ format: integer
+ required: []
+ description: Parameters.
+ title: Parameters
+ format: object
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ image:
+ uiOrder: 0
+ description: Image.
+ title: Image
+ format: image/jpeg
+ required:
+ - image
+ title: Output
+ format: object
+TASK_TOKEN_CLASSIFICATION:
+ shortDescription: Token classification is a natural language understanding task
+ in which a label is assigned to some tokens in a text.
+ description: Token classification is a natural language understanding task in which
+ a label is assigned to some tokens in a text. Some popular token classification
+ subtasks are Named Entity Recognition (NER) and Part-of-Speech (PoS) tagging.
+ NER models could be trained to identify specific entities in a text, such as dates,
+ individuals and places; and PoS tagging would identify, for example, which words
+ in a text are verbs, nouns, and punctuation marks.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ $ref: '#/$defs/string-input'
+ uiOrder: 1
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 3
+ parameters:
+ uiOrder: 2
+ properties:
+ aggregation-strategy:
+ description: |-
+ There are several aggregation strategies:
+ none: Every token gets classified without further aggregation.
+ simple: Entities are grouped according to the default schema (B-, I- tags get merged when the tag is similar).
+ first: Same as the simple strategy except words cannot end up with different tags. Words will use the tag of the first token when there is ambiguity.
+ average: Same as the simple strategy except words cannot end up with different tags. Scores are averaged across tokens and then the maximum label is applied.
+ max: Same as the simple strategy except words cannot end up with different tags. Word entity will be the token with the maximum score.
+ acceptFormats:
+ - string
+ shortDescription: 'There are several aggregation strategies: none, simple,
+ first, average, and max.'
+ uiOrder: 0
+ title: Aggregation Strategy
+ format: string
+ required: []
+ description: Parameters.
+ title: Parameters
+ format: object
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ results:
+ uiOrder: 0
+ items:
+ properties:
+ end:
+ description: The offset stringwise where the answer is located. Useful
+ to disambiguate if word occurs multiple times.
+ uiOrder: 0
+ title: End
+ format: integer
+ entity-group:
+ description: The type for the entity being recognized (model specific).
+ uiOrder: 1
+ title: Entity Group
+ format: string
+ score:
+ description: How likely the entity was recognized.
+ uiOrder: 2
+ title: Score
+ format: number
+ start:
+ description: The offset stringwise where the answer is located. Useful
+ to disambiguate if word occurs multiple times.
+ uiOrder: 3
+ title: Start
+ format: integer
+ word:
+ description: The string that was captured.
+ uiOrder: 4
+ title: Word
+ format: string
+ required: []
+ title: Result
+ format: object
+ description: Results.
+ title: Results
+ format: array
+ required:
+ - results
+ title: Output
+ format: object
+TASK_TRANSLATION:
+ shortDescription: Translation is the task of converting text from one language to
+ another.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ $ref: '#/$defs/string-input'
+ uiOrder: 1
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 2
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ translation-text:
+ description: The string after translation.
+ uiOrder: 0
+ title: Translation Text
+ format: string
+ required:
+ - translation-text
+ title: Output
+ format: object
+TASK_ZERO_SHOT_CLASSIFICATION:
+ shortDescription: Zero-shot text classification is a task in natural language processing
+ where a model is trained on a set of labeled examples but is then able to classify
+ new examples from previously unseen classes.
+ input:
+ uiOrder: 0
+ properties:
+ inputs:
+ $ref: '#/$defs/string-input'
+ uiOrder: 1
+ model:
+ $ref: '#/$defs/model'
+ uiOrder: 0
+ options:
+ $ref: '#/$defs/options'
+ uiOrder: 3
+ parameters:
+ uiOrder: 2
+ properties:
+ candidate-labels:
+ description: a list of strings that are potential classes for inputs.
+ (max 10 candidate-labels, for more, simply run multiple requests, results
+ are going to be misleading if using too many candidate-labels anyway.
+ If you want to keep the exact same, you can simply run multi-label=True
+ and do the scaling on your end. ).
+ shortDescription: a list of strings that are potential classes for inputs.
+ uiOrder: 0
+ items:
+ description: a string that are potential class for inputs.
+ title: candidate-label
+ format: string
+ title: Candidate Labels
+ format: array
+ multi-label:
+ description: Boolean that is set to True if classes can overlap.
+ acceptFormats:
+ - boolean
+ uiOrder: 1
+ title: Multi Label
+ format: boolean
+ required:
+ - candidate-labels
+ description: Parameters.
+ title: Parameters
+ format: object
+ required:
+ - inputs
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ labels:
+ description: The list of strings for labels that you sent (in order).
+ uiOrder: 1
+ items:
+ description: The string for label that you sent (in order).
+ title: Label
+ format: string
+ title: Labels
+ format: array
+ scores:
+ description: a list of floats that correspond the the probability of label,
+ in the same order as labels.
+ uiOrder: 0
+ items:
+ description: float that correspond the the probability of label.
+ title: Score
+ format: number
+ title: Scores
+ format: array
+ sequence:
+ description: The string sent as an input.
+ uiOrder: 1
+ title: Sequence
+ format: string
+ required:
+ - labels
+ - scores
+ title: Output
+ format: object
diff --git a/pkg/component/ai/huggingface/v0/main.go b/pkg/component/ai/huggingface/v0/main.go
index d32be256f..2db9738e1 100644
--- a/pkg/component/ai/huggingface/v0/main.go
+++ b/pkg/component/ai/huggingface/v0/main.go
@@ -41,12 +41,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
)
@@ -62,7 +62,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/instill/v0/README.mdx b/pkg/component/ai/instill/v0/README.mdx
index 4b52c1e1b..a017cabca 100644
--- a/pkg/component/ai/instill/v0/README.mdx
+++ b/pkg/component/ai/instill/v0/README.mdx
@@ -30,7 +30,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/instill/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/instill/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/instill/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/instill/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/instill/v0/config/definition.json b/pkg/component/ai/instill/v0/config/definition.json
deleted file mode 100644
index 678d81dc8..000000000
--- a/pkg/component/ai/instill/v0/config/definition.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "availableTasks": [
- "TASK_CLASSIFICATION",
- "TASK_INSTANCE_SEGMENTATION",
- "TASK_KEYPOINT",
- "TASK_DETECTION",
- "TASK_OCR",
- "TASK_SEMANTIC_SEGMENTATION",
- "TASK_TEXT_GENERATION",
- "TASK_TEXT_GENERATION_CHAT",
- "TASK_TEXT_TO_IMAGE",
- "TASK_VISUAL_QUESTION_ANSWERING",
- "TASK_CHAT",
- "TASK_EMBEDDING"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/ai/instill-model",
- "icon": "assets/instill-model.svg",
- "iconUrl": "",
- "id": "instill-model",
- "public": true,
- "title": "Instill Model",
- "description": "Connect the AI models served on the Instill Model Platform.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_AI",
- "uid": "ddcf42c3-4c30-4c65-9585-25f1c89b2b48",
- "vendor": "Instill",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/instill/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/ai/instill/v0/config/definition.yaml b/pkg/component/ai/instill/v0/config/definition.yaml
new file mode 100644
index 000000000..a1380ed00
--- /dev/null
+++ b/pkg/component/ai/instill/v0/config/definition.yaml
@@ -0,0 +1,29 @@
+availableTasks:
+- TASK_CLASSIFICATION
+- TASK_INSTANCE_SEGMENTATION
+- TASK_KEYPOINT
+- TASK_DETECTION
+- TASK_OCR
+- TASK_SEMANTIC_SEGMENTATION
+- TASK_TEXT_GENERATION
+- TASK_TEXT_GENERATION_CHAT
+- TASK_TEXT_TO_IMAGE
+- TASK_VISUAL_QUESTION_ANSWERING
+- TASK_CHAT
+- TASK_EMBEDDING
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/ai/instill-model
+icon: assets/instill-model.svg
+iconUrl: ''
+id: instill-model
+public: true
+title: Instill Model
+description: Connect the AI models served on the Instill Model Platform.
+tombstone: false
+type: COMPONENT_TYPE_AI
+uid: ddcf42c3-4c30-4c65-9585-25f1c89b2b48
+vendor: Instill
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/instill/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/ai/instill/v0/config/tasks.json b/pkg/component/ai/instill/v0/config/tasks.json
deleted file mode 100644
index b828c6fd9..000000000
--- a/pkg/component/ai/instill/v0/config/tasks.json
+++ /dev/null
@@ -1,733 +0,0 @@
-{
- "$defs": {
- "chat-message": {
- "properties": {
- "content": {
- "$ref": "schema.json#/$defs/instill-types/multi-modal-content",
- "description": "The message content.",
- "uiOrder": 1,
- "title": "Content"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "uiOrder": 0,
- "title": "Role",
- "format": "string"
- }
- },
- "required": [
- "role",
- "content"
- ],
- "title": "Chat Message",
- "format": "object"
- },
- "common": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "image-base64": {
- "description": "Image base64.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 2,
- "title": "Image",
- "format": "string"
- },
- "model-name": {
- "description": "The Instill Model model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- }
- },
- "required": [
- "image-base64",
- "model-name"
- ],
- "title": "Input",
- "format": "object"
- }
- },
- "TASK_CLASSIFICATION": {
- "shortDescription": "Classify images into predefined categories.",
- "input": {
- "$ref": "#/$defs/common",
- "format": "object"
- },
- "output": {
- "$ref": "schema.json#/$defs/instill-types/classification",
- "description": "Output.",
- "uiOrder": 0,
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DETECTION": {
- "shortDescription": "Detect and localize multiple objects in images.",
- "input": {
- "$ref": "#/$defs/common",
- "format": "object"
- },
- "output": {
- "$ref": "schema.json#/$defs/instill-types/detection",
- "description": "Output.",
- "uiOrder": 0,
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_INSTANCE_SEGMENTATION": {
- "shortDescription": "Detect, localize and delineate multiple objects in images.",
- "input": {
- "$ref": "#/$defs/common",
- "format": "object"
- },
- "output": {
- "$ref": "schema.json#/$defs/instill-types/instance-segmentation",
- "description": "Output.",
- "uiOrder": 0,
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_KEYPOINT": {
- "shortDescription": "Detect and localize multiple keypoints of objects in images.",
- "input": {
- "$ref": "#/$defs/common",
- "format": "object"
- },
- "output": {
- "$ref": "schema.json#/$defs/instill-types/keypoint",
- "description": "Output.",
- "uiOrder": 0,
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_OCR": {
- "shortDescription": "Detect and recognize text in images.",
- "input": {
- "$ref": "#/$defs/common",
- "format": "object"
- },
- "output": {
- "$ref": "schema.json#/$defs/instill-types/ocr",
- "description": "Output.",
- "uiOrder": 0,
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEMANTIC_SEGMENTATION": {
- "shortDescription": "Classify image pixels into predefined categories.",
- "input": {
- "$ref": "#/$defs/common",
- "format": "object"
- },
- "output": {
- "$ref": "schema.json#/$defs/instill-types/semantic-segmentation",
- "description": "Output.",
- "uiOrder": 0,
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_GENERATION": {
- "shortDescription": "Generate texts from input text prompts.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "max-new-tokens": {
- "default": 50,
- "description": "The maximum number of tokens for model to generate.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Max New Tokens",
- "format": "integer"
- },
- "model-name": {
- "description": "The Instill Model model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- },
- "prompt": {
- "description": "The prompt text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Prompt",
- "format": "string"
- },
- "seed": {
- "description": "The seed.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Seed",
- "format": "integer"
- },
- "system-message": {
- "default": "You are a helpful assistant.",
- "description": "The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is using a generic message as \"You are a helpful assistant.\".",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The system message helps set the behavior of the assistant",
- "uiOrder": 2,
- "title": "System Message",
- "format": "string"
- },
- "temperature": {
- "default": 0.7,
- "description": "The temperature for sampling.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 5,
- "title": "Temperature",
- "format": "number"
- }
- },
- "required": [
- "prompt",
- "model-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "text": {
- "description": "Text.",
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_GENERATION_CHAT": {
- "shortDescription": "Generate texts from input text prompts and chat history.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "chat-history": {
- "description": "Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {\"role\": \"The message role, i.e. 'system', 'user' or 'assistant'\", \"content\": \"message content\"}.",
- "acceptFormats": [
- "object"
- ],
- "shortDescription": "Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {\"role\": \"The message role, i.e. 'system', 'user' or 'assistant'\", \"content\": \"message content\"}.",
- "uiOrder": 4,
- "items": {
- "$ref": "#/$defs/chat-message"
- },
- "title": "Chat history",
- "format": "array"
- },
- "max-new-tokens": {
- "default": 50,
- "description": "The maximum number of tokens for model to generate.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Max New Tokens",
- "format": "integer"
- },
- "model-name": {
- "description": "The Instill Model model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- },
- "prompt": {
- "description": "The prompt text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Prompt",
- "format": "string"
- },
- "prompt-images": {
- "description": "The prompt images.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "format": "string"
- },
- "title": "Prompt Images",
- "format": "array"
- },
- "seed": {
- "description": "The seed.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Seed",
- "format": "integer"
- },
- "system-message": {
- "default": "You are a helpful assistant.",
- "description": "The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is using a generic message as \"You are a helpful assistant.\".",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The system message helps set the behavior of the assistant",
- "uiOrder": 2,
- "title": "System Message",
- "format": "string"
- },
- "temperature": {
- "default": 0.7,
- "description": "The temperature for sampling.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 5,
- "title": "Temperature",
- "format": "number"
- }
- },
- "required": [
- "prompt",
- "model-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "text": {
- "description": "Text.",
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_TO_IMAGE": {
- "shortDescription": "Generate images from input text prompts.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "model-name": {
- "description": "The Instill Model model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- },
- "prompt": {
- "description": "The prompt text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Prompt",
- "format": "string"
- },
- "samples": {
- "description": "The number of generated samples, default is 1.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Samples",
- "format": "integer"
- },
- "seed": {
- "description": "The seed, default is 0.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Seed",
- "format": "integer"
- },
- "negative-prompt": {
- "title": "Aspect ratio",
- "description": "Keywords of what you do not wish to see in the output image.",
- "shortDescription": "Keywords of what you do not wish to see in the output image.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 7,
- "format": "string"
- },
- "aspect-ratio": {
- "title": "Aspect ratio",
- "description": "Controls the aspect ratio of the generated image. Defaults to 1:1.",
- "shortDescription": "Controls the aspect ratio of the generated image. Defaults to 1:1.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 8,
- "default": "1:1",
- "enum": [
- "16:9",
- "1:1",
- "21:9",
- "2:3",
- "3:2",
- "4:5",
- "5:4",
- "9:16",
- "9:21"
- ],
- "format": "string"
- }
- },
- "required": [
- "prompt",
- "model-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "images": {
- "description": "Images.",
- "uiOrder": 0,
- "items": {
- "title": "Image",
- "format": "image/jpeg"
- },
- "title": "Images",
- "format": "array"
- }
- },
- "required": [
- "images"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_VISUAL_QUESTION_ANSWERING": {
- "shortDescription": "Answer questions based on a prompt and an image.",
- "$ref": "#/TASK_TEXT_GENERATION_CHAT"
- },
- "TASK_CHAT": {
- "shortDescription": "Generate texts from input text prompts and chat history.",
- "$ref": "#/TASK_TEXT_GENERATION_CHAT"
- },
- "TASK_EMBEDDING": {
- "title": "Embedding",
- "shortDescription": "This task refers to the process of generating vector embeddings from input data, which can be text or images. This transformation converts the data into a dense, fixed-length numerical representation that captures the essential features of the original input. These embeddings are typically used in machine learning tasks to represent complex data in a more structured, simplified form.",
- "input": {
- "$schema": "http://json-schema.org/draft-07/schema#",
- "title": "Embedding Input",
- "description": "Input schema of the embedding task.",
- "shortDescription": "Input schema of the embedding task.",
- "properties": {
- "data": {
- "description": "Input data.",
- "shortDescription": "Input data.",
- "properties": {
- "model": {
- "description": "The model to be used for generating embeddings. It should be `namespace/model-name/version`. i.e. `abrc/yolov7-stomata/v0.1.0`. You can see the version from the Versions tab of Model page.",
- "shortDescription": "The model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Model",
- "format": "string"
- },
- "embeddings": {
- "title": "Embeddings",
- "items": {
- "oneOf": [
- {
- "properties": {
- "text": {
- "title": "Text Content",
- "description": "When the input is text, the raw text is tokenized and processed into a dense, fixed-length vector that captures semantic information such as word meanings and relationships. These text embeddings enable tasks like sentiment analysis, search, or classification.",
- "shortDescription": "Text content.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "title": "Text",
- "description": "Text input content type.",
- "shortDescription": "Text input content type.",
- "acceptFormats": [
- "string"
- ],
- "const": "text",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "title": "Text",
- "required": [
- "text",
- "type"
- ],
- "format": "object"
- },
- {
- "properties": {
- "image-url": {
- "title": "Image URL",
- "description": "When the input is an image from a URL, the image is first fetched from the URL and then decoded into its original format. It is then processed into a fixed-length vector representing essential visual features like shapes and colors. These image embeddings are useful for tasks like image classification or similarity search, providing structured numerical data for complex visual inputs.",
- "shortDescription": "Image content URL.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "title": "Image URL",
- "description": "Image URL input content type.",
- "shortDescription": "Image URL input content type",
- "acceptFormats": [
- "string"
- ],
- "const": "image-url",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "title": "Image URL",
- "required": [
- "image-url",
- "type"
- ],
- "format": "object"
- },
- {
- "properties": {
- "image-base64": {
- "title": "Image File",
- "description": "When the input is an image in base64 format, the base64-encoded data is first decoded into its original image form. The image is then processed and transformed into a dense, fixed-length numerical vector, capturing key visual features like shapes, colors, or textures.",
- "shortDescription": "Image file input.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "title": "Image File",
- "description": "Image file input content type.",
- "shortDescription": "Image file input content type.",
- "acceptFormats": [
- "string"
- ],
- "const": "image-base64",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "title": "Image Base64",
- "required": [
- "image-base64",
- "type"
- ],
- "format": "object"
- }
- ],
- "title": "Embedding",
- "description": "Input data to be embedded.",
- "uiOrder": 0,
- "required": [
- "type"
- ],
- "format": "object"
- },
- "description": "List of input data to be embedded.",
- "uiOrder": 1,
- "format": "array"
- }
- },
- "required": [
- "model",
- "embeddings"
- ],
- "uiOrder": 0,
- "title": "Data",
- "format": "object"
- },
- "parameter": {
- "description": "Input parameter.",
- "shortDescription": "Input parameter.",
- "properties": {
- "format": {
- "title": "Data Format",
- "description": "The data format of the embeddings. Defaults to float.",
- "shortDescription": "Data format",
- "acceptFormats": [
- "string"
- ],
- "enum": [
- "float",
- "base64"
- ],
- "default": "float",
- "uiOrder": 0,
- "format": "string"
- },
- "dimensions": {
- "title": "Dimensions",
- "description": "Number of dimensions in the output embedding vectors.",
- "shortDescription": "Number of dimensions",
- "acceptFormats": [
- "integer"
- ],
- "default": 512,
- "uiOrder": 1,
- "format": "integer"
- },
- "input-type": {
- "title": "Input Type",
- "description": "The type of input data to be embedded (e.g., query, document).",
- "shortDescription": "Type of input data",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "format": "string"
- },
- "truncate": {
- "title": "Truncate",
- "description": "How to handle inputs longer than the max token length. Defaults to 'End'.",
- "shortDescription": "Truncation handling",
- "acceptFormats": [
- "string"
- ],
- "enum": [
- "None",
- "End",
- "Start"
- ],
- "default": "End",
- "uiOrder": 3,
- "format": "string"
- }
- },
- "title": "Parameter",
- "uiOrder": 1,
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "data"
- ],
- "format": "object"
- },
- "output": {
- "$schema": "http://json-schema.org/draft-07/schema#",
- "title": "Embedding Output",
- "description": "Output schema of the embedding task.",
- "shortDescription": "Output schema of the embedding task.",
- "properties": {
- "data": {
- "description": "Output data.",
- "shortDescription": "Output data.",
- "properties": {
- "embeddings": {
- "title": "Embeddings",
- "description": "List of generated embeddings.",
- "shortDescription": "List of embeddings.",
- "items": {
- "properties": {
- "index": {
- "title": "Index",
- "description": "The index of the embedding vector in the array.",
- "shortDescription": "Index in the array",
- "uiOrder": 0,
- "format": "integer"
- },
- "vector": {
- "title": "Embedding Vector",
- "description": "The embedding vector.",
- "shortDescription": "Embedding vector.",
- "items": {
- "format": "number"
- },
- "uiOrder": 1,
- "format": "array"
- },
- "created": {
- "title": "Created",
- "description": "The Unix timestamp (in seconds) of when the embedding was created.",
- "shortDescription": "Timestamp of creation",
- "uiOrder": 2,
- "format": "integer"
- }
- },
- "required": [
- "index",
- "vector",
- "created"
- ],
- "format": "object"
- },
- "uiOrder": 0,
- "format": "array"
- }
- },
- "required": [
- "embeddings"
- ],
- "uiOrder": 0,
- "title": "Data",
- "format": "object"
- }
- },
- "required": [
- "data"
- ],
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/instill/v0/config/tasks.yaml b/pkg/component/ai/instill/v0/config/tasks.yaml
new file mode 100644
index 000000000..22dff2535
--- /dev/null
+++ b/pkg/component/ai/instill/v0/config/tasks.yaml
@@ -0,0 +1,605 @@
+$defs:
+ chat-message:
+ properties:
+ content:
+ $ref: schema.yaml#/$defs/instill-types/multi-modal-content
+ description: The message content.
+ uiOrder: 1
+ title: Content
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ uiOrder: 0
+ title: Role
+ format: string
+ required:
+ - role
+ - content
+ title: Chat Message
+ format: object
+ common:
+ description: Input.
+ uiOrder: 0
+ properties:
+ image-base64:
+ description: Image base64.
+ acceptFormats:
+ - image/*
+ uiOrder: 2
+ title: Image
+ format: string
+ model-name:
+ description: The Instill Model model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Model Name
+ format: string
+ required:
+ - image-base64
+ - model-name
+ title: Input
+ format: object
+TASK_CLASSIFICATION:
+ shortDescription: Classify images into predefined categories.
+ input:
+ $ref: '#/$defs/common'
+ format: object
+ output:
+ $ref: schema.yaml#/$defs/instill-types/classification
+ description: Output.
+ uiOrder: 0
+ title: Output
+ format: object
+TASK_DETECTION:
+ shortDescription: Detect and localize multiple objects in images.
+ input:
+ $ref: '#/$defs/common'
+ format: object
+ output:
+ $ref: schema.yaml#/$defs/instill-types/detection
+ description: Output.
+ uiOrder: 0
+ title: Output
+ format: object
+TASK_INSTANCE_SEGMENTATION:
+ shortDescription: Detect, localize and delineate multiple objects in images.
+ input:
+ $ref: '#/$defs/common'
+ format: object
+ output:
+ $ref: schema.yaml#/$defs/instill-types/instance-segmentation
+ description: Output.
+ uiOrder: 0
+ title: Output
+ format: object
+TASK_KEYPOINT:
+ shortDescription: Detect and localize multiple keypoints of objects in images.
+ input:
+ $ref: '#/$defs/common'
+ format: object
+ output:
+ $ref: schema.yaml#/$defs/instill-types/keypoint
+ description: Output.
+ uiOrder: 0
+ title: Output
+ format: object
+TASK_OCR:
+ shortDescription: Detect and recognize text in images.
+ input:
+ $ref: '#/$defs/common'
+ format: object
+ output:
+ $ref: schema.yaml#/$defs/instill-types/ocr
+ description: Output.
+ uiOrder: 0
+ title: Output
+ format: object
+TASK_SEMANTIC_SEGMENTATION:
+ shortDescription: Classify image pixels into predefined categories.
+ input:
+ $ref: '#/$defs/common'
+ format: object
+ output:
+ $ref: schema.yaml#/$defs/instill-types/semantic-segmentation
+ description: Output.
+ uiOrder: 0
+ title: Output
+ format: object
+TASK_TEXT_GENERATION:
+ shortDescription: Generate texts from input text prompts.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ max-new-tokens:
+ default: 50
+ description: The maximum number of tokens for model to generate.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Max New Tokens
+ format: integer
+ model-name:
+ description: The Instill Model model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Model Name
+ format: string
+ prompt:
+ description: The prompt text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Prompt
+ format: string
+ seed:
+ description: The seed.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Seed
+ format: integer
+ system-message:
+ default: You are a helpful assistant.
+ description: The system message helps set the behavior of the assistant. For
+ example, you can modify the personality of the assistant or provide specific
+ instructions about how it should behave throughout the conversation. By
+ default, the model’s behavior is using a generic message as "You are a helpful
+ assistant.".
+ acceptFormats:
+ - string
+ shortDescription: The system message helps set the behavior of the assistant
+ uiOrder: 2
+ title: System Message
+ format: string
+ temperature:
+ default: 0.7
+ description: The temperature for sampling.
+ acceptFormats:
+ - number
+ uiOrder: 5
+ title: Temperature
+ format: number
+ required:
+ - prompt
+ - model-name
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ text:
+ description: Text.
+ uiOrder: 0
+ title: Text
+ format: string
+ required:
+ - text
+ title: Output
+ format: object
+TASK_TEXT_GENERATION_CHAT:
+ shortDescription: Generate texts from input text prompts and chat history.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ chat-history:
+ description: 'Incorporate external chat history, specifically previous messages
+ within the conversation. Please note that System Message will be ignored
+ and will not have any effect when this field is populated. Each message
+ should adhere to the format: : {"role": "The message role, i.e. ''system'',
+ ''user'' or ''assistant''", "content": "message content"}.'
+ acceptFormats:
+ - object
+ shortDescription: 'Incorporate external chat history, specifically previous
+ messages within the conversation. Please note that System Message will be
+ ignored and will not have any effect when this field is populated. Each
+ message should adhere to the format: : {"role": "The message role, i.e.
+ ''system'', ''user'' or ''assistant''", "content": "message content"}.'
+ uiOrder: 4
+ items:
+ $ref: '#/$defs/chat-message'
+ title: Chat history
+ format: array
+ max-new-tokens:
+ default: 50
+ description: The maximum number of tokens for model to generate.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Max New Tokens
+ format: integer
+ model-name:
+ description: The Instill Model model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Model Name
+ format: string
+ prompt:
+ description: The prompt text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Prompt
+ format: string
+ prompt-images:
+ description: The prompt images.
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ format: string
+ title: Prompt Images
+ format: array
+ seed:
+ description: The seed.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Seed
+ format: integer
+ system-message:
+ default: You are a helpful assistant.
+ description: The system message helps set the behavior of the assistant. For
+ example, you can modify the personality of the assistant or provide specific
+ instructions about how it should behave throughout the conversation. By
+ default, the model’s behavior is using a generic message as "You are a helpful
+ assistant.".
+ acceptFormats:
+ - string
+ shortDescription: The system message helps set the behavior of the assistant
+ uiOrder: 2
+ title: System Message
+ format: string
+ temperature:
+ default: 0.7
+ description: The temperature for sampling.
+ acceptFormats:
+ - number
+ uiOrder: 5
+ title: Temperature
+ format: number
+ required:
+ - prompt
+ - model-name
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ text:
+ description: Text.
+ uiOrder: 0
+ title: Text
+ format: string
+ required:
+ - text
+ title: Output
+ format: object
+TASK_TEXT_TO_IMAGE:
+ shortDescription: Generate images from input text prompts.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ model-name:
+ description: The Instill Model model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Model Name
+ format: string
+ prompt:
+ description: The prompt text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Prompt
+ format: string
+ samples:
+ description: The number of generated samples, default is 1.
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Samples
+ format: integer
+ seed:
+ description: The seed, default is 0.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Seed
+ format: integer
+ negative-prompt:
+ title: Aspect ratio
+ description: Keywords of what you do not wish to see in the output image.
+ shortDescription: Keywords of what you do not wish to see in the output image.
+ acceptFormats:
+ - string
+ uiOrder: 7
+ format: string
+ aspect-ratio:
+ title: Aspect ratio
+ description: Controls the aspect ratio of the generated image. Defaults to
+ 1:1.
+ shortDescription: Controls the aspect ratio of the generated image. Defaults
+ to 1:1.
+ acceptFormats:
+ - string
+ uiOrder: 8
+ default: '1:1'
+ enum:
+ - '16:9'
+ - '1:1'
+ - '21:9'
+ - '2:3'
+ - '3:2'
+ - '4:5'
+ - '5:4'
+ - '9:16'
+ - '9:21'
+ format: string
+ required:
+ - prompt
+ - model-name
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ images:
+ description: Images.
+ uiOrder: 0
+ items:
+ title: Image
+ format: image/jpeg
+ title: Images
+ format: array
+ required:
+ - images
+ title: Output
+ format: object
+TASK_VISUAL_QUESTION_ANSWERING:
+ shortDescription: Answer questions based on a prompt and an image.
+ $ref: '#/TASK_TEXT_GENERATION_CHAT'
+TASK_CHAT:
+ shortDescription: Generate texts from input text prompts and chat history.
+ $ref: '#/TASK_TEXT_GENERATION_CHAT'
+TASK_EMBEDDING:
+ title: Embedding
+ shortDescription: This task refers to the process of generating vector embeddings
+ from input data, which can be text or images. This transformation converts the
+ data into a dense, fixed-length numerical representation that captures the essential
+ features of the original input. These embeddings are typically used in machine
+ learning tasks to represent complex data in a more structured, simplified form.
+ input:
+ title: Embedding Input
+ description: Input schema of the embedding task.
+ shortDescription: Input schema of the embedding task.
+ properties:
+ data:
+ description: Input data.
+ shortDescription: Input data.
+ properties:
+ model:
+ description: The model to be used for generating embeddings. It should
+ be `namespace/model-name/version`. i.e. `abrc/yolov7-stomata/v0.1.0`.
+ You can see the version from the Versions tab of Model page.
+ shortDescription: The model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Model
+ format: string
+ embeddings:
+ title: Embeddings
+ items:
+ oneOf:
+ - properties:
+ text:
+ title: Text Content
+ description: When the input is text, the raw text is tokenized
+ and processed into a dense, fixed-length vector that captures
+ semantic information such as word meanings and relationships.
+ These text embeddings enable tasks like sentiment analysis,
+ search, or classification.
+ shortDescription: Text content.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ format: string
+ type:
+ title: Text
+ description: Text input content type.
+ shortDescription: Text input content type.
+ acceptFormats:
+ - string
+ const: text
+ uiOrder: 0
+ format: string
+ title: Text
+ required:
+ - text
+ - type
+ format: object
+ - properties:
+ image-url:
+ title: Image URL
+ description: When the input is an image from a URL, the image
+ is first fetched from the URL and then decoded into its original
+ format. It is then processed into a fixed-length vector representing
+ essential visual features like shapes and colors. These image
+ embeddings are useful for tasks like image classification or
+ similarity search, providing structured numerical data for complex
+ visual inputs.
+ shortDescription: Image content URL.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ format: string
+ type:
+ title: Image URL
+ description: Image URL input content type.
+ shortDescription: Image URL input content type
+ acceptFormats:
+ - string
+ const: image-url
+ uiOrder: 0
+ format: string
+ title: Image URL
+ required:
+ - image-url
+ - type
+ format: object
+ - properties:
+ image-base64:
+ title: Image File
+ description: When the input is an image in base64 format, the
+ base64-encoded data is first decoded into its original image
+ form. The image is then processed and transformed into a dense,
+ fixed-length numerical vector, capturing key visual features
+ like shapes, colors, or textures.
+ shortDescription: Image file input.
+ acceptFormats:
+ - image/*
+ uiOrder: 1
+ format: string
+ type:
+ title: Image File
+ description: Image file input content type.
+ shortDescription: Image file input content type.
+ acceptFormats:
+ - string
+ const: image-base64
+ uiOrder: 0
+ format: string
+ title: Image Base64
+ required:
+ - image-base64
+ - type
+ format: object
+ title: Embedding
+ description: Input data to be embedded.
+ uiOrder: 0
+ required:
+ - type
+ format: object
+ description: List of input data to be embedded.
+ uiOrder: 1
+ format: array
+ required:
+ - model
+ - embeddings
+ uiOrder: 0
+ title: Data
+ format: object
+ parameter:
+ description: Input parameter.
+ shortDescription: Input parameter.
+ properties:
+ format:
+ title: Data Format
+ description: The data format of the embeddings. Defaults to float.
+ shortDescription: Data format
+ acceptFormats:
+ - string
+ enum:
+ - float
+ - base64
+ default: float
+ uiOrder: 0
+ format: string
+ dimensions:
+ title: Dimensions
+ description: Number of dimensions in the output embedding vectors.
+ shortDescription: Number of dimensions
+ acceptFormats:
+ - integer
+ default: 512
+ uiOrder: 1
+ format: integer
+ input-type:
+ title: Input Type
+ description: The type of input data to be embedded (e.g., query, document).
+ shortDescription: Type of input data
+ acceptFormats:
+ - string
+ uiOrder: 2
+ format: string
+ truncate:
+ title: Truncate
+ description: How to handle inputs longer than the max token length. Defaults
+ to 'End'.
+ shortDescription: Truncation handling
+ acceptFormats:
+ - string
+ enum:
+ - None
+ - End
+ - Start
+ default: End
+ uiOrder: 3
+ format: string
+ title: Parameter
+ uiOrder: 1
+ required: []
+ format: object
+ required:
+ - data
+ format: object
+ output:
+ title: Embedding Output
+ description: Output schema of the embedding task.
+ shortDescription: Output schema of the embedding task.
+ properties:
+ data:
+ description: Output data.
+ shortDescription: Output data.
+ properties:
+ embeddings:
+ title: Embeddings
+ description: List of generated embeddings.
+ shortDescription: List of embeddings.
+ items:
+ properties:
+ index:
+ title: Index
+ description: The index of the embedding vector in the array.
+ shortDescription: Index in the array
+ uiOrder: 0
+ format: integer
+ vector:
+ title: Embedding Vector
+ description: The embedding vector.
+ shortDescription: Embedding vector.
+ items:
+ format: number
+ uiOrder: 1
+ format: array
+ created:
+ title: Created
+ description: The Unix timestamp (in seconds) of when the embedding
+ was created.
+ shortDescription: Timestamp of creation
+ uiOrder: 2
+ format: integer
+ required:
+ - index
+ - vector
+ - created
+ format: object
+ uiOrder: 0
+ format: array
+ required:
+ - embeddings
+ uiOrder: 0
+ title: Data
+ format: object
+ required:
+ - data
+ format: object
diff --git a/pkg/component/ai/instill/v0/main.go b/pkg/component/ai/instill/v0/main.go
index c26d559d5..fda97f574 100644
--- a/pkg/component/ai/instill/v0/main.go
+++ b/pkg/component/ai/instill/v0/main.go
@@ -27,10 +27,10 @@ import (
// structure with Instill Model.
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
)
@@ -46,10 +46,10 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- additionalJSONBytes := map[string][]byte{
- "schema.json": schemas.SchemaJSON,
+ additionalYAMLBytes := map[string][]byte{
+ "schema.yaml": schemas.SchemaYAML,
}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, additionalJSONBytes)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, additionalYAMLBytes)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/mistralai/v0/README.mdx b/pkg/component/ai/mistralai/v0/README.mdx
index a40afee00..c5e805aca 100644
--- a/pkg/component/ai/mistralai/v0/README.mdx
+++ b/pkg/component/ai/mistralai/v0/README.mdx
@@ -20,7 +20,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/mistralai/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/mistralai/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/mistralai/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/mistralai/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/mistralai/v0/config/definition.json b/pkg/component/ai/mistralai/v0/config/definition.json
deleted file mode 100644
index 60af6ab2b..000000000
--- a/pkg/component/ai/mistralai/v0/config/definition.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "availableTasks": [
- "TASK_TEXT_GENERATION_CHAT",
- "TASK_TEXT_EMBEDDINGS"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/ai/mistral-ai",
- "icon": "assets/mistral-ai.svg",
- "id": "mistral-ai",
- "public": true,
- "title": "Mistral AI",
- "description": "Connect the AI models served on the Mistral AI Platform.",
- "type": "COMPONENT_TYPE_AI",
- "uid": "5e349d27-b00d-4961-86a3-249c30c06073",
- "vendor": "Mistral AI",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/mistralai/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/ai/mistralai/v0/config/definition.yaml b/pkg/component/ai/mistralai/v0/config/definition.yaml
new file mode 100644
index 000000000..c293e2b6d
--- /dev/null
+++ b/pkg/component/ai/mistralai/v0/config/definition.yaml
@@ -0,0 +1,17 @@
+availableTasks:
+- TASK_TEXT_GENERATION_CHAT
+- TASK_TEXT_EMBEDDINGS
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/ai/mistral-ai
+icon: assets/mistral-ai.svg
+id: mistral-ai
+public: true
+title: Mistral AI
+description: Connect the AI models served on the Mistral AI Platform.
+type: COMPONENT_TYPE_AI
+uid: 5e349d27-b00d-4961-86a3-249c30c06073
+vendor: Mistral AI
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/mistralai/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/ai/mistralai/v0/config/setup.json b/pkg/component/ai/mistralai/v0/config/setup.json
deleted file mode 100644
index 7a1905b38..000000000
--- a/pkg/component/ai/mistralai/v0/config/setup.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Mistral API key. To find your keys, visit the Mistral AI platform page.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "instillCredential": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- }
- },
- "required": [],
- "title": "Mistral AI Connection",
- "format": "object"
-}
diff --git a/pkg/component/ai/mistralai/v0/config/setup.yaml b/pkg/component/ai/mistralai/v0/config/setup.yaml
new file mode 100644
index 000000000..7b9a1a572
--- /dev/null
+++ b/pkg/component/ai/mistralai/v0/config/setup.yaml
@@ -0,0 +1,15 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Mistral API key. To find your keys, visit the Mistral
+ AI platform page.
+ acceptFormats:
+ - string
+ instillSecret: true
+ instillCredential: true
+ uiOrder: 0
+ title: API Key
+ format: string
+required: []
+title: Mistral AI Connection
+format: object
diff --git a/pkg/component/ai/mistralai/v0/config/tasks.json b/pkg/component/ai/mistralai/v0/config/tasks.json
deleted file mode 100644
index 2deba13c5..000000000
--- a/pkg/component/ai/mistralai/v0/config/tasks.json
+++ /dev/null
@@ -1,351 +0,0 @@
-{
- "$defs": {
- "multi-modal-content": {
- "items": {
- "properties": {
- "image-url": {
- "properties": {
- "url": {
- "description": "Either a URL of the image or the base64 encoded image data.",
- "title": "URL",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "url"
- ],
- "title": "Image URL",
- "description": "The image URL.",
- "uiOrder": 0,
- "format": "object"
- },
- "text": {
- "description": "The text content.",
- "title": "Text",
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "description": "The type of the content part.",
- "enum": [
- "text",
- "image_url"
- ],
- "title": "Type",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [
- "type"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "chat-message": {
- "properties": {
- "content": {
- "$ref": "#/$defs/multi-modal-content",
- "description": "The message content.",
- "uiOrder": 1,
- "title": "Content"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "uiOrder": 0,
- "title": "Role",
- "format": "string"
- }
- },
- "required": [
- "role",
- "content"
- ],
- "title": "Chat Message",
- "format": "object"
- },
- "chat-usage": {
- "description": "Token usage on the Mistral platform text generation models.",
- "uiOrder": 1,
- "properties": {
- "input-tokens": {
- "description": "The input tokens used by Mistral models.",
- "uiOrder": 2,
- "title": "Input Tokens",
- "format": "number"
- },
- "output-tokens": {
- "description": "The output tokens generated by Mistral models.",
- "uiOrder": 3,
- "title": "Output Tokens",
- "format": "number"
- }
- },
- "required": [
- "input-tokens",
- "output-tokens"
- ],
- "title": "Usage",
- "format": "object"
- },
- "embedding-usage": {
- "description": "Token usage on the Mistral platform embedding models.",
- "uiOrder": 1,
- "properties": {
- "tokens": {
- "description": "The token count used by Mistral models.",
- "uiOrder": 1,
- "title": "Token Count",
- "format": "number"
- }
- },
- "required": [
- "tokens"
- ],
- "title": "Usage",
- "format": "object"
- }
- },
- "TASK_TEXT_GENERATION_CHAT": {
- "shortDescription": "Provide text outputs in response to text inputs.",
- "description": "Mistral AI's text generation models (often called generative pre-trained transformers or large language models) have been trained to understand natural language, code, and images. The models provide text outputs in response to their inputs. The inputs to these models are also referred to as \"prompts\". Designing a prompt is essentially how you “program” a large language model model, usually by providing instructions or some examples of how to successfully complete a task.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "chat-history": {
- "description": "Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {\"role\": \"The message role, i.e. 'system', 'user' or 'assistant'\", \"content\": \"message content\"}.",
- "acceptFormats": [
- "object"
- ],
- "shortDescription": "Incorporate external chat history, specifically previous messages within the conversation. (Note: The Mistral models are not trained to process images, thus images will be omitted)",
- "uiOrder": 4,
- "items": {
- "$ref": "#/$defs/chat-message"
- },
- "title": "Chat history",
- "format": "array"
- },
- "max-new-tokens": {
- "default": 50,
- "description": "The maximum number of tokens for model to generate.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Max New Tokens",
- "format": "integer"
- },
- "model-name": {
- "enum": [
- "open-mixtral-8x22b",
- "open-mixtral-8x7b",
- "open-mistral-7b",
- "mistral-large-latest",
- "mistral-small-latest",
- "codestral-latest"
- ],
- "example": "open-mixtral-8x22b",
- "description": "The Mistral model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "instillCredentialMap": {
- "values": [
- "open-mixtral-8x22b",
- "open-mixtral-8x7b",
- "open-mistral-7b",
- "mistral-large-latest",
- "mistral-small-latest",
- "codestral-latest"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "title": "Model Name",
- "format": "string"
- },
- "prompt": {
- "description": "The prompt text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Prompt",
- "format": "string"
- },
- "prompt-images": {
- "description": "The prompt images (Note: The Mistral models are not trained to process images, thus images will be omitted).",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "format": "string"
- },
- "title": "Prompt Images",
- "format": "array"
- },
- "seed": {
- "description": "The seed.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Seed",
- "format": "integer"
- },
- "system-message": {
- "default": "You are a helpful assistant.",
- "description": "The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is set using a generic message as \"You are a helpful assistant.\".",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The system message helps set the behavior of the assistant",
- "uiOrder": 2,
- "title": "System Message",
- "format": "string"
- },
- "temperature": {
- "default": 0.7,
- "description": "The temperature for sampling.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 5,
- "title": "Temperature",
- "format": "number"
- },
- "top-k": {
- "default": 10,
- "description": "Integer to define the top tokens considered within the sample operation to create new text (Note: The Mistral models does not support top-k sampling).",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Top K",
- "format": "integer"
- },
- "top-p": {
- "default": 0.5,
- "description": "Float to define the tokens that are within the sample operation of text generation. Add tokens in the sample for more probable to least probable until the sum of the probabilities is greater than top-p (default=0.5).",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "Float to define the tokens that are within the sample operation of text generation",
- "uiOrder": 6,
- "title": "Top P",
- "format": "number"
- },
- "safe": {
- "description": "Safe generation mode.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 7,
- "title": "Safe",
- "format": "boolean"
- }
- },
- "required": [
- "prompt",
- "model-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "text": {
- "description": "Model Output.",
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- },
- "usage": {
- "$ref": "#/$defs/chat-usage"
- }
- },
- "required": [
- "text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_EMBEDDINGS": {
- "shortDescription": "Turn text into a vector of numbers that capture its meaning, unlocking use cases like semantic search.",
- "description": "An embedding is a list of floating point numbers that captures semantic information about the text that it represents.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "model-name": {
- "enum": [
- "mistral-embed"
- ],
- "example": "mistral-embed",
- "description": "The Mistral embed model to be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Model Name",
- "instillCredentialMap": {
- "values": [
- "mistral-embed"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "format": "string"
- },
- "text": {
- "description": "The text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "text",
- "model-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "embedding": {
- "items": {
- "title": "Embedding",
- "format": "number"
- },
- "description": "Embedding of the input text.",
- "uiOrder": 0,
- "title": "Embedding",
- "format": "array"
- },
- "usage": {
- "$ref": "#/$defs/embedding-usage"
- }
- },
- "required": [
- "embedding"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/mistralai/v0/config/tasks.yaml b/pkg/component/ai/mistralai/v0/config/tasks.yaml
new file mode 100644
index 000000000..3473629f7
--- /dev/null
+++ b/pkg/component/ai/mistralai/v0/config/tasks.yaml
@@ -0,0 +1,291 @@
+$defs:
+ multi-modal-content:
+ items:
+ properties:
+ image-url:
+ properties:
+ url:
+ description: Either a URL of the image or the base64 encoded image data.
+ title: URL
+ uiOrder: 0
+ format: string
+ required:
+ - url
+ title: Image URL
+ description: The image URL.
+ uiOrder: 0
+ format: object
+ text:
+ description: The text content.
+ title: Text
+ uiOrder: 1
+ format: string
+ type:
+ description: The type of the content part.
+ enum:
+ - text
+ - image_url
+ title: Type
+ uiOrder: 2
+ format: string
+ required:
+ - type
+ format: object
+ format: array
+ chat-message:
+ properties:
+ content:
+ $ref: '#/$defs/multi-modal-content'
+ description: The message content.
+ uiOrder: 1
+ title: Content
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ uiOrder: 0
+ title: Role
+ format: string
+ required:
+ - role
+ - content
+ title: Chat Message
+ format: object
+ chat-usage:
+ description: Token usage on the Mistral platform text generation models.
+ uiOrder: 1
+ properties:
+ input-tokens:
+ description: The input tokens used by Mistral models.
+ uiOrder: 2
+ title: Input Tokens
+ format: number
+ output-tokens:
+ description: The output tokens generated by Mistral models.
+ uiOrder: 3
+ title: Output Tokens
+ format: number
+ required:
+ - input-tokens
+ - output-tokens
+ title: Usage
+ format: object
+ embedding-usage:
+ description: Token usage on the Mistral platform embedding models.
+ uiOrder: 1
+ properties:
+ tokens:
+ description: The token count used by Mistral models.
+ uiOrder: 1
+ title: Token Count
+ format: number
+ required:
+ - tokens
+ title: Usage
+ format: object
+TASK_TEXT_GENERATION_CHAT:
+ shortDescription: Provide text outputs in response to text inputs.
+ description: Mistral AI's text generation models (often called generative pre-trained
+ transformers or large language models) have been trained to understand natural
+ language, code, and images. The models provide text outputs in response to their
+ inputs. The inputs to these models are also referred to as "prompts". Designing
+ a prompt is essentially how you “program” a large language model model, usually
+ by providing instructions or some examples of how to successfully complete a task.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ chat-history:
+ description: 'Incorporate external chat history, specifically previous messages
+ within the conversation. Please note that System Message will be ignored
+ and will not have any effect when this field is populated. Each message
+ should adhere to the format: : {"role": "The message role, i.e. ''system'',
+ ''user'' or ''assistant''", "content": "message content"}.'
+ acceptFormats:
+ - object
+ shortDescription: 'Incorporate external chat history, specifically previous
+ messages within the conversation. (Note: The Mistral models are not trained
+ to process images, thus images will be omitted)'
+ uiOrder: 4
+ items:
+ $ref: '#/$defs/chat-message'
+ title: Chat history
+ format: array
+ max-new-tokens:
+ default: 50
+ description: The maximum number of tokens for model to generate.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Max New Tokens
+ format: integer
+ model-name:
+ enum:
+ - open-mixtral-8x22b
+ - open-mixtral-8x7b
+ - open-mistral-7b
+ - mistral-large-latest
+ - mistral-small-latest
+ - codestral-latest
+ example: open-mixtral-8x22b
+ description: The Mistral model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ instillCredentialMap:
+ values:
+ - open-mixtral-8x22b
+ - open-mixtral-8x7b
+ - open-mistral-7b
+ - mistral-large-latest
+ - mistral-small-latest
+ - codestral-latest
+ targets:
+ - setup.api-key
+ title: Model Name
+ format: string
+ prompt:
+ description: The prompt text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Prompt
+ format: string
+ prompt-images:
+ description: 'The prompt images (Note: The Mistral models are not trained
+ to process images, thus images will be omitted).'
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ format: string
+ title: Prompt Images
+ format: array
+ seed:
+ description: The seed.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Seed
+ format: integer
+ system-message:
+ default: You are a helpful assistant.
+ description: The system message helps set the behavior of the assistant. For
+ example, you can modify the personality of the assistant or provide specific
+ instructions about how it should behave throughout the conversation. By
+ default, the model’s behavior is set using a generic message as "You are
+ a helpful assistant.".
+ acceptFormats:
+ - string
+ shortDescription: The system message helps set the behavior of the assistant
+ uiOrder: 2
+ title: System Message
+ format: string
+ temperature:
+ default: 0.7
+ description: The temperature for sampling.
+ acceptFormats:
+ - number
+ uiOrder: 5
+ title: Temperature
+ format: number
+ top-k:
+ default: 10
+ description: 'Integer to define the top tokens considered within the sample
+ operation to create new text (Note: The Mistral models does not support
+ top-k sampling).'
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Top K
+ format: integer
+ top-p:
+ default: 0.5
+ description: Float to define the tokens that are within the sample operation
+ of text generation. Add tokens in the sample for more probable to least
+ probable until the sum of the probabilities is greater than top-p (default=0.5).
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: Float to define the tokens that are within the sample operation
+ of text generation
+ uiOrder: 6
+ title: Top P
+ format: number
+ safe:
+ description: Safe generation mode.
+ acceptFormats:
+ - boolean
+ uiOrder: 7
+ title: Safe
+ format: boolean
+ required:
+ - prompt
+ - model-name
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ text:
+ description: Model Output.
+ uiOrder: 0
+ title: Text
+ format: string
+ usage:
+ $ref: '#/$defs/chat-usage'
+ required:
+ - text
+ title: Output
+ format: object
+TASK_TEXT_EMBEDDINGS:
+ shortDescription: Turn text into a vector of numbers that capture its meaning, unlocking
+ use cases like semantic search.
+ description: An embedding is a list of floating point numbers that captures semantic
+ information about the text that it represents.
+ input:
+ uiOrder: 0
+ properties:
+ model-name:
+ enum:
+ - mistral-embed
+ example: mistral-embed
+ description: The Mistral embed model to be used.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Model Name
+ instillCredentialMap:
+ values:
+ - mistral-embed
+ targets:
+ - setup.api-key
+ format: string
+ text:
+ description: The text.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Text
+ format: string
+ required:
+ - text
+ - model-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ embedding:
+ items:
+ title: Embedding
+ format: number
+ description: Embedding of the input text.
+ uiOrder: 0
+ title: Embedding
+ format: array
+ usage:
+ $ref: '#/$defs/embedding-usage'
+ required:
+ - embedding
+ title: Output
+ format: object
diff --git a/pkg/component/ai/mistralai/v0/main.go b/pkg/component/ai/mistralai/v0/main.go
index a7e25974c..4675d9b4c 100644
--- a/pkg/component/ai/mistralai/v0/main.go
+++ b/pkg/component/ai/mistralai/v0/main.go
@@ -20,12 +20,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -39,7 +39,7 @@ type component struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/ollama/v0/README.mdx b/pkg/component/ai/ollama/v0/README.mdx
index 966a0254a..5d9f1f464 100644
--- a/pkg/component/ai/ollama/v0/README.mdx
+++ b/pkg/component/ai/ollama/v0/README.mdx
@@ -20,7 +20,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/ollama/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/ollama/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/ollama/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/ollama/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/ollama/v0/config/definition.json b/pkg/component/ai/ollama/v0/config/definition.json
deleted file mode 100644
index a5e00e235..000000000
--- a/pkg/component/ai/ollama/v0/config/definition.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "availableTasks": [
- "TASK_TEXT_GENERATION_CHAT",
- "TASK_TEXT_EMBEDDINGS"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/ai/ollama",
- "icon": "assets/ollama.svg",
- "id": "ollama",
- "public": true,
- "title": "Ollama",
- "description": "Connect the AI models served with the Ollama library.",
- "type": "COMPONENT_TYPE_AI",
- "uid": "5f6dcfc4-efd0-45a1-aae9-c9b4beb68a32",
- "vendor": "Ollama",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/ollama/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/ai/ollama/v0/config/definition.yaml b/pkg/component/ai/ollama/v0/config/definition.yaml
new file mode 100644
index 000000000..45c0636ee
--- /dev/null
+++ b/pkg/component/ai/ollama/v0/config/definition.yaml
@@ -0,0 +1,16 @@
+availableTasks:
+- TASK_TEXT_GENERATION_CHAT
+- TASK_TEXT_EMBEDDINGS
+documentationUrl: https://www.instill.tech/docs/component/ai/ollama
+icon: assets/ollama.svg
+id: ollama
+public: true
+title: Ollama
+description: Connect the AI models served with the Ollama library.
+type: COMPONENT_TYPE_AI
+uid: 5f6dcfc4-efd0-45a1-aae9-c9b4beb68a32
+vendor: Ollama
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/ollama/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/ai/ollama/v0/config/setup.json b/pkg/component/ai/ollama/v0/config/setup.json
deleted file mode 100644
index f607fa2dd..000000000
--- a/pkg/component/ai/ollama/v0/config/setup.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "endpoint": {
- "description": "Fill in your Ollama hosting endpoint. ### WARNING ###: As of 2024-07-26, the Ollama component does not support authentication methods. To prevent unauthorized access to your Ollama serving resources, please implement additional security measures such as IP whitelisting.",
- "acceptFormats": [
- "string"
- ],
- "default": "http://localhost:11434",
- "uiOrder": 0,
- "title": "Endpoint",
- "format": "string"
- },
- "auto-pull": {
- "description": "Automatically pull the requested models from the Ollama server if the model is not found in the local cache.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 1,
- "title": "Model Auto-Pull",
- "format": "boolean"
- }
- },
- "required": [
- "endpoint",
- "auto-pull"
- ],
- "title": "Ollama Connection",
- "format": "object"
-}
diff --git a/pkg/component/ai/ollama/v0/config/setup.yaml b/pkg/component/ai/ollama/v0/config/setup.yaml
new file mode 100644
index 000000000..2e65741b1
--- /dev/null
+++ b/pkg/component/ai/ollama/v0/config/setup.yaml
@@ -0,0 +1,26 @@
+additionalProperties: false
+properties:
+ endpoint:
+ description: 'Fill in your Ollama hosting endpoint. ### WARNING ###: As of 2024-07-26,
+ the Ollama component does not support authentication methods. To prevent unauthorized
+ access to your Ollama serving resources, please implement additional security
+ measures such as IP whitelisting.'
+ acceptFormats:
+ - string
+ default: http://localhost:11434
+ uiOrder: 0
+ title: Endpoint
+ format: string
+ auto-pull:
+ description: Automatically pull the requested models from the Ollama server if
+ the model is not found in the local cache.
+ acceptFormats:
+ - boolean
+ uiOrder: 1
+ title: Model Auto-Pull
+ format: boolean
+required:
+- endpoint
+- auto-pull
+title: Ollama Connection
+format: object
diff --git a/pkg/component/ai/ollama/v0/config/tasks.json b/pkg/component/ai/ollama/v0/config/tasks.json
deleted file mode 100644
index 03d4ebd88..000000000
--- a/pkg/component/ai/ollama/v0/config/tasks.json
+++ /dev/null
@@ -1,250 +0,0 @@
-{
- "$defs": {
- "multi-modal-content": {
- "items": {
- "properties": {
- "image-url": {
- "properties": {
- "url": {
- "description": "Either a URL of the image or the base64 encoded image data.",
- "title": "URL",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "url"
- ],
- "title": "Image URL",
- "description": "The image URL.",
- "uiOrder": 0,
- "format": "object"
- },
- "text": {
- "description": "The text content.",
- "title": "Text",
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "description": "The type of the content part.",
- "enum": [
- "text",
- "image_url"
- ],
- "title": "Type",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [
- "type"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "chat-message": {
- "properties": {
- "content": {
- "$ref": "#/$defs/multi-modal-content",
- "description": "The message content.",
- "uiOrder": 1,
- "title": "Content"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "uiOrder": 0,
- "title": "Role",
- "format": "string"
- }
- },
- "required": [
- "role",
- "content"
- ],
- "title": "Chat Message",
- "format": "object"
- }
- },
- "TASK_TEXT_GENERATION_CHAT": {
- "shortDescription": "Provide text outputs in response to text/image inputs.",
- "description": "Open-source large language models (OSS LLMs) are artificial intelligence models with publicly accessible code and architecture, allowing for free use, modification, and distribution. These models can provide performance comparable to proprietary alternatives. Ollama is a tool that enables you to run and interact with OSS LLMs using limited computational resources. You can install Ollama from: [here](https://ollama.com).",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "chat-history": {
- "description": "Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {\"role\": \"The message role, i.e. 'system', 'user' or 'assistant'\", \"content\": \"message content\"}.",
- "acceptFormats": [
- "object"
- ],
- "shortDescription": "Incorporate external chat history, specifically previous messages within the conversation.",
- "uiOrder": 4,
- "items": {
- "$ref": "#/$defs/chat-message"
- },
- "title": "Chat history",
- "format": "array"
- },
- "max-new-tokens": {
- "default": 50,
- "description": "The maximum number of tokens for model to generate.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Max New Tokens",
- "format": "integer"
- },
- "model": {
- "example": "moondream",
- "description": "The OSS model to be used, check [here](https://ollama.com/library) for list of models available.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- },
- "prompt": {
- "description": "The prompt text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Prompt",
- "format": "string"
- },
- "prompt-images": {
- "description": "The prompt images.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "format": "string"
- },
- "title": "Prompt Images",
- "format": "array"
- },
- "seed": {
- "description": "The seed.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Seed",
- "format": "integer"
- },
- "system-message": {
- "default": "You are a helpful assistant.",
- "description": "The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is set using a generic message as \"You are a helpful assistant.\".",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The system message helps set the behavior of the assistant",
- "uiOrder": 2,
- "title": "System Message",
- "format": "string"
- },
- "temperature": {
- "default": 0.7,
- "description": "The temperature for sampling.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 5,
- "title": "Temperature",
- "format": "number"
- },
- "top-k": {
- "default": 10,
- "description": "Top k for sampling.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Top K",
- "format": "integer"
- }
- },
- "required": [
- "prompt",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "text": {
- "description": "Model Output.",
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "text"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_TEXT_EMBEDDINGS": {
- "shortDescription": "Turn text into a vector of numbers that capture its meaning, unlocking use cases like semantic search.",
- "description": "An embedding is a list of floating point numbers that captures semantic information about the text that it represents.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "model": {
- "example": "snowflake-arctic-embed:22m",
- "description": "The OSS model to be used, check [here](https://ollama.com/library) for list of models available.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- },
- "text": {
- "description": "The text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "text",
- "model"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "embedding": {
- "items": {
- "format": "number"
- },
- "description": "Embedding of the input text.",
- "uiOrder": 0,
- "title": "Embedding",
- "format": "array"
- }
- },
- "required": [
- "embedding"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/ollama/v0/config/tasks.yaml b/pkg/component/ai/ollama/v0/config/tasks.yaml
new file mode 100644
index 000000000..3c60f8266
--- /dev/null
+++ b/pkg/component/ai/ollama/v0/config/tasks.yaml
@@ -0,0 +1,208 @@
+$defs:
+ multi-modal-content:
+ items:
+ properties:
+ image-url:
+ properties:
+ url:
+ description: Either a URL of the image or the base64 encoded image data.
+ title: URL
+ uiOrder: 0
+ format: string
+ required:
+ - url
+ title: Image URL
+ description: The image URL.
+ uiOrder: 0
+ format: object
+ text:
+ description: The text content.
+ title: Text
+ uiOrder: 1
+ format: string
+ type:
+ description: The type of the content part.
+ enum:
+ - text
+ - image_url
+ title: Type
+ uiOrder: 2
+ format: string
+ required:
+ - type
+ format: object
+ format: array
+ chat-message:
+ properties:
+ content:
+ $ref: '#/$defs/multi-modal-content'
+ description: The message content.
+ uiOrder: 1
+ title: Content
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ uiOrder: 0
+ title: Role
+ format: string
+ required:
+ - role
+ - content
+ title: Chat Message
+ format: object
+TASK_TEXT_GENERATION_CHAT:
+ shortDescription: Provide text outputs in response to text/image inputs.
+ description: 'Open-source large language models (OSS LLMs) are artificial intelligence
+ models with publicly accessible code and architecture, allowing for free use,
+ modification, and distribution. These models can provide performance comparable
+ to proprietary alternatives. Ollama is a tool that enables you to run and interact
+ with OSS LLMs using limited computational resources. You can install Ollama from:
+ [here](https://ollama.com).'
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ chat-history:
+ description: 'Incorporate external chat history, specifically previous messages
+ within the conversation. Please note that System Message will be ignored
+ and will not have any effect when this field is populated. Each message
+ should adhere to the format: : {"role": "The message role, i.e. ''system'',
+ ''user'' or ''assistant''", "content": "message content"}.'
+ acceptFormats:
+ - object
+ shortDescription: Incorporate external chat history, specifically previous
+ messages within the conversation.
+ uiOrder: 4
+ items:
+ $ref: '#/$defs/chat-message'
+ title: Chat history
+ format: array
+ max-new-tokens:
+ default: 50
+ description: The maximum number of tokens for model to generate.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Max New Tokens
+ format: integer
+ model:
+ example: moondream
+ description: The OSS model to be used, check [here](https://ollama.com/library)
+ for list of models available.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Model Name
+ format: string
+ prompt:
+ description: The prompt text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Prompt
+ format: string
+ prompt-images:
+ description: The prompt images.
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ format: string
+ title: Prompt Images
+ format: array
+ seed:
+ description: The seed.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Seed
+ format: integer
+ system-message:
+ default: You are a helpful assistant.
+ description: The system message helps set the behavior of the assistant. For
+ example, you can modify the personality of the assistant or provide specific
+ instructions about how it should behave throughout the conversation. By
+ default, the model’s behavior is set using a generic message as "You are
+ a helpful assistant.".
+ acceptFormats:
+ - string
+ shortDescription: The system message helps set the behavior of the assistant
+ uiOrder: 2
+ title: System Message
+ format: string
+ temperature:
+ default: 0.7
+ description: The temperature for sampling.
+ acceptFormats:
+ - number
+ uiOrder: 5
+ title: Temperature
+ format: number
+ top-k:
+ default: 10
+ description: Top k for sampling.
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Top K
+ format: integer
+ required:
+ - prompt
+ - model
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ text:
+ description: Model Output.
+ uiOrder: 0
+ title: Text
+ format: string
+ required:
+ - text
+ title: Output
+ format: object
+TASK_TEXT_EMBEDDINGS:
+ shortDescription: Turn text into a vector of numbers that capture its meaning, unlocking
+ use cases like semantic search.
+ description: An embedding is a list of floating point numbers that captures semantic
+ information about the text that it represents.
+ input:
+ uiOrder: 0
+ properties:
+ model:
+ example: snowflake-arctic-embed:22m
+ description: The OSS model to be used, check [here](https://ollama.com/library)
+ for list of models available.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Model Name
+ format: string
+ text:
+ description: The text.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Text
+ format: string
+ required:
+ - text
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ embedding:
+ items:
+ format: number
+ description: Embedding of the input text.
+ uiOrder: 0
+ title: Embedding
+ format: array
+ required:
+ - embedding
+ title: Output
+ format: object
diff --git a/pkg/component/ai/ollama/v0/main.go b/pkg/component/ai/ollama/v0/main.go
index 19d60745f..34ca06ce2 100644
--- a/pkg/component/ai/ollama/v0/main.go
+++ b/pkg/component/ai/ollama/v0/main.go
@@ -19,12 +19,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -42,7 +42,7 @@ type OllamaSetup struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/openai/v0/README.mdx b/pkg/component/ai/openai/v0/README.mdx
index 6e5c5671b..9c7698cf4 100644
--- a/pkg/component/ai/openai/v0/README.mdx
+++ b/pkg/component/ai/openai/v0/README.mdx
@@ -23,7 +23,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/openai/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/openai/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/openai/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/openai/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/openai/v0/config/definition.json b/pkg/component/ai/openai/v0/config/definition.json
deleted file mode 100644
index a586427c3..000000000
--- a/pkg/component/ai/openai/v0/config/definition.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "availableTasks": [
- "TASK_TEXT_GENERATION",
- "TASK_TEXT_EMBEDDINGS",
- "TASK_SPEECH_RECOGNITION",
- "TASK_TEXT_TO_SPEECH",
- "TASK_TEXT_TO_IMAGE"
- ],
- "custom": false,
- "icon": "assets/openai.svg",
- "iconUrl": "",
- "id": "openai",
- "public": true,
- "title": "OpenAI",
- "description": "Connect the AI models served on the OpenAI Platform.",
- "type": "COMPONENT_TYPE_AI",
- "uid": "9fb6a2cb-bff5-4c69-bc6d-4538dd8e3362",
- "vendor": "OpenAI",
- "vendorAttributes": {},
- "version": "0.1.1",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/openai/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA",
- "documentationUrl": "https://www.instill.tech/docs/component/ai/openai"
-}
diff --git a/pkg/component/ai/openai/v0/config/definition.yaml b/pkg/component/ai/openai/v0/config/definition.yaml
new file mode 100644
index 000000000..d9ede2fee
--- /dev/null
+++ b/pkg/component/ai/openai/v0/config/definition.yaml
@@ -0,0 +1,21 @@
+availableTasks:
+- TASK_TEXT_GENERATION
+- TASK_TEXT_EMBEDDINGS
+- TASK_SPEECH_RECOGNITION
+- TASK_TEXT_TO_SPEECH
+- TASK_TEXT_TO_IMAGE
+custom: false
+icon: assets/openai.svg
+iconUrl: ''
+id: openai
+public: true
+title: OpenAI
+description: Connect the AI models served on the OpenAI Platform.
+type: COMPONENT_TYPE_AI
+uid: 9fb6a2cb-bff5-4c69-bc6d-4538dd8e3362
+vendor: OpenAI
+vendorAttributes: {}
+version: 0.1.1
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/openai/v0
+releaseStage: RELEASE_STAGE_ALPHA
+documentationUrl: https://www.instill.tech/docs/component/ai/openai
diff --git a/pkg/component/ai/openai/v0/config/setup.json b/pkg/component/ai/openai/v0/config/setup.json
deleted file mode 100644
index bf7baeddd..000000000
--- a/pkg/component/ai/openai/v0/config/setup.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your OpenAI API key. To find your keys, visit your OpenAI's API Keys page.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "instillCredential": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- },
- "organization": {
- "description": "Specify which organization is used for the requests. Usage will count against the specified organization's subscription quota.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Organization ID",
- "format": "string"
- }
- },
- "required": [],
- "title": "OpenAI Connection",
- "format": "object"
-}
diff --git a/pkg/component/ai/openai/v0/config/setup.yaml b/pkg/component/ai/openai/v0/config/setup.yaml
new file mode 100644
index 000000000..2c5ff84a0
--- /dev/null
+++ b/pkg/component/ai/openai/v0/config/setup.yaml
@@ -0,0 +1,23 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your OpenAI API key. To find your keys, visit your OpenAI's
+ API Keys page.
+ acceptFormats:
+ - string
+ instillSecret: true
+ instillCredential: true
+ uiOrder: 0
+ title: API Key
+ format: string
+ organization:
+ description: Specify which organization is used for the requests. Usage will count
+ against the specified organization's subscription quota.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Organization ID
+ format: string
+required: []
+title: OpenAI Connection
+format: object
diff --git a/pkg/component/ai/openai/v0/config/tasks.json b/pkg/component/ai/openai/v0/config/tasks.json
index 17d2e1afd..2a803ba6d 100644
--- a/pkg/component/ai/openai/v0/config/tasks.json
+++ b/pkg/component/ai/openai/v0/config/tasks.json
@@ -3,7 +3,7 @@
"chat-message": {
"properties": {
"content": {
- "$ref": "schema.json#/$defs/instill-types/multi-modal-content",
+ "$ref": "schema.yaml#/$defs/instill-types/multi-modal-content",
"description": "The message content.",
"uiOrder": 1,
"title": "Content"
@@ -176,7 +176,7 @@
"uiOrder": 0,
"properties": {
"embedding": {
- "$ref": "schema.json#/$defs/instill-types/embedding",
+ "$ref": "schema.yaml#/$defs/instill-types/embedding",
"description": "Embedding of the input text.",
"uiOrder": 0,
"title": "Embedding"
diff --git a/pkg/component/ai/openai/v0/config/tasks.yaml b/pkg/component/ai/openai/v0/config/tasks.yaml
new file mode 100644
index 000000000..e7d913556
--- /dev/null
+++ b/pkg/component/ai/openai/v0/config/tasks.yaml
@@ -0,0 +1,678 @@
+$defs:
+ chat-message:
+ properties:
+ content:
+ $ref: schema.yaml#/$defs/instill-types/multi-modal-content
+ description: The message content.
+ uiOrder: 1
+ title: Content
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ uiOrder: 0
+ title: Role
+ format: string
+ required:
+ - role
+ - content
+ title: Chat Message
+ format: object
+TASK_SPEECH_RECOGNITION:
+ shortDescription: Turn audio into text.
+ input:
+ uiOrder: 0
+ properties:
+ audio:
+ description: |-
+ The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
+ .
+ format: string
+ acceptFormats:
+ - audio/*
+ uiOrder: 1
+ title: Audio
+ language:
+ description: |-
+ The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.
+ .
+ acceptFormats:
+ - string
+ shortDescription: The language of the input audio.
+ uiOrder: 3
+ title: Language
+ format: string
+ model:
+ description: |-
+ ID of the model to use. Only `whisper-1` is currently available.
+ .
+ enum:
+ - whisper-1
+ example: whisper-1
+ acceptFormats:
+ - string
+ shortDescription: ID of the model to use
+ uiOrder: 0
+ instillCredentialMap:
+ values:
+ - whisper-1
+ targets:
+ - setup.api-key
+ title: Model
+ format: string
+ prompt:
+ description: |-
+ An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
+ .
+ acceptFormats:
+ - string
+ shortDescription: An optional text to guide the model's style or continue
+ a previous audio segment.
+ uiOrder: 2
+ title: Prompt
+ format: string
+ temperature:
+ default: 0
+ description: |-
+ The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
+ .
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: The sampling temperature, between 0 and 1.
+ uiOrder: 4
+ title: Temperature
+ format: number
+ required:
+ - audio
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ text:
+ description: Generated text.
+ uiOrder: 0
+ title: Text
+ format: string
+ required:
+ - text
+ title: Output
+ format: object
+TASK_TEXT_EMBEDDINGS:
+ shortDescription: Turn text into numbers, unlocking use cases like search.
+ input:
+ uiOrder: 0
+ properties:
+ model:
+ description: ID of the model to use.
+ enum:
+ - text-embedding-ada-002
+ - text-embedding-3-small
+ - text-embedding-3-large
+ example: text-embedding-3-small
+ acceptFormats:
+ - string
+ shortDescription: ID of the model to use
+ uiOrder: 0
+ instillCredentialMap:
+ values:
+ - text-embedding-3-small
+ - text-embedding-3-large
+ targets:
+ - setup.api-key
+ title: Model
+ format: string
+ text:
+ description: The text.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Text
+ format: string
+ dimensions:
+ description: The number of dimensions the resulting output embeddings should
+ have. Only supported in text-embedding-3 and later models.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: Dimensions
+ format: integer
+ required:
+ - text
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ embedding:
+ $ref: schema.yaml#/$defs/instill-types/embedding
+ description: Embedding of the input text.
+ uiOrder: 0
+ title: Embedding
+ required:
+ - embedding
+ title: Output
+ format: object
+TASK_TEXT_GENERATION:
+ shortDescription: Provide text outputs in response to their inputs.
+ description: OpenAI's text generation models (often called generative pre-trained
+ transformers or large language models) have been trained to understand natural
+ language, code, and images. The models provide text outputs in response to their
+ inputs. The inputs to these models are also referred to as "prompts". Designing
+ a prompt is essentially how you “program” a large language model model, usually
+ by providing instructions or some examples of how to successfully complete a task.
+ input:
+ uiOrder: 0
+ properties:
+ chat-history:
+ description: 'Incorporate external chat history, specifically previous messages
+ within the conversation. Please note that System Message will be ignored
+ and will not have any effect when this field is populated. Each message
+ should adhere to the format {"role": "The message role, i.e. ''system'',
+ ''user'' or ''assistant''", "content": "message content"}.'
+ acceptFormats:
+ - object
+ shortDescription: 'Incorporate external chat history, specifically previous
+ messages within the conversation. Please note that System Message will be
+ ignored and will not have any effect when this field is populated. Each
+ message should be an ojbect adhere to the format: {"role": "The message
+ role, i.e. ''system'', ''user'' or ''assistant''", "content": "message content"}.'
+ uiOrder: 4
+ items:
+ $ref: '#/$defs/chat-message'
+ title: Chat history
+ format: array
+ frequency-penalty:
+ default: 0
+ description: Number between -2.0 and 2.0. Positive values penalize new tokens
+ based on their existing frequency in the text so far, decreasing the model's
+ likelihood to repeat the same line verbatim.
+ maximum: 2
+ minimum: -2
+ nullable: true
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: Number between -2.0 and 2.0
+ uiOrder: 11
+ title: Frequency Penalty
+ format: number
+ images:
+ description: The images.
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ format: string
+ title: Image
+ format: array
+ max-tokens:
+ description: |-
+ The maximum number of tokens that can be generated in the chat completion.
+
+ The total length of input tokens and generated tokens is limited by the model's context length.
+ nullable: true
+ acceptFormats:
+ - integer
+ shortDescription: The maximum number of tokens to generate in the chat completion.
+ uiOrder: 7
+ title: Max Tokens
+ format: integer
+ model:
+ description: ID of the model to use.
+ enum:
+ - o1-preview
+ - o1-mini
+ - gpt-4o-mini
+ - gpt-4o
+ - gpt-4o-2024-05-13
+ - gpt-4o-2024-08-06
+ - gpt-4-turbo
+ - gpt-4-turbo-2024-04-09
+ - gpt-4-0125-preview
+ - gpt-4-turbo-preview
+ - gpt-4-1106-preview
+ - gpt-4-vision-preview
+ - gpt-4
+ - gpt-4-0314
+ - gpt-4-0613
+ - gpt-4-32k
+ - gpt-4-32k-0314
+ - gpt-4-32k-0613
+ - gpt-3.5-turbo
+ - gpt-3.5-turbo-16k
+ - gpt-3.5-turbo-0301
+ - gpt-3.5-turbo-0613
+ - gpt-3.5-turbo-1106
+ - gpt-3.5-turbo-0125
+ - gpt-3.5-turbo-16k-0613
+ example: gpt-4o
+ acceptFormats:
+ - string
+ shortDescription: ID of the model to use
+ uiOrder: 0
+ instillCredentialMap:
+ values:
+ - o1-preview
+ - o1-mini
+ - gpt-4o
+ - gpt-4o-2024-08-06
+ - gpt-4-turbo
+ - gpt-4-vision-preview
+ - gpt-4
+ - gpt-4-32k
+ - gpt-3.5-turbo
+ - gpt-4o-mini
+ targets:
+ - setup.api-key
+ title: Model
+ format: string
+ n:
+ default: 1
+ description: How many chat completion choices to generate for each input message.
+ Note that you will be charged based on the number of generated tokens across
+ all of the choices. Keep `n` as `1` to minimize costs.
+ example: 1
+ maximum: 128
+ minimum: 1
+ nullable: true
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: N
+ format: integer
+ presence-penalty:
+ default: 0
+ description: Number between -2.0 and 2.0. Positive values penalize new tokens
+ based on whether they appear in the text so far, increasing the model's
+ likelihood to talk about new topics.
+ maximum: 2
+ minimum: -2
+ nullable: true
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: Number between -2.0 and 2.0
+ uiOrder: 10
+ title: Presence Penalty
+ format: number
+ prompt:
+ description: The prompt text.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Prompt
+ format: string
+ response-format:
+ description: Response format.
+ uiOrder: 8
+ additionalProperties: true
+ required:
+ - type
+ oneOf:
+ - properties:
+ type:
+ const: text
+ title: Type
+ description: Text.
+ uiOrder: 0
+ format: string
+ required:
+ - type
+ title: Text
+ format: object
+ - properties:
+ type:
+ const: json_object
+ title: Type
+ description: JSON Object.
+ uiOrder: 0
+ format: string
+ required:
+ - type
+ title: JSON Object
+ format: object
+ - properties:
+ type:
+ const: json_schema
+ title: Type
+ description: JSON Schema.
+ uiOrder: 0
+ format: string
+ json-schema:
+ description: Set up the schema of the structured output.
+ acceptFormats:
+ - string
+ title: JSON Schema
+ shortDescription: Specify the schema of the structured output.
+ uiOrder: 1
+ format: string
+ required:
+ - type
+ - json-schema
+ title: JSON Schema
+ format: object
+ title: Response Format
+ format: object
+ system-message:
+ default: You are a helpful assistant.
+ description: The system message helps set the behavior of the assistant. For
+ example, you can modify the personality of the assistant or provide specific
+ instructions about how it should behave throughout the conversation. By
+ default, the model’s behavior is using a generic message as "You are a helpful
+ assistant.".
+ acceptFormats:
+ - string
+ shortDescription: The system message helps set the behavior of the assistant
+ uiOrder: 2
+ title: System Message
+ format: string
+ temperature:
+ default: 1
+ description: |-
+ What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
+
+ We generally recommend altering this or `top-p` but not both.
+ .
+ example: 1
+ maximum: 2
+ minimum: 0
+ nullable: true
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: What sampling temperature to use, between 0 and 2.
+ uiOrder: 5
+ title: Temperature
+ format: number
+ top-p:
+ default: 1
+ 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.
+ .
+ example: 1
+ maximum: 1
+ minimum: 0
+ nullable: true
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: An alternative to sampling with temperature, called nucleus
+ sampling
+ uiOrder: 9
+ title: Top P
+ format: number
+ required:
+ - model
+ - prompt
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ texts:
+ uiOrder: 0
+ items:
+ title: Text
+ format: string
+ description: Texts.
+ title: Texts
+ format: array
+ usage:
+ description: Usage statistics related to the query.
+ uiOrder: 1
+ properties:
+ total-tokens:
+ title: Total tokens
+ description: Total number of tokens used (prompt + completion).
+ uiOrder: 0
+ format: integer
+ completion-tokens:
+ title: Completion tokens
+ description: Total number of tokens used (completion).
+ uiOrder: 1
+ format: integer
+ prompt-tokens:
+ title: Prompt tokens
+ description: Total number of tokens used (prompt).
+ uiOrder: 2
+ format: integer
+ required:
+ - total-tokens
+ title: Usage
+ format: object
+ required:
+ - texts
+ title: Output
+ format: object
+TASK_TEXT_TO_IMAGE:
+ shortDescription: Generate or manipulate images with DALL·E.
+ input:
+ uiOrder: 0
+ properties:
+ model:
+ default: dall-e-2
+ description: The model to use for image generation.
+ enum:
+ - dall-e-2
+ - dall-e-3
+ example: dall-e-3
+ nullable: true
+ instillCredentialMap:
+ values:
+ - dall-e-3
+ targets:
+ - setup.api-key
+ acceptFormats:
+ - string
+ shortDescription: ID of the model to use
+ uiOrder: 0
+ title: Model
+ format: string
+ n:
+ default: 1
+ description: The number of images to generate. Must be between 1 and 10. For
+ `dall-e-3`, only `n=1` is supported.
+ example: 1
+ maximum: 10
+ minimum: 1
+ nullable: true
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: N
+ format: integer
+ prompt:
+ description: A text description of the desired image(s). The maximum length
+ is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
+ example: A cute baby sea otter
+ acceptFormats:
+ - string
+ shortDescription: A text description of the desired image(s).
+ uiOrder: 1
+ title: Prompt
+ format: string
+ quality:
+ default: standard
+ description: The quality of the image that will be generated. `hd` creates
+ images with finer details and greater consistency across the image. This
+ param is only supported for `dall-e-3`.
+ enum:
+ - standard
+ - hd
+ example: standard
+ acceptFormats:
+ - string
+ shortDescription: The quality of the image that will be generated.
+ uiOrder: 3
+ title: Quality
+ format: string
+ size:
+ default: 1024x1024
+ description: The size of the generated images. Must be one of `256x256`, `512x512`,
+ or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`,
+ or `1024x1792` for `dall-e-3` models.
+ enum:
+ - 256x256
+ - 512x512
+ - 1024x1024
+ - 1792x1024
+ - 1024x1792
+ example: 1024x1024
+ nullable: true
+ acceptFormats:
+ - string
+ shortDescription: The size of the generated images.
+ uiOrder: 4
+ title: Size
+ format: string
+ style:
+ default: vivid
+ description: The style of the generated images. Must be one of `vivid` or
+ `natural`. Vivid causes the model to lean towards generating hyper-real
+ and dramatic images. Natural causes the model to produce more natural, less
+ hyper-real looking images. This param is only supported for `dall-e-3`.
+ enum:
+ - vivid
+ - natural
+ example: vivid
+ nullable: true
+ acceptFormats:
+ - string
+ shortDescription: The style of the generated images.
+ uiOrder: 5
+ title: N
+ format: string
+ required:
+ - prompt
+ - model
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ results:
+ description: Generated results.
+ uiOrder: 0
+ items:
+ description: Generated result.
+ properties:
+ image:
+ title: Generated Image
+ description: Generated image.
+ uiOrder: 0
+ format: image/webp
+ revised-prompt:
+ title: Revised Prompt
+ description: Revised prompt.
+ uiOrder: 1
+ format: string
+ required:
+ - image
+ - revised-prompt
+ title: Image
+ format: object
+ title: Images
+ format: array
+ required:
+ - results
+ title: Output
+ format: object
+TASK_TEXT_TO_SPEECH:
+ shortDescription: Turn text into lifelike spoken audio
+ input:
+ uiOrder: 0
+ properties:
+ model:
+ description: |-
+ One of the available TTS models: `tts-1` or `tts-1-hd`
+ .
+ default: tts-1
+ enum:
+ - tts-1
+ - tts-1-hd
+ acceptFormats:
+ - string
+ instillCredentialMap:
+ values:
+ - tts-1
+ - tts-1-hd
+ targets:
+ - setup.api-key
+ shortDescription: ID of the model to use
+ uiOrder: 0
+ title: Model
+ format: string
+ response-format:
+ default: mp3
+ description: The format to audio in. Supported formats are `mp3`, `opus`,
+ `aac`, and `flac`.
+ enum:
+ - mp3
+ - opus
+ - aac
+ - flac
+ acceptFormats:
+ - string
+ shortDescription: The format to audio
+ uiOrder: 3
+ title: Response Format
+ format: string
+ speed:
+ default: 1
+ description: The speed of the generated audio. Select a value from `0.25`
+ to `4.0`. `1.0` is the default.
+ maximum: 4
+ minimum: 0.25
+ acceptFormats:
+ - number
+ shortDescription: The speed of the generated audio
+ uiOrder: 4
+ title: Speed
+ format: number
+ text:
+ description: The text to generate audio for. The maximum length is 4096 characters.
+ maxLength: 4096
+ acceptFormats:
+ - string
+ shortDescription: The text to generate audio for
+ uiOrder: 1
+ title: Text
+ format: string
+ voice:
+ description: The voice to use when generating the audio. Supported voices
+ are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`.
+ enum:
+ - alloy
+ - echo
+ - fable
+ - onyx
+ - nova
+ - shimmer
+ acceptFormats:
+ - string
+ default: alloy
+ shortDescription: The voice to use when generating the audio
+ uiOrder: 2
+ title: Voice
+ format: string
+ required:
+ - text
+ - model
+ - voice
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ audio:
+ description: AI generated audio.
+ uiOrder: 0
+ title: Audio
+ format: audio/wav
+ required: []
+ title: Output
+ format: object
diff --git a/pkg/component/ai/openai/v0/main.go b/pkg/component/ai/openai/v0/main.go
index b35024b62..5a3323ed6 100644
--- a/pkg/component/ai/openai/v0/main.go
+++ b/pkg/component/ai/openai/v0/main.go
@@ -39,12 +39,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -61,10 +61,10 @@ type component struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- additionalJSONBytes := map[string][]byte{
- "schema.json": schemas.SchemaJSON,
+ additionalYAMLBytes := map[string][]byte{
+ "schema.yaml": schemas.SchemaYAML,
}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, additionalJSONBytes)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, additionalYAMLBytes)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/openai/v1/config/definition.json b/pkg/component/ai/openai/v1/config/definition.json
deleted file mode 100644
index e69de29bb..000000000
diff --git a/pkg/component/generic/scheduler/v0/config/tasks.json b/pkg/component/ai/openai/v1/config/definition.yaml
similarity index 100%
rename from pkg/component/generic/scheduler/v0/config/tasks.json
rename to pkg/component/ai/openai/v1/config/definition.yaml
diff --git a/pkg/component/ai/openai/v1/config/setup.json b/pkg/component/ai/openai/v1/config/setup.json
deleted file mode 100644
index e69de29bb..000000000
diff --git a/pkg/component/ai/openai/v1/config/setup.yaml b/pkg/component/ai/openai/v1/config/setup.yaml
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/pkg/component/ai/openai/v1/config/setup.yaml
@@ -0,0 +1 @@
+{}
diff --git a/pkg/component/ai/openai/v1/config/tasks.json b/pkg/component/ai/openai/v1/config/tasks.json
deleted file mode 100644
index e69de29bb..000000000
diff --git a/pkg/component/ai/openai/v1/config/tasks.yaml b/pkg/component/ai/openai/v1/config/tasks.yaml
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/pkg/component/ai/openai/v1/config/tasks.yaml
@@ -0,0 +1 @@
+{}
diff --git a/pkg/component/ai/openai/v1/main.go b/pkg/component/ai/openai/v1/main.go
index 000318815..ff7b021f3 100644
--- a/pkg/component/ai/openai/v1/main.go
+++ b/pkg/component/ai/openai/v1/main.go
@@ -23,12 +23,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -52,7 +52,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/perplexity/v0/README.mdx b/pkg/component/ai/perplexity/v0/README.mdx
index 2cdc6e6ee..6b380dd2d 100644
--- a/pkg/component/ai/perplexity/v0/README.mdx
+++ b/pkg/component/ai/perplexity/v0/README.mdx
@@ -19,7 +19,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/perplexity/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/perplexity/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/perplexity/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/perplexity/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/perplexity/v0/config/definition.json b/pkg/component/ai/perplexity/v0/config/definition.json
deleted file mode 100644
index 3ee92daad..000000000
--- a/pkg/component/ai/perplexity/v0/config/definition.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "availableTasks": [
- "TASK_CHAT"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/ai/perplexity",
- "icon": "assets/perplexity.svg",
- "id": "perplexity",
- "public": true,
- "title": "Perplexity",
- "description": "Connect the AI models served on the Perplexity Platform.",
- "type": "COMPONENT_TYPE_AI",
- "uid": "61339791-dfe0-4ba1-9efc-7d4452c03e53",
- "vendor": "Perplexity",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/perplexity/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/ai/perplexity/v0/config/definition.yaml b/pkg/component/ai/perplexity/v0/config/definition.yaml
new file mode 100644
index 000000000..ba7bd7e9a
--- /dev/null
+++ b/pkg/component/ai/perplexity/v0/config/definition.yaml
@@ -0,0 +1,16 @@
+availableTasks:
+- TASK_CHAT
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/ai/perplexity
+icon: assets/perplexity.svg
+id: perplexity
+public: true
+title: Perplexity
+description: Connect the AI models served on the Perplexity Platform.
+type: COMPONENT_TYPE_AI
+uid: 61339791-dfe0-4ba1-9efc-7d4452c03e53
+vendor: Perplexity
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/perplexity/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/ai/perplexity/v0/config/setup.json b/pkg/component/ai/perplexity/v0/config/setup.json
deleted file mode 100644
index d5ce450f7..000000000
--- a/pkg/component/ai/perplexity/v0/config/setup.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your API key from the vendor's platform.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "instillCredential": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- }
- },
- "required": [],
- "title": "Perplexity Connection",
- "format": "object"
-}
diff --git a/pkg/component/ai/perplexity/v0/config/setup.yaml b/pkg/component/ai/perplexity/v0/config/setup.yaml
new file mode 100644
index 000000000..081625797
--- /dev/null
+++ b/pkg/component/ai/perplexity/v0/config/setup.yaml
@@ -0,0 +1,14 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your API key from the vendor's platform.
+ acceptFormats:
+ - string
+ instillSecret: true
+ instillCredential: true
+ uiOrder: 0
+ title: API Key
+ format: string
+required: []
+title: Perplexity Connection
+format: object
diff --git a/pkg/component/ai/perplexity/v0/config/tasks.json b/pkg/component/ai/perplexity/v0/config/tasks.json
deleted file mode 100644
index 6bb0d5ca6..000000000
--- a/pkg/component/ai/perplexity/v0/config/tasks.json
+++ /dev/null
@@ -1,371 +0,0 @@
-{
- "TASK_CHAT": {
- "title": "Chat",
- "shortDescription": "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.",
- "shortDescription": "Input schema of the chat task.",
- "properties": {
- "data": {
- "title": "Chat Data",
- "description": "Input data.",
- "shortDescription": "Input data.",
- "properties": {
- "model": {
- "description": "The model to be used for `TASK_CHAT`.",
- "shortDescription": "The model to be used.",
- "acceptFormats": [
- "string"
- ],
- "enum": [
- "llama-3.1-sonar-small-128k-online",
- "llama-3.1-sonar-large-128k-online",
- "llama-3.1-sonar-huge-128k-online"
- ],
- "instillCredentialMap": {
- "values": [
- "llama-3.1-sonar-small-128k-online",
- "llama-3.1-sonar-large-128k-online",
- "llama-3.1-sonar-huge-128k-online"
- ]
- },
- "title": "Model Name",
- "uiOrder": 0,
- "format": "string"
- },
- "messages": {
- "title": "Chat Messages",
- "items": {
- "properties": {
- "content": {
- "description": "The message content.",
- "shortDescription": "The message content.",
- "title": "Content",
- "items": {
- "properties": {
- "text": {
- "title": "Text Message",
- "description": "Text message.",
- "shortDescription": "Text message.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "title": "Text",
- "description": "Text content type.",
- "shortDescription": "Text content type.",
- "acceptFormats": [
- "string"
- ],
- "const": "text",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [],
- "title": "Text",
- "format": "object"
- },
- "uiOrder": 0,
- "format": "array"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "shortDescription": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "acceptFormats": [
- "string"
- ],
- "title": "Role",
- "enum": [
- "system",
- "user",
- "assistant"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "name": {
- "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.",
- "shortDescription": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.",
- "acceptFormats": [
- "string"
- ],
- "title": "Name",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [
- "content",
- "role"
- ],
- "format": "object"
- },
- "uiOrder": 1,
- "description": "List of chat messages.",
- "format": "array"
- }
- },
- "required": [
- "messages"
- ],
- "uiOrder": 0,
- "format": "object"
- },
- "parameter": {
- "description": "Input parameter.",
- "shortDescription": "Input parameter.",
- "properties": {
- "max-tokens": {
- "title": "Max New Tokens",
- "description": "The maximum number of completion tokens returned by the API. The total number of tokens requested in max_tokens plus the number of prompt tokens sent in messages must not exceed the context window token limit of model requested. If left unspecified, then the model will generate tokens until either it reaches its stop token or the end of its context window.",
- "shortDescription": "The maximum number of tokens for model to generate.",
- "acceptFormats": [
- "integer"
- ],
- "default": 50,
- "uiOrder": 0,
- "format": "integer"
- },
- "temperature": {
- "title": "Temperature",
- "description": "The amount of randomness in the response, valued between 0 inclusive and 2 exclusive. Higher values are more random, and lower values are more deterministic.",
- "shortDescription": "The temperature for sampling.",
- "acceptFormats": [
- "number"
- ],
- "default": 0.2,
- "uiOrder": 1,
- "format": "number"
- },
- "top-p": {
- "title": "Top P",
- "description": "The nucleus sampling threshold, valued between 0 and 1 inclusive. For each subsequent token, the model considers the results of the tokens with top_p probability mass. We recommend either altering top_k or top_p, but not both.",
- "shortDescription": "Nucleus sampling.",
- "acceptFormats": [
- "number"
- ],
- "default": 0.9,
- "uiOrder": 2,
- "format": "number"
- },
- "stream": {
- "title": "Stream",
- "description": "If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events as they become available.",
- "shortDescription": "If set, partial message deltas will be sent.",
- "acceptFormats": [
- "boolean"
- ],
- "default": false,
- "uiOrder": 3,
- "format": "boolean"
- },
- "search-domain-filter": {
- "title": "Search Domain Filter",
- "description": "Given a list of domains, limit the citations used by the online model to URLs from the specified domains. Currently limited to only 3 domains for whitelisting and blacklisting. For blacklisting add a `-` to the beginning of the domain string.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 4,
- "format": "string"
- },
- "search-recency-filter": {
- "title": "Search Recency Filter",
- "description": "Returns search results within the specified time interval - does not apply to images. Values include `month`, `week`, `day`, `hour`.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 5,
- "format": "string"
- },
- "top-k": {
- "title": "Top K",
- "description": "The number of tokens to keep for highest top-k filtering, specified as an integer between 0 and 2048 inclusive. If set to 0, top-k filtering is disabled. We recommend either altering top_k or top_p, but not both.",
- "acceptFormats": [
- "number"
- ],
- "default": 0,
- "uiOrder": 6,
- "format": "number"
- },
- "presence-penalty": {
- "title": "Presence Penalty",
- "description": "A value between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. Incompatible with `frequency_penalty`.",
- "acceptFormats": [
- "number"
- ],
- "default": 0,
- "uiOrder": 7,
- "format": "number"
- },
- "frequency-penalty": {
- "title": "Frequency Penalty",
- "description": "A multiplicative penalty greater than 0. Values greater than 1.0 penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. A value of 1.0 means no penalty. Incompatible with `presence_penalty`.",
- "acceptFormats": [
- "number"
- ],
- "default": 1,
- "uiOrder": 8,
- "format": "number"
- }
- },
- "required": [],
- "uiOrder": 1,
- "title": "Input Parameter",
- "format": "object"
- }
- },
- "required": [
- "data"
- ],
- "format": "object"
- },
- "output": {
- "$schema": "http://json-schema.org/draft-07/schema#",
- "title": "Chat Output",
- "description": "Output schema of the chat task.",
- "shortDescription": "Output schema of the chat task.",
- "properties": {
- "data": {
- "description": "Output data.",
- "shortDescription": "Output data.",
- "properties": {
- "choices": {
- "title": "Choices",
- "description": "List of chat completion choices.",
- "shortDescription": "List of chat completion choices",
- "items": {
- "properties": {
- "finish-reason": {
- "title": "Finish Reason",
- "description": "The reason the model stopped generating tokens.",
- "shortDescription": "The reason the model stopped generating tokens.",
- "uiOrder": 0,
- "format": "string"
- },
- "index": {
- "title": "Index",
- "description": "The index of the choice in the list of choices.",
- "shortDescription": "The index of the choice in the list of choices.",
- "uiOrder": 1,
- "format": "integer"
- },
- "message": {
- "title": "Message",
- "description": "A chat message generated by the model.",
- "shortDescription": "A chat message generated by the model.",
- "properties": {
- "content": {
- "title": "Content",
- "description": "The contents of the message.",
- "shortDescription": "The contents of the message.",
- "uiOrder": 0,
- "format": "string"
- },
- "role": {
- "title": "Role",
- "description": "The role of the author of this message.",
- "shortDescription": "The role of the author of this message.",
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [],
- "uiOrder": 2,
- "format": "object"
- },
- "created": {
- "title": "Created",
- "description": "The timestamp of when the chat completion was created. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z.",
- "shortDescription": "The Unix timestamp (in seconds) of when the chat completion was created.",
- "uiOrder": 3,
- "format": "integer"
- }
- },
- "required": [
- "finish-reason",
- "index",
- "message",
- "created"
- ],
- "format": "object"
- },
- "uiOrder": 0,
- "format": "array"
- },
- "citations": {
- "title": "Citations",
- "description": "List of citations.",
- "shortDescription": "List of citations.",
- "items": {
- "format": "string"
- },
- "uiOrder": 1,
- "format": "array"
- }
- },
- "required": [
- "choices"
- ],
- "uiOrder": 0,
- "title": "Output Data",
- "format": "object"
- },
- "metadata": {
- "description": "Output metadata.",
- "shortDescription": "Output metadata.",
- "properties": {
- "usage": {
- "description": "Usage statistics for the request.",
- "shortDescription": "Usage statistics for the request.",
- "properties": {
- "completion-tokens": {
- "title": "Completion Tokens",
- "description": "Number of tokens in the generated response.",
- "shortDescription": "Number of tokens in the generated response.",
- "uiOrder": 0,
- "format": "integer"
- },
- "prompt-tokens": {
- "title": "Prompt Tokens",
- "description": "Number of tokens in the prompt.",
- "shortDescription": "Number of tokens in the prompt.",
- "uiOrder": 1,
- "format": "integer"
- },
- "total-tokens": {
- "title": "Total Tokens",
- "description": "Total number of tokens used in the request (prompt + completion).",
- "shortDescription": "Total number of tokens used in the request (prompt + completion).",
- "uiOrder": 2,
- "format": "integer"
- }
- },
- "required": [
- "completion-tokens",
- "prompt-tokens",
- "total-tokens"
- ],
- "uiOrder": 0,
- "title": "Usage",
- "format": "object"
- }
- },
- "required": [],
- "title": "Output Metadata",
- "uiOrder": 1,
- "format": "object"
- }
- },
- "required": [
- "data"
- ],
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/perplexity/v0/config/tasks.yaml b/pkg/component/ai/perplexity/v0/config/tasks.yaml
new file mode 100644
index 000000000..7d63cd07a
--- /dev/null
+++ b/pkg/component/ai/perplexity/v0/config/tasks.yaml
@@ -0,0 +1,323 @@
+TASK_CHAT:
+ title: Chat
+ shortDescription: Generate response base on conversation input.
+ input:
+ title: Chat Input
+ description: Input schema of the chat task.
+ shortDescription: Input schema of the chat task.
+ properties:
+ data:
+ title: Chat Data
+ description: Input data.
+ shortDescription: Input data.
+ properties:
+ model:
+ description: The model to be used for `TASK_CHAT`.
+ shortDescription: The model to be used.
+ acceptFormats:
+ - string
+ enum:
+ - llama-3.1-sonar-small-128k-online
+ - llama-3.1-sonar-large-128k-online
+ - llama-3.1-sonar-huge-128k-online
+ instillCredentialMap:
+ values:
+ - llama-3.1-sonar-small-128k-online
+ - llama-3.1-sonar-large-128k-online
+ - llama-3.1-sonar-huge-128k-online
+ title: Model Name
+ uiOrder: 0
+ format: string
+ messages:
+ title: Chat Messages
+ items:
+ properties:
+ content:
+ description: The message content.
+ shortDescription: The message content.
+ title: Content
+ items:
+ properties:
+ text:
+ title: Text Message
+ description: Text message.
+ shortDescription: Text message.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ format: string
+ type:
+ title: Text
+ description: Text content type.
+ shortDescription: Text content type.
+ acceptFormats:
+ - string
+ const: text
+ uiOrder: 0
+ format: string
+ required: []
+ title: Text
+ format: object
+ uiOrder: 0
+ format: array
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ shortDescription: The message role, i.e. 'system', 'user' or 'assistant'.
+ acceptFormats:
+ - string
+ title: Role
+ enum:
+ - system
+ - user
+ - assistant
+ uiOrder: 1
+ format: string
+ name:
+ description: An optional name for the participant. Provides the
+ model information to differentiate between participants of the
+ same role.
+ shortDescription: An optional name for the participant. Provides
+ the model information to differentiate between participants of
+ the same role.
+ acceptFormats:
+ - string
+ title: Name
+ uiOrder: 2
+ format: string
+ required:
+ - content
+ - role
+ format: object
+ uiOrder: 1
+ description: List of chat messages.
+ format: array
+ required:
+ - messages
+ uiOrder: 0
+ format: object
+ parameter:
+ description: Input parameter.
+ shortDescription: Input parameter.
+ properties:
+ max-tokens:
+ title: Max New Tokens
+ description: The maximum number of completion tokens returned by the API.
+ The total number of tokens requested in max_tokens plus the number of
+ prompt tokens sent in messages must not exceed the context window token
+ limit of model requested. If left unspecified, then the model will generate
+ tokens until either it reaches its stop token or the end of its context
+ window.
+ shortDescription: The maximum number of tokens for model to generate.
+ acceptFormats:
+ - integer
+ default: 50
+ uiOrder: 0
+ format: integer
+ temperature:
+ title: Temperature
+ description: The amount of randomness in the response, valued between
+ 0 inclusive and 2 exclusive. Higher values are more random, and lower
+ values are more deterministic.
+ shortDescription: The temperature for sampling.
+ acceptFormats:
+ - number
+ default: 0.2
+ uiOrder: 1
+ format: number
+ top-p:
+ title: Top P
+ description: The nucleus sampling threshold, valued between 0 and 1 inclusive.
+ For each subsequent token, the model considers the results of the tokens
+ with top_p probability mass. We recommend either altering top_k or top_p,
+ but not both.
+ shortDescription: Nucleus sampling.
+ acceptFormats:
+ - number
+ default: 0.9
+ uiOrder: 2
+ format: number
+ stream:
+ title: Stream
+ description: If set, partial message deltas will be sent. Tokens will
+ be sent as data-only server-sent events as they become available.
+ shortDescription: If set, partial message deltas will be sent.
+ acceptFormats:
+ - boolean
+ default: false
+ uiOrder: 3
+ format: boolean
+ search-domain-filter:
+ title: Search Domain Filter
+ description: Given a list of domains, limit the citations used by the
+ online model to URLs from the specified domains. Currently limited to
+ only 3 domains for whitelisting and blacklisting. For blacklisting add
+ a `-` to the beginning of the domain string.
+ acceptFormats:
+ - array
+ uiOrder: 4
+ format: string
+ search-recency-filter:
+ title: Search Recency Filter
+ description: Returns search results within the specified time interval
+ - does not apply to images. Values include `month`, `week`, `day`, `hour`.
+ acceptFormats:
+ - string
+ uiOrder: 5
+ format: string
+ top-k:
+ title: Top K
+ description: The number of tokens to keep for highest top-k filtering,
+ specified as an integer between 0 and 2048 inclusive. If set to 0, top-k
+ filtering is disabled. We recommend either altering top_k or top_p,
+ but not both.
+ acceptFormats:
+ - number
+ default: 0
+ uiOrder: 6
+ format: number
+ presence-penalty:
+ title: Presence Penalty
+ description: A value between -2.0 and 2.0. Positive values penalize new
+ tokens based on whether they appear in the text so far, increasing the
+ model's likelihood to talk about new topics. Incompatible with `frequency_penalty`.
+ acceptFormats:
+ - number
+ default: 0
+ uiOrder: 7
+ format: number
+ frequency-penalty:
+ title: Frequency Penalty
+ description: A multiplicative penalty greater than 0. Values greater than
+ 1.0 penalize new tokens based on their existing frequency in the text
+ so far, decreasing the model's likelihood to repeat the same line verbatim.
+ A value of 1.0 means no penalty. Incompatible with `presence_penalty`.
+ acceptFormats:
+ - number
+ default: 1
+ uiOrder: 8
+ format: number
+ required: []
+ uiOrder: 1
+ title: Input Parameter
+ format: object
+ required:
+ - data
+ format: object
+ output:
+ title: Chat Output
+ description: Output schema of the chat task.
+ shortDescription: Output schema of the chat task.
+ properties:
+ data:
+ description: Output data.
+ shortDescription: Output data.
+ properties:
+ choices:
+ title: Choices
+ description: List of chat completion choices.
+ shortDescription: List of chat completion choices
+ items:
+ properties:
+ finish-reason:
+ title: Finish Reason
+ description: The reason the model stopped generating tokens.
+ shortDescription: The reason the model stopped generating tokens.
+ uiOrder: 0
+ format: string
+ index:
+ title: Index
+ description: The index of the choice in the list of choices.
+ shortDescription: The index of the choice in the list of choices.
+ uiOrder: 1
+ format: integer
+ message:
+ title: Message
+ description: A chat message generated by the model.
+ shortDescription: A chat message generated by the model.
+ properties:
+ content:
+ title: Content
+ description: The contents of the message.
+ shortDescription: The contents of the message.
+ uiOrder: 0
+ format: string
+ role:
+ title: Role
+ description: The role of the author of this message.
+ shortDescription: The role of the author of this message.
+ uiOrder: 1
+ format: string
+ required: []
+ uiOrder: 2
+ format: object
+ created:
+ title: Created
+ description: 'The timestamp of when the chat completion was created.
+ Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z.'
+ shortDescription: The Unix timestamp (in seconds) of when the chat
+ completion was created.
+ uiOrder: 3
+ format: integer
+ required:
+ - finish-reason
+ - index
+ - message
+ - created
+ format: object
+ uiOrder: 0
+ format: array
+ citations:
+ title: Citations
+ description: List of citations.
+ shortDescription: List of citations.
+ items:
+ format: string
+ uiOrder: 1
+ format: array
+ required:
+ - choices
+ uiOrder: 0
+ title: Output Data
+ format: object
+ metadata:
+ description: Output metadata.
+ shortDescription: Output metadata.
+ properties:
+ usage:
+ description: Usage statistics for the request.
+ shortDescription: Usage statistics for the request.
+ properties:
+ completion-tokens:
+ title: Completion Tokens
+ description: Number of tokens in the generated response.
+ shortDescription: Number of tokens in the generated response.
+ uiOrder: 0
+ format: integer
+ prompt-tokens:
+ title: Prompt Tokens
+ description: Number of tokens in the prompt.
+ shortDescription: Number of tokens in the prompt.
+ uiOrder: 1
+ format: integer
+ total-tokens:
+ title: Total Tokens
+ description: Total number of tokens used in the request (prompt +
+ completion).
+ shortDescription: Total number of tokens used in the request (prompt
+ + completion).
+ uiOrder: 2
+ format: integer
+ required:
+ - completion-tokens
+ - prompt-tokens
+ - total-tokens
+ uiOrder: 0
+ title: Usage
+ format: object
+ required: []
+ title: Output Metadata
+ uiOrder: 1
+ format: object
+ required:
+ - data
+ format: object
diff --git a/pkg/component/ai/perplexity/v0/main.go b/pkg/component/ai/perplexity/v0/main.go
index a99c90e09..f10dc634a 100644
--- a/pkg/component/ai/perplexity/v0/main.go
+++ b/pkg/component/ai/perplexity/v0/main.go
@@ -23,12 +23,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -51,7 +51,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/stabilityai/v0/README.mdx b/pkg/component/ai/stabilityai/v0/README.mdx
index 0bdda17cd..6d2fddfe7 100644
--- a/pkg/component/ai/stabilityai/v0/README.mdx
+++ b/pkg/component/ai/stabilityai/v0/README.mdx
@@ -20,7 +20,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/stabilityai/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/stabilityai/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/stabilityai/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/stabilityai/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/stabilityai/v0/config/definition.json b/pkg/component/ai/stabilityai/v0/config/definition.json
deleted file mode 100644
index 33e266073..000000000
--- a/pkg/component/ai/stabilityai/v0/config/definition.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "availableTasks": [
- "TASK_TEXT_TO_IMAGE",
- "TASK_IMAGE_TO_IMAGE"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/ai/stability-ai",
- "icon": "assets/stability-ai.svg",
- "iconUrl": "",
- "id": "stability-ai",
- "public": true,
- "title": "Stability AI",
- "description": "Connect the AI models served on the Stability AI Platform.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_AI",
- "uid": "c86a95cc-7d32-4e22-a290-8c699f6705a4",
- "vendor": "Stability AI",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/stabilityai/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/ai/stabilityai/v0/config/definition.yaml b/pkg/component/ai/stabilityai/v0/config/definition.yaml
new file mode 100644
index 000000000..7dd539af3
--- /dev/null
+++ b/pkg/component/ai/stabilityai/v0/config/definition.yaml
@@ -0,0 +1,19 @@
+availableTasks:
+- TASK_TEXT_TO_IMAGE
+- TASK_IMAGE_TO_IMAGE
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/ai/stability-ai
+icon: assets/stability-ai.svg
+iconUrl: ''
+id: stability-ai
+public: true
+title: Stability AI
+description: Connect the AI models served on the Stability AI Platform.
+tombstone: false
+type: COMPONENT_TYPE_AI
+uid: c86a95cc-7d32-4e22-a290-8c699f6705a4
+vendor: Stability AI
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/stabilityai/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/ai/stabilityai/v0/config/setup.json b/pkg/component/ai/stabilityai/v0/config/setup.json
deleted file mode 100644
index 10322d04a..000000000
--- a/pkg/component/ai/stabilityai/v0/config/setup.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Stability AI API key. To find your keys, visit here.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "instillCredential": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- }
- },
- "required": [],
- "title": "Stability AI Connection",
- "format": "object"
-}
diff --git a/pkg/component/ai/stabilityai/v0/config/setup.yaml b/pkg/component/ai/stabilityai/v0/config/setup.yaml
new file mode 100644
index 000000000..5f4e0abb0
--- /dev/null
+++ b/pkg/component/ai/stabilityai/v0/config/setup.yaml
@@ -0,0 +1,14 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Stability AI API key. To find your keys, visit here.
+ acceptFormats:
+ - string
+ instillSecret: true
+ instillCredential: true
+ uiOrder: 0
+ title: API Key
+ format: string
+required: []
+title: Stability AI Connection
+format: object
diff --git a/pkg/component/ai/stabilityai/v0/config/stabilityai.json b/pkg/component/ai/stabilityai/v0/config/stabilityai.json
deleted file mode 100644
index b4540805b..000000000
--- a/pkg/component/ai/stabilityai/v0/config/stabilityai.json
+++ /dev/null
@@ -1,1721 +0,0 @@
-{
- "components": {
- "headers": {
- "Content-Length": {
- "required": true,
- "schema": {
- "type": "integer"
- }
- },
- "Content-Type": {
- "required": true,
- "schema": {
- "enum": [
- "application/json",
- "image/png"
- ],
- "type": "string"
- }
- },
- "Finish-Reason": {
- "schema": {
- "$ref": "#/components/schemas/FinishReason"
- }
- },
- "Seed": {
- "description": "The seed used to generate the image. This header is only present when the `Accept` is set to `image/png`. Otherwise it is returned in the response body.",
- "example": 3817857576,
- "schema": {
- "example": 787078103,
- "type": "integer"
- }
- }
- },
- "parameters": {
- "accept": {
- "allowEmptyValue": false,
- "description": "The format of the response. Leave blank for JSON, or set to 'image/png' for a PNG image.",
- "in": "header",
- "name": "Accept",
- "schema": {
- "default": "application/json",
- "enum": [
- "application/json",
- "image/png"
- ],
- "type": "string"
- }
- },
- "engineID": {
- "example": "stable-diffusion-v1-6",
- "in": "path",
- "name": "engine_id",
- "required": true,
- "schema": {
- "example": "stable-diffusion-v1-6",
- "type": "string"
- }
- },
- "organization": {
- "allowEmptyValue": false,
- "description": "Allows for requests to be scoped to an organization other than the user's default. If not provided, the user's default organization will be used.",
- "example": "org-123456",
- "in": "header",
- "name": "Organization",
- "schema": {
- "type": "string"
- },
- "x-go-name": "OrganizationID"
- },
- "stabilityClientID": {
- "allowEmptyValue": false,
- "description": "Used to identify the source of requests, such as the client application or sub-organization. Optional, but recommended for organizational clarity.",
- "example": "my-great-plugin",
- "in": "header",
- "name": "Stability-Client-ID",
- "schema": {
- "type": "string"
- }
- },
- "stabilityClientVersion": {
- "allowEmptyValue": false,
- "description": "Used to identify the version of the application or service making the requests. Optional, but recommended for organizational clarity.",
- "example": "1.2.1",
- "in": "header",
- "name": "Stability-Client-Version",
- "schema": {
- "type": "string"
- }
- },
- "upscaleEngineID": {
- "examples": {
- "ESRGAN_X2_PLUS": {
- "description": "ESRGAN x2 Upscaler",
- "value": "esrgan-v1-x2plus"
- },
- "LATENT_UPSCALER_X4": {
- "description": "Stable Diffusion x4 Latent Upscaler",
- "value": "stable-diffusion-x4-latent-upscaler"
- }
- },
- "in": "path",
- "name": "engine_id",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- },
- "responses": {
- "400FromGeneration": {
- "content": {
- "application/json": {
- "example": {
- "id": "296a972f-666a-44a1-a3df-c9c28a1f56c0",
- "message": "init_image: is required",
- "name": "bad_request"
- },
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- },
- "description": "General error for invalid parameters, see below for specific errors.\n - bad_request: one or more provided parameters are invalid (see error description for details)\n - invalid_samples: Sample count may only be greater than 1 when the accept header is set to `application/json`\n - invalid_height_or_width: Height and width must be specified in increments of 64\n - invalid_file_size: The file size of one or more of the provided files is invalid\n - invalid_mime_type: The mime type of one or more of the provided files is invalid\n - invalid_image_dimensions: The dimensions of the provided `init_image` and `mask_image` do not match\n - invalid_mask_image: The parameter `mask_source` was set to `MASK_IMAGE_WHITE` or `MASK_IMAGE_BLACK` but no `mask_image` was provided\n - invalid_prompts: One or more of the prompts contains filtered words\n - invalid_pixel_count: Incorrect number of pixels specified.\n - invalid_sdxl_v222_dimensions: Incorrect dimensions specified for SDXL v2-2-2 engine. Requirements:\n - Neither `height` nor `width` may be below 128\n - Only one of `height` or `width` may be above 512 (e.g. 512x768 is valid but 578x768 is not)\n - Maximum dimensions supported are 512x896 or 896x512 \n - invalid_sdxl_v1_dimensions: Incorrect dimensions specified for SDXL v0.9 or v1.0 engine. Valid dimensions:\n - 1024x1024, 1152x896, 1216x832, 1344x768, 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152"
- },
- "400FromUpscale": {
- "content": {
- "application/json": {
- "example": {
- "id": "296a972f-666a-44a1-a3df-c9c28a1f56c0",
- "message": "image: is required",
- "name": "bad_request"
- },
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- },
- "description": "General error for invalid parameters, see below for specific errors.\n\n - bad_request: one or more provided parameters are invalid (see error description for details)\n - invalid_file_size: The file size of one or more of the provided files is invalid\n - invalid_mime_type: The mime type of one or more of the provided files is invalid\n - invalid_pixel_count: The requested image would exceed the maximum pixel count of 4,194,304"
- },
- "401": {
- "content": {
- "application/json": {
- "example": {
- "id": "9160aa70-222f-4a36-9eb7-475e2668362a",
- "message": "missing authorization header",
- "name": "unauthorized"
- },
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- },
- "description": "unauthorized: API key missing or invalid"
- },
- "403": {
- "content": {
- "application/json": {
- "example": {
- "id": "5cf19777-d17f-49fe-9bd9-39ff0ec6bb50",
- "message": "You do not have permission to access this resource",
- "name": "permission_denied"
- },
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- },
- "description": "permission_denied: You lack the necessary permissions to perform this action"
- },
- "404": {
- "content": {
- "application/json": {
- "example": {
- "id": "92b19e7f-22a2-4e71-a821-90edda229293",
- "message": "The specified engine (ID some-fake-engine) was not found.",
- "name": "not_found"
- },
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- },
- "description": "not_found: The requested resource was not found (e.g. specifing a model that does not exist)"
- },
- "500": {
- "content": {
- "application/json": {
- "example": {
- "id": "f81964d6-619b-453e-97bc-9fd7ac3f04e7",
- "message": "An unexpected server error occurred, please try again.",
- "name": "server_error"
- },
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- },
- "description": "server_error: Some unexpected server error occurred"
- },
- "GenerationResponse": {
- "content": {
- "application/json": {
- "schema": {
- "description": "An array of results from the generation request, where each image is a base64 encoded PNG.",
- "properties": {
- "artifacts": {
- "items": {
- "$ref": "#/components/schemas/Image"
- },
- "type": "array",
- "x-go-type-skip-optional-pointer": true
- }
- },
- "type": "object"
- }
- },
- "image/png": {
- "example": "The bytes of the generated image, what did you expect?",
- "schema": {
- "description": "The bytes of the generated PNG image",
- "format": "binary",
- "type": "string"
- }
- }
- },
- "description": "One or more images were successfully generated.",
- "headers": {
- "Content-Length": {
- "$ref": "#/components/headers/Content-Length"
- },
- "Content-Type": {
- "$ref": "#/components/headers/Content-Type"
- },
- "Finish-Reason": {
- "$ref": "#/components/headers/Finish-Reason"
- },
- "Seed": {
- "$ref": "#/components/headers/Seed"
- }
- }
- }
- },
- "schemas": {
- "AccountResponseBody": {
- "properties": {
- "email": {
- "description": "The user's email",
- "example": "example@stability.ai",
- "format": "email",
- "type": "string"
- },
- "id": {
- "description": "The user's ID",
- "example": "user-1234",
- "type": "string",
- "x-go-name": "ID"
- },
- "organizations": {
- "description": "The user's organizations",
- "example": [
- {
- "id": "org-5678",
- "is_default": true,
- "name": "Another Organization",
- "role": "MEMBER"
- },
- {
- "id": "org-1234",
- "is_default": false,
- "name": "My Organization",
- "role": "MEMBER"
- }
- ],
- "items": {
- "$ref": "#/components/schemas/OrganizationMembership"
- },
- "type": "array"
- },
- "profile_picture": {
- "description": "The user's profile picture",
- "example": "https://api.stability.ai/example.png",
- "format": "uri",
- "type": "string"
- }
- },
- "required": [
- "id",
- "email",
- "organizations"
- ],
- "type": "object"
- },
- "BalanceResponseBody": {
- "example": {
- "credits": 0.07903292496944721
- },
- "properties": {
- "credits": {
- "description": "The balance of the account/organization associated with the API key",
- "example": 0.41122252265928866,
- "format": "double",
- "type": "number"
- }
- },
- "required": [
- "credits"
- ],
- "type": "object"
- },
- "CfgScale": {
- "default": 7,
- "description": "How strictly the diffusion process adheres to the prompt text (higher values keep your image closer to your prompt)",
- "example": 7,
- "maximum": 35,
- "minimum": 0,
- "type": "number"
- },
- "ClipGuidancePreset": {
- "default": "NONE",
- "enum": [
- "FAST_BLUE",
- "FAST_GREEN",
- "NONE",
- "SIMPLE",
- "SLOW",
- "SLOWER",
- "SLOWEST"
- ],
- "example": "FAST_BLUE",
- "type": "string"
- },
- "DiffuseImageHeight": {
- "default": 1024,
- "description": "Height of the image to generate, in pixels, in an increment divible by 64.\n\nEngine-specific dimension validation:\n- SDXL Beta: must be between 128x128 and 512x896 (or 896x512); only one dimension can be greater than 512. \n- SDXL v0.9: must be one of 1024x1024, 1152x896, 1216x832, 1344x768, 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152\n- SDXL v1.0: same as SDXL v0.9\n- SD v1.6: must be between 320x320 and 1536x1536",
- "example": 1024,
- "minimum": 128,
- "multipleOf": 64,
- "type": "integer",
- "x-go-type": "uint64"
- },
- "DiffuseImageWidth": {
- "default": 1024,
- "description": "Width of the image to generate, in pixels, in an increment divible by 64.\n\nEngine-specific dimension validation:\n- SDXL Beta: must be between 128x128 and 512x896 (or 896x512); only one dimension can be greater than 512. \n- SDXL v0.9: must be one of 1024x1024, 1152x896, 1216x832, 1344x768, 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152\n- SDXL v1.0: same as SDXL v0.9\n- SD v1.6: must be between 320x320 and 1536x1536",
- "example": 1024,
- "minimum": 128,
- "multipleOf": 64,
- "type": "integer",
- "x-go-type": "uint64"
- },
- "Engine": {
- "properties": {
- "description": {
- "type": "string"
- },
- "id": {
- "description": "Unique identifier for the engine",
- "example": "stable-diffusion-v1-6",
- "type": "string",
- "x-go-name": "ID"
- },
- "name": {
- "description": "Name of the engine",
- "example": "Stable Diffusion XL v1.0",
- "type": "string"
- },
- "type": {
- "description": "The type of content this engine produces",
- "enum": [
- "AUDIO",
- "CLASSIFICATION",
- "PICTURE",
- "STORAGE",
- "TEXT",
- "VIDEO"
- ],
- "example": "PICTURE",
- "type": "string"
- }
- },
- "required": [
- "id",
- "name",
- "description",
- "type"
- ],
- "type": "object"
- },
- "Error": {
- "properties": {
- "id": {
- "description": "A unique identifier for this particular occurrence of the problem.",
- "example": "296a972f-666a-44a1-a3df-c9c28a1f56c0",
- "type": "string",
- "x-go-name": "ID"
- },
- "message": {
- "description": "A human-readable explanation specific to this occurrence of the problem.",
- "example": "Header parameter Authorization is required, but not found",
- "type": "string"
- },
- "name": {
- "description": "The short-name of this class of errors e.g. `bad_request`.",
- "example": "bad_request",
- "type": "string"
- }
- },
- "required": [
- "name",
- "id",
- "message",
- "status"
- ],
- "type": "object",
- "x-go-name": "RESTError"
- },
- "Extras": {
- "description": "Extra parameters passed to the engine.\nThese parameters are used for in-development or experimental features and may change\nwithout warning, so please use with caution.",
- "type": "object"
- },
- "FinishReason": {
- "description": "The result of the generation process.\n- `SUCCESS` indicates success\n- `ERROR` indicates an error\n- `CONTENT_FILTERED` indicates the result affected by the content filter and may be blurred.\n\nThis header is only present when the `Accept` is set to `image/png`. Otherwise it is returned in the response body.",
- "enum": [
- "SUCCESS",
- "ERROR",
- "CONTENT_FILTERED"
- ],
- "type": "string"
- },
- "GenerationRequestOptionalParams": {
- "description": "Represents the optional parameters that can be passed to any generation request.",
- "properties": {
- "cfg_scale": {
- "$ref": "#/components/schemas/CfgScale"
- },
- "clip_guidance_preset": {
- "$ref": "#/components/schemas/ClipGuidancePreset"
- },
- "extras": {
- "$ref": "#/components/schemas/Extras"
- },
- "sampler": {
- "$ref": "#/components/schemas/Sampler"
- },
- "samples": {
- "$ref": "#/components/schemas/Samples"
- },
- "seed": {
- "$ref": "#/components/schemas/Seed"
- },
- "steps": {
- "$ref": "#/components/schemas/Steps"
- },
- "style_preset": {
- "$ref": "#/components/schemas/StylePreset"
- }
- },
- "type": "object"
- },
- "Image": {
- "example": [
- {
- "base64": "...very long string...",
- "finishReason": "SUCCESS",
- "seed": 1050625087
- },
- {
- "base64": "...very long string...",
- "finishReason": "CONTENT_FILTERED",
- "seed": 1229191277
- }
- ],
- "properties": {
- "base64": {
- "description": "Image encoded in base64",
- "type": "string",
- "x-go-type-skip-optional-pointer": true
- },
- "finishReason": {
- "enum": [
- "SUCCESS",
- "ERROR",
- "CONTENT_FILTERED"
- ],
- "example": "CONTENT_FILTERED",
- "type": "string",
- "x-go-type-skip-optional-pointer": true
- },
- "seed": {
- "description": "The seed associated with this image",
- "example": 1229191277,
- "type": "number",
- "x-go-type-skip-optional-pointer": true
- }
- },
- "type": "object"
- },
- "ImageToImageRequestBody": {
- "discriminator": {
- "mapping": {
- "IMAGE_STRENGTH": "#/components/schemas/ImageToImageUsingImageStrengthRequestBody",
- "STEP_SCHEDULE": "#/components/schemas/ImageToImageUsingStepScheduleRequestBody"
- },
- "propertyName": "init_image_mode"
- },
- "properties": {
- "cfg_scale": {
- "$ref": "#/components/schemas/CfgScale"
- },
- "clip_guidance_preset": {
- "$ref": "#/components/schemas/ClipGuidancePreset"
- },
- "extras": {
- "$ref": "#/components/schemas/Extras"
- },
- "image_strength": {
- "$ref": "#/components/schemas/InitImageStrength"
- },
- "init_image": {
- "$ref": "#/components/schemas/InitImage"
- },
- "init_image_mode": {
- "$ref": "#/components/schemas/InitImageMode"
- },
- "sampler": {
- "$ref": "#/components/schemas/Sampler"
- },
- "samples": {
- "$ref": "#/components/schemas/Samples"
- },
- "seed": {
- "$ref": "#/components/schemas/Seed"
- },
- "step_schedule_end": {
- "$ref": "#/components/schemas/StepScheduleEnd"
- },
- "step_schedule_start": {
- "$ref": "#/components/schemas/StepScheduleStart"
- },
- "steps": {
- "$ref": "#/components/schemas/Steps"
- },
- "style_preset": {
- "$ref": "#/components/schemas/StylePreset"
- },
- "text_prompts": {
- "$ref": "#/components/schemas/TextPrompts"
- }
- },
- "required": [
- "text_prompts",
- "init_image"
- ],
- "type": "object"
- },
- "ImageToImageUsingImageStrengthRequestBody": {
- "allOf": [
- {
- "properties": {
- "image_strength": {
- "$ref": "#/components/schemas/InitImageStrength"
- },
- "init_image": {
- "$ref": "#/components/schemas/InitImage"
- },
- "init_image_mode": {
- "$ref": "#/components/schemas/InitImageMode"
- },
- "text_prompts": {
- "$ref": "#/components/schemas/TextPrompts"
- }
- },
- "required": [
- "text_prompts",
- "init_image"
- ],
- "type": "object"
- },
- {
- "$ref": "#/components/schemas/GenerationRequestOptionalParams"
- }
- ]
- },
- "ImageToImageUsingStepScheduleRequestBody": {
- "allOf": [
- {
- "properties": {
- "init_image": {
- "$ref": "#/components/schemas/InitImage"
- },
- "init_image_mode": {
- "$ref": "#/components/schemas/InitImageMode"
- },
- "step_schedule_end": {
- "$ref": "#/components/schemas/StepScheduleEnd"
- },
- "step_schedule_start": {
- "$ref": "#/components/schemas/StepScheduleStart"
- },
- "text_prompts": {
- "$ref": "#/components/schemas/TextPrompts"
- }
- },
- "required": [
- "text_prompts",
- "init_image"
- ],
- "type": "object"
- },
- {
- "$ref": "#/components/schemas/GenerationRequestOptionalParams"
- }
- ]
- },
- "InitImage": {
- "description": "Image used to initialize the diffusion process, in lieu of random noise.",
- "example": "",
- "format": "binary",
- "type": "string",
- "x-go-type": "[]byte"
- },
- "InitImageMode": {
- "default": "IMAGE_STRENGTH",
- "description": "Whether to use `image_strength` or `step_schedule_*` to control how much influence the `init_image` has on the result.",
- "enum": [
- "IMAGE_STRENGTH",
- "STEP_SCHEDULE"
- ],
- "type": "string"
- },
- "InitImageStrength": {
- "default": 0.35,
- "description": "How much influence the `init_image` has on the diffusion process. Values close to `1` will yield images very similar to the `init_image` while values close to `0` will yield images wildly different than the `init_image`. The behavior of this is meant to mirror DreamStudio's \"Image Strength\" slider.
This parameter is just an alternate way to set `step_schedule_start`, which is done via the calculation `1 - image_strength`. For example, passing in an Image Strength of 35% (`0.35`) would result in a `step_schedule_start` of `0.65`.\n",
- "example": 0.4,
- "format": "float",
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- },
- "InputImage": {
- "example": "",
- "format": "binary",
- "type": "string",
- "x-go-type": "[]byte"
- },
- "LatentUpscalerUpscaleRequestBody": {
- "properties": {
- "cfg_scale": {
- "$ref": "#/components/schemas/CfgScale"
- },
- "height": {
- "$ref": "#/components/schemas/UpscaleImageHeight"
- },
- "image": {
- "$ref": "#/components/schemas/InputImage"
- },
- "seed": {
- "$ref": "#/components/schemas/Seed"
- },
- "steps": {
- "$ref": "#/components/schemas/Steps"
- },
- "text_prompts": {
- "$ref": "#/components/schemas/TextPrompts"
- },
- "width": {
- "$ref": "#/components/schemas/UpscaleImageWidth"
- }
- },
- "required": [
- "image"
- ],
- "type": "object"
- },
- "ListEnginesResponseBody": {
- "description": "The engines available to your user/organization",
- "example": [
- {
- "description": "Stability-AI Stable Diffusion v1.6",
- "id": "stable-diffusion-v1-6",
- "name": "Stable Diffusion v1.6",
- "type": "PICTURE"
- },
- {
- "description": "Stability-AI Stable Diffusion XL v1.0",
- "id": "stable-diffusion-xl-1024-v1-0",
- "name": "Stable Diffusion XL v1.0",
- "type": "PICTURE"
- }
- ],
- "items": {
- "$ref": "#/components/schemas/Engine"
- },
- "type": "array"
- },
- "MaskImage": {
- "description": "Optional grayscale mask that allows for influence over which pixels are eligible for diffusion and at what strength. Must be the same dimensions as the `init_image`. Use the `mask_source` option to specify whether the white or black pixels should be inpainted.",
- "example": "",
- "format": "binary",
- "type": "string",
- "x-go-type": "[]byte"
- },
- "MaskSource": {
- "description": "For any given pixel, the mask determines the strength of generation on a linear scale. This parameter determines where to source the mask from:\n- `MASK_IMAGE_WHITE` will use the white pixels of the mask_image as the mask, where white pixels are completely replaced and black pixels are unchanged\n- `MASK_IMAGE_BLACK` will use the black pixels of the mask_image as the mask, where black pixels are completely replaced and white pixels are unchanged\n- `INIT_IMAGE_ALPHA` will use the alpha channel of the init_image as the mask, where fully transparent pixels are completely replaced and fully opaque pixels are unchanged",
- "type": "string"
- },
- "MaskingRequestBody": {
- "discriminator": {
- "mapping": {
- "INIT_IMAGE_ALPHA": "#/components/schemas/MaskingUsingInitImageAlphaRequestBody",
- "MASK_IMAGE_BLACK": "#/components/schemas/MaskingUsingMaskImageRequestBody",
- "MASK_IMAGE_WHITE": "#/components/schemas/MaskingUsingMaskImageRequestBody"
- },
- "propertyName": "mask_source"
- },
- "properties": {
- "cfg_scale": {
- "$ref": "#/components/schemas/CfgScale"
- },
- "clip_guidance_preset": {
- "$ref": "#/components/schemas/ClipGuidancePreset"
- },
- "extras": {
- "$ref": "#/components/schemas/Extras"
- },
- "init_image": {
- "$ref": "#/components/schemas/InitImage"
- },
- "mask_image": {
- "$ref": "#/components/schemas/MaskImage"
- },
- "mask_source": {
- "$ref": "#/components/schemas/MaskSource"
- },
- "sampler": {
- "$ref": "#/components/schemas/Sampler"
- },
- "samples": {
- "$ref": "#/components/schemas/Samples"
- },
- "seed": {
- "$ref": "#/components/schemas/Seed"
- },
- "steps": {
- "$ref": "#/components/schemas/Steps"
- },
- "style_preset": {
- "$ref": "#/components/schemas/StylePreset"
- },
- "text_prompts": {
- "$ref": "#/components/schemas/TextPrompts"
- }
- },
- "required": [
- "text_prompts",
- "init_image",
- "mask_source"
- ],
- "type": "object"
- },
- "MaskingUsingInitImageAlphaRequestBody": {
- "allOf": [
- {
- "properties": {
- "init_image": {
- "$ref": "#/components/schemas/InitImage"
- },
- "mask_source": {
- "$ref": "#/components/schemas/MaskSource"
- },
- "text_prompts": {
- "$ref": "#/components/schemas/TextPrompts"
- }
- },
- "required": [
- "init_image",
- "text_prompts",
- "mask_source"
- ],
- "type": "object"
- },
- {
- "$ref": "#/components/schemas/GenerationRequestOptionalParams"
- }
- ]
- },
- "MaskingUsingMaskImageRequestBody": {
- "allOf": [
- {
- "properties": {
- "init_image": {
- "$ref": "#/components/schemas/InitImage"
- },
- "mask_image": {
- "$ref": "#/components/schemas/MaskImage"
- },
- "mask_source": {
- "$ref": "#/components/schemas/MaskSource"
- },
- "text_prompts": {
- "$ref": "#/components/schemas/TextPrompts"
- }
- },
- "required": [
- "init_image",
- "mask_image",
- "text_prompts",
- "mask_source"
- ],
- "type": "object"
- },
- {
- "$ref": "#/components/schemas/GenerationRequestOptionalParams"
- }
- ]
- },
- "OrganizationMembership": {
- "properties": {
- "id": {
- "example": "org-123456",
- "type": "string",
- "x-go-name": "ID"
- },
- "is_default": {
- "example": false,
- "type": "boolean"
- },
- "name": {
- "example": "My Organization",
- "type": "string"
- },
- "role": {
- "example": "MEMBER",
- "type": "string"
- }
- },
- "required": [
- "id",
- "name",
- "role",
- "is_default"
- ],
- "type": "object"
- },
- "RealESRGANUpscaleRequestBody": {
- "properties": {
- "height": {
- "$ref": "#/components/schemas/UpscaleImageHeight"
- },
- "image": {
- "$ref": "#/components/schemas/InputImage"
- },
- "width": {
- "$ref": "#/components/schemas/UpscaleImageWidth"
- }
- },
- "required": [
- "image"
- ],
- "type": "object"
- },
- "Sampler": {
- "description": "Which sampler to use for the diffusion process. If this value is omitted we'll automatically select an appropriate sampler for you.",
- "enum": [
- "DDIM",
- "DDPM",
- "K_DPMPP_2M",
- "K_DPMPP_2S_ANCESTRAL",
- "K_DPM_2",
- "K_DPM_2_ANCESTRAL",
- "K_EULER",
- "K_EULER_ANCESTRAL",
- "K_HEUN",
- "K_LMS"
- ],
- "example": "K_DPM_2_ANCESTRAL",
- "type": "string"
- },
- "Samples": {
- "default": 1,
- "description": "Number of images to generate",
- "example": 1,
- "maximum": 10,
- "minimum": 1,
- "type": "integer",
- "x-go-type": "uint64"
- },
- "Seed": {
- "default": 0,
- "description": "Random noise seed (omit this option or use `0` for a random seed)",
- "example": 0,
- "maximum": 4294967295,
- "minimum": 0,
- "type": "integer",
- "x-go-type": "uint32"
- },
- "StepScheduleEnd": {
- "description": "Skips a proportion of the end of the diffusion steps, allowing the init_image to influence the final generated image. Lower values will result in more influence from the init_image, while higher values will result in more influence from the diffusion steps.",
- "example": 0.01,
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- },
- "StepScheduleStart": {
- "default": 0.65,
- "description": "Skips a proportion of the start of the diffusion steps, allowing the init_image to influence the final generated image. Lower values will result in more influence from the init_image, while higher values will result in more influence from the diffusion steps. (e.g. a value of `0` would simply return you the init_image, where a value of `1` would return you a completely different image.)",
- "example": 0.4,
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- },
- "Steps": {
- "default": 30,
- "description": "Number of diffusion steps to run.",
- "example": 50,
- "maximum": 50,
- "minimum": 10,
- "type": "integer",
- "x-go-type": "uint64"
- },
- "StylePreset": {
- "description": "Pass in a style preset to guide the image model towards a particular style.\nThis list of style presets is subject to change.",
- "enum": [
- "enhance",
- "anime",
- "photographic",
- "digital-art",
- "comic-book",
- "fantasy-art",
- "line-art",
- "analog-film",
- "neon-punk",
- "isometric",
- "low-poly",
- "origami",
- "modeling-compound",
- "cinematic",
- "3d-model",
- "pixel-art",
- "tile-texture"
- ],
- "type": "string"
- },
- "TextPrompt": {
- "description": "Text prompt for image generation",
- "properties": {
- "text": {
- "description": "The prompt itself",
- "example": "A lighthouse on a cliff",
- "maxLength": 2000,
- "type": "string"
- },
- "weight": {
- "description": "Weight of the prompt (use negative numbers for negative prompts)",
- "example": 0.8167237,
- "format": "float",
- "type": "number"
- }
- },
- "required": [
- "text"
- ],
- "type": "object"
- },
- "TextPrompts": {
- "description": "An array of text prompts to use for generation.\n\nDue to how arrays are represented in `multipart/form-data` requests, prompts must adhere to the format `text_prompts[index][text|weight]`,\nwhere `index` is some integer used to tie the text and weight together. While `index` does not have to be sequential, duplicate entries \nwill override previous entries, so it is recommended to use sequential indices.\n\nGiven a text prompt with the text `A lighthouse on a cliff` and a weight of `0.5`, it would be represented as:\n```\ntext_prompts[0][text]: \"A lighthouse on a cliff\"\ntext_prompts[0][weight]: 0.5\n```\n\nTo add another prompt to that request simply provide the values under a new `index`:\n\n```\ntext_prompts[0][text]: \"A lighthouse on a cliff\"\ntext_prompts[0][weight]: 0.5\ntext_prompts[1][text]: \"land, ground, dirt, grass\"\ntext_prompts[1][weight]: -0.9\n```",
- "items": {
- "$ref": "#/components/schemas/TextPrompt"
- },
- "minItems": 1,
- "type": "array"
- },
- "TextPromptsForTextToImage": {
- "description": "An array of text prompts to use for generation.\n\nGiven a text prompt with the text `A lighthouse on a cliff` and a weight of `0.5`, it would be represented as:\n\n```\n\"text_prompts\": [\n {\n \"text\": \"A lighthouse on a cliff\",\n \"weight\": 0.5\n }\n]\n```",
- "items": {
- "$ref": "#/components/schemas/TextPrompt"
- },
- "minItems": 1,
- "title": "TextPrompts",
- "type": "array"
- },
- "TextToImageRequestBody": {
- "allOf": [
- {
- "properties": {
- "height": {
- "$ref": "#/components/schemas/DiffuseImageHeight"
- },
- "text_prompts": {
- "$ref": "#/components/schemas/TextPromptsForTextToImage"
- },
- "width": {
- "$ref": "#/components/schemas/DiffuseImageWidth"
- }
- },
- "required": [
- "text_prompts"
- ],
- "type": "object"
- },
- {
- "$ref": "#/components/schemas/GenerationRequestOptionalParams"
- }
- ],
- "example": {
- "cfg_scale": 7,
- "clip_guidance_preset": "FAST_BLUE",
- "height": 512,
- "sampler": "K_DPM_2_ANCESTRAL",
- "samples": 1,
- "seed": 0,
- "steps": 30,
- "text_prompts": [
- {
- "text": "A lighthouse on a cliff",
- "weight": 1
- }
- ],
- "width": 512
- },
- "required": [
- "text_prompts"
- ],
- "type": "object"
- },
- "UpscaleImageHeight": {
- "description": "Desired height of the output image. Only one of `width` or `height` may be specified.",
- "minimum": 512,
- "type": "integer",
- "x-go-type": "uint64"
- },
- "UpscaleImageWidth": {
- "description": "Desired width of the output image. Only one of `width` or `height` may be specified.",
- "minimum": 512,
- "type": "integer",
- "x-go-type": "uint64"
- }
- },
- "securitySchemes": {
- "STABILITY_API_KEY": {
- "in": "header",
- "name": "Authorization",
- "type": "apiKey"
- }
- }
- },
- "info": {
- "description": "Welcome to the official Stability AI REST API!\n\n#### Authentication\n\nYou will need your Stability API key in order to make requests to this API.\nMake sure you never share your API key with anyone, and you never commit it to a public repository. Include this key in \nthe `Authorization` header of your requests.\n\n#### Rate limiting\n\nThis API is rate-limited to 150 requests every 10 seconds. If you exceed this limit, you will receive a `429` response.\nIf you find this limit too restrictive, please reach out to us via email at [platform@stability.ai](mailto:platform@stability.ai).\n\n#### Support\n\nCheck our Status Page to view the current health of our REST/gRPC APIs.\n\nIf you run into issues, please reach out to us:\n - Support Form\n - [platform@stability.ai](mailto:platform@stability.ai) \n - Discord\n",
- "termsOfService": "https://platform.stability.ai/docs/terms-of-service",
- "title": "Stability.ai REST API",
- "version": "v1",
- "x-logo": {
- "altText": "Stability.ai REST API",
- "url": "/docs/StabilityLogo.png"
- }
- },
- "openapi": "3.0.3",
- "paths": {
- "/v1/engines/list": {
- "get": {
- "description": "List all engines available to your organization/user",
- "operationId": "listEngines",
- "parameters": [
- {
- "$ref": "#/components/parameters/organization"
- },
- {
- "$ref": "#/components/parameters/stabilityClientID"
- },
- {
- "$ref": "#/components/parameters/stabilityClientVersion"
- }
- ],
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ListEnginesResponseBody"
- }
- }
- },
- "description": "OK response."
- },
- "401": {
- "$ref": "#/components/responses/401"
- },
- "500": {
- "$ref": "#/components/responses/500"
- }
- },
- "security": [
- {
- "STABILITY_API_KEY": []
- }
- ],
- "summary": "list",
- "tags": [
- "v1/engines"
- ],
- "x-codeSamples": [
- {
- "lang": "Python",
- "source": "import os\nimport requests\n\napi_host = os.getenv('API_HOST', 'https://api.stability.ai')\nurl = f\"{api_host}/v1/engines/list\"\n\napi_key = os.getenv(\"STABILITY_API_KEY\")\nif api_key is None:\n raise Exception(\"Missing Stability API key.\")\n\nresponse = requests.get(url, headers={\n \"Authorization\": f\"Bearer {api_key}\"\n})\n\nif response.status_code != 200:\n raise Exception(\"Non-200 response: \" + str(response.text))\n\n# Do something with the payload...\npayload = response.json()\n\n"
- },
- {
- "label": "TypeScript",
- "lang": "Javascript",
- "source": "import fetch from 'node-fetch'\n\nconst apiHost = process.env.API_HOST ?? 'https://api.stability.ai'\nconst url = `${apiHost}/v1/engines/list`\n\nconst apiKey = process.env.STABILITY_API_KEY\nif (!apiKey) throw new Error('Missing Stability API key.')\n\nconst response = await fetch(url, {\n method: 'GET',\n headers: {\n Authorization: `Bearer ${apiKey}`,\n },\n})\n\nif (!response.ok) {\n throw new Error(`Non-200 response: ${await response.text()}`)\n}\n\ninterface Payload {\n engines: Array<{\n id: string\n name: string\n description: string\n type: string\n }>\n}\n\n// Do something with the payload...\nconst payload = (await response.json()) as Payload\n"
- },
- {
- "lang": "Go",
- "source": "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\t// Build REST endpoint URL\n\tapiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl := apiHost + \"/v1/engines/list\"\n\n\t// Acquire an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment variable\")\n\t}\n\n\t// Execute the request & read all the bytes of the response\n\treq, _ := http.NewRequest(\"GET\", reqUrl, nil)\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tif res.StatusCode != 200 {\n\t\tpanic(\"Non-200 response: \" + string(body))\n\t}\n\n\t// Do something with the payload...\n\t// payload := string(body)\n}\n"
- },
- {
- "lang": "cURL",
- "source": "if [ -z \"$STABILITY_API_KEY\" ]; then\n echo \"STABILITY_API_KEY environment variable is not set\"\n exit 1\nfi\n\nBASE_URL=${API_HOST:-https://api.stability.ai}\nURL=\"$BASE_URL/v1/engines/list\"\n\ncurl -f -sS \"$URL\" \\\n -H 'Accept: application/json' \\\n -H \"Authorization: Bearer $STABILITY_API_KEY\"\n"
- }
- ]
- }
- },
- "/v1/generation/{engine_id}/image-to-image": {
- "post": {
- "description": "Modify an image based on a text prompt",
- "operationId": "imageToImage",
- "parameters": [
- {
- "$ref": "#/components/parameters/engineID"
- },
- {
- "$ref": "#/components/parameters/accept"
- },
- {
- "$ref": "#/components/parameters/organization"
- },
- {
- "$ref": "#/components/parameters/stabilityClientID"
- },
- {
- "$ref": "#/components/parameters/stabilityClientVersion"
- }
- ],
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "examples": {
- "IMAGE_STRENGTH": {
- "description": "Request using 35% image_strength",
- "summary": "Using IMAGE_STRENGTH",
- "value": {
- "cfg_scale": 7,
- "clip_guidance_preset": "FAST_BLUE",
- "image_strength": 0.35,
- "init_image": "",
- "init_image_mode": "IMAGE_STRENGTH",
- "sampler": "K_DPM_2_ANCESTRAL",
- "samples": 3,
- "steps": 30,
- "text_prompts[0][text]": "A dog space commander",
- "text_prompts[0][weight]": 1
- }
- },
- "STEP_SCHEDULE": {
- "description": "Equivalent request using step_schedule_start",
- "summary": "Using STEP_SCHEDULE",
- "value": {
- "cfg_scale": 7,
- "clip_guidance_preset": "FAST_BLUE",
- "init_image": "",
- "init_image_mode": "STEP_SCHEDULE",
- "sampler": "K_DPM_2_ANCESTRAL",
- "samples": 3,
- "step_schedule_start": 0.65,
- "steps": 30,
- "text_prompts[0][text]": "A dog space commander",
- "text_prompts[0][weight]": 1
- }
- }
- },
- "schema": {
- "$ref": "#/components/schemas/ImageToImageRequestBody"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/GenerationResponse"
- },
- "400": {
- "$ref": "#/components/responses/400FromGeneration"
- },
- "401": {
- "$ref": "#/components/responses/401"
- },
- "403": {
- "$ref": "#/components/responses/403"
- },
- "404": {
- "$ref": "#/components/responses/404"
- },
- "500": {
- "$ref": "#/components/responses/500"
- }
- },
- "security": [
- {
- "STABILITY_API_KEY": []
- }
- ],
- "summary": "image-to-image",
- "tags": [
- "v1/generation"
- ],
- "x-codeSamples": [
- {
- "lang": "Python",
- "source": "import base64\nimport os\nimport requests\n\nengine_id = \"stable-diffusion-xl-1024-v1-0\"\napi_host = os.getenv(\"API_HOST\", \"https://api.stability.ai\")\napi_key = os.getenv(\"STABILITY_API_KEY\")\n\nif api_key is None:\n raise Exception(\"Missing Stability API key.\")\n\nresponse = requests.post(\n f\"{api_host}/v1/generation/{engine_id}/image-to-image\",\n headers={\n \"Accept\": \"application/json\",\n \"Authorization\": f\"Bearer {api_key}\"\n },\n files={\n \"init_image\": open(\"../init_image_1024.png\", \"rb\")\n },\n data={\n \"image_strength\": 0.35,\n \"init_image_mode\": \"IMAGE_STRENGTH\",\n \"text_prompts[0][text]\": \"Galactic dog with a cape\",\n \"cfg_scale\": 7,\n \"samples\": 1,\n \"steps\": 30,\n }\n)\n\nif response.status_code != 200:\n raise Exception(\"Non-200 response: \" + str(response.text))\n\ndata = response.json()\n\nfor i, image in enumerate(data[\"artifacts\"]):\n with open(f\"./out/v1_img2img_{i}.png\", \"wb\") as f:\n f.write(base64.b64decode(image[\"base64\"]))\n"
- },
- {
- "label": "TypeScript",
- "lang": "Javascript",
- "source": "import fetch from 'node-fetch'\nimport FormData from 'form-data'\nimport fs from 'node:fs'\n\nconst engineId = 'stable-diffusion-xl-1024-v1-0'\nconst apiHost = process.env.API_HOST ?? 'https://api.stability.ai'\nconst apiKey = process.env.STABILITY_API_KEY\n\nif (!apiKey) throw new Error('Missing Stability API key.')\n\n// NOTE: This example is using a NodeJS FormData library.\n// Browsers should use their native FormData class.\n// React Native apps should also use their native FormData class.\nconst formData = new FormData()\nformData.append('init_image', fs.readFileSync('../init_image_1024.png'))\nformData.append('init_image_mode', 'IMAGE_STRENGTH')\nformData.append('image_strength', 0.35)\nformData.append('text_prompts[0][text]', 'Galactic dog wearing a cape')\nformData.append('cfg_scale', 7)\nformData.append('samples', 1)\nformData.append('steps', 30)\n\nconst response = await fetch(\n `${apiHost}/v1/generation/${engineId}/image-to-image`,\n {\n method: 'POST',\n headers: {\n ...formData.getHeaders(),\n Accept: 'application/json',\n Authorization: `Bearer ${apiKey}`,\n },\n body: formData,\n }\n)\n\nif (!response.ok) {\n throw new Error(`Non-200 response: ${await response.text()}`)\n}\n\ninterface GenerationResponse {\n artifacts: Array<{\n base64: string\n seed: number\n finishReason: string\n }>\n}\n\nconst responseJSON = (await response.json()) as GenerationResponse\n\nresponseJSON.artifacts.forEach((image, index) => {\n fs.writeFileSync(\n `out/v1_img2img_${index}.png`,\n Buffer.from(image.base64, 'base64')\n )\n})\n"
- },
- {
- "lang": "Go",
- "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\n\t\"os\"\n)\n\ntype ImageToImageImage struct {\n\tBase64 string `json:\"base64\"`\n\tSeed uint32 `json:\"seed\"`\n\tFinishReason string `json:\"finishReason\"`\n}\n\ntype ImageToImageResponse struct {\n\tImages []ImageToImageImage `json:\"artifacts\"`\n}\n\nfunc main() {\n\tengineId := \"stable-diffusion-xl-1024-v1-0\"\n\n\t// Build REST endpoint URL\n\tapiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl := apiHost + \"/v1/generation/\" + engineId + \"/image-to-image\"\n\n\t// Acquire an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment variable\")\n\t}\n\n\tdata := &bytes.Buffer{}\n\twriter := multipart.NewWriter(data)\n\n\t// Write the init image to the request\n\tinitImageWriter, _ := writer.CreateFormField(\"init_image\")\n\tinitImageFile, initImageErr := os.Open(\"../init_image_1024.png\")\n\tif initImageErr != nil {\n\t\tpanic(\"Could not open init_image.png\")\n\t}\n\t_, _ = io.Copy(initImageWriter, initImageFile)\n\n\t// Write the options to the request\n\t_ = writer.WriteField(\"init_image_mode\", \"IMAGE_STRENGTH\")\n\t_ = writer.WriteField(\"image_strength\", \"0.35\")\n\t_ = writer.WriteField(\"text_prompts[0][text]\", \"Galactic dog with a cape\")\n\t_ = writer.WriteField(\"cfg_scale\", \"7\")\n\t_ = writer.WriteField(\"samples\", \"1\")\n\t_ = writer.WriteField(\"steps\", \"30\")\n\twriter.Close()\n\n\t// Execute the request\n\tpayload := bytes.NewReader(data.Bytes())\n\treq, _ := http.NewRequest(\"POST\", reqUrl, payload)\n\treq.Header.Add(\"Content-Type\", writer.FormDataContentType())\n\treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\n\tif res.StatusCode != 200 {\n\t\tvar body map[string]interface{}\n\t\tif err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tpanic(fmt.Sprintf(\"Non-200 response: %s\", body))\n\t}\n\n\t// Decode the JSON body\n\tvar body ImageToImageResponse\n\tif err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Write the images to disk\n\tfor i, image := range body.Images {\n\t\toutFile := fmt.Sprintf(\"./out/v1_img2img_%d.png\", i)\n\t\tfile, err := os.Create(outFile)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\timageBytes, err := base64.StdEncoding.DecodeString(image.Base64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif _, err := file.Write(imageBytes); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif err := file.Close(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n"
- },
- {
- "lang": "cURL",
- "source": "if [ -z \"$STABILITY_API_KEY\" ]; then\n echo \"STABILITY_API_KEY environment variable is not set\"\n exit 1\nfi\n\nOUTPUT_FILE=./out/v1_img2img.png\nBASE_URL=${API_HOST:-https://api.stability.ai}\nURL=\"$BASE_URL/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image\"\n\ncurl -f -sS -X POST \"$URL\" \\\n -H 'Content-Type: multipart/form-data' \\\n -H 'Accept: image/png' \\\n -H \"Authorization: Bearer $STABILITY_API_KEY\" \\\n -F 'init_image=@\"../init_image_1024.png\"' \\\n -F 'init_image_mode=IMAGE_STRENGTH' \\\n -F 'image_strength=0.35' \\\n -F 'text_prompts[0][text]=A galactic dog in space' \\\n -F 'cfg_scale=7' \\\n -F 'samples=1' \\\n -F 'steps=30' \\\n -o \"$OUTPUT_FILE\"\n"
- }
- ]
- }
- },
- "/v1/generation/{engine_id}/image-to-image/masking": {
- "post": {
- "description": "Selectively modify portions of an image using a mask",
- "operationId": "masking",
- "parameters": [
- {
- "example": "stable-diffusion-xl-1024-v1-0",
- "in": "path",
- "name": "engine_id",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "$ref": "#/components/parameters/accept"
- },
- {
- "$ref": "#/components/parameters/organization"
- },
- {
- "$ref": "#/components/parameters/stabilityClientID"
- },
- {
- "$ref": "#/components/parameters/stabilityClientVersion"
- }
- ],
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "examples": {
- "INIT_IMAGE_ALPHA": {
- "value": {
- "cfg_scale": 7,
- "clip_guidance_preset": "FAST_BLUE",
- "init_image": "",
- "mask_source": "INIT_IMAGE_ALPHA",
- "sampler": "K_DPM_2_ANCESTRAL",
- "samples": 3,
- "steps": 30,
- "text_prompts[0][text]": "A dog space commander",
- "text_prompts[0][weight]": 1
- }
- },
- "MASK_IMAGE_BLACK": {
- "value": {
- "cfg_scale": 7,
- "clip_guidance_preset": "FAST_BLUE",
- "init_image": "",
- "mask_image": "",
- "mask_source": "MASK_IMAGE_BLACK",
- "sampler": "K_DPM_2_ANCESTRAL",
- "samples": 3,
- "steps": 30,
- "text_prompts[0][text]": "A dog space commander",
- "text_prompts[0][weight]": 1
- }
- },
- "MASK_IMAGE_WHITE": {
- "value": {
- "cfg_scale": 7,
- "clip_guidance_preset": "FAST_BLUE",
- "init_image": "",
- "mask_image": "",
- "mask_source": "MASK_IMAGE_WHITE",
- "sampler": "K_DPM_2_ANCESTRAL",
- "samples": 3,
- "steps": 30,
- "text_prompts[0][text]": "A dog space commander",
- "text_prompts[0][weight]": 1
- }
- }
- },
- "schema": {
- "$ref": "#/components/schemas/MaskingRequestBody"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/GenerationResponse"
- },
- "400": {
- "$ref": "#/components/responses/400FromGeneration"
- },
- "401": {
- "$ref": "#/components/responses/401"
- },
- "403": {
- "$ref": "#/components/responses/403"
- },
- "404": {
- "$ref": "#/components/responses/404"
- },
- "500": {
- "$ref": "#/components/responses/500"
- }
- },
- "security": [
- {
- "STABILITY_API_KEY": []
- }
- ],
- "summary": "image-to-image/masking",
- "tags": [
- "v1/generation"
- ],
- "x-codeSamples": [
- {
- "lang": "Python",
- "source": "import base64\nimport os\nimport requests\n\nengine_id = \"stable-diffusion-xl-1024-v1-0\"\napi_host = os.getenv('API_HOST', 'https://api.stability.ai')\napi_key = os.getenv(\"STABILITY_API_KEY\")\n\nif api_key is None:\n raise Exception(\"Missing Stability API key.\")\n\nresponse = requests.post(\n f\"{api_host}/v1/generation/{engine_id}/image-to-image/masking\",\n headers={\n \"Accept\": 'application/json',\n \"Authorization\": f\"Bearer {api_key}\"\n },\n files={\n 'init_image': open(\"../init_image_1024.png\", 'rb'),\n 'mask_image': open(\"../mask_image_black_1024.png\", 'rb'),\n },\n data={\n \"mask_source\": \"MASK_IMAGE_BLACK\",\n \"text_prompts[0][text]\": \"A large spiral galaxy with a bright central bulge and a ring of stars around it\",\n \"cfg_scale\": 7,\n \"clip_guidance_preset\": \"FAST_BLUE\",\n \"samples\": 1,\n \"steps\": 30,\n }\n)\n\nif response.status_code != 200:\n raise Exception(\"Non-200 response: \" + str(response.text))\n\ndata = response.json()\n\nfor i, image in enumerate(data[\"artifacts\"]):\n with open(f\"./out/v1_img2img_masking_{i}.png\", \"wb\") as f:\n f.write(base64.b64decode(image[\"base64\"]))\n"
- },
- {
- "label": "TypeScript",
- "lang": "Javascript",
- "source": "import fetch from 'node-fetch'\nimport FormData from 'form-data'\nimport fs from 'node:fs'\n\nconst engineId = 'stable-diffusion-xl-1024-v1-0'\nconst apiHost = process.env.API_HOST ?? 'https://api.stability.ai'\nconst apiKey = process.env.STABILITY_API_KEY\n\nif (!apiKey) throw new Error('Missing Stability API key.')\n\n// NOTE: This example is using a NodeJS FormData library. Browser\n// implementations should use their native FormData class. React Native\n// implementations should also use their native FormData class.\nconst formData = new FormData()\nformData.append('init_image', fs.readFileSync('../init_image_1024.png'))\nformData.append('mask_image', fs.readFileSync('../mask_image_black_1024.png'))\nformData.append('mask_source', 'MASK_IMAGE_BLACK')\nformData.append(\n 'text_prompts[0][text]',\n 'A large spiral galaxy with a bright central bulge and a ring of stars around it'\n)\nformData.append('cfg_scale', '7')\nformData.append('clip_guidance_preset', 'FAST_BLUE')\nformData.append('samples', 1)\nformData.append('steps', 30)\n\nconst response = await fetch(\n `${apiHost}/v1/generation/${engineId}/image-to-image/masking`,\n {\n method: 'POST',\n headers: {\n ...formData.getHeaders(),\n Accept: 'application/json',\n Authorization: `Bearer ${apiKey}`,\n },\n body: formData,\n }\n)\n\nif (!response.ok) {\n throw new Error(`Non-200 response: ${await response.text()}`)\n}\n\ninterface GenerationResponse {\n artifacts: Array<{\n base64: string\n seed: number\n finishReason: string\n }>\n}\n\nconst responseJSON = (await response.json()) as GenerationResponse\n\nresponseJSON.artifacts.forEach((image, index) => {\n fs.writeFileSync(\n `out/v1_img2img_masking_${index}.png`,\n Buffer.from(image.base64, 'base64')\n )\n})\n"
- },
- {
- "lang": "Go",
- "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\n\t\"os\"\n)\n\ntype MaskingImage struct {\n\tBase64 string `json:\"base64\"`\n\tSeed uint32 `json:\"seed\"`\n\tFinishReason string `json:\"finishReason\"`\n}\n\ntype MaskingResponse struct {\n\tImages []MaskingImage `json:\"artifacts\"`\n}\n\nfunc main() {\n\tengineId := \"stable-diffusion-xl-1024-v1-0\"\n\n\t// Build REST endpoint URL\n\tapiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl := apiHost + \"/v1/generation/\" + engineId + \"/image-to-image/masking\"\n\n\t// Acquire an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment variable\")\n\t}\n\n\tdata := &bytes.Buffer{}\n\twriter := multipart.NewWriter(data)\n\n\t// Write the init image to the request\n\tinitImageWriter, _ := writer.CreateFormField(\"init_image\")\n\tinitImageFile, initImageErr := os.Open(\"../init_image_1024.png\")\n\tif initImageErr != nil {\n\t\tpanic(\"Could not open init_image.png\")\n\t}\n\t_, _ = io.Copy(initImageWriter, initImageFile)\n\n\t// Write the mask image to the request\n\tmaskImageWriter, _ := writer.CreateFormField(\"mask_image\")\n\tmaskImageFile, maskImageErr := os.Open(\"../mask_image_black_1024.png\")\n\tif maskImageErr != nil {\n\t\tpanic(\"Could not open mask_image_white.png\")\n\t}\n\t_, _ = io.Copy(maskImageWriter, maskImageFile)\n\n\t// Write the options to the request\n\t_ = writer.WriteField(\"mask_source\", \"MASK_IMAGE_BLACK\")\n\t_ = writer.WriteField(\"text_prompts[0][text]\", \"A large spiral galaxy with a bright central bulge and a ring of stars around it\")\n\t_ = writer.WriteField(\"cfg_scale\", \"7\")\n\t_ = writer.WriteField(\"clip_guidance_preset\", \"FAST_BLUE\")\n\t_ = writer.WriteField(\"samples\", \"1\")\n\t_ = writer.WriteField(\"steps\", \"30\")\n\twriter.Close()\n\n\t// Execute the request & read all the bytes of the response\n\tpayload := bytes.NewReader(data.Bytes())\n\treq, _ := http.NewRequest(\"POST\", reqUrl, payload)\n\treq.Header.Add(\"Content-Type\", writer.FormDataContentType())\n\treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\n\tif res.StatusCode != 200 {\n\t\tvar body map[string]interface{}\n\t\tif err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tpanic(fmt.Sprintf(\"Non-200 response: %s\", body))\n\t}\n\n\t// Decode the JSON body\n\tvar body MaskingResponse\n\tif err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Write the images to disk\n\tfor i, image := range body.Images {\n\t\toutFile := fmt.Sprintf(\"./out/v1_img2img_masking_%d.png\", i)\n\t\tfile, err := os.Create(outFile)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\timageBytes, err := base64.StdEncoding.DecodeString(image.Base64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif _, err := file.Write(imageBytes); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif err := file.Close(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n"
- },
- {
- "lang": "cURL",
- "source": "#!/bin/sh\n\nset -e\n\nif [ -z \"$STABILITY_API_KEY\" ]; then\n echo \"STABILITY_API_KEY environment variable is not set\"\n exit 1\nfi\n\nOUTPUT_FILE=./out/v1_img2img_masking.png\nBASE_URL=${API_HOST:-https://api.stability.ai}\nURL=\"$BASE_URL/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking\"\n\ncurl -f -sS -X POST \"$URL\" \\\n -H 'Content-Type: multipart/form-data' \\\n -H 'Accept: image/png' \\\n -H \"Authorization: Bearer $STABILITY_API_KEY\" \\\n -F 'init_image=@\"../init_image_1024.png\"' \\\n -F 'mask_image=@\"../mask_image_black_1024.png\"' \\\n -F 'mask_source=MASK_IMAGE_BLACK' \\\n -F 'text_prompts[0][text]=A large spiral galaxy with a bright central bulge and a ring of stars around it' \\\n -F 'cfg_scale=7' \\\n -F 'clip_guidance_preset=FAST_BLUE' \\\n -F 'samples=1' \\\n -F 'steps=30' \\\n -o \"$OUTPUT_FILE\"\n"
- }
- ]
- }
- },
- "/v1/generation/{engine_id}/image-to-image/upscale": {
- "post": {
- "description": "Create a higher resolution version of an input image.\n\nThis operation outputs an image with a maximum pixel count of **4,194,304**. This is equivalent to dimensions such as `2048x2048` and `4096x1024`.\n\nBy default, the input image will be upscaled by a factor of 2. For additional control over the output dimensions, a `width` or `height` parameter may be specified.\n\nFor upscaler engines that are ESRGAN-based, refer to the `RealESRGANUpscaleRequestBody` body option below. For upscaler engines that are Stable Diffusion Latent Upscaler-based, refer to the `LatentUpscalerUpscaleRequestBody` body option below.\n\nFor more details on the upscaler engines, refer to the [documentation on the Platform site.](https://platform.stability.ai/docs/features/image-upscaling?tab=python)\n",
- "operationId": "upscaleImage",
- "parameters": [
- {
- "$ref": "#/components/parameters/upscaleEngineID"
- },
- {
- "$ref": "#/components/parameters/accept"
- },
- {
- "$ref": "#/components/parameters/organization"
- },
- {
- "$ref": "#/components/parameters/stabilityClientID"
- },
- {
- "$ref": "#/components/parameters/stabilityClientVersion"
- }
- ],
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "examples": {
- "DESIRED_HEIGHT": {
- "description": "Upscale input image to desired height with ESRGAN or the Latent Upscaler.",
- "value": {
- "height": 1024,
- "image": ""
- }
- },
- "DESIRED_WIDTH": {
- "description": "Upscale input image to desired width with ESRGAN or the Latent Upscaler.",
- "value": {
- "image": "",
- "width": 1024
- }
- },
- "ESRGAN": {
- "description": "Upscale input image by 2x using ESRGAN.",
- "value": {
- "image": ""
- }
- },
- "LATENT_UPSCALER": {
- "description": "Request using the Latent Upscaler. Refer to the LatentUpscalerUpscaleRequestBody for reference.",
- "value": {
- "cfg_scale": 7,
- "image": "",
- "seed": 5555,
- "steps": 30,
- "text_prompts[0][text]": "A dog space commander",
- "text_prompts[0][weight]": 1
- }
- }
- },
- "schema": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/RealESRGANUpscaleRequestBody"
- },
- {
- "$ref": "#/components/schemas/LatentUpscalerUpscaleRequestBody"
- }
- ]
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/GenerationResponse"
- },
- "400": {
- "$ref": "#/components/responses/400FromUpscale"
- },
- "401": {
- "$ref": "#/components/responses/401"
- },
- "403": {
- "$ref": "#/components/responses/403"
- },
- "404": {
- "$ref": "#/components/responses/404"
- },
- "500": {
- "$ref": "#/components/responses/500"
- }
- },
- "security": [
- {
- "STABILITY_API_KEY": []
- }
- ],
- "summary": "image-to-image/upscale",
- "tags": [
- "v1/generation"
- ],
- "x-codeSamples": [
- {
- "lang": "Python",
- "source": "import os\nimport requests\n\nengine_id = \"esrgan-v1-x2plus\"\napi_host = os.getenv(\"API_HOST\", \"https://api.stability.ai\")\napi_key = os.getenv(\"STABILITY_API_KEY\")\n\nif api_key is None:\n raise Exception(\"Missing Stability API key.\")\n\nresponse = requests.post(\n f\"{api_host}/v1/generation/{engine_id}/image-to-image/upscale\",\n headers={\n \"Accept\": \"image/png\",\n \"Authorization\": f\"Bearer {api_key}\"\n },\n files={\n \"image\": open(\"../init_image.png\", \"rb\")\n },\n data={\n \"width\": 1024,\n }\n)\n\nif response.status_code != 200:\n raise Exception(\"Non-200 response: \" + str(response.text))\n\nwith open(f\"./out/v1_upscaled_image.png\", \"wb\") as f:\n f.write(response.content)\n"
- },
- {
- "label": "TypeScript",
- "lang": "Javascript",
- "source": "import fetch from 'node-fetch'\nimport FormData from 'form-data'\nimport fs from 'node:fs'\n\nconst engineId = 'esrgan-v1-x2plus'\nconst apiHost = process.env.API_HOST ?? 'https://api.stability.ai'\nconst apiKey = process.env.STABILITY_API_KEY\n\nif (!apiKey) throw new Error('Missing Stability API key.')\n\n// NOTE: This example is using a NodeJS FormData library.\n// Browsers should use their native FormData class.\n// React Native apps should also use their native FormData class.\nconst formData = new FormData()\nformData.append('image', fs.readFileSync('../init_image.png'))\nformData.append('width', 1024)\n\nconst response = await fetch(\n `${apiHost}/v1/generation/${engineId}/image-to-image/upscale`,\n {\n method: 'POST',\n headers: {\n ...formData.getHeaders(),\n Accept: 'image/png',\n Authorization: `Bearer ${apiKey}`,\n },\n body: formData,\n }\n)\n\nif (!response.ok) {\n throw new Error(`Non-200 response: ${await response.text()}`)\n}\n\nconst image = await response.arrayBuffer()\nfs.writeFileSync('./out/v1_upscaled_image.png', Buffer.from(image))\n"
- },
- {
- "lang": "Go",
- "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tengineId := \"esrgan-v1-x2plus\"\n\n\t// Build REST endpoint URL\n\tapiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl := apiHost + \"/v1/generation/\" + engineId + \"/image-to-image/upscale\"\n\n\t// Acquire an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment variable\")\n\t}\n\n\tdata := &bytes.Buffer{}\n\twriter := multipart.NewWriter(data)\n\n\t// Write the init image to the request\n\tinitImageWriter, _ := writer.CreateFormField(\"image\")\n\tinitImageFile, initImageErr := os.Open(\"../init_image.png\")\n\tif initImageErr != nil {\n\t\tpanic(\"Could not open init_image.png\")\n\t}\n\t_, _ = io.Copy(initImageWriter, initImageFile)\n\n\t// Write the options to the request\n\t_ = writer.WriteField(\"width\", \"1024\")\n\twriter.Close()\n\n\t// Execute the request\n\tpayload := bytes.NewReader(data.Bytes())\n\treq, _ := http.NewRequest(\"POST\", reqUrl, payload)\n\treq.Header.Add(\"Content-Type\", writer.FormDataContentType())\n\treq.Header.Add(\"Accept\", \"image/png\")\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\n\tif res.StatusCode != 200 {\n\t\tvar body map[string]interface{}\n\t\tif err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tpanic(fmt.Sprintf(\"Non-200 response: %s\", body))\n\t}\n\n\t// Write the response to a file\n\tout, err := os.Create(\"./out/v1_upscaled_image.png\")\n\tdefer out.Close()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = io.Copy(out, res.Body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n"
- },
- {
- "lang": "cURL",
- "source": "if [ -z \"$STABILITY_API_KEY\" ]; then\n echo \"STABILITY_API_KEY environment variable is not set\"\n exit 1\nfi\n\nOUTPUT_FILE=./out/v1_upscaled_image.png\nBASE_URL=${API_HOST:-https://api.stability.ai}\nURL=\"$BASE_URL/v1/generation/esrgan-v1-x2plus/image-to-image/upscale\"\n\ncurl -f -sS -X POST \"$URL\" \\\n -H 'Content-Type: multipart/form-data' \\\n -H 'Accept: image/png' \\\n -H \"Authorization: Bearer $STABILITY_API_KEY\" \\\n -F 'image=@\"../init_image.png\"' \\\n -F 'width=1024' \\\n -o \"$OUTPUT_FILE\"\n"
- }
- ]
- }
- },
- "/v1/generation/{engine_id}/text-to-image": {
- "post": {
- "description": "Generate a new image from a text prompt",
- "operationId": "textToImage",
- "parameters": [
- {
- "$ref": "#/components/parameters/engineID"
- },
- {
- "$ref": "#/components/parameters/accept"
- },
- {
- "$ref": "#/components/parameters/organization"
- },
- {
- "$ref": "#/components/parameters/stabilityClientID"
- },
- {
- "$ref": "#/components/parameters/stabilityClientVersion"
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "example": {
- "cfg_scale": 7,
- "clip_guidance_preset": "FAST_BLUE",
- "height": 512,
- "sampler": "K_DPM_2_ANCESTRAL",
- "samples": 1,
- "steps": 30,
- "text_prompts": [
- {
- "text": "A lighthouse on a cliff",
- "weight": 1
- }
- ],
- "width": 512
- },
- "schema": {
- "$ref": "#/components/schemas/TextToImageRequestBody"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/GenerationResponse"
- },
- "400": {
- "$ref": "#/components/responses/400FromGeneration"
- },
- "401": {
- "$ref": "#/components/responses/401"
- },
- "403": {
- "$ref": "#/components/responses/403"
- },
- "404": {
- "$ref": "#/components/responses/404"
- },
- "500": {
- "$ref": "#/components/responses/500"
- }
- },
- "security": [
- {
- "STABILITY_API_KEY": []
- }
- ],
- "summary": "text-to-image",
- "tags": [
- "v1/generation"
- ],
- "x-codeSamples": [
- {
- "lang": "Python",
- "source": "import base64\nimport os\nimport requests\n\nengine_id = \"stable-diffusion-v1-6\"\napi_host = os.getenv('API_HOST', 'https://api.stability.ai')\napi_key = os.getenv(\"STABILITY_API_KEY\")\n\nif api_key is None:\n raise Exception(\"Missing Stability API key.\")\n\nresponse = requests.post(\n f\"{api_host}/v1/generation/{engine_id}/text-to-image\",\n headers={\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\",\n \"Authorization\": f\"Bearer {api_key}\"\n },\n json={\n \"text_prompts\": [\n {\n \"text\": \"A lighthouse on a cliff\"\n }\n ],\n \"cfg_scale\": 7,\n \"height\": 1024,\n \"width\": 1024,\n \"samples\": 1,\n \"steps\": 30,\n },\n)\n\nif response.status_code != 200:\n raise Exception(\"Non-200 response: \" + str(response.text))\n\ndata = response.json()\n\nfor i, image in enumerate(data[\"artifacts\"]):\n with open(f\"./out/v1_txt2img_{i}.png\", \"wb\") as f:\n f.write(base64.b64decode(image[\"base64\"]))\n"
- },
- {
- "label": "TypeScript",
- "lang": "Javascript",
- "source": "import fetch from 'node-fetch'\nimport fs from 'node:fs'\n\nconst engineId = 'stable-diffusion-v1-6'\nconst apiHost = process.env.API_HOST ?? 'https://api.stability.ai'\nconst apiKey = process.env.STABILITY_API_KEY\n\nif (!apiKey) throw new Error('Missing Stability API key.')\n\nconst response = await fetch(\n `${apiHost}/v1/generation/${engineId}/text-to-image`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n Authorization: `Bearer ${apiKey}`,\n },\n body: JSON.stringify({\n text_prompts: [\n {\n text: 'A lighthouse on a cliff',\n },\n ],\n cfg_scale: 7,\n height: 1024,\n width: 1024,\n steps: 30,\n samples: 1,\n }),\n }\n)\n\nif (!response.ok) {\n throw new Error(`Non-200 response: ${await response.text()}`)\n}\n\ninterface GenerationResponse {\n artifacts: Array<{\n base64: string\n seed: number\n finishReason: string\n }>\n}\n\nconst responseJSON = (await response.json()) as GenerationResponse\n\nresponseJSON.artifacts.forEach((image, index) => {\n fs.writeFileSync(\n `./out/v1_txt2img_${index}.png`,\n Buffer.from(image.base64, 'base64')\n )\n})\n"
- },
- {
- "lang": "Go",
- "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\ntype TextToImageImage struct {\n\tBase64 string `json:\"base64\"`\n\tSeed uint32 `json:\"seed\"`\n\tFinishReason string `json:\"finishReason\"`\n}\n\ntype TextToImageResponse struct {\n\tImages []TextToImageImage `json:\"artifacts\"`\n}\n\nfunc main() {\n\t// Build REST endpoint URL w/ specified engine\n\tengineId := \"stable-diffusion-v1-6\"\n\tapiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl := apiHost + \"/v1/generation/\" + engineId + \"/text-to-image\"\n\n\t// Acquire an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment variable\")\n\t}\n\n\tvar data = []byte(`{\n\t\t\"text_prompts\": [\n\t\t {\n\t\t\t\"text\": \"A lighthouse on a cliff\"\n\t\t }\n\t\t],\n\t\t\"cfg_scale\": 7,\n\t\t\"height\": 1024,\n\t\t\"width\": 1024,\n\t\t\"samples\": 1,\n\t\t\"steps\": 30\n \t}`)\n\n\treq, _ := http.NewRequest(\"POST\", reqUrl, bytes.NewBuffer(data))\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\n\t// Execute the request & read all the bytes of the body\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\n\tif res.StatusCode != 200 {\n\t\tvar body map[string]interface{}\n\t\tif err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tpanic(fmt.Sprintf(\"Non-200 response: %s\", body))\n\t}\n\n\t// Decode the JSON body\n\tvar body TextToImageResponse\n\tif err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Write the images to disk\n\tfor i, image := range body.Images {\n\t\toutFile := fmt.Sprintf(\"./out/v1_txt2img_%d.png\", i)\n\t\tfile, err := os.Create(outFile)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\timageBytes, err := base64.StdEncoding.DecodeString(image.Base64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif _, err := file.Write(imageBytes); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif err := file.Close(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n"
- },
- {
- "lang": "cURL",
- "source": "if [ -z \"$STABILITY_API_KEY\" ]; then\n echo \"STABILITY_API_KEY environment variable is not set\"\n exit 1\nfi\n\nOUTPUT_FILE=./out/v1_txt2img.png\nBASE_URL=${API_HOST:-https://api.stability.ai}\nURL=\"$BASE_URL/v1/generation/stable-diffusion-v1-6/text-to-image\"\n\ncurl -f -sS -X POST \"$URL\" \\\n -H 'Content-Type: application/json' \\\n -H 'Accept: image/png' \\\n -H \"Authorization: Bearer $STABILITY_API_KEY\" \\\n --data-raw '{\n \"text_prompts\": [\n {\n \"text\": \"A lighthouse on a cliff\"\n }\n ],\n \"cfg_scale\": 7,\n \"height\": 1024,\n \"width\": 1024,\n \"samples\": 1,\n \"steps\": 30\n }' \\\n -o \"$OUTPUT_FILE\"\n"
- }
- ]
- }
- },
- "/v1/user/account": {
- "get": {
- "description": "Get information about the account associated with the provided API key",
- "operationId": "userAccount",
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/AccountResponseBody"
- }
- }
- },
- "description": "OK response."
- },
- "401": {
- "$ref": "#/components/responses/401"
- },
- "500": {
- "$ref": "#/components/responses/500"
- }
- },
- "security": [
- {
- "STABILITY_API_KEY": []
- }
- ],
- "summary": "account",
- "tags": [
- "v1/user"
- ],
- "x-codeSamples": [
- {
- "lang": "Python",
- "source": "import os\nimport requests\n\napi_host = os.getenv('API_HOST', 'https://api.stability.ai')\nurl = f\"{api_host}/v1/user/account\"\n\napi_key = os.getenv(\"STABILITY_API_KEY\")\nif api_key is None:\n raise Exception(\"Missing Stability API key.\")\n\nresponse = requests.get(url, headers={\n \"Authorization\": f\"Bearer {api_key}\"\n})\n\nif response.status_code != 200:\n raise Exception(\"Non-200 response: \" + str(response.text))\n\n# Do something with the payload...\npayload = response.json()\n\n"
- },
- {
- "label": "TypeScript",
- "lang": "Javascript",
- "source": "import fetch from 'node-fetch'\n\nconst apiHost = process.env.API_HOST ?? 'https://api.stability.ai'\nconst url = `${apiHost}/v1/user/account`\n\nconst apiKey = process.env.STABILITY_API_KEY\nif (!apiKey) throw new Error('Missing Stability API key.')\n\nconst response = await fetch(url, {\n method: 'GET',\n headers: {\n Authorization: `Bearer ${apiKey}`,\n },\n})\n\nif (!response.ok) {\n throw new Error(`Non-200 response: ${await response.text()}`)\n}\n\ninterface User {\n id: string\n profile_picture: string\n email: string\n organizations?: Array<{\n id: string\n name: string\n role: string\n is_default: boolean\n }>\n}\n\n// Do something with the user...\nconst user = (await response.json()) as User\n"
- },
- {
- "lang": "Go",
- "source": "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\t// Build REST endpoint URL\n\tapiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl := apiHost + \"/v1/user/account\"\n\n\t// Acquire an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment variable\")\n\t}\n\n\t// Build the request\n\treq, _ := http.NewRequest(\"GET\", reqUrl, nil)\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\n\t// Execute the request\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tif res.StatusCode != 200 {\n\t\tpanic(\"Non-200 response: \" + string(body))\n\t}\n\n\t// Do something with the payload...\n\t// payload := string(body)\n}\n"
- },
- {
- "lang": "cURL",
- "source": "if [ -z \"$STABILITY_API_KEY\" ]; then\n echo \"STABILITY_API_KEY environment variable is not set\"\n exit 1\nfi\n\n# Determine the URL to use for the request\nBASE_URL=${API_HOST:-https://api.stability.ai}\nURL=\"$BASE_URL/v1/user/account\"\n\ncurl -f -sS \"$URL\" \\\n -H 'Accept: application/json' \\\n -H \"Authorization: Bearer $STABILITY_API_KEY\"\n"
- }
- ]
- }
- },
- "/v1/user/balance": {
- "get": {
- "description": "Get the credit balance of the account/organization associated with the API key",
- "operationId": "userBalance",
- "parameters": [
- {
- "$ref": "#/components/parameters/organization"
- },
- {
- "$ref": "#/components/parameters/stabilityClientID"
- },
- {
- "$ref": "#/components/parameters/stabilityClientVersion"
- }
- ],
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "example": {
- "credits": 0.6336833840314097
- },
- "schema": {
- "$ref": "#/components/schemas/BalanceResponseBody"
- }
- }
- },
- "description": "OK response."
- },
- "401": {
- "$ref": "#/components/responses/401"
- },
- "500": {
- "$ref": "#/components/responses/500"
- }
- },
- "security": [
- {
- "STABILITY_API_KEY": []
- }
- ],
- "summary": "balance",
- "tags": [
- "v1/user"
- ],
- "x-codeSamples": [
- {
- "lang": "Python",
- "source": "import os\nimport requests\n\napi_host = os.getenv('API_HOST', 'https://api.stability.ai')\nurl = f\"{api_host}/v1/user/balance\"\n\napi_key = os.getenv(\"STABILITY_API_KEY\")\nif api_key is None:\n raise Exception(\"Missing Stability API key.\")\n\nresponse = requests.get(url, headers={\n \"Authorization\": f\"Bearer {api_key}\"\n})\n\nif response.status_code != 200:\n raise Exception(\"Non-200 response: \" + str(response.text))\n\n# Do something with the payload...\npayload = response.json()\n\n"
- },
- {
- "label": "TypeScript",
- "lang": "Javascript",
- "source": "import fetch from 'node-fetch'\n\nconst apiHost = process.env.API_HOST ?? 'https://api.stability.ai'\nconst url = `${apiHost}/v1/user/balance`\n\nconst apiKey = process.env.STABILITY_API_KEY\nif (!apiKey) throw new Error('Missing Stability API key.')\n\nconst response = await fetch(url, {\n method: 'GET',\n headers: {\n Authorization: `Bearer ${apiKey}`,\n },\n})\n\nif (!response.ok) {\n throw new Error(`Non-200 response: ${await response.text()}`)\n}\n\ninterface Balance {\n credits: number\n}\n\n// Do something with the balance...\nconst balance = (await response.json()) as Balance\n"
- },
- {
- "lang": "Go",
- "source": "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\t// Build REST endpoint URL\n\tapiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl := apiHost + \"/v1/user/balance\"\n\n\t// Acquire an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment variable\")\n\t}\n\n\t// Build the request\n\treq, _ := http.NewRequest(\"GET\", reqUrl, nil)\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\n\t// Execute the request\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tif res.StatusCode != 200 {\n\t\tpanic(\"Non-200 response: \" + string(body))\n\t}\n\n\t// Do something with the payload...\n\t// payload := string(body)\n}\n"
- },
- {
- "lang": "cURL",
- "source": "if [ -z \"$STABILITY_API_KEY\" ]; then\n echo \"STABILITY_API_KEY environment variable is not set\"\n exit 1\nfi\n\n# Determine the URL to use for the request\nBASE_URL=${API_HOST:-https://api.stability.ai}\nURL=\"$BASE_URL/v1/user/balance\"\n\ncurl -f -sS \"$URL\" \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $STABILITY_API_KEY\"\n"
- }
- ]
- }
- }
- },
- "servers": [
- {
- "url": "https://api.stability.ai"
- }
- ],
- "tags": [
- {
- "description": "Manage your Stability.ai account, and view account/organization balances",
- "name": "v1/user"
- },
- {
- "description": "Enumerate available engines",
- "name": "v1/engines"
- },
- {
- "description": "Generate images from text, existing images, or both",
- "name": "v1/generation"
- }
- ]
-}
diff --git a/pkg/component/ai/stabilityai/v0/config/stabilityai.yaml b/pkg/component/ai/stabilityai/v0/config/stabilityai.yaml
new file mode 100644
index 000000000..87833d9df
--- /dev/null
+++ b/pkg/component/ai/stabilityai/v0/config/stabilityai.yaml
@@ -0,0 +1,2072 @@
+components:
+ headers:
+ Content-Length:
+ required: true
+ schema:
+ type: integer
+ Content-Type:
+ required: true
+ schema:
+ enum:
+ - application/json
+ - image/png
+ type: string
+ Finish-Reason:
+ schema:
+ $ref: '#/components/schemas/FinishReason'
+ Seed:
+ description: The seed used to generate the image. This header is only present
+ when the `Accept` is set to `image/png`. Otherwise it is returned in the
+ response body.
+ example: 3817857576
+ schema:
+ example: 787078103
+ type: integer
+ parameters:
+ accept:
+ allowEmptyValue: false
+ description: The format of the response. Leave blank for JSON, or set to 'image/png'
+ for a PNG image.
+ in: header
+ name: Accept
+ schema:
+ default: application/json
+ enum:
+ - application/json
+ - image/png
+ type: string
+ engineID:
+ example: stable-diffusion-v1-6
+ in: path
+ name: engine_id
+ required: true
+ schema:
+ example: stable-diffusion-v1-6
+ type: string
+ organization:
+ allowEmptyValue: false
+ description: Allows for requests to be scoped to an organization other than
+ the user's default. If not provided, the user's default organization will
+ be used.
+ example: org-123456
+ in: header
+ name: Organization
+ schema:
+ type: string
+ x-go-name: OrganizationID
+ stabilityClientID:
+ allowEmptyValue: false
+ description: Used to identify the source of requests, such as the client application
+ or sub-organization. Optional, but recommended for organizational clarity.
+ example: my-great-plugin
+ in: header
+ name: Stability-Client-ID
+ schema:
+ type: string
+ stabilityClientVersion:
+ allowEmptyValue: false
+ description: Used to identify the version of the application or service making
+ the requests. Optional, but recommended for organizational clarity.
+ example: 1.2.1
+ in: header
+ name: Stability-Client-Version
+ schema:
+ type: string
+ upscaleEngineID:
+ examples:
+ ESRGAN_X2_PLUS:
+ description: ESRGAN x2 Upscaler
+ value: esrgan-v1-x2plus
+ LATENT_UPSCALER_X4:
+ description: Stable Diffusion x4 Latent Upscaler
+ value: stable-diffusion-x4-latent-upscaler
+ in: path
+ name: engine_id
+ required: true
+ schema:
+ type: string
+ responses:
+ 400FromGeneration:
+ content:
+ application/json:
+ example:
+ id: 296a972f-666a-44a1-a3df-c9c28a1f56c0
+ message: 'init_image: is required'
+ name: bad_request
+ schema:
+ $ref: '#/components/schemas/Error'
+ description: "General error for invalid parameters, see below for specific errors.\n\
+ \ - bad_request: one or more provided parameters are invalid (see error description\
+ \ for details)\n - invalid_samples: Sample count may only be greater than\
+ \ 1 when the accept header is set to `application/json`\n - invalid_height_or_width:\
+ \ Height and width must be specified in increments of 64\n - invalid_file_size:\
+ \ The file size of one or more of the provided files is invalid\n - invalid_mime_type:\
+ \ The mime type of one or more of the provided files is invalid\n - invalid_image_dimensions:\
+ \ The dimensions of the provided `init_image` and `mask_image` do not match\n\
+ \ - invalid_mask_image: The parameter `mask_source` was set to `MASK_IMAGE_WHITE`\
+ \ or `MASK_IMAGE_BLACK` but no `mask_image` was provided\n - invalid_prompts:\
+ \ One or more of the prompts contains filtered words\n - invalid_pixel_count:\
+ \ Incorrect number of pixels specified.\n - invalid_sdxl_v222_dimensions:\
+ \ Incorrect dimensions specified for SDXL v2-2-2 engine. Requirements:\n \
+ \ - Neither `height` nor `width` may be below 128\n - Only one of `height`\
+ \ or `width` may be above 512 (e.g. 512x768 is valid but 578x768 is not)\n\
+ \ - Maximum dimensions supported are 512x896 or 896x512 \n -\
+ \ invalid_sdxl_v1_dimensions: Incorrect dimensions specified for SDXL v0.9\
+ \ or v1.0 engine. Valid dimensions:\n - 1024x1024, 1152x896, 1216x832,\
+ \ 1344x768, 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152"
+ 400FromUpscale:
+ content:
+ application/json:
+ example:
+ id: 296a972f-666a-44a1-a3df-c9c28a1f56c0
+ message: 'image: is required'
+ name: bad_request
+ schema:
+ $ref: '#/components/schemas/Error'
+ description: |-
+ General error for invalid parameters, see below for specific errors.
+
+ - bad_request: one or more provided parameters are invalid (see error description for details)
+ - invalid_file_size: The file size of one or more of the provided files is invalid
+ - invalid_mime_type: The mime type of one or more of the provided files is invalid
+ - invalid_pixel_count: The requested image would exceed the maximum pixel count of 4,194,304
+ '401':
+ content:
+ application/json:
+ example:
+ id: 9160aa70-222f-4a36-9eb7-475e2668362a
+ message: missing authorization header
+ name: unauthorized
+ schema:
+ $ref: '#/components/schemas/Error'
+ description: 'unauthorized: API key missing or invalid'
+ '403':
+ content:
+ application/json:
+ example:
+ id: 5cf19777-d17f-49fe-9bd9-39ff0ec6bb50
+ message: You do not have permission to access this resource
+ name: permission_denied
+ schema:
+ $ref: '#/components/schemas/Error'
+ description: 'permission_denied: You lack the necessary permissions to perform
+ this action'
+ '404':
+ content:
+ application/json:
+ example:
+ id: 92b19e7f-22a2-4e71-a821-90edda229293
+ message: The specified engine (ID some-fake-engine) was not found.
+ name: not_found
+ schema:
+ $ref: '#/components/schemas/Error'
+ description: 'not_found: The requested resource was not found (e.g. specifing
+ a model that does not exist)'
+ '500':
+ content:
+ application/json:
+ example:
+ id: f81964d6-619b-453e-97bc-9fd7ac3f04e7
+ message: An unexpected server error occurred, please try again.
+ name: server_error
+ schema:
+ $ref: '#/components/schemas/Error'
+ description: 'server_error: Some unexpected server error occurred'
+ GenerationResponse:
+ content:
+ application/json:
+ schema:
+ description: An array of results from the generation request, where each
+ image is a base64 encoded PNG.
+ properties:
+ artifacts:
+ items:
+ $ref: '#/components/schemas/Image'
+ type: array
+ x-go-type-skip-optional-pointer: true
+ type: object
+ image/png:
+ example: The bytes of the generated image, what did you expect?
+ schema:
+ description: The bytes of the generated PNG image
+ format: binary
+ type: string
+ description: One or more images were successfully generated.
+ headers:
+ Content-Length:
+ $ref: '#/components/headers/Content-Length'
+ Content-Type:
+ $ref: '#/components/headers/Content-Type'
+ Finish-Reason:
+ $ref: '#/components/headers/Finish-Reason'
+ Seed:
+ $ref: '#/components/headers/Seed'
+ schemas:
+ AccountResponseBody:
+ properties:
+ email:
+ description: The user's email
+ example: example@stability.ai
+ format: email
+ type: string
+ id:
+ description: The user's ID
+ example: user-1234
+ type: string
+ x-go-name: ID
+ organizations:
+ description: The user's organizations
+ example:
+ - id: org-5678
+ is_default: true
+ name: Another Organization
+ role: MEMBER
+ - id: org-1234
+ is_default: false
+ name: My Organization
+ role: MEMBER
+ items:
+ $ref: '#/components/schemas/OrganizationMembership'
+ type: array
+ profile_picture:
+ description: The user's profile picture
+ example: https://api.stability.ai/example.png
+ format: uri
+ type: string
+ required:
+ - id
+ - email
+ - organizations
+ type: object
+ BalanceResponseBody:
+ example:
+ credits: 0.07903292496944721
+ properties:
+ credits:
+ description: The balance of the account/organization associated with the
+ API key
+ example: 0.41122252265928866
+ format: double
+ type: number
+ required:
+ - credits
+ type: object
+ CfgScale:
+ default: 7
+ description: How strictly the diffusion process adheres to the prompt text (higher
+ values keep your image closer to your prompt)
+ example: 7
+ maximum: 35
+ minimum: 0
+ type: number
+ ClipGuidancePreset:
+ default: NONE
+ enum:
+ - FAST_BLUE
+ - FAST_GREEN
+ - NONE
+ - SIMPLE
+ - SLOW
+ - SLOWER
+ - SLOWEST
+ example: FAST_BLUE
+ type: string
+ DiffuseImageHeight:
+ default: 1024
+ description: "Height of the image to generate, in pixels, in an increment divible\
+ \ by 64.\n\nEngine-specific dimension validation:\n- SDXL Beta: must be between\
+ \ 128x128 and 512x896 (or 896x512); only one dimension can be greater than\
+ \ 512. \n- SDXL v0.9: must be one of 1024x1024, 1152x896, 1216x832, 1344x768,\
+ \ 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152\n- SDXL v1.0: same as\
+ \ SDXL v0.9\n- SD v1.6: must be between 320x320 and 1536x1536"
+ example: 1024
+ minimum: 128
+ multipleOf: 64
+ type: integer
+ x-go-type: uint64
+ DiffuseImageWidth:
+ default: 1024
+ description: "Width of the image to generate, in pixels, in an increment divible\
+ \ by 64.\n\nEngine-specific dimension validation:\n- SDXL Beta: must be between\
+ \ 128x128 and 512x896 (or 896x512); only one dimension can be greater than\
+ \ 512. \n- SDXL v0.9: must be one of 1024x1024, 1152x896, 1216x832, 1344x768,\
+ \ 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152\n- SDXL v1.0: same as\
+ \ SDXL v0.9\n- SD v1.6: must be between 320x320 and 1536x1536"
+ example: 1024
+ minimum: 128
+ multipleOf: 64
+ type: integer
+ x-go-type: uint64
+ Engine:
+ properties:
+ description:
+ type: string
+ id:
+ description: Unique identifier for the engine
+ example: stable-diffusion-v1-6
+ type: string
+ x-go-name: ID
+ name:
+ description: Name of the engine
+ example: Stable Diffusion XL v1.0
+ type: string
+ type:
+ description: The type of content this engine produces
+ enum:
+ - AUDIO
+ - CLASSIFICATION
+ - PICTURE
+ - STORAGE
+ - TEXT
+ - VIDEO
+ example: PICTURE
+ type: string
+ required:
+ - id
+ - name
+ - description
+ - type
+ type: object
+ Error:
+ properties:
+ id:
+ description: A unique identifier for this particular occurrence of the problem.
+ example: 296a972f-666a-44a1-a3df-c9c28a1f56c0
+ type: string
+ x-go-name: ID
+ message:
+ description: A human-readable explanation specific to this occurrence of
+ the problem.
+ example: Header parameter Authorization is required, but not found
+ type: string
+ name:
+ description: The short-name of this class of errors e.g. `bad_request`.
+ example: bad_request
+ type: string
+ required:
+ - name
+ - id
+ - message
+ - status
+ type: object
+ x-go-name: RESTError
+ Extras:
+ description: |-
+ Extra parameters passed to the engine.
+ These parameters are used for in-development or experimental features and may change
+ without warning, so please use with caution.
+ type: object
+ FinishReason:
+ description: |-
+ The result of the generation process.
+ - `SUCCESS` indicates success
+ - `ERROR` indicates an error
+ - `CONTENT_FILTERED` indicates the result affected by the content filter and may be blurred.
+
+ This header is only present when the `Accept` is set to `image/png`. Otherwise it is returned in the response body.
+ enum:
+ - SUCCESS
+ - ERROR
+ - CONTENT_FILTERED
+ type: string
+ GenerationRequestOptionalParams:
+ description: Represents the optional parameters that can be passed to any generation
+ request.
+ properties:
+ cfg_scale:
+ $ref: '#/components/schemas/CfgScale'
+ clip_guidance_preset:
+ $ref: '#/components/schemas/ClipGuidancePreset'
+ extras:
+ $ref: '#/components/schemas/Extras'
+ sampler:
+ $ref: '#/components/schemas/Sampler'
+ samples:
+ $ref: '#/components/schemas/Samples'
+ seed:
+ $ref: '#/components/schemas/Seed'
+ steps:
+ $ref: '#/components/schemas/Steps'
+ style_preset:
+ $ref: '#/components/schemas/StylePreset'
+ type: object
+ Image:
+ example:
+ - base64: '...very long string...'
+ finishReason: SUCCESS
+ seed: 1050625087
+ - base64: '...very long string...'
+ finishReason: CONTENT_FILTERED
+ seed: 1229191277
+ properties:
+ base64:
+ description: Image encoded in base64
+ type: string
+ x-go-type-skip-optional-pointer: true
+ finishReason:
+ enum:
+ - SUCCESS
+ - ERROR
+ - CONTENT_FILTERED
+ example: CONTENT_FILTERED
+ type: string
+ x-go-type-skip-optional-pointer: true
+ seed:
+ description: The seed associated with this image
+ example: 1229191277
+ type: number
+ x-go-type-skip-optional-pointer: true
+ type: object
+ ImageToImageRequestBody:
+ discriminator:
+ mapping:
+ IMAGE_STRENGTH: '#/components/schemas/ImageToImageUsingImageStrengthRequestBody'
+ STEP_SCHEDULE: '#/components/schemas/ImageToImageUsingStepScheduleRequestBody'
+ propertyName: init_image_mode
+ properties:
+ cfg_scale:
+ $ref: '#/components/schemas/CfgScale'
+ clip_guidance_preset:
+ $ref: '#/components/schemas/ClipGuidancePreset'
+ extras:
+ $ref: '#/components/schemas/Extras'
+ image_strength:
+ $ref: '#/components/schemas/InitImageStrength'
+ init_image:
+ $ref: '#/components/schemas/InitImage'
+ init_image_mode:
+ $ref: '#/components/schemas/InitImageMode'
+ sampler:
+ $ref: '#/components/schemas/Sampler'
+ samples:
+ $ref: '#/components/schemas/Samples'
+ seed:
+ $ref: '#/components/schemas/Seed'
+ step_schedule_end:
+ $ref: '#/components/schemas/StepScheduleEnd'
+ step_schedule_start:
+ $ref: '#/components/schemas/StepScheduleStart'
+ steps:
+ $ref: '#/components/schemas/Steps'
+ style_preset:
+ $ref: '#/components/schemas/StylePreset'
+ text_prompts:
+ $ref: '#/components/schemas/TextPrompts'
+ required:
+ - text_prompts
+ - init_image
+ type: object
+ ImageToImageUsingImageStrengthRequestBody:
+ allOf:
+ - properties:
+ image_strength:
+ $ref: '#/components/schemas/InitImageStrength'
+ init_image:
+ $ref: '#/components/schemas/InitImage'
+ init_image_mode:
+ $ref: '#/components/schemas/InitImageMode'
+ text_prompts:
+ $ref: '#/components/schemas/TextPrompts'
+ required:
+ - text_prompts
+ - init_image
+ type: object
+ - $ref: '#/components/schemas/GenerationRequestOptionalParams'
+ ImageToImageUsingStepScheduleRequestBody:
+ allOf:
+ - properties:
+ init_image:
+ $ref: '#/components/schemas/InitImage'
+ init_image_mode:
+ $ref: '#/components/schemas/InitImageMode'
+ step_schedule_end:
+ $ref: '#/components/schemas/StepScheduleEnd'
+ step_schedule_start:
+ $ref: '#/components/schemas/StepScheduleStart'
+ text_prompts:
+ $ref: '#/components/schemas/TextPrompts'
+ required:
+ - text_prompts
+ - init_image
+ type: object
+ - $ref: '#/components/schemas/GenerationRequestOptionalParams'
+ InitImage:
+ description: Image used to initialize the diffusion process, in lieu of random
+ noise.
+ example:
+ format: binary
+ type: string
+ x-go-type: '[]byte'
+ InitImageMode:
+ default: IMAGE_STRENGTH
+ description: Whether to use `image_strength` or `step_schedule_*` to control
+ how much influence the `init_image` has on the result.
+ enum:
+ - IMAGE_STRENGTH
+ - STEP_SCHEDULE
+ type: string
+ InitImageStrength:
+ default: 0.35
+ description: |
+ How much influence the `init_image` has on the diffusion process. Values close to `1` will yield images very similar to the `init_image` while values close to `0` will yield images wildly different than the `init_image`. The behavior of this is meant to mirror DreamStudio's "Image Strength" slider.
This parameter is just an alternate way to set `step_schedule_start`, which is done via the calculation `1 - image_strength`. For example, passing in an Image Strength of 35% (`0.35`) would result in a `step_schedule_start` of `0.65`.
+ example: 0.4
+ format: float
+ maximum: 1
+ minimum: 0
+ type: number
+ InputImage:
+ example:
+ format: binary
+ type: string
+ x-go-type: '[]byte'
+ LatentUpscalerUpscaleRequestBody:
+ properties:
+ cfg_scale:
+ $ref: '#/components/schemas/CfgScale'
+ height:
+ $ref: '#/components/schemas/UpscaleImageHeight'
+ image:
+ $ref: '#/components/schemas/InputImage'
+ seed:
+ $ref: '#/components/schemas/Seed'
+ steps:
+ $ref: '#/components/schemas/Steps'
+ text_prompts:
+ $ref: '#/components/schemas/TextPrompts'
+ width:
+ $ref: '#/components/schemas/UpscaleImageWidth'
+ required:
+ - image
+ type: object
+ ListEnginesResponseBody:
+ description: The engines available to your user/organization
+ example:
+ - description: Stability-AI Stable Diffusion v1.6
+ id: stable-diffusion-v1-6
+ name: Stable Diffusion v1.6
+ type: PICTURE
+ - description: Stability-AI Stable Diffusion XL v1.0
+ id: stable-diffusion-xl-1024-v1-0
+ name: Stable Diffusion XL v1.0
+ type: PICTURE
+ items:
+ $ref: '#/components/schemas/Engine'
+ type: array
+ MaskImage:
+ description: Optional grayscale mask that allows for influence over which pixels
+ are eligible for diffusion and at what strength. Must be the same dimensions
+ as the `init_image`. Use the `mask_source` option to specify whether the white
+ or black pixels should be inpainted.
+ example:
+ format: binary
+ type: string
+ x-go-type: '[]byte'
+ MaskSource:
+ description: |-
+ For any given pixel, the mask determines the strength of generation on a linear scale. This parameter determines where to source the mask from:
+ - `MASK_IMAGE_WHITE` will use the white pixels of the mask_image as the mask, where white pixels are completely replaced and black pixels are unchanged
+ - `MASK_IMAGE_BLACK` will use the black pixels of the mask_image as the mask, where black pixels are completely replaced and white pixels are unchanged
+ - `INIT_IMAGE_ALPHA` will use the alpha channel of the init_image as the mask, where fully transparent pixels are completely replaced and fully opaque pixels are unchanged
+ type: string
+ MaskingRequestBody:
+ discriminator:
+ mapping:
+ INIT_IMAGE_ALPHA: '#/components/schemas/MaskingUsingInitImageAlphaRequestBody'
+ MASK_IMAGE_BLACK: '#/components/schemas/MaskingUsingMaskImageRequestBody'
+ MASK_IMAGE_WHITE: '#/components/schemas/MaskingUsingMaskImageRequestBody'
+ propertyName: mask_source
+ properties:
+ cfg_scale:
+ $ref: '#/components/schemas/CfgScale'
+ clip_guidance_preset:
+ $ref: '#/components/schemas/ClipGuidancePreset'
+ extras:
+ $ref: '#/components/schemas/Extras'
+ init_image:
+ $ref: '#/components/schemas/InitImage'
+ mask_image:
+ $ref: '#/components/schemas/MaskImage'
+ mask_source:
+ $ref: '#/components/schemas/MaskSource'
+ sampler:
+ $ref: '#/components/schemas/Sampler'
+ samples:
+ $ref: '#/components/schemas/Samples'
+ seed:
+ $ref: '#/components/schemas/Seed'
+ steps:
+ $ref: '#/components/schemas/Steps'
+ style_preset:
+ $ref: '#/components/schemas/StylePreset'
+ text_prompts:
+ $ref: '#/components/schemas/TextPrompts'
+ required:
+ - text_prompts
+ - init_image
+ - mask_source
+ type: object
+ MaskingUsingInitImageAlphaRequestBody:
+ allOf:
+ - properties:
+ init_image:
+ $ref: '#/components/schemas/InitImage'
+ mask_source:
+ $ref: '#/components/schemas/MaskSource'
+ text_prompts:
+ $ref: '#/components/schemas/TextPrompts'
+ required:
+ - init_image
+ - text_prompts
+ - mask_source
+ type: object
+ - $ref: '#/components/schemas/GenerationRequestOptionalParams'
+ MaskingUsingMaskImageRequestBody:
+ allOf:
+ - properties:
+ init_image:
+ $ref: '#/components/schemas/InitImage'
+ mask_image:
+ $ref: '#/components/schemas/MaskImage'
+ mask_source:
+ $ref: '#/components/schemas/MaskSource'
+ text_prompts:
+ $ref: '#/components/schemas/TextPrompts'
+ required:
+ - init_image
+ - mask_image
+ - text_prompts
+ - mask_source
+ type: object
+ - $ref: '#/components/schemas/GenerationRequestOptionalParams'
+ OrganizationMembership:
+ properties:
+ id:
+ example: org-123456
+ type: string
+ x-go-name: ID
+ is_default:
+ example: false
+ type: boolean
+ name:
+ example: My Organization
+ type: string
+ role:
+ example: MEMBER
+ type: string
+ required:
+ - id
+ - name
+ - role
+ - is_default
+ type: object
+ RealESRGANUpscaleRequestBody:
+ properties:
+ height:
+ $ref: '#/components/schemas/UpscaleImageHeight'
+ image:
+ $ref: '#/components/schemas/InputImage'
+ width:
+ $ref: '#/components/schemas/UpscaleImageWidth'
+ required:
+ - image
+ type: object
+ Sampler:
+ description: Which sampler to use for the diffusion process. If this value is
+ omitted we'll automatically select an appropriate sampler for you.
+ enum:
+ - DDIM
+ - DDPM
+ - K_DPMPP_2M
+ - K_DPMPP_2S_ANCESTRAL
+ - K_DPM_2
+ - K_DPM_2_ANCESTRAL
+ - K_EULER
+ - K_EULER_ANCESTRAL
+ - K_HEUN
+ - K_LMS
+ example: K_DPM_2_ANCESTRAL
+ type: string
+ Samples:
+ default: 1
+ description: Number of images to generate
+ example: 1
+ maximum: 10
+ minimum: 1
+ type: integer
+ x-go-type: uint64
+ Seed:
+ default: 0
+ description: Random noise seed (omit this option or use `0` for a random seed)
+ example: 0
+ maximum: 4294967295
+ minimum: 0
+ type: integer
+ x-go-type: uint32
+ StepScheduleEnd:
+ description: Skips a proportion of the end of the diffusion steps, allowing
+ the init_image to influence the final generated image. Lower values will
+ result in more influence from the init_image, while higher values will result
+ in more influence from the diffusion steps.
+ example: 0.01
+ maximum: 1
+ minimum: 0
+ type: number
+ StepScheduleStart:
+ default: 0.65
+ description: Skips a proportion of the start of the diffusion steps, allowing
+ the init_image to influence the final generated image. Lower values will
+ result in more influence from the init_image, while higher values will result
+ in more influence from the diffusion steps. (e.g. a value of `0` would simply
+ return you the init_image, where a value of `1` would return you a completely
+ different image.)
+ example: 0.4
+ maximum: 1
+ minimum: 0
+ type: number
+ Steps:
+ default: 30
+ description: Number of diffusion steps to run.
+ example: 50
+ maximum: 50
+ minimum: 10
+ type: integer
+ x-go-type: uint64
+ StylePreset:
+ description: |-
+ Pass in a style preset to guide the image model towards a particular style.
+ This list of style presets is subject to change.
+ enum:
+ - enhance
+ - anime
+ - photographic
+ - digital-art
+ - comic-book
+ - fantasy-art
+ - line-art
+ - analog-film
+ - neon-punk
+ - isometric
+ - low-poly
+ - origami
+ - modeling-compound
+ - cinematic
+ - 3d-model
+ - pixel-art
+ - tile-texture
+ type: string
+ TextPrompt:
+ description: Text prompt for image generation
+ properties:
+ text:
+ description: The prompt itself
+ example: A lighthouse on a cliff
+ maxLength: 2000
+ type: string
+ weight:
+ description: Weight of the prompt (use negative numbers for negative prompts)
+ example: 0.8167237
+ format: float
+ type: number
+ required:
+ - text
+ type: object
+ TextPrompts:
+ description: "An array of text prompts to use for generation.\n\nDue to how\
+ \ arrays are represented in `multipart/form-data` requests, prompts must adhere\
+ \ to the format `text_prompts[index][text|weight]`,\nwhere `index` is some\
+ \ integer used to tie the text and weight together. While `index` does not\
+ \ have to be sequential, duplicate entries \nwill override previous entries,\
+ \ so it is recommended to use sequential indices.\n\nGiven a text prompt with\
+ \ the text `A lighthouse on a cliff` and a weight of `0.5`, it would be represented\
+ \ as:\n```\ntext_prompts[0][text]: \"A lighthouse on a cliff\"\ntext_prompts[0][weight]:\
+ \ 0.5\n```\n\nTo add another prompt to that request simply provide the values\
+ \ under a new `index`:\n\n```\ntext_prompts[0][text]: \"A lighthouse on a\
+ \ cliff\"\ntext_prompts[0][weight]: 0.5\ntext_prompts[1][text]: \"land, ground,\
+ \ dirt, grass\"\ntext_prompts[1][weight]: -0.9\n```"
+ items:
+ $ref: '#/components/schemas/TextPrompt'
+ minItems: 1
+ type: array
+ TextPromptsForTextToImage:
+ description: |-
+ An array of text prompts to use for generation.
+
+ Given a text prompt with the text `A lighthouse on a cliff` and a weight of `0.5`, it would be represented as:
+
+ ```
+ "text_prompts": [
+ {
+ "text": "A lighthouse on a cliff",
+ "weight": 0.5
+ }
+ ]
+ ```
+ items:
+ $ref: '#/components/schemas/TextPrompt'
+ minItems: 1
+ title: TextPrompts
+ type: array
+ TextToImageRequestBody:
+ allOf:
+ - properties:
+ height:
+ $ref: '#/components/schemas/DiffuseImageHeight'
+ text_prompts:
+ $ref: '#/components/schemas/TextPromptsForTextToImage'
+ width:
+ $ref: '#/components/schemas/DiffuseImageWidth'
+ required:
+ - text_prompts
+ type: object
+ - $ref: '#/components/schemas/GenerationRequestOptionalParams'
+ example:
+ cfg_scale: 7
+ clip_guidance_preset: FAST_BLUE
+ height: 512
+ sampler: K_DPM_2_ANCESTRAL
+ samples: 1
+ seed: 0
+ steps: 30
+ text_prompts:
+ - text: A lighthouse on a cliff
+ weight: 1
+ width: 512
+ required:
+ - text_prompts
+ type: object
+ UpscaleImageHeight:
+ description: Desired height of the output image. Only one of `width` or `height`
+ may be specified.
+ minimum: 512
+ type: integer
+ x-go-type: uint64
+ UpscaleImageWidth:
+ description: Desired width of the output image. Only one of `width` or `height`
+ may be specified.
+ minimum: 512
+ type: integer
+ x-go-type: uint64
+ securitySchemes:
+ STABILITY_API_KEY:
+ in: header
+ name: Authorization
+ type: apiKey
+info:
+ description: "Welcome to the official Stability AI REST API!\n\n#### Authentication\n\
+ \nYou will need your Stability\
+ \ API key in order to make requests to this API.\nMake sure you never share\
+ \ your API key with anyone, and you never commit it to a public repository. Include\
+ \ this key in \nthe `Authorization` header of your requests.\n\n#### Rate limiting\n\
+ \nThis API is rate-limited to 150 requests every 10 seconds. If you exceed this\
+ \ limit, you will receive a `429` response.\nIf you find this limit too restrictive,\
+ \ please reach out to us via email at [platform@stability.ai](mailto:platform@stability.ai).\n\
+ \n#### Support\n\nCheck our Status\
+ \ Page to view the current health of our REST/gRPC APIs.\n\nIf you run into\
+ \ issues, please reach out to us:\n - Support Form\n - [platform@stability.ai](mailto:platform@stability.ai) \n\
+ \ - Discord\n"
+ termsOfService: https://platform.stability.ai/docs/terms-of-service
+ title: Stability.ai REST API
+ version: v1
+ x-logo:
+ altText: Stability.ai REST API
+ url: /docs/StabilityLogo.png
+openapi: 3.0.3
+paths:
+ /v1/engines/list:
+ get:
+ description: List all engines available to your organization/user
+ operationId: listEngines
+ parameters:
+ - $ref: '#/components/parameters/organization'
+ - $ref: '#/components/parameters/stabilityClientID'
+ - $ref: '#/components/parameters/stabilityClientVersion'
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ListEnginesResponseBody'
+ description: OK response.
+ '401':
+ $ref: '#/components/responses/401'
+ '500':
+ $ref: '#/components/responses/500'
+ security:
+ - STABILITY_API_KEY: []
+ summary: list
+ tags:
+ - v1/engines
+ x-codeSamples:
+ - lang: Python
+ source: |+
+ import os
+ import requests
+
+ api_host = os.getenv('API_HOST', 'https://api.stability.ai')
+ url = f"{api_host}/v1/engines/list"
+
+ api_key = os.getenv("STABILITY_API_KEY")
+ if api_key is None:
+ raise Exception("Missing Stability API key.")
+
+ response = requests.get(url, headers={
+ "Authorization": f"Bearer {api_key}"
+ })
+
+ if response.status_code != 200:
+ raise Exception("Non-200 response: " + str(response.text))
+
+ # Do something with the payload...
+ payload = response.json()
+
+ - label: TypeScript
+ lang: Javascript
+ source: |
+ import fetch from 'node-fetch'
+
+ const apiHost = process.env.API_HOST ?? 'https://api.stability.ai'
+ const url = `${apiHost}/v1/engines/list`
+
+ const apiKey = process.env.STABILITY_API_KEY
+ if (!apiKey) throw new Error('Missing Stability API key.')
+
+ const response = await fetch(url, {
+ method: 'GET',
+ headers: {
+ Authorization: `Bearer ${apiKey}`,
+ },
+ })
+
+ if (!response.ok) {
+ throw new Error(`Non-200 response: ${await response.text()}`)
+ }
+
+ interface Payload {
+ engines: Array<{
+ id: string
+ name: string
+ description: string
+ type: string
+ }>
+ }
+
+ // Do something with the payload...
+ const payload = (await response.json()) as Payload
+ - lang: Go
+ source: "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\
+ \nfunc main() {\n\t// Build REST endpoint URL\n\tapiHost, hasApiHost :=\
+ \ os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\
+ \n\t}\n\treqUrl := apiHost + \"/v1/engines/list\"\n\n\t// Acquire an API\
+ \ key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\"\
+ )\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment\
+ \ variable\")\n\t}\n\n\t// Execute the request & read all the bytes of the\
+ \ response\n\treq, _ := http.NewRequest(\"GET\", reqUrl, nil)\n\treq.Header.Add(\"\
+ Authorization\", \"Bearer \"+apiKey)\n\tres, _ := http.DefaultClient.Do(req)\n\
+ \tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tif res.StatusCode\
+ \ != 200 {\n\t\tpanic(\"Non-200 response: \" + string(body))\n\t}\n\n\t\
+ // Do something with the payload...\n\t// payload := string(body)\n}\n"
+ - lang: cURL
+ source: |
+ if [ -z "$STABILITY_API_KEY" ]; then
+ echo "STABILITY_API_KEY environment variable is not set"
+ exit 1
+ fi
+
+ BASE_URL=${API_HOST:-https://api.stability.ai}
+ URL="$BASE_URL/v1/engines/list"
+
+ curl -f -sS "$URL" \
+ -H 'Accept: application/json' \
+ -H "Authorization: Bearer $STABILITY_API_KEY"
+ /v1/generation/{engine_id}/image-to-image:
+ post:
+ description: Modify an image based on a text prompt
+ operationId: imageToImage
+ parameters:
+ - $ref: '#/components/parameters/engineID'
+ - $ref: '#/components/parameters/accept'
+ - $ref: '#/components/parameters/organization'
+ - $ref: '#/components/parameters/stabilityClientID'
+ - $ref: '#/components/parameters/stabilityClientVersion'
+ requestBody:
+ content:
+ multipart/form-data:
+ examples:
+ IMAGE_STRENGTH:
+ description: Request using 35% image_strength
+ summary: Using IMAGE_STRENGTH
+ value:
+ cfg_scale: 7
+ clip_guidance_preset: FAST_BLUE
+ image_strength: 0.35
+ init_image:
+ init_image_mode: IMAGE_STRENGTH
+ sampler: K_DPM_2_ANCESTRAL
+ samples: 3
+ steps: 30
+ text_prompts[0][text]: A dog space commander
+ text_prompts[0][weight]: 1
+ STEP_SCHEDULE:
+ description: Equivalent request using step_schedule_start
+ summary: Using STEP_SCHEDULE
+ value:
+ cfg_scale: 7
+ clip_guidance_preset: FAST_BLUE
+ init_image:
+ init_image_mode: STEP_SCHEDULE
+ sampler: K_DPM_2_ANCESTRAL
+ samples: 3
+ step_schedule_start: 0.65
+ steps: 30
+ text_prompts[0][text]: A dog space commander
+ text_prompts[0][weight]: 1
+ schema:
+ $ref: '#/components/schemas/ImageToImageRequestBody'
+ required: true
+ responses:
+ '200':
+ $ref: '#/components/responses/GenerationResponse'
+ '400':
+ $ref: '#/components/responses/400FromGeneration'
+ '401':
+ $ref: '#/components/responses/401'
+ '403':
+ $ref: '#/components/responses/403'
+ '404':
+ $ref: '#/components/responses/404'
+ '500':
+ $ref: '#/components/responses/500'
+ security:
+ - STABILITY_API_KEY: []
+ summary: image-to-image
+ tags:
+ - v1/generation
+ x-codeSamples:
+ - lang: Python
+ source: |
+ import base64
+ import os
+ import requests
+
+ engine_id = "stable-diffusion-xl-1024-v1-0"
+ api_host = os.getenv("API_HOST", "https://api.stability.ai")
+ api_key = os.getenv("STABILITY_API_KEY")
+
+ if api_key is None:
+ raise Exception("Missing Stability API key.")
+
+ response = requests.post(
+ f"{api_host}/v1/generation/{engine_id}/image-to-image",
+ headers={
+ "Accept": "application/json",
+ "Authorization": f"Bearer {api_key}"
+ },
+ files={
+ "init_image": open("../init_image_1024.png", "rb")
+ },
+ data={
+ "image_strength": 0.35,
+ "init_image_mode": "IMAGE_STRENGTH",
+ "text_prompts[0][text]": "Galactic dog with a cape",
+ "cfg_scale": 7,
+ "samples": 1,
+ "steps": 30,
+ }
+ )
+
+ if response.status_code != 200:
+ raise Exception("Non-200 response: " + str(response.text))
+
+ data = response.json()
+
+ for i, image in enumerate(data["artifacts"]):
+ with open(f"./out/v1_img2img_{i}.png", "wb") as f:
+ f.write(base64.b64decode(image["base64"]))
+ - label: TypeScript
+ lang: Javascript
+ source: |
+ import fetch from 'node-fetch'
+ import FormData from 'form-data'
+ import fs from 'node:fs'
+
+ const engineId = 'stable-diffusion-xl-1024-v1-0'
+ const apiHost = process.env.API_HOST ?? 'https://api.stability.ai'
+ const apiKey = process.env.STABILITY_API_KEY
+
+ if (!apiKey) throw new Error('Missing Stability API key.')
+
+ // NOTE: This example is using a NodeJS FormData library.
+ // Browsers should use their native FormData class.
+ // React Native apps should also use their native FormData class.
+ const formData = new FormData()
+ formData.append('init_image', fs.readFileSync('../init_image_1024.png'))
+ formData.append('init_image_mode', 'IMAGE_STRENGTH')
+ formData.append('image_strength', 0.35)
+ formData.append('text_prompts[0][text]', 'Galactic dog wearing a cape')
+ formData.append('cfg_scale', 7)
+ formData.append('samples', 1)
+ formData.append('steps', 30)
+
+ const response = await fetch(
+ `${apiHost}/v1/generation/${engineId}/image-to-image`,
+ {
+ method: 'POST',
+ headers: {
+ ...formData.getHeaders(),
+ Accept: 'application/json',
+ Authorization: `Bearer ${apiKey}`,
+ },
+ body: formData,
+ }
+ )
+
+ if (!response.ok) {
+ throw new Error(`Non-200 response: ${await response.text()}`)
+ }
+
+ interface GenerationResponse {
+ artifacts: Array<{
+ base64: string
+ seed: number
+ finishReason: string
+ }>
+ }
+
+ const responseJSON = (await response.json()) as GenerationResponse
+
+ responseJSON.artifacts.forEach((image, index) => {
+ fs.writeFileSync(
+ `out/v1_img2img_${index}.png`,
+ Buffer.from(image.base64, 'base64')
+ )
+ })
+ - lang: Go
+ source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"\
+ encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\
+ \n\t\"os\"\n)\n\ntype ImageToImageImage struct {\n\tBase64 string\
+ \ `json:\"base64\"`\n\tSeed uint32 `json:\"seed\"`\n\tFinishReason\
+ \ string `json:\"finishReason\"`\n}\n\ntype ImageToImageResponse struct\
+ \ {\n\tImages []ImageToImageImage `json:\"artifacts\"`\n}\n\nfunc main()\
+ \ {\n\tengineId := \"stable-diffusion-xl-1024-v1-0\"\n\n\t// Build REST\
+ \ endpoint URL\n\tapiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\t\
+ if !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl\
+ \ := apiHost + \"/v1/generation/\" + engineId + \"/image-to-image\"\n\n\t\
+ // Acquire an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"\
+ STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY\
+ \ environment variable\")\n\t}\n\n\tdata := &bytes.Buffer{}\n\twriter :=\
+ \ multipart.NewWriter(data)\n\n\t// Write the init image to the request\n\
+ \tinitImageWriter, _ := writer.CreateFormField(\"init_image\")\n\tinitImageFile,\
+ \ initImageErr := os.Open(\"../init_image_1024.png\")\n\tif initImageErr\
+ \ != nil {\n\t\tpanic(\"Could not open init_image.png\")\n\t}\n\t_, _ =\
+ \ io.Copy(initImageWriter, initImageFile)\n\n\t// Write the options to the\
+ \ request\n\t_ = writer.WriteField(\"init_image_mode\", \"IMAGE_STRENGTH\"\
+ )\n\t_ = writer.WriteField(\"image_strength\", \"0.35\")\n\t_ = writer.WriteField(\"\
+ text_prompts[0][text]\", \"Galactic dog with a cape\")\n\t_ = writer.WriteField(\"\
+ cfg_scale\", \"7\")\n\t_ = writer.WriteField(\"samples\", \"1\")\n\t_ =\
+ \ writer.WriteField(\"steps\", \"30\")\n\twriter.Close()\n\n\t// Execute\
+ \ the request\n\tpayload := bytes.NewReader(data.Bytes())\n\treq, _ := http.NewRequest(\"\
+ POST\", reqUrl, payload)\n\treq.Header.Add(\"Content-Type\", writer.FormDataContentType())\n\
+ \treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"\
+ Authorization\", \"Bearer \"+apiKey)\n\tres, _ := http.DefaultClient.Do(req)\n\
+ \tdefer res.Body.Close()\n\n\tif res.StatusCode != 200 {\n\t\tvar body map[string]interface{}\n\
+ \t\tif err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\t\
+ \tpanic(err)\n\t\t}\n\t\tpanic(fmt.Sprintf(\"Non-200 response: %s\", body))\n\
+ \t}\n\n\t// Decode the JSON body\n\tvar body ImageToImageResponse\n\tif\
+ \ err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\tpanic(err)\n\
+ \t}\n\n\t// Write the images to disk\n\tfor i, image := range body.Images\
+ \ {\n\t\toutFile := fmt.Sprintf(\"./out/v1_img2img_%d.png\", i)\n\t\tfile,\
+ \ err := os.Create(outFile)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t\
+ }\n\n\t\timageBytes, err := base64.StdEncoding.DecodeString(image.Base64)\n\
+ \t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif _, err := file.Write(imageBytes);\
+ \ err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif err := file.Close(); err\
+ \ != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n"
+ - lang: cURL
+ source: |
+ if [ -z "$STABILITY_API_KEY" ]; then
+ echo "STABILITY_API_KEY environment variable is not set"
+ exit 1
+ fi
+
+ OUTPUT_FILE=./out/v1_img2img.png
+ BASE_URL=${API_HOST:-https://api.stability.ai}
+ URL="$BASE_URL/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image"
+
+ curl -f -sS -X POST "$URL" \
+ -H 'Content-Type: multipart/form-data' \
+ -H 'Accept: image/png' \
+ -H "Authorization: Bearer $STABILITY_API_KEY" \
+ -F 'init_image=@"../init_image_1024.png"' \
+ -F 'init_image_mode=IMAGE_STRENGTH' \
+ -F 'image_strength=0.35' \
+ -F 'text_prompts[0][text]=A galactic dog in space' \
+ -F 'cfg_scale=7' \
+ -F 'samples=1' \
+ -F 'steps=30' \
+ -o "$OUTPUT_FILE"
+ /v1/generation/{engine_id}/image-to-image/masking:
+ post:
+ description: Selectively modify portions of an image using a mask
+ operationId: masking
+ parameters:
+ - example: stable-diffusion-xl-1024-v1-0
+ in: path
+ name: engine_id
+ required: true
+ schema:
+ type: string
+ - $ref: '#/components/parameters/accept'
+ - $ref: '#/components/parameters/organization'
+ - $ref: '#/components/parameters/stabilityClientID'
+ - $ref: '#/components/parameters/stabilityClientVersion'
+ requestBody:
+ content:
+ multipart/form-data:
+ examples:
+ INIT_IMAGE_ALPHA:
+ value:
+ cfg_scale: 7
+ clip_guidance_preset: FAST_BLUE
+ init_image:
+ mask_source: INIT_IMAGE_ALPHA
+ sampler: K_DPM_2_ANCESTRAL
+ samples: 3
+ steps: 30
+ text_prompts[0][text]: A dog space commander
+ text_prompts[0][weight]: 1
+ MASK_IMAGE_BLACK:
+ value:
+ cfg_scale: 7
+ clip_guidance_preset: FAST_BLUE
+ init_image:
+ mask_image:
+ mask_source: MASK_IMAGE_BLACK
+ sampler: K_DPM_2_ANCESTRAL
+ samples: 3
+ steps: 30
+ text_prompts[0][text]: A dog space commander
+ text_prompts[0][weight]: 1
+ MASK_IMAGE_WHITE:
+ value:
+ cfg_scale: 7
+ clip_guidance_preset: FAST_BLUE
+ init_image:
+ mask_image:
+ mask_source: MASK_IMAGE_WHITE
+ sampler: K_DPM_2_ANCESTRAL
+ samples: 3
+ steps: 30
+ text_prompts[0][text]: A dog space commander
+ text_prompts[0][weight]: 1
+ schema:
+ $ref: '#/components/schemas/MaskingRequestBody'
+ required: true
+ responses:
+ '200':
+ $ref: '#/components/responses/GenerationResponse'
+ '400':
+ $ref: '#/components/responses/400FromGeneration'
+ '401':
+ $ref: '#/components/responses/401'
+ '403':
+ $ref: '#/components/responses/403'
+ '404':
+ $ref: '#/components/responses/404'
+ '500':
+ $ref: '#/components/responses/500'
+ security:
+ - STABILITY_API_KEY: []
+ summary: image-to-image/masking
+ tags:
+ - v1/generation
+ x-codeSamples:
+ - lang: Python
+ source: |
+ import base64
+ import os
+ import requests
+
+ engine_id = "stable-diffusion-xl-1024-v1-0"
+ api_host = os.getenv('API_HOST', 'https://api.stability.ai')
+ api_key = os.getenv("STABILITY_API_KEY")
+
+ if api_key is None:
+ raise Exception("Missing Stability API key.")
+
+ response = requests.post(
+ f"{api_host}/v1/generation/{engine_id}/image-to-image/masking",
+ headers={
+ "Accept": 'application/json',
+ "Authorization": f"Bearer {api_key}"
+ },
+ files={
+ 'init_image': open("../init_image_1024.png", 'rb'),
+ 'mask_image': open("../mask_image_black_1024.png", 'rb'),
+ },
+ data={
+ "mask_source": "MASK_IMAGE_BLACK",
+ "text_prompts[0][text]": "A large spiral galaxy with a bright central bulge and a ring of stars around it",
+ "cfg_scale": 7,
+ "clip_guidance_preset": "FAST_BLUE",
+ "samples": 1,
+ "steps": 30,
+ }
+ )
+
+ if response.status_code != 200:
+ raise Exception("Non-200 response: " + str(response.text))
+
+ data = response.json()
+
+ for i, image in enumerate(data["artifacts"]):
+ with open(f"./out/v1_img2img_masking_{i}.png", "wb") as f:
+ f.write(base64.b64decode(image["base64"]))
+ - label: TypeScript
+ lang: Javascript
+ source: |
+ import fetch from 'node-fetch'
+ import FormData from 'form-data'
+ import fs from 'node:fs'
+
+ const engineId = 'stable-diffusion-xl-1024-v1-0'
+ const apiHost = process.env.API_HOST ?? 'https://api.stability.ai'
+ const apiKey = process.env.STABILITY_API_KEY
+
+ if (!apiKey) throw new Error('Missing Stability API key.')
+
+ // NOTE: This example is using a NodeJS FormData library. Browser
+ // implementations should use their native FormData class. React Native
+ // implementations should also use their native FormData class.
+ const formData = new FormData()
+ formData.append('init_image', fs.readFileSync('../init_image_1024.png'))
+ formData.append('mask_image', fs.readFileSync('../mask_image_black_1024.png'))
+ formData.append('mask_source', 'MASK_IMAGE_BLACK')
+ formData.append(
+ 'text_prompts[0][text]',
+ 'A large spiral galaxy with a bright central bulge and a ring of stars around it'
+ )
+ formData.append('cfg_scale', '7')
+ formData.append('clip_guidance_preset', 'FAST_BLUE')
+ formData.append('samples', 1)
+ formData.append('steps', 30)
+
+ const response = await fetch(
+ `${apiHost}/v1/generation/${engineId}/image-to-image/masking`,
+ {
+ method: 'POST',
+ headers: {
+ ...formData.getHeaders(),
+ Accept: 'application/json',
+ Authorization: `Bearer ${apiKey}`,
+ },
+ body: formData,
+ }
+ )
+
+ if (!response.ok) {
+ throw new Error(`Non-200 response: ${await response.text()}`)
+ }
+
+ interface GenerationResponse {
+ artifacts: Array<{
+ base64: string
+ seed: number
+ finishReason: string
+ }>
+ }
+
+ const responseJSON = (await response.json()) as GenerationResponse
+
+ responseJSON.artifacts.forEach((image, index) => {
+ fs.writeFileSync(
+ `out/v1_img2img_masking_${index}.png`,
+ Buffer.from(image.base64, 'base64')
+ )
+ })
+ - lang: Go
+ source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"\
+ encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\
+ \n\t\"os\"\n)\n\ntype MaskingImage struct {\n\tBase64 string `json:\"\
+ base64\"`\n\tSeed uint32 `json:\"seed\"`\n\tFinishReason string\
+ \ `json:\"finishReason\"`\n}\n\ntype MaskingResponse struct {\n\tImages\
+ \ []MaskingImage `json:\"artifacts\"`\n}\n\nfunc main() {\n\tengineId :=\
+ \ \"stable-diffusion-xl-1024-v1-0\"\n\n\t// Build REST endpoint URL\n\t\
+ apiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\
+ \tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl := apiHost + \"\
+ /v1/generation/\" + engineId + \"/image-to-image/masking\"\n\n\t// Acquire\
+ \ an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"\
+ STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY\
+ \ environment variable\")\n\t}\n\n\tdata := &bytes.Buffer{}\n\twriter :=\
+ \ multipart.NewWriter(data)\n\n\t// Write the init image to the request\n\
+ \tinitImageWriter, _ := writer.CreateFormField(\"init_image\")\n\tinitImageFile,\
+ \ initImageErr := os.Open(\"../init_image_1024.png\")\n\tif initImageErr\
+ \ != nil {\n\t\tpanic(\"Could not open init_image.png\")\n\t}\n\t_, _ =\
+ \ io.Copy(initImageWriter, initImageFile)\n\n\t// Write the mask image to\
+ \ the request\n\tmaskImageWriter, _ := writer.CreateFormField(\"mask_image\"\
+ )\n\tmaskImageFile, maskImageErr := os.Open(\"../mask_image_black_1024.png\"\
+ )\n\tif maskImageErr != nil {\n\t\tpanic(\"Could not open mask_image_white.png\"\
+ )\n\t}\n\t_, _ = io.Copy(maskImageWriter, maskImageFile)\n\n\t// Write the\
+ \ options to the request\n\t_ = writer.WriteField(\"mask_source\", \"MASK_IMAGE_BLACK\"\
+ )\n\t_ = writer.WriteField(\"text_prompts[0][text]\", \"A large spiral galaxy\
+ \ with a bright central bulge and a ring of stars around it\")\n\t_ = writer.WriteField(\"\
+ cfg_scale\", \"7\")\n\t_ = writer.WriteField(\"clip_guidance_preset\", \"\
+ FAST_BLUE\")\n\t_ = writer.WriteField(\"samples\", \"1\")\n\t_ = writer.WriteField(\"\
+ steps\", \"30\")\n\twriter.Close()\n\n\t// Execute the request & read all\
+ \ the bytes of the response\n\tpayload := bytes.NewReader(data.Bytes())\n\
+ \treq, _ := http.NewRequest(\"POST\", reqUrl, payload)\n\treq.Header.Add(\"\
+ Content-Type\", writer.FormDataContentType())\n\treq.Header.Add(\"Accept\"\
+ , \"application/json\")\n\treq.Header.Add(\"Authorization\", \"Bearer \"\
+ +apiKey)\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\
+ \n\tif res.StatusCode != 200 {\n\t\tvar body map[string]interface{}\n\t\t\
+ if err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\t\t\
+ panic(err)\n\t\t}\n\t\tpanic(fmt.Sprintf(\"Non-200 response: %s\", body))\n\
+ \t}\n\n\t// Decode the JSON body\n\tvar body MaskingResponse\n\tif err :=\
+ \ json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\tpanic(err)\n\
+ \t}\n\n\t// Write the images to disk\n\tfor i, image := range body.Images\
+ \ {\n\t\toutFile := fmt.Sprintf(\"./out/v1_img2img_masking_%d.png\", i)\n\
+ \t\tfile, err := os.Create(outFile)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\
+ \t\t}\n\n\t\timageBytes, err := base64.StdEncoding.DecodeString(image.Base64)\n\
+ \t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif _, err := file.Write(imageBytes);\
+ \ err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif err := file.Close(); err\
+ \ != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n"
+ - lang: cURL
+ source: |
+ #!/bin/sh
+
+ set -e
+
+ if [ -z "$STABILITY_API_KEY" ]; then
+ echo "STABILITY_API_KEY environment variable is not set"
+ exit 1
+ fi
+
+ OUTPUT_FILE=./out/v1_img2img_masking.png
+ BASE_URL=${API_HOST:-https://api.stability.ai}
+ URL="$BASE_URL/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking"
+
+ curl -f -sS -X POST "$URL" \
+ -H 'Content-Type: multipart/form-data' \
+ -H 'Accept: image/png' \
+ -H "Authorization: Bearer $STABILITY_API_KEY" \
+ -F 'init_image=@"../init_image_1024.png"' \
+ -F 'mask_image=@"../mask_image_black_1024.png"' \
+ -F 'mask_source=MASK_IMAGE_BLACK' \
+ -F 'text_prompts[0][text]=A large spiral galaxy with a bright central bulge and a ring of stars around it' \
+ -F 'cfg_scale=7' \
+ -F 'clip_guidance_preset=FAST_BLUE' \
+ -F 'samples=1' \
+ -F 'steps=30' \
+ -o "$OUTPUT_FILE"
+ /v1/generation/{engine_id}/image-to-image/upscale:
+ post:
+ description: |
+ Create a higher resolution version of an input image.
+
+ This operation outputs an image with a maximum pixel count of **4,194,304**. This is equivalent to dimensions such as `2048x2048` and `4096x1024`.
+
+ By default, the input image will be upscaled by a factor of 2. For additional control over the output dimensions, a `width` or `height` parameter may be specified.
+
+ For upscaler engines that are ESRGAN-based, refer to the `RealESRGANUpscaleRequestBody` body option below. For upscaler engines that are Stable Diffusion Latent Upscaler-based, refer to the `LatentUpscalerUpscaleRequestBody` body option below.
+
+ For more details on the upscaler engines, refer to the [documentation on the Platform site.](https://platform.stability.ai/docs/features/image-upscaling?tab=python)
+ operationId: upscaleImage
+ parameters:
+ - $ref: '#/components/parameters/upscaleEngineID'
+ - $ref: '#/components/parameters/accept'
+ - $ref: '#/components/parameters/organization'
+ - $ref: '#/components/parameters/stabilityClientID'
+ - $ref: '#/components/parameters/stabilityClientVersion'
+ requestBody:
+ content:
+ multipart/form-data:
+ examples:
+ DESIRED_HEIGHT:
+ description: Upscale input image to desired height with ESRGAN or
+ the Latent Upscaler.
+ value:
+ height: 1024
+ image:
+ DESIRED_WIDTH:
+ description: Upscale input image to desired width with ESRGAN or the
+ Latent Upscaler.
+ value:
+ image:
+ width: 1024
+ ESRGAN:
+ description: Upscale input image by 2x using ESRGAN.
+ value:
+ image:
+ LATENT_UPSCALER:
+ description: Request using the Latent Upscaler. Refer to the LatentUpscalerUpscaleRequestBody
+ for reference.
+ value:
+ cfg_scale: 7
+ image:
+ seed: 5555
+ steps: 30
+ text_prompts[0][text]: A dog space commander
+ text_prompts[0][weight]: 1
+ schema:
+ oneOf:
+ - $ref: '#/components/schemas/RealESRGANUpscaleRequestBody'
+ - $ref: '#/components/schemas/LatentUpscalerUpscaleRequestBody'
+ required: true
+ responses:
+ '200':
+ $ref: '#/components/responses/GenerationResponse'
+ '400':
+ $ref: '#/components/responses/400FromUpscale'
+ '401':
+ $ref: '#/components/responses/401'
+ '403':
+ $ref: '#/components/responses/403'
+ '404':
+ $ref: '#/components/responses/404'
+ '500':
+ $ref: '#/components/responses/500'
+ security:
+ - STABILITY_API_KEY: []
+ summary: image-to-image/upscale
+ tags:
+ - v1/generation
+ x-codeSamples:
+ - lang: Python
+ source: |
+ import os
+ import requests
+
+ engine_id = "esrgan-v1-x2plus"
+ api_host = os.getenv("API_HOST", "https://api.stability.ai")
+ api_key = os.getenv("STABILITY_API_KEY")
+
+ if api_key is None:
+ raise Exception("Missing Stability API key.")
+
+ response = requests.post(
+ f"{api_host}/v1/generation/{engine_id}/image-to-image/upscale",
+ headers={
+ "Accept": "image/png",
+ "Authorization": f"Bearer {api_key}"
+ },
+ files={
+ "image": open("../init_image.png", "rb")
+ },
+ data={
+ "width": 1024,
+ }
+ )
+
+ if response.status_code != 200:
+ raise Exception("Non-200 response: " + str(response.text))
+
+ with open(f"./out/v1_upscaled_image.png", "wb") as f:
+ f.write(response.content)
+ - label: TypeScript
+ lang: Javascript
+ source: |
+ import fetch from 'node-fetch'
+ import FormData from 'form-data'
+ import fs from 'node:fs'
+
+ const engineId = 'esrgan-v1-x2plus'
+ const apiHost = process.env.API_HOST ?? 'https://api.stability.ai'
+ const apiKey = process.env.STABILITY_API_KEY
+
+ if (!apiKey) throw new Error('Missing Stability API key.')
+
+ // NOTE: This example is using a NodeJS FormData library.
+ // Browsers should use their native FormData class.
+ // React Native apps should also use their native FormData class.
+ const formData = new FormData()
+ formData.append('image', fs.readFileSync('../init_image.png'))
+ formData.append('width', 1024)
+
+ const response = await fetch(
+ `${apiHost}/v1/generation/${engineId}/image-to-image/upscale`,
+ {
+ method: 'POST',
+ headers: {
+ ...formData.getHeaders(),
+ Accept: 'image/png',
+ Authorization: `Bearer ${apiKey}`,
+ },
+ body: formData,
+ }
+ )
+
+ if (!response.ok) {
+ throw new Error(`Non-200 response: ${await response.text()}`)
+ }
+
+ const image = await response.arrayBuffer()
+ fs.writeFileSync('./out/v1_upscaled_image.png', Buffer.from(image))
+ - lang: Go
+ source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"\
+ fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc\
+ \ main() {\n\tengineId := \"esrgan-v1-x2plus\"\n\n\t// Build REST endpoint\
+ \ URL\n\tapiHost, hasApiHost := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost\
+ \ {\n\t\tapiHost = \"https://api.stability.ai\"\n\t}\n\treqUrl := apiHost\
+ \ + \"/v1/generation/\" + engineId + \"/image-to-image/upscale\"\n\n\t//\
+ \ Acquire an API key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"\
+ STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY\
+ \ environment variable\")\n\t}\n\n\tdata := &bytes.Buffer{}\n\twriter :=\
+ \ multipart.NewWriter(data)\n\n\t// Write the init image to the request\n\
+ \tinitImageWriter, _ := writer.CreateFormField(\"image\")\n\tinitImageFile,\
+ \ initImageErr := os.Open(\"../init_image.png\")\n\tif initImageErr != nil\
+ \ {\n\t\tpanic(\"Could not open init_image.png\")\n\t}\n\t_, _ = io.Copy(initImageWriter,\
+ \ initImageFile)\n\n\t// Write the options to the request\n\t_ = writer.WriteField(\"\
+ width\", \"1024\")\n\twriter.Close()\n\n\t// Execute the request\n\tpayload\
+ \ := bytes.NewReader(data.Bytes())\n\treq, _ := http.NewRequest(\"POST\"\
+ , reqUrl, payload)\n\treq.Header.Add(\"Content-Type\", writer.FormDataContentType())\n\
+ \treq.Header.Add(\"Accept\", \"image/png\")\n\treq.Header.Add(\"Authorization\"\
+ , \"Bearer \"+apiKey)\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\
+ \n\tif res.StatusCode != 200 {\n\t\tvar body map[string]interface{}\n\t\t\
+ if err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\t\t\
+ panic(err)\n\t\t}\n\t\tpanic(fmt.Sprintf(\"Non-200 response: %s\", body))\n\
+ \t}\n\n\t// Write the response to a file\n\tout, err := os.Create(\"./out/v1_upscaled_image.png\"\
+ )\n\tdefer out.Close()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err\
+ \ = io.Copy(out, res.Body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n"
+ - lang: cURL
+ source: |
+ if [ -z "$STABILITY_API_KEY" ]; then
+ echo "STABILITY_API_KEY environment variable is not set"
+ exit 1
+ fi
+
+ OUTPUT_FILE=./out/v1_upscaled_image.png
+ BASE_URL=${API_HOST:-https://api.stability.ai}
+ URL="$BASE_URL/v1/generation/esrgan-v1-x2plus/image-to-image/upscale"
+
+ curl -f -sS -X POST "$URL" \
+ -H 'Content-Type: multipart/form-data' \
+ -H 'Accept: image/png' \
+ -H "Authorization: Bearer $STABILITY_API_KEY" \
+ -F 'image=@"../init_image.png"' \
+ -F 'width=1024' \
+ -o "$OUTPUT_FILE"
+ /v1/generation/{engine_id}/text-to-image:
+ post:
+ description: Generate a new image from a text prompt
+ operationId: textToImage
+ parameters:
+ - $ref: '#/components/parameters/engineID'
+ - $ref: '#/components/parameters/accept'
+ - $ref: '#/components/parameters/organization'
+ - $ref: '#/components/parameters/stabilityClientID'
+ - $ref: '#/components/parameters/stabilityClientVersion'
+ requestBody:
+ content:
+ application/json:
+ example:
+ cfg_scale: 7
+ clip_guidance_preset: FAST_BLUE
+ height: 512
+ sampler: K_DPM_2_ANCESTRAL
+ samples: 1
+ steps: 30
+ text_prompts:
+ - text: A lighthouse on a cliff
+ weight: 1
+ width: 512
+ schema:
+ $ref: '#/components/schemas/TextToImageRequestBody'
+ required: true
+ responses:
+ '200':
+ $ref: '#/components/responses/GenerationResponse'
+ '400':
+ $ref: '#/components/responses/400FromGeneration'
+ '401':
+ $ref: '#/components/responses/401'
+ '403':
+ $ref: '#/components/responses/403'
+ '404':
+ $ref: '#/components/responses/404'
+ '500':
+ $ref: '#/components/responses/500'
+ security:
+ - STABILITY_API_KEY: []
+ summary: text-to-image
+ tags:
+ - v1/generation
+ x-codeSamples:
+ - lang: Python
+ source: |
+ import base64
+ import os
+ import requests
+
+ engine_id = "stable-diffusion-v1-6"
+ api_host = os.getenv('API_HOST', 'https://api.stability.ai')
+ api_key = os.getenv("STABILITY_API_KEY")
+
+ if api_key is None:
+ raise Exception("Missing Stability API key.")
+
+ response = requests.post(
+ f"{api_host}/v1/generation/{engine_id}/text-to-image",
+ headers={
+ "Content-Type": "application/json",
+ "Accept": "application/json",
+ "Authorization": f"Bearer {api_key}"
+ },
+ json={
+ "text_prompts": [
+ {
+ "text": "A lighthouse on a cliff"
+ }
+ ],
+ "cfg_scale": 7,
+ "height": 1024,
+ "width": 1024,
+ "samples": 1,
+ "steps": 30,
+ },
+ )
+
+ if response.status_code != 200:
+ raise Exception("Non-200 response: " + str(response.text))
+
+ data = response.json()
+
+ for i, image in enumerate(data["artifacts"]):
+ with open(f"./out/v1_txt2img_{i}.png", "wb") as f:
+ f.write(base64.b64decode(image["base64"]))
+ - label: TypeScript
+ lang: Javascript
+ source: |
+ import fetch from 'node-fetch'
+ import fs from 'node:fs'
+
+ const engineId = 'stable-diffusion-v1-6'
+ const apiHost = process.env.API_HOST ?? 'https://api.stability.ai'
+ const apiKey = process.env.STABILITY_API_KEY
+
+ if (!apiKey) throw new Error('Missing Stability API key.')
+
+ const response = await fetch(
+ `${apiHost}/v1/generation/${engineId}/text-to-image`,
+ {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ Accept: 'application/json',
+ Authorization: `Bearer ${apiKey}`,
+ },
+ body: JSON.stringify({
+ text_prompts: [
+ {
+ text: 'A lighthouse on a cliff',
+ },
+ ],
+ cfg_scale: 7,
+ height: 1024,
+ width: 1024,
+ steps: 30,
+ samples: 1,
+ }),
+ }
+ )
+
+ if (!response.ok) {
+ throw new Error(`Non-200 response: ${await response.text()}`)
+ }
+
+ interface GenerationResponse {
+ artifacts: Array<{
+ base64: string
+ seed: number
+ finishReason: string
+ }>
+ }
+
+ const responseJSON = (await response.json()) as GenerationResponse
+
+ responseJSON.artifacts.forEach((image, index) => {
+ fs.writeFileSync(
+ `./out/v1_txt2img_${index}.png`,
+ Buffer.from(image.base64, 'base64')
+ )
+ })
+ - lang: Go
+ source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"\
+ encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\ntype TextToImageImage\
+ \ struct {\n\tBase64 string `json:\"base64\"`\n\tSeed uint32\
+ \ `json:\"seed\"`\n\tFinishReason string `json:\"finishReason\"`\n}\n\n\
+ type TextToImageResponse struct {\n\tImages []TextToImageImage `json:\"\
+ artifacts\"`\n}\n\nfunc main() {\n\t// Build REST endpoint URL w/ specified\
+ \ engine\n\tengineId := \"stable-diffusion-v1-6\"\n\tapiHost, hasApiHost\
+ \ := os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\
+ \n\t}\n\treqUrl := apiHost + \"/v1/generation/\" + engineId + \"/text-to-image\"\
+ \n\n\t// Acquire an API key from the environment\n\tapiKey, hasAPIKey :=\
+ \ os.LookupEnv(\"STABILITY_API_KEY\")\n\tif !hasAPIKey {\n\t\tpanic(\"Missing\
+ \ STABILITY_API_KEY environment variable\")\n\t}\n\n\tvar data = []byte(`{\n\
+ \t\t\"text_prompts\": [\n\t\t {\n\t\t\t\"text\": \"A lighthouse on a cliff\"\
+ \n\t\t }\n\t\t],\n\t\t\"cfg_scale\": 7,\n\t\t\"height\": 1024,\n\t\t\"\
+ width\": 1024,\n\t\t\"samples\": 1,\n\t\t\"steps\": 30\n \t}`)\n\n\treq,\
+ \ _ := http.NewRequest(\"POST\", reqUrl, bytes.NewBuffer(data))\n\treq.Header.Add(\"\
+ Content-Type\", \"application/json\")\n\treq.Header.Add(\"Accept\", \"application/json\"\
+ )\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\n\t// Execute\
+ \ the request & read all the bytes of the body\n\tres, _ := http.DefaultClient.Do(req)\n\
+ \tdefer res.Body.Close()\n\n\tif res.StatusCode != 200 {\n\t\tvar body map[string]interface{}\n\
+ \t\tif err := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\t\
+ \tpanic(err)\n\t\t}\n\t\tpanic(fmt.Sprintf(\"Non-200 response: %s\", body))\n\
+ \t}\n\n\t// Decode the JSON body\n\tvar body TextToImageResponse\n\tif err\
+ \ := json.NewDecoder(res.Body).Decode(&body); err != nil {\n\t\tpanic(err)\n\
+ \t}\n\n\t// Write the images to disk\n\tfor i, image := range body.Images\
+ \ {\n\t\toutFile := fmt.Sprintf(\"./out/v1_txt2img_%d.png\", i)\n\t\tfile,\
+ \ err := os.Create(outFile)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t\
+ }\n\n\t\timageBytes, err := base64.StdEncoding.DecodeString(image.Base64)\n\
+ \t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif _, err := file.Write(imageBytes);\
+ \ err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif err := file.Close(); err\
+ \ != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n"
+ - lang: cURL
+ source: |
+ if [ -z "$STABILITY_API_KEY" ]; then
+ echo "STABILITY_API_KEY environment variable is not set"
+ exit 1
+ fi
+
+ OUTPUT_FILE=./out/v1_txt2img.png
+ BASE_URL=${API_HOST:-https://api.stability.ai}
+ URL="$BASE_URL/v1/generation/stable-diffusion-v1-6/text-to-image"
+
+ curl -f -sS -X POST "$URL" \
+ -H 'Content-Type: application/json' \
+ -H 'Accept: image/png' \
+ -H "Authorization: Bearer $STABILITY_API_KEY" \
+ --data-raw '{
+ "text_prompts": [
+ {
+ "text": "A lighthouse on a cliff"
+ }
+ ],
+ "cfg_scale": 7,
+ "height": 1024,
+ "width": 1024,
+ "samples": 1,
+ "steps": 30
+ }' \
+ -o "$OUTPUT_FILE"
+ /v1/user/account:
+ get:
+ description: Get information about the account associated with the provided
+ API key
+ operationId: userAccount
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/AccountResponseBody'
+ description: OK response.
+ '401':
+ $ref: '#/components/responses/401'
+ '500':
+ $ref: '#/components/responses/500'
+ security:
+ - STABILITY_API_KEY: []
+ summary: account
+ tags:
+ - v1/user
+ x-codeSamples:
+ - lang: Python
+ source: |+
+ import os
+ import requests
+
+ api_host = os.getenv('API_HOST', 'https://api.stability.ai')
+ url = f"{api_host}/v1/user/account"
+
+ api_key = os.getenv("STABILITY_API_KEY")
+ if api_key is None:
+ raise Exception("Missing Stability API key.")
+
+ response = requests.get(url, headers={
+ "Authorization": f"Bearer {api_key}"
+ })
+
+ if response.status_code != 200:
+ raise Exception("Non-200 response: " + str(response.text))
+
+ # Do something with the payload...
+ payload = response.json()
+
+ - label: TypeScript
+ lang: Javascript
+ source: |
+ import fetch from 'node-fetch'
+
+ const apiHost = process.env.API_HOST ?? 'https://api.stability.ai'
+ const url = `${apiHost}/v1/user/account`
+
+ const apiKey = process.env.STABILITY_API_KEY
+ if (!apiKey) throw new Error('Missing Stability API key.')
+
+ const response = await fetch(url, {
+ method: 'GET',
+ headers: {
+ Authorization: `Bearer ${apiKey}`,
+ },
+ })
+
+ if (!response.ok) {
+ throw new Error(`Non-200 response: ${await response.text()}`)
+ }
+
+ interface User {
+ id: string
+ profile_picture: string
+ email: string
+ organizations?: Array<{
+ id: string
+ name: string
+ role: string
+ is_default: boolean
+ }>
+ }
+
+ // Do something with the user...
+ const user = (await response.json()) as User
+ - lang: Go
+ source: "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\
+ \nfunc main() {\n\t// Build REST endpoint URL\n\tapiHost, hasApiHost :=\
+ \ os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\
+ \n\t}\n\treqUrl := apiHost + \"/v1/user/account\"\n\n\t// Acquire an API\
+ \ key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\"\
+ )\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment\
+ \ variable\")\n\t}\n\n\t// Build the request\n\treq, _ := http.NewRequest(\"\
+ GET\", reqUrl, nil)\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\
+ \n\t// Execute the request\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer\
+ \ res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tif res.StatusCode\
+ \ != 200 {\n\t\tpanic(\"Non-200 response: \" + string(body))\n\t}\n\n\t\
+ // Do something with the payload...\n\t// payload := string(body)\n}\n"
+ - lang: cURL
+ source: |
+ if [ -z "$STABILITY_API_KEY" ]; then
+ echo "STABILITY_API_KEY environment variable is not set"
+ exit 1
+ fi
+
+ # Determine the URL to use for the request
+ BASE_URL=${API_HOST:-https://api.stability.ai}
+ URL="$BASE_URL/v1/user/account"
+
+ curl -f -sS "$URL" \
+ -H 'Accept: application/json' \
+ -H "Authorization: Bearer $STABILITY_API_KEY"
+ /v1/user/balance:
+ get:
+ description: Get the credit balance of the account/organization associated with
+ the API key
+ operationId: userBalance
+ parameters:
+ - $ref: '#/components/parameters/organization'
+ - $ref: '#/components/parameters/stabilityClientID'
+ - $ref: '#/components/parameters/stabilityClientVersion'
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ credits: 0.6336833840314097
+ schema:
+ $ref: '#/components/schemas/BalanceResponseBody'
+ description: OK response.
+ '401':
+ $ref: '#/components/responses/401'
+ '500':
+ $ref: '#/components/responses/500'
+ security:
+ - STABILITY_API_KEY: []
+ summary: balance
+ tags:
+ - v1/user
+ x-codeSamples:
+ - lang: Python
+ source: |+
+ import os
+ import requests
+
+ api_host = os.getenv('API_HOST', 'https://api.stability.ai')
+ url = f"{api_host}/v1/user/balance"
+
+ api_key = os.getenv("STABILITY_API_KEY")
+ if api_key is None:
+ raise Exception("Missing Stability API key.")
+
+ response = requests.get(url, headers={
+ "Authorization": f"Bearer {api_key}"
+ })
+
+ if response.status_code != 200:
+ raise Exception("Non-200 response: " + str(response.text))
+
+ # Do something with the payload...
+ payload = response.json()
+
+ - label: TypeScript
+ lang: Javascript
+ source: |
+ import fetch from 'node-fetch'
+
+ const apiHost = process.env.API_HOST ?? 'https://api.stability.ai'
+ const url = `${apiHost}/v1/user/balance`
+
+ const apiKey = process.env.STABILITY_API_KEY
+ if (!apiKey) throw new Error('Missing Stability API key.')
+
+ const response = await fetch(url, {
+ method: 'GET',
+ headers: {
+ Authorization: `Bearer ${apiKey}`,
+ },
+ })
+
+ if (!response.ok) {
+ throw new Error(`Non-200 response: ${await response.text()}`)
+ }
+
+ interface Balance {
+ credits: number
+ }
+
+ // Do something with the balance...
+ const balance = (await response.json()) as Balance
+ - lang: Go
+ source: "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\
+ \nfunc main() {\n\t// Build REST endpoint URL\n\tapiHost, hasApiHost :=\
+ \ os.LookupEnv(\"API_HOST\")\n\tif !hasApiHost {\n\t\tapiHost = \"https://api.stability.ai\"\
+ \n\t}\n\treqUrl := apiHost + \"/v1/user/balance\"\n\n\t// Acquire an API\
+ \ key from the environment\n\tapiKey, hasAPIKey := os.LookupEnv(\"STABILITY_API_KEY\"\
+ )\n\tif !hasAPIKey {\n\t\tpanic(\"Missing STABILITY_API_KEY environment\
+ \ variable\")\n\t}\n\n\t// Build the request\n\treq, _ := http.NewRequest(\"\
+ GET\", reqUrl, nil)\n\treq.Header.Add(\"Authorization\", \"Bearer \"+apiKey)\n\
+ \n\t// Execute the request\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer\
+ \ res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tif res.StatusCode\
+ \ != 200 {\n\t\tpanic(\"Non-200 response: \" + string(body))\n\t}\n\n\t\
+ // Do something with the payload...\n\t// payload := string(body)\n}\n"
+ - lang: cURL
+ source: |
+ if [ -z "$STABILITY_API_KEY" ]; then
+ echo "STABILITY_API_KEY environment variable is not set"
+ exit 1
+ fi
+
+ # Determine the URL to use for the request
+ BASE_URL=${API_HOST:-https://api.stability.ai}
+ URL="$BASE_URL/v1/user/balance"
+
+ curl -f -sS "$URL" \
+ -H 'Content-Type: application/json' \
+ -H "Authorization: Bearer $STABILITY_API_KEY"
+servers:
+- url: https://api.stability.ai
+tags:
+- description: Manage your Stability.ai account, and view account/organization balances
+ name: v1/user
+- description: Enumerate available engines
+ name: v1/engines
+- description: Generate images from text, existing images, or both
+ name: v1/generation
diff --git a/pkg/component/ai/stabilityai/v0/config/tasks.json b/pkg/component/ai/stabilityai/v0/config/tasks.json
deleted file mode 100644
index db34d5621..000000000
--- a/pkg/component/ai/stabilityai/v0/config/tasks.json
+++ /dev/null
@@ -1,534 +0,0 @@
-{
- "TASK_IMAGE_TO_IMAGE": {
- "shortDescription": "Modify an image based on a text prompt.",
- "input": {
- "additionalProperties": false,
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "cfg-scale": {
- "default": 7,
- "description": "How strictly the diffusion process adheres to the prompt text (higher values keep your image closer to your prompt)",
- "example": 7,
- "maximum": 35,
- "minimum": 0,
- "format": "number",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 6,
- "title": "Cfg Scale"
- },
- "clip-guidance-preset": {
- "default": "NONE",
- "enum": [
- "FAST_BLUE",
- "FAST_GREEN",
- "NONE",
- "SIMPLE",
- "SLOW",
- "SLOWER",
- "SLOWEST"
- ],
- "example": "FAST_BLUE",
- "format": "string",
- "description": "Clip guidance preset.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Clip Guidance Preset"
- },
- "engine": {
- "default": "stable-diffusion-xl-1024-v1-0",
- "description": "Stability AI Engine (model) to be used.",
- "enum": [
- "stable-diffusion-xl-1024-v1-0",
- "stable-diffusion-xl-1024-v0-9",
- "stable-diffusion-v1-6",
- "esrgan-v1-x2plus",
- "stable-diffusion-512-v2-1",
- "stable-diffusion-xl-beta-v2-2-2"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Engine",
- "format": "string"
- },
- "image-strength": {
- "default": 0.35,
- "description": "How much influence the `init_image` has on the diffusion process. Values close to `1` will yield images very similar to the `init_image` while values close to `0` will yield images wildly different than the `init_image`. The behavior of this is meant to mirror DreamStudio's \"Image Strength\" slider.
This parameter is just an alternate way to set `step_schedule_start`, which is done via the calculation `1 - image_strength`. For example, passing in an Image Strength of 35% (`0.35`) would result in a `step_schedule_start` of `0.65`.\n",
- "example": 0.4,
- "maximum": 1,
- "minimum": 0,
- "format": "number",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "How much influence the `init-image` has on the diffusion process.",
- "uiOrder": 5,
- "title": "Image Strength"
- },
- "init-image": {
- "description": "Image used to initialize the diffusion process, in lieu of random noise.",
- "format": "image",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 2,
- "title": "Init Image"
- },
- "init-image-mode": {
- "default": "IMAGE_STRENGTH",
- "description": "Whether to use `image_strength` or `step_schedule_*` to control how much influence the `init_image` has on the result.",
- "enum": [
- "IMAGE_STRENGTH",
- "STEP_SCHEDULE"
- ],
- "format": "string",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 7,
- "title": "Init Image Mode"
- },
- "prompts": {
- "description": "An array of prompts to use for generation.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "The prompt itself",
- "example": "A lighthouse on a cliff",
- "maxLength": 2000,
- "format": "string"
- },
- "minItems": 1,
- "title": "Prompts",
- "format": "array"
- },
- "sampler": {
- "description": "Which sampler to use for the diffusion process. If this value is omitted we'll automatically select an appropriate sampler for you.",
- "enum": [
- "DDIM",
- "DDPM",
- "K_DPMPP_2M",
- "K_DPMPP_2S_ANCESTRAL",
- "K_DPM_2",
- "K_DPM_2_ANCESTRAL",
- "K_EULER",
- "K_EULER_ANCESTRAL",
- "K_HEUN",
- "K_LMS"
- ],
- "example": "K_DPM_2_ANCESTRAL",
- "format": "string",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Which sampler to use for the diffusion process",
- "uiOrder": 8,
- "title": "Sampler"
- },
- "samples": {
- "default": 1,
- "description": "Number of images to generate",
- "example": 1,
- "maximum": 10,
- "minimum": 1,
- "format": "integer",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 9,
- "title": "Samples"
- },
- "seed": {
- "default": 0,
- "description": "Random noise seed (omit this option or use `0` for a random seed)",
- "example": 0,
- "maximum": 4294967295,
- "minimum": 0,
- "format": "integer",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 10,
- "title": "Seed"
- },
- "step-schedule-end": {
- "description": "Skips a proportion of the end of the diffusion steps, allowing the init_image to influence the final generated image. Lower values will result in more influence from the init_image, while higher values will result in more influence from the diffusion steps.",
- "example": 0.01,
- "maximum": 1,
- "minimum": 0,
- "format": "number",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "Skips a proportion of the end of the diffusion steps",
- "uiOrder": 12,
- "title": "Step Schedule End"
- },
- "step-schedule-start": {
- "default": 0.65,
- "description": "Skips a proportion of the start of the diffusion steps, allowing the init_image to influence the final generated image. Lower values will result in more influence from the init_image, while higher values will result in more influence from the diffusion steps. (e.g. a value of `0` would simply return you the init_image, where a value of `1` would return you a completely different image.)",
- "example": 0.4,
- "maximum": 1,
- "minimum": 0,
- "format": "number",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "shortDescription": "Skips a proportion of the start of the diffusion steps",
- "uiOrder": 11,
- "title": "Step Schedule Start"
- },
- "steps": {
- "default": 30,
- "description": "Number of diffusion steps to run.",
- "example": 50,
- "maximum": 50,
- "minimum": 10,
- "format": "integer",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 13,
- "title": "Steps"
- },
- "style-preset": {
- "description": "Pass in a style preset to guide the image model towards a particular style.\nThis list of style presets is subject to change.",
- "enum": [
- "enhance",
- "anime",
- "photographic",
- "digital-art",
- "comic-book",
- "fantasy-art",
- "line-art",
- "analog-film",
- "neon-punk",
- "isometric",
- "low-poly",
- "origami",
- "modeling-compound",
- "cinematic",
- "3d-model",
- "pixel-art",
- "tile-texture"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 14,
- "title": "Style Preset"
- },
- "weights": {
- "description": "An array of weights to use for generation. If unspecified, the model will automatically assign a default weight of 1.0 to each prompt.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 2,
- "items": {
- "description": "Weight of the prompt (use negative numbers for negative prompts)",
- "example": 0.8167237,
- "acceptFormats": [
- "number",
- "integer"
- ]
- },
- "minItems": 1,
- "title": "Weights",
- "format": "array"
- }
- },
- "required": [
- "prompts",
- "engine"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "$ref": "#/TASK_TEXT_TO_IMAGE/output"
- }
- },
- "TASK_TEXT_TO_IMAGE": {
- "shortDescription": "Generate a new image from a text prompt.",
- "input": {
- "additionalProperties": false,
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "cfg-scale": {
- "default": 7,
- "description": "How strictly the diffusion process adheres to the prompt text (higher values keep your image closer to your prompt)",
- "example": 7,
- "maximum": 35,
- "minimum": 0,
- "format": "number",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 3,
- "title": "CFG Scale"
- },
- "clip-guidance-preset": {
- "default": "NONE",
- "enum": [
- "FAST_BLUE",
- "FAST_GREEN",
- "NONE",
- "SIMPLE",
- "SLOW",
- "SLOWER",
- "SLOWEST"
- ],
- "example": "FAST_BLUE",
- "format": "string",
- "description": "Clip guidance preset.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Clip Guidance Preset"
- },
- "engine": {
- "default": "stable-diffusion-xl-1024-v1-0",
- "description": "Stability AI Engine (model) to be used.",
- "enum": [
- "stable-diffusion-xl-1024-v1-0",
- "stable-diffusion-xl-1024-v0-9",
- "stable-diffusion-v1-6",
- "esrgan-v1-x2plus",
- "stable-diffusion-512-v2-1",
- "stable-diffusion-xl-beta-v2-2-2"
- ],
- "instillCredentialMap": {
- "values": [
- "stable-diffusion-xl-1024-v1-0",
- "stable-diffusion-v1-6"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Engine",
- "format": "string"
- },
- "height": {
- "default": 1024,
- "description": "Height of the image to generate, in pixels, in an increment divible by 64.\n\nEngine-specific dimension validation:\n- SDXL Beta: must be between 128x128 and 512x896 (or 896x512); only one dimension can be greater than 512. \n- SDXL v0.9: must be one of 1024x1024, 1152x896, 1216x832, 1344x768, 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152\n- SDXL v1.0: same as SDXL v0.9\n- SD v1.6: must be between 320x320 and 1536x1536",
- "example": 1024,
- "minimum": 128,
- "multipleOf": 64,
- "format": "integer",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Height"
- },
- "prompts": {
- "description": "An array of prompts to use for generation.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "The prompt itself",
- "example": "A lighthouse on a cliff",
- "maxLength": 2000,
- "acceptFormats": [
- "string"
- ]
- },
- "minItems": 1,
- "title": "Prompts",
- "format": "array"
- },
- "sampler": {
- "description": "Which sampler to use for the diffusion process. If this value is omitted we'll automatically select an appropriate sampler for you.",
- "enum": [
- "DDIM",
- "DDPM",
- "K_DPMPP_2M",
- "K_DPMPP_2S_ANCESTRAL",
- "K_DPM_2",
- "K_DPM_2_ANCESTRAL",
- "K_EULER",
- "K_EULER_ANCESTRAL",
- "K_HEUN",
- "K_LMS"
- ],
- "example": "K_DPM_2_ANCESTRAL",
- "format": "string",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 6,
- "title": "Sampler"
- },
- "samples": {
- "default": 1,
- "description": "Number of images to generate",
- "example": 1,
- "maximum": 10,
- "minimum": 1,
- "format": "integer",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 7,
- "title": "Samples"
- },
- "seed": {
- "default": 0,
- "description": "Random noise seed (omit this option or use `0` for a random seed)",
- "example": 0,
- "maximum": 4294967295,
- "minimum": 0,
- "format": "integer",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 8,
- "title": "Seed"
- },
- "steps": {
- "default": 30,
- "description": "Number of diffusion steps to run.",
- "example": 50,
- "maximum": 50,
- "minimum": 10,
- "format": "integer",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 9,
- "title": "Steps"
- },
- "style-preset": {
- "description": "Pass in a style preset to guide the image model towards a particular style.\nThis list of style presets is subject to change.",
- "enum": [
- "enhance",
- "anime",
- "photographic",
- "digital-art",
- "comic-book",
- "fantasy-art",
- "line-art",
- "analog-film",
- "neon-punk",
- "isometric",
- "low-poly",
- "origami",
- "modeling-compound",
- "cinematic",
- "3d-model",
- "pixel-art",
- "tile-texture"
- ],
- "format": "string",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 10,
- "title": "Style Preset"
- },
- "weights": {
- "description": "An array of weights to use for generation.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 2,
- "items": {
- "description": "Weight of the prompt (use negative numbers for negative prompts)",
- "example": 0.8167237,
- "format": "float",
- "acceptFormats": [
- "number",
- "integer"
- ]
- },
- "minItems": 1,
- "title": "Weights",
- "format": "array"
- },
- "width": {
- "default": 1024,
- "description": "Width of the image to generate, in pixels, in an increment divible by 64.\n\nEngine-specific dimension validation:\n- SDXL Beta: must be between 128x128 and 512x896 (or 896x512); only one dimension can be greater than 512. \n- SDXL v0.9: must be one of 1024x1024, 1152x896, 1216x832, 1344x768, 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152\n- SDXL v1.0: same as SDXL v0.9\n- SD v1.6: must be between 320x320 and 1536x1536",
- "example": 1024,
- "minimum": 128,
- "multipleOf": 64,
- "format": "integer",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Width"
- }
- },
- "required": [
- "prompts",
- "engine"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "additionalProperties": false,
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "images": {
- "description": "Generated images.",
- "uiOrder": 0,
- "items": {
- "title": "Image",
- "format": "image/png"
- },
- "title": "Images",
- "format": "array"
- },
- "seeds": {
- "description": "Seeds of generated images.",
- "uiOrder": 1,
- "items": {
- "description": "The seed associated with this image",
- "example": 1229191277,
- "format": "number",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "title": "Seed",
- "x-go-type-skip-optional-pointer": true
- },
- "title": "Seeds",
- "format": "array"
- }
- },
- "required": [
- "images",
- "seeds"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/stabilityai/v0/config/tasks.yaml b/pkg/component/ai/stabilityai/v0/config/tasks.yaml
new file mode 100644
index 000000000..7e9dd0d23
--- /dev/null
+++ b/pkg/component/ai/stabilityai/v0/config/tasks.yaml
@@ -0,0 +1,474 @@
+TASK_IMAGE_TO_IMAGE:
+ shortDescription: Modify an image based on a text prompt.
+ input:
+ additionalProperties: false
+ description: Input.
+ uiOrder: 0
+ properties:
+ cfg-scale:
+ default: 7
+ description: How strictly the diffusion process adheres to the prompt text
+ (higher values keep your image closer to your prompt)
+ example: 7
+ maximum: 35
+ minimum: 0
+ format: number
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 6
+ title: Cfg Scale
+ clip-guidance-preset:
+ default: NONE
+ enum:
+ - FAST_BLUE
+ - FAST_GREEN
+ - NONE
+ - SIMPLE
+ - SLOW
+ - SLOWER
+ - SLOWEST
+ example: FAST_BLUE
+ format: string
+ description: Clip guidance preset.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Clip Guidance Preset
+ engine:
+ default: stable-diffusion-xl-1024-v1-0
+ description: Stability AI Engine (model) to be used.
+ enum:
+ - stable-diffusion-xl-1024-v1-0
+ - stable-diffusion-xl-1024-v0-9
+ - stable-diffusion-v1-6
+ - esrgan-v1-x2plus
+ - stable-diffusion-512-v2-1
+ - stable-diffusion-xl-beta-v2-2-2
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Engine
+ format: string
+ image-strength:
+ default: 0.35
+ description: |
+ How much influence the `init_image` has on the diffusion process. Values close to `1` will yield images very similar to the `init_image` while values close to `0` will yield images wildly different than the `init_image`. The behavior of this is meant to mirror DreamStudio's "Image Strength" slider.
This parameter is just an alternate way to set `step_schedule_start`, which is done via the calculation `1 - image_strength`. For example, passing in an Image Strength of 35% (`0.35`) would result in a `step_schedule_start` of `0.65`.
+ example: 0.4
+ maximum: 1
+ minimum: 0
+ format: number
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: How much influence the `init-image` has on the diffusion
+ process.
+ uiOrder: 5
+ title: Image Strength
+ init-image:
+ description: Image used to initialize the diffusion process, in lieu of random
+ noise.
+ format: image
+ acceptFormats:
+ - image/*
+ uiOrder: 2
+ title: Init Image
+ init-image-mode:
+ default: IMAGE_STRENGTH
+ description: Whether to use `image_strength` or `step_schedule_*` to control
+ how much influence the `init_image` has on the result.
+ enum:
+ - IMAGE_STRENGTH
+ - STEP_SCHEDULE
+ format: string
+ acceptFormats:
+ - string
+ uiOrder: 7
+ title: Init Image Mode
+ prompts:
+ description: An array of prompts to use for generation.
+ acceptFormats:
+ - array
+ uiOrder: 1
+ items:
+ description: The prompt itself
+ example: A lighthouse on a cliff
+ maxLength: 2000
+ format: string
+ minItems: 1
+ title: Prompts
+ format: array
+ sampler:
+ description: Which sampler to use for the diffusion process. If this value
+ is omitted we'll automatically select an appropriate sampler for you.
+ enum:
+ - DDIM
+ - DDPM
+ - K_DPMPP_2M
+ - K_DPMPP_2S_ANCESTRAL
+ - K_DPM_2
+ - K_DPM_2_ANCESTRAL
+ - K_EULER
+ - K_EULER_ANCESTRAL
+ - K_HEUN
+ - K_LMS
+ example: K_DPM_2_ANCESTRAL
+ format: string
+ acceptFormats:
+ - string
+ shortDescription: Which sampler to use for the diffusion process
+ uiOrder: 8
+ title: Sampler
+ samples:
+ default: 1
+ description: Number of images to generate
+ example: 1
+ maximum: 10
+ minimum: 1
+ format: integer
+ acceptFormats:
+ - integer
+ uiOrder: 9
+ title: Samples
+ seed:
+ default: 0
+ description: Random noise seed (omit this option or use `0` for a random seed)
+ example: 0
+ maximum: 4294967295
+ minimum: 0
+ format: integer
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 10
+ title: Seed
+ step-schedule-end:
+ description: Skips a proportion of the end of the diffusion steps, allowing
+ the init_image to influence the final generated image. Lower values will
+ result in more influence from the init_image, while higher values will result
+ in more influence from the diffusion steps.
+ example: 0.01
+ maximum: 1
+ minimum: 0
+ format: number
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: Skips a proportion of the end of the diffusion steps
+ uiOrder: 12
+ title: Step Schedule End
+ step-schedule-start:
+ default: 0.65
+ description: Skips a proportion of the start of the diffusion steps, allowing
+ the init_image to influence the final generated image. Lower values will
+ result in more influence from the init_image, while higher values will result
+ in more influence from the diffusion steps. (e.g. a value of `0` would
+ simply return you the init_image, where a value of `1` would return you
+ a completely different image.)
+ example: 0.4
+ maximum: 1
+ minimum: 0
+ format: number
+ acceptFormats:
+ - number
+ - integer
+ shortDescription: Skips a proportion of the start of the diffusion steps
+ uiOrder: 11
+ title: Step Schedule Start
+ steps:
+ default: 30
+ description: Number of diffusion steps to run.
+ example: 50
+ maximum: 50
+ minimum: 10
+ format: integer
+ acceptFormats:
+ - integer
+ uiOrder: 13
+ title: Steps
+ style-preset:
+ description: |-
+ Pass in a style preset to guide the image model towards a particular style.
+ This list of style presets is subject to change.
+ enum:
+ - enhance
+ - anime
+ - photographic
+ - digital-art
+ - comic-book
+ - fantasy-art
+ - line-art
+ - analog-film
+ - neon-punk
+ - isometric
+ - low-poly
+ - origami
+ - modeling-compound
+ - cinematic
+ - 3d-model
+ - pixel-art
+ - tile-texture
+ acceptFormats:
+ - string
+ uiOrder: 14
+ title: Style Preset
+ weights:
+ description: An array of weights to use for generation. If unspecified, the
+ model will automatically assign a default weight of 1.0 to each prompt.
+ acceptFormats:
+ - array
+ uiOrder: 2
+ items:
+ description: Weight of the prompt (use negative numbers for negative prompts)
+ example: 0.8167237
+ acceptFormats:
+ - number
+ - integer
+ minItems: 1
+ title: Weights
+ format: array
+ required:
+ - prompts
+ - engine
+ title: Input
+ format: object
+ output:
+ $ref: '#/TASK_TEXT_TO_IMAGE/output'
+TASK_TEXT_TO_IMAGE:
+ shortDescription: Generate a new image from a text prompt.
+ input:
+ additionalProperties: false
+ description: Input.
+ uiOrder: 0
+ properties:
+ cfg-scale:
+ default: 7
+ description: How strictly the diffusion process adheres to the prompt text
+ (higher values keep your image closer to your prompt)
+ example: 7
+ maximum: 35
+ minimum: 0
+ format: number
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 3
+ title: CFG Scale
+ clip-guidance-preset:
+ default: NONE
+ enum:
+ - FAST_BLUE
+ - FAST_GREEN
+ - NONE
+ - SIMPLE
+ - SLOW
+ - SLOWER
+ - SLOWEST
+ example: FAST_BLUE
+ format: string
+ description: Clip guidance preset.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Clip Guidance Preset
+ engine:
+ default: stable-diffusion-xl-1024-v1-0
+ description: Stability AI Engine (model) to be used.
+ enum:
+ - stable-diffusion-xl-1024-v1-0
+ - stable-diffusion-xl-1024-v0-9
+ - stable-diffusion-v1-6
+ - esrgan-v1-x2plus
+ - stable-diffusion-512-v2-1
+ - stable-diffusion-xl-beta-v2-2-2
+ instillCredentialMap:
+ values:
+ - stable-diffusion-xl-1024-v1-0
+ - stable-diffusion-v1-6
+ targets:
+ - setup.api-key
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Engine
+ format: string
+ height:
+ default: 1024
+ description: "Height of the image to generate, in pixels, in an increment\
+ \ divible by 64.\n\nEngine-specific dimension validation:\n- SDXL Beta:\
+ \ must be between 128x128 and 512x896 (or 896x512); only one dimension can\
+ \ be greater than 512. \n- SDXL v0.9: must be one of 1024x1024, 1152x896,\
+ \ 1216x832, 1344x768, 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152\n\
+ - SDXL v1.0: same as SDXL v0.9\n- SD v1.6: must be between 320x320 and\
+ \ 1536x1536"
+ example: 1024
+ minimum: 128
+ multipleOf: 64
+ format: integer
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Height
+ prompts:
+ description: An array of prompts to use for generation.
+ acceptFormats:
+ - array
+ uiOrder: 1
+ items:
+ description: The prompt itself
+ example: A lighthouse on a cliff
+ maxLength: 2000
+ acceptFormats:
+ - string
+ minItems: 1
+ title: Prompts
+ format: array
+ sampler:
+ description: Which sampler to use for the diffusion process. If this value
+ is omitted we'll automatically select an appropriate sampler for you.
+ enum:
+ - DDIM
+ - DDPM
+ - K_DPMPP_2M
+ - K_DPMPP_2S_ANCESTRAL
+ - K_DPM_2
+ - K_DPM_2_ANCESTRAL
+ - K_EULER
+ - K_EULER_ANCESTRAL
+ - K_HEUN
+ - K_LMS
+ example: K_DPM_2_ANCESTRAL
+ format: string
+ acceptFormats:
+ - string
+ uiOrder: 6
+ title: Sampler
+ samples:
+ default: 1
+ description: Number of images to generate
+ example: 1
+ maximum: 10
+ minimum: 1
+ format: integer
+ acceptFormats:
+ - integer
+ uiOrder: 7
+ title: Samples
+ seed:
+ default: 0
+ description: Random noise seed (omit this option or use `0` for a random seed)
+ example: 0
+ maximum: 4294967295
+ minimum: 0
+ format: integer
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 8
+ title: Seed
+ steps:
+ default: 30
+ description: Number of diffusion steps to run.
+ example: 50
+ maximum: 50
+ minimum: 10
+ format: integer
+ acceptFormats:
+ - integer
+ uiOrder: 9
+ title: Steps
+ style-preset:
+ description: |-
+ Pass in a style preset to guide the image model towards a particular style.
+ This list of style presets is subject to change.
+ enum:
+ - enhance
+ - anime
+ - photographic
+ - digital-art
+ - comic-book
+ - fantasy-art
+ - line-art
+ - analog-film
+ - neon-punk
+ - isometric
+ - low-poly
+ - origami
+ - modeling-compound
+ - cinematic
+ - 3d-model
+ - pixel-art
+ - tile-texture
+ format: string
+ acceptFormats:
+ - string
+ uiOrder: 10
+ title: Style Preset
+ weights:
+ description: An array of weights to use for generation.
+ acceptFormats:
+ - array
+ uiOrder: 2
+ items:
+ description: Weight of the prompt (use negative numbers for negative prompts)
+ example: 0.8167237
+ format: float
+ acceptFormats:
+ - number
+ - integer
+ minItems: 1
+ title: Weights
+ format: array
+ width:
+ default: 1024
+ description: "Width of the image to generate, in pixels, in an increment divible\
+ \ by 64.\n\nEngine-specific dimension validation:\n- SDXL Beta: must be\
+ \ between 128x128 and 512x896 (or 896x512); only one dimension can be greater\
+ \ than 512. \n- SDXL v0.9: must be one of 1024x1024, 1152x896, 1216x832,\
+ \ 1344x768, 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152\n- SDXL\
+ \ v1.0: same as SDXL v0.9\n- SD v1.6: must be between 320x320 and 1536x1536"
+ example: 1024
+ minimum: 128
+ multipleOf: 64
+ format: integer
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Width
+ required:
+ - prompts
+ - engine
+ title: Input
+ format: object
+ output:
+ additionalProperties: false
+ description: Output.
+ uiOrder: 0
+ properties:
+ images:
+ description: Generated images.
+ uiOrder: 0
+ items:
+ title: Image
+ format: image/png
+ title: Images
+ format: array
+ seeds:
+ description: Seeds of generated images.
+ uiOrder: 1
+ items:
+ description: The seed associated with this image
+ example: 1229191277
+ format: number
+ acceptFormats:
+ - number
+ - integer
+ title: Seed
+ x-go-type-skip-optional-pointer: true
+ title: Seeds
+ format: array
+ required:
+ - images
+ - seeds
+ title: Output
+ format: object
diff --git a/pkg/component/ai/stabilityai/v0/main.go b/pkg/component/ai/stabilityai/v0/main.go
index f42816cc2..9fd99f614 100644
--- a/pkg/component/ai/stabilityai/v0/main.go
+++ b/pkg/component/ai/stabilityai/v0/main.go
@@ -24,13 +24,13 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
- //go:embed config/stabilityai.json
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
+ //go:embed config/stabilityai.yaml
stabilityaiJSON []byte
once sync.Once
comp *component
@@ -47,7 +47,7 @@ type component struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, map[string][]byte{"stabilityai.json": stabilityaiJSON})
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, map[string][]byte{"stabilityai.yaml": stabilityaiJSON})
if err != nil {
panic(err)
}
diff --git a/pkg/component/ai/universalai/v0/README.mdx b/pkg/component/ai/universalai/v0/README.mdx
index 25dcae235..95395916c 100644
--- a/pkg/component/ai/universalai/v0/README.mdx
+++ b/pkg/component/ai/universalai/v0/README.mdx
@@ -19,7 +19,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/universalai/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/universalai/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/universalai/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/universalai/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/ai/universalai/v0/config/definition.json b/pkg/component/ai/universalai/v0/config/definition.json
deleted file mode 100644
index 5372ff478..000000000
--- a/pkg/component/ai/universalai/v0/config/definition.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "availableTasks": [
- "TASK_CHAT"
- ],
- "custom": false,
- "icon": "assets/universal-ai.svg",
- "id": "universal-ai",
- "public": true,
- "title": "Universal AI",
- "description": "Connect the AI models served on the different platforms with standardized input and output formats.",
- "type": "COMPONENT_TYPE_AI",
- "uid": "7656cb11-d504-4ca0-b481-6ef80964f2c9",
- "vendorAttributes": {},
- "version": "0.2.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/universalai/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA",
- "documentationUrl": "https://www.instill.tech/docs/component/ai/universal-ai"
-}
diff --git a/pkg/component/ai/universalai/v0/config/definition.yaml b/pkg/component/ai/universalai/v0/config/definition.yaml
new file mode 100644
index 000000000..4de217a4d
--- /dev/null
+++ b/pkg/component/ai/universalai/v0/config/definition.yaml
@@ -0,0 +1,16 @@
+availableTasks:
+- TASK_CHAT
+custom: false
+icon: assets/universal-ai.svg
+id: universal-ai
+public: true
+title: Universal AI
+description: Connect the AI models served on the different platforms with standardized
+ input and output formats.
+type: COMPONENT_TYPE_AI
+uid: 7656cb11-d504-4ca0-b481-6ef80964f2c9
+vendorAttributes: {}
+version: 0.2.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/ai/universalai/v0
+releaseStage: RELEASE_STAGE_ALPHA
+documentationUrl: https://www.instill.tech/docs/component/ai/universal-ai
diff --git a/pkg/component/ai/universalai/v0/config/setup.json b/pkg/component/ai/universalai/v0/config/setup.json
deleted file mode 100644
index 98d857096..000000000
--- a/pkg/component/ai/universalai/v0/config/setup.json
+++ /dev/null
@@ -1,85 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": true,
- "properties": {
- "model": {
- "description": "The model to be used. Now, it only supports OpenAI model, and will support more models in the future.",
- "shortDescription": "The model to be used.",
- "acceptFormats": [
- "string"
- ],
- "enum": [
- "o1-preview",
- "o1-mini",
- "gpt-4o-mini",
- "gpt-4o",
- "gpt-4o-2024-05-13",
- "gpt-4o-2024-08-06",
- "gpt-4-turbo",
- "gpt-4-turbo-2024-04-09",
- "gpt-4-0125-preview",
- "gpt-4-turbo-preview",
- "gpt-4-1106-preview",
- "gpt-4-vision-preview",
- "gpt-4",
- "gpt-4-0314",
- "gpt-4-0613",
- "gpt-4-32k",
- "gpt-4-32k-0314",
- "gpt-4-32k-0613",
- "gpt-3.5-turbo",
- "gpt-3.5-turbo-16k",
- "gpt-3.5-turbo-0301",
- "gpt-3.5-turbo-0613",
- "gpt-3.5-turbo-1106",
- "gpt-3.5-turbo-0125",
- "gpt-3.5-turbo-16k-0613"
- ],
- "instillCredentialMap": {
- "values": [
- "o1-preview",
- "o1-mini",
- "gpt-4o",
- "gpt-4o-2024-08-06",
- "gpt-4-turbo",
- "gpt-4-vision-preview",
- "gpt-4",
- "gpt-4-32k",
- "gpt-3.5-turbo",
- "gpt-4o-mini"
- ],
- "targets": [
- "setup.api-key"
- ]
- },
- "uiOrder": 0,
- "title": "Model Name",
- "format": "string"
- },
- "api-key": {
- "description": "Fill in your API key from the vendor's platform.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "instillCredential": true,
- "uiOrder": 1,
- "title": "API Key",
- "format": "string"
- },
- "organization": {
- "description": "Specify which organization is used for the requests. Usage will count against the specified organization's subscription quota.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Organization ID",
- "format": "string"
- }
- },
- "required": [
- "model"
- ],
- "title": "Universal AI Connection",
- "format": "object"
-}
diff --git a/pkg/component/ai/universalai/v0/config/setup.yaml b/pkg/component/ai/universalai/v0/config/setup.yaml
new file mode 100644
index 000000000..660b85e83
--- /dev/null
+++ b/pkg/component/ai/universalai/v0/config/setup.yaml
@@ -0,0 +1,72 @@
+additionalProperties: true
+properties:
+ model:
+ description: The model to be used. Now, it only supports OpenAI model, and will
+ support more models in the future.
+ shortDescription: The model to be used.
+ acceptFormats:
+ - string
+ enum:
+ - o1-preview
+ - o1-mini
+ - gpt-4o-mini
+ - gpt-4o
+ - gpt-4o-2024-05-13
+ - gpt-4o-2024-08-06
+ - gpt-4-turbo
+ - gpt-4-turbo-2024-04-09
+ - gpt-4-0125-preview
+ - gpt-4-turbo-preview
+ - gpt-4-1106-preview
+ - gpt-4-vision-preview
+ - gpt-4
+ - gpt-4-0314
+ - gpt-4-0613
+ - gpt-4-32k
+ - gpt-4-32k-0314
+ - gpt-4-32k-0613
+ - gpt-3.5-turbo
+ - gpt-3.5-turbo-16k
+ - gpt-3.5-turbo-0301
+ - gpt-3.5-turbo-0613
+ - gpt-3.5-turbo-1106
+ - gpt-3.5-turbo-0125
+ - gpt-3.5-turbo-16k-0613
+ instillCredentialMap:
+ values:
+ - o1-preview
+ - o1-mini
+ - gpt-4o
+ - gpt-4o-2024-08-06
+ - gpt-4-turbo
+ - gpt-4-vision-preview
+ - gpt-4
+ - gpt-4-32k
+ - gpt-3.5-turbo
+ - gpt-4o-mini
+ targets:
+ - setup.api-key
+ uiOrder: 0
+ title: Model Name
+ format: string
+ api-key:
+ description: Fill in your API key from the vendor's platform.
+ acceptFormats:
+ - string
+ instillSecret: true
+ instillCredential: true
+ uiOrder: 1
+ title: API Key
+ format: string
+ organization:
+ description: Specify which organization is used for the requests. Usage will count
+ against the specified organization's subscription quota.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Organization ID
+ format: string
+required:
+- model
+title: Universal AI Connection
+format: object
diff --git a/pkg/component/ai/universalai/v0/config/tasks.json b/pkg/component/ai/universalai/v0/config/tasks.json
deleted file mode 100644
index 1cc80afa5..000000000
--- a/pkg/component/ai/universalai/v0/config/tasks.json
+++ /dev/null
@@ -1,384 +0,0 @@
-{
- "TASK_CHAT": {
- "title": "Chat",
- "shortDescription": "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.",
- "shortDescription": "Input schema of the chat task",
- "properties": {
- "data": {
- "title": "Chat Data",
- "description": "Input data.",
- "shortDescription": "Input data",
- "properties": {
- "messages": {
- "title": "Chat Messages",
- "items": {
- "properties": {
- "content": {
- "description": "The message content.",
- "shortDescription": "The message content",
- "title": "Content",
- "items": {
- "oneOf": [
- {
- "properties": {
- "text": {
- "title": "Text Message",
- "description": "Text message.",
- "shortDescription": "Text message.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "title": "Text",
- "description": "Text content type.",
- "shortDescription": "Text content type.",
- "acceptFormats": [
- "string"
- ],
- "const": "text",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "text",
- "type"
- ],
- "title": "Text",
- "format": "object"
- },
- {
- "properties": {
- "image-url": {
- "title": "Image URL",
- "description": "Image message URL.",
- "shortDescription": "Image message URL.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "title": "Image URL",
- "description": "Image URL content type.",
- "shortDescription": "Image URL content type",
- "acceptFormats": [
- "string"
- ],
- "const": "image-url",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "image-url",
- "type"
- ],
- "title": "Image URL",
- "format": "object"
- },
- {
- "properties": {
- "image-base64": {
- "title": "Image Base64",
- "description": "Image base64 encoded string.",
- "shortDescription": "Image base64 encoded string.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "title": "Image File",
- "description": "Image file input content type.",
- "shortDescription": "Image file input content type",
- "acceptFormats": [
- "string"
- ],
- "const": "image-base64",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "image-base64",
- "type"
- ],
- "title": "Image Base64",
- "format": "object"
- }
- ],
- "required": [],
- "format": "object"
- },
- "uiOrder": 0,
- "format": "array"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "shortDescription": "The message role, i.e. 'system', 'user' or 'assistant'",
- "acceptFormats": [
- "string"
- ],
- "title": "Role",
- "enum": [
- "system",
- "user",
- "assistant"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "name": {
- "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.",
- "shortDescription": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.",
- "acceptFormats": [
- "string"
- ],
- "title": "Name",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [
- "content",
- "role"
- ],
- "format": "object"
- },
- "uiOrder": 0,
- "description": "List of chat messages.",
- "format": "array"
- }
- },
- "required": [
- "messages"
- ],
- "uiOrder": 0,
- "format": "object"
- },
- "parameter": {
- "description": "Input parameter.",
- "shortDescription": "Input parameter",
- "properties": {
- "max-tokens": {
- "title": "Max New Tokens",
- "description": "The maximum number of tokens for model to generate.",
- "shortDescription": "The maximum number of tokens for model to generate",
- "acceptFormats": [
- "integer"
- ],
- "default": 50,
- "uiOrder": 0,
- "format": "integer"
- },
- "seed": {
- "title": "Seed",
- "description": "The seed, default is 0.",
- "shortDescription": "The seed, default is 0",
- "acceptFormats": [
- "integer"
- ],
- "default": 0,
- "uiOrder": 1,
- "format": "integer"
- },
- "n": {
- "title": "Number of Choices",
- "description": "How many chat completion choices to generate for each input message.",
- "shortDescription": "How many chat completion choices to generate for each input message.",
- "acceptFormats": [
- "integer"
- ],
- "default": 1,
- "uiOrder": 2,
- "format": "integer"
- },
- "temperature": {
- "title": "Temperature",
- "description": "The temperature for sampling.",
- "shortDescription": "The temperature for sampling",
- "acceptFormats": [
- "number"
- ],
- "default": 0.7,
- "uiOrder": 3,
- "format": "number"
- },
- "top-p": {
- "title": "Top P",
- "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.",
- "shortDescription": "Nucleus sampling",
- "acceptFormats": [
- "number"
- ],
- "default": 1,
- "uiOrder": 4,
- "format": "number"
- },
- "stream": {
- "title": "Stream",
- "description": "If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events as they become available.",
- "shortDescription": "If set, partial message deltas will be sent",
- "acceptFormats": [
- "boolean"
- ],
- "default": false,
- "uiOrder": 5,
- "format": "boolean"
- }
- },
- "required": [],
- "uiOrder": 1,
- "title": "Input Parameter",
- "format": "object"
- }
- },
- "required": [
- "data"
- ],
- "format": "object"
- },
- "output": {
- "$schema": "http://json-schema.org/draft-07/schema#",
- "title": "Chat output",
- "description": "Output schema of the chat task.",
- "shortDescription": "Output schema of the chat task",
- "properties": {
- "data": {
- "description": "Output data.",
- "shortDescription": "Output data",
- "properties": {
- "choices": {
- "title": "Choices",
- "description": "List of chat completion choices.",
- "shortDescription": "List of chat completion choices",
- "items": {
- "properties": {
- "finish-reason": {
- "title": "Finish Reason",
- "description": "The reason the model stopped generating tokens.",
- "shortDescription": "The reason the model stopped generating tokens.",
- "uiOrder": 0,
- "format": "string"
- },
- "index": {
- "title": "Index",
- "description": "The index of the choice in the list of choices.",
- "shortDescription": "The index of the choice in the list of choices.",
- "uiOrder": 1,
- "format": "integer"
- },
- "message": {
- "title": "Message",
- "description": "A chat message generated by the model.",
- "shortDescription": "A chat message generated by the model.",
- "properties": {
- "content": {
- "title": "Content",
- "description": "The contents of the message.",
- "shortDescription": "The contents of the message.",
- "uiOrder": 0,
- "format": "string"
- },
- "role": {
- "title": "Role",
- "description": "The role of the author of this message.",
- "shortDescription": "The role of the author of this message.",
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [],
- "uiOrder": 2,
- "format": "object"
- },
- "created": {
- "title": "Created",
- "description": "The Unix timestamp (in seconds) of when the chat completion was created.",
- "shortDescription": "The Unix timestamp (in seconds) of when the chat completion was created.",
- "uiOrder": 3,
- "format": "integer"
- }
- },
- "required": [
- "finish-reason",
- "index",
- "message",
- "created"
- ],
- "format": "object"
- },
- "uiOrder": 0,
- "format": "array"
- }
- },
- "required": [
- "choices"
- ],
- "uiOrder": 0,
- "title": "Output Data",
- "format": "object"
- },
- "metadata": {
- "description": "Output metadata.",
- "shortDescription": "Output metadata",
- "properties": {
- "usage": {
- "description": "Usage statistics for the request.",
- "shortDescription": "Usage statistics for the request.",
- "properties": {
- "completion-tokens": {
- "title": "Completion Tokens",
- "description": "Number of tokens in the generated response.",
- "shortDescription": "Number of tokens in the generated response.",
- "uiOrder": 0,
- "format": "integer"
- },
- "prompt-tokens": {
- "title": "Prompt Tokens",
- "description": "Number of tokens in the prompt.",
- "shortDescription": "Number of tokens in the prompt.",
- "uiOrder": 1,
- "format": "integer"
- },
- "total-tokens": {
- "title": "Total Tokens",
- "description": "Total number of tokens used in the request (prompt + completion).",
- "shortDescription": "Total number of tokens used in the request (prompt + completion).",
- "uiOrder": 2,
- "format": "integer"
- }
- },
- "required": [
- "completion-tokens",
- "prompt-tokens",
- "total-tokens"
- ],
- "uiOrder": 0,
- "title": "Usage",
- "format": "object"
- }
- },
- "required": [],
- "title": "Output Metadata",
- "uiOrder": 1,
- "format": "object"
- }
- },
- "required": [
- "data"
- ],
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/ai/universalai/v0/config/tasks.yaml b/pkg/component/ai/universalai/v0/config/tasks.yaml
new file mode 100644
index 000000000..4d99463a0
--- /dev/null
+++ b/pkg/component/ai/universalai/v0/config/tasks.yaml
@@ -0,0 +1,313 @@
+TASK_CHAT:
+ title: Chat
+ shortDescription: Generate response base on conversation input
+ input:
+ title: Chat input
+ description: Input schema of the chat task.
+ shortDescription: Input schema of the chat task
+ properties:
+ data:
+ title: Chat Data
+ description: Input data.
+ shortDescription: Input data
+ properties:
+ messages:
+ title: Chat Messages
+ items:
+ properties:
+ content:
+ description: The message content.
+ shortDescription: The message content
+ title: Content
+ items:
+ oneOf:
+ - properties:
+ text:
+ title: Text Message
+ description: Text message.
+ shortDescription: Text message.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ format: string
+ type:
+ title: Text
+ description: Text content type.
+ shortDescription: Text content type.
+ acceptFormats:
+ - string
+ const: text
+ uiOrder: 0
+ format: string
+ required:
+ - text
+ - type
+ title: Text
+ format: object
+ - properties:
+ image-url:
+ title: Image URL
+ description: Image message URL.
+ shortDescription: Image message URL.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ format: string
+ type:
+ title: Image URL
+ description: Image URL content type.
+ shortDescription: Image URL content type
+ acceptFormats:
+ - string
+ const: image-url
+ uiOrder: 0
+ format: string
+ required:
+ - image-url
+ - type
+ title: Image URL
+ format: object
+ - properties:
+ image-base64:
+ title: Image Base64
+ description: Image base64 encoded string.
+ shortDescription: Image base64 encoded string.
+ acceptFormats:
+ - image/*
+ uiOrder: 1
+ format: string
+ type:
+ title: Image File
+ description: Image file input content type.
+ shortDescription: Image file input content type
+ acceptFormats:
+ - string
+ const: image-base64
+ uiOrder: 0
+ format: string
+ required:
+ - image-base64
+ - type
+ title: Image Base64
+ format: object
+ required: []
+ format: object
+ uiOrder: 0
+ format: array
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ shortDescription: The message role, i.e. 'system', 'user' or 'assistant'
+ acceptFormats:
+ - string
+ title: Role
+ enum:
+ - system
+ - user
+ - assistant
+ uiOrder: 1
+ format: string
+ name:
+ description: An optional name for the participant. Provides the
+ model information to differentiate between participants of the
+ same role.
+ shortDescription: An optional name for the participant. Provides
+ the model information to differentiate between participants of
+ the same role.
+ acceptFormats:
+ - string
+ title: Name
+ uiOrder: 2
+ format: string
+ required:
+ - content
+ - role
+ format: object
+ uiOrder: 0
+ description: List of chat messages.
+ format: array
+ required:
+ - messages
+ uiOrder: 0
+ format: object
+ parameter:
+ description: Input parameter.
+ shortDescription: Input parameter
+ properties:
+ max-tokens:
+ title: Max New Tokens
+ description: The maximum number of tokens for model to generate.
+ shortDescription: The maximum number of tokens for model to generate
+ acceptFormats:
+ - integer
+ default: 50
+ uiOrder: 0
+ format: integer
+ seed:
+ title: Seed
+ description: The seed, default is 0.
+ shortDescription: The seed, default is 0
+ acceptFormats:
+ - integer
+ default: 0
+ uiOrder: 1
+ format: integer
+ n:
+ title: Number of Choices
+ description: How many chat completion choices to generate for each input
+ message.
+ shortDescription: How many chat completion choices to generate for each
+ input message.
+ acceptFormats:
+ - integer
+ default: 1
+ uiOrder: 2
+ format: integer
+ temperature:
+ title: Temperature
+ description: The temperature for sampling.
+ shortDescription: The temperature for sampling
+ acceptFormats:
+ - number
+ default: 0.7
+ uiOrder: 3
+ format: number
+ top-p:
+ title: Top P
+ 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.
+ shortDescription: Nucleus sampling
+ acceptFormats:
+ - number
+ default: 1
+ uiOrder: 4
+ format: number
+ stream:
+ title: Stream
+ description: If set, partial message deltas will be sent. Tokens will
+ be sent as data-only server-sent events as they become available.
+ shortDescription: If set, partial message deltas will be sent
+ acceptFormats:
+ - boolean
+ default: false
+ uiOrder: 5
+ format: boolean
+ required: []
+ uiOrder: 1
+ title: Input Parameter
+ format: object
+ required:
+ - data
+ format: object
+ output:
+ title: Chat output
+ description: Output schema of the chat task.
+ shortDescription: Output schema of the chat task
+ properties:
+ data:
+ description: Output data.
+ shortDescription: Output data
+ properties:
+ choices:
+ title: Choices
+ description: List of chat completion choices.
+ shortDescription: List of chat completion choices
+ items:
+ properties:
+ finish-reason:
+ title: Finish Reason
+ description: The reason the model stopped generating tokens.
+ shortDescription: The reason the model stopped generating tokens.
+ uiOrder: 0
+ format: string
+ index:
+ title: Index
+ description: The index of the choice in the list of choices.
+ shortDescription: The index of the choice in the list of choices.
+ uiOrder: 1
+ format: integer
+ message:
+ title: Message
+ description: A chat message generated by the model.
+ shortDescription: A chat message generated by the model.
+ properties:
+ content:
+ title: Content
+ description: The contents of the message.
+ shortDescription: The contents of the message.
+ uiOrder: 0
+ format: string
+ role:
+ title: Role
+ description: The role of the author of this message.
+ shortDescription: The role of the author of this message.
+ uiOrder: 1
+ format: string
+ required: []
+ uiOrder: 2
+ format: object
+ created:
+ title: Created
+ description: The Unix timestamp (in seconds) of when the chat completion
+ was created.
+ shortDescription: The Unix timestamp (in seconds) of when the chat
+ completion was created.
+ uiOrder: 3
+ format: integer
+ required:
+ - finish-reason
+ - index
+ - message
+ - created
+ format: object
+ uiOrder: 0
+ format: array
+ required:
+ - choices
+ uiOrder: 0
+ title: Output Data
+ format: object
+ metadata:
+ description: Output metadata.
+ shortDescription: Output metadata
+ properties:
+ usage:
+ description: Usage statistics for the request.
+ shortDescription: Usage statistics for the request.
+ properties:
+ completion-tokens:
+ title: Completion Tokens
+ description: Number of tokens in the generated response.
+ shortDescription: Number of tokens in the generated response.
+ uiOrder: 0
+ format: integer
+ prompt-tokens:
+ title: Prompt Tokens
+ description: Number of tokens in the prompt.
+ shortDescription: Number of tokens in the prompt.
+ uiOrder: 1
+ format: integer
+ total-tokens:
+ title: Total Tokens
+ description: Total number of tokens used in the request (prompt +
+ completion).
+ shortDescription: Total number of tokens used in the request (prompt
+ + completion).
+ uiOrder: 2
+ format: integer
+ required:
+ - completion-tokens
+ - prompt-tokens
+ - total-tokens
+ uiOrder: 0
+ title: Usage
+ format: object
+ required: []
+ title: Output Metadata
+ uiOrder: 1
+ format: object
+ required:
+ - data
+ format: object
diff --git a/pkg/component/ai/universalai/v0/main.go b/pkg/component/ai/universalai/v0/main.go
index aded97b12..b8ef67683 100644
--- a/pkg/component/ai/universalai/v0/main.go
+++ b/pkg/component/ai/universalai/v0/main.go
@@ -21,12 +21,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -50,7 +50,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/asana/v0/README.mdx b/pkg/component/application/asana/v0/README.mdx
index cd9240388..6dd2fe857 100644
--- a/pkg/component/application/asana/v0/README.mdx
+++ b/pkg/component/application/asana/v0/README.mdx
@@ -22,7 +22,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/asana/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/asana/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/asana/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/asana/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/asana/v0/config/definition.json b/pkg/component/application/asana/v0/config/definition.json
deleted file mode 100644
index 94cf1c47a..000000000
--- a/pkg/component/application/asana/v0/config/definition.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "availableTasks": [
- "TASK_CRUD_GOAL",
- "TASK_CRUD_TASK",
- "TASK_CRUD_PROJECT",
- "TASK_CRUD_PORTFOLIO"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/application/asana",
- "icon": "assets/asana.svg",
- "id": "asana",
- "public": true,
- "title": "Asana",
- "vendor": "Asana",
- "description": "Do anything available on Asana.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "7c83cda3-50a9-46fc-992f-c4e8b949bbec",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/asana/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/asana/v0/config/definition.yaml b/pkg/component/application/asana/v0/config/definition.yaml
new file mode 100644
index 000000000..1e4c742e5
--- /dev/null
+++ b/pkg/component/application/asana/v0/config/definition.yaml
@@ -0,0 +1,18 @@
+availableTasks:
+- TASK_CRUD_GOAL
+- TASK_CRUD_TASK
+- TASK_CRUD_PROJECT
+- TASK_CRUD_PORTFOLIO
+documentationUrl: https://www.instill.tech/docs/component/application/asana
+icon: assets/asana.svg
+id: asana
+public: true
+title: Asana
+vendor: Asana
+description: Do anything available on Asana.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: 7c83cda3-50a9-46fc-992f-c4e8b949bbec
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/asana/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/asana/v0/config/setup.json b/pkg/component/application/asana/v0/config/setup.json
deleted file mode 100644
index 0abf63fac..000000000
--- a/pkg/component/application/asana/v0/config/setup.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "token": {
- "description": "Fill in your Asana Personal Access Token (PAT). You can generate one from developer console.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "Token",
- "format": "string"
- }
- },
- "required": [
- "token"
- ],
- "title": "Asana Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/asana/v0/config/setup.yaml b/pkg/component/application/asana/v0/config/setup.yaml
new file mode 100644
index 000000000..afd1e0fee
--- /dev/null
+++ b/pkg/component/application/asana/v0/config/setup.yaml
@@ -0,0 +1,15 @@
+additionalProperties: false
+properties:
+ token:
+ description: Fill in your Asana Personal Access Token (PAT). You can generate
+ one from developer console.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: Token
+ format: string
+required:
+- token
+title: Asana Connection
+format: object
diff --git a/pkg/component/application/asana/v0/config/tasks.json b/pkg/component/application/asana/v0/config/tasks.json
deleted file mode 100644
index 6045adcf9..000000000
--- a/pkg/component/application/asana/v0/config/tasks.json
+++ /dev/null
@@ -1,2164 +0,0 @@
-{
- "TASK_CRUD_GOAL": {
- "description": "Create, Update, Delete, Read and Duplicate goal in Asana.",
- "shortDescription": "Goal Related Task, including get, update, delete, create, duplicate",
- "input": {
- "description": "Goal Related Task, including get, update, delete, create, duplicate.",
- "uiOrder": 0,
- "properties": {
- "action": {
- "title": "Action",
- "description": "action.",
- "uiOrder": 1,
- "additionalProperties": true,
- "required": [
- "action"
- ],
- "oneOf": [
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "get",
- "description": "Get Goal.",
- "uiOrder": 0,
- "format": "string"
- },
- "goal-gid": {
- "description": "Globally unique identifier (GID) for the goal. You can find the GID of a goal from the URL of the goal in Asana. For example, if the URL of the goal is https://app.asana.com/0/goal/1234567890, then the GID is 1234567890.",
- "shortDescription": "Goal ID",
- "uiOrder": 0,
- "title": "Goal ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "goal-gid"
- ],
- "title": "Get",
- "description": "Get Goal.",
- "uiOrder": 0,
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "update",
- "description": "Update Goal.",
- "uiOrder": 0,
- "format": "string"
- },
- "goal-gid": {
- "description": "Globally unique identifier (GID) for the goal. You can find the GID of a goal from the URL of the goal in Asana. For example, if the URL of the goal is https://app.asana.com/0/goal/1234567890, then the GID is 1234567890.",
- "shortDescription": "Goal ID",
- "uiOrder": 0,
- "title": "Goal ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "name": {
- "description": "The name of the goal.",
- "shortDescription": "Update Goal Name",
- "uiOrder": 1,
- "title": "Goal Name",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "notes": {
- "description": "The notes of the goal.",
- "shortDescription": "Update Goal Note",
- "uiOrder": 2,
- "title": "Goal Note",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "due-on": {
- "description": "The date on which the goal is due. In the format YYYY-MM-DD.",
- "shortDescription": "Update Due Date",
- "uiOrder": 2,
- "title": "Due Date",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "start-on": {
- "description": "The date on which the goal starts. In the format YYYY-MM-DD.",
- "shortDescription": "Update Start Date",
- "uiOrder": 3,
- "title": "Start Date",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "liked": {
- "description": "Whether the goal is liked by the user.",
- "shortDescription": "Liked",
- "uiOrder": 4,
- "title": "Liked",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "status": {
- "description": "The current status of this goal. When the goal is open, its status can be green, yellow, and red to reflect \"On Track\", \"At Risk\", and \"Off Track\", respectively. When the goal is closed, the value can be missed, achieved, partial, or dropped.",
- "shortDescription": "Update Status",
- "uiOrder": 5,
- "enum": [
- "green",
- "yellow",
- "red",
- "missed",
- "achieved",
- "partial",
- "dropped"
- ],
- "title": "Status",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "goal-gid",
- "liked"
- ],
- "title": "Update",
- "description": "Update Goal.",
- "uiOrder": 0,
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "delete",
- "uiOrder": 0,
- "description": "Delete goal.",
- "format": "string"
- },
- "goal-gid": {
- "description": "Globally unique identifier (GID) for the goal. You can find the GID of a goal from the URL of the goal in Asana. For example, if the URL of the goal is https://app.asana.com/0/goal/1234567890, then the GID is 1234567890.",
- "shortDescription": "Goal ID",
- "uiOrder": 0,
- "title": "Goal ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "goal-gid"
- ],
- "title": "Delete",
- "description": "Delete Goal.",
- "uiOrder": 0,
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "create",
- "description": "Create Goal.",
- "uiOrder": 0,
- "format": "string"
- },
- "name": {
- "description": "The name of the goal.",
- "shortDescription": "Goal Name",
- "uiOrder": 1,
- "title": "Goal Name",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "notes": {
- "description": "The notes of the goal.",
- "shortDescription": "Goal Note",
- "uiOrder": 2,
- "title": "Goal Note",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "due-on": {
- "description": "The date on which the goal is due. In the format YYYY-MM-DD.",
- "shortDescription": "Due Date",
- "uiOrder": 2,
- "title": "Due Date",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "start-on": {
- "description": "The date on which the goal starts. In the format YYYY-MM-DD.",
- "shortDescription": "Start Date",
- "uiOrder": 3,
- "title": "Start Date",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "liked": {
- "description": "Whether the goal is liked by the user.",
- "shortDescription": "Liked",
- "uiOrder": 4,
- "title": "Liked",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "workspace": {
- "description": "GID of the workspace. You can find one by filling the access token in the Asana API Playground.",
- "shortDescription": "GID of the workspace",
- "uiOrder": 5,
- "title": "Workspace",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "time-period": {
- "description": "GID of the time period. You can find one by filling the workspace id in the Asana API Playground.",
- "shortDescription": "Time Period",
- "uiOrder": 6,
- "title": "Time Period",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "owner": {
- "description": "User GID of the Owner. You can find one by filling the workspace id in the Asana API Playground.",
- "shortDescription": "Owner",
- "uiOrder": 7,
- "title": "Owner",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "name",
- "liked"
- ],
- "title": "Create",
- "description": "Create Goal.",
- "uiOrder": 0,
- "format": "object"
- }
- ],
- "format": "object"
- }
- },
- "required": [],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Goal.",
- "uiOrder": 0,
- "properties": {
- "gid": {
- "description": "Globally unique identifier (GID) for the goal.",
- "shortDescription": "Goal ID",
- "uiOrder": 0,
- "title": "Goal ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the goal.",
- "shortDescription": "Goal Name",
- "uiOrder": 1,
- "title": "Goal Name",
- "format": "string"
- },
- "owner": {
- "description": "The owner of the goal.",
- "shortDescription": "The owner of the goal.",
- "uiOrder": 1,
- "title": "Owner",
- "properties": {
- "gid": {
- "description": "Globally unique identifier (GID) for the owner.",
- "shortDescription": "Owner ID",
- "uiOrder": 0,
- "title": "Owner ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the owner.",
- "shortDescription": "Owner Name",
- "uiOrder": 1,
- "title": "Owner Name",
- "format": "string"
- }
- },
- "required": [
- "gid",
- "name"
- ],
- "format": "object"
- },
- "notes": {
- "description": "The notes of the goal.",
- "shortDescription": "The notes of the goal.",
- "uiOrder": 2,
- "title": "Goal Note",
- "format": "string"
- },
- "html-notes": {
- "description": "The notes of the goal in HTML format.",
- "shortDescription": "The notes of the goal in HTML format.",
- "uiOrder": 3,
- "title": "Goal HTML Note",
- "format": "string"
- },
- "due-on": {
- "description": "The date on which the goal is due. In the format YYYY-MM-DD.",
- "shortDescription": "Due Date",
- "uiOrder": 4,
- "title": "Due Date",
- "format": "string"
- },
- "start-on": {
- "description": "The date on which the goal starts. In the format YYYY-MM-DD.",
- "shortDescription": "Start Date",
- "uiOrder": 5,
- "title": "Start Date",
- "format": "string"
- },
- "liked": {
- "description": "Whether the goal is liked by the user.",
- "shortDescription": "Liked",
- "uiOrder": 6,
- "title": "Liked",
- "format": "boolean"
- },
- "likes": {
- "description": "The users who likes the goal.",
- "shortDescription": "The users who likes the goal.",
- "uiOrder": 7,
- "title": "Likes",
- "items": {
- "properties": {
- "like-gid": {
- "description": "Globally unique identifier (GID) for the like.",
- "shortDescription": "Like ID",
- "uiOrder": 0,
- "title": "Like ID",
- "format": "string"
- },
- "user-gid": {
- "description": "Globally unique identifier (GID) for the user.",
- "shortDescription": "User ID",
- "uiOrder": 0,
- "title": "User ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the user.",
- "shortDescription": "User Name",
- "uiOrder": 1,
- "title": "User Name",
- "format": "string"
- }
- },
- "required": [
- "like-gid",
- "user-gid",
- "name"
- ],
- "format": "object"
- },
- "format": "array"
- }
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CRUD_TASK": {
- "description": "Create, Update, Delete, Read and Duplicate Task in Asana.",
- "shortDescription": "Task Related Task, including get, update, delete, create, duplicate",
- "input": {
- "description": "Task Related Task, including get, update, delete, create, duplicate.",
- "shortDescription": "Task Related Task, including get, update, delete, create, duplicate",
- "uiOrder": 0,
- "properties": {
- "action": {
- "title": "Action",
- "description": "Action.",
- "uiOrder": 1,
- "additionalProperties": true,
- "required": [
- "action"
- ],
- "oneOf": [
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "get",
- "description": "Get Task.",
- "uiOrder": 0,
- "format": "string"
- },
- "task-gid": {
- "description": "Globally unique identifier (GID) for the task.",
- "shortDescription": "Task ID",
- "uiOrder": 0,
- "title": "Task ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "task-gid"
- ],
- "title": "Get",
- "description": "Get Task.",
- "uiOrder": 0,
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "update",
- "description": "Update Task.",
- "uiOrder": 0,
- "format": "string"
- },
- "task-gid": {
- "description": "Globally unique identifier (GID) for the task.",
- "shortDescription": "Task ID",
- "uiOrder": 0,
- "title": "Task ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "name": {
- "description": "Name of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.",
- "shortDescription": "Name of the task",
- "uiOrder": 1,
- "title": "Name of the task",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "resource-subtype": {
- "description": "The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning.",
- "shortDescription": "The subtype of this resource",
- "uiOrder": 2,
- "title": "Resource Subtype",
- "enum": [
- "default_task",
- "milestone",
- "section",
- "approval",
- "custom"
- ],
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "approval-status": {
- "description": "The approval status of the task. If you set completed to true, this field will be set to approved.",
- "shortDescription": "The approval status of the task",
- "uiOrder": 3,
- "title": "Approval Status",
- "enum": [
- "pending",
- "approved",
- "rejected",
- "changes_requested"
- ],
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "completed": {
- "description": "Whether the task is currently marked complete.",
- "shortDescription": "Whether the task is currently marked complete",
- "uiOrder": 4,
- "title": "Completed",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "liked": {
- "description": "Whether the task is liked by the user.",
- "shortDescription": "Whether the task is liked by the user",
- "uiOrder": 5,
- "title": "Liked",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "notes": {
- "description": "Free-form textual information associated with the task (i.e. its description).",
- "shortDescription": "Notes of the task",
- "uiOrder": 6,
- "title": "Notes of the task",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "assignee": {
- "description": "GID of the assignee.",
- "shortDescription": "GID of the assignee",
- "uiOrder": 7,
- "title": "Assignee",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "parent": {
- "description": "GID of the parent task.",
- "shortDescription": "GID of the parent task",
- "uiOrder": 8,
- "title": "Parent Task",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "task-gid",
- "liked"
- ],
- "description": "Update Task.",
- "uiOrder": 0,
- "title": "Update",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "delete",
- "description": "Delete Task.",
- "uiOrder": 0,
- "format": "string"
- },
- "task-gid": {
- "description": "Globally unique identifier (GID) for the task.",
- "shortDescription": "Task ID",
- "uiOrder": 0,
- "title": "Task ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "task-gid"
- ],
- "description": "Delete Task.",
- "uiOrder": 0,
- "title": "Delete",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "create",
- "description": "Create Task.",
- "uiOrder": 0,
- "format": "string"
- },
- "name": {
- "description": "The name of the task.",
- "shortDescription": "Task Name",
- "uiOrder": 1,
- "title": "Task Name",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "notes": {
- "description": "The notes of the task.",
- "shortDescription": "Task Notes",
- "uiOrder": 2,
- "title": "Task Notes",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "resource-subtype": {
- "default": "default_task",
- "description": "The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning.",
- "shortDescription": "The subtype of this resource",
- "uiOrder": 2,
- "title": "Resource Subtype",
- "enum": [
- "default_task",
- "milestone",
- "section",
- "approval",
- "custom"
- ],
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "approval-status": {
- "description": "The approval status of the task. If you set completed to true, this field will be set to approved.",
- "shortDescription": "The approval status of the task",
- "uiOrder": 3,
- "title": "Approval Status",
- "enum": [
- "pending",
- "approved",
- "rejected",
- "changes_requested"
- ],
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "completed": {
- "description": "Whether the task is currently marked complete.",
- "shortDescription": "Whether the task is currently marked complete",
- "uiOrder": 4,
- "title": "Completed",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "liked": {
- "description": "Whether the task is liked by the user.",
- "shortDescription": "Whether the task is liked by the user",
- "uiOrder": 5,
- "title": "Liked",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "assignee": {
- "description": "GID of the assignee.",
- "shortDescription": "GID of the assignee",
- "uiOrder": 7,
- "title": "Assignee",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "parent": {
- "description": "GID of the parent task.",
- "shortDescription": "GID of the parent task",
- "uiOrder": 8,
- "title": "Parent Task",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "start-at": {
- "description": "The UTC date and time on which this task is due, or null if the task has no due time. This takes an ISO 8601 date string in UTC.",
- "shortDescription": "Start Date & Time. In format like 2021-09-01T00:00:00Z",
- "uiOrder": 9,
- "title": "Start Date & Time",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "due-at": {
- "description": "Date and time on which work begins for the task, or null if the task has no start time. This takes an ISO 8601 date string in UTC.",
- "shortDescription": "Due Date & Time. In format like 2021-09-01T00:00:00Z",
- "uiOrder": 10,
- "title": "Due Date & Time",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "workspace": {
- "description": "GID of the workspace. You can find one by filling the access token in the Asana API Playground.",
- "shortDescription": "GID of the workspace",
- "uiOrder": 11,
- "title": "Workspace",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "workspace",
- "name",
- "liked"
- ],
- "description": "Create Task.",
- "uiOrder": 0,
- "title": "Create",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "duplicate",
- "description": "Duplicate Task.",
- "uiOrder": 0,
- "format": "string"
- },
- "task-gid": {
- "description": "Globally unique identifier (GID) for the task.",
- "shortDescription": "Task ID",
- "uiOrder": 0,
- "title": "Task ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "name": {
- "description": "Name of the new task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.",
- "shortDescription": "Name of the new task",
- "uiOrder": 1,
- "title": "Name",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "task-gid",
- "name"
- ],
- "description": "Duplicate Task.",
- "uiOrder": 0,
- "title": "Duplicate",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "set parent",
- "description": "Set Parent Task.",
- "uiOrder": 0,
- "format": "string"
- },
- "task-gid": {
- "description": "Globally unique identifier (GID) for the task.",
- "shortDescription": "Task ID",
- "uiOrder": 0,
- "title": "Task ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "parent": {
- "description": "GID of the parent task.",
- "shortDescription": "GID of the parent task",
- "uiOrder": 1,
- "title": "Parent Task",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "task-gid",
- "parent"
- ],
- "description": "Set Parent Task.",
- "uiOrder": 0,
- "title": "Set Parent",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "edit tag",
- "description": "Edit Tag.",
- "uiOrder": 0,
- "format": "string"
- },
- "task-gid": {
- "description": "Globally unique identifier (GID) for the task.",
- "shortDescription": "Task ID",
- "uiOrder": 0,
- "title": "Task ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "tag-gid": {
- "description": "Globally unique identifier (GID) for the tag.",
- "shortDescription": "Tag ID",
- "uiOrder": 1,
- "title": "Tag ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "edit-option": {
- "default": "add",
- "description": "Edit option. You can choose to add or remove the tag.",
- "shortDescription": "Edit option",
- "uiOrder": 2,
- "title": "Edit option",
- "enum": [
- "add",
- "remove"
- ],
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "task-gid",
- "tag-gid",
- "edit-option"
- ],
- "description": "Edit Tag.",
- "uiOrder": 0,
- "title": "Edit Tag",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "edit follower",
- "description": "Edit follower.",
- "uiOrder": 0,
- "format": "string"
- },
- "task-gid": {
- "description": "Globally unique identifier (GID) for the task.",
- "shortDescription": "Task ID",
- "uiOrder": 0,
- "title": "Task ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "followers": {
- "description": "This can either be the string \"me\", an email, or the gid of a user. For multiple followers, separate them with commas.",
- "shortDescription": "Followers' Identifications, can either be the string \"me\", an email, or the gid of a user.",
- "uiOrder": 1,
- "title": "Followers",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "edit-option": {
- "default": "add",
- "description": "Edit option. You can choose to add or remove the follower.",
- "shortDescription": "Edit option",
- "uiOrder": 2,
- "title": "Edit option",
- "enum": [
- "add",
- "remove"
- ],
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "task-gid",
- "followers",
- "edit-option"
- ],
- "description": "Edit Follower.",
- "uiOrder": 0,
- "title": "Edit Follower",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "edit project",
- "description": "Edit project.",
- "uiOrder": 0,
- "format": "string"
- },
- "task-gid": {
- "description": "Globally unique identifier (GID) for the task.",
- "shortDescription": "Task ID",
- "uiOrder": 0,
- "title": "Task ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "project-gid": {
- "description": "Globally unique identifier (GID) for the project.",
- "shortDescription": "Project ID",
- "uiOrder": 1,
- "title": "Project ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "edit-option": {
- "default": "add",
- "description": "Edit option. You can choose to add or remove the project.",
- "shortDescription": "Edit option",
- "uiOrder": 2,
- "title": "Edit option",
- "enum": [
- "add",
- "remove"
- ],
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "task-gid",
- "project-gid",
- "edit-option"
- ],
- "description": "Edit Project.",
- "uiOrder": 0,
- "title": "Edit Project",
- "format": "object"
- }
- ],
- "format": "object"
- }
- },
- "required": [],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Task.",
- "uiOrder": 0,
- "properties": {
- "gid": {
- "description": "Globally unique identifier (GID) for the task.",
- "shortDescription": "Task ID",
- "uiOrder": 0,
- "title": "Task ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the task.",
- "shortDescription": "Task Name",
- "uiOrder": 1,
- "title": "Task Name",
- "format": "string"
- },
- "notes": {
- "description": "The notes of the task.",
- "shortDescription": "Task Notes",
- "uiOrder": 2,
- "title": "Task Notes",
- "format": "string"
- },
- "html-notes": {
- "description": "The notes of the task in HTML format.",
- "shortDescription": "Task Notes in HTML format",
- "uiOrder": 3,
- "title": "Task Notes in HTML format",
- "format": "string"
- },
- "projects": {
- "description": "The projects of the task.",
- "shortDescription": "The projects of the task.",
- "uiOrder": 4,
- "title": "Projects",
- "items": {
- "properties": {
- "gid": {
- "description": "Globally unique identifier (GID) for the project.",
- "shortDescription": "Project ID",
- "uiOrder": 0,
- "title": "Project ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the project.",
- "shortDescription": "Project Name",
- "uiOrder": 1,
- "title": "Project Name",
- "format": "string"
- }
- },
- "required": [
- "gid",
- "name"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "due-on": {
- "description": "The date on which the task is due. In the format YYYY-MM-DD.",
- "shortDescription": "Due Date",
- "uiOrder": 4,
- "title": "Due Date",
- "format": "string"
- },
- "start-on": {
- "description": "The date on which the task starts. In the format YYYY-MM-DD.",
- "shortDescription": "Start Date",
- "uiOrder": 5,
- "title": "Start Date",
- "format": "string"
- },
- "liked": {
- "description": "Whether the task is liked by the user.",
- "shortDescription": "Liked",
- "uiOrder": 6,
- "title": "Liked",
- "format": "boolean"
- },
- "likes": {
- "description": "The users who likes the task.",
- "shortDescription": "The users who likes the task.",
- "uiOrder": 7,
- "title": "Likes",
- "items": {
- "properties": {
- "like-gid": {
- "description": "Globally unique identifier (GID) for the like.",
- "shortDescription": "Like ID",
- "uiOrder": 0,
- "title": "Like ID",
- "format": "string"
- },
- "user-gid": {
- "description": "Globally unique identifier (GID) for the user.",
- "shortDescription": "User ID",
- "uiOrder": 0,
- "title": "User ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the user.",
- "shortDescription": "User Name",
- "uiOrder": 1,
- "title": "User Name",
- "format": "string"
- }
- },
- "required": [
- "like-gid",
- "user-gid",
- "name"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "approval-status": {
- "description": "The approval status of the task. If you set completed to true, this field will be set to approved.",
- "shortDescription": "The approval status of the task",
- "uiOrder": 8,
- "title": "Approval Status",
- "format": "string"
- },
- "resource-subtype": {
- "description": "The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning.",
- "shortDescription": "The subtype of this resource",
- "uiOrder": 9,
- "title": "Resource Subtype",
- "format": "string"
- },
- "completed": {
- "description": "Whether the task is currently marked complete.",
- "shortDescription": "Whether the task is currently marked complete",
- "uiOrder": 10,
- "title": "Completed",
- "format": "boolean"
- },
- "assignee": {
- "description": "GID of the assignee.",
- "shortDescription": "GID of the assignee",
- "uiOrder": 11,
- "title": "Assignee",
- "format": "string"
- },
- "parent": {
- "description": "GID of the parent task.",
- "shortDescription": "GID of the parent task",
- "uiOrder": 12,
- "title": "Parent Task",
- "format": "string"
- }
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CRUD_PROJECT": {
- "description": "Create, Update, Delete, Read and Duplicate project in Asana.",
- "shortDescription": "Project Related Task, including get, update, delete, create, duplicate",
- "input": {
- "description": "Project Related Task, including get, update, delete, create, duplicate.",
- "uiOrder": 0,
- "properties": {
- "action": {
- "title": "Action",
- "description": "action.",
- "uiOrder": 1,
- "additionalProperties": true,
- "required": [
- "action"
- ],
- "oneOf": [
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "get",
- "description": "Get Project.",
- "uiOrder": 0,
- "format": "string"
- },
- "project-gid": {
- "description": "Globally unique identifier (GID) for the project.",
- "shortDescription": "Project ID",
- "uiOrder": 0,
- "title": "Project ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "project-gid"
- ],
- "description": "Get Project.",
- "uiOrder": 0,
- "title": "Get",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "update",
- "description": "Update Project.",
- "uiOrder": 0,
- "format": "string"
- },
- "project-gid": {
- "description": "Globally unique identifier (GID) for the project.",
- "shortDescription": "Project ID",
- "uiOrder": 0,
- "title": "Project ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "name": {
- "description": "The name of the project.",
- "shortDescription": "Update Project Name",
- "uiOrder": 1,
- "title": "Project Name",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "notes": {
- "description": "The notes of the project.",
- "shortDescription": "Update Project Note",
- "uiOrder": 2,
- "title": "Project Note",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "due-on": {
- "description": "The date on which the project is due. In the format YYYY-MM-DD.",
- "shortDescription": "Update Due Date",
- "uiOrder": 2,
- "title": "Due Date",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "start-on": {
- "description": "The date on which the project starts. In the format YYYY-MM-DD.",
- "shortDescription": "Update Start Date",
- "uiOrder": 3,
- "title": "Start Date",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "color": {
- "description": "The color of the project.",
- "shortDescription": "Update Color",
- "uiOrder": 5,
- "enum": [
- "dark-pink",
- "dark-green",
- "dark-blue",
- "dark-red",
- "dark-teal",
- "dark-brown",
- "dark-orange",
- "dark-purple",
- "dark-warm-gray",
- "light-pink",
- "light-green",
- "light-blue",
- "light-red",
- "light-teal",
- "light-brown",
- "light-orange",
- "light-purple",
- "light-warm-gray",
- "none",
- "null"
- ],
- "title": "Update Color",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "privacy-setting": {
- "description": "The privacy setting of the project.",
- "shortDescription": "Update Privacy Setting",
- "uiOrder": 6,
- "title": "Update Privacy Setting",
- "enum": [
- "public to workspace",
- "private to team",
- "private"
- ],
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "archived": {
- "description": "Whether the project is archived.",
- "shortDescription": "Whether the project is archived",
- "uiOrder": 7,
- "title": "Archived",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- }
- },
- "required": [
- "action",
- "project-gid",
- "archived"
- ],
- "description": "Update Project.",
- "uiOrder": 0,
- "title": "Update",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "delete",
- "description": "Delete project.",
- "uiOrder": 0,
- "format": "string"
- },
- "project-gid": {
- "description": "Globally unique identifier (GID) for the project.",
- "shortDescription": "Project ID",
- "uiOrder": 0,
- "title": "Project ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "project-gid"
- ],
- "description": "Delete Project.",
- "uiOrder": 0,
- "title": "Delete",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "create",
- "description": "Create project.",
- "uiOrder": 0,
- "format": "string"
- },
- "name": {
- "description": "The name of the project.",
- "shortDescription": "Update Project Name",
- "uiOrder": 1,
- "title": "Project Name",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "notes": {
- "description": "The notes of the project.",
- "shortDescription": "Update Project Note",
- "uiOrder": 2,
- "title": "Project Note",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "due-on": {
- "description": "The date on which the project is due. In the format YYYY-MM-DD.",
- "shortDescription": "Update Due Date",
- "uiOrder": 2,
- "title": "Due Date",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "start-on": {
- "description": "The date on which the project starts. In the format YYYY-MM-DD.",
- "shortDescription": "Update Start Date",
- "uiOrder": 3,
- "title": "Start Date",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "color": {
- "description": "The color of the project.",
- "shortDescription": "Update Color",
- "uiOrder": 5,
- "enum": [
- "dark-pink",
- "dark-green",
- "dark-blue",
- "dark-red",
- "dark-teal",
- "dark-brown",
- "dark-orange",
- "dark-purple",
- "dark-warm-gray",
- "light-pink",
- "light-green",
- "light-blue",
- "light-red",
- "light-teal",
- "light-brown",
- "light-orange",
- "light-purple",
- "light-warm-gray",
- "none",
- "null"
- ],
- "title": "Update Color",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "privacy-setting": {
- "description": "The privacy setting of the project.",
- "shortDescription": "Update Privacy Setting",
- "uiOrder": 6,
- "title": "Update Privacy Setting",
- "enum": [
- "public to workspace",
- "private to team",
- "private"
- ],
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "workspace": {
- "description": "Globally unique identifier (GID) for the workspace. You can find one by filling the access token in the Asana API Playground.",
- "shortDescription": "Workspace ID",
- "uiOrder": 7,
- "title": "Workspace ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "team": {
- "description": "Globally unique identifier (GID) for the team of the new project.",
- "shortDescription": "Team ID of the new project",
- "uiOrder": 8,
- "title": "Team ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "name"
- ],
- "description": "Create Project.",
- "uiOrder": 0,
- "title": "Create",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "duplicate",
- "description": "Duplicate project.",
- "uiOrder": 0,
- "format": "string"
- },
- "project-gid": {
- "description": "Globally unique identifier (GID) for the project. You can find the GID of a goal from the URL of the project in Asana. For example, if the URL of the project is https://app.asana.com/0/goal/1234567890, then the GID is 1234567890.",
- "shortDescription": "Project ID",
- "uiOrder": 0,
- "title": "Project ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "name": {
- "description": "The name of the new project.",
- "shortDescription": "New Project Name",
- "uiOrder": 1,
- "title": "New Project Name",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "team": {
- "description": "Globally unique identifier (GID) for the team of the new project. If team is not defined, the new project will be in the same team as the the original project.",
- "shortDescription": "Team ID of the new project",
- "uiOrder": 2,
- "title": "Team ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "due-on": {
- "description": "Sets the last due date in the duplicated project to the given date. The rest of the due dates will be offset by the same amount as the due dates in the original project. In the format YYYY-MM-DD.",
- "shortDescription": "Due Date (You should only specify exactly one of due-on or start-on)",
- "uiOrder": 3,
- "title": "Due Date",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "start-on": {
- "description": "Sets the first start date in the duplicated project to the given date. The rest of the start dates will be offset by the same amount as the start dates in the original project. In the format YYYY-MM-DD.",
- "shortDescription": "Start Date (You should only specify exactly one of due-on or start-on)",
- "uiOrder": 4,
- "title": "Start Date",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "should-skip-weekends": {
- "description": "Determines if the auto-shifted dates should skip weekends.",
- "shortDescription": "Determines if the auto-shifted dates should skip weekends.",
- "uiOrder": 5,
- "title": "Should Skip Weekends (For auto-shifted dates)",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- }
- },
- "required": [
- "action",
- "project-gid",
- "name"
- ],
- "description": "Duplicate Project.",
- "uiOrder": 0,
- "title": "Duplicate",
- "format": "object"
- }
- ],
- "format": "object"
- }
- },
- "required": [],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Project.",
- "uiOrder": 0,
- "properties": {
- "gid": {
- "description": "Globally unique identifier (GID) for the project.",
- "shortDescription": "Project ID",
- "uiOrder": 0,
- "title": "Project ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the project.",
- "shortDescription": "Project Name",
- "uiOrder": 1,
- "title": "Project Name",
- "format": "string"
- },
- "owner": {
- "description": "The owner of the project.",
- "shortDescription": "The owner of the project.",
- "uiOrder": 1,
- "title": "Owner",
- "properties": {
- "gid": {
- "description": "Globally unique identifier (GID) for the owner.",
- "shortDescription": "Owner ID",
- "uiOrder": 0,
- "title": "Owner ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the owner.",
- "shortDescription": "Owner Name",
- "uiOrder": 1,
- "title": "Owner Name",
- "format": "string"
- }
- },
- "required": [
- "gid",
- "name"
- ],
- "format": "object"
- },
- "notes": {
- "description": "The notes of the project.",
- "shortDescription": "The notes of the project.",
- "uiOrder": 2,
- "title": "Project Note",
- "format": "string"
- },
- "html-notes": {
- "description": "The notes of the project in HTML format.",
- "shortDescription": "The notes of the project in HTML format.",
- "uiOrder": 3,
- "title": "Project HTML Note",
- "format": "string"
- },
- "due-on": {
- "description": "The date on which the project is due. In the format YYYY-MM-DD.",
- "shortDescription": "Due Date",
- "uiOrder": 4,
- "title": "Due Date",
- "format": "string"
- },
- "start-on": {
- "description": "The date on which the project starts. In the format YYYY-MM-DD.",
- "shortDescription": "Start Date",
- "uiOrder": 5,
- "title": "Start Date",
- "format": "string"
- },
- "completed": {
- "description": "Whether the project is completed.",
- "shortDescription": "Whether the project is completed",
- "uiOrder": 6,
- "title": "Completed",
- "format": "boolean"
- },
- "color": {
- "description": "The color of the project.",
- "shortDescription": "Color",
- "uiOrder": 7,
- "title": "Color",
- "format": "string"
- },
- "privacy-setting": {
- "description": "The privacy setting of the project.",
- "shortDescription": "Privacy Setting",
- "uiOrder": 8,
- "title": "Privacy Setting",
- "format": "string"
- },
- "archived": {
- "description": "Whether the project is archived.",
- "shortDescription": "Whether the project is archived",
- "uiOrder": 9,
- "title": "Archived",
- "format": "boolean"
- },
- "completed-by": {
- "description": "The user who completed the project.",
- "shortDescription": "The user who completed the project.",
- "uiOrder": 10,
- "title": "Completed By",
- "properties": {
- "gid": {
- "description": "Globally unique identifier (GID) for the user.",
- "shortDescription": "User ID",
- "uiOrder": 0,
- "title": "User ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the user.",
- "shortDescription": "User Name",
- "uiOrder": 1,
- "title": "User Name",
- "format": "string"
- }
- },
- "required": [
- "gid",
- "name"
- ],
- "format": "object"
- },
- "current-status": {
- "description": "The current status of the project.",
- "shortDescription": "The current status of the project.",
- "uiOrder": 11,
- "title": "Current Status",
- "required": [],
- "items": {
- "properties": {},
- "required": [],
- "format": "json"
- },
- "format": "array"
- },
- "custom-fields": {
- "description": "The custom fields of the project.",
- "shortDescription": "The custom fields of the project.",
- "uiOrder": 12,
- "title": "Custom Fields",
- "required": [],
- "items": {
- "properties": {},
- "required": [],
- "format": "json"
- },
- "format": "array"
- },
- "custom-field-settings": {
- "description": "The custom field settings of the project.",
- "shortDescription": "The custom field settings of the project.",
- "uiOrder": 13,
- "title": "Custom Field Settings",
- "required": [],
- "items": {
- "properties": {},
- "required": [],
- "format": "json"
- },
- "format": "array"
- },
- "modified-at": {
- "description": "The time at which the project was last modified.",
- "shortDescription": "The time at which the project was last modified.",
- "uiOrder": 14,
- "title": "Modified At",
- "format": "string"
- }
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CRUD_PORTFOLIO": {
- "description": "Create, Update, Delete and Read portfolio in Asana.",
- "shortDescription": "Portfolio Related Task, including get, update, delete, create",
- "input": {
- "description": "Portfolio Related Task, including get, update, delete, create.",
- "uiOrder": 0,
- "properties": {
- "action": {
- "title": "Action",
- "description": "action.",
- "uiOrder": 1,
- "additionalProperties": true,
- "required": [
- "action"
- ],
- "oneOf": [
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "get",
- "description": "Get portfolio.",
- "uiOrder": 0,
- "format": "string"
- },
- "portfolio-gid": {
- "description": "Globally unique identifier (GID) for the portfolio.",
- "shortDescription": "Portfolio ID",
- "uiOrder": 0,
- "title": "Portfolio ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "portfolio-gid"
- ],
- "description": "Get Portfolio.",
- "uiOrder": 0,
- "title": "Get",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "update",
- "description": "Update portfolio.",
- "uiOrder": 0,
- "format": "string"
- },
- "portfolio-gid": {
- "description": "Globally unique identifier (GID) for the portfolio.",
- "shortDescription": "Portfolio ID",
- "uiOrder": 0,
- "title": "Portfolio ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "name": {
- "description": "The name of the portfolio.",
- "shortDescription": "Update Portfolio Name",
- "uiOrder": 1,
- "title": "Portfolio Name",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "color": {
- "description": "The color of the portfolio.",
- "shortDescription": "Update Color",
- "uiOrder": 5,
- "enum": [
- "dark-pink",
- "dark-green",
- "dark-blue",
- "dark-red",
- "dark-teal",
- "dark-brown",
- "dark-orange",
- "dark-purple",
- "dark-warm-gray",
- "light-pink",
- "light-green",
- "light-blue",
- "light-red",
- "light-teal",
- "light-brown",
- "light-orange",
- "light-purple",
- "light-warm-gray",
- "none",
- "null"
- ],
- "title": "Update Color",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "public": {
- "description": "Whether the portfolio is public.",
- "shortDescription": "Whether the portfolio is public",
- "uiOrder": 6,
- "title": "Public",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "workspace": {
- "description": "The workspace of the portfolio. Please fill in the Globally unique identifier (GID) for the workspace.",
- "shortDescription": "The workspace of the portfolio.",
- "uiOrder": 7,
- "title": "Workspace",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "portfolio-gid"
- ],
- "description": "Update Portfolio.",
- "uiOrder": 0,
- "title": "Update",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "delete",
- "description": "Delete portfolio.",
- "uiOrder": 0,
- "format": "string"
- },
- "portfolio-gid": {
- "description": "Globally unique identifier (GID) for the portfolio.",
- "shortDescription": "Portfolio ID",
- "uiOrder": 0,
- "title": "Portfolio ID",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "portfolio-gid"
- ],
- "description": "Delete Portfolio.",
- "uiOrder": 0,
- "title": "Delete",
- "format": "object"
- },
- {
- "properties": {
- "action": {
- "title": "Action",
- "const": "create",
- "description": "Create portfolio.",
- "uiOrder": 0,
- "format": "string"
- },
- "name": {
- "description": "The name of the portfolio.",
- "shortDescription": "Portfolio Name",
- "uiOrder": 1,
- "title": "Portfolio Name",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "color": {
- "description": "The color of the portfolio.",
- "shortDescription": "Color",
- "uiOrder": 5,
- "enum": [
- "dark-pink",
- "dark-green",
- "dark-blue",
- "dark-red",
- "dark-teal",
- "dark-brown",
- "dark-orange",
- "dark-purple",
- "dark-warm-gray",
- "light-pink",
- "light-green",
- "light-blue",
- "light-red",
- "light-teal",
- "light-brown",
- "light-orange",
- "light-purple",
- "light-warm-gray",
- "none",
- "null"
- ],
- "title": "Color",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "public": {
- "description": "Whether the portfolio is public.",
- "shortDescription": "Whether the portfolio is public",
- "uiOrder": 6,
- "title": "Public",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "workspace": {
- "description": "The workspace of the portfolio. Please fill in the Globally unique identifier (GID) for the workspace.",
- "shortDescription": "The workspace of the portfolio.",
- "uiOrder": 7,
- "title": "Workspace",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "action",
- "workspace",
- "name",
- "public"
- ],
- "description": "Create Portfolio.",
- "uiOrder": 0,
- "title": "Create",
- "format": "object"
- }
- ],
- "format": "object"
- }
- },
- "required": [],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Portfolio.",
- "uiOrder": 0,
- "properties": {
- "gid": {
- "description": "Globally unique identifier (GID) for the portfolio.",
- "shortDescription": "Portfolio ID",
- "uiOrder": 0,
- "title": "Portfolio ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the portfolio.",
- "shortDescription": "Portfolio Name",
- "uiOrder": 1,
- "title": "Portfolio Name",
- "format": "string"
- },
- "owner": {
- "description": "The owner of the portfolio.",
- "shortDescription": "The owner of the portfolio.",
- "uiOrder": 1,
- "title": "Owner",
- "properties": {
- "gid": {
- "description": "Globally unique identifier (GID) for the owner.",
- "shortDescription": "Owner ID",
- "uiOrder": 0,
- "title": "Owner ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the owner.",
- "shortDescription": "Owner Name",
- "uiOrder": 1,
- "title": "Owner Name",
- "format": "string"
- }
- },
- "required": [
- "gid",
- "name"
- ],
- "format": "object"
- },
- "due-on": {
- "description": "The date on which the portfolio is due. In the format YYYY-MM-DD.",
- "shortDescription": "Due Date",
- "uiOrder": 4,
- "title": "Due Date",
- "format": "string"
- },
- "start-on": {
- "description": "The date on which the portfolio starts. In the format YYYY-MM-DD.",
- "shortDescription": "Start Date",
- "uiOrder": 5,
- "title": "Start Date",
- "format": "string"
- },
- "color": {
- "description": "The color of the portfolio.",
- "shortDescription": "Color",
- "uiOrder": 7,
- "title": "Color",
- "format": "string"
- },
- "public": {
- "description": "Whether the portfolio is public.",
- "shortDescription": "Whether the portfolio is public",
- "uiOrder": 8,
- "title": "Public",
- "format": "boolean"
- },
- "created-by": {
- "description": "The user who created the portfolio.",
- "shortDescription": "The user who created the portfolio.",
- "uiOrder": 10,
- "title": "Created By",
- "properties": {
- "gid": {
- "description": "Globally unique identifier (GID) for the user.",
- "shortDescription": "User ID",
- "uiOrder": 0,
- "title": "User ID",
- "format": "string"
- },
- "name": {
- "description": "The name of the user.",
- "shortDescription": "User Name",
- "uiOrder": 1,
- "title": "User Name",
- "format": "string"
- }
- },
- "required": [
- "gid",
- "name"
- ],
- "format": "object"
- },
- "current-status": {
- "description": "The current status of the portfolio.",
- "shortDescription": "The current status of the portfolio.",
- "uiOrder": 11,
- "title": "Current Status",
- "required": [],
- "items": {
- "properties": {},
- "required": [],
- "format": "json"
- },
- "format": "array"
- },
- "custom-fields": {
- "description": "The custom fields of the portfolio.",
- "shortDescription": "The custom fields of the portfolio.",
- "uiOrder": 12,
- "title": "Custom Fields",
- "required": [],
- "items": {
- "properties": {},
- "required": [],
- "format": "json"
- },
- "format": "array"
- },
- "custom-field-settings": {
- "description": "The custom field settings of the portfolio.",
- "shortDescription": "The custom field settings of the portfolio.",
- "uiOrder": 13,
- "title": "Custom Field Settings",
- "required": [],
- "items": {
- "properties": {},
- "required": [],
- "format": "json"
- },
- "format": "array"
- }
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/asana/v0/config/tasks.yaml b/pkg/component/application/asana/v0/config/tasks.yaml
new file mode 100644
index 000000000..7cec4bdd2
--- /dev/null
+++ b/pkg/component/application/asana/v0/config/tasks.yaml
@@ -0,0 +1,1796 @@
+TASK_CRUD_GOAL:
+ description: Create, Update, Delete, Read and Duplicate goal in Asana.
+ shortDescription: Goal Related Task, including get, update, delete, create, duplicate
+ input:
+ description: Goal Related Task, including get, update, delete, create, duplicate.
+ uiOrder: 0
+ properties:
+ action:
+ title: Action
+ description: action.
+ uiOrder: 1
+ additionalProperties: true
+ required:
+ - action
+ oneOf:
+ - properties:
+ action:
+ title: Action
+ const: get
+ description: Get Goal.
+ uiOrder: 0
+ format: string
+ goal-gid:
+ description: Globally unique identifier (GID) for the goal. You can
+ find the GID of a goal from the URL of the goal in Asana. For example,
+ if the URL of the goal is https://app.asana.com/0/goal/1234567890,
+ then the GID is 1234567890.
+ shortDescription: Goal ID
+ uiOrder: 0
+ title: Goal ID
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - goal-gid
+ title: Get
+ description: Get Goal.
+ uiOrder: 0
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: update
+ description: Update Goal.
+ uiOrder: 0
+ format: string
+ goal-gid:
+ description: Globally unique identifier (GID) for the goal. You can
+ find the GID of a goal from the URL of the goal in Asana. For example,
+ if the URL of the goal is https://app.asana.com/0/goal/1234567890,
+ then the GID is 1234567890.
+ shortDescription: Goal ID
+ uiOrder: 0
+ title: Goal ID
+ acceptFormats:
+ - string
+ format: string
+ name:
+ description: The name of the goal.
+ shortDescription: Update Goal Name
+ uiOrder: 1
+ title: Goal Name
+ acceptFormats:
+ - string
+ format: string
+ notes:
+ description: The notes of the goal.
+ shortDescription: Update Goal Note
+ uiOrder: 2
+ title: Goal Note
+ acceptFormats:
+ - string
+ format: string
+ due-on:
+ description: The date on which the goal is due. In the format YYYY-MM-DD.
+ shortDescription: Update Due Date
+ uiOrder: 2
+ title: Due Date
+ acceptFormats:
+ - string
+ format: string
+ start-on:
+ description: The date on which the goal starts. In the format YYYY-MM-DD.
+ shortDescription: Update Start Date
+ uiOrder: 3
+ title: Start Date
+ acceptFormats:
+ - string
+ format: string
+ liked:
+ description: Whether the goal is liked by the user.
+ shortDescription: Liked
+ uiOrder: 4
+ title: Liked
+ acceptFormats:
+ - boolean
+ format: boolean
+ status:
+ description: The current status of this goal. When the goal is open,
+ its status can be green, yellow, and red to reflect "On Track", "At
+ Risk", and "Off Track", respectively. When the goal is closed, the
+ value can be missed, achieved, partial, or dropped.
+ shortDescription: Update Status
+ uiOrder: 5
+ enum:
+ - green
+ - yellow
+ - red
+ - missed
+ - achieved
+ - partial
+ - dropped
+ title: Status
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - goal-gid
+ - liked
+ title: Update
+ description: Update Goal.
+ uiOrder: 0
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: delete
+ uiOrder: 0
+ description: Delete goal.
+ format: string
+ goal-gid:
+ description: Globally unique identifier (GID) for the goal. You can
+ find the GID of a goal from the URL of the goal in Asana. For example,
+ if the URL of the goal is https://app.asana.com/0/goal/1234567890,
+ then the GID is 1234567890.
+ shortDescription: Goal ID
+ uiOrder: 0
+ title: Goal ID
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - goal-gid
+ title: Delete
+ description: Delete Goal.
+ uiOrder: 0
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: create
+ description: Create Goal.
+ uiOrder: 0
+ format: string
+ name:
+ description: The name of the goal.
+ shortDescription: Goal Name
+ uiOrder: 1
+ title: Goal Name
+ acceptFormats:
+ - string
+ format: string
+ notes:
+ description: The notes of the goal.
+ shortDescription: Goal Note
+ uiOrder: 2
+ title: Goal Note
+ acceptFormats:
+ - string
+ format: string
+ due-on:
+ description: The date on which the goal is due. In the format YYYY-MM-DD.
+ shortDescription: Due Date
+ uiOrder: 2
+ title: Due Date
+ acceptFormats:
+ - string
+ format: string
+ start-on:
+ description: The date on which the goal starts. In the format YYYY-MM-DD.
+ shortDescription: Start Date
+ uiOrder: 3
+ title: Start Date
+ acceptFormats:
+ - string
+ format: string
+ liked:
+ description: Whether the goal is liked by the user.
+ shortDescription: Liked
+ uiOrder: 4
+ title: Liked
+ acceptFormats:
+ - boolean
+ format: boolean
+ workspace:
+ description: GID of the workspace. You can find one by filling the
+ access token in the Asana
+ API Playground.
+ shortDescription: GID of the workspace
+ uiOrder: 5
+ title: Workspace
+ acceptFormats:
+ - string
+ format: string
+ time-period:
+ description: GID of the time period. You can find one by filling the
+ workspace id in the Asana
+ API Playground.
+ shortDescription: Time Period
+ uiOrder: 6
+ title: Time Period
+ acceptFormats:
+ - string
+ format: string
+ owner:
+ description: User GID of the Owner. You can find one by filling the
+ workspace id in the Asana
+ API Playground.
+ shortDescription: Owner
+ uiOrder: 7
+ title: Owner
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - name
+ - liked
+ title: Create
+ description: Create Goal.
+ uiOrder: 0
+ format: object
+ format: object
+ required: []
+ title: Input
+ format: object
+ output:
+ description: Goal.
+ uiOrder: 0
+ properties:
+ gid:
+ description: Globally unique identifier (GID) for the goal.
+ shortDescription: Goal ID
+ uiOrder: 0
+ title: Goal ID
+ format: string
+ name:
+ description: The name of the goal.
+ shortDescription: Goal Name
+ uiOrder: 1
+ title: Goal Name
+ format: string
+ owner:
+ description: The owner of the goal.
+ shortDescription: The owner of the goal.
+ uiOrder: 1
+ title: Owner
+ properties:
+ gid:
+ description: Globally unique identifier (GID) for the owner.
+ shortDescription: Owner ID
+ uiOrder: 0
+ title: Owner ID
+ format: string
+ name:
+ description: The name of the owner.
+ shortDescription: Owner Name
+ uiOrder: 1
+ title: Owner Name
+ format: string
+ required:
+ - gid
+ - name
+ format: object
+ notes:
+ description: The notes of the goal.
+ shortDescription: The notes of the goal.
+ uiOrder: 2
+ title: Goal Note
+ format: string
+ html-notes:
+ description: The notes of the goal in HTML format.
+ shortDescription: The notes of the goal in HTML format.
+ uiOrder: 3
+ title: Goal HTML Note
+ format: string
+ due-on:
+ description: The date on which the goal is due. In the format YYYY-MM-DD.
+ shortDescription: Due Date
+ uiOrder: 4
+ title: Due Date
+ format: string
+ start-on:
+ description: The date on which the goal starts. In the format YYYY-MM-DD.
+ shortDescription: Start Date
+ uiOrder: 5
+ title: Start Date
+ format: string
+ liked:
+ description: Whether the goal is liked by the user.
+ shortDescription: Liked
+ uiOrder: 6
+ title: Liked
+ format: boolean
+ likes:
+ description: The users who likes the goal.
+ shortDescription: The users who likes the goal.
+ uiOrder: 7
+ title: Likes
+ items:
+ properties:
+ like-gid:
+ description: Globally unique identifier (GID) for the like.
+ shortDescription: Like ID
+ uiOrder: 0
+ title: Like ID
+ format: string
+ user-gid:
+ description: Globally unique identifier (GID) for the user.
+ shortDescription: User ID
+ uiOrder: 0
+ title: User ID
+ format: string
+ name:
+ description: The name of the user.
+ shortDescription: User Name
+ uiOrder: 1
+ title: User Name
+ format: string
+ required:
+ - like-gid
+ - user-gid
+ - name
+ format: object
+ format: array
+ required: []
+ title: Output
+ format: object
+TASK_CRUD_TASK:
+ description: Create, Update, Delete, Read and Duplicate Task in Asana.
+ shortDescription: Task Related Task, including get, update, delete, create, duplicate
+ input:
+ description: Task Related Task, including get, update, delete, create, duplicate.
+ shortDescription: Task Related Task, including get, update, delete, create, duplicate
+ uiOrder: 0
+ properties:
+ action:
+ title: Action
+ description: Action.
+ uiOrder: 1
+ additionalProperties: true
+ required:
+ - action
+ oneOf:
+ - properties:
+ action:
+ title: Action
+ const: get
+ description: Get Task.
+ uiOrder: 0
+ format: string
+ task-gid:
+ description: Globally unique identifier (GID) for the task.
+ shortDescription: Task ID
+ uiOrder: 0
+ title: Task ID
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - task-gid
+ title: Get
+ description: Get Task.
+ uiOrder: 0
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: update
+ description: Update Task.
+ uiOrder: 0
+ format: string
+ task-gid:
+ description: Globally unique identifier (GID) for the task.
+ shortDescription: Task ID
+ uiOrder: 0
+ title: Task ID
+ acceptFormats:
+ - string
+ format: string
+ name:
+ description: Name of the task. This is generally a short sentence fragment
+ that fits on a line in the UI for maximum readability. However, it
+ can be longer.
+ shortDescription: Name of the task
+ uiOrder: 1
+ title: Name of the task
+ acceptFormats:
+ - string
+ format: string
+ resource-subtype:
+ description: The subtype of this resource. Different subtypes retain
+ many of the same fields and behavior, but may render differently in
+ Asana or represent resources with different semantic meaning.
+ shortDescription: The subtype of this resource
+ uiOrder: 2
+ title: Resource Subtype
+ enum:
+ - default_task
+ - milestone
+ - section
+ - approval
+ - custom
+ acceptFormats:
+ - string
+ format: string
+ approval-status:
+ description: The approval status of the task. If you set completed to
+ true, this field will be set to approved.
+ shortDescription: The approval status of the task
+ uiOrder: 3
+ title: Approval Status
+ enum:
+ - pending
+ - approved
+ - rejected
+ - changes_requested
+ acceptFormats:
+ - string
+ format: string
+ completed:
+ description: Whether the task is currently marked complete.
+ shortDescription: Whether the task is currently marked complete
+ uiOrder: 4
+ title: Completed
+ acceptFormats:
+ - boolean
+ format: boolean
+ liked:
+ description: Whether the task is liked by the user.
+ shortDescription: Whether the task is liked by the user
+ uiOrder: 5
+ title: Liked
+ acceptFormats:
+ - boolean
+ format: boolean
+ notes:
+ description: Free-form textual information associated with the task
+ (i.e. its description).
+ shortDescription: Notes of the task
+ uiOrder: 6
+ title: Notes of the task
+ acceptFormats:
+ - string
+ format: string
+ assignee:
+ description: GID of the assignee.
+ shortDescription: GID of the assignee
+ uiOrder: 7
+ title: Assignee
+ acceptFormats:
+ - string
+ format: string
+ parent:
+ description: GID of the parent task.
+ shortDescription: GID of the parent task
+ uiOrder: 8
+ title: Parent Task
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - task-gid
+ - liked
+ description: Update Task.
+ uiOrder: 0
+ title: Update
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: delete
+ description: Delete Task.
+ uiOrder: 0
+ format: string
+ task-gid:
+ description: Globally unique identifier (GID) for the task.
+ shortDescription: Task ID
+ uiOrder: 0
+ title: Task ID
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - task-gid
+ description: Delete Task.
+ uiOrder: 0
+ title: Delete
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: create
+ description: Create Task.
+ uiOrder: 0
+ format: string
+ name:
+ description: The name of the task.
+ shortDescription: Task Name
+ uiOrder: 1
+ title: Task Name
+ acceptFormats:
+ - string
+ format: string
+ notes:
+ description: The notes of the task.
+ shortDescription: Task Notes
+ uiOrder: 2
+ title: Task Notes
+ acceptFormats:
+ - string
+ format: string
+ resource-subtype:
+ default: default_task
+ description: The subtype of this resource. Different subtypes retain
+ many of the same fields and behavior, but may render differently in
+ Asana or represent resources with different semantic meaning.
+ shortDescription: The subtype of this resource
+ uiOrder: 2
+ title: Resource Subtype
+ enum:
+ - default_task
+ - milestone
+ - section
+ - approval
+ - custom
+ acceptFormats:
+ - string
+ format: string
+ approval-status:
+ description: The approval status of the task. If you set completed to
+ true, this field will be set to approved.
+ shortDescription: The approval status of the task
+ uiOrder: 3
+ title: Approval Status
+ enum:
+ - pending
+ - approved
+ - rejected
+ - changes_requested
+ acceptFormats:
+ - string
+ format: string
+ completed:
+ description: Whether the task is currently marked complete.
+ shortDescription: Whether the task is currently marked complete
+ uiOrder: 4
+ title: Completed
+ acceptFormats:
+ - boolean
+ format: boolean
+ liked:
+ description: Whether the task is liked by the user.
+ shortDescription: Whether the task is liked by the user
+ uiOrder: 5
+ title: Liked
+ acceptFormats:
+ - boolean
+ format: boolean
+ assignee:
+ description: GID of the assignee.
+ shortDescription: GID of the assignee
+ uiOrder: 7
+ title: Assignee
+ acceptFormats:
+ - string
+ format: string
+ parent:
+ description: GID of the parent task.
+ shortDescription: GID of the parent task
+ uiOrder: 8
+ title: Parent Task
+ acceptFormats:
+ - string
+ format: string
+ start-at:
+ description: The UTC date and time on which this task is due, or null
+ if the task has no due time. This takes an ISO 8601 date string in
+ UTC.
+ shortDescription: Start Date & Time. In format like 2021-09-01T00:00:00Z
+ uiOrder: 9
+ title: Start Date & Time
+ acceptFormats:
+ - string
+ format: string
+ due-at:
+ description: Date and time on which work begins for the task, or null
+ if the task has no start time. This takes an ISO 8601 date string
+ in UTC.
+ shortDescription: Due Date & Time. In format like 2021-09-01T00:00:00Z
+ uiOrder: 10
+ title: Due Date & Time
+ acceptFormats:
+ - string
+ format: string
+ workspace:
+ description: GID of the workspace. You can find one by filling the
+ access token in the Asana
+ API Playground.
+ shortDescription: GID of the workspace
+ uiOrder: 11
+ title: Workspace
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - workspace
+ - name
+ - liked
+ description: Create Task.
+ uiOrder: 0
+ title: Create
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: duplicate
+ description: Duplicate Task.
+ uiOrder: 0
+ format: string
+ task-gid:
+ description: Globally unique identifier (GID) for the task.
+ shortDescription: Task ID
+ uiOrder: 0
+ title: Task ID
+ acceptFormats:
+ - string
+ format: string
+ name:
+ description: Name of the new task. This is generally a short sentence
+ fragment that fits on a line in the UI for maximum readability. However,
+ it can be longer.
+ shortDescription: Name of the new task
+ uiOrder: 1
+ title: Name
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - task-gid
+ - name
+ description: Duplicate Task.
+ uiOrder: 0
+ title: Duplicate
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: set parent
+ description: Set Parent Task.
+ uiOrder: 0
+ format: string
+ task-gid:
+ description: Globally unique identifier (GID) for the task.
+ shortDescription: Task ID
+ uiOrder: 0
+ title: Task ID
+ acceptFormats:
+ - string
+ format: string
+ parent:
+ description: GID of the parent task.
+ shortDescription: GID of the parent task
+ uiOrder: 1
+ title: Parent Task
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - task-gid
+ - parent
+ description: Set Parent Task.
+ uiOrder: 0
+ title: Set Parent
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: edit tag
+ description: Edit Tag.
+ uiOrder: 0
+ format: string
+ task-gid:
+ description: Globally unique identifier (GID) for the task.
+ shortDescription: Task ID
+ uiOrder: 0
+ title: Task ID
+ acceptFormats:
+ - string
+ format: string
+ tag-gid:
+ description: Globally unique identifier (GID) for the tag.
+ shortDescription: Tag ID
+ uiOrder: 1
+ title: Tag ID
+ acceptFormats:
+ - string
+ format: string
+ edit-option:
+ default: add
+ description: Edit option. You can choose to add or remove the tag.
+ shortDescription: Edit option
+ uiOrder: 2
+ title: Edit option
+ enum:
+ - add
+ - remove
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - task-gid
+ - tag-gid
+ - edit-option
+ description: Edit Tag.
+ uiOrder: 0
+ title: Edit Tag
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: edit follower
+ description: Edit follower.
+ uiOrder: 0
+ format: string
+ task-gid:
+ description: Globally unique identifier (GID) for the task.
+ shortDescription: Task ID
+ uiOrder: 0
+ title: Task ID
+ acceptFormats:
+ - string
+ format: string
+ followers:
+ description: This can either be the string "me", an email, or the gid
+ of a user. For multiple followers, separate them with commas.
+ shortDescription: Followers' Identifications, can either be the string
+ "me", an email, or the gid of a user.
+ uiOrder: 1
+ title: Followers
+ acceptFormats:
+ - string
+ format: string
+ edit-option:
+ default: add
+ description: Edit option. You can choose to add or remove the follower.
+ shortDescription: Edit option
+ uiOrder: 2
+ title: Edit option
+ enum:
+ - add
+ - remove
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - task-gid
+ - followers
+ - edit-option
+ description: Edit Follower.
+ uiOrder: 0
+ title: Edit Follower
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: edit project
+ description: Edit project.
+ uiOrder: 0
+ format: string
+ task-gid:
+ description: Globally unique identifier (GID) for the task.
+ shortDescription: Task ID
+ uiOrder: 0
+ title: Task ID
+ acceptFormats:
+ - string
+ format: string
+ project-gid:
+ description: Globally unique identifier (GID) for the project.
+ shortDescription: Project ID
+ uiOrder: 1
+ title: Project ID
+ acceptFormats:
+ - string
+ format: string
+ edit-option:
+ default: add
+ description: Edit option. You can choose to add or remove the project.
+ shortDescription: Edit option
+ uiOrder: 2
+ title: Edit option
+ enum:
+ - add
+ - remove
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - task-gid
+ - project-gid
+ - edit-option
+ description: Edit Project.
+ uiOrder: 0
+ title: Edit Project
+ format: object
+ format: object
+ required: []
+ title: Input
+ format: object
+ output:
+ description: Task.
+ uiOrder: 0
+ properties:
+ gid:
+ description: Globally unique identifier (GID) for the task.
+ shortDescription: Task ID
+ uiOrder: 0
+ title: Task ID
+ format: string
+ name:
+ description: The name of the task.
+ shortDescription: Task Name
+ uiOrder: 1
+ title: Task Name
+ format: string
+ notes:
+ description: The notes of the task.
+ shortDescription: Task Notes
+ uiOrder: 2
+ title: Task Notes
+ format: string
+ html-notes:
+ description: The notes of the task in HTML format.
+ shortDescription: Task Notes in HTML format
+ uiOrder: 3
+ title: Task Notes in HTML format
+ format: string
+ projects:
+ description: The projects of the task.
+ shortDescription: The projects of the task.
+ uiOrder: 4
+ title: Projects
+ items:
+ properties:
+ gid:
+ description: Globally unique identifier (GID) for the project.
+ shortDescription: Project ID
+ uiOrder: 0
+ title: Project ID
+ format: string
+ name:
+ description: The name of the project.
+ shortDescription: Project Name
+ uiOrder: 1
+ title: Project Name
+ format: string
+ required:
+ - gid
+ - name
+ format: object
+ format: array
+ due-on:
+ description: The date on which the task is due. In the format YYYY-MM-DD.
+ shortDescription: Due Date
+ uiOrder: 4
+ title: Due Date
+ format: string
+ start-on:
+ description: The date on which the task starts. In the format YYYY-MM-DD.
+ shortDescription: Start Date
+ uiOrder: 5
+ title: Start Date
+ format: string
+ liked:
+ description: Whether the task is liked by the user.
+ shortDescription: Liked
+ uiOrder: 6
+ title: Liked
+ format: boolean
+ likes:
+ description: The users who likes the task.
+ shortDescription: The users who likes the task.
+ uiOrder: 7
+ title: Likes
+ items:
+ properties:
+ like-gid:
+ description: Globally unique identifier (GID) for the like.
+ shortDescription: Like ID
+ uiOrder: 0
+ title: Like ID
+ format: string
+ user-gid:
+ description: Globally unique identifier (GID) for the user.
+ shortDescription: User ID
+ uiOrder: 0
+ title: User ID
+ format: string
+ name:
+ description: The name of the user.
+ shortDescription: User Name
+ uiOrder: 1
+ title: User Name
+ format: string
+ required:
+ - like-gid
+ - user-gid
+ - name
+ format: object
+ format: array
+ approval-status:
+ description: The approval status of the task. If you set completed to true,
+ this field will be set to approved.
+ shortDescription: The approval status of the task
+ uiOrder: 8
+ title: Approval Status
+ format: string
+ resource-subtype:
+ description: The subtype of this resource. Different subtypes retain many
+ of the same fields and behavior, but may render differently in Asana or
+ represent resources with different semantic meaning.
+ shortDescription: The subtype of this resource
+ uiOrder: 9
+ title: Resource Subtype
+ format: string
+ completed:
+ description: Whether the task is currently marked complete.
+ shortDescription: Whether the task is currently marked complete
+ uiOrder: 10
+ title: Completed
+ format: boolean
+ assignee:
+ description: GID of the assignee.
+ shortDescription: GID of the assignee
+ uiOrder: 11
+ title: Assignee
+ format: string
+ parent:
+ description: GID of the parent task.
+ shortDescription: GID of the parent task
+ uiOrder: 12
+ title: Parent Task
+ format: string
+ required: []
+ title: Output
+ format: object
+TASK_CRUD_PROJECT:
+ description: Create, Update, Delete, Read and Duplicate project in Asana.
+ shortDescription: Project Related Task, including get, update, delete, create, duplicate
+ input:
+ description: Project Related Task, including get, update, delete, create, duplicate.
+ uiOrder: 0
+ properties:
+ action:
+ title: Action
+ description: action.
+ uiOrder: 1
+ additionalProperties: true
+ required:
+ - action
+ oneOf:
+ - properties:
+ action:
+ title: Action
+ const: get
+ description: Get Project.
+ uiOrder: 0
+ format: string
+ project-gid:
+ description: Globally unique identifier (GID) for the project.
+ shortDescription: Project ID
+ uiOrder: 0
+ title: Project ID
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - project-gid
+ description: Get Project.
+ uiOrder: 0
+ title: Get
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: update
+ description: Update Project.
+ uiOrder: 0
+ format: string
+ project-gid:
+ description: Globally unique identifier (GID) for the project.
+ shortDescription: Project ID
+ uiOrder: 0
+ title: Project ID
+ acceptFormats:
+ - string
+ format: string
+ name:
+ description: The name of the project.
+ shortDescription: Update Project Name
+ uiOrder: 1
+ title: Project Name
+ acceptFormats:
+ - string
+ format: string
+ notes:
+ description: The notes of the project.
+ shortDescription: Update Project Note
+ uiOrder: 2
+ title: Project Note
+ acceptFormats:
+ - string
+ format: string
+ due-on:
+ description: The date on which the project is due. In the format YYYY-MM-DD.
+ shortDescription: Update Due Date
+ uiOrder: 2
+ title: Due Date
+ acceptFormats:
+ - string
+ format: string
+ start-on:
+ description: The date on which the project starts. In the format YYYY-MM-DD.
+ shortDescription: Update Start Date
+ uiOrder: 3
+ title: Start Date
+ acceptFormats:
+ - string
+ format: string
+ color:
+ description: The color of the project.
+ shortDescription: Update Color
+ uiOrder: 5
+ enum:
+ - dark-pink
+ - dark-green
+ - dark-blue
+ - dark-red
+ - dark-teal
+ - dark-brown
+ - dark-orange
+ - dark-purple
+ - dark-warm-gray
+ - light-pink
+ - light-green
+ - light-blue
+ - light-red
+ - light-teal
+ - light-brown
+ - light-orange
+ - light-purple
+ - light-warm-gray
+ - none
+ - 'null'
+ title: Update Color
+ acceptFormats:
+ - string
+ format: string
+ privacy-setting:
+ description: The privacy setting of the project.
+ shortDescription: Update Privacy Setting
+ uiOrder: 6
+ title: Update Privacy Setting
+ enum:
+ - public to workspace
+ - private to team
+ - private
+ acceptFormats:
+ - string
+ format: string
+ archived:
+ description: Whether the project is archived.
+ shortDescription: Whether the project is archived
+ uiOrder: 7
+ title: Archived
+ acceptFormats:
+ - boolean
+ format: boolean
+ required:
+ - action
+ - project-gid
+ - archived
+ description: Update Project.
+ uiOrder: 0
+ title: Update
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: delete
+ description: Delete project.
+ uiOrder: 0
+ format: string
+ project-gid:
+ description: Globally unique identifier (GID) for the project.
+ shortDescription: Project ID
+ uiOrder: 0
+ title: Project ID
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - project-gid
+ description: Delete Project.
+ uiOrder: 0
+ title: Delete
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: create
+ description: Create project.
+ uiOrder: 0
+ format: string
+ name:
+ description: The name of the project.
+ shortDescription: Update Project Name
+ uiOrder: 1
+ title: Project Name
+ acceptFormats:
+ - string
+ format: string
+ notes:
+ description: The notes of the project.
+ shortDescription: Update Project Note
+ uiOrder: 2
+ title: Project Note
+ acceptFormats:
+ - string
+ format: string
+ due-on:
+ description: The date on which the project is due. In the format YYYY-MM-DD.
+ shortDescription: Update Due Date
+ uiOrder: 2
+ title: Due Date
+ acceptFormats:
+ - string
+ format: string
+ start-on:
+ description: The date on which the project starts. In the format YYYY-MM-DD.
+ shortDescription: Update Start Date
+ uiOrder: 3
+ title: Start Date
+ acceptFormats:
+ - string
+ format: string
+ color:
+ description: The color of the project.
+ shortDescription: Update Color
+ uiOrder: 5
+ enum:
+ - dark-pink
+ - dark-green
+ - dark-blue
+ - dark-red
+ - dark-teal
+ - dark-brown
+ - dark-orange
+ - dark-purple
+ - dark-warm-gray
+ - light-pink
+ - light-green
+ - light-blue
+ - light-red
+ - light-teal
+ - light-brown
+ - light-orange
+ - light-purple
+ - light-warm-gray
+ - none
+ - 'null'
+ title: Update Color
+ acceptFormats:
+ - string
+ format: string
+ privacy-setting:
+ description: The privacy setting of the project.
+ shortDescription: Update Privacy Setting
+ uiOrder: 6
+ title: Update Privacy Setting
+ enum:
+ - public to workspace
+ - private to team
+ - private
+ acceptFormats:
+ - string
+ format: string
+ workspace:
+ description: Globally unique identifier (GID) for the workspace. You
+ can find one by filling the access token in the Asana
+ API Playground.
+ shortDescription: Workspace ID
+ uiOrder: 7
+ title: Workspace ID
+ acceptFormats:
+ - string
+ format: string
+ team:
+ description: Globally unique identifier (GID) for the team of the new
+ project.
+ shortDescription: Team ID of the new project
+ uiOrder: 8
+ title: Team ID
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - name
+ description: Create Project.
+ uiOrder: 0
+ title: Create
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: duplicate
+ description: Duplicate project.
+ uiOrder: 0
+ format: string
+ project-gid:
+ description: Globally unique identifier (GID) for the project. You can
+ find the GID of a goal from the URL of the project in Asana. For example,
+ if the URL of the project is https://app.asana.com/0/goal/1234567890,
+ then the GID is 1234567890.
+ shortDescription: Project ID
+ uiOrder: 0
+ title: Project ID
+ acceptFormats:
+ - string
+ format: string
+ name:
+ description: The name of the new project.
+ shortDescription: New Project Name
+ uiOrder: 1
+ title: New Project Name
+ acceptFormats:
+ - string
+ format: string
+ team:
+ description: Globally unique identifier (GID) for the team of the new
+ project. If team is not defined, the new project will be in the same
+ team as the the original project.
+ shortDescription: Team ID of the new project
+ uiOrder: 2
+ title: Team ID
+ acceptFormats:
+ - string
+ format: string
+ due-on:
+ description: Sets the last due date in the duplicated project to the
+ given date. The rest of the due dates will be offset by the same amount
+ as the due dates in the original project. In the format YYYY-MM-DD.
+ shortDescription: Due Date (You should only specify exactly one of due-on
+ or start-on)
+ uiOrder: 3
+ title: Due Date
+ acceptFormats:
+ - string
+ format: string
+ start-on:
+ description: Sets the first start date in the duplicated project to
+ the given date. The rest of the start dates will be offset by the
+ same amount as the start dates in the original project. In the format
+ YYYY-MM-DD.
+ shortDescription: Start Date (You should only specify exactly one of
+ due-on or start-on)
+ uiOrder: 4
+ title: Start Date
+ acceptFormats:
+ - string
+ format: string
+ should-skip-weekends:
+ description: Determines if the auto-shifted dates should skip weekends.
+ shortDescription: Determines if the auto-shifted dates should skip weekends.
+ uiOrder: 5
+ title: Should Skip Weekends (For auto-shifted dates)
+ acceptFormats:
+ - boolean
+ format: boolean
+ required:
+ - action
+ - project-gid
+ - name
+ description: Duplicate Project.
+ uiOrder: 0
+ title: Duplicate
+ format: object
+ format: object
+ required: []
+ title: Input
+ format: object
+ output:
+ description: Project.
+ uiOrder: 0
+ properties:
+ gid:
+ description: Globally unique identifier (GID) for the project.
+ shortDescription: Project ID
+ uiOrder: 0
+ title: Project ID
+ format: string
+ name:
+ description: The name of the project.
+ shortDescription: Project Name
+ uiOrder: 1
+ title: Project Name
+ format: string
+ owner:
+ description: The owner of the project.
+ shortDescription: The owner of the project.
+ uiOrder: 1
+ title: Owner
+ properties:
+ gid:
+ description: Globally unique identifier (GID) for the owner.
+ shortDescription: Owner ID
+ uiOrder: 0
+ title: Owner ID
+ format: string
+ name:
+ description: The name of the owner.
+ shortDescription: Owner Name
+ uiOrder: 1
+ title: Owner Name
+ format: string
+ required:
+ - gid
+ - name
+ format: object
+ notes:
+ description: The notes of the project.
+ shortDescription: The notes of the project.
+ uiOrder: 2
+ title: Project Note
+ format: string
+ html-notes:
+ description: The notes of the project in HTML format.
+ shortDescription: The notes of the project in HTML format.
+ uiOrder: 3
+ title: Project HTML Note
+ format: string
+ due-on:
+ description: The date on which the project is due. In the format YYYY-MM-DD.
+ shortDescription: Due Date
+ uiOrder: 4
+ title: Due Date
+ format: string
+ start-on:
+ description: The date on which the project starts. In the format YYYY-MM-DD.
+ shortDescription: Start Date
+ uiOrder: 5
+ title: Start Date
+ format: string
+ completed:
+ description: Whether the project is completed.
+ shortDescription: Whether the project is completed
+ uiOrder: 6
+ title: Completed
+ format: boolean
+ color:
+ description: The color of the project.
+ shortDescription: Color
+ uiOrder: 7
+ title: Color
+ format: string
+ privacy-setting:
+ description: The privacy setting of the project.
+ shortDescription: Privacy Setting
+ uiOrder: 8
+ title: Privacy Setting
+ format: string
+ archived:
+ description: Whether the project is archived.
+ shortDescription: Whether the project is archived
+ uiOrder: 9
+ title: Archived
+ format: boolean
+ completed-by:
+ description: The user who completed the project.
+ shortDescription: The user who completed the project.
+ uiOrder: 10
+ title: Completed By
+ properties:
+ gid:
+ description: Globally unique identifier (GID) for the user.
+ shortDescription: User ID
+ uiOrder: 0
+ title: User ID
+ format: string
+ name:
+ description: The name of the user.
+ shortDescription: User Name
+ uiOrder: 1
+ title: User Name
+ format: string
+ required:
+ - gid
+ - name
+ format: object
+ current-status:
+ description: The current status of the project.
+ shortDescription: The current status of the project.
+ uiOrder: 11
+ title: Current Status
+ required: []
+ items:
+ properties: {}
+ required: []
+ format: json
+ format: array
+ custom-fields:
+ description: The custom fields of the project.
+ shortDescription: The custom fields of the project.
+ uiOrder: 12
+ title: Custom Fields
+ required: []
+ items:
+ properties: {}
+ required: []
+ format: json
+ format: array
+ custom-field-settings:
+ description: The custom field settings of the project.
+ shortDescription: The custom field settings of the project.
+ uiOrder: 13
+ title: Custom Field Settings
+ required: []
+ items:
+ properties: {}
+ required: []
+ format: json
+ format: array
+ modified-at:
+ description: The time at which the project was last modified.
+ shortDescription: The time at which the project was last modified.
+ uiOrder: 14
+ title: Modified At
+ format: string
+ required: []
+ title: Output
+ format: object
+TASK_CRUD_PORTFOLIO:
+ description: Create, Update, Delete and Read portfolio in Asana.
+ shortDescription: Portfolio Related Task, including get, update, delete, create
+ input:
+ description: Portfolio Related Task, including get, update, delete, create.
+ uiOrder: 0
+ properties:
+ action:
+ title: Action
+ description: action.
+ uiOrder: 1
+ additionalProperties: true
+ required:
+ - action
+ oneOf:
+ - properties:
+ action:
+ title: Action
+ const: get
+ description: Get portfolio.
+ uiOrder: 0
+ format: string
+ portfolio-gid:
+ description: Globally unique identifier (GID) for the portfolio.
+ shortDescription: Portfolio ID
+ uiOrder: 0
+ title: Portfolio ID
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - portfolio-gid
+ description: Get Portfolio.
+ uiOrder: 0
+ title: Get
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: update
+ description: Update portfolio.
+ uiOrder: 0
+ format: string
+ portfolio-gid:
+ description: Globally unique identifier (GID) for the portfolio.
+ shortDescription: Portfolio ID
+ uiOrder: 0
+ title: Portfolio ID
+ acceptFormats:
+ - string
+ format: string
+ name:
+ description: The name of the portfolio.
+ shortDescription: Update Portfolio Name
+ uiOrder: 1
+ title: Portfolio Name
+ acceptFormats:
+ - string
+ format: string
+ color:
+ description: The color of the portfolio.
+ shortDescription: Update Color
+ uiOrder: 5
+ enum:
+ - dark-pink
+ - dark-green
+ - dark-blue
+ - dark-red
+ - dark-teal
+ - dark-brown
+ - dark-orange
+ - dark-purple
+ - dark-warm-gray
+ - light-pink
+ - light-green
+ - light-blue
+ - light-red
+ - light-teal
+ - light-brown
+ - light-orange
+ - light-purple
+ - light-warm-gray
+ - none
+ - 'null'
+ title: Update Color
+ acceptFormats:
+ - string
+ format: string
+ public:
+ description: Whether the portfolio is public.
+ shortDescription: Whether the portfolio is public
+ uiOrder: 6
+ title: Public
+ acceptFormats:
+ - boolean
+ format: boolean
+ workspace:
+ description: The workspace of the portfolio. Please fill in the Globally
+ unique identifier (GID) for the workspace.
+ shortDescription: The workspace of the portfolio.
+ uiOrder: 7
+ title: Workspace
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - portfolio-gid
+ description: Update Portfolio.
+ uiOrder: 0
+ title: Update
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: delete
+ description: Delete portfolio.
+ uiOrder: 0
+ format: string
+ portfolio-gid:
+ description: Globally unique identifier (GID) for the portfolio.
+ shortDescription: Portfolio ID
+ uiOrder: 0
+ title: Portfolio ID
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - portfolio-gid
+ description: Delete Portfolio.
+ uiOrder: 0
+ title: Delete
+ format: object
+ - properties:
+ action:
+ title: Action
+ const: create
+ description: Create portfolio.
+ uiOrder: 0
+ format: string
+ name:
+ description: The name of the portfolio.
+ shortDescription: Portfolio Name
+ uiOrder: 1
+ title: Portfolio Name
+ acceptFormats:
+ - string
+ format: string
+ color:
+ description: The color of the portfolio.
+ shortDescription: Color
+ uiOrder: 5
+ enum:
+ - dark-pink
+ - dark-green
+ - dark-blue
+ - dark-red
+ - dark-teal
+ - dark-brown
+ - dark-orange
+ - dark-purple
+ - dark-warm-gray
+ - light-pink
+ - light-green
+ - light-blue
+ - light-red
+ - light-teal
+ - light-brown
+ - light-orange
+ - light-purple
+ - light-warm-gray
+ - none
+ - 'null'
+ title: Color
+ acceptFormats:
+ - string
+ format: string
+ public:
+ description: Whether the portfolio is public.
+ shortDescription: Whether the portfolio is public
+ uiOrder: 6
+ title: Public
+ acceptFormats:
+ - boolean
+ format: boolean
+ workspace:
+ description: The workspace of the portfolio. Please fill in the Globally
+ unique identifier (GID) for the workspace.
+ shortDescription: The workspace of the portfolio.
+ uiOrder: 7
+ title: Workspace
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - action
+ - workspace
+ - name
+ - public
+ description: Create Portfolio.
+ uiOrder: 0
+ title: Create
+ format: object
+ format: object
+ required: []
+ title: Input
+ format: object
+ output:
+ description: Portfolio.
+ uiOrder: 0
+ properties:
+ gid:
+ description: Globally unique identifier (GID) for the portfolio.
+ shortDescription: Portfolio ID
+ uiOrder: 0
+ title: Portfolio ID
+ format: string
+ name:
+ description: The name of the portfolio.
+ shortDescription: Portfolio Name
+ uiOrder: 1
+ title: Portfolio Name
+ format: string
+ owner:
+ description: The owner of the portfolio.
+ shortDescription: The owner of the portfolio.
+ uiOrder: 1
+ title: Owner
+ properties:
+ gid:
+ description: Globally unique identifier (GID) for the owner.
+ shortDescription: Owner ID
+ uiOrder: 0
+ title: Owner ID
+ format: string
+ name:
+ description: The name of the owner.
+ shortDescription: Owner Name
+ uiOrder: 1
+ title: Owner Name
+ format: string
+ required:
+ - gid
+ - name
+ format: object
+ due-on:
+ description: The date on which the portfolio is due. In the format YYYY-MM-DD.
+ shortDescription: Due Date
+ uiOrder: 4
+ title: Due Date
+ format: string
+ start-on:
+ description: The date on which the portfolio starts. In the format YYYY-MM-DD.
+ shortDescription: Start Date
+ uiOrder: 5
+ title: Start Date
+ format: string
+ color:
+ description: The color of the portfolio.
+ shortDescription: Color
+ uiOrder: 7
+ title: Color
+ format: string
+ public:
+ description: Whether the portfolio is public.
+ shortDescription: Whether the portfolio is public
+ uiOrder: 8
+ title: Public
+ format: boolean
+ created-by:
+ description: The user who created the portfolio.
+ shortDescription: The user who created the portfolio.
+ uiOrder: 10
+ title: Created By
+ properties:
+ gid:
+ description: Globally unique identifier (GID) for the user.
+ shortDescription: User ID
+ uiOrder: 0
+ title: User ID
+ format: string
+ name:
+ description: The name of the user.
+ shortDescription: User Name
+ uiOrder: 1
+ title: User Name
+ format: string
+ required:
+ - gid
+ - name
+ format: object
+ current-status:
+ description: The current status of the portfolio.
+ shortDescription: The current status of the portfolio.
+ uiOrder: 11
+ title: Current Status
+ required: []
+ items:
+ properties: {}
+ required: []
+ format: json
+ format: array
+ custom-fields:
+ description: The custom fields of the portfolio.
+ shortDescription: The custom fields of the portfolio.
+ uiOrder: 12
+ title: Custom Fields
+ required: []
+ items:
+ properties: {}
+ required: []
+ format: json
+ format: array
+ custom-field-settings:
+ description: The custom field settings of the portfolio.
+ shortDescription: The custom field settings of the portfolio.
+ uiOrder: 13
+ title: Custom Field Settings
+ required: []
+ items:
+ properties: {}
+ required: []
+ format: json
+ format: array
+ required: []
+ title: Output
+ format: object
diff --git a/pkg/component/application/asana/v0/main.go b/pkg/component/application/asana/v0/main.go
index 01e5fcc46..5f2cd95bf 100644
--- a/pkg/component/application/asana/v0/main.go
+++ b/pkg/component/application/asana/v0/main.go
@@ -15,12 +15,12 @@ import (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -47,7 +47,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/email/v0/README.mdx b/pkg/component/application/email/v0/README.mdx
index 561adbbec..9c3bf935d 100644
--- a/pkg/component/application/email/v0/README.mdx
+++ b/pkg/component/application/email/v0/README.mdx
@@ -22,7 +22,7 @@ Emails are fetched and sent using the IMAP and SMTP protocols, respectively. You
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/email/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/email/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/email/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/email/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/email/v0/config/definition.json b/pkg/component/application/email/v0/config/definition.json
deleted file mode 100644
index 14bd84375..000000000
--- a/pkg/component/application/email/v0/config/definition.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "availableTasks": [
- "TASK_SEND_EMAIL",
- "TASK_READ_EMAILS"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/application/email",
- "icon": "assets/email.svg",
- "id": "email",
- "public": true,
- "title": "Email",
- "description": "Get and send email from Mail Protocol.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "ee8edff7-443f-459d-8db1-a99ea71db233",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/email/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/email/v0/config/definition.yaml b/pkg/component/application/email/v0/config/definition.yaml
new file mode 100644
index 000000000..f5f186049
--- /dev/null
+++ b/pkg/component/application/email/v0/config/definition.yaml
@@ -0,0 +1,15 @@
+availableTasks:
+- TASK_SEND_EMAIL
+- TASK_READ_EMAILS
+documentationUrl: https://www.instill.tech/docs/component/application/email
+icon: assets/email.svg
+id: email
+public: true
+title: Email
+description: Get and send email from Mail Protocol.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: ee8edff7-443f-459d-8db1-a99ea71db233
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/email/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/email/v0/config/setup.json b/pkg/component/application/email/v0/config/setup.json
deleted file mode 100644
index 25258875a..000000000
--- a/pkg/component/application/email/v0/config/setup.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "email-address": {
- "description": "The email address of the user.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 2,
- "title": "Email Address",
- "format": "string"
- },
- "password": {
- "description": "The password of the App passwords in Gmail settings.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 3,
- "title": "App Password",
- "format": "string"
- },
- "server-address": {
- "description": "The address of the email server.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Server Address",
- "format": "string"
- },
- "server-port": {
- "description": "The port of the email server.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "title": "Server Port",
- "format": "integer"
- }
- },
- "required": [
- "email-address",
- "password",
- "server-address",
- "server-port"
- ],
- "title": "Email",
- "format": "object"
-}
diff --git a/pkg/component/application/email/v0/config/setup.yaml b/pkg/component/application/email/v0/config/setup.yaml
new file mode 100644
index 000000000..8a9338473
--- /dev/null
+++ b/pkg/component/application/email/v0/config/setup.yaml
@@ -0,0 +1,39 @@
+additionalProperties: false
+properties:
+ email-address:
+ description: The email address of the user.
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 2
+ title: Email Address
+ format: string
+ password:
+ description: The password of the App passwords in Gmail settings.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 3
+ title: App Password
+ format: string
+ server-address:
+ description: The address of the email server.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Server Address
+ format: string
+ server-port:
+ description: The port of the email server.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ title: Server Port
+ format: integer
+required:
+- email-address
+- password
+- server-address
+- server-port
+title: Email
+format: object
diff --git a/pkg/component/application/email/v0/config/tasks.json b/pkg/component/application/email/v0/config/tasks.json
deleted file mode 100644
index d3da4dffd..000000000
--- a/pkg/component/application/email/v0/config/tasks.json
+++ /dev/null
@@ -1,251 +0,0 @@
-{
- "$defs": {
- "search-subject": {
- "description": "Search for emails with a specific subject.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Search Subject",
- "format": "string"
- },
- "search-from": {
- "description": "Search for emails from a specific email address.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Search From",
- "format": "string"
- },
- "search-to": {
- "description": "Search for emails to a specific email address.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Search To",
- "format": "string"
- },
- "limit": {
- "description": "The maximum number of emails to search for.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Limit",
- "format": "integer"
- },
- "date": {
- "description": "Search for emails with the date the email was sent.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 6,
- "title": "Search Date",
- "format": "string"
- },
- "search-email-message": {
- "description": "Search for emails with a specific message.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 7,
- "title": "Search Message",
- "format": "string"
- }
- },
- "TASK_SEND_EMAIL": {
- "shortDescription": "Send an email to recipients",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "recipients": {
- "description": "The email addresses of the recipients.",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "uiOrder": 2,
- "title": "Recipient",
- "format": "array"
- },
- "cc": {
- "description": "The email addresses for Carbon Copy.",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "uiOrder": 3,
- "title": "Cc",
- "format": "array"
- },
- "bcc": {
- "description": "The email addresses for Blind Carbon Copy.",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "uiOrder": 4,
- "title": "Bcc",
- "format": "array"
- },
- "subject": {
- "description": "The subject of the email.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 5,
- "title": "Subject",
- "format": "string"
- },
- "message": {
- "description": "The message to be sent.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 6,
- "title": "Message",
- "format": "string"
- }
- },
- "required": [
- "recipients",
- "message"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "The result of sending the email.",
- "uiOrder": 0,
- "properties": {
- "result": {
- "description": "The result of sending the email.",
- "uiOrder": 0,
- "title": "Result",
- "format": "string"
- }
- },
- "required": [
- "result"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_READ_EMAILS": {
- "shortDescription": "Read emails from a mailbox",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "search": {
- "description": "The search criteria for the emails.",
- "uiOrder": 0,
- "properties": {
- "mailbox": {
- "description": "The mailbox to search for emails.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Mailbox",
- "format": "string"
- },
- "search-subject": {
- "$ref": "#/$defs/search-subject"
- },
- "search-from": {
- "$ref": "#/$defs/search-from"
- },
- "search-to": {
- "$ref": "#/$defs/search-to"
- },
- "limit": {
- "$ref": "#/$defs/limit"
- },
- "date": {
- "$ref": "#/$defs/date"
- },
- "search-email-message": {
- "$ref": "#/$defs/search-email-message"
- }
- },
- "required": [
- "mailbox"
- ],
- "title": "Search",
- "format": "object"
- }
- },
- "required": [],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "The emails that match the search criteria.",
- "uiOrder": 0,
- "properties": {
- "emails": {
- "description": "The emails that match the search criteria.",
- "uiOrder": 0,
- "items": {
- "properties": {
- "date": {
- "description": "The date the email was sent.",
- "uiOrder": 0,
- "title": "Date",
- "format": "string"
- },
- "from": {
- "description": "The email address of the sender.",
- "uiOrder": 1,
- "title": "From",
- "format": "string"
- },
- "to": {
- "description": "The email addresses of the recipient.",
- "uiOrder": 2,
- "items": {
- "description": "The email address of the recipient.",
- "format": "string"
- },
- "title": "To",
- "format": "array"
- },
- "subject": {
- "description": "The subject of the email.",
- "uiOrder": 3,
- "title": "Subject",
- "format": "string"
- },
- "message": {
- "description": "The message of the email.",
- "uiOrder": 4,
- "title": "Message",
- "format": "string"
- }
- },
- "required": [],
- "format": "object"
- },
- "title": "Emails",
- "format": "array"
- }
- },
- "required": [
- "emails"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/email/v0/config/tasks.yaml b/pkg/component/application/email/v0/config/tasks.yaml
new file mode 100644
index 000000000..a03bd54e9
--- /dev/null
+++ b/pkg/component/application/email/v0/config/tasks.yaml
@@ -0,0 +1,189 @@
+$defs:
+ search-subject:
+ description: Search for emails with a specific subject.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Search Subject
+ format: string
+ search-from:
+ description: Search for emails from a specific email address.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Search From
+ format: string
+ search-to:
+ description: Search for emails to a specific email address.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Search To
+ format: string
+ limit:
+ description: The maximum number of emails to search for.
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Limit
+ format: integer
+ date:
+ description: Search for emails with the date the email was sent.
+ acceptFormats:
+ - string
+ uiOrder: 6
+ title: Search Date
+ format: string
+ search-email-message:
+ description: Search for emails with a specific message.
+ acceptFormats:
+ - string
+ uiOrder: 7
+ title: Search Message
+ format: string
+TASK_SEND_EMAIL:
+ shortDescription: Send an email to recipients
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ recipients:
+ description: The email addresses of the recipients.
+ acceptFormats:
+ - array
+ items:
+ format: string
+ uiOrder: 2
+ title: Recipient
+ format: array
+ cc:
+ description: The email addresses for Carbon Copy.
+ acceptFormats:
+ - array
+ items:
+ format: string
+ uiOrder: 3
+ title: Cc
+ format: array
+ bcc:
+ description: The email addresses for Blind Carbon Copy.
+ acceptFormats:
+ - array
+ items:
+ format: string
+ uiOrder: 4
+ title: Bcc
+ format: array
+ subject:
+ description: The subject of the email.
+ acceptFormats:
+ - string
+ uiOrder: 5
+ title: Subject
+ format: string
+ message:
+ description: The message to be sent.
+ acceptFormats:
+ - string
+ uiOrder: 6
+ title: Message
+ format: string
+ required:
+ - recipients
+ - message
+ title: Input
+ format: object
+ output:
+ description: The result of sending the email.
+ uiOrder: 0
+ properties:
+ result:
+ description: The result of sending the email.
+ uiOrder: 0
+ title: Result
+ format: string
+ required:
+ - result
+ title: Output
+ format: object
+TASK_READ_EMAILS:
+ shortDescription: Read emails from a mailbox
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ search:
+ description: The search criteria for the emails.
+ uiOrder: 0
+ properties:
+ mailbox:
+ description: The mailbox to search for emails.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Mailbox
+ format: string
+ search-subject:
+ $ref: '#/$defs/search-subject'
+ search-from:
+ $ref: '#/$defs/search-from'
+ search-to:
+ $ref: '#/$defs/search-to'
+ limit:
+ $ref: '#/$defs/limit'
+ date:
+ $ref: '#/$defs/date'
+ search-email-message:
+ $ref: '#/$defs/search-email-message'
+ required:
+ - mailbox
+ title: Search
+ format: object
+ required: []
+ title: Input
+ format: object
+ output:
+ description: The emails that match the search criteria.
+ uiOrder: 0
+ properties:
+ emails:
+ description: The emails that match the search criteria.
+ uiOrder: 0
+ items:
+ properties:
+ date:
+ description: The date the email was sent.
+ uiOrder: 0
+ title: Date
+ format: string
+ from:
+ description: The email address of the sender.
+ uiOrder: 1
+ title: From
+ format: string
+ to:
+ description: The email addresses of the recipient.
+ uiOrder: 2
+ items:
+ description: The email address of the recipient.
+ format: string
+ title: To
+ format: array
+ subject:
+ description: The subject of the email.
+ uiOrder: 3
+ title: Subject
+ format: string
+ message:
+ description: The message of the email.
+ uiOrder: 4
+ title: Message
+ format: string
+ required: []
+ format: object
+ title: Emails
+ format: array
+ required:
+ - emails
+ title: Output
+ format: object
diff --git a/pkg/component/application/email/v0/main.go b/pkg/component/application/email/v0/main.go
index fb53942c7..ea2719886 100644
--- a/pkg/component/application/email/v0/main.go
+++ b/pkg/component/application/email/v0/main.go
@@ -20,12 +20,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -44,7 +44,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
fmt.Println("Failed to load definition", err)
panic(err)
diff --git a/pkg/component/application/freshdesk/v0/README.mdx b/pkg/component/application/freshdesk/v0/README.mdx
index 4ea86b35b..bfeb7b980 100644
--- a/pkg/component/application/freshdesk/v0/README.mdx
+++ b/pkg/component/application/freshdesk/v0/README.mdx
@@ -33,7 +33,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/freshdesk/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/freshdesk/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/freshdesk/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/freshdesk/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/freshdesk/v0/config/definition.json b/pkg/component/application/freshdesk/v0/config/definition.json
deleted file mode 100644
index f4b0e612d..000000000
--- a/pkg/component/application/freshdesk/v0/config/definition.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "availableTasks": [
- "TASK_GET_TICKET",
- "TASK_CREATE_TICKET",
- "TASK_REPLY_TO_TICKET",
- "TASK_CREATE_TICKET_NOTE",
- "TASK_GET_ALL_CONVERSATIONS",
- "TASK_GET_CONTACT",
- "TASK_CREATE_CONTACT",
- "TASK_GET_COMPANY",
- "TASK_CREATE_COMPANY",
- "TASK_GET_ALL",
- "TASK_GET_PRODUCT",
- "TASK_GET_AGENT",
- "TASK_GET_ROLE",
- "TASK_GET_GROUP",
- "TASK_GET_SKILL"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/application/freshdesk",
- "icon": "assets/freshdesk.svg",
- "id": "freshdesk",
- "public": true,
- "title": "Freshdesk",
- "description": "Use Freshdesk API to manage tickets, contacts and more.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "e89b5830-bc28-4886-9e04-e3db6e0efe9f",
- "vendor": "Freshdesk",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/freshdesk/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/freshdesk/v0/config/definition.yaml b/pkg/component/application/freshdesk/v0/config/definition.yaml
new file mode 100644
index 000000000..6538709cc
--- /dev/null
+++ b/pkg/component/application/freshdesk/v0/config/definition.yaml
@@ -0,0 +1,30 @@
+availableTasks:
+- TASK_GET_TICKET
+- TASK_CREATE_TICKET
+- TASK_REPLY_TO_TICKET
+- TASK_CREATE_TICKET_NOTE
+- TASK_GET_ALL_CONVERSATIONS
+- TASK_GET_CONTACT
+- TASK_CREATE_CONTACT
+- TASK_GET_COMPANY
+- TASK_CREATE_COMPANY
+- TASK_GET_ALL
+- TASK_GET_PRODUCT
+- TASK_GET_AGENT
+- TASK_GET_ROLE
+- TASK_GET_GROUP
+- TASK_GET_SKILL
+documentationUrl: https://www.instill.tech/docs/component/application/freshdesk
+icon: assets/freshdesk.svg
+id: freshdesk
+public: true
+title: Freshdesk
+description: Use Freshdesk API to manage tickets, contacts and more.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: e89b5830-bc28-4886-9e04-e3db6e0efe9f
+vendor: Freshdesk
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/freshdesk/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/freshdesk/v0/config/setup.json b/pkg/component/application/freshdesk/v0/config/setup.json
deleted file mode 100644
index 9b9176c84..000000000
--- a/pkg/component/application/freshdesk/v0/config/setup.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Freshdesk API key. To find your key, go to profile settigs and on the right pane, you can get your key once you have completed the captcha verification.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "API key",
- "format": "string"
- },
- "domain": {
- "description": "Your Freshdesk domain. You can find this by going to Admin -> Search for \"Portals\" -> Portal URL. Your portal URL will look like \"yourdomain.freshdesk.com\". Please only input your domain and not the whole URL.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 1,
- "title": "Domain",
- "format": "string"
- }
- },
- "required": [
- "api-key",
- "domain"
- ],
- "title": "Freshdesk Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/freshdesk/v0/config/setup.yaml b/pkg/component/application/freshdesk/v0/config/setup.yaml
new file mode 100644
index 000000000..7d50211ff
--- /dev/null
+++ b/pkg/component/application/freshdesk/v0/config/setup.yaml
@@ -0,0 +1,27 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Freshdesk API key. To find your key, go to profile settigs
+ and on the right pane, you can get your key once you have completed the captcha
+ verification.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: API key
+ format: string
+ domain:
+ description: Your Freshdesk domain. You can find this by going to Admin -> Search
+ for "Portals" -> Portal URL. Your portal URL will look like "yourdomain.freshdesk.com".
+ Please only input your domain and not the whole URL.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 1
+ title: Domain
+ format: string
+required:
+- api-key
+- domain
+title: Freshdesk Connection
+format: object
diff --git a/pkg/component/application/freshdesk/v0/config/tasks.json b/pkg/component/application/freshdesk/v0/config/tasks.json
deleted file mode 100644
index bb11dcc2c..000000000
--- a/pkg/component/application/freshdesk/v0/config/tasks.json
+++ /dev/null
@@ -1,2465 +0,0 @@
-{
- "$defs": {
- "language": {
- "enum": [
- "Arabic",
- "Bosnian",
- "Bulgarian",
- "Catalan",
- "Chinese",
- "Chinese (Traditional)",
- "Croatian",
- "Czech",
- "Danish",
- "Dutch",
- "English",
- "Estonian",
- "Filipino",
- "Finnish",
- "French",
- "German",
- "Greek",
- "Hebrew",
- "Hungarian",
- "Icelandic",
- "Indonesian",
- "Italian",
- "Japanese",
- "Korean",
- "Latvian",
- "Lithuanian",
- "Malay",
- "Norwegian",
- "Polish",
- "Portuguese (BR)",
- "Portuguese/Portugal",
- "Romanian",
- "Russian",
- "Serbian",
- "Slovak",
- "Slovenian",
- "Spanish",
- "Spanish (Latin America)",
- "Swedish",
- "Thai",
- "Turkish",
- "Ukrainian",
- "Vietnamese"
- ],
- "example": "English"
- },
- "time-zone": {
- "enum": [
- "American Samoa",
- "International Date Line West",
- "Midway Island",
- "Hawaii",
- "Alaska",
- "Pacific Time (US & Canada)",
- "Tijuana",
- "Arizona",
- "Mazatlan",
- "Mountain Time (US & Canada)",
- "Central America",
- "Central Time (US & Canada)",
- "Chihuahua",
- "Guadalajara",
- "Mexico City",
- "Monterrey",
- "Saskatchewan",
- "Bogota",
- "Eastern Time (US & Canada)",
- "Indiana (East)",
- "Lima",
- "Quito",
- "Atlantic Time (Canada)",
- "Caracas",
- "Georgetown",
- "La Paz",
- "Santiago",
- "Newfoundland",
- "Brasilia",
- "Buenos Aires",
- "Montevideo",
- "Greenland",
- "Mid-Atlantic",
- "Azores",
- "Cape Verde Is.",
- "Casablanca",
- "Dublin",
- "Edinburgh",
- "Lisbon",
- "London",
- "Monrovia",
- "UTC",
- "Amsterdam",
- "Belgrade",
- "Berlin",
- "Bern",
- "Bratislava",
- "Brussels",
- "Budapest",
- "Copenhagen",
- "Ljubljana",
- "Madrid",
- "Paris",
- "Prague",
- "Rome",
- "Sarajevo",
- "Skopje",
- "Stockholm",
- "Vienna",
- "Warsaw",
- "West Central Africa",
- "Zagreb",
- "Athens",
- "Bucharest",
- "Cairo",
- "Harare",
- "Helsinki",
- "Jerusalem",
- "Kaliningrad",
- "Kyiv",
- "Pretoria",
- "Riga",
- "Sofia",
- "Tallinn",
- "Vilnius",
- "Baghdad",
- "Istanbul",
- "Kuwait",
- "Minsk",
- "Moscow",
- "Nairobi",
- "Riyadh",
- "St. Petersburg",
- "Volgograd",
- "Tehran",
- "Abu Dhabi",
- "Baku",
- "Muscat",
- "Samara",
- "Tbilisi",
- "Yerevan",
- "Kabul",
- "Ekaterinburg",
- "Islamabad",
- "Karachi",
- "Tashkent",
- "Chennai",
- "Kolkata",
- "Mumbai",
- "New Delhi",
- "Sri Jayawardenepura",
- "Kathmandu",
- "Almaty",
- "Astana",
- "Dhaka",
- "Urumqi",
- "Rangoon",
- "Bangkok",
- "Hanoi",
- "Jakarta",
- "Krasnoyarsk",
- "Novosibirsk",
- "Beijing",
- "Chongqing",
- "Hong Kong",
- "Irkutsk",
- "Kuala Lumpur",
- "Perth",
- "Singapore",
- "Taipei",
- "Ulaanbaatar",
- "Osaka",
- "Sapporo",
- "Seoul",
- "Tokyo",
- "Yakutsk",
- "Adelaide",
- "Darwin",
- "Brisbane",
- "Canberra",
- "Guam",
- "Hobart",
- "Melbourne",
- "Port Moresby",
- "Sydney",
- "Vladivostok",
- "Magadan",
- "New Caledonia",
- "Solomon Is.",
- "Srednekolymsk",
- "Auckland",
- "Fiji",
- "Kamchatka",
- "Marshall Is.",
- "Wellington",
- "Chatham Is.",
- "Nuku'alofa",
- "Samoa",
- "Tokelau Is."
- ],
- "example": "Eastern Time (US & Canada)"
- },
- "ticket": {
- "ticket-id": {
- "description": "The ID of the ticket.",
- "title": "Ticket ID",
- "format": "integer"
- },
- "subject": {
- "description": "Subject of the ticket.",
- "title": "Subject",
- "format": "string"
- },
- "description-text": {
- "description": "Content of the ticket.",
- "title": "Description Text",
- "format": "string"
- },
- "source": {
- "description": "Source of the ticket. Eg: Email.",
- "title": "Source",
- "format": "string"
- },
- "status": {
- "description": "Status of the ticket. Eg: Pending.",
- "title": "Status",
- "format": "string"
- },
- "priority": {
- "description": "Priority of the ticket. Eg: Medium.",
- "title": "Priority",
- "format": "string"
- },
- "ticket-type": {
- "description": "Used to categorize the ticket. To check the possible types a ticket can have, please go to Admin -> Ticket Fields.",
- "title": "Ticket Type",
- "format": "string"
- },
- "association-type": {
- "description": "Used to determine whether a ticket is a parent, child, tracker or related ticket.",
- "title": "Association Type",
- "format": "string"
- },
- "associated-ticket-list": {
- "description": "List of associated ticket IDs.",
- "title": "Associated Ticket List",
- "format": "array"
- },
- "tags": {
- "description": "Tags associated with the ticket.",
- "title": "Tags",
- "format": "array"
- },
- "cc-emails": {
- "description": "Email addresses added in the 'cc' field of the incoming ticket email.",
- "title": "CC Emails",
- "format": "array"
- },
- "bcc-emails": {
- "description": "Email addresses added in the 'bcc' field of the incoming ticket email.",
- "title": "BCC Emails",
- "format": "array"
- },
- "forward-emails": {
- "description": "Email addresses added while forwarding a ticket.",
- "title": "Forward Emails",
- "format": "array"
- },
- "reply-cc-emails": {
- "description": "Email addresses added while replying to a ticket.",
- "title": "Reply CC Emails",
- "format": "array"
- },
- "requester-id": {
- "description": "ID of the requester.",
- "title": "Requester ID",
- "format": "integer"
- },
- "responder-id": {
- "description": "ID of the agent to whom the ticket has been assigned. List of agents can be found in Admin -> Agents.",
- "title": "Responder ID",
- "format": "integer"
- },
- "company-id": {
- "description": "ID of the company to which this ticket belongs.",
- "title": "Company ID",
- "format": "integer"
- },
- "group-id": {
- "description": "ID of the group to which the ticket has been assigned. List of groups can be found in Admin -> Groups.",
- "title": "Group ID",
- "format": "integer"
- },
- "product-id": {
- "description": "ID of the product to which the ticket is associated. List of products can be found in Admin -> Multiple Products.",
- "title": "Product ID",
- "format": "integer"
- },
- "support-email": {
- "description": "Support email address. You can find it in Admin -> Email (under channel).",
- "title": "Support Email",
- "format": "string"
- },
- "to-emails": {
- "description": "Email addresses to which the ticket was originally sent.",
- "title": "To Emails",
- "format": "array"
- },
- "spam": {
- "description": "Set to true if the ticket is marked as spam.",
- "title": "Spam",
- "format": "boolean"
- },
- "due-by": {
- "description": "Timestamp that denotes when the ticket is due to be resolved. In UTC format.",
- "title": "Due By",
- "format": "string"
- },
- "is-escalated": {
- "description": "Set to true if the ticket has been escalated.",
- "title": "Is Escalated",
- "format": "boolean"
- },
- "first-response-due-by": {
- "description": "Timestamp that denotes when the first response is due. In UTC format. You can adjust this by going to Admin -> SLA policy (under Workflows).",
- "title": "First Response Due By",
- "format": "string"
- },
- "first-response-escalated": {
- "description": "Set to true if the ticket has been escalated as the result of first response time being breached.",
- "title": "First Response Escalated",
- "format": "boolean"
- },
- "next-response-due-by": {
- "description": "Timestamp that denotes when the next response is due. In UTC format. You can adjust this by going to Admin -> SLA policy (under Workflows).",
- "title": "Next Response Due By",
- "format": "string"
- },
- "next-response-escalated": {
- "description": "Set to true if the ticket has been escalated as the result of next response time being breached.",
- "title": "Next Response Escalated",
- "format": "boolean"
- },
- "created-at": {
- "description": "Timestamp that denotes when the ticket/conversation was created. In UTC format.",
- "title": "Created At",
- "format": "string"
- },
- "updated-at": {
- "description": "Timestamp that denotes when the ticket was last updated. In UTC format.",
- "title": "Updated At",
- "format": "string"
- },
- "attachments": {
- "description": "Ticket attachments (cannot be more than 20MB).",
- "title": "Attachments",
- "format": "array"
- },
- "sentiment-score": {
- "description": "Freshdesk uses AI to assess the emotional tone and attitude expressed in customer interaction.",
- "title": "Sentiment Score",
- "format": "integer"
- },
- "initial-sentiment-score": {
- "description": "The initial sentiment score of the ticket.",
- "title": "Initial Sentiment Score",
- "format": "integer"
- },
- "custom-fields": {
- "description": "Custom fields that the ticket have. Custom fields can be created or modified in Admin -> Ticket Fields.",
- "title": "Custom Fields",
- "format": "object"
- },
- "conversation-id": {
- "description": "The ID of the note or reply that is associated with the ticket.",
- "title": "Conversation ID",
- "format": "integer"
- }
- },
- "contact": {
- "contact-id": {
- "description": "ID of the contact.",
- "title": "Contact ID",
- "format": "integer"
- },
- "name": {
- "description": "Name of the contact.",
- "title": "Name",
- "format": "string"
- },
- "email": {
- "description": "The primary email address of the contact.",
- "title": "Email",
- "format": "string"
- },
- "phone": {
- "description": "Telephone number of the contact.",
- "title": "Phone",
- "format": "string"
- },
- "mobile": {
- "description": "Mobile number of the contact.",
- "title": "Mobile",
- "format": "string"
- },
- "description": {
- "description": "Description of the contact.",
- "title": "Description",
- "format": "string"
- },
- "address": {
- "description": "Address of the contact.",
- "title": "Address",
- "format": "string"
- },
- "job-title": {
- "description": "Job title of the contact.",
- "title": "Job Title",
- "format": "string"
- },
- "tags": {
- "description": "Tags associated with the contact.",
- "title": "Tags",
- "format": "array"
- },
- "language": {
- "description": "Language of the contact.",
- "title": "Language",
- "format": "string"
- },
- "time-zone": {
- "description": "Time zone of the contact.",
- "title": "Time Zone",
- "format": "string"
- },
- "company-id": {
- "description": "ID of the primary company to which the contact belongs.",
- "title": "Company ID",
- "format": "integer"
- },
- "unique-external-id": {
- "description": "Unique external ID of the contact which be assigned by the user(agent).",
- "title": "Unique External ID",
- "format": "string"
- },
- "twitter-id": {
- "description": "Twitter ID of the contact.",
- "title": "Twitter ID",
- "format": "string"
- },
- "view-all-tickets": {
- "description": "Set to true if the contact can see all the tickets that are associated with the primary company.",
- "title": "View All Tickets",
- "format": "boolean"
- },
- "deleted": {
- "description": "Set to true if the contact is deleted.",
- "title": "Deleted",
- "format": "boolean"
- },
- "active": {
- "description": "Set to true if the contact has been verified.",
- "title": "Active",
- "format": "boolean"
- },
- "other-emails": {
- "description": "List of other email addresses of the contact.",
- "title": "Other Emails",
- "format": "array"
- },
- "other-companies": {
- "description": "List of other companies to which the contact belongs.",
- "title": "Other Companies",
- "format": "array"
- },
- "other-phone-numbers": {
- "description": "List of other phone numbers of the contact.",
- "title": "Other Phone Numbers",
- "format": "array"
- },
- "created-at": {
- "description": "Timestamp that denotes when the contact was created. In UTC format.",
- "title": "Created At",
- "format": "string"
- },
- "updated-at": {
- "description": "Timestamp that denotes when the contact was last updated. In UTC format.",
- "title": "Updated At",
- "format": "string"
- },
- "custom-fields": {
- "description": "Custom fields that the contact have. Custom fields can be created or modified in Admin -> Customer Fields.",
- "title": "Custom Fields",
- "format": "object"
- }
- },
- "company": {
- "company-id": {
- "description": "ID of the company.",
- "title": "Company ID",
- "format": "integer"
- },
- "name": {
- "description": "Name of the company.",
- "title": "Name",
- "format": "string"
- },
- "description": {
- "description": "Description of the company.",
- "title": "Description",
- "format": "string"
- },
- "note": {
- "description": "Note about the company.",
- "title": "Note",
- "format": "string"
- },
- "domains": {
- "description": "Domains of the company.",
- "title": "Domains",
- "format": "array"
- },
- "health-score": {
- "description": "The strength of your relationship with the company. To look at all the possible values or create custom values, please go to Admin -> Customer Fields. Default values: \"At risk\", \"Doing okay\", \"Happy\".",
- "title": "Health Score",
- "format": "string"
- },
- "account-tier": {
- "description": "Classification based on how much value the company brings to your business. To look at all the possible values or create custom values, please go to Admin -> Customer Fields. Default values: \"Basic\", \"Premium\", \"Enterprise\".",
- "title": "Account Tier",
- "format": "string"
- },
- "renewal-date": {
- "description": "Date when your contract or relationship with the company is due for renewal.",
- "title": "Renewal Date",
- "format": "string"
- },
- "industry": {
- "description": "The industry in which the company operates. To look at all the possible values or create custom values, please go to Admin -> Customer Fields.",
- "title": "Industry",
- "format": "string"
- },
- "created-at": {
- "description": "Timestamp that denotes when the company was created. In UTC format.",
- "title": "Created At",
- "format": "string"
- },
- "updated-at": {
- "description": "Timestamp that denotes when the company was last updated. In UTC format.",
- "title": "Updated At",
- "format": "string"
- },
- "custom-fields": {
- "description": "Custom fields that the company have. Custom fields can be created or modified in Admin -> Customer Fields.",
- "title": "Custom Fields",
- "format": "object"
- }
- }
- },
- "TASK_GET_TICKET": {
- "shortDescription": "Get ticket using ID",
- "input": {
- "description": "Ticket ID.",
- "uiOrder": 0,
- "properties": {
- "ticket-id": {
- "$ref": "#/$defs/ticket/ticket-id",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 0
- }
- },
- "required": [
- "ticket-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Ticket information.",
- "uiOrder": 0,
- "properties": {
- "subject": {
- "$ref": "#/$defs/ticket/subject",
- "uiOrder": 0,
- "format": "string"
- },
- "description-text": {
- "$ref": "#/$defs/ticket/description-text",
- "uiOrder": 1,
- "format": "string"
- },
- "source": {
- "$ref": "#/$defs/ticket/source",
- "uiOrder": 2,
- "format": "string"
- },
- "status": {
- "$ref": "#/$defs/ticket/status",
- "uiOrder": 3,
- "format": "string"
- },
- "priority": {
- "$ref": "#/$defs/ticket/priority",
- "uiOrder": 4,
- "format": "string"
- },
- "ticket-type": {
- "$ref": "#/$defs/ticket/ticket-type",
- "uiOrder": 5,
- "format": "string"
- },
- "association-type": {
- "$ref": "#/$defs/ticket/association-type",
- "uiOrder": 6,
- "format": "string"
- },
- "associated-ticket-list": {
- "$ref": "#/$defs/ticket/associated-ticket-list",
- "items": {
- "title": "Associated Ticket",
- "description": "The ID of the ticket associated with the current ticket.",
- "format": "integer"
- },
- "uiOrder": 7,
- "format": "array"
- },
- "tags": {
- "$ref": "#/$defs/ticket/tags",
- "items": {
- "title": "Tag",
- "description": "Tag associated with the ticket.",
- "format": "string"
- },
- "uiOrder": 8,
- "format": "array"
- },
- "cc-emails": {
- "$ref": "#/$defs/ticket/cc-emails",
- "items": {
- "title": "CC Email",
- "description": "One of the email address added in the 'cc' field of the incoming ticket email.",
- "format": "string"
- },
- "uiOrder": 9,
- "format": "array"
- },
- "forward-emails": {
- "$ref": "#/$defs/ticket/forward-emails",
- "items": {
- "title": "Forward Email",
- "description": "One of the email address added while forwarding a ticket.",
- "format": "string"
- },
- "uiOrder": 10,
- "format": "array"
- },
- "reply-cc-emails": {
- "$ref": "#/$defs/ticket/reply-cc-emails",
- "items": {
- "title": "Reply CC Email",
- "description": "One of the email address added while replying to a ticket.",
- "format": "string"
- },
- "uiOrder": 11,
- "format": "array"
- },
- "requester-id": {
- "$ref": "#/$defs/ticket/requester-id",
- "uiOrder": 12,
- "format": "integer"
- },
- "responder-id": {
- "$ref": "#/$defs/ticket/responder-id",
- "uiOrder": 13,
- "format": "integer"
- },
- "company-id": {
- "$ref": "#/$defs/ticket/company-id",
- "uiOrder": 14,
- "format": "integer"
- },
- "group-id": {
- "$ref": "#/$defs/ticket/group-id",
- "uiOrder": 15,
- "format": "integer"
- },
- "product-id": {
- "$ref": "#/$defs/ticket/product-id",
- "uiOrder": 16,
- "format": "integer"
- },
- "support-email": {
- "$ref": "#/$defs/ticket/support-email",
- "uiOrder": 17,
- "format": "string"
- },
- "to-emails": {
- "$ref": "#/$defs/ticket/to-emails",
- "items": {
- "title": "To Email",
- "description": "One of the email address to which the ticket was originally sent.",
- "format": "string"
- },
- "uiOrder": 18,
- "format": "array"
- },
- "spam": {
- "$ref": "#/$defs/ticket/spam",
- "uiOrder": 19,
- "format": "boolean"
- },
- "due-by": {
- "$ref": "#/$defs/ticket/due-by",
- "uiOrder": 20,
- "format": "string"
- },
- "is-escalated": {
- "$ref": "#/$defs/ticket/is-escalated",
- "uiOrder": 21,
- "format": "boolean"
- },
- "first-response-due-by": {
- "$ref": "#/$defs/ticket/first-response-due-by",
- "uiOrder": 22,
- "format": "string"
- },
- "first-response-escalated": {
- "$ref": "#/$defs/ticket/first-response-escalated",
- "uiOrder": 23,
- "format": "boolean"
- },
- "next-response-due-by": {
- "$ref": "#/$defs/ticket/next-response-due-by",
- "uiOrder": 24,
- "format": "string"
- },
- "next-response-escalated": {
- "$ref": "#/$defs/ticket/next-response-escalated",
- "uiOrder": 25,
- "format": "boolean"
- },
- "created-at": {
- "$ref": "#/$defs/ticket/created-at",
- "uiOrder": 26,
- "format": "string"
- },
- "updated-at": {
- "$ref": "#/$defs/ticket/updated-at",
- "uiOrder": 27,
- "format": "string"
- },
- "attachments": {
- "$ref": "#/$defs/ticket/attachments",
- "items": {
- "title": "Attachment",
- "properties": {
- "name": {
- "description": "The name of the file.",
- "uiOrder": 0,
- "title": "Attachment Name",
- "format": "string"
- },
- "content-type": {
- "description": "The type of the file.",
- "uiOrder": 1,
- "title": "Attachment Content Type",
- "format": "string"
- },
- "url": {
- "description": "The URL to the attachment.",
- "uiOrder": 2,
- "title": "Attachment URL",
- "format": "string"
- }
- },
- "required": [
- "name",
- "content-type",
- "url"
- ],
- "format": "object"
- },
- "uiOrder": 28,
- "format": "array"
- },
- "sentiment-score": {
- "$ref": "#/$defs/ticket/sentiment-score",
- "uiOrder": 29,
- "format": "integer"
- },
- "initial-sentiment-score": {
- "$ref": "#/$defs/ticket/initial-sentiment-score",
- "uiOrder": 30,
- "format": "integer"
- },
- "custom-fields": {
- "$ref": "#/$defs/ticket/custom-fields",
- "required": [],
- "uiOrder": 31,
- "format": "json"
- }
- },
- "required": [
- "requester-id",
- "subject",
- "description-text",
- "source",
- "status",
- "priority",
- "created-at",
- "updated-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_TICKET": {
- "shortDescription": "Create ticket",
- "input": {
- "description": "Ticket Information.",
- "uiOrder": 0,
- "properties": {
- "requester-id": {
- "description": "ID of the requester. Must be an existing contact. If you fill in this field, you don't need to fill in the email field. Only one of the two fields is required.",
- "title": "Requester ID",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "email": {
- "description": "Email address of the requester. If you fill in the Requester ID above, it will be ignored. Only one of the two fields is required. If no contact exists with this email address in Freshdesk, it will be added as a new contact.",
- "title": "Email",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "subject": {
- "$ref": "#/$defs/ticket/subject",
- "uiOrder": 2,
- "acceptFormats": [
- "string"
- ]
- },
- "description": {
- "description": "Content of the ticket. You can use HTML tags in the content.",
- "title": "Description",
- "uiOrder": 3,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "source": {
- "$ref": "#/$defs/ticket/source",
- "enum": [
- "Email",
- "Portal",
- "Phone",
- "Twitter",
- "Facebook",
- "Chat",
- "Feedback Widget",
- "Outbound Email",
- "Ecommerce"
- ],
- "example": "Portal",
- "uiOrder": 4,
- "acceptFormats": [
- "string"
- ]
- },
- "status": {
- "$ref": "#/$defs/ticket/status",
- "enum": [
- "Open",
- "Pending",
- "Resolved",
- "Closed",
- "Waiting on Customer",
- "Waiting on Third Party"
- ],
- "example": "Open",
- "uiOrder": 5,
- "acceptFormats": [
- "string"
- ]
- },
- "priority": {
- "$ref": "#/$defs/ticket/priority",
- "enum": [
- "Low",
- "Medium",
- "High",
- "Urgent"
- ],
- "example": "Low",
- "uiOrder": 6,
- "acceptFormats": [
- "string"
- ]
- },
- "ticket-type": {
- "$ref": "#/$defs/ticket/ticket-type",
- "uiOrder": 7,
- "acceptFormats": [
- "string"
- ]
- },
- "company-id": {
- "$ref": "#/$defs/ticket/company-id",
- "uiOrder": 8,
- "acceptFormats": [
- "integer"
- ]
- },
- "product-id": {
- "$ref": "#/$defs/ticket/product-id",
- "uiOrder": 9,
- "acceptFormats": [
- "integer"
- ]
- },
- "group-id": {
- "$ref": "#/$defs/ticket/group-id",
- "uiOrder": 10,
- "acceptFormats": [
- "integer"
- ]
- },
- "responder-id": {
- "$ref": "#/$defs/ticket/responder-id",
- "uiOrder": 11,
- "acceptFormats": [
- "integer"
- ]
- },
- "tags": {
- "$ref": "#/$defs/ticket/tags",
- "uiOrder": 12,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- }
- },
- "cc-emails": {
- "$ref": "#/$defs/ticket/cc-emails",
- "uiOrder": 13,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- }
- },
- "parent-id": {
- "description": "ID of the parent ticket. Need to be filled out if you want to create a child ticket.",
- "title": "Parent ID",
- "uiOrder": 14,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "related-ticket-ids": {
- "description": "List of related ticket IDs. Need to be filled out if you want to create a tracker ticket.",
- "title": "Related Ticket IDs",
- "uiOrder": 15,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "integer"
- },
- "format": "array"
- }
- },
- "required": [
- "subject",
- "description",
- "source",
- "status",
- "priority"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Ticket ID and create date.",
- "uiOrder": 0,
- "properties": {
- "ticket-id": {
- "$ref": "#/$defs/ticket/ticket-id",
- "uiOrder": 0,
- "format": "integer"
- },
- "created-at": {
- "$ref": "#/$defs/ticket/created-at",
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [
- "ticket-id",
- "created-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_REPLY_TO_TICKET": {
- "shortDescription": "Reply to a ticket thread.",
- "input": {
- "description": "Reply information.",
- "uiOrder": 0,
- "properties": {
- "ticket-id": {
- "$ref": "#/$defs/ticket/ticket-id",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ]
- },
- "body": {
- "description": "Content of the reply. Can be in HTML format.",
- "title": "Body",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "from-email": {
- "description": "Email address that is replying to the ticket. You need to have this email address registered in Freshdesk by going to Admin -> Emails. If you leave this field empty, the global support email will be used.",
- "title": "From Email",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "user-id": {
- "description": "ID of the agent/contact replying to the ticket. If you fill this field using a contact ID, there will be no email sent to the requester.",
- "title": "User ID",
- "uiOrder": 2,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "cc-emails": {
- "description": "Email addresses added in the 'cc' field of the outgoing ticket email.",
- "title": "CC Emails",
- "uiOrder": 3,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "format": "array"
- },
- "bcc-emails": {
- "description": "Email addresses added in the 'bcc' field of the outgoing ticket email.",
- "title": "BCC Emails",
- "uiOrder": 4,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "format": "array"
- }
- },
- "required": [
- "ticket-id",
- "body"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Conversation ID, Ticket ID and created date.",
- "uiOrder": 0,
- "properties": {
- "conversation-id": {
- "$ref": "#/$defs/ticket/conversation-id",
- "uiOrder": 0,
- "format": "integer"
- },
- "created-at": {
- "$ref": "#/$defs/ticket/created-at",
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [
- "conversation-id",
- "created-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_TICKET_NOTE": {
- "shortDescription": "Create a private/public note on a ticket thread.",
- "input": {
- "description": "Note information.",
- "uiOrder": 0,
- "properties": {
- "ticket-id": {
- "$ref": "#/$defs/ticket/ticket-id",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ]
- },
- "body": {
- "description": "Content of the note. Can be in HTML format.",
- "title": "Body",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "notify-emails": {
- "description": "Email addresses of agents/users who need to be notified about this note. The emails need to exist in Freshdesk agent. Agent list can be seen in Admin -> Agents.",
- "title": "Notify Emails",
- "uiOrder": 2,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "format": "array"
- },
- "user-id": {
- "description": "ID of the agent/contact who is adding the note.",
- "title": "User ID",
- "uiOrder": 3,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "private": {
- "description": "Set to true if the note is private.",
- "title": "Private",
- "uiOrder": 4,
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "incoming": {
- "description": "Set to true if a particular note should appear as being created from outside (i.e., not through web portal).",
- "title": "Incoming",
- "uiOrder": 5,
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- }
- },
- "required": [
- "ticket-id",
- "body"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Conversation ID, Ticket ID and created date.",
- "uiOrder": 0,
- "properties": {
- "conversation-id": {
- "$ref": "#/$defs/ticket/conversation-id",
- "uiOrder": 0,
- "format": "integer"
- },
- "created-at": {
- "$ref": "#/$defs/ticket/created-at",
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [
- "conversation-id",
- "created-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_ALL_CONVERSATIONS": {
- "shortDescription": "Get all the conversations in a ticket. (Conversations are replies and notes that are added to a ticket)",
- "input": {
- "description": "Ticket ID.",
- "uiOrder": 0,
- "properties": {
- "ticket-id": {
- "description": "Ticket ID.",
- "title": "Ticket ID",
- "uiOrder": 2,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "ticket-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Conversations.",
- "uiOrder": 0,
- "properties": {
- "conversations": {
- "description": "An array of conversations.",
- "uiOrder": 0,
- "title": "Conversations",
- "items": {
- "title": "Conversation",
- "properties": {
- "body-text": {
- "description": "Content of the conversation.",
- "title": "Body Text",
- "uiOrder": 0,
- "format": "string"
- },
- "conversation-id": {
- "$ref": "#/$defs/ticket/conversation-id",
- "uiOrder": 1,
- "format": "integer"
- },
- "support-email": {
- "$ref": "#/$defs/ticket/support-email",
- "uiOrder": 2,
- "format": "string"
- },
- "to-emails": {
- "description": "Email addresses of agents/users who need to be notified about this conversation.",
- "title": "To Emails",
- "uiOrder": 3,
- "items": {
- "title": "To Email",
- "description": "One of the email addresses of agents/users who need to be notified about this conversation.",
- "format": "string"
- },
- "format": "array"
- },
- "from-email": {
- "description": "Email address that is replying to the ticket or adding the note.",
- "title": "From Email",
- "uiOrder": 4,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "cc-emails": {
- "$ref": "#/$defs/ticket/cc-emails",
- "uiOrder": 5,
- "items": {
- "title": "CC Email",
- "description": "One of the email address added in the 'cc' field of the incoming ticket email.",
- "format": "string"
- },
- "format": "array"
- },
- "bcc-emails": {
- "$ref": "#/$defs/ticket/bcc-emails",
- "uiOrder": 6,
- "items": {
- "title": "BCC Email",
- "description": "One of the email address added in the 'bcc' field of the incoming ticket email.",
- "format": "string"
- },
- "format": "array"
- },
- "incoming": {
- "description": "Set to true if a particular conversation should appear as being created from outside.",
- "title": "Incoming",
- "uiOrder": 7,
- "format": "boolean"
- },
- "private": {
- "description": "Set to true if a note is private. Can be set only for notes.",
- "title": "Incoming",
- "uiOrder": 8,
- "format": "boolean"
- },
- "user-id": {
- "description": "ID of the agent/contact replying to the ticket.",
- "title": "Incoming",
- "uiOrder": 9,
- "format": "integer"
- },
- "created-at": {
- "$ref": "#/$defs/ticket/created-at",
- "uiOrder": 10,
- "format": "string"
- }
- },
- "required": [
- "body-text",
- "created-at"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "conversations-length": {
- "description": "Number of conversations.",
- "title": "Conversations Length",
- "uiOrder": 1,
- "format": "integer"
- }
- },
- "required": [
- "conversations",
- "conversations-length"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_CONTACT": {
- "shortDescription": "Get contact using ID",
- "input": {
- "description": "Contact ID.",
- "uiOrder": 0,
- "properties": {
- "contact-id": {
- "$ref": "#/$defs/contact/contact-id",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 0
- }
- },
- "required": [
- "contact-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Contact information.",
- "uiOrder": 0,
- "properties": {
- "name": {
- "$ref": "#/$defs/contact/name",
- "uiOrder": 0,
- "format": "string"
- },
- "email": {
- "$ref": "#/$defs/contact/email",
- "uiOrder": 1,
- "format": "string"
- },
- "phone": {
- "$ref": "#/$defs/contact/phone",
- "uiOrder": 2,
- "format": "string"
- },
- "mobile": {
- "$ref": "#/$defs/contact/mobile",
- "uiOrder": 3,
- "format": "string"
- },
- "description": {
- "$ref": "#/$defs/contact/description",
- "uiOrder": 4,
- "format": "string"
- },
- "address": {
- "$ref": "#/$defs/contact/address",
- "uiOrder": 5,
- "format": "string"
- },
- "job-title": {
- "$ref": "#/$defs/contact/job-title",
- "uiOrder": 6,
- "format": "string"
- },
- "tags": {
- "$ref": "#/$defs/contact/tags",
- "items": {
- "title": "Tag",
- "description": "Tag associated with the contact.",
- "format": "string"
- },
- "uiOrder": 7,
- "format": "array"
- },
- "language": {
- "$ref": "#/$defs/contact/language",
- "uiOrder": 8,
- "format": "string"
- },
- "time-zone": {
- "$ref": "#/$defs/contact/time-zone",
- "uiOrder": 9,
- "format": "string"
- },
- "company-id": {
- "$ref": "#/$defs/contact/company-id",
- "uiOrder": 10,
- "format": "integer"
- },
- "unique-external-id": {
- "$ref": "#/$defs/contact/unique-external-id",
- "uiOrder": 11,
- "format": "string"
- },
- "twitter-id": {
- "$ref": "#/$defs/contact/twitter-id",
- "uiOrder": 12,
- "format": "string"
- },
- "view-all-tickets": {
- "$ref": "#/$defs/contact/view-all-tickets",
- "uiOrder": 13,
- "format": "boolean"
- },
- "deleted": {
- "$ref": "#/$defs/contact/deleted",
- "uiOrder": 14,
- "format": "boolean"
- },
- "active": {
- "$ref": "#/$defs/contact/active",
- "uiOrder": 15,
- "format": "boolean"
- },
- "other-emails": {
- "$ref": "#/$defs/contact/other-emails",
- "items": {
- "title": "Other Email",
- "description": "The other email addresses of the contact.",
- "format": "string"
- },
- "uiOrder": 16,
- "format": "array"
- },
- "other-companies": {
- "$ref": "#/$defs/contact/other-companies",
- "items": {
- "title": "Company",
- "properties": {
- "company-id": {
- "description": "ID of the company.",
- "uiOrder": 0,
- "title": "Company ID",
- "format": "integer"
- },
- "view-all-tickets": {
- "description": "Set to true if the contact can see all the tickets that are associated with the company.",
- "uiOrder": 1,
- "title": "View All Tickets",
- "format": "boolean"
- }
- },
- "required": [
- "company-id",
- "view-all-tickets"
- ],
- "format": "object"
- },
- "uiOrder": 17,
- "format": "array"
- },
- "other-phone-numbers": {
- "$ref": "#/$defs/contact/other-phone-numbers",
- "items": {
- "title": "Other Phone Number",
- "description": "The other phone number of the contact.",
- "format": "string"
- },
- "uiOrder": 18,
- "format": "array"
- },
- "created-at": {
- "$ref": "#/$defs/contact/created-at",
- "uiOrder": 19,
- "format": "string"
- },
- "updated-at": {
- "$ref": "#/$defs/contact/updated-at",
- "uiOrder": 20,
- "format": "string"
- },
- "custom-fields": {
- "$ref": "#/$defs/contact/custom-fields",
- "required": [],
- "uiOrder": 21,
- "format": "json"
- }
- },
- "required": [
- "name"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_CONTACT": {
- "shortDescription": "Create contact",
- "input": {
- "description": "Contact Information.",
- "uiOrder": 0,
- "properties": {
- "name": {
- "$ref": "#/$defs/contact/name",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ]
- },
- "email": {
- "$ref": "#/$defs/contact/email",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ]
- },
- "phone": {
- "$ref": "#/$defs/contact/phone",
- "uiOrder": 2,
- "acceptFormats": [
- "string"
- ]
- },
- "mobile": {
- "$ref": "#/$defs/contact/mobile",
- "uiOrder": 3,
- "acceptFormats": [
- "string"
- ]
- },
- "description": {
- "$ref": "#/$defs/contact/description",
- "uiOrder": 4,
- "acceptFormats": [
- "string"
- ]
- },
- "address": {
- "$ref": "#/$defs/contact/address",
- "uiOrder": 5,
- "acceptFormats": [
- "string"
- ]
- },
- "job-title": {
- "$ref": "#/$defs/contact/job-title",
- "uiOrder": 6,
- "acceptFormats": [
- "string"
- ]
- },
- "tags": {
- "$ref": "#/$defs/contact/tags",
- "uiOrder": 7,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- }
- },
- "language": {
- "description": "Language of the contact.",
- "title": "Language",
- "$ref": "#/$defs/language",
- "uiOrder": 8,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "time-zone": {
- "description": "Time zone of the contact.",
- "title": "Time Zone",
- "$ref": "#/$defs/time-zone",
- "uiOrder": 9,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "company-id": {
- "$ref": "#/$defs/contact/company-id",
- "uiOrder": 10,
- "acceptFormats": [
- "integer"
- ]
- },
- "unique-external-id": {
- "$ref": "#/$defs/contact/unique-external-id",
- "uiOrder": 11,
- "acceptFormats": [
- "string"
- ]
- },
- "twitter-id": {
- "$ref": "#/$defs/contact/twitter-id",
- "uiOrder": 12,
- "acceptFormats": [
- "string"
- ]
- },
- "view-all-tickets": {
- "description": "Used to determine if the contact can see all the tickets that are associated with the primary company. Note: this property will be ignored if the Company ID is not provided.",
- "title": "View All Tickets",
- "uiOrder": 13,
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "other-emails": {
- "$ref": "#/$defs/contact/other-emails",
- "uiOrder": 14,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- }
- },
- "other-companies": {
- "title": "Other Companies",
- "description": "List of other companies to which the contact belongs. Each company should be in the format of company-id;view-all-tickets(boolean \"true\"/\"false\") Example: 123;true.",
- "items": {
- "format": "string"
- },
- "uiOrder": 15,
- "format": "array"
- },
- "other-phone-numbers": {
- "$ref": "#/$defs/contact/other-phone-numbers",
- "uiOrder": 16,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- }
- }
- },
- "required": [
- "name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Contact ID and create date.",
- "uiOrder": 0,
- "properties": {
- "contact-id": {
- "$ref": "#/$defs/contact/contact-id",
- "uiOrder": 0,
- "format": "integer"
- },
- "created-at": {
- "$ref": "#/$defs/contact/created-at",
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [
- "contact-id",
- "created-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_COMPANY": {
- "shortDescription": "Get company using ID",
- "input": {
- "description": "Company ID.",
- "uiOrder": 0,
- "properties": {
- "company-id": {
- "$ref": "#/$defs/contact/company-id",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 0
- }
- },
- "required": [
- "company-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Company information.",
- "uiOrder": 0,
- "properties": {
- "name": {
- "$ref": "#/$defs/company/name",
- "uiOrder": 0,
- "format": "string"
- },
- "description": {
- "$ref": "#/$defs/company/description",
- "uiOrder": 1,
- "format": "string"
- },
- "note": {
- "$ref": "#/$defs/company/note",
- "uiOrder": 2,
- "format": "string"
- },
- "domains": {
- "$ref": "#/$defs/company/domains",
- "items": {
- "title": "Domain",
- "description": "Domain of the company.",
- "format": "string"
- },
- "uiOrder": 3,
- "format": "array"
- },
- "health-score": {
- "$ref": "#/$defs/company/health-score",
- "uiOrder": 4,
- "format": "string"
- },
- "account-tier": {
- "$ref": "#/$defs/company/account-tier",
- "uiOrder": 5,
- "format": "string"
- },
- "renewal-date": {
- "$ref": "#/$defs/company/renewal-date",
- "uiOrder": 6,
- "format": "string"
- },
- "industry": {
- "$ref": "#/$defs/company/industry",
- "uiOrder": 7,
- "format": "string"
- },
- "created-at": {
- "$ref": "#/$defs/company/created-at",
- "uiOrder": 8,
- "format": "string"
- },
- "updated-at": {
- "$ref": "#/$defs/company/updated-at",
- "uiOrder": 9,
- "format": "string"
- },
- "custom-fields": {
- "$ref": "#/$defs/company/custom-fields",
- "required": [],
- "uiOrder": 10,
- "format": "json"
- }
- },
- "required": [
- "name",
- "created-at",
- "updated-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_COMPANY": {
- "shortDescription": "Create company",
- "input": {
- "description": "Company Information.",
- "uiOrder": 0,
- "properties": {
- "name": {
- "$ref": "#/$defs/company/name",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ]
- },
- "description": {
- "$ref": "#/$defs/company/description",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ]
- },
- "note": {
- "$ref": "#/$defs/company/note",
- "uiOrder": 2,
- "acceptFormats": [
- "string"
- ]
- },
- "domains": {
- "$ref": "#/$defs/company/domains",
- "uiOrder": 3,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- }
- },
- "health-score": {
- "$ref": "#/$defs/company/health-score",
- "uiOrder": 4,
- "acceptFormats": [
- "string"
- ]
- },
- "account-tier": {
- "$ref": "#/$defs/company/account-tier",
- "uiOrder": 5,
- "acceptFormats": [
- "string"
- ]
- },
- "renewal-date": {
- "description": "Date when your contract or relationship with the company is due for renewal. Enter in the format YYYY-MM-DD.",
- "title": "Renewal Date",
- "uiOrder": 6,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "industry": {
- "$ref": "#/$defs/company/industry",
- "uiOrder": 7,
- "acceptFormats": [
- "string"
- ]
- }
- },
- "required": [
- "name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Company ID and create date.",
- "uiOrder": 0,
- "properties": {
- "company-id": {
- "$ref": "#/$defs/company/company-id",
- "uiOrder": 0,
- "format": "integer"
- },
- "created-at": {
- "$ref": "#/$defs/company/created-at",
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [
- "company-id",
- "created-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_ALL": {
- "shortDescription": "Task to get all the IDs of existing contacts, companies, tickets, products, agents, roles, or skills. Note: products, agents, roles, and skills require admin privileges. Some of these might not work, depending on the plan you are on.",
- "input": {
- "description": "Object type.",
- "uiOrder": 0,
- "properties": {
- "object-type": {
- "description": "Type of object to get IDs for.",
- "title": "Object Type",
- "enum": [
- "Contacts",
- "Companies",
- "Tickets",
- "Products",
- "Agents",
- "Roles",
- "Skills"
- ],
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "length": {
- "description": "The maximum number of IDs allowed is 500. The most recent IDs will be retrieved.",
- "default": 500,
- "title": "Length",
- "uiOrder": 1,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "object-type",
- "length"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "IDs of the object.",
- "uiOrder": 0,
- "properties": {
- "ids": {
- "description": "List of IDs.",
- "title": "IDs",
- "items": {
- "title": "ID",
- "description": "ID of the object.",
- "format": "integer"
- },
- "uiOrder": 0,
- "format": "array"
- },
- "id-length": {
- "description": "Number of IDs.",
- "title": "ID Length",
- "uiOrder": 1,
- "format": "integer"
- }
- },
- "required": [
- "ids",
- "id-length"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_PRODUCT": {
- "shortDescription": "Get product using ID. This task will only work if you have admin privileges.",
- "input": {
- "description": "Product ID.",
- "uiOrder": 0,
- "properties": {
- "product-id": {
- "description": "Product ID.",
- "title": "Product ID",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "product-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Product information.",
- "uiOrder": 0,
- "properties": {
- "name": {
- "description": "Name of the product.",
- "title": "Name",
- "uiOrder": 0,
- "format": "string"
- },
- "description": {
- "description": "Description of the product.",
- "title": "Description",
- "uiOrder": 1,
- "format": "string"
- },
- "primary-email": {
- "description": "Primary email of the product.",
- "title": "Primary Email",
- "uiOrder": 2,
- "format": "string"
- },
- "created-at": {
- "description": "Timestamp that denotes when the product was created.",
- "title": "Created At",
- "uiOrder": 3,
- "format": "string"
- },
- "updated-at": {
- "description": "Timestamp that denotes when the product was last updated.",
- "title": "Updated At",
- "uiOrder": 4,
- "format": "string"
- },
- "default": {
- "description": "Set to true if the product is the default product.",
- "title": "Default",
- "uiOrder": 5,
- "format": "boolean"
- }
- },
- "required": [
- "name",
- "description",
- "primary-email",
- "created-at",
- "updated-at",
- "default"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_AGENT": {
- "shortDescription": "Get agent using ID. This task will only work if you have admin privileges. Agents are those in your team who will login to Freshdesk.",
- "input": {
- "description": "Agent ID.",
- "uiOrder": 0,
- "properties": {
- "agent-id": {
- "description": "Agent ID.",
- "title": "Agent ID",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "agent-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Agent information.",
- "uiOrder": 0,
- "properties": {
- "name": {
- "description": "Name of the agent.",
- "title": "Name",
- "uiOrder": 0,
- "format": "string"
- },
- "active": {
- "description": "Set to true if the agent is verified.",
- "title": "Active",
- "uiOrder": 1,
- "format": "boolean"
- },
- "email": {
- "description": "Email of the agent.",
- "title": "Email",
- "uiOrder": 2,
- "format": "string"
- },
- "job-title": {
- "description": "Job title of the agent.",
- "title": "Job Title",
- "uiOrder": 3,
- "format": "string"
- },
- "language": {
- "description": "Language of the agent.",
- "title": "Language",
- "uiOrder": 4,
- "format": "string"
- },
- "mobile": {
- "description": "Mobile number of the agent.",
- "title": "Mobile",
- "uiOrder": 5,
- "format": "string"
- },
- "phone": {
- "description": "Telephone number of the agent.",
- "title": "Phone",
- "uiOrder": 6,
- "format": "string"
- },
- "time-zone": {
- "description": "Time zone of the agent.",
- "title": "Time Zone",
- "uiOrder": 7,
- "format": "string"
- },
- "ticket-scope": {
- "description": "Ticket permission of the agent. Can be \"Global Access\", \"Group Access\" or \"Restricted Access\".",
- "title": "Ticket Scope",
- "uiOrder": 9,
- "format": "string"
- },
- "available": {
- "description": "Set to true if the agent is in a group that has enabled \"Automatic Ticket Assignment\".",
- "title": "Available",
- "uiOrder": 10,
- "format": "boolean"
- },
- "group-ids": {
- "description": "Group IDs of the agent.",
- "title": "Group IDs",
- "uiOrder": 11,
- "items": {
- "title": "Group ID",
- "description": "ID of the group.",
- "format": "integer"
- },
- "format": "array"
- },
- "role-ids": {
- "description": "Role IDs of the agent.",
- "title": "Role IDs",
- "uiOrder": 12,
- "items": {
- "title": "Role ID",
- "description": "ID of the role.",
- "format": "integer"
- },
- "format": "array"
- },
- "skill-ids": {
- "description": "Skill IDs of the agent.",
- "title": "Skill IDs",
- "uiOrder": 13,
- "items": {
- "title": "Skill ID",
- "description": "ID of the skill.",
- "format": "integer"
- },
- "format": "array"
- },
- "occasional": {
- "description": "Set to true if the agent is not working full-time.",
- "title": "Occasional",
- "uiOrder": 14,
- "format": "boolean"
- },
- "signature": {
- "description": "Signature of the agent in HTML format.",
- "title": "Signature",
- "uiOrder": 15,
- "format": "string"
- },
- "focus-mode": {
- "description": "Set to true if the agent is in focus mode.",
- "title": "Focus Mode",
- "uiOrder": 16,
- "format": "boolean"
- },
- "deactivated": {
- "description": "Set to true if the agent is deactivated.",
- "title": "Deactivated",
- "uiOrder": 17,
- "format": "boolean"
- },
- "created-at": {
- "description": "Timestamp that denotes when the agent was created.",
- "title": "Created At",
- "uiOrder": 18,
- "format": "string"
- },
- "updated-at": {
- "description": "Timestamp that denotes when the agent was last updated.",
- "title": "Updated At",
- "uiOrder": 19,
- "format": "string"
- },
- "type": {
- "description": "Type of the agent. Can be \"Support Agent\", \"Field Agent\" or \"Collaborator\".",
- "title": "Type",
- "uiOrder": 8,
- "format": "string"
- }
- },
- "required": [
- "email",
- "type",
- "ticket-scope",
- "occasional"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_ROLE": {
- "shortDescription": "Get role using ID. This task will only work if you have admin privileges. Roles allow agents/collaborators to have different privileges.",
- "input": {
- "description": "Role ID.",
- "uiOrder": 0,
- "properties": {
- "role-id": {
- "description": "Role ID.",
- "title": "Role ID",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "role-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Role information.",
- "uiOrder": 0,
- "properties": {
- "name": {
- "description": "Name of the role.",
- "title": "Name",
- "uiOrder": 0,
- "format": "string"
- },
- "description": {
- "description": "Description of the role.",
- "title": "Description",
- "uiOrder": 1,
- "format": "string"
- },
- "default": {
- "description": "Set to true if the role is the default role.",
- "title": "Default",
- "uiOrder": 2,
- "format": "boolean"
- },
- "agent-type": {
- "description": "Type of the agent. Can be \"Support Agent\", \"Field Agent\" or \"Collaborator\".",
- "title": "Agent Type",
- "uiOrder": 3,
- "format": "string"
- },
- "created-at": {
- "description": "Timestamp that denotes when the role was created.",
- "title": "Created At",
- "uiOrder": 4,
- "format": "string"
- },
- "updated-at": {
- "description": "Timestamp that denotes when the role was last updated.",
- "title": "Updated At",
- "uiOrder": 5,
- "format": "string"
- }
- },
- "required": [
- "name",
- "description",
- "default",
- "agent-type",
- "created-at",
- "updated-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_GROUP": {
- "shortDescription": "Get group using ID. This task will only work if you have admin privileges. Agents can be classified into groups such as Customer Support.",
- "input": {
- "description": "Group ID.",
- "uiOrder": 0,
- "properties": {
- "group-id": {
- "description": "Group ID.",
- "title": "Group ID",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "group-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Group information.",
- "uiOrder": 0,
- "properties": {
- "name": {
- "description": "Name of the group.",
- "title": "Name",
- "uiOrder": 0,
- "format": "string"
- },
- "description": {
- "description": "Description of the group.",
- "title": "Description",
- "uiOrder": 1,
- "format": "string"
- },
- "agent-ids": {
- "description": "Agent IDs of the group.",
- "title": "Agent IDs",
- "uiOrder": 2,
- "items": {
- "title": "Agent ID",
- "description": "ID of the agent.",
- "format": "integer"
- },
- "format": "array"
- },
- "auto-ticket-assign": {
- "description": "The type of automatic ticket assignment set for the group.",
- "title": "Auto Ticket Assign",
- "uiOrder": 3,
- "format": "string"
- },
- "escalate-to": {
- "description": "The ID of the user to whom an escalation email is sent if a ticket is unassigned.",
- "title": "Escalate To",
- "uiOrder": 4,
- "format": "integer"
- },
- "unassigned-duration": {
- "description": "The duration for which a ticket is unassigned before it is escalated.",
- "title": "Unassigned Duration",
- "uiOrder": 5,
- "format": "string"
- },
- "group-type": {
- "description": "Group type. Can be \"support_agent_group\" or \"field_agent_group\".",
- "title": "Group Type",
- "uiOrder": 6,
- "format": "string"
- },
- "agent-availability-status": {
- "description": "The availability status of the agent in the group. Automatically set to true if the group has enabled \"Automatic Ticket Assignment\".",
- "title": "Agent Availability Status",
- "uiOrder": 7,
- "format": "boolean"
- },
- "created-at": {
- "description": "Timestamp that denotes when the group was created.",
- "title": "Created At",
- "uiOrder": 8,
- "format": "string"
- },
- "updated-at": {
- "description": "Timestamp that denotes when the group was last updated.",
- "title": "Updated At",
- "uiOrder": 9,
- "format": "string"
- }
- },
- "required": [
- "name",
- "description",
- "auto-ticket-assign",
- "created-at",
- "updated-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_SKILL": {
- "shortDescription": "Get skill using ID. This task will only work if you have admin privileges. Agents can be assigned skills, and it is possible for tickets to be automatically assigned to agents based on the skills they have.",
- "input": {
- "description": "Skill ID.",
- "uiOrder": 0,
- "properties": {
- "skill-id": {
- "description": "Skill ID.",
- "title": "Skill ID",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "skill-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Skill information.",
- "uiOrder": 0,
- "properties": {
- "name": {
- "description": "Name of the skill.",
- "title": "Name",
- "uiOrder": 0,
- "format": "string"
- },
- "rank": {
- "description": "Rank of the skill.",
- "title": "Rank",
- "uiOrder": 1,
- "format": "integer"
- },
- "condition-match-type": {
- "description": "Type of condition match. Can be \"all\" or \"any\".",
- "title": "Condition Match Type",
- "uiOrder": 2,
- "format": "string"
- },
- "conditions": {
- "description": "Conditions for the skill.",
- "title": "Conditions",
- "items": {
- "title": "Condition",
- "format": "json"
- },
- "uiOrder": 3,
- "format": "array"
- },
- "created-at": {
- "description": "Timestamp that denotes when the skill was created.",
- "title": "Created At",
- "uiOrder": 4,
- "format": "string"
- },
- "updated-at": {
- "description": "Timestamp that denotes when the skill was last updated.",
- "title": "Updated At",
- "uiOrder": 5,
- "format": "string"
- }
- },
- "required": [
- "name",
- "rank",
- "condition-match-type",
- "conditions",
- "created-at",
- "updated-at"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/freshdesk/v0/config/tasks.yaml b/pkg/component/application/freshdesk/v0/config/tasks.yaml
new file mode 100644
index 000000000..47ba9804d
--- /dev/null
+++ b/pkg/component/application/freshdesk/v0/config/tasks.yaml
@@ -0,0 +1,2038 @@
+$defs:
+ language:
+ enum:
+ - Arabic
+ - Bosnian
+ - Bulgarian
+ - Catalan
+ - Chinese
+ - Chinese (Traditional)
+ - Croatian
+ - Czech
+ - Danish
+ - Dutch
+ - English
+ - Estonian
+ - Filipino
+ - Finnish
+ - French
+ - German
+ - Greek
+ - Hebrew
+ - Hungarian
+ - Icelandic
+ - Indonesian
+ - Italian
+ - Japanese
+ - Korean
+ - Latvian
+ - Lithuanian
+ - Malay
+ - Norwegian
+ - Polish
+ - Portuguese (BR)
+ - Portuguese/Portugal
+ - Romanian
+ - Russian
+ - Serbian
+ - Slovak
+ - Slovenian
+ - Spanish
+ - Spanish (Latin America)
+ - Swedish
+ - Thai
+ - Turkish
+ - Ukrainian
+ - Vietnamese
+ example: English
+ time-zone:
+ enum:
+ - American Samoa
+ - International Date Line West
+ - Midway Island
+ - Hawaii
+ - Alaska
+ - Pacific Time (US & Canada)
+ - Tijuana
+ - Arizona
+ - Mazatlan
+ - Mountain Time (US & Canada)
+ - Central America
+ - Central Time (US & Canada)
+ - Chihuahua
+ - Guadalajara
+ - Mexico City
+ - Monterrey
+ - Saskatchewan
+ - Bogota
+ - Eastern Time (US & Canada)
+ - Indiana (East)
+ - Lima
+ - Quito
+ - Atlantic Time (Canada)
+ - Caracas
+ - Georgetown
+ - La Paz
+ - Santiago
+ - Newfoundland
+ - Brasilia
+ - Buenos Aires
+ - Montevideo
+ - Greenland
+ - Mid-Atlantic
+ - Azores
+ - Cape Verde Is.
+ - Casablanca
+ - Dublin
+ - Edinburgh
+ - Lisbon
+ - London
+ - Monrovia
+ - UTC
+ - Amsterdam
+ - Belgrade
+ - Berlin
+ - Bern
+ - Bratislava
+ - Brussels
+ - Budapest
+ - Copenhagen
+ - Ljubljana
+ - Madrid
+ - Paris
+ - Prague
+ - Rome
+ - Sarajevo
+ - Skopje
+ - Stockholm
+ - Vienna
+ - Warsaw
+ - West Central Africa
+ - Zagreb
+ - Athens
+ - Bucharest
+ - Cairo
+ - Harare
+ - Helsinki
+ - Jerusalem
+ - Kaliningrad
+ - Kyiv
+ - Pretoria
+ - Riga
+ - Sofia
+ - Tallinn
+ - Vilnius
+ - Baghdad
+ - Istanbul
+ - Kuwait
+ - Minsk
+ - Moscow
+ - Nairobi
+ - Riyadh
+ - St. Petersburg
+ - Volgograd
+ - Tehran
+ - Abu Dhabi
+ - Baku
+ - Muscat
+ - Samara
+ - Tbilisi
+ - Yerevan
+ - Kabul
+ - Ekaterinburg
+ - Islamabad
+ - Karachi
+ - Tashkent
+ - Chennai
+ - Kolkata
+ - Mumbai
+ - New Delhi
+ - Sri Jayawardenepura
+ - Kathmandu
+ - Almaty
+ - Astana
+ - Dhaka
+ - Urumqi
+ - Rangoon
+ - Bangkok
+ - Hanoi
+ - Jakarta
+ - Krasnoyarsk
+ - Novosibirsk
+ - Beijing
+ - Chongqing
+ - Hong Kong
+ - Irkutsk
+ - Kuala Lumpur
+ - Perth
+ - Singapore
+ - Taipei
+ - Ulaanbaatar
+ - Osaka
+ - Sapporo
+ - Seoul
+ - Tokyo
+ - Yakutsk
+ - Adelaide
+ - Darwin
+ - Brisbane
+ - Canberra
+ - Guam
+ - Hobart
+ - Melbourne
+ - Port Moresby
+ - Sydney
+ - Vladivostok
+ - Magadan
+ - New Caledonia
+ - Solomon Is.
+ - Srednekolymsk
+ - Auckland
+ - Fiji
+ - Kamchatka
+ - Marshall Is.
+ - Wellington
+ - Chatham Is.
+ - Nuku'alofa
+ - Samoa
+ - Tokelau Is.
+ example: Eastern Time (US & Canada)
+ ticket:
+ ticket-id:
+ description: The ID of the ticket.
+ title: Ticket ID
+ format: integer
+ subject:
+ description: Subject of the ticket.
+ title: Subject
+ format: string
+ description-text:
+ description: Content of the ticket.
+ title: Description Text
+ format: string
+ source:
+ description: 'Source of the ticket. Eg: Email.'
+ title: Source
+ format: string
+ status:
+ description: 'Status of the ticket. Eg: Pending.'
+ title: Status
+ format: string
+ priority:
+ description: 'Priority of the ticket. Eg: Medium.'
+ title: Priority
+ format: string
+ ticket-type:
+ description: Used to categorize the ticket. To check the possible types a ticket
+ can have, please go to Admin -> Ticket Fields.
+ title: Ticket Type
+ format: string
+ association-type:
+ description: Used to determine whether a ticket is a parent, child, tracker
+ or related ticket.
+ title: Association Type
+ format: string
+ associated-ticket-list:
+ description: List of associated ticket IDs.
+ title: Associated Ticket List
+ format: array
+ tags:
+ description: Tags associated with the ticket.
+ title: Tags
+ format: array
+ cc-emails:
+ description: Email addresses added in the 'cc' field of the incoming ticket
+ email.
+ title: CC Emails
+ format: array
+ bcc-emails:
+ description: Email addresses added in the 'bcc' field of the incoming ticket
+ email.
+ title: BCC Emails
+ format: array
+ forward-emails:
+ description: Email addresses added while forwarding a ticket.
+ title: Forward Emails
+ format: array
+ reply-cc-emails:
+ description: Email addresses added while replying to a ticket.
+ title: Reply CC Emails
+ format: array
+ requester-id:
+ description: ID of the requester.
+ title: Requester ID
+ format: integer
+ responder-id:
+ description: ID of the agent to whom the ticket has been assigned. List of agents
+ can be found in Admin -> Agents.
+ title: Responder ID
+ format: integer
+ company-id:
+ description: ID of the company to which this ticket belongs.
+ title: Company ID
+ format: integer
+ group-id:
+ description: ID of the group to which the ticket has been assigned. List of
+ groups can be found in Admin -> Groups.
+ title: Group ID
+ format: integer
+ product-id:
+ description: ID of the product to which the ticket is associated. List of products
+ can be found in Admin -> Multiple Products.
+ title: Product ID
+ format: integer
+ support-email:
+ description: Support email address. You can find it in Admin -> Email (under
+ channel).
+ title: Support Email
+ format: string
+ to-emails:
+ description: Email addresses to which the ticket was originally sent.
+ title: To Emails
+ format: array
+ spam:
+ description: Set to true if the ticket is marked as spam.
+ title: Spam
+ format: boolean
+ due-by:
+ description: Timestamp that denotes when the ticket is due to be resolved. In
+ UTC format.
+ title: Due By
+ format: string
+ is-escalated:
+ description: Set to true if the ticket has been escalated.
+ title: Is Escalated
+ format: boolean
+ first-response-due-by:
+ description: Timestamp that denotes when the first response is due. In UTC format.
+ You can adjust this by going to Admin -> SLA policy (under Workflows).
+ title: First Response Due By
+ format: string
+ first-response-escalated:
+ description: Set to true if the ticket has been escalated as the result of first
+ response time being breached.
+ title: First Response Escalated
+ format: boolean
+ next-response-due-by:
+ description: Timestamp that denotes when the next response is due. In UTC format.
+ You can adjust this by going to Admin -> SLA policy (under Workflows).
+ title: Next Response Due By
+ format: string
+ next-response-escalated:
+ description: Set to true if the ticket has been escalated as the result of next
+ response time being breached.
+ title: Next Response Escalated
+ format: boolean
+ created-at:
+ description: Timestamp that denotes when the ticket/conversation was created.
+ In UTC format.
+ title: Created At
+ format: string
+ updated-at:
+ description: Timestamp that denotes when the ticket was last updated. In UTC
+ format.
+ title: Updated At
+ format: string
+ attachments:
+ description: Ticket attachments (cannot be more than 20MB).
+ title: Attachments
+ format: array
+ sentiment-score:
+ description: Freshdesk uses AI to assess the emotional tone and attitude expressed
+ in customer interaction.
+ title: Sentiment Score
+ format: integer
+ initial-sentiment-score:
+ description: The initial sentiment score of the ticket.
+ title: Initial Sentiment Score
+ format: integer
+ custom-fields:
+ description: Custom fields that the ticket have. Custom fields can be created
+ or modified in Admin -> Ticket Fields.
+ title: Custom Fields
+ format: object
+ conversation-id:
+ description: The ID of the note or reply that is associated with the ticket.
+ title: Conversation ID
+ format: integer
+ contact:
+ contact-id:
+ description: ID of the contact.
+ title: Contact ID
+ format: integer
+ name:
+ description: Name of the contact.
+ title: Name
+ format: string
+ email:
+ description: The primary email address of the contact.
+ title: Email
+ format: string
+ phone:
+ description: Telephone number of the contact.
+ title: Phone
+ format: string
+ mobile:
+ description: Mobile number of the contact.
+ title: Mobile
+ format: string
+ description:
+ description: Description of the contact.
+ title: Description
+ format: string
+ address:
+ description: Address of the contact.
+ title: Address
+ format: string
+ job-title:
+ description: Job title of the contact.
+ title: Job Title
+ format: string
+ tags:
+ description: Tags associated with the contact.
+ title: Tags
+ format: array
+ language:
+ description: Language of the contact.
+ title: Language
+ format: string
+ time-zone:
+ description: Time zone of the contact.
+ title: Time Zone
+ format: string
+ company-id:
+ description: ID of the primary company to which the contact belongs.
+ title: Company ID
+ format: integer
+ unique-external-id:
+ description: Unique external ID of the contact which be assigned by the user(agent).
+ title: Unique External ID
+ format: string
+ twitter-id:
+ description: Twitter ID of the contact.
+ title: Twitter ID
+ format: string
+ view-all-tickets:
+ description: Set to true if the contact can see all the tickets that are associated
+ with the primary company.
+ title: View All Tickets
+ format: boolean
+ deleted:
+ description: Set to true if the contact is deleted.
+ title: Deleted
+ format: boolean
+ active:
+ description: Set to true if the contact has been verified.
+ title: Active
+ format: boolean
+ other-emails:
+ description: List of other email addresses of the contact.
+ title: Other Emails
+ format: array
+ other-companies:
+ description: List of other companies to which the contact belongs.
+ title: Other Companies
+ format: array
+ other-phone-numbers:
+ description: List of other phone numbers of the contact.
+ title: Other Phone Numbers
+ format: array
+ created-at:
+ description: Timestamp that denotes when the contact was created. In UTC format.
+ title: Created At
+ format: string
+ updated-at:
+ description: Timestamp that denotes when the contact was last updated. In UTC
+ format.
+ title: Updated At
+ format: string
+ custom-fields:
+ description: Custom fields that the contact have. Custom fields can be created
+ or modified in Admin -> Customer Fields.
+ title: Custom Fields
+ format: object
+ company:
+ company-id:
+ description: ID of the company.
+ title: Company ID
+ format: integer
+ name:
+ description: Name of the company.
+ title: Name
+ format: string
+ description:
+ description: Description of the company.
+ title: Description
+ format: string
+ note:
+ description: Note about the company.
+ title: Note
+ format: string
+ domains:
+ description: Domains of the company.
+ title: Domains
+ format: array
+ health-score:
+ description: 'The strength of your relationship with the company. To look at
+ all the possible values or create custom values, please go to Admin -> Customer
+ Fields. Default values: "At risk", "Doing okay", "Happy".'
+ title: Health Score
+ format: string
+ account-tier:
+ description: 'Classification based on how much value the company brings to your
+ business. To look at all the possible values or create custom values, please
+ go to Admin -> Customer Fields. Default values: "Basic", "Premium", "Enterprise".'
+ title: Account Tier
+ format: string
+ renewal-date:
+ description: Date when your contract or relationship with the company is due
+ for renewal.
+ title: Renewal Date
+ format: string
+ industry:
+ description: The industry in which the company operates. To look at all the
+ possible values or create custom values, please go to Admin -> Customer Fields.
+ title: Industry
+ format: string
+ created-at:
+ description: Timestamp that denotes when the company was created. In UTC format.
+ title: Created At
+ format: string
+ updated-at:
+ description: Timestamp that denotes when the company was last updated. In UTC
+ format.
+ title: Updated At
+ format: string
+ custom-fields:
+ description: Custom fields that the company have. Custom fields can be created
+ or modified in Admin -> Customer Fields.
+ title: Custom Fields
+ format: object
+TASK_GET_TICKET:
+ shortDescription: Get ticket using ID
+ input:
+ description: Ticket ID.
+ uiOrder: 0
+ properties:
+ ticket-id:
+ $ref: '#/$defs/ticket/ticket-id'
+ acceptFormats:
+ - integer
+ uiOrder: 0
+ required:
+ - ticket-id
+ title: Input
+ format: object
+ output:
+ description: Ticket information.
+ uiOrder: 0
+ properties:
+ subject:
+ $ref: '#/$defs/ticket/subject'
+ uiOrder: 0
+ format: string
+ description-text:
+ $ref: '#/$defs/ticket/description-text'
+ uiOrder: 1
+ format: string
+ source:
+ $ref: '#/$defs/ticket/source'
+ uiOrder: 2
+ format: string
+ status:
+ $ref: '#/$defs/ticket/status'
+ uiOrder: 3
+ format: string
+ priority:
+ $ref: '#/$defs/ticket/priority'
+ uiOrder: 4
+ format: string
+ ticket-type:
+ $ref: '#/$defs/ticket/ticket-type'
+ uiOrder: 5
+ format: string
+ association-type:
+ $ref: '#/$defs/ticket/association-type'
+ uiOrder: 6
+ format: string
+ associated-ticket-list:
+ $ref: '#/$defs/ticket/associated-ticket-list'
+ items:
+ title: Associated Ticket
+ description: The ID of the ticket associated with the current ticket.
+ format: integer
+ uiOrder: 7
+ format: array
+ tags:
+ $ref: '#/$defs/ticket/tags'
+ items:
+ title: Tag
+ description: Tag associated with the ticket.
+ format: string
+ uiOrder: 8
+ format: array
+ cc-emails:
+ $ref: '#/$defs/ticket/cc-emails'
+ items:
+ title: CC Email
+ description: One of the email address added in the 'cc' field of the incoming
+ ticket email.
+ format: string
+ uiOrder: 9
+ format: array
+ forward-emails:
+ $ref: '#/$defs/ticket/forward-emails'
+ items:
+ title: Forward Email
+ description: One of the email address added while forwarding a ticket.
+ format: string
+ uiOrder: 10
+ format: array
+ reply-cc-emails:
+ $ref: '#/$defs/ticket/reply-cc-emails'
+ items:
+ title: Reply CC Email
+ description: One of the email address added while replying to a ticket.
+ format: string
+ uiOrder: 11
+ format: array
+ requester-id:
+ $ref: '#/$defs/ticket/requester-id'
+ uiOrder: 12
+ format: integer
+ responder-id:
+ $ref: '#/$defs/ticket/responder-id'
+ uiOrder: 13
+ format: integer
+ company-id:
+ $ref: '#/$defs/ticket/company-id'
+ uiOrder: 14
+ format: integer
+ group-id:
+ $ref: '#/$defs/ticket/group-id'
+ uiOrder: 15
+ format: integer
+ product-id:
+ $ref: '#/$defs/ticket/product-id'
+ uiOrder: 16
+ format: integer
+ support-email:
+ $ref: '#/$defs/ticket/support-email'
+ uiOrder: 17
+ format: string
+ to-emails:
+ $ref: '#/$defs/ticket/to-emails'
+ items:
+ title: To Email
+ description: One of the email address to which the ticket was originally
+ sent.
+ format: string
+ uiOrder: 18
+ format: array
+ spam:
+ $ref: '#/$defs/ticket/spam'
+ uiOrder: 19
+ format: boolean
+ due-by:
+ $ref: '#/$defs/ticket/due-by'
+ uiOrder: 20
+ format: string
+ is-escalated:
+ $ref: '#/$defs/ticket/is-escalated'
+ uiOrder: 21
+ format: boolean
+ first-response-due-by:
+ $ref: '#/$defs/ticket/first-response-due-by'
+ uiOrder: 22
+ format: string
+ first-response-escalated:
+ $ref: '#/$defs/ticket/first-response-escalated'
+ uiOrder: 23
+ format: boolean
+ next-response-due-by:
+ $ref: '#/$defs/ticket/next-response-due-by'
+ uiOrder: 24
+ format: string
+ next-response-escalated:
+ $ref: '#/$defs/ticket/next-response-escalated'
+ uiOrder: 25
+ format: boolean
+ created-at:
+ $ref: '#/$defs/ticket/created-at'
+ uiOrder: 26
+ format: string
+ updated-at:
+ $ref: '#/$defs/ticket/updated-at'
+ uiOrder: 27
+ format: string
+ attachments:
+ $ref: '#/$defs/ticket/attachments'
+ items:
+ title: Attachment
+ properties:
+ name:
+ description: The name of the file.
+ uiOrder: 0
+ title: Attachment Name
+ format: string
+ content-type:
+ description: The type of the file.
+ uiOrder: 1
+ title: Attachment Content Type
+ format: string
+ url:
+ description: The URL to the attachment.
+ uiOrder: 2
+ title: Attachment URL
+ format: string
+ required:
+ - name
+ - content-type
+ - url
+ format: object
+ uiOrder: 28
+ format: array
+ sentiment-score:
+ $ref: '#/$defs/ticket/sentiment-score'
+ uiOrder: 29
+ format: integer
+ initial-sentiment-score:
+ $ref: '#/$defs/ticket/initial-sentiment-score'
+ uiOrder: 30
+ format: integer
+ custom-fields:
+ $ref: '#/$defs/ticket/custom-fields'
+ required: []
+ uiOrder: 31
+ format: json
+ required:
+ - requester-id
+ - subject
+ - description-text
+ - source
+ - status
+ - priority
+ - created-at
+ - updated-at
+ title: Output
+ format: object
+TASK_CREATE_TICKET:
+ shortDescription: Create ticket
+ input:
+ description: Ticket Information.
+ uiOrder: 0
+ properties:
+ requester-id:
+ description: ID of the requester. Must be an existing contact. If you fill
+ in this field, you don't need to fill in the email field. Only one of the
+ two fields is required.
+ title: Requester ID
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ format: integer
+ email:
+ description: Email address of the requester. If you fill in the Requester
+ ID above, it will be ignored. Only one of the two fields is required. If
+ no contact exists with this email address in Freshdesk, it will be added
+ as a new contact.
+ title: Email
+ uiOrder: 1
+ acceptFormats:
+ - string
+ format: string
+ subject:
+ $ref: '#/$defs/ticket/subject'
+ uiOrder: 2
+ acceptFormats:
+ - string
+ description:
+ description: Content of the ticket. You can use HTML tags in the content.
+ title: Description
+ uiOrder: 3
+ acceptFormats:
+ - string
+ format: string
+ source:
+ $ref: '#/$defs/ticket/source'
+ enum:
+ - Email
+ - Portal
+ - Phone
+ - Twitter
+ - Facebook
+ - Chat
+ - Feedback Widget
+ - Outbound Email
+ - Ecommerce
+ example: Portal
+ uiOrder: 4
+ acceptFormats:
+ - string
+ status:
+ $ref: '#/$defs/ticket/status'
+ enum:
+ - Open
+ - Pending
+ - Resolved
+ - Closed
+ - Waiting on Customer
+ - Waiting on Third Party
+ example: Open
+ uiOrder: 5
+ acceptFormats:
+ - string
+ priority:
+ $ref: '#/$defs/ticket/priority'
+ enum:
+ - Low
+ - Medium
+ - High
+ - Urgent
+ example: Low
+ uiOrder: 6
+ acceptFormats:
+ - string
+ ticket-type:
+ $ref: '#/$defs/ticket/ticket-type'
+ uiOrder: 7
+ acceptFormats:
+ - string
+ company-id:
+ $ref: '#/$defs/ticket/company-id'
+ uiOrder: 8
+ acceptFormats:
+ - integer
+ product-id:
+ $ref: '#/$defs/ticket/product-id'
+ uiOrder: 9
+ acceptFormats:
+ - integer
+ group-id:
+ $ref: '#/$defs/ticket/group-id'
+ uiOrder: 10
+ acceptFormats:
+ - integer
+ responder-id:
+ $ref: '#/$defs/ticket/responder-id'
+ uiOrder: 11
+ acceptFormats:
+ - integer
+ tags:
+ $ref: '#/$defs/ticket/tags'
+ uiOrder: 12
+ acceptFormats:
+ - array
+ items:
+ format: string
+ cc-emails:
+ $ref: '#/$defs/ticket/cc-emails'
+ uiOrder: 13
+ acceptFormats:
+ - array
+ items:
+ format: string
+ parent-id:
+ description: ID of the parent ticket. Need to be filled out if you want to
+ create a child ticket.
+ title: Parent ID
+ uiOrder: 14
+ acceptFormats:
+ - integer
+ format: integer
+ related-ticket-ids:
+ description: List of related ticket IDs. Need to be filled out if you want
+ to create a tracker ticket.
+ title: Related Ticket IDs
+ uiOrder: 15
+ acceptFormats:
+ - array
+ items:
+ format: integer
+ format: array
+ required:
+ - subject
+ - description
+ - source
+ - status
+ - priority
+ title: Input
+ format: object
+ output:
+ description: Ticket ID and create date.
+ uiOrder: 0
+ properties:
+ ticket-id:
+ $ref: '#/$defs/ticket/ticket-id'
+ uiOrder: 0
+ format: integer
+ created-at:
+ $ref: '#/$defs/ticket/created-at'
+ uiOrder: 1
+ format: string
+ required:
+ - ticket-id
+ - created-at
+ title: Output
+ format: object
+TASK_REPLY_TO_TICKET:
+ shortDescription: Reply to a ticket thread.
+ input:
+ description: Reply information.
+ uiOrder: 0
+ properties:
+ ticket-id:
+ $ref: '#/$defs/ticket/ticket-id'
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ body:
+ description: Content of the reply. Can be in HTML format.
+ title: Body
+ uiOrder: 0
+ acceptFormats:
+ - string
+ format: string
+ from-email:
+ description: Email address that is replying to the ticket. You need to have
+ this email address registered in Freshdesk by going to Admin -> Emails.
+ If you leave this field empty, the global support email will be used.
+ title: From Email
+ uiOrder: 1
+ acceptFormats:
+ - string
+ format: string
+ user-id:
+ description: ID of the agent/contact replying to the ticket. If you fill this
+ field using a contact ID, there will be no email sent to the requester.
+ title: User ID
+ uiOrder: 2
+ acceptFormats:
+ - integer
+ format: integer
+ cc-emails:
+ description: Email addresses added in the 'cc' field of the outgoing ticket
+ email.
+ title: CC Emails
+ uiOrder: 3
+ acceptFormats:
+ - array
+ items:
+ format: string
+ format: array
+ bcc-emails:
+ description: Email addresses added in the 'bcc' field of the outgoing ticket
+ email.
+ title: BCC Emails
+ uiOrder: 4
+ acceptFormats:
+ - array
+ items:
+ format: string
+ format: array
+ required:
+ - ticket-id
+ - body
+ title: Input
+ format: object
+ output:
+ description: Conversation ID, Ticket ID and created date.
+ uiOrder: 0
+ properties:
+ conversation-id:
+ $ref: '#/$defs/ticket/conversation-id'
+ uiOrder: 0
+ format: integer
+ created-at:
+ $ref: '#/$defs/ticket/created-at'
+ uiOrder: 1
+ format: string
+ required:
+ - conversation-id
+ - created-at
+ title: Output
+ format: object
+TASK_CREATE_TICKET_NOTE:
+ shortDescription: Create a private/public note on a ticket thread.
+ input:
+ description: Note information.
+ uiOrder: 0
+ properties:
+ ticket-id:
+ $ref: '#/$defs/ticket/ticket-id'
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ body:
+ description: Content of the note. Can be in HTML format.
+ title: Body
+ uiOrder: 1
+ acceptFormats:
+ - string
+ format: string
+ notify-emails:
+ description: Email addresses of agents/users who need to be notified about
+ this note. The emails need to exist in Freshdesk agent. Agent list can be
+ seen in Admin -> Agents.
+ title: Notify Emails
+ uiOrder: 2
+ acceptFormats:
+ - array
+ items:
+ format: string
+ format: array
+ user-id:
+ description: ID of the agent/contact who is adding the note.
+ title: User ID
+ uiOrder: 3
+ acceptFormats:
+ - integer
+ format: integer
+ private:
+ description: Set to true if the note is private.
+ title: Private
+ uiOrder: 4
+ acceptFormats:
+ - boolean
+ format: boolean
+ incoming:
+ description: Set to true if a particular note should appear as being created
+ from outside (i.e., not through web portal).
+ title: Incoming
+ uiOrder: 5
+ acceptFormats:
+ - boolean
+ format: boolean
+ required:
+ - ticket-id
+ - body
+ title: Input
+ format: object
+ output:
+ description: Conversation ID, Ticket ID and created date.
+ uiOrder: 0
+ properties:
+ conversation-id:
+ $ref: '#/$defs/ticket/conversation-id'
+ uiOrder: 0
+ format: integer
+ created-at:
+ $ref: '#/$defs/ticket/created-at'
+ uiOrder: 1
+ format: string
+ required:
+ - conversation-id
+ - created-at
+ title: Output
+ format: object
+TASK_GET_ALL_CONVERSATIONS:
+ shortDescription: Get all the conversations in a ticket. (Conversations are replies
+ and notes that are added to a ticket)
+ input:
+ description: Ticket ID.
+ uiOrder: 0
+ properties:
+ ticket-id:
+ description: Ticket ID.
+ title: Ticket ID
+ uiOrder: 2
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - ticket-id
+ title: Input
+ format: object
+ output:
+ description: Conversations.
+ uiOrder: 0
+ properties:
+ conversations:
+ description: An array of conversations.
+ uiOrder: 0
+ title: Conversations
+ items:
+ title: Conversation
+ properties:
+ body-text:
+ description: Content of the conversation.
+ title: Body Text
+ uiOrder: 0
+ format: string
+ conversation-id:
+ $ref: '#/$defs/ticket/conversation-id'
+ uiOrder: 1
+ format: integer
+ support-email:
+ $ref: '#/$defs/ticket/support-email'
+ uiOrder: 2
+ format: string
+ to-emails:
+ description: Email addresses of agents/users who need to be notified
+ about this conversation.
+ title: To Emails
+ uiOrder: 3
+ items:
+ title: To Email
+ description: One of the email addresses of agents/users who need to
+ be notified about this conversation.
+ format: string
+ format: array
+ from-email:
+ description: Email address that is replying to the ticket or adding
+ the note.
+ title: From Email
+ uiOrder: 4
+ acceptFormats:
+ - string
+ format: string
+ cc-emails:
+ $ref: '#/$defs/ticket/cc-emails'
+ uiOrder: 5
+ items:
+ title: CC Email
+ description: One of the email address added in the 'cc' field of the
+ incoming ticket email.
+ format: string
+ format: array
+ bcc-emails:
+ $ref: '#/$defs/ticket/bcc-emails'
+ uiOrder: 6
+ items:
+ title: BCC Email
+ description: One of the email address added in the 'bcc' field of
+ the incoming ticket email.
+ format: string
+ format: array
+ incoming:
+ description: Set to true if a particular conversation should appear
+ as being created from outside.
+ title: Incoming
+ uiOrder: 7
+ format: boolean
+ private:
+ description: Set to true if a note is private. Can be set only for notes.
+ title: Incoming
+ uiOrder: 8
+ format: boolean
+ user-id:
+ description: ID of the agent/contact replying to the ticket.
+ title: Incoming
+ uiOrder: 9
+ format: integer
+ created-at:
+ $ref: '#/$defs/ticket/created-at'
+ uiOrder: 10
+ format: string
+ required:
+ - body-text
+ - created-at
+ format: object
+ format: array
+ conversations-length:
+ description: Number of conversations.
+ title: Conversations Length
+ uiOrder: 1
+ format: integer
+ required:
+ - conversations
+ - conversations-length
+ title: Output
+ format: object
+TASK_GET_CONTACT:
+ shortDescription: Get contact using ID
+ input:
+ description: Contact ID.
+ uiOrder: 0
+ properties:
+ contact-id:
+ $ref: '#/$defs/contact/contact-id'
+ acceptFormats:
+ - integer
+ uiOrder: 0
+ required:
+ - contact-id
+ title: Input
+ format: object
+ output:
+ description: Contact information.
+ uiOrder: 0
+ properties:
+ name:
+ $ref: '#/$defs/contact/name'
+ uiOrder: 0
+ format: string
+ email:
+ $ref: '#/$defs/contact/email'
+ uiOrder: 1
+ format: string
+ phone:
+ $ref: '#/$defs/contact/phone'
+ uiOrder: 2
+ format: string
+ mobile:
+ $ref: '#/$defs/contact/mobile'
+ uiOrder: 3
+ format: string
+ description:
+ $ref: '#/$defs/contact/description'
+ uiOrder: 4
+ format: string
+ address:
+ $ref: '#/$defs/contact/address'
+ uiOrder: 5
+ format: string
+ job-title:
+ $ref: '#/$defs/contact/job-title'
+ uiOrder: 6
+ format: string
+ tags:
+ $ref: '#/$defs/contact/tags'
+ items:
+ title: Tag
+ description: Tag associated with the contact.
+ format: string
+ uiOrder: 7
+ format: array
+ language:
+ $ref: '#/$defs/contact/language'
+ uiOrder: 8
+ format: string
+ time-zone:
+ $ref: '#/$defs/contact/time-zone'
+ uiOrder: 9
+ format: string
+ company-id:
+ $ref: '#/$defs/contact/company-id'
+ uiOrder: 10
+ format: integer
+ unique-external-id:
+ $ref: '#/$defs/contact/unique-external-id'
+ uiOrder: 11
+ format: string
+ twitter-id:
+ $ref: '#/$defs/contact/twitter-id'
+ uiOrder: 12
+ format: string
+ view-all-tickets:
+ $ref: '#/$defs/contact/view-all-tickets'
+ uiOrder: 13
+ format: boolean
+ deleted:
+ $ref: '#/$defs/contact/deleted'
+ uiOrder: 14
+ format: boolean
+ active:
+ $ref: '#/$defs/contact/active'
+ uiOrder: 15
+ format: boolean
+ other-emails:
+ $ref: '#/$defs/contact/other-emails'
+ items:
+ title: Other Email
+ description: The other email addresses of the contact.
+ format: string
+ uiOrder: 16
+ format: array
+ other-companies:
+ $ref: '#/$defs/contact/other-companies'
+ items:
+ title: Company
+ properties:
+ company-id:
+ description: ID of the company.
+ uiOrder: 0
+ title: Company ID
+ format: integer
+ view-all-tickets:
+ description: Set to true if the contact can see all the tickets that
+ are associated with the company.
+ uiOrder: 1
+ title: View All Tickets
+ format: boolean
+ required:
+ - company-id
+ - view-all-tickets
+ format: object
+ uiOrder: 17
+ format: array
+ other-phone-numbers:
+ $ref: '#/$defs/contact/other-phone-numbers'
+ items:
+ title: Other Phone Number
+ description: The other phone number of the contact.
+ format: string
+ uiOrder: 18
+ format: array
+ created-at:
+ $ref: '#/$defs/contact/created-at'
+ uiOrder: 19
+ format: string
+ updated-at:
+ $ref: '#/$defs/contact/updated-at'
+ uiOrder: 20
+ format: string
+ custom-fields:
+ $ref: '#/$defs/contact/custom-fields'
+ required: []
+ uiOrder: 21
+ format: json
+ required:
+ - name
+ title: Output
+ format: object
+TASK_CREATE_CONTACT:
+ shortDescription: Create contact
+ input:
+ description: Contact Information.
+ uiOrder: 0
+ properties:
+ name:
+ $ref: '#/$defs/contact/name'
+ uiOrder: 0
+ acceptFormats:
+ - string
+ email:
+ $ref: '#/$defs/contact/email'
+ uiOrder: 1
+ acceptFormats:
+ - string
+ phone:
+ $ref: '#/$defs/contact/phone'
+ uiOrder: 2
+ acceptFormats:
+ - string
+ mobile:
+ $ref: '#/$defs/contact/mobile'
+ uiOrder: 3
+ acceptFormats:
+ - string
+ description:
+ $ref: '#/$defs/contact/description'
+ uiOrder: 4
+ acceptFormats:
+ - string
+ address:
+ $ref: '#/$defs/contact/address'
+ uiOrder: 5
+ acceptFormats:
+ - string
+ job-title:
+ $ref: '#/$defs/contact/job-title'
+ uiOrder: 6
+ acceptFormats:
+ - string
+ tags:
+ $ref: '#/$defs/contact/tags'
+ uiOrder: 7
+ acceptFormats:
+ - array
+ items:
+ format: string
+ language:
+ description: Language of the contact.
+ title: Language
+ $ref: '#/$defs/language'
+ uiOrder: 8
+ acceptFormats:
+ - string
+ format: string
+ time-zone:
+ description: Time zone of the contact.
+ title: Time Zone
+ $ref: '#/$defs/time-zone'
+ uiOrder: 9
+ acceptFormats:
+ - string
+ format: string
+ company-id:
+ $ref: '#/$defs/contact/company-id'
+ uiOrder: 10
+ acceptFormats:
+ - integer
+ unique-external-id:
+ $ref: '#/$defs/contact/unique-external-id'
+ uiOrder: 11
+ acceptFormats:
+ - string
+ twitter-id:
+ $ref: '#/$defs/contact/twitter-id'
+ uiOrder: 12
+ acceptFormats:
+ - string
+ view-all-tickets:
+ description: 'Used to determine if the contact can see all the tickets that
+ are associated with the primary company. Note: this property will be ignored
+ if the Company ID is not provided.'
+ title: View All Tickets
+ uiOrder: 13
+ acceptFormats:
+ - boolean
+ format: boolean
+ other-emails:
+ $ref: '#/$defs/contact/other-emails'
+ uiOrder: 14
+ acceptFormats:
+ - array
+ items:
+ format: string
+ other-companies:
+ title: Other Companies
+ description: 'List of other companies to which the contact belongs. Each company
+ should be in the format of company-id;view-all-tickets(boolean "true"/"false")
+ Example: 123;true.'
+ items:
+ format: string
+ uiOrder: 15
+ format: array
+ other-phone-numbers:
+ $ref: '#/$defs/contact/other-phone-numbers'
+ uiOrder: 16
+ acceptFormats:
+ - array
+ items:
+ format: string
+ required:
+ - name
+ title: Input
+ format: object
+ output:
+ description: Contact ID and create date.
+ uiOrder: 0
+ properties:
+ contact-id:
+ $ref: '#/$defs/contact/contact-id'
+ uiOrder: 0
+ format: integer
+ created-at:
+ $ref: '#/$defs/contact/created-at'
+ uiOrder: 1
+ format: string
+ required:
+ - contact-id
+ - created-at
+ title: Output
+ format: object
+TASK_GET_COMPANY:
+ shortDescription: Get company using ID
+ input:
+ description: Company ID.
+ uiOrder: 0
+ properties:
+ company-id:
+ $ref: '#/$defs/contact/company-id'
+ acceptFormats:
+ - integer
+ uiOrder: 0
+ required:
+ - company-id
+ title: Input
+ format: object
+ output:
+ description: Company information.
+ uiOrder: 0
+ properties:
+ name:
+ $ref: '#/$defs/company/name'
+ uiOrder: 0
+ format: string
+ description:
+ $ref: '#/$defs/company/description'
+ uiOrder: 1
+ format: string
+ note:
+ $ref: '#/$defs/company/note'
+ uiOrder: 2
+ format: string
+ domains:
+ $ref: '#/$defs/company/domains'
+ items:
+ title: Domain
+ description: Domain of the company.
+ format: string
+ uiOrder: 3
+ format: array
+ health-score:
+ $ref: '#/$defs/company/health-score'
+ uiOrder: 4
+ format: string
+ account-tier:
+ $ref: '#/$defs/company/account-tier'
+ uiOrder: 5
+ format: string
+ renewal-date:
+ $ref: '#/$defs/company/renewal-date'
+ uiOrder: 6
+ format: string
+ industry:
+ $ref: '#/$defs/company/industry'
+ uiOrder: 7
+ format: string
+ created-at:
+ $ref: '#/$defs/company/created-at'
+ uiOrder: 8
+ format: string
+ updated-at:
+ $ref: '#/$defs/company/updated-at'
+ uiOrder: 9
+ format: string
+ custom-fields:
+ $ref: '#/$defs/company/custom-fields'
+ required: []
+ uiOrder: 10
+ format: json
+ required:
+ - name
+ - created-at
+ - updated-at
+ title: Output
+ format: object
+TASK_CREATE_COMPANY:
+ shortDescription: Create company
+ input:
+ description: Company Information.
+ uiOrder: 0
+ properties:
+ name:
+ $ref: '#/$defs/company/name'
+ uiOrder: 0
+ acceptFormats:
+ - string
+ description:
+ $ref: '#/$defs/company/description'
+ uiOrder: 1
+ acceptFormats:
+ - string
+ note:
+ $ref: '#/$defs/company/note'
+ uiOrder: 2
+ acceptFormats:
+ - string
+ domains:
+ $ref: '#/$defs/company/domains'
+ uiOrder: 3
+ acceptFormats:
+ - array
+ items:
+ format: string
+ health-score:
+ $ref: '#/$defs/company/health-score'
+ uiOrder: 4
+ acceptFormats:
+ - string
+ account-tier:
+ $ref: '#/$defs/company/account-tier'
+ uiOrder: 5
+ acceptFormats:
+ - string
+ renewal-date:
+ description: Date when your contract or relationship with the company is due
+ for renewal. Enter in the format YYYY-MM-DD.
+ title: Renewal Date
+ uiOrder: 6
+ acceptFormats:
+ - string
+ format: string
+ industry:
+ $ref: '#/$defs/company/industry'
+ uiOrder: 7
+ acceptFormats:
+ - string
+ required:
+ - name
+ title: Input
+ format: object
+ output:
+ description: Company ID and create date.
+ uiOrder: 0
+ properties:
+ company-id:
+ $ref: '#/$defs/company/company-id'
+ uiOrder: 0
+ format: integer
+ created-at:
+ $ref: '#/$defs/company/created-at'
+ uiOrder: 1
+ format: string
+ required:
+ - company-id
+ - created-at
+ title: Output
+ format: object
+TASK_GET_ALL:
+ shortDescription: 'Task to get all the IDs of existing contacts, companies, tickets,
+ products, agents, roles, or skills. Note: products, agents, roles, and skills
+ require admin privileges. Some of these might not work, depending on the plan
+ you are on.'
+ input:
+ description: Object type.
+ uiOrder: 0
+ properties:
+ object-type:
+ description: Type of object to get IDs for.
+ title: Object Type
+ enum:
+ - Contacts
+ - Companies
+ - Tickets
+ - Products
+ - Agents
+ - Roles
+ - Skills
+ uiOrder: 0
+ acceptFormats:
+ - string
+ format: string
+ length:
+ description: The maximum number of IDs allowed is 500. The most recent IDs
+ will be retrieved.
+ default: 500
+ title: Length
+ uiOrder: 1
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - object-type
+ - length
+ title: Input
+ format: object
+ output:
+ description: IDs of the object.
+ uiOrder: 0
+ properties:
+ ids:
+ description: List of IDs.
+ title: IDs
+ items:
+ title: ID
+ description: ID of the object.
+ format: integer
+ uiOrder: 0
+ format: array
+ id-length:
+ description: Number of IDs.
+ title: ID Length
+ uiOrder: 1
+ format: integer
+ required:
+ - ids
+ - id-length
+ title: Output
+ format: object
+TASK_GET_PRODUCT:
+ shortDescription: Get product using ID. This task will only work if you have admin
+ privileges.
+ input:
+ description: Product ID.
+ uiOrder: 0
+ properties:
+ product-id:
+ description: Product ID.
+ title: Product ID
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - product-id
+ title: Input
+ format: object
+ output:
+ description: Product information.
+ uiOrder: 0
+ properties:
+ name:
+ description: Name of the product.
+ title: Name
+ uiOrder: 0
+ format: string
+ description:
+ description: Description of the product.
+ title: Description
+ uiOrder: 1
+ format: string
+ primary-email:
+ description: Primary email of the product.
+ title: Primary Email
+ uiOrder: 2
+ format: string
+ created-at:
+ description: Timestamp that denotes when the product was created.
+ title: Created At
+ uiOrder: 3
+ format: string
+ updated-at:
+ description: Timestamp that denotes when the product was last updated.
+ title: Updated At
+ uiOrder: 4
+ format: string
+ default:
+ description: Set to true if the product is the default product.
+ title: Default
+ uiOrder: 5
+ format: boolean
+ required:
+ - name
+ - description
+ - primary-email
+ - created-at
+ - updated-at
+ - default
+ title: Output
+ format: object
+TASK_GET_AGENT:
+ shortDescription: Get agent using ID. This task will only work if you have admin
+ privileges. Agents are those in your team who will login to Freshdesk.
+ input:
+ description: Agent ID.
+ uiOrder: 0
+ properties:
+ agent-id:
+ description: Agent ID.
+ title: Agent ID
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - agent-id
+ title: Input
+ format: object
+ output:
+ description: Agent information.
+ uiOrder: 0
+ properties:
+ name:
+ description: Name of the agent.
+ title: Name
+ uiOrder: 0
+ format: string
+ active:
+ description: Set to true if the agent is verified.
+ title: Active
+ uiOrder: 1
+ format: boolean
+ email:
+ description: Email of the agent.
+ title: Email
+ uiOrder: 2
+ format: string
+ job-title:
+ description: Job title of the agent.
+ title: Job Title
+ uiOrder: 3
+ format: string
+ language:
+ description: Language of the agent.
+ title: Language
+ uiOrder: 4
+ format: string
+ mobile:
+ description: Mobile number of the agent.
+ title: Mobile
+ uiOrder: 5
+ format: string
+ phone:
+ description: Telephone number of the agent.
+ title: Phone
+ uiOrder: 6
+ format: string
+ time-zone:
+ description: Time zone of the agent.
+ title: Time Zone
+ uiOrder: 7
+ format: string
+ ticket-scope:
+ description: Ticket permission of the agent. Can be "Global Access", "Group
+ Access" or "Restricted Access".
+ title: Ticket Scope
+ uiOrder: 9
+ format: string
+ available:
+ description: Set to true if the agent is in a group that has enabled "Automatic
+ Ticket Assignment".
+ title: Available
+ uiOrder: 10
+ format: boolean
+ group-ids:
+ description: Group IDs of the agent.
+ title: Group IDs
+ uiOrder: 11
+ items:
+ title: Group ID
+ description: ID of the group.
+ format: integer
+ format: array
+ role-ids:
+ description: Role IDs of the agent.
+ title: Role IDs
+ uiOrder: 12
+ items:
+ title: Role ID
+ description: ID of the role.
+ format: integer
+ format: array
+ skill-ids:
+ description: Skill IDs of the agent.
+ title: Skill IDs
+ uiOrder: 13
+ items:
+ title: Skill ID
+ description: ID of the skill.
+ format: integer
+ format: array
+ occasional:
+ description: Set to true if the agent is not working full-time.
+ title: Occasional
+ uiOrder: 14
+ format: boolean
+ signature:
+ description: Signature of the agent in HTML format.
+ title: Signature
+ uiOrder: 15
+ format: string
+ focus-mode:
+ description: Set to true if the agent is in focus mode.
+ title: Focus Mode
+ uiOrder: 16
+ format: boolean
+ deactivated:
+ description: Set to true if the agent is deactivated.
+ title: Deactivated
+ uiOrder: 17
+ format: boolean
+ created-at:
+ description: Timestamp that denotes when the agent was created.
+ title: Created At
+ uiOrder: 18
+ format: string
+ updated-at:
+ description: Timestamp that denotes when the agent was last updated.
+ title: Updated At
+ uiOrder: 19
+ format: string
+ type:
+ description: Type of the agent. Can be "Support Agent", "Field Agent" or "Collaborator".
+ title: Type
+ uiOrder: 8
+ format: string
+ required:
+ - email
+ - type
+ - ticket-scope
+ - occasional
+ title: Output
+ format: object
+TASK_GET_ROLE:
+ shortDescription: Get role using ID. This task will only work if you have admin
+ privileges. Roles allow agents/collaborators to have different privileges.
+ input:
+ description: Role ID.
+ uiOrder: 0
+ properties:
+ role-id:
+ description: Role ID.
+ title: Role ID
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - role-id
+ title: Input
+ format: object
+ output:
+ description: Role information.
+ uiOrder: 0
+ properties:
+ name:
+ description: Name of the role.
+ title: Name
+ uiOrder: 0
+ format: string
+ description:
+ description: Description of the role.
+ title: Description
+ uiOrder: 1
+ format: string
+ default:
+ description: Set to true if the role is the default role.
+ title: Default
+ uiOrder: 2
+ format: boolean
+ agent-type:
+ description: Type of the agent. Can be "Support Agent", "Field Agent" or "Collaborator".
+ title: Agent Type
+ uiOrder: 3
+ format: string
+ created-at:
+ description: Timestamp that denotes when the role was created.
+ title: Created At
+ uiOrder: 4
+ format: string
+ updated-at:
+ description: Timestamp that denotes when the role was last updated.
+ title: Updated At
+ uiOrder: 5
+ format: string
+ required:
+ - name
+ - description
+ - default
+ - agent-type
+ - created-at
+ - updated-at
+ title: Output
+ format: object
+TASK_GET_GROUP:
+ shortDescription: Get group using ID. This task will only work if you have admin
+ privileges. Agents can be classified into groups such as Customer Support.
+ input:
+ description: Group ID.
+ uiOrder: 0
+ properties:
+ group-id:
+ description: Group ID.
+ title: Group ID
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - group-id
+ title: Input
+ format: object
+ output:
+ description: Group information.
+ uiOrder: 0
+ properties:
+ name:
+ description: Name of the group.
+ title: Name
+ uiOrder: 0
+ format: string
+ description:
+ description: Description of the group.
+ title: Description
+ uiOrder: 1
+ format: string
+ agent-ids:
+ description: Agent IDs of the group.
+ title: Agent IDs
+ uiOrder: 2
+ items:
+ title: Agent ID
+ description: ID of the agent.
+ format: integer
+ format: array
+ auto-ticket-assign:
+ description: The type of automatic ticket assignment set for the group.
+ title: Auto Ticket Assign
+ uiOrder: 3
+ format: string
+ escalate-to:
+ description: The ID of the user to whom an escalation email is sent if a ticket
+ is unassigned.
+ title: Escalate To
+ uiOrder: 4
+ format: integer
+ unassigned-duration:
+ description: The duration for which a ticket is unassigned before it is escalated.
+ title: Unassigned Duration
+ uiOrder: 5
+ format: string
+ group-type:
+ description: Group type. Can be "support_agent_group" or "field_agent_group".
+ title: Group Type
+ uiOrder: 6
+ format: string
+ agent-availability-status:
+ description: The availability status of the agent in the group. Automatically
+ set to true if the group has enabled "Automatic Ticket Assignment".
+ title: Agent Availability Status
+ uiOrder: 7
+ format: boolean
+ created-at:
+ description: Timestamp that denotes when the group was created.
+ title: Created At
+ uiOrder: 8
+ format: string
+ updated-at:
+ description: Timestamp that denotes when the group was last updated.
+ title: Updated At
+ uiOrder: 9
+ format: string
+ required:
+ - name
+ - description
+ - auto-ticket-assign
+ - created-at
+ - updated-at
+ title: Output
+ format: object
+TASK_GET_SKILL:
+ shortDescription: Get skill using ID. This task will only work if you have admin
+ privileges. Agents can be assigned skills, and it is possible for tickets to be
+ automatically assigned to agents based on the skills they have.
+ input:
+ description: Skill ID.
+ uiOrder: 0
+ properties:
+ skill-id:
+ description: Skill ID.
+ title: Skill ID
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - skill-id
+ title: Input
+ format: object
+ output:
+ description: Skill information.
+ uiOrder: 0
+ properties:
+ name:
+ description: Name of the skill.
+ title: Name
+ uiOrder: 0
+ format: string
+ rank:
+ description: Rank of the skill.
+ title: Rank
+ uiOrder: 1
+ format: integer
+ condition-match-type:
+ description: Type of condition match. Can be "all" or "any".
+ title: Condition Match Type
+ uiOrder: 2
+ format: string
+ conditions:
+ description: Conditions for the skill.
+ title: Conditions
+ items:
+ title: Condition
+ format: json
+ uiOrder: 3
+ format: array
+ created-at:
+ description: Timestamp that denotes when the skill was created.
+ title: Created At
+ uiOrder: 4
+ format: string
+ updated-at:
+ description: Timestamp that denotes when the skill was last updated.
+ title: Updated At
+ uiOrder: 5
+ format: string
+ required:
+ - name
+ - rank
+ - condition-match-type
+ - conditions
+ - created-at
+ - updated-at
+ title: Output
+ format: object
diff --git a/pkg/component/application/freshdesk/v0/main.go b/pkg/component/application/freshdesk/v0/main.go
index 4f53eef2a..6ffb09b4c 100644
--- a/pkg/component/application/freshdesk/v0/main.go
+++ b/pkg/component/application/freshdesk/v0/main.go
@@ -36,12 +36,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
once sync.Once
comp *component
@@ -62,7 +62,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/github/v0/README.mdx b/pkg/component/application/github/v0/README.mdx
index 455cbb017..b9bafc637 100644
--- a/pkg/component/application/github/v0/README.mdx
+++ b/pkg/component/application/github/v0/README.mdx
@@ -27,7 +27,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/github/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/github/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/github/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/github/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/github/v0/config/definition.json b/pkg/component/application/github/v0/config/definition.json
deleted file mode 100644
index 32cae5e5c..000000000
--- a/pkg/component/application/github/v0/config/definition.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "availableTasks": [
- "TASK_LIST_PULL_REQUESTS",
- "TASK_GET_PULL_REQUEST",
- "TASK_GET_COMMIT",
- "TASK_LIST_REVIEW_COMMENTS",
- "TASK_CREATE_REVIEW_COMMENT",
- "TASK_LIST_ISSUES",
- "TASK_GET_ISSUE",
- "TASK_CREATE_ISSUE",
- "TASK_CREATE_WEBHOOK"
- ],
- "availableEvents": [
- "EVENT_STAR_CREATED"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/application/github",
- "icon": "assets/github.svg",
- "id": "github",
- "public": true,
- "title": "GitHub",
- "vendor": "GitHub",
- "description": "Do anything available on GitHub.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "9c14438b-90fa-41fc-83bb-4a3d9b8cbba6",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/github/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/github/v0/config/definition.yaml b/pkg/component/application/github/v0/config/definition.yaml
new file mode 100644
index 000000000..6e6884e67
--- /dev/null
+++ b/pkg/component/application/github/v0/config/definition.yaml
@@ -0,0 +1,25 @@
+availableTasks:
+- TASK_LIST_PULL_REQUESTS
+- TASK_GET_PULL_REQUEST
+- TASK_GET_COMMIT
+- TASK_LIST_REVIEW_COMMENTS
+- TASK_CREATE_REVIEW_COMMENT
+- TASK_LIST_ISSUES
+- TASK_GET_ISSUE
+- TASK_CREATE_ISSUE
+- TASK_CREATE_WEBHOOK
+availableEvents:
+- EVENT_STAR_CREATED
+documentationUrl: https://www.instill.tech/docs/component/application/github
+icon: assets/github.svg
+id: github
+public: true
+title: GitHub
+vendor: GitHub
+description: Do anything available on GitHub.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: 9c14438b-90fa-41fc-83bb-4a3d9b8cbba6
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/github/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/github/v0/config/events.json b/pkg/component/application/github/v0/config/events.json
deleted file mode 100644
index 19a2945df..000000000
--- a/pkg/component/application/github/v0/config/events.json
+++ /dev/null
@@ -1,995 +0,0 @@
-{
- "EVENT_STAR_CREATED": {
- "title": "Star Created",
- "description": "A star created event from GitHub",
- "configSchema": {
- "properties": {
- "repository": {
- "format": "string"
- }
- },
- "format": "object"
- },
- "messageSchema": {
- "$schema": "http://json-schema.org/draft-07/schema",
- "required": [
- "action",
- "starred-at",
- "repository",
- "sender"
- ],
- "properties": {
- "action": {
- "enum": [
- "created"
- ],
- "format": "string"
- },
- "starred-at": {
- "format": "string",
- "description": "The time the star was created. This is a timestamp in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Will be `null` for the `deleted` action."
- },
- "repository": {
- "$schema": "http://json-schema.org/draft-07/schema",
- "description": "A git repository",
- "required": [
- "id",
- "node-id",
- "name",
- "full-name",
- "private",
- "owner",
- "html-url",
- "description",
- "fork",
- "url",
- "forks-url",
- "keys-url",
- "collaborators-url",
- "teams-url",
- "hooks-url",
- "issue-events-url",
- "events-url",
- "assignees-url",
- "branches-url",
- "tags-url",
- "blobs-url",
- "git-tags-url",
- "git-refs-url",
- "trees-url",
- "statuses-url",
- "languages-url",
- "stargazers-url",
- "contributors-url",
- "subscribers-url",
- "subscription-url",
- "commits-url",
- "git-commits-url",
- "comments-url",
- "issue-comment-url",
- "contents-url",
- "compare-url",
- "merges-url",
- "archive-url",
- "downloads-url",
- "issues-url",
- "pulls-url",
- "milestones-url",
- "notifications-url",
- "labels-url",
- "releases-url",
- "deployments-url",
- "created-at",
- "updated-at",
- "pushed-at",
- "git-url",
- "ssh-url",
- "clone-url",
- "svn-url",
- "homepage",
- "size",
- "stargazers-count",
- "watchers-count",
- "language",
- "has-issues",
- "has-projects",
- "has-downloads",
- "has-wiki",
- "has-pages",
- "forks-count",
- "mirror-url",
- "archived",
- "open-issues-count",
- "license",
- "forks",
- "open-issues",
- "watchers",
- "default-branch",
- "is-template",
- "web-commit-signoff-required",
- "topics",
- "visibility",
- "custom-properties"
- ],
- "properties": {
- "id": {
- "description": "Unique identifier of the repository",
- "format": "integer"
- },
- "node-id": {
- "description": "The GraphQL identifier of the repository.",
- "format": "string"
- },
- "name": {
- "description": "The name of the repository.",
- "format": "string"
- },
- "full-name": {
- "description": "The full, globally unique, name of the repository.",
- "format": "string"
- },
- "private": {
- "description": "Whether the repository is private or public.",
- "format": "boolean"
- },
- "owner": {
- "$schema": "http://json-schema.org/draft-07/schema",
- "required": [
- "login",
- "id",
- "node-id",
- "avatar-url",
- "gravatar-id",
- "url",
- "html-url",
- "followers-url",
- "following-url",
- "gists-url",
- "starred-url",
- "subscriptions-url",
- "organizations-url",
- "repos-url",
- "events-url",
- "received-events-url",
- "type",
- "site-admin"
- ],
- "properties": {
- "login": {
- "format": "string"
- },
- "id": {
- "format": "integer"
- },
- "node-id": {
- "format": "string"
- },
- "name": {
- "format": "string"
- },
- "email": {
- "format": [
- "string",
- "null"
- ]
- },
- "avatar-url": {
- "format": "string"
- },
- "gravatar-id": {
- "format": "string"
- },
- "url": {
- "format": "string"
- },
- "html-url": {
- "format": "string"
- },
- "followers-url": {
- "format": "string"
- },
- "following-url": {
- "format": "string"
- },
- "gists-url": {
- "format": "string"
- },
- "starred-url": {
- "format": "string"
- },
- "subscriptions-url": {
- "format": "string"
- },
- "organizations-url": {
- "format": "string"
- },
- "repos-url": {
- "format": "string"
- },
- "events-url": {
- "format": "string"
- },
- "received-events-url": {
- "format": "string"
- },
- "site-admin": {
- "format": "boolean"
- },
- "type": {
- "enum": [
- "Bot",
- "User",
- "Organization"
- ],
- "format": "string"
- }
- },
- "additionalProperties": false,
- "title": "User",
- "format": "object"
- },
- "html-url": {
- "format": "string",
- "description": "The URL to view the repository on GitHub.com."
- },
- "description": {
- "description": "The repository description.",
- "format": [
- "string",
- "null"
- ]
- },
- "fork": {
- "description": "Whether the repository is a fork.",
- "format": "boolean"
- },
- "url": {
- "format": "string",
- "description": "The URL to get more information about the repository from the GitHub API."
- },
- "forks-url": {
- "format": "string",
- "description": "The API URL to list the forks of the repository."
- },
- "keys-url": {
- "format": "string",
- "description": "A template for the API URL to get information about deploy keys on the repository."
- },
- "collaborators-url": {
- "format": "string",
- "description": "A template for the API URL to get information about collaborators of the repository."
- },
- "teams-url": {
- "format": "string",
- "description": "The API URL to list the teams on the repository."
- },
- "hooks-url": {
- "format": "string",
- "description": "The API URL to list the hooks on the repository."
- },
- "issue-events-url": {
- "format": "string",
- "description": "A template for the API URL to get information about issue events on the repository."
- },
- "events-url": {
- "format": "string",
- "description": "The API URL to list the events of the repository."
- },
- "assignees-url": {
- "format": "string",
- "description": "A template for the API URL to list the available assignees for issues in the repository."
- },
- "branches-url": {
- "format": "string",
- "description": "A template for the API URL to get information about branches in the repository."
- },
- "tags-url": {
- "format": "string",
- "description": "The API URL to get information about tags on the repository."
- },
- "blobs-url": {
- "format": "string",
- "description": "A template for the API URL to create or retrieve a raw Git blob in the repository."
- },
- "git-tags-url": {
- "format": "string",
- "description": "A template for the API URL to get information about Git tags of the repository."
- },
- "git-refs-url": {
- "format": "string",
- "description": "A template for the API URL to get information about Git refs of the repository."
- },
- "trees-url": {
- "format": "string",
- "description": "A template for the API URL to create or retrieve a raw Git tree of the repository."
- },
- "statuses-url": {
- "format": "string",
- "description": "A template for the API URL to get information about statuses of a commit."
- },
- "languages-url": {
- "format": "string",
- "description": "The API URL to get information about the languages of the repository."
- },
- "stargazers-url": {
- "format": "string",
- "description": "The API URL to list the stargazers on the repository."
- },
- "contributors-url": {
- "format": "string",
- "description": "A template for the API URL to list the contributors to the repository."
- },
- "subscribers-url": {
- "format": "string",
- "description": "The API URL to list the subscribers on the repository."
- },
- "subscription-url": {
- "format": "string",
- "description": "The API URL to subscribe to notifications for this repository."
- },
- "commits-url": {
- "format": "string",
- "description": "A template for the API URL to get information about commits on the repository."
- },
- "git-commits-url": {
- "format": "string",
- "description": "A template for the API URL to get information about Git commits of the repository."
- },
- "comments-url": {
- "format": "string",
- "description": "A template for the API URL to get information about comments on the repository."
- },
- "issue-comment-url": {
- "format": "string",
- "description": "A template for the API URL to get information about issue comments on the repository."
- },
- "contents-url": {
- "format": "string",
- "description": "A template for the API URL to get the contents of the repository."
- },
- "compare-url": {
- "format": "string",
- "description": "A template for the API URL to compare two commits or refs."
- },
- "merges-url": {
- "format": "string",
- "description": "The API URL to merge branches in the repository."
- },
- "archive-url": {
- "format": "string",
- "description": "A template for the API URL to download the repository as an archive."
- },
- "downloads-url": {
- "format": "string",
- "description": "The API URL to list the downloads on the repository."
- },
- "issues-url": {
- "format": "string",
- "description": "A template for the API URL to get information about issues on the repository."
- },
- "pulls-url": {
- "format": "string",
- "description": "A template for the API URL to get information about pull requests on the repository."
- },
- "milestones-url": {
- "format": "string",
- "description": "A template for the API URL to get information about milestones of the repository."
- },
- "notifications-url": {
- "format": "string",
- "description": "A template for the API URL to get information about notifications on the repository."
- },
- "labels-url": {
- "format": "string",
- "description": "A template for the API URL to get information about labels of the repository."
- },
- "releases-url": {
- "format": "string",
- "description": "A template for the API URL to get information about releases on the repository."
- },
- "deployments-url": {
- "format": "string",
- "description": "The API URL to list the deployments of the repository."
- },
- "created-at": {
- "oneOf": [
- {
- "format": "integer"
- },
- {
- "format": "string"
- }
- ]
- },
- "updated-at": {
- "format": "string"
- },
- "pushed-at": {
- "oneOf": [
- {
- "format": "integer"
- },
- {
- "format": "string"
- },
- {
- "format": "null"
- }
- ]
- },
- "git-url": {
- "format": "string"
- },
- "ssh-url": {
- "format": "string"
- },
- "clone-url": {
- "format": "string"
- },
- "svn-url": {
- "format": "string"
- },
- "homepage": {
- "format": [
- "string",
- "null"
- ]
- },
- "size": {
- "format": "integer"
- },
- "stargazers-count": {
- "format": "integer"
- },
- "watchers-count": {
- "format": "integer"
- },
- "language": {
- "format": [
- "string",
- "null"
- ]
- },
- "has-issues": {
- "description": "Whether issues are enabled.",
- "default": true,
- "format": "boolean"
- },
- "has-projects": {
- "description": "Whether projects are enabled.",
- "default": true,
- "format": "boolean"
- },
- "has-downloads": {
- "description": "Whether downloads are enabled.",
- "default": true,
- "format": "boolean"
- },
- "has-wiki": {
- "description": "Whether the wiki is enabled.",
- "default": true,
- "format": "boolean"
- },
- "has-pages": {
- "format": "boolean"
- },
- "has-discussions": {
- "description": "Whether discussions are enabled.",
- "default": true,
- "format": "boolean"
- },
- "forks-count": {
- "format": "integer"
- },
- "mirror-url": {
- "format": [
- "string",
- "null"
- ]
- },
- "archived": {
- "description": "Whether the repository is archived.",
- "default": false,
- "format": "boolean"
- },
- "disabled": {
- "description": "Returns whether or not this repository is disabled.",
- "format": "boolean"
- },
- "open-issues-count": {
- "format": "integer"
- },
- "license": {
- "oneOf": [
- {
- "$schema": "http://json-schema.org/draft-07/schema",
- "required": [
- "key",
- "name",
- "spdx-id",
- "url",
- "node-id"
- ],
- "properties": {
- "key": {
- "format": "string"
- },
- "name": {
- "format": "string"
- },
- "spdx-id": {
- "format": "string"
- },
- "url": {
- "format": [
- "string",
- "null"
- ]
- },
- "node-id": {
- "format": "string"
- }
- },
- "additionalProperties": false,
- "title": "License",
- "format": "object"
- },
- {
- "format": "null"
- }
- ]
- },
- "forks": {
- "format": "integer"
- },
- "open-issues": {
- "format": "integer"
- },
- "watchers": {
- "format": "integer"
- },
- "stargazers": {
- "format": "integer"
- },
- "default-branch": {
- "description": "The default branch of the repository.",
- "format": "string"
- },
- "allow-squash-merge": {
- "description": "Whether to allow squash merges for pull requests.",
- "default": true,
- "format": "boolean"
- },
- "allow-merge-commit": {
- "description": "Whether to allow merge commits for pull requests.",
- "default": true,
- "format": "boolean"
- },
- "allow-rebase-merge": {
- "description": "Whether to allow rebase merges for pull requests.",
- "default": true,
- "format": "boolean"
- },
- "allow-auto-merge": {
- "description": "Whether to allow auto-merge for pull requests.",
- "default": false,
- "format": "boolean"
- },
- "allow-forking": {
- "description": "Whether to allow private forks",
- "format": "boolean"
- },
- "allow-update-branch": {
- "format": "boolean"
- },
- "use-squash-pr-title-as-default": {
- "format": "boolean"
- },
- "squash-merge-commit-message": {
- "format": "string"
- },
- "squash-merge-commit-title": {
- "format": "string"
- },
- "merge-commit-message": {
- "format": "string"
- },
- "merge-commit-title": {
- "format": "string"
- },
- "is-template": {
- "format": "boolean"
- },
- "web-commit-signoff-required": {
- "format": "boolean"
- },
- "topics": {
- "items": {
- "format": "string"
- },
- "format": "array"
- },
- "visibility": {
- "enum": [
- "public",
- "private",
- "internal"
- ],
- "format": "string"
- },
- "delete-branch-on-merge": {
- "description": "Whether to delete head branches when pull requests are merged",
- "default": false,
- "format": "boolean"
- },
- "master-branch": {
- "format": "string"
- },
- "permissions": {
- "required": [
- "pull",
- "push",
- "admin"
- ],
- "properties": {
- "pull": {
- "format": "boolean"
- },
- "push": {
- "format": "boolean"
- },
- "admin": {
- "format": "boolean"
- },
- "maintain": {
- "format": "boolean"
- },
- "triage": {
- "format": "boolean"
- }
- },
- "additionalProperties": false,
- "format": "object"
- },
- "public": {
- "format": "boolean"
- },
- "organization": {
- "format": "string"
- },
- "custom-properties": {
- "additionalProperties": {
- "oneOf": [
- {
- "format": "null"
- },
- {
- "format": "string"
- },
- {
- "items": {
- "format": "string"
- },
- "format": "array"
- }
- ]
- },
- "format": "object"
- }
- },
- "additionalProperties": false,
- "title": "Repository",
- "format": "object"
- },
- "sender": {
- "$schema": "http://json-schema.org/draft-07/schema",
- "required": [
- "login",
- "id",
- "node-id",
- "avatar-url",
- "gravatar-id",
- "url",
- "html-url",
- "followers-url",
- "following-url",
- "gists-url",
- "starred-url",
- "subscriptions-url",
- "organizations-url",
- "repos-url",
- "events-url",
- "received-events-url",
- "type",
- "site-admin"
- ],
- "properties": {
- "login": {
- "format": "string"
- },
- "id": {
- "format": "integer"
- },
- "node-id": {
- "format": "string"
- },
- "name": {
- "format": "string"
- },
- "email": {
- "format": [
- "string",
- "null"
- ]
- },
- "avatar-url": {
- "format": "string"
- },
- "gravatar-id": {
- "format": "string"
- },
- "url": {
- "format": "string"
- },
- "html-url": {
- "format": "string"
- },
- "followers-url": {
- "format": "string"
- },
- "following-url": {
- "format": "string"
- },
- "gists-url": {
- "format": "string"
- },
- "starred-url": {
- "format": "string"
- },
- "subscriptions-url": {
- "format": "string"
- },
- "organizations-url": {
- "format": "string"
- },
- "repos-url": {
- "format": "string"
- },
- "events-url": {
- "format": "string"
- },
- "received-events-url": {
- "format": "string"
- },
- "site-admin": {
- "format": "boolean"
- },
- "type": {
- "enum": [
- "Bot",
- "User",
- "Organization"
- ],
- "format": "string"
- }
- },
- "additionalProperties": false,
- "title": "User",
- "format": "object"
- },
- "organization": {
- "$schema": "http://json-schema.org/draft-07/schema",
- "required": [
- "login",
- "id",
- "node-id",
- "url",
- "repos-url",
- "events-url",
- "hooks-url",
- "issues-url",
- "members-url",
- "public-members-url",
- "avatar-url",
- "description"
- ],
- "properties": {
- "login": {
- "format": "string"
- },
- "id": {
- "format": "integer"
- },
- "node-id": {
- "format": "string"
- },
- "url": {
- "format": "string"
- },
- "html-url": {
- "format": "string"
- },
- "repos-url": {
- "format": "string"
- },
- "events-url": {
- "format": "string"
- },
- "hooks-url": {
- "format": "string"
- },
- "issues-url": {
- "format": "string"
- },
- "members-url": {
- "format": "string"
- },
- "public-members-url": {
- "format": "string"
- },
- "avatar-url": {
- "format": "string"
- },
- "description": {
- "format": [
- "string",
- "null"
- ]
- }
- },
- "additionalProperties": false,
- "title": "Organization",
- "format": "object"
- },
- "installation": {
- "$schema": "http://json-schema.org/draft-07/schema",
- "description": "Installation",
- "required": [
- "id",
- "node-id"
- ],
- "properties": {
- "id": {
- "description": "The ID of the installation.",
- "format": "integer"
- },
- "node-id": {
- "format": "string"
- }
- },
- "additionalProperties": false,
- "title": "InstallationLite",
- "format": "object"
- }
- },
- "additionalProperties": false,
- "title": "star created event",
- "format": "object"
- },
- "messageExamples": [
- {
- "action": "created",
- "starred-at": "2019-05-15T15:20:40Z",
- "repository": {
- "id": 186853002,
- "node-id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=",
- "name": "Hello-World",
- "full-name": "Codertocat/Hello-World",
- "private": false,
- "owner": {
- "login": "Codertocat",
- "id": 21031067,
- "node-id": "MDQ6VXNlcjIxMDMxMDY3",
- "avatar-url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
- "gravatar-id": "",
- "url": "https://api.github.com/users/Codertocat",
- "html-url": "https://github.com/Codertocat",
- "followers-url": "https://api.github.com/users/Codertocat/followers",
- "following-url": "https://api.github.com/users/Codertocat/following{/other_user}",
- "gists-url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
- "starred-url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
- "subscriptions-url": "https://api.github.com/users/Codertocat/subscriptions",
- "organizations-url": "https://api.github.com/users/Codertocat/orgs",
- "repos-url": "https://api.github.com/users/Codertocat/repos",
- "events-url": "https://api.github.com/users/Codertocat/events{/privacy}",
- "received-events-url": "https://api.github.com/users/Codertocat/received_events",
- "site-admin": false,
- "format": "User"
- },
- "html-url": "https://github.com/Codertocat/Hello-World",
- "description": null,
- "fork": false,
- "url": "https://api.github.com/repos/Codertocat/Hello-World",
- "forks-url": "https://api.github.com/repos/Codertocat/Hello-World/forks",
- "keys-url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}",
- "collaborators-url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}",
- "teams-url": "https://api.github.com/repos/Codertocat/Hello-World/teams",
- "hooks-url": "https://api.github.com/repos/Codertocat/Hello-World/hooks",
- "issue-events-url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}",
- "events-url": "https://api.github.com/repos/Codertocat/Hello-World/events",
- "assignees-url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}",
- "branches-url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}",
- "tags-url": "https://api.github.com/repos/Codertocat/Hello-World/tags",
- "blobs-url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}",
- "git-tags-url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}",
- "git-refs-url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}",
- "trees-url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}",
- "statuses-url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}",
- "languages-url": "https://api.github.com/repos/Codertocat/Hello-World/languages",
- "stargazers-url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers",
- "contributors-url": "https://api.github.com/repos/Codertocat/Hello-World/contributors",
- "subscribers-url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers",
- "subscription-url": "https://api.github.com/repos/Codertocat/Hello-World/subscription",
- "commits-url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}",
- "git-commits-url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}",
- "comments-url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}",
- "issue-comment-url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}",
- "contents-url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}",
- "compare-url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}",
- "merges-url": "https://api.github.com/repos/Codertocat/Hello-World/merges",
- "archive-url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}",
- "downloads-url": "https://api.github.com/repos/Codertocat/Hello-World/downloads",
- "issues-url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}",
- "pulls-url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}",
- "milestones-url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}",
- "notifications-url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}",
- "labels-url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}",
- "releases-url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}",
- "deployments-url": "https://api.github.com/repos/Codertocat/Hello-World/deployments",
- "created-at": "2019-05-15T15:19:25Z",
- "updated-at": "2019-05-15T15:20:40Z",
- "pushed-at": "2019-05-15T15:20:33Z",
- "git-url": "git://github.com/Codertocat/Hello-World.git",
- "ssh-url": "git@github.com:Codertocat/Hello-World.git",
- "clone-url": "https://github.com/Codertocat/Hello-World.git",
- "svn-url": "https://github.com/Codertocat/Hello-World",
- "homepage": null,
- "size": 0,
- "stargazers-count": 1,
- "watchers-count": 1,
- "language": "Ruby",
- "has-issues": true,
- "has-projects": true,
- "has-downloads": true,
- "has-wiki": true,
- "has-pages": true,
- "forks-count": 0,
- "mirror-url": null,
- "archived": false,
- "disabled": false,
- "open-issues-count": 2,
- "license": null,
- "forks": 0,
- "open-issues": 2,
- "watchers": 1,
- "default-branch": "master",
- "is-template": false,
- "topics": [],
- "visibility": "public",
- "web-commit-signoff-required": false,
- "custom-properties": {}
- },
- "sender": {
- "login": "Codertocat",
- "id": 21031067,
- "node-id": "MDQ6VXNlcjIxMDMxMDY3",
- "avatar-url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
- "gravatar-id": "",
- "url": "https://api.github.com/users/Codertocat",
- "html-url": "https://github.com/Codertocat",
- "followers-url": "https://api.github.com/users/Codertocat/followers",
- "following-url": "https://api.github.com/users/Codertocat/following{/other_user}",
- "gists-url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
- "starred-url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
- "subscriptions-url": "https://api.github.com/users/Codertocat/subscriptions",
- "organizations-url": "https://api.github.com/users/Codertocat/orgs",
- "repos-url": "https://api.github.com/users/Codertocat/repos",
- "events-url": "https://api.github.com/users/Codertocat/events{/privacy}",
- "received-events-url": "https://api.github.com/users/Codertocat/received_events",
- "site-admin": false,
- "format": "User"
- }
- }
- ]
- }
-}
diff --git a/pkg/component/application/github/v0/config/events.yaml b/pkg/component/application/github/v0/config/events.yaml
new file mode 100644
index 000000000..9f3460209
--- /dev/null
+++ b/pkg/component/application/github/v0/config/events.yaml
@@ -0,0 +1,785 @@
+EVENT_STAR_CREATED:
+ title: Star Created
+ description: A star created event from GitHub
+ configSchema:
+ properties:
+ repository:
+ format: string
+ format: object
+ messageSchema:
+ $schema: http://json-schema.org/draft-07/schema
+ required:
+ - action
+ - starred-at
+ - repository
+ - sender
+ properties:
+ action:
+ enum:
+ - created
+ format: string
+ starred-at:
+ format: string
+ description: 'The time the star was created. This is a timestamp in ISO 8601
+ format: `YYYY-MM-DDTHH:MM:SSZ`. Will be `null` for the `deleted` action.'
+ repository:
+ $schema: http://json-schema.org/draft-07/schema
+ description: A git repository
+ required:
+ - id
+ - node-id
+ - name
+ - full-name
+ - private
+ - owner
+ - html-url
+ - description
+ - fork
+ - url
+ - forks-url
+ - keys-url
+ - collaborators-url
+ - teams-url
+ - hooks-url
+ - issue-events-url
+ - events-url
+ - assignees-url
+ - branches-url
+ - tags-url
+ - blobs-url
+ - git-tags-url
+ - git-refs-url
+ - trees-url
+ - statuses-url
+ - languages-url
+ - stargazers-url
+ - contributors-url
+ - subscribers-url
+ - subscription-url
+ - commits-url
+ - git-commits-url
+ - comments-url
+ - issue-comment-url
+ - contents-url
+ - compare-url
+ - merges-url
+ - archive-url
+ - downloads-url
+ - issues-url
+ - pulls-url
+ - milestones-url
+ - notifications-url
+ - labels-url
+ - releases-url
+ - deployments-url
+ - created-at
+ - updated-at
+ - pushed-at
+ - git-url
+ - ssh-url
+ - clone-url
+ - svn-url
+ - homepage
+ - size
+ - stargazers-count
+ - watchers-count
+ - language
+ - has-issues
+ - has-projects
+ - has-downloads
+ - has-wiki
+ - has-pages
+ - forks-count
+ - mirror-url
+ - archived
+ - open-issues-count
+ - license
+ - forks
+ - open-issues
+ - watchers
+ - default-branch
+ - is-template
+ - web-commit-signoff-required
+ - topics
+ - visibility
+ - custom-properties
+ properties:
+ id:
+ description: Unique identifier of the repository
+ format: integer
+ node-id:
+ description: The GraphQL identifier of the repository.
+ format: string
+ name:
+ description: The name of the repository.
+ format: string
+ full-name:
+ description: The full, globally unique, name of the repository.
+ format: string
+ private:
+ description: Whether the repository is private or public.
+ format: boolean
+ owner:
+ $schema: http://json-schema.org/draft-07/schema
+ required:
+ - login
+ - id
+ - node-id
+ - avatar-url
+ - gravatar-id
+ - url
+ - html-url
+ - followers-url
+ - following-url
+ - gists-url
+ - starred-url
+ - subscriptions-url
+ - organizations-url
+ - repos-url
+ - events-url
+ - received-events-url
+ - type
+ - site-admin
+ properties:
+ login:
+ format: string
+ id:
+ format: integer
+ node-id:
+ format: string
+ name:
+ format: string
+ email:
+ format:
+ - string
+ - 'null'
+ avatar-url:
+ format: string
+ gravatar-id:
+ format: string
+ url:
+ format: string
+ html-url:
+ format: string
+ followers-url:
+ format: string
+ following-url:
+ format: string
+ gists-url:
+ format: string
+ starred-url:
+ format: string
+ subscriptions-url:
+ format: string
+ organizations-url:
+ format: string
+ repos-url:
+ format: string
+ events-url:
+ format: string
+ received-events-url:
+ format: string
+ site-admin:
+ format: boolean
+ type:
+ enum:
+ - Bot
+ - User
+ - Organization
+ format: string
+ additionalProperties: false
+ title: User
+ format: object
+ html-url:
+ format: string
+ description: The URL to view the repository on GitHub.com.
+ description:
+ description: The repository description.
+ format:
+ - string
+ - 'null'
+ fork:
+ description: Whether the repository is a fork.
+ format: boolean
+ url:
+ format: string
+ description: The URL to get more information about the repository from
+ the GitHub API.
+ forks-url:
+ format: string
+ description: The API URL to list the forks of the repository.
+ keys-url:
+ format: string
+ description: A template for the API URL to get information about deploy
+ keys on the repository.
+ collaborators-url:
+ format: string
+ description: A template for the API URL to get information about collaborators
+ of the repository.
+ teams-url:
+ format: string
+ description: The API URL to list the teams on the repository.
+ hooks-url:
+ format: string
+ description: The API URL to list the hooks on the repository.
+ issue-events-url:
+ format: string
+ description: A template for the API URL to get information about issue
+ events on the repository.
+ events-url:
+ format: string
+ description: The API URL to list the events of the repository.
+ assignees-url:
+ format: string
+ description: A template for the API URL to list the available assignees
+ for issues in the repository.
+ branches-url:
+ format: string
+ description: A template for the API URL to get information about branches
+ in the repository.
+ tags-url:
+ format: string
+ description: The API URL to get information about tags on the repository.
+ blobs-url:
+ format: string
+ description: A template for the API URL to create or retrieve a raw Git
+ blob in the repository.
+ git-tags-url:
+ format: string
+ description: A template for the API URL to get information about Git tags
+ of the repository.
+ git-refs-url:
+ format: string
+ description: A template for the API URL to get information about Git refs
+ of the repository.
+ trees-url:
+ format: string
+ description: A template for the API URL to create or retrieve a raw Git
+ tree of the repository.
+ statuses-url:
+ format: string
+ description: A template for the API URL to get information about statuses
+ of a commit.
+ languages-url:
+ format: string
+ description: The API URL to get information about the languages of the
+ repository.
+ stargazers-url:
+ format: string
+ description: The API URL to list the stargazers on the repository.
+ contributors-url:
+ format: string
+ description: A template for the API URL to list the contributors to the
+ repository.
+ subscribers-url:
+ format: string
+ description: The API URL to list the subscribers on the repository.
+ subscription-url:
+ format: string
+ description: The API URL to subscribe to notifications for this repository.
+ commits-url:
+ format: string
+ description: A template for the API URL to get information about commits
+ on the repository.
+ git-commits-url:
+ format: string
+ description: A template for the API URL to get information about Git commits
+ of the repository.
+ comments-url:
+ format: string
+ description: A template for the API URL to get information about comments
+ on the repository.
+ issue-comment-url:
+ format: string
+ description: A template for the API URL to get information about issue
+ comments on the repository.
+ contents-url:
+ format: string
+ description: A template for the API URL to get the contents of the repository.
+ compare-url:
+ format: string
+ description: A template for the API URL to compare two commits or refs.
+ merges-url:
+ format: string
+ description: The API URL to merge branches in the repository.
+ archive-url:
+ format: string
+ description: A template for the API URL to download the repository as
+ an archive.
+ downloads-url:
+ format: string
+ description: The API URL to list the downloads on the repository.
+ issues-url:
+ format: string
+ description: A template for the API URL to get information about issues
+ on the repository.
+ pulls-url:
+ format: string
+ description: A template for the API URL to get information about pull
+ requests on the repository.
+ milestones-url:
+ format: string
+ description: A template for the API URL to get information about milestones
+ of the repository.
+ notifications-url:
+ format: string
+ description: A template for the API URL to get information about notifications
+ on the repository.
+ labels-url:
+ format: string
+ description: A template for the API URL to get information about labels
+ of the repository.
+ releases-url:
+ format: string
+ description: A template for the API URL to get information about releases
+ on the repository.
+ deployments-url:
+ format: string
+ description: The API URL to list the deployments of the repository.
+ created-at:
+ oneOf:
+ - format: integer
+ - format: string
+ updated-at:
+ format: string
+ pushed-at:
+ oneOf:
+ - format: integer
+ - format: string
+ - format: 'null'
+ git-url:
+ format: string
+ ssh-url:
+ format: string
+ clone-url:
+ format: string
+ svn-url:
+ format: string
+ homepage:
+ format:
+ - string
+ - 'null'
+ size:
+ format: integer
+ stargazers-count:
+ format: integer
+ watchers-count:
+ format: integer
+ language:
+ format:
+ - string
+ - 'null'
+ has-issues:
+ description: Whether issues are enabled.
+ default: true
+ format: boolean
+ has-projects:
+ description: Whether projects are enabled.
+ default: true
+ format: boolean
+ has-downloads:
+ description: Whether downloads are enabled.
+ default: true
+ format: boolean
+ has-wiki:
+ description: Whether the wiki is enabled.
+ default: true
+ format: boolean
+ has-pages:
+ format: boolean
+ has-discussions:
+ description: Whether discussions are enabled.
+ default: true
+ format: boolean
+ forks-count:
+ format: integer
+ mirror-url:
+ format:
+ - string
+ - 'null'
+ archived:
+ description: Whether the repository is archived.
+ default: false
+ format: boolean
+ disabled:
+ description: Returns whether or not this repository is disabled.
+ format: boolean
+ open-issues-count:
+ format: integer
+ license:
+ oneOf:
+ - $schema: http://json-schema.org/draft-07/schema
+ required:
+ - key
+ - name
+ - spdx-id
+ - url
+ - node-id
+ properties:
+ key:
+ format: string
+ name:
+ format: string
+ spdx-id:
+ format: string
+ url:
+ format:
+ - string
+ - 'null'
+ node-id:
+ format: string
+ additionalProperties: false
+ title: License
+ format: object
+ - format: 'null'
+ forks:
+ format: integer
+ open-issues:
+ format: integer
+ watchers:
+ format: integer
+ stargazers:
+ format: integer
+ default-branch:
+ description: The default branch of the repository.
+ format: string
+ allow-squash-merge:
+ description: Whether to allow squash merges for pull requests.
+ default: true
+ format: boolean
+ allow-merge-commit:
+ description: Whether to allow merge commits for pull requests.
+ default: true
+ format: boolean
+ allow-rebase-merge:
+ description: Whether to allow rebase merges for pull requests.
+ default: true
+ format: boolean
+ allow-auto-merge:
+ description: Whether to allow auto-merge for pull requests.
+ default: false
+ format: boolean
+ allow-forking:
+ description: Whether to allow private forks
+ format: boolean
+ allow-update-branch:
+ format: boolean
+ use-squash-pr-title-as-default:
+ format: boolean
+ squash-merge-commit-message:
+ format: string
+ squash-merge-commit-title:
+ format: string
+ merge-commit-message:
+ format: string
+ merge-commit-title:
+ format: string
+ is-template:
+ format: boolean
+ web-commit-signoff-required:
+ format: boolean
+ topics:
+ items:
+ format: string
+ format: array
+ visibility:
+ enum:
+ - public
+ - private
+ - internal
+ format: string
+ delete-branch-on-merge:
+ description: Whether to delete head branches when pull requests are merged
+ default: false
+ format: boolean
+ master-branch:
+ format: string
+ permissions:
+ required:
+ - pull
+ - push
+ - admin
+ properties:
+ pull:
+ format: boolean
+ push:
+ format: boolean
+ admin:
+ format: boolean
+ maintain:
+ format: boolean
+ triage:
+ format: boolean
+ additionalProperties: false
+ format: object
+ public:
+ format: boolean
+ organization:
+ format: string
+ custom-properties:
+ additionalProperties:
+ oneOf:
+ - format: 'null'
+ - format: string
+ - items:
+ format: string
+ format: array
+ format: object
+ additionalProperties: false
+ title: Repository
+ format: object
+ sender:
+ $schema: http://json-schema.org/draft-07/schema
+ required:
+ - login
+ - id
+ - node-id
+ - avatar-url
+ - gravatar-id
+ - url
+ - html-url
+ - followers-url
+ - following-url
+ - gists-url
+ - starred-url
+ - subscriptions-url
+ - organizations-url
+ - repos-url
+ - events-url
+ - received-events-url
+ - type
+ - site-admin
+ properties:
+ login:
+ format: string
+ id:
+ format: integer
+ node-id:
+ format: string
+ name:
+ format: string
+ email:
+ format:
+ - string
+ - 'null'
+ avatar-url:
+ format: string
+ gravatar-id:
+ format: string
+ url:
+ format: string
+ html-url:
+ format: string
+ followers-url:
+ format: string
+ following-url:
+ format: string
+ gists-url:
+ format: string
+ starred-url:
+ format: string
+ subscriptions-url:
+ format: string
+ organizations-url:
+ format: string
+ repos-url:
+ format: string
+ events-url:
+ format: string
+ received-events-url:
+ format: string
+ site-admin:
+ format: boolean
+ type:
+ enum:
+ - Bot
+ - User
+ - Organization
+ format: string
+ additionalProperties: false
+ title: User
+ format: object
+ organization:
+ $schema: http://json-schema.org/draft-07/schema
+ required:
+ - login
+ - id
+ - node-id
+ - url
+ - repos-url
+ - events-url
+ - hooks-url
+ - issues-url
+ - members-url
+ - public-members-url
+ - avatar-url
+ - description
+ properties:
+ login:
+ format: string
+ id:
+ format: integer
+ node-id:
+ format: string
+ url:
+ format: string
+ html-url:
+ format: string
+ repos-url:
+ format: string
+ events-url:
+ format: string
+ hooks-url:
+ format: string
+ issues-url:
+ format: string
+ members-url:
+ format: string
+ public-members-url:
+ format: string
+ avatar-url:
+ format: string
+ description:
+ format:
+ - string
+ - 'null'
+ additionalProperties: false
+ title: Organization
+ format: object
+ installation:
+ $schema: http://json-schema.org/draft-07/schema
+ description: Installation
+ required:
+ - id
+ - node-id
+ properties:
+ id:
+ description: The ID of the installation.
+ format: integer
+ node-id:
+ format: string
+ additionalProperties: false
+ title: InstallationLite
+ format: object
+ additionalProperties: false
+ title: star created event
+ format: object
+ messageExamples:
+ - action: created
+ starred-at: '2019-05-15T15:20:40Z'
+ repository:
+ id: 186853002
+ node-id: MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=
+ name: Hello-World
+ full-name: Codertocat/Hello-World
+ private: false
+ owner:
+ login: Codertocat
+ id: 21031067
+ node-id: MDQ6VXNlcjIxMDMxMDY3
+ avatar-url: https://avatars1.githubusercontent.com/u/21031067?v=4
+ gravatar-id: ''
+ url: https://api.github.com/users/Codertocat
+ html-url: https://github.com/Codertocat
+ followers-url: https://api.github.com/users/Codertocat/followers
+ following-url: https://api.github.com/users/Codertocat/following{/other_user}
+ gists-url: https://api.github.com/users/Codertocat/gists{/gist_id}
+ starred-url: https://api.github.com/users/Codertocat/starred{/owner}{/repo}
+ subscriptions-url: https://api.github.com/users/Codertocat/subscriptions
+ organizations-url: https://api.github.com/users/Codertocat/orgs
+ repos-url: https://api.github.com/users/Codertocat/repos
+ events-url: https://api.github.com/users/Codertocat/events{/privacy}
+ received-events-url: https://api.github.com/users/Codertocat/received_events
+ site-admin: false
+ format: User
+ html-url: https://github.com/Codertocat/Hello-World
+ description: null
+ fork: false
+ url: https://api.github.com/repos/Codertocat/Hello-World
+ forks-url: https://api.github.com/repos/Codertocat/Hello-World/forks
+ keys-url: https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}
+ collaborators-url: https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}
+ teams-url: https://api.github.com/repos/Codertocat/Hello-World/teams
+ hooks-url: https://api.github.com/repos/Codertocat/Hello-World/hooks
+ issue-events-url: https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}
+ events-url: https://api.github.com/repos/Codertocat/Hello-World/events
+ assignees-url: https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}
+ branches-url: https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}
+ tags-url: https://api.github.com/repos/Codertocat/Hello-World/tags
+ blobs-url: https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}
+ git-tags-url: https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}
+ git-refs-url: https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}
+ trees-url: https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}
+ statuses-url: https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}
+ languages-url: https://api.github.com/repos/Codertocat/Hello-World/languages
+ stargazers-url: https://api.github.com/repos/Codertocat/Hello-World/stargazers
+ contributors-url: https://api.github.com/repos/Codertocat/Hello-World/contributors
+ subscribers-url: https://api.github.com/repos/Codertocat/Hello-World/subscribers
+ subscription-url: https://api.github.com/repos/Codertocat/Hello-World/subscription
+ commits-url: https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}
+ git-commits-url: https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}
+ comments-url: https://api.github.com/repos/Codertocat/Hello-World/comments{/number}
+ issue-comment-url: https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}
+ contents-url: https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}
+ compare-url: https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}
+ merges-url: https://api.github.com/repos/Codertocat/Hello-World/merges
+ archive-url: https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}
+ downloads-url: https://api.github.com/repos/Codertocat/Hello-World/downloads
+ issues-url: https://api.github.com/repos/Codertocat/Hello-World/issues{/number}
+ pulls-url: https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}
+ milestones-url: https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}
+ notifications-url: https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}
+ labels-url: https://api.github.com/repos/Codertocat/Hello-World/labels{/name}
+ releases-url: https://api.github.com/repos/Codertocat/Hello-World/releases{/id}
+ deployments-url: https://api.github.com/repos/Codertocat/Hello-World/deployments
+ created-at: '2019-05-15T15:19:25Z'
+ updated-at: '2019-05-15T15:20:40Z'
+ pushed-at: '2019-05-15T15:20:33Z'
+ git-url: git://github.com/Codertocat/Hello-World.git
+ ssh-url: git@github.com:Codertocat/Hello-World.git
+ clone-url: https://github.com/Codertocat/Hello-World.git
+ svn-url: https://github.com/Codertocat/Hello-World
+ homepage: null
+ size: 0
+ stargazers-count: 1
+ watchers-count: 1
+ language: Ruby
+ has-issues: true
+ has-projects: true
+ has-downloads: true
+ has-wiki: true
+ has-pages: true
+ forks-count: 0
+ mirror-url: null
+ archived: false
+ disabled: false
+ open-issues-count: 2
+ license: null
+ forks: 0
+ open-issues: 2
+ watchers: 1
+ default-branch: master
+ is-template: false
+ topics: []
+ visibility: public
+ web-commit-signoff-required: false
+ custom-properties: {}
+ sender:
+ login: Codertocat
+ id: 21031067
+ node-id: MDQ6VXNlcjIxMDMxMDY3
+ avatar-url: https://avatars1.githubusercontent.com/u/21031067?v=4
+ gravatar-id: ''
+ url: https://api.github.com/users/Codertocat
+ html-url: https://github.com/Codertocat
+ followers-url: https://api.github.com/users/Codertocat/followers
+ following-url: https://api.github.com/users/Codertocat/following{/other_user}
+ gists-url: https://api.github.com/users/Codertocat/gists{/gist_id}
+ starred-url: https://api.github.com/users/Codertocat/starred{/owner}{/repo}
+ subscriptions-url: https://api.github.com/users/Codertocat/subscriptions
+ organizations-url: https://api.github.com/users/Codertocat/orgs
+ repos-url: https://api.github.com/users/Codertocat/repos
+ events-url: https://api.github.com/users/Codertocat/events{/privacy}
+ received-events-url: https://api.github.com/users/Codertocat/received_events
+ site-admin: false
+ format: User
diff --git a/pkg/component/application/github/v0/config/setup.json b/pkg/component/application/github/v0/config/setup.json
deleted file mode 100644
index 783926b61..000000000
--- a/pkg/component/application/github/v0/config/setup.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "token": {
- "description": "Fill in your GitHub access token for advanced usages. For more information about how to create tokens, please refer to the github settings.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "Token",
- "format": "string"
- }
- },
- "required": [
- "token"
- ],
- "instillOAuthConfig": {
- "authUrl": "https://github.com/login/oauth/authorize",
- "accessUrl": "https://github.com/login/oauth/access_token",
- "scopes": [
- "repo",
- "admin:repo_hook"
- ]
- },
- "title": "GitHub Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/github/v0/config/setup.yaml b/pkg/component/application/github/v0/config/setup.yaml
new file mode 100644
index 000000000..3557cec59
--- /dev/null
+++ b/pkg/component/application/github/v0/config/setup.yaml
@@ -0,0 +1,22 @@
+additionalProperties: false
+properties:
+ token:
+ description: Fill in your GitHub access token for advanced usages. For more information
+ about how to create tokens, please refer to the github
+ settings.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: Token
+ format: string
+required:
+- token
+instillOAuthConfig:
+ authUrl: https://github.com/login/oauth/authorize
+ accessUrl: https://github.com/login/oauth/access_token
+ scopes:
+ - repo
+ - admin:repo_hook
+title: GitHub Connection
+format: object
diff --git a/pkg/component/application/github/v0/config/tasks.json b/pkg/component/application/github/v0/config/tasks.json
deleted file mode 100644
index 81f6508e0..000000000
--- a/pkg/component/application/github/v0/config/tasks.json
+++ /dev/null
@@ -1,1148 +0,0 @@
-{
- "$defs": {
- "pullRequest": {
- "description": "A pull request object.",
- "properties": {
- "id": {
- "description": "ID of the PR.",
- "uiOrder": 1,
- "title": "PR id",
- "format": "integer"
- },
- "number": {
- "description": "Number of the PR.",
- "uiOrder": 2,
- "title": "PR number",
- "format": "integer"
- },
- "state": {
- "description": "State of the PR.",
- "uiOrder": 3,
- "title": "PR state",
- "format": "string"
- },
- "title": {
- "description": "Title of the PR.",
- "uiOrder": 4,
- "title": "PR Title",
- "format": "string"
- },
- "body": {
- "description": "Body of the PR.",
- "uiOrder": 5,
- "title": "PR body",
- "format": "string"
- },
- "diff-url": {
- "description": "URL to the diff of the PR.",
- "uiOrder": 6,
- "title": "PR diff url",
- "format": "string"
- },
- "head": {
- "description": "Head commit of the PR (in SHA value).",
- "uiOrder": 8,
- "title": "PR head",
- "format": "string"
- },
- "base": {
- "description": "Base commit of the PR (in SHA value).",
- "uiOrder": 9,
- "title": "PR base",
- "format": "string"
- },
- "comments-num": {
- "description": "Number of comments on the PR.",
- "uiOrder": 10,
- "title": "Number of PR comments",
- "format": "integer"
- },
- "commits-num": {
- "description": "Number of commits in the PR.",
- "uiOrder": 11,
- "title": "Number of PR commits",
- "format": "integer"
- },
- "review-comments-num": {
- "description": "Number of review comments in the PR.",
- "uiOrder": 12,
- "title": "Number of PR review comments",
- "format": "integer"
- },
- "commits": {
- "description": "Commits in the PR.",
- "uiOrder": 13,
- "title": "Commits",
- "items": {
- "$ref": "#/$defs/commit",
- "required": [],
- "description": "A commit in the PR."
- },
- "format": "array"
- }
- },
- "required": [],
- "title": "Pull Request",
- "format": "object"
- },
- "commit": {
- "description": "A commit object.",
- "properties": {
- "sha": {
- "description": "SHA of the commit.",
- "uiOrder": 1,
- "title": "Commit SHA",
- "format": "string"
- },
- "message": {
- "description": "Message of the commit.",
- "uiOrder": 2,
- "title": "Commit message",
- "format": "string"
- },
- "stats": {
- "uiOrder": 3,
- "$ref": "#/$defs/commitStats",
- "required": []
- },
- "files": {
- "description": "Files in the commit.",
- "uiOrder": 4,
- "title": "Files",
- "items": {
- "$ref": "#/$defs/commitFile",
- "required": [],
- "description": "A file in the commit."
- },
- "format": "array"
- }
- },
- "required": [],
- "title": "Commit",
- "format": "object"
- },
- "commitStats": {
- "description": "Stats of changes.",
- "uiOrder": 1,
- "properties": {
- "additions": {
- "description": "Number of additions in the commit.",
- "uiOrder": 1,
- "title": "Additions",
- "format": "integer"
- },
- "deletions": {
- "description": "Number of deletions in the commit.",
- "uiOrder": 2,
- "title": "Deletions",
- "format": "integer"
- },
- "changes": {
- "description": "Total number of changes in the commit.",
- "uiOrder": 3,
- "title": "Total changes",
- "format": "integer"
- }
- },
- "required": [],
- "title": "Commit stats",
- "format": "object"
- },
- "commitFile": {
- "description": "A commit file object.",
- "properties": {
- "filename": {
- "description": "Name of the file.",
- "uiOrder": 1,
- "title": "File name",
- "format": "string"
- },
- "$ref": "#/$defs/commitStats/properties",
- "patch": {
- "description": "Patch of the file.",
- "uiOrder": 3,
- "title": "Patch",
- "format": "string"
- }
- },
- "required": [],
- "title": "Commit File",
- "format": "object"
- },
- "repositoryInfo": {
- "owner": {
- "description": "Owner of the repository.",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "title": "Owner",
- "format": "string"
- },
- "repository": {
- "description": "Repository name.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Repository",
- "format": "string"
- }
- },
- "reviewComments": {
- "description": "A review comment object.",
- "properties": {
- "id": {
- "description": "ID of the comment.",
- "uiOrder": 1,
- "title": "Comment id",
- "format": "integer"
- },
- "in-reply-to-id": {
- "description": "ID of the comment this comment is in reply to.",
- "uiOrder": 2,
- "title": "In Reply To",
- "format": "integer"
- },
- "commit-id": {
- "description": "SHA of the commit on which you want to comment.",
- "uiOrder": 3,
- "title": "Commit SHA",
- "format": "string"
- },
- "body": {
- "description": "Body of the comment.",
- "uiOrder": 4,
- "title": "Comment body",
- "format": "string"
- },
- "path": {
- "description": "Path of the file the comment is on.",
- "uiOrder": 5,
- "title": "Comment path",
- "format": "string"
- },
- "line": {
- "shortDescription": "The last line of the range that your comment applies to. Your comment will be placed under this line.",
- "description": "The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to.",
- "uiOrder": 6,
- "title": "Comment end line",
- "format": "integer"
- },
- "start-line": {
- "description": "The first line in the pull request diff that your multi-line comment applies to. Only multi-line comment needs to fill this field.",
- "uiOrder": 7,
- "title": "Comment start line",
- "format": "integer"
- },
- "side": {
- "shortDescription": "Side of the end line, can be one of: LEFT, RIGHT, side. Default is side.",
- "description": "Side of the end line, can be one of: LEFT, RIGHT, side. LEFT is the left side of the diff (deletion), RIGHT is the right side of the diff (addition), and side is the comment on the PR as a whole. Default is side.",
- "default": "side",
- "enum": [
- "LEFT",
- "RIGHT",
- "side"
- ],
- "uiOrder": 8,
- "title": "Comment end side",
- "format": "string"
- },
- "start-side": {
- "shortDescription": "Side of the start line, can be one of: LEFT, RIGHT, side. Default is side.",
- "description": "Side of the start line, can be one of: LEFT, RIGHT, side. LEFT is the left side of the diff (deletion), RIGHT is the right side of the diff (addition), and side is the comment on the PR as a whole. Default is side.",
- "default": "side",
- "enum": [
- "LEFT",
- "RIGHT",
- "side"
- ],
- "uiOrder": 9,
- "title": "Comment start side",
- "format": "string"
- },
- "subject-type": {
- "description": "Subject type of the comment, can be one of: line, file. Default is line.",
- "uiOrder": 10,
- "title": "Comment type",
- "default": "line",
- "enum": [
- "line",
- "file"
- ],
- "format": "string"
- },
- "created-at": {
- "description": "Time the comment was created.",
- "uiOrder": 11,
- "title": "Comment created at",
- "format": "string"
- },
- "updated-at": {
- "description": "Time the comment was updated.",
- "uiOrder": 12,
- "title": "Comment updated at",
- "format": "string"
- },
- "user": {
- "description": "User who created the comment.",
- "uiOrder": 13,
- "title": "User",
- "properties": {
- "id": {
- "description": "ID of the user.",
- "uiOrder": 14,
- "title": "User id",
- "format": "integer"
- },
- "url": {
- "description": "URL of the user.",
- "uiOrder": 15,
- "title": "User URL",
- "format": "string"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "title": "Review Comment",
- "format": "object"
- },
- "issue": {
- "description": "An issue object.",
- "properties": {
- "number": {
- "description": "Number of the issue.",
- "uiOrder": 2,
- "title": "Issue Number",
- "format": "integer"
- },
- "state": {
- "description": "State of the issue.",
- "uiOrder": 3,
- "title": "Issue state",
- "format": "string"
- },
- "title": {
- "description": "Title of the issue.",
- "uiOrder": 4,
- "title": "Issue title",
- "format": "string"
- },
- "body": {
- "description": "Body of the issue.",
- "uiOrder": 5,
- "title": "Issue body",
- "format": "string"
- },
- "assignee": {
- "description": "Assignee of the issue.",
- "uiOrder": 6,
- "title": "Assignee",
- "format": "string"
- },
- "assignees": {
- "description": "Assignees of the issue.",
- "uiOrder": 7,
- "title": "Assignees",
- "items": {
- "format": "string"
- },
- "format": "array"
- },
- "labels": {
- "description": "Labels of the issue.",
- "uiOrder": 8,
- "title": "Labels",
- "items": {
- "format": "string"
- },
- "format": "array"
- },
- "is-pull-request": {
- "description": "Whether the issue is a pull request.",
- "uiOrder": 9,
- "title": "Is Pull Request",
- "format": "boolean"
- }
- },
- "title": "Issue",
- "format": "object"
- },
- "pageOptions": {
- "title": "Page Options",
- "description": "Options for listing pages.",
- "required": [],
- "page": {
- "default": 1,
- "description": "Page number of the results to fetch. Default is 1.",
- "uiOrder": 100,
- "title": "Page",
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "per-page": {
- "default": 30,
- "description": "Number of results to fetch per page. Default is 30.",
- "uiOrder": 101,
- "title": "Per Page",
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "format": "object"
- }
- },
- "TASK_CREATE_ISSUE": {
- "description": "Create an issue.",
- "input": {
- "description": "Please input the repository name and owner.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/repositoryInfo",
- "title": {
- "$ref": "#/$defs/issue/properties/title",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3
- },
- "body": {
- "$ref": "#/$defs/issue/properties/body",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4
- },
- "assignees": {
- "$ref": "#/$defs/issue/properties/assignees",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "title": "Assignees",
- "uiOrder": 5
- },
- "labels": {
- "$ref": "#/$defs/issue/properties/labels",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "title": "Labels",
- "uiOrder": 6
- }
- },
- "required": [
- "owner",
- "repository",
- "title",
- "body"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "The created issue.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/issue/properties"
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_REVIEW_COMMENT": {
- "shortDescription": "Create a review comment in pull request.",
- "description": "Create a review comment in a pull request. The comment can be a general comment or a review comment. The comment can be on a specific line or on the PR as a whole.",
- "input": {
- "description": "Please input the repository name and owner, and the PR number.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/repositoryInfo",
- "pr-number": {
- "title": "PR Number",
- "description": "Number of the PR.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 3,
- "format": "integer"
- },
- "comment": {
- "title": "Comment",
- "description": "The comment to be added.",
- "uiOrder": 4,
- "properties": {
- "commit-id": {
- "$ref": "#/$defs/reviewComments/properties/commit-id",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0
- },
- "body": {
- "$ref": "#/$defs/reviewComments/properties/body",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1
- },
- "path": {
- "$ref": "#/$defs/reviewComments/properties/path",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2
- },
- "start-line": {
- "$ref": "#/$defs/reviewComments/properties/start-line",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 3
- },
- "line": {
- "$ref": "#/$defs/reviewComments/properties/line",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4
- },
- "start-side": {
- "$ref": "#/$defs/reviewComments/properties/start-side",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 5
- },
- "side": {
- "$ref": "#/$defs/reviewComments/properties/side",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 6
- },
- "subject-type": {
- "$ref": "#/$defs/reviewComments/properties/subject-type",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 7
- }
- },
- "required": [
- "body",
- "path",
- "commit-id"
- ],
- "format": "object"
- }
- },
- "required": [
- "owner",
- "repository",
- "pr-number",
- "comment"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "The created comment.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/reviewComments/properties"
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_WEBHOOK": {
- "description": "Create a webhook for a repository.",
- "input": {
- "description": "Please input the repository name and owner.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/repositoryInfo",
- "hook-url": {
- "title": "Webhook URL",
- "description": "URL to send the payload to.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "format": "string"
- },
- "events": {
- "title": "Events",
- "description": "Events to trigger the webhook. Please see the github document for more information.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 4,
- "items": {
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "format": "array"
- },
- "active": {
- "title": "Active",
- "default": false,
- "description": "Whether the webhook is active. Default is false.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 5,
- "format": "boolean"
- },
- "content-type": {
- "default": "json",
- "title": "Content Type",
- "description": "Content type of the webhook, can be one of: json, form. Default is json.",
- "enum": [
- "json",
- "form"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 6,
- "format": "string"
- },
- "hook-secret": {
- "title": "Hook Secret",
- "description": "If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers. (see the document).",
- "instillSecret": true,
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 7,
- "format": "string"
- }
- },
- "required": [
- "owner",
- "repository",
- "hook-url",
- "events"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "The created webhook.",
- "uiOrder": 0,
- "properties": {
- "id": {
- "description": "ID of the webhook.",
- "uiOrder": 1,
- "title": "Webhook ID",
- "format": "integer"
- },
- "url": {
- "description": "URL of the webhook.",
- "uiOrder": 2,
- "title": "Webhook URL",
- "format": "string"
- },
- "ping-url": {
- "description": "URL to ping the webhook.",
- "uiOrder": 3,
- "title": "Ping URL",
- "format": "string"
- },
- "test-url": {
- "description": "URL to test the webhook.",
- "uiOrder": 4,
- "title": "Test URL",
- "format": "string"
- },
- "config": {
- "description": "Configuration of the webhook.",
- "uiOrder": 6,
- "title": "Config",
- "properties": {
- "url": {
- "description": "URL of the webhook.",
- "uiOrder": 1,
- "title": "Webhook URL",
- "format": "string"
- },
- "content-type": {
- "description": "Content type of the webhook.",
- "uiOrder": 2,
- "title": "Content Type",
- "format": "string"
- },
- "insecure-ssl": {
- "description": "Whether the webhook is insecure.",
- "uiOrder": 3,
- "title": "Insecure SSL",
- "format": "string"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_COMMIT": {
- "shortDescription": "Get a commit from a repository, given the commit SHA",
- "input": {
- "description": "Please input the repository name and owner, and the commit SHA.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/repositoryInfo",
- "sha": {
- "$ref": "#/$defs/commit/properties/sha",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3
- }
- },
- "required": [
- "owner",
- "repository",
- "sha"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "The specific commit in GitHub repository.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/commit/properties"
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_ISSUE": {
- "description": "Get an issue. This can be a pull request or a general issue, and you can tell by the `is-pull-request` field.",
- "shortDescription": "Get an issue.",
- "input": {
- "description": "Please input the repository name and owner.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/repositoryInfo",
- "issue-number": {
- "default": 0,
- "title": "Issue Number",
- "description": "Number of the issue.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "format": "integer"
- }
- },
- "required": [
- "owner",
- "repository",
- "issue-number"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "The specific issue in GitHub repository.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/issue/properties"
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_PULL_REQUEST": {
- "shortDescription": "Get a pull request from a repository, given the PR number. This will default to the latest PR if no PR number is provided.",
- "input": {
- "description": "Please input the repository name and owner, and the PR number.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/repositoryInfo",
- "pr-number": {
- "default": 0,
- "title": "PR Number",
- "description": "Number of the PR. `0` for the latest PR.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "format": "integer"
- }
- },
- "required": [
- "owner",
- "repository"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "The specific pr in GitHub repository.",
- "uiOrder": 0,
- "$ref": "#/$defs/pullRequest",
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_LIST_ISSUES": {
- "description": "Get the list of all issues in a repository,This can be a pull request or a general issue, and you can tell by the `is-pull-request` field.",
- "shortDescription": "Get the list of all issues in a repository",
- "input": {
- "description": "Please input the repository name and owner.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/repositoryInfo",
- "state": {
- "default": "open",
- "title": "State",
- "description": "State of the issues, can be one of: open, closed, all. Default is open.",
- "enum": [
- "open",
- "closed",
- "all"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 10,
- "format": "string"
- },
- "sort": {
- "default": "created",
- "title": "Sort",
- "description": "Sort the issues by created, updated, popularity, or long-running. Default is created.",
- "enum": [
- "created",
- "updated",
- "popularity",
- "long-running"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 11,
- "format": "string"
- },
- "direction": {
- "default": "desc",
- "title": "Direction",
- "description": "Direction of the sort, can be one of: asc, desc. Default is desc.",
- "enum": [
- "asc",
- "desc"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 12,
- "format": "string"
- },
- "since": {
- "default": "2021-01-01",
- "title": "Since",
- "description": "Date (in `YYYY-MM-DD` format) from which issues will start to be fetched. The date will be in the UTC timezone.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 13,
- "format": "string"
- },
- "no-pull-request": {
- "title": "No Pull Request",
- "description": "Whether to `not` include pull requests in the response. Since issue and pr use the same indexing system in GitHub, the API returns all relevant objects (issues and pr). Default is false.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 14,
- "format": "boolean"
- },
- "page": {
- "default": 1,
- "description": "Page number of the results to fetch. Default is 1.",
- "uiOrder": 100,
- "title": "Page",
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "per-page": {
- "default": 30,
- "description": "Number of results to fetch per page. Default is 30.",
- "uiOrder": 101,
- "title": "Per Page",
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "owner",
- "repository"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "All issues in GitHub repository.",
- "uiOrder": 0,
- "properties": {
- "issues": {
- "description": "An array of issues.",
- "uiOrder": 1,
- "title": "Issues",
- "items": {
- "$ref": "#/$defs/issue",
- "required": [],
- "description": "An issue in GitHub."
- },
- "format": "array"
- }
- },
- "required": [
- "issues"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_LIST_PULL_REQUESTS": {
- "shortDescription": "Get the list of all pull requests in a repository",
- "description": "Get the list of all pull requests in a repository. Detailed information about each commit in a PR is omitted, please use the `Get Commit` task or the `Get Pull Request` task to get the details of a commit.",
- "input": {
- "description": "Please input the repository name and owner.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/repositoryInfo",
- "state": {
- "default": "open",
- "title": "State",
- "description": "State of the PRs, including open, closed, all. Default is open.",
- "enum": [
- "open",
- "closed",
- "all"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 10,
- "format": "string"
- },
- "sort": {
- "default": "created",
- "title": "Sort",
- "description": "Sort the PRs by created, updated, popularity, or long-running. Default is created.",
- "enum": [
- "created",
- "updated",
- "popularity",
- "long-running"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 11,
- "format": "string"
- },
- "direction": {
- "default": "desc",
- "title": "Direction",
- "description": "Direction of the sort, including asc or desc. Default is desc.",
- "enum": [
- "asc",
- "desc"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 12,
- "format": "string"
- },
- "page": {
- "default": 1,
- "description": "Page number of the results to fetch. Default is 1.",
- "uiOrder": 100,
- "title": "Page",
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "per-page": {
- "default": 30,
- "description": "Number of results to fetch per page. Default is 30.",
- "uiOrder": 101,
- "title": "Per Page",
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "owner",
- "repository"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "All PRs in GitHub repository.",
- "uiOrder": 0,
- "properties": {
- "pull-requests": {
- "description": "An array of PRs.",
- "title": "Pull Requests",
- "uiOrder": 1,
- "items": {
- "$ref": "#/$defs/pullRequest",
- "required": [],
- "description": "A pull request in GitHub."
- },
- "format": "array"
- }
- },
- "required": [
- "pull-requests"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_LIST_REVIEW_COMMENTS": {
- "shortDescription": "Get the review comments in a pull request",
- "description": "Get the review comments in a pull request. The comments can be on a specific line or on the PR as a whole.",
- "input": {
- "description": "Please input the repository name and owner, and the PR number. Set PR number as`0` to get all comments on all PRs in the repository.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/repositoryInfo",
- "pr-number": {
- "default": 0,
- "title": "PR Number",
- "description": "Number of the PR. Default is `0`, which retrieves all comments on all PRs in the repository.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "format": "integer"
- },
- "sort": {
- "default": "created",
- "title": "Sort",
- "description": "Sort the comments by created, updated. Default is created.",
- "enum": [
- "created",
- "updated"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 11,
- "format": "string"
- },
- "direction": {
- "default": "desc",
- "title": "Direction",
- "description": "Direction of the sort, including asc or desc. Default is desc.",
- "enum": [
- "asc",
- "desc"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 12,
- "format": "string"
- },
- "since": {
- "default": "2021-01-01",
- "title": "Since",
- "description": "Date (in `YYYY-MM-DD` format) from which comments will start to be fetched. The date will be in the UTC timezone.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 13,
- "format": "string"
- },
- "page": {
- "default": 1,
- "description": "Page number of the results to fetch. Default is 1.",
- "uiOrder": 100,
- "title": "Page",
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "per-page": {
- "default": 30,
- "description": "Number of results to fetch per page. Default is 30.",
- "uiOrder": 101,
- "title": "Per Page",
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "owner",
- "repository"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Comments in the PR.",
- "uiOrder": 0,
- "properties": {
- "comments": {
- "description": "An array of comments.",
- "uiOrder": 0,
- "title": "Comments",
- "items": {
- "$ref": "#/$defs/reviewComments",
- "required": [],
- "uiOrder": 1,
- "description": "Comments in the PR."
- },
- "format": "array"
- }
- },
- "required": [
- "comments"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/github/v0/config/tasks.yaml b/pkg/component/application/github/v0/config/tasks.yaml
new file mode 100644
index 000000000..7fff24ef3
--- /dev/null
+++ b/pkg/component/application/github/v0/config/tasks.yaml
@@ -0,0 +1,941 @@
+$defs:
+ pullRequest:
+ description: A pull request object.
+ properties:
+ id:
+ description: ID of the PR.
+ uiOrder: 1
+ title: PR id
+ format: integer
+ number:
+ description: Number of the PR.
+ uiOrder: 2
+ title: PR number
+ format: integer
+ state:
+ description: State of the PR.
+ uiOrder: 3
+ title: PR state
+ format: string
+ title:
+ description: Title of the PR.
+ uiOrder: 4
+ title: PR Title
+ format: string
+ body:
+ description: Body of the PR.
+ uiOrder: 5
+ title: PR body
+ format: string
+ diff-url:
+ description: URL to the diff of the PR.
+ uiOrder: 6
+ title: PR diff url
+ format: string
+ head:
+ description: Head commit of the PR (in SHA value).
+ uiOrder: 8
+ title: PR head
+ format: string
+ base:
+ description: Base commit of the PR (in SHA value).
+ uiOrder: 9
+ title: PR base
+ format: string
+ comments-num:
+ description: Number of comments on the PR.
+ uiOrder: 10
+ title: Number of PR comments
+ format: integer
+ commits-num:
+ description: Number of commits in the PR.
+ uiOrder: 11
+ title: Number of PR commits
+ format: integer
+ review-comments-num:
+ description: Number of review comments in the PR.
+ uiOrder: 12
+ title: Number of PR review comments
+ format: integer
+ commits:
+ description: Commits in the PR.
+ uiOrder: 13
+ title: Commits
+ items:
+ $ref: '#/$defs/commit'
+ required: []
+ description: A commit in the PR.
+ format: array
+ required: []
+ title: Pull Request
+ format: object
+ commit:
+ description: A commit object.
+ properties:
+ sha:
+ description: SHA of the commit.
+ uiOrder: 1
+ title: Commit SHA
+ format: string
+ message:
+ description: Message of the commit.
+ uiOrder: 2
+ title: Commit message
+ format: string
+ stats:
+ uiOrder: 3
+ $ref: '#/$defs/commitStats'
+ required: []
+ files:
+ description: Files in the commit.
+ uiOrder: 4
+ title: Files
+ items:
+ $ref: '#/$defs/commitFile'
+ required: []
+ description: A file in the commit.
+ format: array
+ required: []
+ title: Commit
+ format: object
+ commitStats:
+ description: Stats of changes.
+ uiOrder: 1
+ properties:
+ additions:
+ description: Number of additions in the commit.
+ uiOrder: 1
+ title: Additions
+ format: integer
+ deletions:
+ description: Number of deletions in the commit.
+ uiOrder: 2
+ title: Deletions
+ format: integer
+ changes:
+ description: Total number of changes in the commit.
+ uiOrder: 3
+ title: Total changes
+ format: integer
+ required: []
+ title: Commit stats
+ format: object
+ commitFile:
+ description: A commit file object.
+ properties:
+ filename:
+ description: Name of the file.
+ uiOrder: 1
+ title: File name
+ format: string
+ $ref: '#/$defs/commitStats/properties'
+ patch:
+ description: Patch of the file.
+ uiOrder: 3
+ title: Patch
+ format: string
+ required: []
+ title: Commit File
+ format: object
+ repositoryInfo:
+ owner:
+ description: Owner of the repository.
+ uiOrder: 0
+ acceptFormats:
+ - string
+ title: Owner
+ format: string
+ repository:
+ description: Repository name.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Repository
+ format: string
+ reviewComments:
+ description: A review comment object.
+ properties:
+ id:
+ description: ID of the comment.
+ uiOrder: 1
+ title: Comment id
+ format: integer
+ in-reply-to-id:
+ description: ID of the comment this comment is in reply to.
+ uiOrder: 2
+ title: In Reply To
+ format: integer
+ commit-id:
+ description: SHA of the commit on which you want to comment.
+ uiOrder: 3
+ title: Commit SHA
+ format: string
+ body:
+ description: Body of the comment.
+ uiOrder: 4
+ title: Comment body
+ format: string
+ path:
+ description: Path of the file the comment is on.
+ uiOrder: 5
+ title: Comment path
+ format: string
+ line:
+ shortDescription: The last line of the range that your comment applies to.
+ Your comment will be placed under this line.
+ description: The line of the blob in the pull request diff that the comment
+ applies to. For a multi-line comment, the last line of the range that your
+ comment applies to.
+ uiOrder: 6
+ title: Comment end line
+ format: integer
+ start-line:
+ description: The first line in the pull request diff that your multi-line
+ comment applies to. Only multi-line comment needs to fill this field.
+ uiOrder: 7
+ title: Comment start line
+ format: integer
+ side:
+ shortDescription: 'Side of the end line, can be one of: LEFT, RIGHT, side.
+ Default is side.'
+ description: 'Side of the end line, can be one of: LEFT, RIGHT, side. LEFT
+ is the left side of the diff (deletion), RIGHT is the right side of the
+ diff (addition), and side is the comment on the PR as a whole. Default is
+ side.'
+ default: side
+ enum:
+ - LEFT
+ - RIGHT
+ - side
+ uiOrder: 8
+ title: Comment end side
+ format: string
+ start-side:
+ shortDescription: 'Side of the start line, can be one of: LEFT, RIGHT, side.
+ Default is side.'
+ description: 'Side of the start line, can be one of: LEFT, RIGHT, side. LEFT
+ is the left side of the diff (deletion), RIGHT is the right side of the
+ diff (addition), and side is the comment on the PR as a whole. Default is
+ side.'
+ default: side
+ enum:
+ - LEFT
+ - RIGHT
+ - side
+ uiOrder: 9
+ title: Comment start side
+ format: string
+ subject-type:
+ description: 'Subject type of the comment, can be one of: line, file. Default
+ is line.'
+ uiOrder: 10
+ title: Comment type
+ default: line
+ enum:
+ - line
+ - file
+ format: string
+ created-at:
+ description: Time the comment was created.
+ uiOrder: 11
+ title: Comment created at
+ format: string
+ updated-at:
+ description: Time the comment was updated.
+ uiOrder: 12
+ title: Comment updated at
+ format: string
+ user:
+ description: User who created the comment.
+ uiOrder: 13
+ title: User
+ properties:
+ id:
+ description: ID of the user.
+ uiOrder: 14
+ title: User id
+ format: integer
+ url:
+ description: URL of the user.
+ uiOrder: 15
+ title: User URL
+ format: string
+ required: []
+ format: object
+ title: Review Comment
+ format: object
+ issue:
+ description: An issue object.
+ properties:
+ number:
+ description: Number of the issue.
+ uiOrder: 2
+ title: Issue Number
+ format: integer
+ state:
+ description: State of the issue.
+ uiOrder: 3
+ title: Issue state
+ format: string
+ title:
+ description: Title of the issue.
+ uiOrder: 4
+ title: Issue title
+ format: string
+ body:
+ description: Body of the issue.
+ uiOrder: 5
+ title: Issue body
+ format: string
+ assignee:
+ description: Assignee of the issue.
+ uiOrder: 6
+ title: Assignee
+ format: string
+ assignees:
+ description: Assignees of the issue.
+ uiOrder: 7
+ title: Assignees
+ items:
+ format: string
+ format: array
+ labels:
+ description: Labels of the issue.
+ uiOrder: 8
+ title: Labels
+ items:
+ format: string
+ format: array
+ is-pull-request:
+ description: Whether the issue is a pull request.
+ uiOrder: 9
+ title: Is Pull Request
+ format: boolean
+ title: Issue
+ format: object
+ pageOptions:
+ title: Page Options
+ description: Options for listing pages.
+ required: []
+ page:
+ default: 1
+ description: Page number of the results to fetch. Default is 1.
+ uiOrder: 100
+ title: Page
+ acceptFormats:
+ - integer
+ format: integer
+ per-page:
+ default: 30
+ description: Number of results to fetch per page. Default is 30.
+ uiOrder: 101
+ title: Per Page
+ acceptFormats:
+ - integer
+ format: integer
+ format: object
+TASK_CREATE_ISSUE:
+ description: Create an issue.
+ input:
+ description: Please input the repository name and owner.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/repositoryInfo'
+ title:
+ $ref: '#/$defs/issue/properties/title'
+ acceptFormats:
+ - string
+ uiOrder: 3
+ body:
+ $ref: '#/$defs/issue/properties/body'
+ acceptFormats:
+ - string
+ uiOrder: 4
+ assignees:
+ $ref: '#/$defs/issue/properties/assignees'
+ acceptFormats:
+ - array
+ items:
+ format: string
+ title: Assignees
+ uiOrder: 5
+ labels:
+ $ref: '#/$defs/issue/properties/labels'
+ acceptFormats:
+ - array
+ items:
+ format: string
+ title: Labels
+ uiOrder: 6
+ required:
+ - owner
+ - repository
+ - title
+ - body
+ title: Input
+ format: object
+ output:
+ description: The created issue.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/issue/properties'
+ required: []
+ title: Output
+ format: object
+TASK_CREATE_REVIEW_COMMENT:
+ shortDescription: Create a review comment in pull request.
+ description: Create a review comment in a pull request. The comment can be a general
+ comment or a review comment. The comment can be on a specific line or on the PR
+ as a whole.
+ input:
+ description: Please input the repository name and owner, and the PR number.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/repositoryInfo'
+ pr-number:
+ title: PR Number
+ description: Number of the PR.
+ acceptFormats:
+ - integer
+ uiOrder: 3
+ format: integer
+ comment:
+ title: Comment
+ description: The comment to be added.
+ uiOrder: 4
+ properties:
+ commit-id:
+ $ref: '#/$defs/reviewComments/properties/commit-id'
+ acceptFormats:
+ - string
+ uiOrder: 0
+ body:
+ $ref: '#/$defs/reviewComments/properties/body'
+ acceptFormats:
+ - string
+ uiOrder: 1
+ path:
+ $ref: '#/$defs/reviewComments/properties/path'
+ acceptFormats:
+ - string
+ uiOrder: 2
+ start-line:
+ $ref: '#/$defs/reviewComments/properties/start-line'
+ acceptFormats:
+ - integer
+ uiOrder: 3
+ line:
+ $ref: '#/$defs/reviewComments/properties/line'
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ start-side:
+ $ref: '#/$defs/reviewComments/properties/start-side'
+ acceptFormats:
+ - string
+ uiOrder: 5
+ side:
+ $ref: '#/$defs/reviewComments/properties/side'
+ acceptFormats:
+ - string
+ uiOrder: 6
+ subject-type:
+ $ref: '#/$defs/reviewComments/properties/subject-type'
+ acceptFormats:
+ - string
+ uiOrder: 7
+ required:
+ - body
+ - path
+ - commit-id
+ format: object
+ required:
+ - owner
+ - repository
+ - pr-number
+ - comment
+ title: Input
+ format: object
+ output:
+ description: The created comment.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/reviewComments/properties'
+ required: []
+ title: Output
+ format: object
+TASK_CREATE_WEBHOOK:
+ description: Create a webhook for a repository.
+ input:
+ description: Please input the repository name and owner.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/repositoryInfo'
+ hook-url:
+ title: Webhook URL
+ description: URL to send the payload to.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ format: string
+ events:
+ title: Events
+ description: Events to trigger the webhook. Please see the
+ github document for more information.
+ acceptFormats:
+ - array
+ uiOrder: 4
+ items:
+ acceptFormats:
+ - string
+ format: string
+ format: array
+ active:
+ title: Active
+ default: false
+ description: Whether the webhook is active. Default is false.
+ acceptFormats:
+ - boolean
+ uiOrder: 5
+ format: boolean
+ content-type:
+ default: json
+ title: Content Type
+ description: 'Content type of the webhook, can be one of: json, form. Default
+ is json.'
+ enum:
+ - json
+ - form
+ acceptFormats:
+ - string
+ uiOrder: 6
+ format: string
+ hook-secret:
+ title: Hook Secret
+ description: If provided, the secret will be used as the key to generate the
+ HMAC hex digest value for delivery signature headers. (see the
+ document).
+ instillSecret: true
+ acceptFormats:
+ - string
+ uiOrder: 7
+ format: string
+ required:
+ - owner
+ - repository
+ - hook-url
+ - events
+ title: Input
+ format: object
+ output:
+ description: The created webhook.
+ uiOrder: 0
+ properties:
+ id:
+ description: ID of the webhook.
+ uiOrder: 1
+ title: Webhook ID
+ format: integer
+ url:
+ description: URL of the webhook.
+ uiOrder: 2
+ title: Webhook URL
+ format: string
+ ping-url:
+ description: URL to ping the webhook.
+ uiOrder: 3
+ title: Ping URL
+ format: string
+ test-url:
+ description: URL to test the webhook.
+ uiOrder: 4
+ title: Test URL
+ format: string
+ config:
+ description: Configuration of the webhook.
+ uiOrder: 6
+ title: Config
+ properties:
+ url:
+ description: URL of the webhook.
+ uiOrder: 1
+ title: Webhook URL
+ format: string
+ content-type:
+ description: Content type of the webhook.
+ uiOrder: 2
+ title: Content Type
+ format: string
+ insecure-ssl:
+ description: Whether the webhook is insecure.
+ uiOrder: 3
+ title: Insecure SSL
+ format: string
+ required: []
+ format: object
+ required: []
+ title: Output
+ format: object
+TASK_GET_COMMIT:
+ shortDescription: Get a commit from a repository, given the commit SHA
+ input:
+ description: Please input the repository name and owner, and the commit SHA.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/repositoryInfo'
+ sha:
+ $ref: '#/$defs/commit/properties/sha'
+ acceptFormats:
+ - string
+ uiOrder: 3
+ required:
+ - owner
+ - repository
+ - sha
+ title: Input
+ format: object
+ output:
+ description: The specific commit in GitHub repository.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/commit/properties'
+ required: []
+ title: Output
+ format: object
+TASK_GET_ISSUE:
+ description: Get an issue. This can be a pull request or a general issue, and you
+ can tell by the `is-pull-request` field.
+ shortDescription: Get an issue.
+ input:
+ description: Please input the repository name and owner.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/repositoryInfo'
+ issue-number:
+ default: 0
+ title: Issue Number
+ description: Number of the issue.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ format: integer
+ required:
+ - owner
+ - repository
+ - issue-number
+ title: Input
+ format: object
+ output:
+ description: The specific issue in GitHub repository.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/issue/properties'
+ required: []
+ title: Output
+ format: object
+TASK_GET_PULL_REQUEST:
+ shortDescription: Get a pull request from a repository, given the PR number. This
+ will default to the latest PR if no PR number is provided.
+ input:
+ description: Please input the repository name and owner, and the PR number.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/repositoryInfo'
+ pr-number:
+ default: 0
+ title: PR Number
+ description: Number of the PR. `0` for the latest PR.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ format: integer
+ required:
+ - owner
+ - repository
+ title: Input
+ format: object
+ output:
+ description: The specific pr in GitHub repository.
+ uiOrder: 0
+ $ref: '#/$defs/pullRequest'
+ required: []
+ title: Output
+ format: object
+TASK_LIST_ISSUES:
+ description: Get the list of all issues in a repository,This can be a pull request
+ or a general issue, and you can tell by the `is-pull-request` field.
+ shortDescription: Get the list of all issues in a repository
+ input:
+ description: Please input the repository name and owner.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/repositoryInfo'
+ state:
+ default: open
+ title: State
+ description: 'State of the issues, can be one of: open, closed, all. Default
+ is open.'
+ enum:
+ - open
+ - closed
+ - all
+ acceptFormats:
+ - string
+ uiOrder: 10
+ format: string
+ sort:
+ default: created
+ title: Sort
+ description: Sort the issues by created, updated, popularity, or long-running.
+ Default is created.
+ enum:
+ - created
+ - updated
+ - popularity
+ - long-running
+ acceptFormats:
+ - string
+ uiOrder: 11
+ format: string
+ direction:
+ default: desc
+ title: Direction
+ description: 'Direction of the sort, can be one of: asc, desc. Default is
+ desc.'
+ enum:
+ - asc
+ - desc
+ acceptFormats:
+ - string
+ uiOrder: 12
+ format: string
+ since:
+ default: '2021-01-01'
+ title: Since
+ description: Date (in `YYYY-MM-DD` format) from which issues will start to
+ be fetched. The date will be in the UTC timezone.
+ acceptFormats:
+ - string
+ uiOrder: 13
+ format: string
+ no-pull-request:
+ title: No Pull Request
+ description: Whether to `not` include pull requests in the response. Since
+ issue and pr use the same indexing system in GitHub, the API returns all
+ relevant objects (issues and pr). Default is false.
+ acceptFormats:
+ - boolean
+ uiOrder: 14
+ format: boolean
+ page:
+ default: 1
+ description: Page number of the results to fetch. Default is 1.
+ uiOrder: 100
+ title: Page
+ acceptFormats:
+ - integer
+ format: integer
+ per-page:
+ default: 30
+ description: Number of results to fetch per page. Default is 30.
+ uiOrder: 101
+ title: Per Page
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - owner
+ - repository
+ title: Input
+ format: object
+ output:
+ description: All issues in GitHub repository.
+ uiOrder: 0
+ properties:
+ issues:
+ description: An array of issues.
+ uiOrder: 1
+ title: Issues
+ items:
+ $ref: '#/$defs/issue'
+ required: []
+ description: An issue in GitHub.
+ format: array
+ required:
+ - issues
+ title: Output
+ format: object
+TASK_LIST_PULL_REQUESTS:
+ shortDescription: Get the list of all pull requests in a repository
+ description: Get the list of all pull requests in a repository. Detailed information
+ about each commit in a PR is omitted, please use the `Get Commit` task or the
+ `Get Pull Request` task to get the details of a commit.
+ input:
+ description: Please input the repository name and owner.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/repositoryInfo'
+ state:
+ default: open
+ title: State
+ description: State of the PRs, including open, closed, all. Default is open.
+ enum:
+ - open
+ - closed
+ - all
+ acceptFormats:
+ - string
+ uiOrder: 10
+ format: string
+ sort:
+ default: created
+ title: Sort
+ description: Sort the PRs by created, updated, popularity, or long-running.
+ Default is created.
+ enum:
+ - created
+ - updated
+ - popularity
+ - long-running
+ acceptFormats:
+ - string
+ uiOrder: 11
+ format: string
+ direction:
+ default: desc
+ title: Direction
+ description: Direction of the sort, including asc or desc. Default is desc.
+ enum:
+ - asc
+ - desc
+ acceptFormats:
+ - string
+ uiOrder: 12
+ format: string
+ page:
+ default: 1
+ description: Page number of the results to fetch. Default is 1.
+ uiOrder: 100
+ title: Page
+ acceptFormats:
+ - integer
+ format: integer
+ per-page:
+ default: 30
+ description: Number of results to fetch per page. Default is 30.
+ uiOrder: 101
+ title: Per Page
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - owner
+ - repository
+ title: Input
+ format: object
+ output:
+ description: All PRs in GitHub repository.
+ uiOrder: 0
+ properties:
+ pull-requests:
+ description: An array of PRs.
+ title: Pull Requests
+ uiOrder: 1
+ items:
+ $ref: '#/$defs/pullRequest'
+ required: []
+ description: A pull request in GitHub.
+ format: array
+ required:
+ - pull-requests
+ title: Output
+ format: object
+TASK_LIST_REVIEW_COMMENTS:
+ shortDescription: Get the review comments in a pull request
+ description: Get the review comments in a pull request. The comments can be on a
+ specific line or on the PR as a whole.
+ input:
+ description: Please input the repository name and owner, and the PR number. Set
+ PR number as`0` to get all comments on all PRs in the repository.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/repositoryInfo'
+ pr-number:
+ default: 0
+ title: PR Number
+ description: Number of the PR. Default is `0`, which retrieves all comments
+ on all PRs in the repository.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ format: integer
+ sort:
+ default: created
+ title: Sort
+ description: Sort the comments by created, updated. Default is created.
+ enum:
+ - created
+ - updated
+ acceptFormats:
+ - string
+ uiOrder: 11
+ format: string
+ direction:
+ default: desc
+ title: Direction
+ description: Direction of the sort, including asc or desc. Default is desc.
+ enum:
+ - asc
+ - desc
+ acceptFormats:
+ - string
+ uiOrder: 12
+ format: string
+ since:
+ default: '2021-01-01'
+ title: Since
+ description: Date (in `YYYY-MM-DD` format) from which comments will start
+ to be fetched. The date will be in the UTC timezone.
+ acceptFormats:
+ - string
+ uiOrder: 13
+ format: string
+ page:
+ default: 1
+ description: Page number of the results to fetch. Default is 1.
+ uiOrder: 100
+ title: Page
+ acceptFormats:
+ - integer
+ format: integer
+ per-page:
+ default: 30
+ description: Number of results to fetch per page. Default is 30.
+ uiOrder: 101
+ title: Per Page
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - owner
+ - repository
+ title: Input
+ format: object
+ output:
+ description: Comments in the PR.
+ uiOrder: 0
+ properties:
+ comments:
+ description: An array of comments.
+ uiOrder: 0
+ title: Comments
+ items:
+ $ref: '#/$defs/reviewComments'
+ required: []
+ uiOrder: 1
+ description: Comments in the PR.
+ format: array
+ required:
+ - comments
+ title: Output
+ format: object
diff --git a/pkg/component/application/github/v0/main.go b/pkg/component/application/github/v0/main.go
index c43442d76..abd5f2a20 100644
--- a/pkg/component/application/github/v0/main.go
+++ b/pkg/component/application/github/v0/main.go
@@ -32,14 +32,14 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
- //go:embed config/events.json
- eventsJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
+ //go:embed config/events.yaml
+ eventsYAML []byte
once sync.Once
comp *component
@@ -60,7 +60,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, eventsJSON, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, eventsYAML, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/googlesearch/v0/README.mdx b/pkg/component/application/googlesearch/v0/README.mdx
index 21c297f16..aa1b4796c 100644
--- a/pkg/component/application/googlesearch/v0/README.mdx
+++ b/pkg/component/application/googlesearch/v0/README.mdx
@@ -19,7 +19,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/googlesearch/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/googlesearch/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/googlesearch/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/googlesearch/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/googlesearch/v0/config/definition.json b/pkg/component/application/googlesearch/v0/config/definition.json
deleted file mode 100644
index 8665fa52a..000000000
--- a/pkg/component/application/googlesearch/v0/config/definition.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "availableTasks": [
- "TASK_SEARCH"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/application/google-search",
- "icon": "assets/google-search.svg",
- "iconUrl": "",
- "id": "google-search",
- "public": true,
- "title": "Google Search",
- "description": "Leverage the Google Search engine.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "2b1da686-878a-462c-b2c6-a9690199939c",
- "vendor": "Google",
- "vendorAttributes": {},
- "version": "0.1.1",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/googlesearch/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/googlesearch/v0/config/definition.yaml b/pkg/component/application/googlesearch/v0/config/definition.yaml
new file mode 100644
index 000000000..a0eac5ae5
--- /dev/null
+++ b/pkg/component/application/googlesearch/v0/config/definition.yaml
@@ -0,0 +1,18 @@
+availableTasks:
+- TASK_SEARCH
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/application/google-search
+icon: assets/google-search.svg
+iconUrl: ''
+id: google-search
+public: true
+title: Google Search
+description: Leverage the Google Search engine.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: 2b1da686-878a-462c-b2c6-a9690199939c
+vendor: Google
+vendorAttributes: {}
+version: 0.1.1
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/googlesearch/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/googlesearch/v0/config/setup.json b/pkg/component/application/googlesearch/v0/config/setup.json
deleted file mode 100644
index 4648b85f9..000000000
--- a/pkg/component/application/googlesearch/v0/config/setup.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "API Key for the Google Custom Search API. You can create one here.",
- "instillSecret": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- },
- "cse-id": {
- "description": "ID of the Search Engine to use. Before using the Custom Search JSON API you will first need to create and configure your Programmable Search Engine. If you have not already created a Programmable Search Engine, you can start by visiting [the Programmable Search Engine control panel](https://programmablesearchengine.google.com/controlpanel/all).
You can find this in the URL of your Search Engine. For example, if the URL of your search engine is `https://cse.google.com/cse.js?cx=012345678910`, the ID value is: `012345678910`.",
- "instillSecret": false,
- "uiOrder": 1,
- "title": "Search Engine ID",
- "format": "string"
- }
- },
- "required": [
- "api-key",
- "cse-id"
- ],
- "title": "Google Search Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/googlesearch/v0/config/setup.yaml b/pkg/component/application/googlesearch/v0/config/setup.yaml
new file mode 100644
index 000000000..9cc691683
--- /dev/null
+++ b/pkg/component/application/googlesearch/v0/config/setup.yaml
@@ -0,0 +1,25 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: API Key for the Google Custom Search API. You can create one here.
+ instillSecret: true
+ uiOrder: 0
+ title: API Key
+ format: string
+ cse-id:
+ description: 'ID of the Search Engine to use. Before using the Custom Search JSON
+ API you will first need to create and configure your Programmable Search Engine.
+ If you have not already created a Programmable Search Engine, you can start
+ by visiting [the Programmable Search Engine control panel](https://programmablesearchengine.google.com/controlpanel/all).
+
You can find this in the URL of your Search Engine. For example, if the
+ URL of your search engine is `https://cse.google.com/cse.js?cx=012345678910`,
+ the ID value is: `012345678910`.'
+ instillSecret: false
+ uiOrder: 1
+ title: Search Engine ID
+ format: string
+required:
+- api-key
+- cse-id
+title: Google Search Connection
+format: object
diff --git a/pkg/component/application/googlesearch/v0/config/tasks.json b/pkg/component/application/googlesearch/v0/config/tasks.json
deleted file mode 100644
index c7189720d..000000000
--- a/pkg/component/application/googlesearch/v0/config/tasks.json
+++ /dev/null
@@ -1,133 +0,0 @@
-{
- "$defs": {
- "result": {
- "properties": {
- "link": {
- "description": "The full URL to which the search result is pointing, e.g., http://www.example.com/foo/bar.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Link",
- "format": "string"
- },
- "link-html": {
- "description": "The scraped raw html of the link associated with this search result.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Link HTML",
- "format": "string"
- },
- "link-text": {
- "description": "The scraped text of the link associated with this search result, in plain text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Link Text",
- "format": "string"
- },
- "snippet": {
- "description": "The snippet from the page associated with this search result, in plain text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Snippet",
- "format": "string"
- },
- "title": {
- "description": "The title of a search result, in plain text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Title",
- "format": "string"
- }
- },
- "required": [
- "title",
- "link",
- "snippet"
- ],
- "title": "Result",
- "format": "object"
- }
- },
- "TASK_SEARCH": {
- "shortDescription": "Search data via Google Search Engine.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "include-link-html": {
- "default": false,
- "description": "Indicate whether to scrape the link and include the raw HTML of the link associated with this search result in the 'link-html' field.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 3,
- "title": "Include Link HTML",
- "format": "boolean"
- },
- "include-link-text": {
- "default": false,
- "description": "Indicate whether to scrape the link and include the text of the link associated with this search result in the 'link-text' field.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 2,
- "title": "Include Link Text",
- "format": "boolean"
- },
- "query": {
- "description": "The search query for Google.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Query",
- "format": "string"
- },
- "top-k": {
- "default": 10,
- "description": "The number of results to return for each query.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "maximum": 100,
- "minimum": 1,
- "title": "Top K",
- "format": "integer"
- }
- },
- "required": [
- "query"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "results": {
- "description": "The returned search results from Google.",
- "uiOrder": 0,
- "items": {
- "$ref": "#/$defs/result"
- },
- "title": "Results",
- "format": "array"
- }
- },
- "required": [
- "results"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/googlesearch/v0/config/tasks.yaml b/pkg/component/application/googlesearch/v0/config/tasks.yaml
new file mode 100644
index 000000000..151949595
--- /dev/null
+++ b/pkg/component/application/googlesearch/v0/config/tasks.yaml
@@ -0,0 +1,105 @@
+$defs:
+ result:
+ properties:
+ link:
+ description: The full URL to which the search result is pointing, e.g., http://www.example.com/foo/bar.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Link
+ format: string
+ link-html:
+ description: The scraped raw html of the link associated with this search
+ result.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Link HTML
+ format: string
+ link-text:
+ description: The scraped text of the link associated with this search result,
+ in plain text.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Link Text
+ format: string
+ snippet:
+ description: The snippet from the page associated with this search result,
+ in plain text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Snippet
+ format: string
+ title:
+ description: The title of a search result, in plain text.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Title
+ format: string
+ required:
+ - title
+ - link
+ - snippet
+ title: Result
+ format: object
+TASK_SEARCH:
+ shortDescription: Search data via Google Search Engine.
+ input:
+ uiOrder: 0
+ properties:
+ include-link-html:
+ default: false
+ description: Indicate whether to scrape the link and include the raw HTML
+ of the link associated with this search result in the 'link-html' field.
+ acceptFormats:
+ - boolean
+ uiOrder: 3
+ title: Include Link HTML
+ format: boolean
+ include-link-text:
+ default: false
+ description: Indicate whether to scrape the link and include the text of the
+ link associated with this search result in the 'link-text' field.
+ acceptFormats:
+ - boolean
+ uiOrder: 2
+ title: Include Link Text
+ format: boolean
+ query:
+ description: The search query for Google.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Query
+ format: string
+ top-k:
+ default: 10
+ description: The number of results to return for each query.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ maximum: 100
+ minimum: 1
+ title: Top K
+ format: integer
+ required:
+ - query
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ results:
+ description: The returned search results from Google.
+ uiOrder: 0
+ items:
+ $ref: '#/$defs/result'
+ title: Results
+ format: array
+ required:
+ - results
+ title: Output
+ format: object
diff --git a/pkg/component/application/googlesearch/v0/main.go b/pkg/component/application/googlesearch/v0/main.go
index e756b4925..0cdb8b825 100644
--- a/pkg/component/application/googlesearch/v0/main.go
+++ b/pkg/component/application/googlesearch/v0/main.go
@@ -20,14 +20,14 @@ const (
taskSearch = "TASK_SEARCH"
)
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -43,7 +43,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/hubspot/v0/README.mdx b/pkg/component/application/hubspot/v0/README.mdx
index 2a60a7498..f8f8c5718 100644
--- a/pkg/component/application/hubspot/v0/README.mdx
+++ b/pkg/component/application/hubspot/v0/README.mdx
@@ -33,7 +33,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/hubspot/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/hubspot/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/hubspot/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/hubspot/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/hubspot/v0/config/definition.json b/pkg/component/application/hubspot/v0/config/definition.json
deleted file mode 100644
index e648fadf6..000000000
--- a/pkg/component/application/hubspot/v0/config/definition.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "availableTasks": [
- "TASK_GET_CONTACT",
- "TASK_CREATE_CONTACT",
- "TASK_GET_DEAL",
- "TASK_CREATE_DEAL",
- "TASK_UPDATE_DEAL",
- "TASK_GET_COMPANY",
- "TASK_CREATE_COMPANY",
- "TASK_GET_TICKET",
- "TASK_CREATE_TICKET",
- "TASK_UPDATE_TICKET",
- "TASK_GET_THREAD",
- "TASK_INSERT_MESSAGE",
- "TASK_RETRIEVE_ASSOCIATION",
- "TASK_GET_OWNER",
- "TASK_GET_ALL"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/application/hubspot",
- "icon": "assets/hubspot.svg",
- "id": "hubspot",
- "public": true,
- "title": "HubSpot",
- "description": "Use HubSpot application to do various tasks.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "0cd80b30-29bc-4f19-91ca-5911de3a3aae",
- "vendor": "HubSpot",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/hubspot/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/hubspot/v0/config/definition.yaml b/pkg/component/application/hubspot/v0/config/definition.yaml
new file mode 100644
index 000000000..765ca4b2e
--- /dev/null
+++ b/pkg/component/application/hubspot/v0/config/definition.yaml
@@ -0,0 +1,30 @@
+availableTasks:
+- TASK_GET_CONTACT
+- TASK_CREATE_CONTACT
+- TASK_GET_DEAL
+- TASK_CREATE_DEAL
+- TASK_UPDATE_DEAL
+- TASK_GET_COMPANY
+- TASK_CREATE_COMPANY
+- TASK_GET_TICKET
+- TASK_CREATE_TICKET
+- TASK_UPDATE_TICKET
+- TASK_GET_THREAD
+- TASK_INSERT_MESSAGE
+- TASK_RETRIEVE_ASSOCIATION
+- TASK_GET_OWNER
+- TASK_GET_ALL
+documentationUrl: https://www.instill.tech/docs/component/application/hubspot
+icon: assets/hubspot.svg
+id: hubspot
+public: true
+title: HubSpot
+description: Use HubSpot application to do various tasks.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: 0cd80b30-29bc-4f19-91ca-5911de3a3aae
+vendor: HubSpot
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/hubspot/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/hubspot/v0/config/setup.json b/pkg/component/application/hubspot/v0/config/setup.json
deleted file mode 100644
index bcdc033a9..000000000
--- a/pkg/component/application/hubspot/v0/config/setup.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "token": {
- "description": "Fill in your HubSpot private app access token. Go here for [more information](https://developers.hubspot.com/docs/api/private-apps).",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "Token",
- "format": "string"
- }
- },
- "required": [
- "token"
- ],
- "title": "HubSpot Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/hubspot/v0/config/setup.yaml b/pkg/component/application/hubspot/v0/config/setup.yaml
new file mode 100644
index 000000000..26d3d3515
--- /dev/null
+++ b/pkg/component/application/hubspot/v0/config/setup.yaml
@@ -0,0 +1,15 @@
+additionalProperties: false
+properties:
+ token:
+ description: Fill in your HubSpot private app access token. Go here for [more
+ information](https://developers.hubspot.com/docs/api/private-apps).
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: Token
+ format: string
+required:
+- token
+title: HubSpot Connection
+format: object
diff --git a/pkg/component/application/hubspot/v0/config/tasks.json b/pkg/component/application/hubspot/v0/config/tasks.json
deleted file mode 100644
index dde84a1c9..000000000
--- a/pkg/component/application/hubspot/v0/config/tasks.json
+++ /dev/null
@@ -1,1772 +0,0 @@
-{
- "$defs": {
- "common": {
- "owner-id": {
- "description": "The user who is assigned to the object.",
- "title": "Owner ID",
- "uiOrder": 0,
- "format": "string"
- },
- "associated-contact-ids": {
- "description": "Contact IDs associated with the object.",
- "title": "Associated Contact IDs",
- "items": {
- "title": "Associated Contact ID",
- "description": "Contact ID associated with the object.",
- "format": "string"
- },
- "format": "array"
- },
- "create-contacts-association": {
- "description": "Existing contact IDs to be associated with the object.",
- "title": "Create Object -> Contact Association using contact IDs",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "format": "array"
- },
- "create-deals-association": {
- "description": "Existing deal IDs to be associated with the object.",
- "title": "Create Object -> Deal Association using deal IDs",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "format": "array"
- },
- "create-companies-association": {
- "description": "Existing company IDs to be associated with the object.",
- "title": "Create Object -> Company Association using company IDs",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "format": "array"
- },
- "create-tickets-association": {
- "description": "Existing ticket IDs to be associated with the object.",
- "title": "Create Object -> Ticket Association using ticket IDs",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "format": "array"
- }
- },
- "contact": {
- "email": {
- "description": "Email address.",
- "uiOrder": 1,
- "title": "Email Address",
- "format": "string"
- },
- "first-name": {
- "description": "First name.",
- "uiOrder": 2,
- "title": "First Name",
- "format": "string"
- },
- "last-name": {
- "description": "Last name.",
- "uiOrder": 3,
- "title": "Last Name",
- "format": "string"
- },
- "phone-number": {
- "description": "Phone number. If you plan to use the number formatting feature in HubSpot, use country code + phone number. Example: +886xxxxxxxxx.",
- "uiOrder": 4,
- "title": "Phone Number",
- "format": "string"
- },
- "company": {
- "description": "Company.",
- "uiOrder": 5,
- "title": "Company",
- "format": "string"
- },
- "job-title": {
- "description": "Job title.",
- "uiOrder": 6,
- "title": "Job Title",
- "format": "string"
- },
- "lifecycle-stage": {
- "description": "Lifecycle stages are used to track how contacts or companies move forward in your process. Default format is in small letters, all words are combined. Example: salesqualifiedlead. However, remember to check internal value for custom fields.",
- "uiOrder": 7,
- "title": "Lifecycle Stage",
- "format": "string"
- },
- "lead-status": {
- "description": "The contact's sales, prospecting or outreach status. Default format is in capital letters, with _ as space. Example: IN_PROGRESS. However, remember to check internal value for custom fields.",
- "uiOrder": 8,
- "title": "Lead Status",
- "format": "string"
- }
- },
- "deal": {
- "deal-name": {
- "description": "Deal name.",
- "uiOrder": 1,
- "title": "Deal Name",
- "format": "string"
- },
- "pipeline": {
- "description": "A pipeline is the place where you document and manage how your prospects move through the steps of your sales process. HubSpot uses interval value rather than the name displayed in the view.",
- "uiOrder": 2,
- "title": "Pipeline",
- "format": "string"
- },
- "deal-stage": {
- "description": "Deal stages allow you to categorize and track the progress of the deals that you are working on. Default format is in small letters, all words are combined. Example: qualifiedtobuy. However, remember to check internal value for custom fields.",
- "uiOrder": 3,
- "title": "Deal Stage",
- "format": "string"
- },
- "amount": {
- "description": "The total amount of the deal.",
- "uiOrder": 4,
- "title": "Amount",
- "format": "number"
- },
- "deal-type": {
- "description": "The type of deal. Default format is in small letters, all words are combined. Example: newbusiness. However, remember to check internal value for custom fields.",
- "uiOrder": 5,
- "title": "Deal Type",
- "format": "string"
- },
- "close-date": {
- "description": "Date the deal was closed. Set automatically by HubSpot. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z.",
- "uiOrder": 6,
- "title": "Close Date",
- "format": "string"
- },
- "create-date": {
- "description": "Create date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z.",
- "uiOrder": 7,
- "title": "Create Date",
- "format": "string"
- }
- },
- "company": {
- "company-name": {
- "description": "Company name.",
- "uiOrder": 1,
- "title": "Company Name",
- "format": "string"
- },
- "company-domain": {
- "description": "The domain name of the company.",
- "uiOrder": 2,
- "title": "Company Domain",
- "format": "string"
- },
- "description": {
- "description": "Description of the company.",
- "uiOrder": 3,
- "title": "Description",
- "format": "string"
- },
- "phone-number": {
- "description": "Phone number of the company. If you plan to use the number formatting feature in HubSpot, use country code + phone number. Example: +886xxxxxxxxx.",
- "uiOrder": 4,
- "title": "Phone Number",
- "format": "string"
- },
- "industry": {
- "description": "The industry the company belongs to. Default format is in capital letters, with _ as space. Example: BROADCAST_MEDIA.",
- "uiOrder": 5,
- "title": "Industry",
- "format": "string"
- },
- "company-type": {
- "description": "Type of company. Default format is capital letter. Example: RESELLER.",
- "uiOrder": 6,
- "title": "Company Type",
- "format": "string"
- },
- "city": {
- "description": "City.",
- "uiOrder": 7,
- "title": "City",
- "format": "string"
- },
- "state": {
- "description": "State.",
- "uiOrder": 8,
- "title": "State",
- "format": "string"
- },
- "country": {
- "description": "Country.",
- "uiOrder": 9,
- "title": "Country",
- "format": "string"
- },
- "postal-code": {
- "description": "Postal code.",
- "uiOrder": 10,
- "title": "Postal Code",
- "format": "string"
- },
- "time-zone": {
- "description": "Time zone.",
- "uiOrder": 11,
- "title": "Time Zone",
- "format": "string"
- },
- "annual-revenue": {
- "description": "Annual revenue.",
- "uiOrder": 12,
- "title": "Annual Revenue",
- "format": "number"
- },
- "total-revenue": {
- "description": "Total revenue. Calculated automatically by HubSpot.",
- "uiOrder": 13,
- "title": "Total Revenue",
- "format": "number"
- },
- "linkedin-page": {
- "description": "Linkedin page of the company.",
- "uiOrder": 14,
- "title": "Linkedin Page",
- "format": "string"
- }
- },
- "ticket": {
- "ticket-name": {
- "description": "Ticket name.",
- "uiOrder": 1,
- "title": "Ticket Name",
- "format": "string"
- },
- "ticket-status": {
- "description": "The pipeline stage that contains this ticket. Default format is number. Example: 1. However, remember to check internal value for custom fields. Note: In Instill AI, ticket-status is displayed as string because of the possible custom internal value.",
- "uiOrder": 2,
- "title": "Ticket Status",
- "format": "string"
- },
- "pipeline": {
- "description": "A pipeline organizes and tracks the progression of tickets through various stages of resolution within your support process. HubSpot uses interval value rather than the name displayed in the view.",
- "uiOrder": 3,
- "title": "Pipeline",
- "format": "string"
- },
- "categories": {
- "description": "The main reason customer reached out for help. Default format is in capital letters. Example: BILLING_ISSUE. However, remember to check internal value for custom fields.",
- "uiOrder": 4,
- "title": "Categories",
- "format": "array"
- },
- "priority": {
- "description": "The level of attention needed on the ticket. Default format is in capital letters. Example: MEDIUM. However, remember to check internal value for custom fields.",
- "uiOrder": 5,
- "title": "Priority",
- "format": "string"
- },
- "source": {
- "description": "Channel where ticket was originally submitted. Default format is in capital letters. Example: EMAIL.",
- "uiOrder": 6,
- "title": "Source",
- "format": "string"
- },
- "record-source": {
- "description": "How this record was created.",
- "uiOrder": 7,
- "title": "Record Source",
- "format": "string"
- },
- "create-date": {
- "description": "Create date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z.",
- "uiOrder": 8,
- "title": "Create Date",
- "format": "string"
- },
- "last-modified-date": {
- "description": "Last modified date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z.",
- "uiOrder": 9,
- "title": "Last Modified Date",
- "format": "string"
- }
- }
- },
- "TASK_GET_CONTACT": {
- "shortDescription": "Get contact information using contact ID or Email",
- "input": {
- "description": "Input contact ID or email.",
- "uiOrder": 0,
- "properties": {
- "contact-id-or-email": {
- "description": "Input contact ID or email. If the input has @, it will search the contact using email.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Contact ID or Email",
- "format": "string"
- }
- },
- "required": [
- "contact-id-or-email"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Contact information.",
- "uiOrder": 0,
- "properties": {
- "owner-id": {
- "$ref": "#/$defs/common/owner-id",
- "required": [],
- "format": "string"
- },
- "email": {
- "$ref": "#/$defs/contact/email",
- "required": [],
- "format": "string"
- },
- "first-name": {
- "$ref": "#/$defs/contact/first-name",
- "required": [],
- "format": "string"
- },
- "last-name": {
- "$ref": "#/$defs/contact/last-name",
- "required": [],
- "format": "string"
- },
- "phone-number": {
- "$ref": "#/$defs/contact/phone-number",
- "required": [],
- "format": "string"
- },
- "company": {
- "$ref": "#/$defs/contact/company",
- "required": [],
- "format": "string"
- },
- "job-title": {
- "$ref": "#/$defs/contact/job-title",
- "required": [],
- "format": "string"
- },
- "lifecycle-stage": {
- "$ref": "#/$defs/contact/lifecycle-stage",
- "required": [],
- "format": "string"
- },
- "lead-status": {
- "$ref": "#/$defs/contact/lead-status",
- "required": [],
- "format": "string"
- },
- "contact-id": {
- "description": "Contact ID.",
- "uiOrder": 9,
- "required": [],
- "title": "Contact ID",
- "format": "string"
- }
- },
- "required": [
- "contact-id"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_CONTACT": {
- "shortDescription": "Create new contact",
- "input": {
- "description": "Contact information.",
- "uiOrder": 0,
- "properties": {
- "owner-id": {
- "$ref": "#/$defs/common/owner-id",
- "acceptFormats": [
- "string"
- ]
- },
- "email": {
- "$ref": "#/$defs/contact/email",
- "acceptFormats": [
- "string"
- ]
- },
- "first-name": {
- "$ref": "#/$defs/contact/first-name",
- "acceptFormats": [
- "string"
- ]
- },
- "last-name": {
- "$ref": "#/$defs/contact/last-name",
- "acceptFormats": [
- "string"
- ]
- },
- "phone-number": {
- "$ref": "#/$defs/contact/phone-number",
- "acceptFormats": [
- "string"
- ]
- },
- "company": {
- "$ref": "#/$defs/contact/company",
- "acceptFormats": [
- "string"
- ]
- },
- "job-title": {
- "$ref": "#/$defs/contact/job-title",
- "acceptFormats": [
- "string"
- ]
- },
- "lifecycle-stage": {
- "$ref": "#/$defs/contact/lifecycle-stage",
- "acceptFormats": [
- "string"
- ]
- },
- "lead-status": {
- "$ref": "#/$defs/contact/lead-status",
- "acceptFormats": [
- "string"
- ]
- },
- "create-deals-association": {
- "$ref": "#/$defs/common/create-deals-association",
- "uiOrder": 9
- },
- "create-companies-association": {
- "$ref": "#/$defs/common/create-companies-association",
- "uiOrder": 10
- },
- "create-tickets-association": {
- "$ref": "#/$defs/common/create-tickets-association",
- "uiOrder": 11
- }
- },
- "required": [
- "email"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Obtain contact ID.",
- "uiOrder": 0,
- "properties": {
- "contact-id": {
- "description": "Contact ID.",
- "uiOrder": 0,
- "required": [],
- "title": "Contact ID",
- "format": "string"
- }
- },
- "required": [
- "contact-id"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_DEAL": {
- "shortDescription": "Get deal information using deal ID",
- "input": {
- "description": "Input deal ID.",
- "uiOrder": 0,
- "properties": {
- "deal-id": {
- "description": "Input deal ID.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Deal ID",
- "format": "string"
- }
- },
- "required": [
- "deal-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Deal information.",
- "uiOrder": 0,
- "properties": {
- "owner-id": {
- "$ref": "#/$defs/common/owner-id",
- "required": [],
- "format": "string"
- },
- "deal-name": {
- "$ref": "#/$defs/deal/deal-name",
- "required": [],
- "format": "string"
- },
- "pipeline": {
- "$ref": "#/$defs/deal/pipeline",
- "required": [],
- "format": "string"
- },
- "deal-stage": {
- "$ref": "#/$defs/deal/deal-stage",
- "required": [],
- "format": "string"
- },
- "amount": {
- "$ref": "#/$defs/deal/amount",
- "required": [],
- "format": "number"
- },
- "deal-type": {
- "$ref": "#/$defs/deal/deal-type",
- "required": [],
- "format": "string"
- },
- "create-date": {
- "$ref": "#/$defs/deal/create-date",
- "required": [],
- "format": "string"
- },
- "close-date": {
- "$ref": "#/$defs/deal/close-date",
- "required": [],
- "format": "string"
- },
- "associated-contact-ids": {
- "$ref": "#/$defs/common/associated-contact-ids",
- "uiOrder": 8
- }
- },
- "required": [
- "deal-name",
- "pipeline",
- "deal-stage"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_DEAL": {
- "shortDescription": "Create new deal",
- "input": {
- "description": "Deal information.",
- "uiOrder": 0,
- "properties": {
- "owner-id": {
- "$ref": "#/$defs/common/owner-id",
- "acceptFormats": [
- "string"
- ]
- },
- "deal-name": {
- "$ref": "#/$defs/deal/deal-name",
- "acceptFormats": [
- "string"
- ]
- },
- "pipeline": {
- "$ref": "#/$defs/deal/pipeline",
- "acceptFormats": [
- "string"
- ]
- },
- "deal-stage": {
- "$ref": "#/$defs/deal/deal-stage",
- "acceptFormats": [
- "string"
- ]
- },
- "amount": {
- "$ref": "#/$defs/deal/amount",
- "acceptFormats": [
- "number"
- ]
- },
- "deal-type": {
- "$ref": "#/$defs/deal/deal-type",
- "acceptFormats": [
- "string"
- ]
- },
- "close-date": {
- "$ref": "#/$defs/deal/close-date",
- "acceptFormats": [
- "string"
- ]
- },
- "create-contacts-association": {
- "$ref": "#/$defs/common/create-contacts-association",
- "uiOrder": 7
- }
- },
- "required": [
- "deal-name",
- "pipeline",
- "deal-stage"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Obtain deal ID.",
- "uiOrder": 0,
- "properties": {
- "deal-id": {
- "description": "Deal ID.",
- "uiOrder": 0,
- "required": [],
- "title": "Deal ID",
- "format": "string"
- }
- },
- "required": [
- "deal-id"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPDATE_DEAL": {
- "shortDescription": "Update existing deal",
- "input": {
- "description": "Deal information.",
- "uiOrder": 0,
- "properties": {
- "deal-id": {
- "description": "Input deal ID.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Deal ID",
- "format": "string"
- },
- "owner-id": {
- "$ref": "#/$defs/common/owner-id",
- "acceptFormats": [
- "string"
- ]
- },
- "deal-name": {
- "$ref": "#/$defs/deal/deal-name",
- "acceptFormats": [
- "string"
- ]
- },
- "pipeline": {
- "$ref": "#/$defs/deal/pipeline",
- "acceptFormats": [
- "string"
- ]
- },
- "deal-stage": {
- "$ref": "#/$defs/deal/deal-stage",
- "acceptFormats": [
- "string"
- ]
- },
- "amount": {
- "$ref": "#/$defs/deal/amount",
- "acceptFormats": [
- "number"
- ]
- },
- "deal-type": {
- "$ref": "#/$defs/deal/deal-type",
- "acceptFormats": [
- "string"
- ]
- },
- "close-date": {
- "$ref": "#/$defs/deal/close-date",
- "acceptFormats": [
- "string"
- ]
- },
- "create-contacts-association": {
- "$ref": "#/$defs/common/create-contacts-association",
- "uiOrder": 7
- }
- },
- "required": [
- "deal-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Obtain user ID that updated the deal and its update time.",
- "uiOrder": 0,
- "properties": {
- "updated-by-user-id": {
- "description": "User ID that updated the deal.",
- "uiOrder": 0,
- "required": [],
- "title": "Updated By User ID",
- "format": "string"
- },
- "updated-at": {
- "description": "The time when the deal was updated.",
- "uiOrder": 1,
- "required": [],
- "title": "Updated At",
- "format": "string"
- }
- },
- "required": [
- "updated-by-user-id",
- "updated-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_COMPANY": {
- "shortDescription": "Get company information using company ID",
- "input": {
- "description": "Input company ID.",
- "uiOrder": 0,
- "properties": {
- "company-id": {
- "description": "Input company ID.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Company ID",
- "format": "string"
- }
- },
- "required": [
- "company-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Company information.",
- "uiOrder": 0,
- "properties": {
- "owner-id": {
- "$ref": "#/$defs/common/owner-id",
- "required": [],
- "format": "string"
- },
- "company-name": {
- "$ref": "#/$defs/company/company-name",
- "required": [],
- "format": "string"
- },
- "company-domain": {
- "$ref": "#/$defs/company/company-domain",
- "required": [],
- "format": "string"
- },
- "description": {
- "$ref": "#/$defs/company/description",
- "required": [],
- "format": "string"
- },
- "phone-number": {
- "$ref": "#/$defs/company/phone-number",
- "required": [],
- "format": "string"
- },
- "industry": {
- "$ref": "#/$defs/company/industry",
- "required": [],
- "format": "string"
- },
- "company-type": {
- "$ref": "#/$defs/company/company-type",
- "required": [],
- "format": "string"
- },
- "city": {
- "$ref": "#/$defs/company/city",
- "required": [],
- "format": "string"
- },
- "state": {
- "$ref": "#/$defs/company/state",
- "required": [],
- "format": "string"
- },
- "country": {
- "$ref": "#/$defs/company/country",
- "required": [],
- "format": "string"
- },
- "postal-code,": {
- "$ref": "#/$defs/company/postal-code",
- "required": [],
- "format": "string"
- },
- "time-zone": {
- "$ref": "#/$defs/company/time-zone",
- "required": [],
- "format": "string"
- },
- "annual-revenue": {
- "$ref": "#/$defs/company/annual-revenue",
- "required": [],
- "format": "number"
- },
- "total-revenue": {
- "$ref": "#/$defs/company/total-revenue",
- "required": [],
- "format": "number"
- },
- "linkedin-page": {
- "$ref": "#/$defs/company/linkedin-page",
- "required": [],
- "format": "string"
- },
- "associated-contact-ids": {
- "$ref": "#/$defs/common/associated-contact-ids",
- "uiOrder": 15
- }
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_COMPANY": {
- "shortDescription": "Create new company",
- "input": {
- "description": "Company information.",
- "uiOrder": 0,
- "properties": {
- "owner-id": {
- "$ref": "#/$defs/common/owner-id",
- "acceptFormats": [
- "string"
- ]
- },
- "company-name": {
- "$ref": "#/$defs/company/company-name",
- "acceptFormats": [
- "string"
- ]
- },
- "company-domain": {
- "$ref": "#/$defs/company/company-domain",
- "acceptFormats": [
- "string"
- ]
- },
- "description": {
- "$ref": "#/$defs/company/description",
- "acceptFormats": [
- "string"
- ]
- },
- "phone-number": {
- "$ref": "#/$defs/company/phone-number",
- "acceptFormats": [
- "string"
- ]
- },
- "industry": {
- "$ref": "#/$defs/company/industry",
- "acceptFormats": [
- "string"
- ]
- },
- "company-type": {
- "$ref": "#/$defs/company/company-type",
- "acceptFormats": [
- "string"
- ]
- },
- "city": {
- "$ref": "#/$defs/company/city",
- "acceptFormats": [
- "string"
- ]
- },
- "state": {
- "$ref": "#/$defs/company/state",
- "acceptFormats": [
- "string"
- ]
- },
- "country": {
- "$ref": "#/$defs/company/country",
- "acceptFormats": [
- "string"
- ]
- },
- "postal-code,": {
- "$ref": "#/$defs/company/postal-code",
- "acceptFormats": [
- "string"
- ]
- },
- "time-zone": {
- "$ref": "#/$defs/company/time-zone",
- "acceptFormats": [
- "string"
- ]
- },
- "annual-revenue": {
- "$ref": "#/$defs/company/annual-revenue",
- "acceptFormats": [
- "number"
- ]
- },
- "linkedin-page": {
- "$ref": "#/$defs/company/linkedin-page",
- "acceptFormats": [
- "string"
- ]
- },
- "create-contacts-association": {
- "$ref": "#/$defs/common/create-contacts-association",
- "uiOrder": 15
- }
- },
- "required": [
- "company-domain"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Obtain company ID.",
- "uiOrder": 0,
- "properties": {
- "company-id": {
- "description": "Company ID.",
- "uiOrder": 0,
- "required": [],
- "title": "Company ID",
- "format": "string"
- }
- },
- "required": [
- "company-id"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_TICKET": {
- "shortDescription": "Get ticket information using ticket ID",
- "input": {
- "description": "Input ticket ID.",
- "uiOrder": 0,
- "properties": {
- "ticket-id": {
- "description": "Input ticket ID.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Ticket ID",
- "format": "string"
- }
- },
- "required": [
- "ticket-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Ticket information.",
- "uiOrder": 0,
- "properties": {
- "owner-id": {
- "$ref": "#/$defs/common/owner-id",
- "required": [],
- "format": "string"
- },
- "ticket-name": {
- "$ref": "#/$defs/ticket/ticket-name",
- "required": [],
- "format": "string"
- },
- "ticket-status": {
- "$ref": "#/$defs/ticket/ticket-status",
- "required": [],
- "format": "string"
- },
- "pipeline": {
- "$ref": "#/$defs/ticket/pipeline",
- "required": [],
- "format": "string"
- },
- "categories": {
- "$ref": "#/$defs/ticket/categories",
- "items": {
- "title": "Category Value",
- "description": "Category value.",
- "format": "string"
- },
- "format": "array"
- },
- "priority": {
- "$ref": "#/$defs/ticket/priority",
- "required": [],
- "format": "string"
- },
- "source": {
- "$ref": "#/$defs/ticket/source",
- "required": [],
- "format": "string"
- },
- "record-source": {
- "$ref": "#/$defs/ticket/record-source",
- "required": [],
- "format": "string"
- },
- "create-date": {
- "$ref": "#/$defs/ticket/create-date",
- "required": [],
- "format": "string"
- },
- "last-modified-date": {
- "$ref": "#/$defs/ticket/last-modified-date",
- "required": [],
- "format": "string"
- },
- "associated-contact-ids": {
- "$ref": "#/$defs/common/associated-contact-ids",
- "uiOrder": 10
- }
- },
- "required": [
- "ticket-name",
- "ticket-status",
- "pipeline"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_TICKET": {
- "shortDescription": "Create new ticket",
- "input": {
- "description": "Ticket information.",
- "uiOrder": 0,
- "properties": {
- "owner-id": {
- "$ref": "#/$defs/common/owner-id",
- "acceptFormats": [
- "string"
- ]
- },
- "ticket-name": {
- "$ref": "#/$defs/ticket/ticket-name",
- "acceptFormats": [
- "string"
- ]
- },
- "ticket-status": {
- "$ref": "#/$defs/ticket/ticket-status",
- "acceptFormats": [
- "string"
- ]
- },
- "pipeline": {
- "$ref": "#/$defs/ticket/pipeline",
- "acceptFormats": [
- "string"
- ]
- },
- "categories": {
- "$ref": "#/$defs/ticket/categories",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- }
- },
- "priority": {
- "$ref": "#/$defs/ticket/priority",
- "acceptFormats": [
- "string"
- ]
- },
- "source": {
- "$ref": "#/$defs/ticket/source",
- "acceptFormats": [
- "string"
- ]
- },
- "create-contacts-association": {
- "$ref": "#/$defs/common/create-contacts-association",
- "uiOrder": 7
- }
- },
- "required": [
- "ticket-name",
- "ticket-status",
- "pipeline"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Obtain ticket ID.",
- "uiOrder": 0,
- "properties": {
- "ticket-id": {
- "description": "Ticket ID.",
- "uiOrder": 0,
- "required": [],
- "title": "Ticket ID",
- "format": "string"
- }
- },
- "required": [
- "ticket-id"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPDATE_TICKET": {
- "shortDescription": "Update existing ticket",
- "input": {
- "description": "Ticket information.",
- "uiOrder": 0,
- "properties": {
- "ticket-id": {
- "description": "Input ticket ID.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Ticket ID",
- "format": "string"
- },
- "owner-id": {
- "$ref": "#/$defs/common/owner-id",
- "acceptFormats": [
- "string"
- ]
- },
- "ticket-name": {
- "$ref": "#/$defs/ticket/ticket-name",
- "acceptFormats": [
- "string"
- ]
- },
- "ticket-status": {
- "$ref": "#/$defs/ticket/ticket-status",
- "acceptFormats": [
- "string"
- ]
- },
- "pipeline": {
- "$ref": "#/$defs/ticket/pipeline",
- "acceptFormats": [
- "string"
- ]
- },
- "categories": {
- "$ref": "#/$defs/ticket/categories",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- }
- },
- "priority": {
- "$ref": "#/$defs/ticket/priority",
- "acceptFormats": [
- "string"
- ]
- },
- "source": {
- "$ref": "#/$defs/ticket/source",
- "acceptFormats": [
- "string"
- ]
- },
- "create-contacts-association": {
- "$ref": "#/$defs/common/create-contacts-association",
- "uiOrder": 7
- }
- },
- "required": [
- "ticket-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Update time.",
- "uiOrder": 0,
- "properties": {
- "updated-at": {
- "description": "The time when the ticket was updated.",
- "uiOrder": 0,
- "required": [],
- "title": "Updated At",
- "format": "string"
- }
- },
- "required": [
- "updated-at"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_THREAD": {
- "shortDescription": "Retrieve all the messages inside a thread (conversation inbox). The messages will be sorted from most recent to least recent. Note: This task uses Conversation API from HubSpot, which is still in BETA.",
- "input": {
- "description": "Input thread ID.",
- "uiOrder": 0,
- "properties": {
- "thread-id": {
- "description": "Input thread ID.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Thread ID",
- "format": "string"
- }
- },
- "required": [
- "thread-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "All messages in the thread.",
- "uiOrder": 0,
- "properties": {
- "results": {
- "description": "An array of messages.",
- "uiOrder": 0,
- "title": "Messages",
- "items": {
- "title": "Messages Details",
- "properties": {
- "created-at": {
- "description": "message to start a conversation.",
- "uiOrder": 0,
- "title": "Start Conversation Message",
- "format": "string"
- },
- "sender": {
- "description": "Sender's information.",
- "uiOrder": 1,
- "title": "Sender",
- "properties": {
- "sender-name": {
- "description": "The name of the sender.",
- "uiOrder": 0,
- "title": "Name",
- "format": "string"
- },
- "sender-type": {
- "description": "Specify the category of sender information.",
- "uiOrder": 1,
- "title": "Type",
- "format": "string"
- },
- "sender-value": {
- "description": "Contains the actual sender information (e.g.: email address).",
- "uiOrder": 2,
- "title": "Value",
- "format": "string"
- },
- "sender-actor-id": {
- "description": "The actor ID of the sender.",
- "uiOrder": 3,
- "title": "Actor ID",
- "format": "string"
- }
- },
- "required": [
- "sender-actor-id"
- ],
- "format": "object"
- },
- "recipients": {
- "description": "Recipients' information.",
- "uiOrder": 2,
- "title": "Recipients",
- "items": {
- "title": "Recipient's information",
- "properties": {
- "name": {
- "description": "The name of the recipient.",
- "uiOrder": 0,
- "title": "Name",
- "format": "string"
- },
- "value": {
- "description": "Contains the actual recipient information (e.g.: email address).",
- "uiOrder": 2,
- "title": "Value",
- "format": "string"
- },
- "type": {
- "description": "Specify the category of recipient information.",
- "uiOrder": 1,
- "title": "Type",
- "format": "string"
- }
- },
- "required": [],
- "format": "object"
- },
- "format": "array"
- },
- "text": {
- "description": "The content of the message.",
- "uiOrder": 3,
- "required": [],
- "title": "Text",
- "format": "string"
- },
- "subject": {
- "description": "The subject of the message.",
- "uiOrder": 4,
- "required": [],
- "title": "Subject",
- "format": "string"
- },
- "channel-id": {
- "description": "The ID of a generic channel returned from the channels endpoint, like 1000 for live chat, 1001 for Facebook Messenger, 1002 for email, etc.",
- "uiOrder": 5,
- "required": [],
- "title": "Channel ID",
- "format": "string"
- },
- "channel-account-id": {
- "description": "The ID of an account that is part of the channel-id channel.",
- "uiOrder": 6,
- "required": [],
- "title": "Channel Account ID",
- "format": "string"
- }
- },
- "required": [
- "created-at",
- "text",
- "channel-id",
- "channel-account-id"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "no-of-messages": {
- "description": "The number of messages in a thread.",
- "uiOrder": 1,
- "required": [],
- "title": "Number of Messages",
- "format": "integer"
- }
- },
- "required": [
- "results",
- "no-of-messages"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_INSERT_MESSAGE": {
- "shortDescription": "Insert message into a thread (only support email thread)",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "thread-id": {
- "description": "Input thread ID.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Thread ID",
- "format": "string"
- },
- "sender-actor-id": {
- "description": "Input sender actor id. Example: A-12345678. To obtain this, it is recommended to use and copy the 'Get Thread task' sender output. For [more information](https://developers.hubspot.com/beta-docs/guides/api/conversations/inbox-and-messages#get-actors) about actor id.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Sender Actor ID",
- "format": "string"
- },
- "recipients": {
- "description": "Recipients of the message.",
- "title": "Recipients",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 2,
- "items": {
- "format": "string"
- },
- "format": "array"
- },
- "channel-account-id": {
- "description": "The ID of an account that is part of the channel-id channel. On an existing thread, it is recommended to copy channel-account-id of the most recent message on the thread.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Channel Account ID",
- "format": "string"
- },
- "subject": {
- "description": "The subject of the message.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Subject",
- "format": "string"
- },
- "text": {
- "description": "The body of the message.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 5,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "thread-id",
- "sender-actor-id",
- "recipients",
- "channel-account-id",
- "subject",
- "text"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Status of the message.",
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "The message status.",
- "uiOrder": 0,
- "required": [],
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_RETRIEVE_ASSOCIATION": {
- "shortDescription": "Get the object IDs associated with contact ID (contact->objects). If you are trying to do the opposite (object->contacts), it is possible using the other tasks. Example: Go to get deal task to obtain deal->contacts. Remember to check that the contact ID you input exists, because there won't be an error message if the contact ID doesn't exist.",
- "input": {
- "description": "Contact ID and object type (CRM objects or Thread).",
- "uiOrder": 0,
- "properties": {
- "contact-id": {
- "description": "Input contact ID.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Contact ID",
- "format": "string"
- },
- "object-type": {
- "enum": [
- "Deals",
- "Companies",
- "Tickets",
- "Threads"
- ],
- "example": "Deals",
- "description": "Input object type (CRM objects or 'Threads'). Note: CRM objects include 'Deals', 'Companies', 'Tickets', etc.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Object Type",
- "format": "string"
- }
- },
- "required": [
- "contact-id",
- "object-type"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "All object IDs.",
- "uiOrder": 0,
- "properties": {
- "object-ids": {
- "description": "An array of object ID associated with the contact.",
- "uiOrder": 0,
- "title": "Object ID Array ",
- "items": {
- "title": "Object ID",
- "description": "The object ID associated with the contact.",
- "format": "string"
- },
- "format": "array"
- },
- "object-ids-length": {
- "description": "The number of object IDs.",
- "uiOrder": 1,
- "required": [],
- "title": "Object IDs Length",
- "format": "integer"
- }
- },
- "required": [
- "object-ids",
- "object-ids-length"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_OWNER": {
- "shortDescription": "Get information about HubSpot owner using either owner ID or user ID. For more information about owner, please go to [here](https://developers.hubspot.com/docs/api/crm/owners)",
- "input": {
- "description": "Owner information and type.",
- "uiOrder": 0,
- "properties": {
- "id-type": {
- "enum": [
- "Owner ID",
- "User ID"
- ],
- "example": "Owner ID",
- "description": "Specify the type of ID you will use to get owner's information.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "ID Type",
- "format": "string"
- },
- "id": {
- "description": "Can either be owner ID or user ID; according to the ID type you selected.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- }
- },
- "required": [
- "id-type",
- "id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Owner's detailed information.",
- "uiOrder": 0,
- "properties": {
- "first-name": {
- "description": "First name.",
- "uiOrder": 0,
- "required": [],
- "title": "First Name",
- "format": "string"
- },
- "last-name": {
- "description": "Last name.",
- "uiOrder": 1,
- "required": [],
- "title": "Last Name",
- "format": "string"
- },
- "email": {
- "description": "Email.",
- "uiOrder": 2,
- "required": [],
- "title": "Email",
- "format": "string"
- },
- "owner-id": {
- "description": "Owner ID. Usually used to associate the owner with other objects.",
- "uiOrder": 3,
- "required": [],
- "title": "Owner ID",
- "format": "string"
- },
- "user-id": {
- "description": "User ID. Usually used to indicate the owner who performed the action. User ID can be seen in Update Deal task output.",
- "uiOrder": 4,
- "required": [],
- "title": "User ID",
- "format": "string"
- },
- "teams": {
- "description": "The owner's teams information.",
- "uiOrder": 5,
- "title": "Teams",
- "items": {
- "title": "The owner's team information",
- "properties": {
- "team-name": {
- "description": "The name of the team.",
- "uiOrder": 0,
- "title": "Team Name",
- "format": "string"
- },
- "team-id": {
- "description": "The ID of the team.",
- "uiOrder": 1,
- "title": "Team ID",
- "format": "string"
- },
- "team-primary": {
- "description": "Indicate whether this team is the primary team of the owner.",
- "uiOrder": 2,
- "title": "Team Primary",
- "format": "boolean"
- }
- },
- "required": [
- "team-name",
- "team-id",
- "team-primary"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "created-at": {
- "description": "Created at.",
- "uiOrder": 6,
- "required": [],
- "title": "Created At",
- "format": "string"
- },
- "updated-at": {
- "description": "Updated at.",
- "uiOrder": 7,
- "required": [],
- "title": "Updated At",
- "format": "string"
- },
- "archived": {
- "description": "Archived.",
- "uiOrder": 8,
- "required": [],
- "title": "Archived",
- "format": "boolean"
- }
- },
- "required": [
- "first-name",
- "last-name",
- "email",
- "owner-id",
- "user-id",
- "created-at",
- "updated-at",
- "archived"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_ALL": {
- "shortDescription": "Get all the IDs for a specific object (e.g. all contact IDs)",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "object-type": {
- "enum": [
- "Contacts",
- "Deals",
- "Companies",
- "Tickets",
- "Threads",
- "Owners"
- ],
- "example": "Contacts",
- "description": "The object which you want to get all IDs for.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Object Type",
- "format": "string"
- }
- },
- "required": [
- "object-type"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "All the IDs of the object.",
- "uiOrder": 0,
- "properties": {
- "object-ids": {
- "description": "An array of object ID.",
- "uiOrder": 0,
- "title": "Object ID Array ",
- "items": {
- "title": "Object ID",
- "description": "Object ID.",
- "format": "string"
- },
- "format": "array"
- },
- "object-ids-length": {
- "description": "The number of object IDs.",
- "uiOrder": 1,
- "required": [],
- "title": "Object IDs Length",
- "format": "integer"
- }
- },
- "required": [
- "object-ids",
- "object-ids-length"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/hubspot/v0/config/tasks.yaml b/pkg/component/application/hubspot/v0/config/tasks.yaml
new file mode 100644
index 000000000..8d284f1e4
--- /dev/null
+++ b/pkg/component/application/hubspot/v0/config/tasks.yaml
@@ -0,0 +1,1402 @@
+$defs:
+ common:
+ owner-id:
+ description: The user who is assigned to the object.
+ title: Owner ID
+ uiOrder: 0
+ format: string
+ associated-contact-ids:
+ description: Contact IDs associated with the object.
+ title: Associated Contact IDs
+ items:
+ title: Associated Contact ID
+ description: Contact ID associated with the object.
+ format: string
+ format: array
+ create-contacts-association:
+ description: Existing contact IDs to be associated with the object.
+ title: Create Object -> Contact Association using contact IDs
+ acceptFormats:
+ - array
+ items:
+ format: string
+ format: array
+ create-deals-association:
+ description: Existing deal IDs to be associated with the object.
+ title: Create Object -> Deal Association using deal IDs
+ acceptFormats:
+ - array
+ items:
+ format: string
+ format: array
+ create-companies-association:
+ description: Existing company IDs to be associated with the object.
+ title: Create Object -> Company Association using company IDs
+ acceptFormats:
+ - array
+ items:
+ format: string
+ format: array
+ create-tickets-association:
+ description: Existing ticket IDs to be associated with the object.
+ title: Create Object -> Ticket Association using ticket IDs
+ acceptFormats:
+ - array
+ items:
+ format: string
+ format: array
+ contact:
+ email:
+ description: Email address.
+ uiOrder: 1
+ title: Email Address
+ format: string
+ first-name:
+ description: First name.
+ uiOrder: 2
+ title: First Name
+ format: string
+ last-name:
+ description: Last name.
+ uiOrder: 3
+ title: Last Name
+ format: string
+ phone-number:
+ description: 'Phone number. If you plan to use the number formatting feature
+ in HubSpot, use country code + phone number. Example: +886xxxxxxxxx.'
+ uiOrder: 4
+ title: Phone Number
+ format: string
+ company:
+ description: Company.
+ uiOrder: 5
+ title: Company
+ format: string
+ job-title:
+ description: Job title.
+ uiOrder: 6
+ title: Job Title
+ format: string
+ lifecycle-stage:
+ description: 'Lifecycle stages are used to track how contacts or companies move
+ forward in your process. Default format is in small letters, all words are
+ combined. Example: salesqualifiedlead. However, remember to check internal
+ value for custom fields.'
+ uiOrder: 7
+ title: Lifecycle Stage
+ format: string
+ lead-status:
+ description: 'The contact''s sales, prospecting or outreach status. Default
+ format is in capital letters, with _ as space. Example: IN_PROGRESS. However,
+ remember to check internal value for custom fields.'
+ uiOrder: 8
+ title: Lead Status
+ format: string
+ deal:
+ deal-name:
+ description: Deal name.
+ uiOrder: 1
+ title: Deal Name
+ format: string
+ pipeline:
+ description: A pipeline is the place where you document and manage how your
+ prospects move through the steps of your sales process. HubSpot uses interval
+ value rather than the name displayed in the view.
+ uiOrder: 2
+ title: Pipeline
+ format: string
+ deal-stage:
+ description: 'Deal stages allow you to categorize and track the progress of
+ the deals that you are working on. Default format is in small letters, all
+ words are combined. Example: qualifiedtobuy. However, remember to check internal
+ value for custom fields.'
+ uiOrder: 3
+ title: Deal Stage
+ format: string
+ amount:
+ description: The total amount of the deal.
+ uiOrder: 4
+ title: Amount
+ format: number
+ deal-type:
+ description: 'The type of deal. Default format is in small letters, all words
+ are combined. Example: newbusiness. However, remember to check internal value
+ for custom fields.'
+ uiOrder: 5
+ title: Deal Type
+ format: string
+ close-date:
+ description: 'Date the deal was closed. Set automatically by HubSpot. Format
+ is in ISO 8601. Example: 2024-07-01T11:47:40.388Z.'
+ uiOrder: 6
+ title: Close Date
+ format: string
+ create-date:
+ description: 'Create date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z.'
+ uiOrder: 7
+ title: Create Date
+ format: string
+ company:
+ company-name:
+ description: Company name.
+ uiOrder: 1
+ title: Company Name
+ format: string
+ company-domain:
+ description: The domain name of the company.
+ uiOrder: 2
+ title: Company Domain
+ format: string
+ description:
+ description: Description of the company.
+ uiOrder: 3
+ title: Description
+ format: string
+ phone-number:
+ description: 'Phone number of the company. If you plan to use the number formatting
+ feature in HubSpot, use country code + phone number. Example: +886xxxxxxxxx.'
+ uiOrder: 4
+ title: Phone Number
+ format: string
+ industry:
+ description: 'The industry the company belongs to. Default format is in capital
+ letters, with _ as space. Example: BROADCAST_MEDIA.'
+ uiOrder: 5
+ title: Industry
+ format: string
+ company-type:
+ description: 'Type of company. Default format is capital letter. Example: RESELLER.'
+ uiOrder: 6
+ title: Company Type
+ format: string
+ city:
+ description: City.
+ uiOrder: 7
+ title: City
+ format: string
+ state:
+ description: State.
+ uiOrder: 8
+ title: State
+ format: string
+ country:
+ description: Country.
+ uiOrder: 9
+ title: Country
+ format: string
+ postal-code:
+ description: Postal code.
+ uiOrder: 10
+ title: Postal Code
+ format: string
+ time-zone:
+ description: Time zone.
+ uiOrder: 11
+ title: Time Zone
+ format: string
+ annual-revenue:
+ description: Annual revenue.
+ uiOrder: 12
+ title: Annual Revenue
+ format: number
+ total-revenue:
+ description: Total revenue. Calculated automatically by HubSpot.
+ uiOrder: 13
+ title: Total Revenue
+ format: number
+ linkedin-page:
+ description: Linkedin page of the company.
+ uiOrder: 14
+ title: Linkedin Page
+ format: string
+ ticket:
+ ticket-name:
+ description: Ticket name.
+ uiOrder: 1
+ title: Ticket Name
+ format: string
+ ticket-status:
+ description: 'The pipeline stage that contains this ticket. Default format is
+ number. Example: 1. However, remember to check internal value for custom fields.
+ Note: In Instill AI, ticket-status is displayed as string because of the possible
+ custom internal value.'
+ uiOrder: 2
+ title: Ticket Status
+ format: string
+ pipeline:
+ description: A pipeline organizes and tracks the progression of tickets through
+ various stages of resolution within your support process. HubSpot uses interval
+ value rather than the name displayed in the view.
+ uiOrder: 3
+ title: Pipeline
+ format: string
+ categories:
+ description: 'The main reason customer reached out for help. Default format
+ is in capital letters. Example: BILLING_ISSUE. However, remember to check
+ internal value for custom fields.'
+ uiOrder: 4
+ title: Categories
+ format: array
+ priority:
+ description: 'The level of attention needed on the ticket. Default format is
+ in capital letters. Example: MEDIUM. However, remember to check internal value
+ for custom fields.'
+ uiOrder: 5
+ title: Priority
+ format: string
+ source:
+ description: 'Channel where ticket was originally submitted. Default format
+ is in capital letters. Example: EMAIL.'
+ uiOrder: 6
+ title: Source
+ format: string
+ record-source:
+ description: How this record was created.
+ uiOrder: 7
+ title: Record Source
+ format: string
+ create-date:
+ description: 'Create date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z.'
+ uiOrder: 8
+ title: Create Date
+ format: string
+ last-modified-date:
+ description: 'Last modified date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z.'
+ uiOrder: 9
+ title: Last Modified Date
+ format: string
+TASK_GET_CONTACT:
+ shortDescription: Get contact information using contact ID or Email
+ input:
+ description: Input contact ID or email.
+ uiOrder: 0
+ properties:
+ contact-id-or-email:
+ description: Input contact ID or email. If the input has @, it will search
+ the contact using email.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Contact ID or Email
+ format: string
+ required:
+ - contact-id-or-email
+ title: Input
+ format: object
+ output:
+ description: Contact information.
+ uiOrder: 0
+ properties:
+ owner-id:
+ $ref: '#/$defs/common/owner-id'
+ required: []
+ format: string
+ email:
+ $ref: '#/$defs/contact/email'
+ required: []
+ format: string
+ first-name:
+ $ref: '#/$defs/contact/first-name'
+ required: []
+ format: string
+ last-name:
+ $ref: '#/$defs/contact/last-name'
+ required: []
+ format: string
+ phone-number:
+ $ref: '#/$defs/contact/phone-number'
+ required: []
+ format: string
+ company:
+ $ref: '#/$defs/contact/company'
+ required: []
+ format: string
+ job-title:
+ $ref: '#/$defs/contact/job-title'
+ required: []
+ format: string
+ lifecycle-stage:
+ $ref: '#/$defs/contact/lifecycle-stage'
+ required: []
+ format: string
+ lead-status:
+ $ref: '#/$defs/contact/lead-status'
+ required: []
+ format: string
+ contact-id:
+ description: Contact ID.
+ uiOrder: 9
+ required: []
+ title: Contact ID
+ format: string
+ required:
+ - contact-id
+ title: Output
+ format: object
+TASK_CREATE_CONTACT:
+ shortDescription: Create new contact
+ input:
+ description: Contact information.
+ uiOrder: 0
+ properties:
+ owner-id:
+ $ref: '#/$defs/common/owner-id'
+ acceptFormats:
+ - string
+ email:
+ $ref: '#/$defs/contact/email'
+ acceptFormats:
+ - string
+ first-name:
+ $ref: '#/$defs/contact/first-name'
+ acceptFormats:
+ - string
+ last-name:
+ $ref: '#/$defs/contact/last-name'
+ acceptFormats:
+ - string
+ phone-number:
+ $ref: '#/$defs/contact/phone-number'
+ acceptFormats:
+ - string
+ company:
+ $ref: '#/$defs/contact/company'
+ acceptFormats:
+ - string
+ job-title:
+ $ref: '#/$defs/contact/job-title'
+ acceptFormats:
+ - string
+ lifecycle-stage:
+ $ref: '#/$defs/contact/lifecycle-stage'
+ acceptFormats:
+ - string
+ lead-status:
+ $ref: '#/$defs/contact/lead-status'
+ acceptFormats:
+ - string
+ create-deals-association:
+ $ref: '#/$defs/common/create-deals-association'
+ uiOrder: 9
+ create-companies-association:
+ $ref: '#/$defs/common/create-companies-association'
+ uiOrder: 10
+ create-tickets-association:
+ $ref: '#/$defs/common/create-tickets-association'
+ uiOrder: 11
+ required:
+ - email
+ title: Input
+ format: object
+ output:
+ description: Obtain contact ID.
+ uiOrder: 0
+ properties:
+ contact-id:
+ description: Contact ID.
+ uiOrder: 0
+ required: []
+ title: Contact ID
+ format: string
+ required:
+ - contact-id
+ title: Output
+ format: object
+TASK_GET_DEAL:
+ shortDescription: Get deal information using deal ID
+ input:
+ description: Input deal ID.
+ uiOrder: 0
+ properties:
+ deal-id:
+ description: Input deal ID.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Deal ID
+ format: string
+ required:
+ - deal-id
+ title: Input
+ format: object
+ output:
+ description: Deal information.
+ uiOrder: 0
+ properties:
+ owner-id:
+ $ref: '#/$defs/common/owner-id'
+ required: []
+ format: string
+ deal-name:
+ $ref: '#/$defs/deal/deal-name'
+ required: []
+ format: string
+ pipeline:
+ $ref: '#/$defs/deal/pipeline'
+ required: []
+ format: string
+ deal-stage:
+ $ref: '#/$defs/deal/deal-stage'
+ required: []
+ format: string
+ amount:
+ $ref: '#/$defs/deal/amount'
+ required: []
+ format: number
+ deal-type:
+ $ref: '#/$defs/deal/deal-type'
+ required: []
+ format: string
+ create-date:
+ $ref: '#/$defs/deal/create-date'
+ required: []
+ format: string
+ close-date:
+ $ref: '#/$defs/deal/close-date'
+ required: []
+ format: string
+ associated-contact-ids:
+ $ref: '#/$defs/common/associated-contact-ids'
+ uiOrder: 8
+ required:
+ - deal-name
+ - pipeline
+ - deal-stage
+ title: Output
+ format: object
+TASK_CREATE_DEAL:
+ shortDescription: Create new deal
+ input:
+ description: Deal information.
+ uiOrder: 0
+ properties:
+ owner-id:
+ $ref: '#/$defs/common/owner-id'
+ acceptFormats:
+ - string
+ deal-name:
+ $ref: '#/$defs/deal/deal-name'
+ acceptFormats:
+ - string
+ pipeline:
+ $ref: '#/$defs/deal/pipeline'
+ acceptFormats:
+ - string
+ deal-stage:
+ $ref: '#/$defs/deal/deal-stage'
+ acceptFormats:
+ - string
+ amount:
+ $ref: '#/$defs/deal/amount'
+ acceptFormats:
+ - number
+ deal-type:
+ $ref: '#/$defs/deal/deal-type'
+ acceptFormats:
+ - string
+ close-date:
+ $ref: '#/$defs/deal/close-date'
+ acceptFormats:
+ - string
+ create-contacts-association:
+ $ref: '#/$defs/common/create-contacts-association'
+ uiOrder: 7
+ required:
+ - deal-name
+ - pipeline
+ - deal-stage
+ title: Input
+ format: object
+ output:
+ description: Obtain deal ID.
+ uiOrder: 0
+ properties:
+ deal-id:
+ description: Deal ID.
+ uiOrder: 0
+ required: []
+ title: Deal ID
+ format: string
+ required:
+ - deal-id
+ title: Output
+ format: object
+TASK_UPDATE_DEAL:
+ shortDescription: Update existing deal
+ input:
+ description: Deal information.
+ uiOrder: 0
+ properties:
+ deal-id:
+ description: Input deal ID.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Deal ID
+ format: string
+ owner-id:
+ $ref: '#/$defs/common/owner-id'
+ acceptFormats:
+ - string
+ deal-name:
+ $ref: '#/$defs/deal/deal-name'
+ acceptFormats:
+ - string
+ pipeline:
+ $ref: '#/$defs/deal/pipeline'
+ acceptFormats:
+ - string
+ deal-stage:
+ $ref: '#/$defs/deal/deal-stage'
+ acceptFormats:
+ - string
+ amount:
+ $ref: '#/$defs/deal/amount'
+ acceptFormats:
+ - number
+ deal-type:
+ $ref: '#/$defs/deal/deal-type'
+ acceptFormats:
+ - string
+ close-date:
+ $ref: '#/$defs/deal/close-date'
+ acceptFormats:
+ - string
+ create-contacts-association:
+ $ref: '#/$defs/common/create-contacts-association'
+ uiOrder: 7
+ required:
+ - deal-id
+ title: Input
+ format: object
+ output:
+ description: Obtain user ID that updated the deal and its update time.
+ uiOrder: 0
+ properties:
+ updated-by-user-id:
+ description: User ID that updated the deal.
+ uiOrder: 0
+ required: []
+ title: Updated By User ID
+ format: string
+ updated-at:
+ description: The time when the deal was updated.
+ uiOrder: 1
+ required: []
+ title: Updated At
+ format: string
+ required:
+ - updated-by-user-id
+ - updated-at
+ title: Output
+ format: object
+TASK_GET_COMPANY:
+ shortDescription: Get company information using company ID
+ input:
+ description: Input company ID.
+ uiOrder: 0
+ properties:
+ company-id:
+ description: Input company ID.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Company ID
+ format: string
+ required:
+ - company-id
+ title: Input
+ format: object
+ output:
+ description: Company information.
+ uiOrder: 0
+ properties:
+ owner-id:
+ $ref: '#/$defs/common/owner-id'
+ required: []
+ format: string
+ company-name:
+ $ref: '#/$defs/company/company-name'
+ required: []
+ format: string
+ company-domain:
+ $ref: '#/$defs/company/company-domain'
+ required: []
+ format: string
+ description:
+ $ref: '#/$defs/company/description'
+ required: []
+ format: string
+ phone-number:
+ $ref: '#/$defs/company/phone-number'
+ required: []
+ format: string
+ industry:
+ $ref: '#/$defs/company/industry'
+ required: []
+ format: string
+ company-type:
+ $ref: '#/$defs/company/company-type'
+ required: []
+ format: string
+ city:
+ $ref: '#/$defs/company/city'
+ required: []
+ format: string
+ state:
+ $ref: '#/$defs/company/state'
+ required: []
+ format: string
+ country:
+ $ref: '#/$defs/company/country'
+ required: []
+ format: string
+ postal-code,:
+ $ref: '#/$defs/company/postal-code'
+ required: []
+ format: string
+ time-zone:
+ $ref: '#/$defs/company/time-zone'
+ required: []
+ format: string
+ annual-revenue:
+ $ref: '#/$defs/company/annual-revenue'
+ required: []
+ format: number
+ total-revenue:
+ $ref: '#/$defs/company/total-revenue'
+ required: []
+ format: number
+ linkedin-page:
+ $ref: '#/$defs/company/linkedin-page'
+ required: []
+ format: string
+ associated-contact-ids:
+ $ref: '#/$defs/common/associated-contact-ids'
+ uiOrder: 15
+ required: []
+ title: Output
+ format: object
+TASK_CREATE_COMPANY:
+ shortDescription: Create new company
+ input:
+ description: Company information.
+ uiOrder: 0
+ properties:
+ owner-id:
+ $ref: '#/$defs/common/owner-id'
+ acceptFormats:
+ - string
+ company-name:
+ $ref: '#/$defs/company/company-name'
+ acceptFormats:
+ - string
+ company-domain:
+ $ref: '#/$defs/company/company-domain'
+ acceptFormats:
+ - string
+ description:
+ $ref: '#/$defs/company/description'
+ acceptFormats:
+ - string
+ phone-number:
+ $ref: '#/$defs/company/phone-number'
+ acceptFormats:
+ - string
+ industry:
+ $ref: '#/$defs/company/industry'
+ acceptFormats:
+ - string
+ company-type:
+ $ref: '#/$defs/company/company-type'
+ acceptFormats:
+ - string
+ city:
+ $ref: '#/$defs/company/city'
+ acceptFormats:
+ - string
+ state:
+ $ref: '#/$defs/company/state'
+ acceptFormats:
+ - string
+ country:
+ $ref: '#/$defs/company/country'
+ acceptFormats:
+ - string
+ postal-code,:
+ $ref: '#/$defs/company/postal-code'
+ acceptFormats:
+ - string
+ time-zone:
+ $ref: '#/$defs/company/time-zone'
+ acceptFormats:
+ - string
+ annual-revenue:
+ $ref: '#/$defs/company/annual-revenue'
+ acceptFormats:
+ - number
+ linkedin-page:
+ $ref: '#/$defs/company/linkedin-page'
+ acceptFormats:
+ - string
+ create-contacts-association:
+ $ref: '#/$defs/common/create-contacts-association'
+ uiOrder: 15
+ required:
+ - company-domain
+ title: Input
+ format: object
+ output:
+ description: Obtain company ID.
+ uiOrder: 0
+ properties:
+ company-id:
+ description: Company ID.
+ uiOrder: 0
+ required: []
+ title: Company ID
+ format: string
+ required:
+ - company-id
+ title: Output
+ format: object
+TASK_GET_TICKET:
+ shortDescription: Get ticket information using ticket ID
+ input:
+ description: Input ticket ID.
+ uiOrder: 0
+ properties:
+ ticket-id:
+ description: Input ticket ID.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Ticket ID
+ format: string
+ required:
+ - ticket-id
+ title: Input
+ format: object
+ output:
+ description: Ticket information.
+ uiOrder: 0
+ properties:
+ owner-id:
+ $ref: '#/$defs/common/owner-id'
+ required: []
+ format: string
+ ticket-name:
+ $ref: '#/$defs/ticket/ticket-name'
+ required: []
+ format: string
+ ticket-status:
+ $ref: '#/$defs/ticket/ticket-status'
+ required: []
+ format: string
+ pipeline:
+ $ref: '#/$defs/ticket/pipeline'
+ required: []
+ format: string
+ categories:
+ $ref: '#/$defs/ticket/categories'
+ items:
+ title: Category Value
+ description: Category value.
+ format: string
+ format: array
+ priority:
+ $ref: '#/$defs/ticket/priority'
+ required: []
+ format: string
+ source:
+ $ref: '#/$defs/ticket/source'
+ required: []
+ format: string
+ record-source:
+ $ref: '#/$defs/ticket/record-source'
+ required: []
+ format: string
+ create-date:
+ $ref: '#/$defs/ticket/create-date'
+ required: []
+ format: string
+ last-modified-date:
+ $ref: '#/$defs/ticket/last-modified-date'
+ required: []
+ format: string
+ associated-contact-ids:
+ $ref: '#/$defs/common/associated-contact-ids'
+ uiOrder: 10
+ required:
+ - ticket-name
+ - ticket-status
+ - pipeline
+ title: Output
+ format: object
+TASK_CREATE_TICKET:
+ shortDescription: Create new ticket
+ input:
+ description: Ticket information.
+ uiOrder: 0
+ properties:
+ owner-id:
+ $ref: '#/$defs/common/owner-id'
+ acceptFormats:
+ - string
+ ticket-name:
+ $ref: '#/$defs/ticket/ticket-name'
+ acceptFormats:
+ - string
+ ticket-status:
+ $ref: '#/$defs/ticket/ticket-status'
+ acceptFormats:
+ - string
+ pipeline:
+ $ref: '#/$defs/ticket/pipeline'
+ acceptFormats:
+ - string
+ categories:
+ $ref: '#/$defs/ticket/categories'
+ acceptFormats:
+ - array
+ items:
+ format: string
+ priority:
+ $ref: '#/$defs/ticket/priority'
+ acceptFormats:
+ - string
+ source:
+ $ref: '#/$defs/ticket/source'
+ acceptFormats:
+ - string
+ create-contacts-association:
+ $ref: '#/$defs/common/create-contacts-association'
+ uiOrder: 7
+ required:
+ - ticket-name
+ - ticket-status
+ - pipeline
+ title: Input
+ format: object
+ output:
+ description: Obtain ticket ID.
+ uiOrder: 0
+ properties:
+ ticket-id:
+ description: Ticket ID.
+ uiOrder: 0
+ required: []
+ title: Ticket ID
+ format: string
+ required:
+ - ticket-id
+ title: Output
+ format: object
+TASK_UPDATE_TICKET:
+ shortDescription: Update existing ticket
+ input:
+ description: Ticket information.
+ uiOrder: 0
+ properties:
+ ticket-id:
+ description: Input ticket ID.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Ticket ID
+ format: string
+ owner-id:
+ $ref: '#/$defs/common/owner-id'
+ acceptFormats:
+ - string
+ ticket-name:
+ $ref: '#/$defs/ticket/ticket-name'
+ acceptFormats:
+ - string
+ ticket-status:
+ $ref: '#/$defs/ticket/ticket-status'
+ acceptFormats:
+ - string
+ pipeline:
+ $ref: '#/$defs/ticket/pipeline'
+ acceptFormats:
+ - string
+ categories:
+ $ref: '#/$defs/ticket/categories'
+ acceptFormats:
+ - array
+ items:
+ format: string
+ priority:
+ $ref: '#/$defs/ticket/priority'
+ acceptFormats:
+ - string
+ source:
+ $ref: '#/$defs/ticket/source'
+ acceptFormats:
+ - string
+ create-contacts-association:
+ $ref: '#/$defs/common/create-contacts-association'
+ uiOrder: 7
+ required:
+ - ticket-id
+ title: Input
+ format: object
+ output:
+ description: Update time.
+ uiOrder: 0
+ properties:
+ updated-at:
+ description: The time when the ticket was updated.
+ uiOrder: 0
+ required: []
+ title: Updated At
+ format: string
+ required:
+ - updated-at
+ title: Output
+ format: object
+TASK_GET_THREAD:
+ shortDescription: 'Retrieve all the messages inside a thread (conversation inbox).
+ The messages will be sorted from most recent to least recent. Note: This task
+ uses Conversation API from HubSpot, which is still in BETA.'
+ input:
+ description: Input thread ID.
+ uiOrder: 0
+ properties:
+ thread-id:
+ description: Input thread ID.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Thread ID
+ format: string
+ required:
+ - thread-id
+ title: Input
+ format: object
+ output:
+ description: All messages in the thread.
+ uiOrder: 0
+ properties:
+ results:
+ description: An array of messages.
+ uiOrder: 0
+ title: Messages
+ items:
+ title: Messages Details
+ properties:
+ created-at:
+ description: message to start a conversation.
+ uiOrder: 0
+ title: Start Conversation Message
+ format: string
+ sender:
+ description: Sender's information.
+ uiOrder: 1
+ title: Sender
+ properties:
+ sender-name:
+ description: The name of the sender.
+ uiOrder: 0
+ title: Name
+ format: string
+ sender-type:
+ description: Specify the category of sender information.
+ uiOrder: 1
+ title: Type
+ format: string
+ sender-value:
+ description: 'Contains the actual sender information (e.g.: email
+ address).'
+ uiOrder: 2
+ title: Value
+ format: string
+ sender-actor-id:
+ description: The actor ID of the sender.
+ uiOrder: 3
+ title: Actor ID
+ format: string
+ required:
+ - sender-actor-id
+ format: object
+ recipients:
+ description: Recipients' information.
+ uiOrder: 2
+ title: Recipients
+ items:
+ title: Recipient's information
+ properties:
+ name:
+ description: The name of the recipient.
+ uiOrder: 0
+ title: Name
+ format: string
+ value:
+ description: 'Contains the actual recipient information (e.g.:
+ email address).'
+ uiOrder: 2
+ title: Value
+ format: string
+ type:
+ description: Specify the category of recipient information.
+ uiOrder: 1
+ title: Type
+ format: string
+ required: []
+ format: object
+ format: array
+ text:
+ description: The content of the message.
+ uiOrder: 3
+ required: []
+ title: Text
+ format: string
+ subject:
+ description: The subject of the message.
+ uiOrder: 4
+ required: []
+ title: Subject
+ format: string
+ channel-id:
+ description: The ID of a generic channel returned from the channels
+ endpoint, like 1000 for live chat, 1001 for Facebook Messenger, 1002
+ for email, etc.
+ uiOrder: 5
+ required: []
+ title: Channel ID
+ format: string
+ channel-account-id:
+ description: The ID of an account that is part of the channel-id channel.
+ uiOrder: 6
+ required: []
+ title: Channel Account ID
+ format: string
+ required:
+ - created-at
+ - text
+ - channel-id
+ - channel-account-id
+ format: object
+ format: array
+ no-of-messages:
+ description: The number of messages in a thread.
+ uiOrder: 1
+ required: []
+ title: Number of Messages
+ format: integer
+ required:
+ - results
+ - no-of-messages
+ title: Output
+ format: object
+TASK_INSERT_MESSAGE:
+ shortDescription: Insert message into a thread (only support email thread)
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ thread-id:
+ description: Input thread ID.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Thread ID
+ format: string
+ sender-actor-id:
+ description: 'Input sender actor id. Example: A-12345678. To obtain this,
+ it is recommended to use and copy the ''Get Thread task'' sender output.
+ For [more information](https://developers.hubspot.com/beta-docs/guides/api/conversations/inbox-and-messages#get-actors)
+ about actor id.'
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Sender Actor ID
+ format: string
+ recipients:
+ description: Recipients of the message.
+ title: Recipients
+ acceptFormats:
+ - array
+ uiOrder: 2
+ items:
+ format: string
+ format: array
+ channel-account-id:
+ description: The ID of an account that is part of the channel-id channel.
+ On an existing thread, it is recommended to copy channel-account-id of the
+ most recent message on the thread.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Channel Account ID
+ format: string
+ subject:
+ description: The subject of the message.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Subject
+ format: string
+ text:
+ description: The body of the message.
+ acceptFormats:
+ - string
+ uiOrder: 5
+ title: Text
+ format: string
+ required:
+ - thread-id
+ - sender-actor-id
+ - recipients
+ - channel-account-id
+ - subject
+ - text
+ title: Input
+ format: object
+ output:
+ description: Status of the message.
+ uiOrder: 0
+ properties:
+ status:
+ description: The message status.
+ uiOrder: 0
+ required: []
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_RETRIEVE_ASSOCIATION:
+ shortDescription: 'Get the object IDs associated with contact ID (contact->objects).
+ If you are trying to do the opposite (object->contacts), it is possible using
+ the other tasks. Example: Go to get deal task to obtain deal->contacts. Remember
+ to check that the contact ID you input exists, because there won''t be an error
+ message if the contact ID doesn''t exist.'
+ input:
+ description: Contact ID and object type (CRM objects or Thread).
+ uiOrder: 0
+ properties:
+ contact-id:
+ description: Input contact ID.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Contact ID
+ format: string
+ object-type:
+ enum:
+ - Deals
+ - Companies
+ - Tickets
+ - Threads
+ example: Deals
+ description: 'Input object type (CRM objects or ''Threads''). Note: CRM objects
+ include ''Deals'', ''Companies'', ''Tickets'', etc.'
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Object Type
+ format: string
+ required:
+ - contact-id
+ - object-type
+ title: Input
+ format: object
+ output:
+ description: All object IDs.
+ uiOrder: 0
+ properties:
+ object-ids:
+ description: An array of object ID associated with the contact.
+ uiOrder: 0
+ title: 'Object ID Array '
+ items:
+ title: Object ID
+ description: The object ID associated with the contact.
+ format: string
+ format: array
+ object-ids-length:
+ description: The number of object IDs.
+ uiOrder: 1
+ required: []
+ title: Object IDs Length
+ format: integer
+ required:
+ - object-ids
+ - object-ids-length
+ title: Output
+ format: object
+TASK_GET_OWNER:
+ shortDescription: Get information about HubSpot owner using either owner ID or user
+ ID. For more information about owner, please go to [here](https://developers.hubspot.com/docs/api/crm/owners)
+ input:
+ description: Owner information and type.
+ uiOrder: 0
+ properties:
+ id-type:
+ enum:
+ - Owner ID
+ - User ID
+ example: Owner ID
+ description: Specify the type of ID you will use to get owner's information.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: ID Type
+ format: string
+ id:
+ description: Can either be owner ID or user ID; according to the ID type you
+ selected.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ required:
+ - id-type
+ - id
+ title: Input
+ format: object
+ output:
+ description: Owner's detailed information.
+ uiOrder: 0
+ properties:
+ first-name:
+ description: First name.
+ uiOrder: 0
+ required: []
+ title: First Name
+ format: string
+ last-name:
+ description: Last name.
+ uiOrder: 1
+ required: []
+ title: Last Name
+ format: string
+ email:
+ description: Email.
+ uiOrder: 2
+ required: []
+ title: Email
+ format: string
+ owner-id:
+ description: Owner ID. Usually used to associate the owner with other objects.
+ uiOrder: 3
+ required: []
+ title: Owner ID
+ format: string
+ user-id:
+ description: User ID. Usually used to indicate the owner who performed the
+ action. User ID can be seen in Update Deal task output.
+ uiOrder: 4
+ required: []
+ title: User ID
+ format: string
+ teams:
+ description: The owner's teams information.
+ uiOrder: 5
+ title: Teams
+ items:
+ title: The owner's team information
+ properties:
+ team-name:
+ description: The name of the team.
+ uiOrder: 0
+ title: Team Name
+ format: string
+ team-id:
+ description: The ID of the team.
+ uiOrder: 1
+ title: Team ID
+ format: string
+ team-primary:
+ description: Indicate whether this team is the primary team of the owner.
+ uiOrder: 2
+ title: Team Primary
+ format: boolean
+ required:
+ - team-name
+ - team-id
+ - team-primary
+ format: object
+ format: array
+ created-at:
+ description: Created at.
+ uiOrder: 6
+ required: []
+ title: Created At
+ format: string
+ updated-at:
+ description: Updated at.
+ uiOrder: 7
+ required: []
+ title: Updated At
+ format: string
+ archived:
+ description: Archived.
+ uiOrder: 8
+ required: []
+ title: Archived
+ format: boolean
+ required:
+ - first-name
+ - last-name
+ - email
+ - owner-id
+ - user-id
+ - created-at
+ - updated-at
+ - archived
+ title: Output
+ format: object
+TASK_GET_ALL:
+ shortDescription: Get all the IDs for a specific object (e.g. all contact IDs)
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ object-type:
+ enum:
+ - Contacts
+ - Deals
+ - Companies
+ - Tickets
+ - Threads
+ - Owners
+ example: Contacts
+ description: The object which you want to get all IDs for.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Object Type
+ format: string
+ required:
+ - object-type
+ title: Input
+ format: object
+ output:
+ description: All the IDs of the object.
+ uiOrder: 0
+ properties:
+ object-ids:
+ description: An array of object ID.
+ uiOrder: 0
+ title: 'Object ID Array '
+ items:
+ title: Object ID
+ description: Object ID.
+ format: string
+ format: array
+ object-ids-length:
+ description: The number of object IDs.
+ uiOrder: 1
+ required: []
+ title: Object IDs Length
+ format: integer
+ required:
+ - object-ids
+ - object-ids-length
+ title: Output
+ format: object
diff --git a/pkg/component/application/hubspot/v0/main.go b/pkg/component/application/hubspot/v0/main.go
index 43d73e79f..2854e0376 100644
--- a/pkg/component/application/hubspot/v0/main.go
+++ b/pkg/component/application/hubspot/v0/main.go
@@ -35,12 +35,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
once sync.Once
comp *component
@@ -59,7 +59,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/jira/v0/README.mdx b/pkg/component/application/jira/v0/README.mdx
index af5a6deb3..cb16b7025 100644
--- a/pkg/component/application/jira/v0/README.mdx
+++ b/pkg/component/application/jira/v0/README.mdx
@@ -27,7 +27,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/jira/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/jira/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/jira/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/jira/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/jira/v0/config/definition.json b/pkg/component/application/jira/v0/config/definition.json
deleted file mode 100644
index 61796f8d6..000000000
--- a/pkg/component/application/jira/v0/config/definition.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "availableTasks": [
- "TASK_CREATE_ISSUE",
- "TASK_CREATE_SPRINT",
- "TASK_GET_ISSUE",
- "TASK_GET_SPRINT",
- "TASK_LIST_BOARDS",
- "TASK_LIST_ISSUES",
- "TASK_LIST_SPRINTS",
- "TASK_UPDATE_ISSUE",
- "TASK_UPDATE_SPRINT"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/application/jira",
- "icon": "assets/jira.svg",
- "id": "jira",
- "public": true,
- "title": "Jira",
- "vendor": "Atlassian",
- "description": "Do anything available on Jira.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "3b27f50d-a754-4b9d-8141-95aaec647cc5",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/jira/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/jira/v0/config/definition.yaml b/pkg/component/application/jira/v0/config/definition.yaml
new file mode 100644
index 000000000..2d24f2715
--- /dev/null
+++ b/pkg/component/application/jira/v0/config/definition.yaml
@@ -0,0 +1,23 @@
+availableTasks:
+- TASK_CREATE_ISSUE
+- TASK_CREATE_SPRINT
+- TASK_GET_ISSUE
+- TASK_GET_SPRINT
+- TASK_LIST_BOARDS
+- TASK_LIST_ISSUES
+- TASK_LIST_SPRINTS
+- TASK_UPDATE_ISSUE
+- TASK_UPDATE_SPRINT
+documentationUrl: https://www.instill.tech/docs/component/application/jira
+icon: assets/jira.svg
+id: jira
+public: true
+title: Jira
+vendor: Atlassian
+description: Do anything available on Jira.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: 3b27f50d-a754-4b9d-8141-95aaec647cc5
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/jira/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/jira/v0/config/setup.json b/pkg/component/application/jira/v0/config/setup.json
deleted file mode 100644
index 4664b2cbb..000000000
--- a/pkg/component/application/jira/v0/config/setup.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "token": {
- "description": "Fill in your Jira API token. You can generate one from your Jira account \"settings > security > API tokens\".",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "Token",
- "format": "string"
- },
- "email": {
- "description": "Fill in your Jira email address.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Email",
- "format": "string"
- },
- "base-url": {
- "description": "Fill in your Jira base URL. For example, if your Jira URL is \"https://mycompany.atlassian.net/...\", then your base URL is https://mycompany.atlassian.net.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Base URL",
- "format": "string"
- }
- },
- "required": [
- "token",
- "email",
- "base-url"
- ],
- "title": "Jira Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/jira/v0/config/setup.yaml b/pkg/component/application/jira/v0/config/setup.yaml
new file mode 100644
index 000000000..9ea65efca
--- /dev/null
+++ b/pkg/component/application/jira/v0/config/setup.yaml
@@ -0,0 +1,32 @@
+additionalProperties: false
+properties:
+ token:
+ description: Fill in your Jira API token. You can generate one from your Jira
+ account "settings > security > API tokens".
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: Token
+ format: string
+ email:
+ description: Fill in your Jira email address.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Email
+ format: string
+ base-url:
+ description: Fill in your Jira base URL. For example, if your Jira URL is "https://mycompany.atlassian.net/...",
+ then your base URL is https://mycompany.atlassian.net.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Base URL
+ format: string
+required:
+- token
+- email
+- base-url
+title: Jira Connection
+format: object
diff --git a/pkg/component/application/jira/v0/config/tasks.json b/pkg/component/application/jira/v0/config/tasks.json
deleted file mode 100644
index f46246fb4..000000000
--- a/pkg/component/application/jira/v0/config/tasks.json
+++ /dev/null
@@ -1,1182 +0,0 @@
-{
- "$defs": {
- "common-query-params": {
- "start-at": {
- "default": 0,
- "description": "The starting index of the returned boards. Base index: 0. Default is 0.",
- "uiOrder": 3,
- "title": "Start At",
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "max-results": {
- "default": 50,
- "description": "The maximum number of boards to return. Default is 50.",
- "uiOrder": 4,
- "title": "Max Results",
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "update-history": {
- "description": "Whether the action taken is added to the user's Recent history, as shown under `Your Work` in Jira.",
- "title": "Update History",
- "uiOrder": 5,
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- }
- },
- "issue": {
- "properties": {
- "id": {
- "description": "The ID of the issue.",
- "uiOrder": 0,
- "title": "ID",
- "format": "string"
- },
- "key": {
- "title": "Key",
- "description": "The key of the issue, e.g. `JRA-1330`.",
- "shortDescription": "The key of the issue",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "self": {
- "description": "The URL of the issue.",
- "uiOrder": 2,
- "title": "Self",
- "format": "string"
- },
- "fields": {
- "description": "The fields of the issue. All navigable and Agile fields are returned.",
- "uiOrder": 3,
- "title": "Fields",
- "required": [],
- "format": "json"
- },
- "issue-type": {
- "description": "The type of the issue, can be: `Task`, `Epic`.",
- "uiOrder": 4,
- "title": "Issue Type",
- "format": "string"
- },
- "summary": {
- "description": "The summary of the issue.",
- "uiOrder": 5,
- "title": "Summary",
- "format": "string"
- },
- "description": {
- "description": "The description of the issue.",
- "uiOrder": 6,
- "title": "Description",
- "format": "string"
- },
- "status": {
- "description": "The status of the issue, can be: `To Do`, `In Progress`, `Done`.",
- "uiOrder": 7,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "id",
- "key",
- "self",
- "fields"
- ],
- "title": "Issue",
- "format": "object"
- },
- "sprint": {
- "properties": {
- "id": {
- "title": "ID",
- "description": "The ID of the sprint.",
- "uiOrder": 0,
- "format": "integer"
- },
- "self": {
- "title": "Self",
- "description": "The URL of the sprint.",
- "uiOrder": 1,
- "format": "string"
- },
- "state": {
- "title": "State",
- "description": "The state of the sprint, can be: `active`, `closed`, `future`.",
- "uiOrder": 2,
- "format": "string"
- },
- "name": {
- "title": "Name",
- "description": "The name of the sprint.",
- "uiOrder": 3,
- "format": "string"
- },
- "start-date": {
- "title": "Start Date",
- "description": "The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`.",
- "uiOrder": 4,
- "format": "string"
- },
- "end-date": {
- "title": "End Date",
- "description": "The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`.",
- "uiOrder": 5,
- "format": "string"
- },
- "complete-date": {
- "title": "Complete Date",
- "description": "The complete date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`.",
- "uiOrder": 6,
- "format": "string"
- },
- "origin-board-id": {
- "title": "Origin Board ID",
- "description": "The ID of the origin board.",
- "uiOrder": 7,
- "format": "integer"
- },
- "goal": {
- "title": "Goal",
- "description": "The Goal of the sprint.",
- "uiOrder": 8,
- "format": "string"
- }
- },
- "required": [
- "id",
- "self"
- ],
- "title": "Sprint",
- "format": "object"
- }
- },
- "TASK_CREATE_ISSUE": {
- "description": "Create an issue in Jira.",
- "shortDescription": "Create an issue in Jira",
- "input": {
- "description": "Create an issue in Jira.",
- "uiOrder": 0,
- "properties": {
- "project-key": {
- "title": "Project Key",
- "description": "The key of the project, e.g. `INS`.",
- "shortDescription": "The key of the project",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "issue-type": {
- "title": "Issue Type",
- "description": "The type of the issue, can be: `Task`, `Epic`, `Subtask`, etc.",
- "uiOrder": 1,
- "additionalProperties": true,
- "required": [
- "issue-type"
- ],
- "oneOf": [
- {
- "properties": {
- "issue-type": {
- "title": "Issue Type",
- "const": "Epic",
- "description": "Epic.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "issue-type"
- ],
- "description": "Epic.",
- "uiOrder": 0,
- "title": "Epic",
- "format": "object"
- },
- {
- "properties": {
- "issue-type": {
- "title": "Issue Type",
- "const": "Task",
- "description": "Task.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "issue-type"
- ],
- "description": "Task.",
- "uiOrder": 0,
- "title": "Task",
- "format": "object"
- },
- {
- "properties": {
- "issue-type": {
- "title": "Issue Type",
- "const": "Subtask",
- "description": "Subtask.",
- "uiOrder": 0,
- "format": "string"
- },
- "parent-key": {
- "title": "Parent Key",
- "description": "The key of the parent issue, e.g. `JRA-1330`.",
- "shortDescription": "The key of the parent issue",
- "uiOrder": 10,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "issue-type",
- "parent-key"
- ],
- "description": "Subtask.",
- "uiOrder": 0,
- "title": "Subtask",
- "format": "object"
- },
- {
- "properties": {
- "issue-type": {
- "title": "Issue Type",
- "const": "Other",
- "description": "Other.",
- "uiOrder": 0,
- "format": "string"
- },
- "custom-issue-type": {
- "title": "Issue Type",
- "description": "The type of the issue, can be: `Task`, `Epic`, `Subtask`, etc.",
- "shortDescription": "The type of the issue",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "issue-type",
- "custom-issue-type"
- ],
- "description": "Other.",
- "uiOrder": 0,
- "title": "Other",
- "format": "object"
- }
- ],
- "format": "object"
- },
- "summary": {
- "title": "Summary",
- "description": "The summary of the issue.",
- "shortDescription": "The summary of the issue",
- "uiOrder": 2,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "description": {
- "title": "Description",
- "description": "The description of the issue.",
- "shortDescription": "The description of the issue",
- "uiOrder": 3,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "project-key",
- "issue-type"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Create an issue in Jira.",
- "uiOrder": 0,
- "$ref": "#/$defs/issue",
- "title": "Output",
- "format": "object"
- },
- "format": "object"
- },
- "TASK_CREATE_SPRINT": {
- "description": "Create a sprint in Jira.",
- "shortDescription": "Create a sprint in Jira",
- "input": {
- "description": "Create a sprint in Jira.",
- "uiOrder": 0,
- "properties": {
- "board-name": {
- "title": "Board Name",
- "description": "The name of the board.",
- "shortDescription": "The name of the board",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "name": {
- "title": "Name",
- "description": "The name of the sprint.",
- "shortDescription": "The name of the sprint",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "goal": {
- "title": "Goal",
- "description": "The goal of the sprint.",
- "shortDescription": "The goal of the sprint",
- "uiOrder": 2,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "start-date": {
- "title": "Start Date",
- "description": "The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`.",
- "shortDescription": "The start date of the sprint",
- "uiOrder": 3,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "end-date": {
- "title": "End Date",
- "description": "The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`.",
- "shortDescription": "The end date of the sprint",
- "uiOrder": 4,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "board-name",
- "name",
- "goal",
- "start-date",
- "end-date"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Create a sprint in Jira.",
- "uiOrder": 0,
- "$ref": "#/$defs/sprint",
- "title": "Output",
- "format": "object"
- },
- "format": "object"
- },
- "TASK_GET_ISSUE": {
- "description": "Get an issue in Jira. The issue will only be returned if the user has permission to view it. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic.",
- "shortDescription": "Get an issue in Jira",
- "input": {
- "description": "Get an issue in Jira.",
- "uiOrder": 0,
- "properties": {
- "issue-key": {
- "title": "Issue Key",
- "description": "The key of the issue, e.g. `JRA-1330`.",
- "shortDescription": "The key of the issue",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "update-history": {
- "$ref": "#/$defs/common-query-params/update-history",
- "uiOrder": 1
- }
- },
- "required": [
- "issue-key"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Get an issue in Jira.",
- "uiOrder": 0,
- "$ref": "#/$defs/issue",
- "title": "Output",
- "format": "object"
- },
- "format": "object"
- },
- "TASK_GET_SPRINT": {
- "description": "Get a sprint in Jira. The sprint will only be returned if the user can view the board that the sprint was created on, or view at least one of the issues in the sprint.",
- "shortDescription": "Get a sprint in Jira",
- "input": {
- "description": "Get an sprint in Jira.",
- "uiOrder": 0,
- "properties": {
- "sprint-id": {
- "title": "Sprint ID",
- "description": "The ID of the sprint. The sprint will only be returned if you can view the board that the sprint was created on, or view at least one of the issues in the sprint.",
- "shortDescription": "The ID of the sprint",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- }
- },
- "required": [
- "sprint-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Get an sprint in Jira.",
- "uiOrder": 0,
- "$ref": "#/$defs/sprint",
- "required": [],
- "title": "Output",
- "format": "object"
- },
- "format": "object"
- },
- "TASK_LIST_BOARDS": {
- "shortDescription": "List all boards in Jira",
- "input": {
- "description": "List all boards in Jira.",
- "uiOrder": 0,
- "properties": {
- "project-key-or-id": {
- "default": "",
- "title": "Project Key or ID",
- "description": "This filters results to boards that are relevant to a project. Relevance meaning that the JQL filter defined in board contains a reference to a project.",
- "shortDescription": "The project key or ID, e.g. `INS`. Default is empty",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "board-type": {
- "default": "simple",
- "description": "The type of board, can be: scrum, kanban, simple. Default is simple.",
- "uiOrder": 1,
- "enum": [
- "scrum",
- "kanban",
- "simple"
- ],
- "title": "Board Type",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "name": {
- "default": "",
- "description": "Name filters results to boards that match or partially match the specified name. Default is empty.",
- "uiOrder": 2,
- "title": "Name",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "start-at": {
- "$ref": "#/$defs/common-query-params/start-at",
- "uiOrder": 3
- },
- "max-results": {
- "$ref": "#/$defs/common-query-params/max-results",
- "uiOrder": 4
- }
- },
- "required": [],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "List all boards in Jira.",
- "uiOrder": 0,
- "properties": {
- "boards": {
- "description": "A array of boards in Jira.",
- "uiOrder": 1,
- "title": "Boards",
- "items": {
- "properties": {
- "id": {
- "description": "The ID of the board.",
- "uiOrder": 0,
- "title": "ID",
- "format": "integer"
- },
- "name": {
- "description": "The name of the board.",
- "uiOrder": 1,
- "title": "Name",
- "format": "string"
- },
- "self": {
- "description": "The URL of the board.",
- "uiOrder": 3,
- "title": "Self",
- "format": "string"
- },
- "type": {
- "description": "The type of the board.",
- "uiOrder": 2,
- "title": "Type",
- "format": "string"
- }
- },
- "required": [
- "id",
- "name",
- "type",
- "self"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "start-at": {
- "description": "The starting index of the returned boards. Base index: 0.",
- "uiOrder": 2,
- "title": "Start At",
- "format": "integer"
- },
- "max-results": {
- "description": "The maximum number of boards.",
- "uiOrder": 3,
- "title": "Max Results",
- "format": "integer"
- },
- "total": {
- "description": "The total number of boards.",
- "uiOrder": 4,
- "title": "Total",
- "format": "integer"
- },
- "is-last": {
- "description": "Whether the last board is reached.",
- "uiOrder": 5,
- "title": "Is Last",
- "format": "boolean"
- }
- },
- "required": [
- "start-at",
- "max-results",
- "total",
- "is-last"
- ],
- "title": "Output",
- "format": "object"
- },
- "format": "object"
- },
- "TASK_LIST_ISSUES": {
- "description": "List issues in Jira.",
- "shortDescription": "List issues in Jira",
- "input": {
- "description": "List issues in Jira.",
- "uiOrder": 0,
- "properties": {
- "board-name": {
- "title": "Board Name",
- "description": "The name of the board.",
- "shortDescription": "The name of the board",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "range": {
- "title": "Range",
- "description": "Choose the range of issues to return. Default is `all`.",
- "uiOrder": 1,
- "additionalProperties": true,
- "required": [
- "range"
- ],
- "oneOf": [
- {
- "properties": {
- "range": {
- "title": "Range",
- "const": "All",
- "description": "All issues.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "range"
- ],
- "description": "All issues.",
- "uiOrder": 0,
- "title": "All",
- "format": "object"
- },
- {
- "properties": {
- "range": {
- "title": "Range",
- "const": "Standard Issues",
- "description": "Standard issues.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "range"
- ],
- "description": "Standard issues.",
- "uiOrder": 0,
- "title": "Standard Issues",
- "format": "object"
- },
- {
- "properties": {
- "range": {
- "title": "Range",
- "const": "Epics only",
- "description": "Epics only.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "range"
- ],
- "description": "Epics only.",
- "uiOrder": 0,
- "title": "Epics only",
- "format": "object"
- },
- {
- "properties": {
- "range": {
- "title": "Range",
- "const": "In backlog only",
- "description": "In backlog only.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "range"
- ],
- "description": "In backlog only.",
- "uiOrder": 0,
- "title": "In Backlog Only",
- "format": "object"
- },
- {
- "properties": {
- "range": {
- "title": "Range",
- "const": "Issues of an epic",
- "description": "Issues of an epic.",
- "uiOrder": 0,
- "format": "string"
- },
- "epic-key": {
- "title": "Epic Key",
- "description": "The Key of the epic, e.g. `JRA-1330`.",
- "shortDescription": "The Key of the epic",
- "uiOrder": 10,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "range",
- "epic-key"
- ],
- "description": "Issues of an epic.",
- "uiOrder": 0,
- "title": "Issues of an Epic",
- "format": "object"
- },
- {
- "properties": {
- "range": {
- "title": "Range",
- "const": "Issues of a sprint",
- "description": "Issues of a sprint.",
- "uiOrder": 0,
- "format": "string"
- },
- "sprint-name": {
- "title": "Sprint Name",
- "description": "The name of the sprint.",
- "shortDescription": "The Name of the sprint",
- "uiOrder": 10,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "range",
- "sprint-name"
- ],
- "description": "Issues of a sprint.",
- "uiOrder": 0,
- "title": "Issues of a Sprint",
- "format": "object"
- },
- {
- "properties": {
- "range": {
- "title": "Range",
- "const": "Issues without epic assigned",
- "description": "Issues without epic assigned.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "range"
- ],
- "description": "Issues without Epic Assigned.",
- "uiOrder": 0,
- "title": "Issues without Epic Assigned",
- "format": "object"
- },
- {
- "properties": {
- "range": {
- "title": "Range",
- "const": "JQL query",
- "description": "JQL query.",
- "uiOrder": 0,
- "format": "string"
- },
- "jql": {
- "title": "JQL",
- "description": "The JQL query. For example, `type = \"Task\" AND status = \"Done\"`. For more information, see Advanced searching.",
- "shortDescription": "The JQL query",
- "uiOrder": 10,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "range",
- "jql"
- ],
- "description": "JQL query.",
- "uiOrder": 0,
- "title": "JQL Query",
- "format": "object"
- }
- ],
- "format": "object"
- },
- "start-at": {
- "$ref": "#/$defs/common-query-params/start-at",
- "uiOrder": 3
- },
- "max-results": {
- "$ref": "#/$defs/common-query-params/max-results",
- "uiOrder": 4
- }
- },
- "required": [
- "board-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Get issues in Jira.",
- "uiOrder": 0,
- "properties": {
- "issues": {
- "description": "A array of issues in Jira.",
- "uiOrder": 1,
- "title": "Issues",
- "items": {
- "$ref": "#/$defs/issue"
- },
- "format": "array"
- },
- "start-at": {
- "description": "The starting index of the returned boards. Base index: 0.",
- "uiOrder": 2,
- "title": "Start At",
- "format": "integer"
- },
- "max-results": {
- "description": "The maximum number of boards.",
- "uiOrder": 3,
- "title": "Max Results",
- "format": "integer"
- },
- "total": {
- "description": "The total number of boards.",
- "uiOrder": 4,
- "title": "Total",
- "format": "integer"
- }
- },
- "required": [
- "start-at",
- "max-results",
- "total"
- ],
- "title": "Output",
- "format": "object"
- },
- "format": "object"
- },
- "TASK_LIST_SPRINTS": {
- "description": "List sprints in Jira.",
- "shortDescription": "List sprints in Jira",
- "input": {
- "description": "List sprints in Jira.",
- "uiOrder": 0,
- "properties": {
- "board-id": {
- "title": "Board ID",
- "description": "The ID of the board.",
- "shortDescription": "The ID of the board",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "start-at": {
- "$ref": "#/$defs/common-query-params/start-at",
- "uiOrder": 1
- },
- "max-results": {
- "$ref": "#/$defs/common-query-params/max-results",
- "uiOrder": 2
- }
- },
- "required": [
- "board-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Get sprints in Jira.",
- "uiOrder": 0,
- "properties": {
- "sprints": {
- "description": "A array of sprints in Jira.",
- "uiOrder": 1,
- "title": "Sprints",
- "items": {
- "$ref": "#/$defs/sprint"
- },
- "format": "array"
- },
- "start-at": {
- "description": "The starting index of the returned boards. Base index: 0.",
- "uiOrder": 2,
- "title": "Start At",
- "format": "integer"
- },
- "max-results": {
- "description": "The maximum number of boards.",
- "uiOrder": 3,
- "title": "Max Results",
- "format": "integer"
- },
- "total": {
- "description": "The total number of boards.",
- "uiOrder": 4,
- "title": "Total",
- "format": "integer"
- }
- },
- "required": [
- "start-at",
- "max-results",
- "total"
- ],
- "title": "Output",
- "format": "object"
- },
- "format": "object"
- },
- "TASK_UPDATE_ISSUE": {
- "description": "Update an issue in Jira.",
- "shortDescription": "Update an issue in Jira",
- "input": {
- "description": "Update an issue in Jira.",
- "uiOrder": 0,
- "properties": {
- "issue-key": {
- "$ref": "#/$defs/issue/properties/key",
- "title": "Issue Key",
- "uiOrder": 0
- },
- "notify-users": {
- "title": "Notify Users",
- "description": "Whether to notify users.",
- "uiOrder": 1,
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- },
- "update": {
- "title": "Update",
- "description": "Update an issue in Jira.",
- "uiOrder": 1,
- "additionalProperties": true,
- "required": [
- "update"
- ],
- "oneOf": [
- {
- "properties": {
- "update": {
- "title": "Update",
- "const": "Custom Update",
- "description": "Custom update.",
- "uiOrder": 0,
- "format": "string"
- },
- "update-fields": {
- "title": "Update Fields",
- "description": "The fields to update.",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "properties": {
- "action": {
- "description": "The action to perform, can be: `add`, `copy`, `edit`, `remove`, `set`.",
- "enum": [
- "add",
- "copy",
- "edit",
- "remove",
- "set"
- ],
- "uiOrder": 3,
- "title": "Action",
- "format": "string"
- },
- "field-name": {
- "description": "The name of the field to update.",
- "uiOrder": 4,
- "title": "Field Name",
- "format": "string"
- },
- "value": {
- "description": "The value of the field to update.",
- "uiOrder": 5,
- "title": "Value",
- "format": "string"
- }
- },
- "required": [
- "action",
- "field-name"
- ],
- "format": "object"
- },
- "uiOrder": 1,
- "format": "array"
- }
- },
- "required": [
- "update",
- "update-fields"
- ],
- "description": "Custom update.",
- "uiOrder": 0,
- "title": "Custom Update",
- "format": "object"
- },
- {
- "properties": {
- "update": {
- "title": "Update",
- "const": "Move Issue to Epic",
- "description": "Move issue to epic.",
- "uiOrder": 0,
- "format": "string"
- },
- "epic-key": {
- "title": "Epic Key",
- "description": "The key of the epic, e.g. `JRA-1330`.",
- "shortDescription": "The key of the epic",
- "uiOrder": 11,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "required": [
- "update",
- "epic-key"
- ],
- "description": "Move issue to epic.",
- "uiOrder": 0,
- "title": "Move Issue to Epic",
- "format": "object"
- }
- ],
- "format": "object"
- }
- },
- "required": [
- "issue-key"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Update an issue in Jira.",
- "uiOrder": 0,
- "$ref": "#/$defs/issue",
- "title": "Output",
- "format": "object"
- },
- "format": "object"
- },
- "TASK_UPDATE_SPRINT": {
- "description": "Update a sprint in Jira.",
- "shortDescription": "Update a sprint in Jira",
- "input": {
- "description": "Update a sprint in Jira.",
- "uiOrder": 0,
- "properties": {
- "sprint-id": {
- "title": "Sprint ID",
- "description": "The ID of the sprint.",
- "shortDescription": "The ID of the sprint",
- "uiOrder": 0,
- "acceptFormats": [
- "integer"
- ],
- "format": "integer"
- },
- "name": {
- "title": "Name",
- "description": "The name of the sprint.",
- "shortDescription": "The name of the sprint",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "goal": {
- "title": "Goal",
- "description": "The goal of the sprint.",
- "shortDescription": "The goal of the sprint",
- "uiOrder": 2,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "start-date": {
- "title": "Start Date",
- "description": "The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`.",
- "shortDescription": "The start date of the sprint",
- "uiOrder": 3,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "end-date": {
- "title": "End Date",
- "description": "The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`.",
- "shortDescription": "The end date of the sprint",
- "uiOrder": 4,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "current-state": {
- "title": "Current State",
- "description": "The current state of the sprint, can be: `future`, `active`, `closed`.",
- "shortDescription": "The current state of the sprint",
- "uiOrder": 5,
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "enter-next-state": {
- "title": "Enter Next State",
- "description": "Whether to enter the next state. If `true`, the sprint will enter the next state, i.e., `future` -> `active` -> `closed`.",
- "shortDescription": "Whether to enter the next state",
- "uiOrder": 6,
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- }
- },
- "required": [
- "sprint-id",
- "name",
- "start-date",
- "end-date",
- "current-state"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Update a sprint in Jira.",
- "uiOrder": 0,
- "$ref": "#/$defs/sprint",
- "title": "Output",
- "format": "object"
- },
- "format": "object"
- }
-}
diff --git a/pkg/component/application/jira/v0/config/tasks.yaml b/pkg/component/application/jira/v0/config/tasks.yaml
new file mode 100644
index 000000000..96161f706
--- /dev/null
+++ b/pkg/component/application/jira/v0/config/tasks.yaml
@@ -0,0 +1,953 @@
+$defs:
+ common-query-params:
+ start-at:
+ default: 0
+ description: 'The starting index of the returned boards. Base index: 0. Default
+ is 0.'
+ uiOrder: 3
+ title: Start At
+ acceptFormats:
+ - integer
+ format: integer
+ max-results:
+ default: 50
+ description: The maximum number of boards to return. Default is 50.
+ uiOrder: 4
+ title: Max Results
+ acceptFormats:
+ - integer
+ format: integer
+ update-history:
+ description: Whether the action taken is added to the user's Recent history,
+ as shown under `Your Work` in Jira.
+ title: Update History
+ uiOrder: 5
+ acceptFormats:
+ - boolean
+ format: boolean
+ issue:
+ properties:
+ id:
+ description: The ID of the issue.
+ uiOrder: 0
+ title: ID
+ format: string
+ key:
+ title: Key
+ description: The key of the issue, e.g. `JRA-1330`.
+ shortDescription: The key of the issue
+ uiOrder: 1
+ acceptFormats:
+ - string
+ format: string
+ self:
+ description: The URL of the issue.
+ uiOrder: 2
+ title: Self
+ format: string
+ fields:
+ description: The fields of the issue. All navigable and Agile fields are returned.
+ uiOrder: 3
+ title: Fields
+ required: []
+ format: json
+ issue-type:
+ description: 'The type of the issue, can be: `Task`, `Epic`.'
+ uiOrder: 4
+ title: Issue Type
+ format: string
+ summary:
+ description: The summary of the issue.
+ uiOrder: 5
+ title: Summary
+ format: string
+ description:
+ description: The description of the issue.
+ uiOrder: 6
+ title: Description
+ format: string
+ status:
+ description: 'The status of the issue, can be: `To Do`, `In Progress`, `Done`.'
+ uiOrder: 7
+ title: Status
+ format: string
+ required:
+ - id
+ - key
+ - self
+ - fields
+ title: Issue
+ format: object
+ sprint:
+ properties:
+ id:
+ title: ID
+ description: The ID of the sprint.
+ uiOrder: 0
+ format: integer
+ self:
+ title: Self
+ description: The URL of the sprint.
+ uiOrder: 1
+ format: string
+ state:
+ title: State
+ description: 'The state of the sprint, can be: `active`, `closed`, `future`.'
+ uiOrder: 2
+ format: string
+ name:
+ title: Name
+ description: The name of the sprint.
+ uiOrder: 3
+ format: string
+ start-date:
+ title: Start Date
+ description: The start date of the sprint, e.g. 2018-03-05 (default 00:00
+ UTC+0). To adjust your time zone, please provide a more detailed RFC3339
+ format like `2018-03-05T09:00:00Z0000`.
+ uiOrder: 4
+ format: string
+ end-date:
+ title: End Date
+ description: The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0).
+ To adjust your time zone, please provide a more detailed RFC3339 format
+ like `2018-03-05T09:00:00Z0000`.
+ uiOrder: 5
+ format: string
+ complete-date:
+ title: Complete Date
+ description: The complete date of the sprint, e.g. 2018-03-05 (default 00:00
+ UTC+0). To adjust your time zone, please provide a more detailed RFC3339
+ format like `2018-03-05T09:00:00Z0000`.
+ uiOrder: 6
+ format: string
+ origin-board-id:
+ title: Origin Board ID
+ description: The ID of the origin board.
+ uiOrder: 7
+ format: integer
+ goal:
+ title: Goal
+ description: The Goal of the sprint.
+ uiOrder: 8
+ format: string
+ required:
+ - id
+ - self
+ title: Sprint
+ format: object
+TASK_CREATE_ISSUE:
+ description: Create an issue in Jira.
+ shortDescription: Create an issue in Jira
+ input:
+ description: Create an issue in Jira.
+ uiOrder: 0
+ properties:
+ project-key:
+ title: Project Key
+ description: The key of the project, e.g. `INS`.
+ shortDescription: The key of the project
+ uiOrder: 0
+ acceptFormats:
+ - string
+ format: string
+ issue-type:
+ title: Issue Type
+ description: 'The type of the issue, can be: `Task`, `Epic`, `Subtask`, etc.'
+ uiOrder: 1
+ additionalProperties: true
+ required:
+ - issue-type
+ oneOf:
+ - properties:
+ issue-type:
+ title: Issue Type
+ const: Epic
+ description: Epic.
+ uiOrder: 0
+ format: string
+ required:
+ - issue-type
+ description: Epic.
+ uiOrder: 0
+ title: Epic
+ format: object
+ - properties:
+ issue-type:
+ title: Issue Type
+ const: Task
+ description: Task.
+ uiOrder: 0
+ format: string
+ required:
+ - issue-type
+ description: Task.
+ uiOrder: 0
+ title: Task
+ format: object
+ - properties:
+ issue-type:
+ title: Issue Type
+ const: Subtask
+ description: Subtask.
+ uiOrder: 0
+ format: string
+ parent-key:
+ title: Parent Key
+ description: The key of the parent issue, e.g. `JRA-1330`.
+ shortDescription: The key of the parent issue
+ uiOrder: 10
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - issue-type
+ - parent-key
+ description: Subtask.
+ uiOrder: 0
+ title: Subtask
+ format: object
+ - properties:
+ issue-type:
+ title: Issue Type
+ const: Other
+ description: Other.
+ uiOrder: 0
+ format: string
+ custom-issue-type:
+ title: Issue Type
+ description: 'The type of the issue, can be: `Task`, `Epic`, `Subtask`,
+ etc.'
+ shortDescription: The type of the issue
+ uiOrder: 1
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - issue-type
+ - custom-issue-type
+ description: Other.
+ uiOrder: 0
+ title: Other
+ format: object
+ format: object
+ summary:
+ title: Summary
+ description: The summary of the issue.
+ shortDescription: The summary of the issue
+ uiOrder: 2
+ acceptFormats:
+ - string
+ format: string
+ description:
+ title: Description
+ description: The description of the issue.
+ shortDescription: The description of the issue
+ uiOrder: 3
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - project-key
+ - issue-type
+ title: Input
+ format: object
+ output:
+ description: Create an issue in Jira.
+ uiOrder: 0
+ $ref: '#/$defs/issue'
+ title: Output
+ format: object
+ format: object
+TASK_CREATE_SPRINT:
+ description: Create a sprint in Jira.
+ shortDescription: Create a sprint in Jira
+ input:
+ description: Create a sprint in Jira.
+ uiOrder: 0
+ properties:
+ board-name:
+ title: Board Name
+ description: The name of the board.
+ shortDescription: The name of the board
+ uiOrder: 0
+ acceptFormats:
+ - string
+ format: string
+ name:
+ title: Name
+ description: The name of the sprint.
+ shortDescription: The name of the sprint
+ uiOrder: 1
+ acceptFormats:
+ - string
+ format: string
+ goal:
+ title: Goal
+ description: The goal of the sprint.
+ shortDescription: The goal of the sprint
+ uiOrder: 2
+ acceptFormats:
+ - string
+ format: string
+ start-date:
+ title: Start Date
+ description: The start date of the sprint, e.g. 2018-03-05 (default 00:00
+ UTC+0). To adjust your time zone, please provide a more detailed RFC3339
+ format like `2018-03-05T09:00:00Z0000`.
+ shortDescription: The start date of the sprint
+ uiOrder: 3
+ acceptFormats:
+ - string
+ format: string
+ end-date:
+ title: End Date
+ description: The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0).
+ To adjust your time zone, please provide a more detailed RFC3339 format
+ like `2018-03-05T09:00:00Z0000`.
+ shortDescription: The end date of the sprint
+ uiOrder: 4
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - board-name
+ - name
+ - goal
+ - start-date
+ - end-date
+ title: Input
+ format: object
+ output:
+ description: Create a sprint in Jira.
+ uiOrder: 0
+ $ref: '#/$defs/sprint'
+ title: Output
+ format: object
+ format: object
+TASK_GET_ISSUE:
+ description: Get an issue in Jira. The issue will only be returned if the user has
+ permission to view it. Issues returned from this resource include Agile fields,
+ like sprint, closedSprints, flagged, and epic.
+ shortDescription: Get an issue in Jira
+ input:
+ description: Get an issue in Jira.
+ uiOrder: 0
+ properties:
+ issue-key:
+ title: Issue Key
+ description: The key of the issue, e.g. `JRA-1330`.
+ shortDescription: The key of the issue
+ uiOrder: 0
+ acceptFormats:
+ - string
+ format: string
+ update-history:
+ $ref: '#/$defs/common-query-params/update-history'
+ uiOrder: 1
+ required:
+ - issue-key
+ title: Input
+ format: object
+ output:
+ description: Get an issue in Jira.
+ uiOrder: 0
+ $ref: '#/$defs/issue'
+ title: Output
+ format: object
+ format: object
+TASK_GET_SPRINT:
+ description: Get a sprint in Jira. The sprint will only be returned if the user
+ can view the board that the sprint was created on, or view at least one of the
+ issues in the sprint.
+ shortDescription: Get a sprint in Jira
+ input:
+ description: Get an sprint in Jira.
+ uiOrder: 0
+ properties:
+ sprint-id:
+ title: Sprint ID
+ description: The ID of the sprint. The sprint will only be returned if you
+ can view the board that the sprint was created on, or view at least one
+ of the issues in the sprint.
+ shortDescription: The ID of the sprint
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ format: integer
+ required:
+ - sprint-id
+ title: Input
+ format: object
+ output:
+ description: Get an sprint in Jira.
+ uiOrder: 0
+ $ref: '#/$defs/sprint'
+ required: []
+ title: Output
+ format: object
+ format: object
+TASK_LIST_BOARDS:
+ shortDescription: List all boards in Jira
+ input:
+ description: List all boards in Jira.
+ uiOrder: 0
+ properties:
+ project-key-or-id:
+ default: ''
+ title: Project Key or ID
+ description: This filters results to boards that are relevant to a project.
+ Relevance meaning that the JQL filter defined in board contains a reference
+ to a project.
+ shortDescription: The project key or ID, e.g. `INS`. Default is empty
+ uiOrder: 0
+ acceptFormats:
+ - string
+ format: string
+ board-type:
+ default: simple
+ description: 'The type of board, can be: scrum, kanban, simple. Default is
+ simple.'
+ uiOrder: 1
+ enum:
+ - scrum
+ - kanban
+ - simple
+ title: Board Type
+ acceptFormats:
+ - string
+ format: string
+ name:
+ default: ''
+ description: Name filters results to boards that match or partially match
+ the specified name. Default is empty.
+ uiOrder: 2
+ title: Name
+ acceptFormats:
+ - string
+ format: string
+ start-at:
+ $ref: '#/$defs/common-query-params/start-at'
+ uiOrder: 3
+ max-results:
+ $ref: '#/$defs/common-query-params/max-results'
+ uiOrder: 4
+ required: []
+ title: Input
+ format: object
+ output:
+ description: List all boards in Jira.
+ uiOrder: 0
+ properties:
+ boards:
+ description: A array of boards in Jira.
+ uiOrder: 1
+ title: Boards
+ items:
+ properties:
+ id:
+ description: The ID of the board.
+ uiOrder: 0
+ title: ID
+ format: integer
+ name:
+ description: The name of the board.
+ uiOrder: 1
+ title: Name
+ format: string
+ self:
+ description: The URL of the board.
+ uiOrder: 3
+ title: Self
+ format: string
+ type:
+ description: The type of the board.
+ uiOrder: 2
+ title: Type
+ format: string
+ required:
+ - id
+ - name
+ - type
+ - self
+ format: object
+ format: array
+ start-at:
+ description: 'The starting index of the returned boards. Base index: 0.'
+ uiOrder: 2
+ title: Start At
+ format: integer
+ max-results:
+ description: The maximum number of boards.
+ uiOrder: 3
+ title: Max Results
+ format: integer
+ total:
+ description: The total number of boards.
+ uiOrder: 4
+ title: Total
+ format: integer
+ is-last:
+ description: Whether the last board is reached.
+ uiOrder: 5
+ title: Is Last
+ format: boolean
+ required:
+ - start-at
+ - max-results
+ - total
+ - is-last
+ title: Output
+ format: object
+ format: object
+TASK_LIST_ISSUES:
+ description: List issues in Jira.
+ shortDescription: List issues in Jira
+ input:
+ description: List issues in Jira.
+ uiOrder: 0
+ properties:
+ board-name:
+ title: Board Name
+ description: The name of the board.
+ shortDescription: The name of the board
+ uiOrder: 0
+ acceptFormats:
+ - string
+ format: string
+ range:
+ title: Range
+ description: Choose the range of issues to return. Default is `all`.
+ uiOrder: 1
+ additionalProperties: true
+ required:
+ - range
+ oneOf:
+ - properties:
+ range:
+ title: Range
+ const: All
+ description: All issues.
+ uiOrder: 0
+ format: string
+ required:
+ - range
+ description: All issues.
+ uiOrder: 0
+ title: All
+ format: object
+ - properties:
+ range:
+ title: Range
+ const: Standard Issues
+ description: Standard issues.
+ uiOrder: 0
+ format: string
+ required:
+ - range
+ description: Standard issues.
+ uiOrder: 0
+ title: Standard Issues
+ format: object
+ - properties:
+ range:
+ title: Range
+ const: Epics only
+ description: Epics only.
+ uiOrder: 0
+ format: string
+ required:
+ - range
+ description: Epics only.
+ uiOrder: 0
+ title: Epics only
+ format: object
+ - properties:
+ range:
+ title: Range
+ const: In backlog only
+ description: In backlog only.
+ uiOrder: 0
+ format: string
+ required:
+ - range
+ description: In backlog only.
+ uiOrder: 0
+ title: In Backlog Only
+ format: object
+ - properties:
+ range:
+ title: Range
+ const: Issues of an epic
+ description: Issues of an epic.
+ uiOrder: 0
+ format: string
+ epic-key:
+ title: Epic Key
+ description: The Key of the epic, e.g. `JRA-1330`.
+ shortDescription: The Key of the epic
+ uiOrder: 10
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - range
+ - epic-key
+ description: Issues of an epic.
+ uiOrder: 0
+ title: Issues of an Epic
+ format: object
+ - properties:
+ range:
+ title: Range
+ const: Issues of a sprint
+ description: Issues of a sprint.
+ uiOrder: 0
+ format: string
+ sprint-name:
+ title: Sprint Name
+ description: The name of the sprint.
+ shortDescription: The Name of the sprint
+ uiOrder: 10
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - range
+ - sprint-name
+ description: Issues of a sprint.
+ uiOrder: 0
+ title: Issues of a Sprint
+ format: object
+ - properties:
+ range:
+ title: Range
+ const: Issues without epic assigned
+ description: Issues without epic assigned.
+ uiOrder: 0
+ format: string
+ required:
+ - range
+ description: Issues without Epic Assigned.
+ uiOrder: 0
+ title: Issues without Epic Assigned
+ format: object
+ - properties:
+ range:
+ title: Range
+ const: JQL query
+ description: JQL query.
+ uiOrder: 0
+ format: string
+ jql:
+ title: JQL
+ description: The JQL query. For example, `type = "Task" AND status =
+ "Done"`. For more information, see Advanced
+ searching.
+ shortDescription: The JQL query
+ uiOrder: 10
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - range
+ - jql
+ description: JQL query.
+ uiOrder: 0
+ title: JQL Query
+ format: object
+ format: object
+ start-at:
+ $ref: '#/$defs/common-query-params/start-at'
+ uiOrder: 3
+ max-results:
+ $ref: '#/$defs/common-query-params/max-results'
+ uiOrder: 4
+ required:
+ - board-name
+ title: Input
+ format: object
+ output:
+ description: Get issues in Jira.
+ uiOrder: 0
+ properties:
+ issues:
+ description: A array of issues in Jira.
+ uiOrder: 1
+ title: Issues
+ items:
+ $ref: '#/$defs/issue'
+ format: array
+ start-at:
+ description: 'The starting index of the returned boards. Base index: 0.'
+ uiOrder: 2
+ title: Start At
+ format: integer
+ max-results:
+ description: The maximum number of boards.
+ uiOrder: 3
+ title: Max Results
+ format: integer
+ total:
+ description: The total number of boards.
+ uiOrder: 4
+ title: Total
+ format: integer
+ required:
+ - start-at
+ - max-results
+ - total
+ title: Output
+ format: object
+ format: object
+TASK_LIST_SPRINTS:
+ description: List sprints in Jira.
+ shortDescription: List sprints in Jira
+ input:
+ description: List sprints in Jira.
+ uiOrder: 0
+ properties:
+ board-id:
+ title: Board ID
+ description: The ID of the board.
+ shortDescription: The ID of the board
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ format: integer
+ start-at:
+ $ref: '#/$defs/common-query-params/start-at'
+ uiOrder: 1
+ max-results:
+ $ref: '#/$defs/common-query-params/max-results'
+ uiOrder: 2
+ required:
+ - board-id
+ title: Input
+ format: object
+ output:
+ description: Get sprints in Jira.
+ uiOrder: 0
+ properties:
+ sprints:
+ description: A array of sprints in Jira.
+ uiOrder: 1
+ title: Sprints
+ items:
+ $ref: '#/$defs/sprint'
+ format: array
+ start-at:
+ description: 'The starting index of the returned boards. Base index: 0.'
+ uiOrder: 2
+ title: Start At
+ format: integer
+ max-results:
+ description: The maximum number of boards.
+ uiOrder: 3
+ title: Max Results
+ format: integer
+ total:
+ description: The total number of boards.
+ uiOrder: 4
+ title: Total
+ format: integer
+ required:
+ - start-at
+ - max-results
+ - total
+ title: Output
+ format: object
+ format: object
+TASK_UPDATE_ISSUE:
+ description: Update an issue in Jira.
+ shortDescription: Update an issue in Jira
+ input:
+ description: Update an issue in Jira.
+ uiOrder: 0
+ properties:
+ issue-key:
+ $ref: '#/$defs/issue/properties/key'
+ title: Issue Key
+ uiOrder: 0
+ notify-users:
+ title: Notify Users
+ description: Whether to notify users.
+ uiOrder: 1
+ acceptFormats:
+ - boolean
+ format: boolean
+ update:
+ title: Update
+ description: Update an issue in Jira.
+ uiOrder: 1
+ additionalProperties: true
+ required:
+ - update
+ oneOf:
+ - properties:
+ update:
+ title: Update
+ const: Custom Update
+ description: Custom update.
+ uiOrder: 0
+ format: string
+ update-fields:
+ title: Update Fields
+ description: The fields to update.
+ acceptFormats:
+ - array
+ items:
+ properties:
+ action:
+ description: 'The action to perform, can be: `add`, `copy`, `edit`,
+ `remove`, `set`.'
+ enum:
+ - add
+ - copy
+ - edit
+ - remove
+ - set
+ uiOrder: 3
+ title: Action
+ format: string
+ field-name:
+ description: The name of the field to update.
+ uiOrder: 4
+ title: Field Name
+ format: string
+ value:
+ description: The value of the field to update.
+ uiOrder: 5
+ title: Value
+ format: string
+ required:
+ - action
+ - field-name
+ format: object
+ uiOrder: 1
+ format: array
+ required:
+ - update
+ - update-fields
+ description: Custom update.
+ uiOrder: 0
+ title: Custom Update
+ format: object
+ - properties:
+ update:
+ title: Update
+ const: Move Issue to Epic
+ description: Move issue to epic.
+ uiOrder: 0
+ format: string
+ epic-key:
+ title: Epic Key
+ description: The key of the epic, e.g. `JRA-1330`.
+ shortDescription: The key of the epic
+ uiOrder: 11
+ acceptFormats:
+ - string
+ format: string
+ required:
+ - update
+ - epic-key
+ description: Move issue to epic.
+ uiOrder: 0
+ title: Move Issue to Epic
+ format: object
+ format: object
+ required:
+ - issue-key
+ title: Input
+ format: object
+ output:
+ description: Update an issue in Jira.
+ uiOrder: 0
+ $ref: '#/$defs/issue'
+ title: Output
+ format: object
+ format: object
+TASK_UPDATE_SPRINT:
+ description: Update a sprint in Jira.
+ shortDescription: Update a sprint in Jira
+ input:
+ description: Update a sprint in Jira.
+ uiOrder: 0
+ properties:
+ sprint-id:
+ title: Sprint ID
+ description: The ID of the sprint.
+ shortDescription: The ID of the sprint
+ uiOrder: 0
+ acceptFormats:
+ - integer
+ format: integer
+ name:
+ title: Name
+ description: The name of the sprint.
+ shortDescription: The name of the sprint
+ uiOrder: 1
+ acceptFormats:
+ - string
+ format: string
+ goal:
+ title: Goal
+ description: The goal of the sprint.
+ shortDescription: The goal of the sprint
+ uiOrder: 2
+ acceptFormats:
+ - string
+ format: string
+ start-date:
+ title: Start Date
+ description: The start date of the sprint, e.g. 2018-03-05 (default 00:00
+ UTC+0). To adjust your time zone, please provide a more detailed RFC3339
+ format like `2018-03-05T09:00:00Z0000`.
+ shortDescription: The start date of the sprint
+ uiOrder: 3
+ acceptFormats:
+ - string
+ format: string
+ end-date:
+ title: End Date
+ description: The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0).
+ To adjust your time zone, please provide a more detailed RFC3339 format
+ like `2018-03-05T09:00:00Z0000`.
+ shortDescription: The end date of the sprint
+ uiOrder: 4
+ acceptFormats:
+ - string
+ format: string
+ current-state:
+ title: Current State
+ description: 'The current state of the sprint, can be: `future`, `active`,
+ `closed`.'
+ shortDescription: The current state of the sprint
+ uiOrder: 5
+ acceptFormats:
+ - string
+ format: string
+ enter-next-state:
+ title: Enter Next State
+ description: Whether to enter the next state. If `true`, the sprint will enter
+ the next state, i.e., `future` -> `active` -> `closed`.
+ shortDescription: Whether to enter the next state
+ uiOrder: 6
+ acceptFormats:
+ - boolean
+ format: boolean
+ required:
+ - sprint-id
+ - name
+ - start-date
+ - end-date
+ - current-state
+ title: Input
+ format: object
+ output:
+ description: Update a sprint in Jira.
+ uiOrder: 0
+ $ref: '#/$defs/sprint'
+ title: Output
+ format: object
+ format: object
diff --git a/pkg/component/application/jira/v0/main.go b/pkg/component/application/jira/v0/main.go
index 1dc11d900..5a08c0d99 100644
--- a/pkg/component/application/jira/v0/main.go
+++ b/pkg/component/application/jira/v0/main.go
@@ -25,12 +25,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -50,7 +50,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/leadiq/v0/README.mdx b/pkg/component/application/leadiq/v0/README.mdx
index 65889556a..a1b3c3651 100644
--- a/pkg/component/application/leadiq/v0/README.mdx
+++ b/pkg/component/application/leadiq/v0/README.mdx
@@ -19,7 +19,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/leadiq/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/leadiq/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/leadiq/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/leadiq/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/leadiq/v0/config/definition.json b/pkg/component/application/leadiq/v0/config/definition.json
deleted file mode 100644
index 425e9a49d..000000000
--- a/pkg/component/application/leadiq/v0/config/definition.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "availableTasks": [
- "TASK_FIND_PROSPECTS"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/application/leadiq",
- "icon": "assets/leadiq.svg",
- "id": "leadiq",
- "public": true,
- "title": "LeadIQ",
- "vendor": "LeadIQ",
- "description": "Search for prospects and enrich your leads.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "9fbda0b2-e8a6-497f-bd26-7e3f0c40ea44",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/leadiq/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/leadiq/v0/config/definition.yaml b/pkg/component/application/leadiq/v0/config/definition.yaml
new file mode 100644
index 000000000..8b7d18525
--- /dev/null
+++ b/pkg/component/application/leadiq/v0/config/definition.yaml
@@ -0,0 +1,15 @@
+availableTasks:
+- TASK_FIND_PROSPECTS
+documentationUrl: https://www.instill.tech/docs/component/application/leadiq
+icon: assets/leadiq.svg
+id: leadiq
+public: true
+title: LeadIQ
+vendor: LeadIQ
+description: Search for prospects and enrich your leads.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: 9fbda0b2-e8a6-497f-bd26-7e3f0c40ea44
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/leadiq/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/leadiq/v0/config/setup.json b/pkg/component/application/leadiq/v0/config/setup.json
deleted file mode 100644
index 569610e28..000000000
--- a/pkg/component/application/leadiq/v0/config/setup.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your LeadIQ Secret Base64 API key, you can find it in [API Key](https://account.leadiq.com/app/settings/api-keys).",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- }
- },
- "required": [
- "api-key"
- ],
- "title": "LeadIQ Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/leadiq/v0/config/setup.yaml b/pkg/component/application/leadiq/v0/config/setup.yaml
new file mode 100644
index 000000000..5774318ab
--- /dev/null
+++ b/pkg/component/application/leadiq/v0/config/setup.yaml
@@ -0,0 +1,15 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your LeadIQ Secret Base64 API key, you can find it in [API
+ Key](https://account.leadiq.com/app/settings/api-keys).
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: API Key
+ format: string
+required:
+- api-key
+title: LeadIQ Connection
+format: object
diff --git a/pkg/component/application/leadiq/v0/config/tasks.json b/pkg/component/application/leadiq/v0/config/tasks.json
deleted file mode 100644
index e81ad1dbe..000000000
--- a/pkg/component/application/leadiq/v0/config/tasks.json
+++ /dev/null
@@ -1,294 +0,0 @@
-{
- "TASK_FIND_PROSPECTS": {
- "title": "Find Prospects",
- "shortDescription": "Find prospects' contact information based on the company name you provide.",
- "description": "Find prospects' contact information based on the company name you provide. And, it will filter out the prospects who are not relevant to your search.",
- "input": {
- "title": "Input",
- "description": "Provide the information for which you want to find prospects.",
- "properties": {
- "company": {
- "title": "Company",
- "description": "Provide the company information for which you want to find prospects.",
- "properties": {
- "names": {
- "title": "Names",
- "description": "Provide the company names for which you want to find prospects.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "format": "array"
- },
- "revenue-size": {
- "title": "Revenue Size",
- "description": "Provide the min or max revenue size of the company you want to find prospects. If you don't provide any value, it will return all the prospects. If you set the company names, the revenue size will be ignored.",
- "properties": {
- "min": {
- "title": "Min",
- "description": "Provide the minimum revenue size of the company you want to find prospects.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 0,
- "format": "integer"
- },
- "max": {
- "title": "Max",
- "description": "Provide the maximum revenue size of the company you want to find prospects.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "format": "integer"
- }
- },
- "required": [],
- "uiOrder": 1,
- "format": "object"
- },
- "countries": {
- "title": "Countries",
- "description": "Provide the countries of the company you want to find prospects. If you don't provide any value, it will return all the prospects.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 2,
- "format": "array"
- },
- "states": {
- "title": "States",
- "description": "Provide the states of the company you want to find prospects. If you don't provide any value, it will return all the prospects.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "format": "array"
- },
- "cities": {
- "title": "Cities",
- "description": "Provide the cities of the company you want to find prospects. If you don't provide any value, it will return all the prospects.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 4,
- "format": "array"
- },
- "industries": {
- "title": "Industries",
- "description": "Provide the industries of the company you want to find prospects. If you don't provide any value, it will return all the prospects.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 5,
- "format": "array"
- },
- "descriptions": {
- "title": "Descriptions",
- "description": "Provide the descriptions of the company you want to find prospects. In LeadIQ, it will return the similar companies based on the descriptions.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 6,
- "format": "array"
- },
- "technologies": {
- "title": "Technologies",
- "description": "Provide the technologies used by the company you want to find prospects. If you don't provide any value, it will return all the prospects.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 7,
- "format": "array"
- }
- },
- "required": [],
- "uiOrder": 0,
- "format": "object"
- },
- "limit": {
- "title": "Limit",
- "description": "Provide the number of prospects you want to find. If you don't provide any value, it will return 10 prospects. The maximum limit is 60. The minimum limit is 1.",
- "default": 10,
- "maximum": 60,
- "minimum": 1,
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "format": "integer"
- },
- "filter-by": {
- "title": "Filter By",
- "description": "Provide the information about the prospects you want to filter. You can filter the prospects based on job title, name, seniority, and function. When it matches, the prospect will be included in the output. If you don't provide any value, it will return all the prospects.",
- "properties": {
- "job-title": {
- "title": "Job Title",
- "description": "Provide the job title of the prospects you want to filter with [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions).",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- },
- "seniorities": {
- "title": "Seniorities",
- "description": "Provide the seniorities of the prospects you want to filter.",
- "acceptFormats": [
- "array"
- ],
- "enum": [
- "Executive",
- "Director",
- "SeniorIndividualContributor",
- "VP",
- "Manager",
- "Other"
- ],
- "uiOrder": 1,
- "format": "array"
- },
- "function": {
- "title": "Function",
- "description": "Provide the function of the prospects you want to filter with [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions).",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [],
- "uiOrder": 2,
- "format": "object"
- }
- },
- "uiOrder": 0,
- "required": [
- "company",
- "limit"
- ],
- "format": "object"
- },
- "output": {
- "title": "Output",
- "description": "The output will be the list of prospects' contact information based on the company name you provide. It will include the name, job title, seniority, and email address of the prospects, and other company information from LeadIQ provided in the response.",
- "properties": {
- "prospects": {
- "title": "Prospects",
- "description": "The list of prospects' contact information based on the company information you provide.",
- "items": {
- "properties": {
- "name": {
- "title": "Name",
- "description": "The name of the prospect.",
- "uiOrder": 0,
- "format": "string"
- },
- "job-title": {
- "title": "Job Title",
- "description": "The job title of the prospect.",
- "uiOrder": 1,
- "format": "string"
- },
- "seniority": {
- "title": "Seniority",
- "description": "The seniority of the prospect.",
- "uiOrder": 2,
- "format": "string"
- },
- "email": {
- "title": "Email",
- "description": "The email address of the prospect.",
- "uiOrder": 3,
- "format": "string"
- },
- "linkedin-url": {
- "title": "LinkedIn URL",
- "description": "The LinkedIn URL of the prospect.",
- "uiOrder": 4,
- "format": "string"
- },
- "company-name": {
- "title": "Company Name",
- "description": "The company name of the prospect.",
- "uiOrder": 5,
- "format": "string"
- },
- "company-description": {
- "title": "Company Description",
- "description": "The description of the company from LeadIQ.",
- "uiOrder": 6,
- "format": "string"
- },
- "company-industry": {
- "title": "Company Industry",
- "description": "The industry of the company from LeadIQ.",
- "uiOrder": 7,
- "format": "string"
- },
- "company-address": {
- "title": "Company Address",
- "description": "The address of the company from LeadIQ. It combines the city, state, and country.",
- "uiOrder": 8,
- "format": "string"
- },
- "company-technologies": {
- "title": "Company Technologies",
- "description": "The technologies used by the company from LeadIQ.",
- "uiOrder": 9,
- "format": "array"
- },
- "company-technology-categories": {
- "title": "Company Technology Categories",
- "description": "The technology categories of the company from LeadIQ.",
- "uiOrder": 10,
- "format": "array"
- },
- "revenue-size": {
- "title": "Revenue Size",
- "description": "The revenue size of the company from LeadIQ.",
- "properties": {
- "min": {
- "title": "Min",
- "description": "The minimum revenue size of the company from LeadIQ.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 0,
- "format": "integer"
- },
- "max": {
- "title": "Max",
- "description": "The maximum revenue size of the company from LeadIQ.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "format": "integer"
- },
- "description": {
- "title": "Description",
- "description": "The description of the revenue size of the company from LeadIQ.",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [],
- "uiOrder": 11,
- "format": "object"
- }
- },
- "required": [],
- "format": "object"
- },
- "uiOrder": 0,
- "format": "array"
- }
- },
- "required": [],
- "uiOrder": 1,
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/leadiq/v0/config/tasks.yaml b/pkg/component/application/leadiq/v0/config/tasks.yaml
new file mode 100644
index 000000000..2b53de037
--- /dev/null
+++ b/pkg/component/application/leadiq/v0/config/tasks.yaml
@@ -0,0 +1,260 @@
+TASK_FIND_PROSPECTS:
+ title: Find Prospects
+ shortDescription: Find prospects' contact information based on the company name
+ you provide.
+ description: Find prospects' contact information based on the company name you provide.
+ And, it will filter out the prospects who are not relevant to your search.
+ input:
+ title: Input
+ description: Provide the information for which you want to find prospects.
+ properties:
+ company:
+ title: Company
+ description: Provide the company information for which you want to find prospects.
+ properties:
+ names:
+ title: Names
+ description: Provide the company names for which you want to find prospects.
+ acceptFormats:
+ - array
+ uiOrder: 0
+ format: array
+ revenue-size:
+ title: Revenue Size
+ description: Provide the min or max revenue size of the company you want
+ to find prospects. If you don't provide any value, it will return all
+ the prospects. If you set the company names, the revenue size will be
+ ignored.
+ properties:
+ min:
+ title: Min
+ description: Provide the minimum revenue size of the company you want
+ to find prospects.
+ acceptFormats:
+ - integer
+ uiOrder: 0
+ format: integer
+ max:
+ title: Max
+ description: Provide the maximum revenue size of the company you want
+ to find prospects.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ format: integer
+ required: []
+ uiOrder: 1
+ format: object
+ countries:
+ title: Countries
+ description: Provide the countries of the company you want to find prospects.
+ If you don't provide any value, it will return all the prospects.
+ acceptFormats:
+ - array
+ uiOrder: 2
+ format: array
+ states:
+ title: States
+ description: Provide the states of the company you want to find prospects.
+ If you don't provide any value, it will return all the prospects.
+ acceptFormats:
+ - array
+ uiOrder: 3
+ format: array
+ cities:
+ title: Cities
+ description: Provide the cities of the company you want to find prospects.
+ If you don't provide any value, it will return all the prospects.
+ acceptFormats:
+ - array
+ uiOrder: 4
+ format: array
+ industries:
+ title: Industries
+ description: Provide the industries of the company you want to find prospects.
+ If you don't provide any value, it will return all the prospects.
+ acceptFormats:
+ - array
+ uiOrder: 5
+ format: array
+ descriptions:
+ title: Descriptions
+ description: Provide the descriptions of the company you want to find
+ prospects. In LeadIQ, it will return the similar companies based on
+ the descriptions.
+ acceptFormats:
+ - array
+ uiOrder: 6
+ format: array
+ technologies:
+ title: Technologies
+ description: Provide the technologies used by the company you want to
+ find prospects. If you don't provide any value, it will return all the
+ prospects.
+ acceptFormats:
+ - array
+ uiOrder: 7
+ format: array
+ required: []
+ uiOrder: 0
+ format: object
+ limit:
+ title: Limit
+ description: Provide the number of prospects you want to find. If you don't
+ provide any value, it will return 10 prospects. The maximum limit is 60.
+ The minimum limit is 1.
+ default: 10
+ maximum: 60
+ minimum: 1
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ format: integer
+ filter-by:
+ title: Filter By
+ description: Provide the information about the prospects you want to filter.
+ You can filter the prospects based on job title, name, seniority, and function.
+ When it matches, the prospect will be included in the output. If you don't
+ provide any value, it will return all the prospects.
+ properties:
+ job-title:
+ title: Job Title
+ description: Provide the job title of the prospects you want to filter
+ with [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions).
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ seniorities:
+ title: Seniorities
+ description: Provide the seniorities of the prospects you want to filter.
+ acceptFormats:
+ - array
+ enum:
+ - Executive
+ - Director
+ - SeniorIndividualContributor
+ - VP
+ - Manager
+ - Other
+ uiOrder: 1
+ format: array
+ function:
+ title: Function
+ description: Provide the function of the prospects you want to filter
+ with [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions).
+ acceptFormats:
+ - string
+ uiOrder: 2
+ format: string
+ required: []
+ uiOrder: 2
+ format: object
+ uiOrder: 0
+ required:
+ - company
+ - limit
+ format: object
+ output:
+ title: Output
+ description: The output will be the list of prospects' contact information based
+ on the company name you provide. It will include the name, job title, seniority,
+ and email address of the prospects, and other company information from LeadIQ
+ provided in the response.
+ properties:
+ prospects:
+ title: Prospects
+ description: The list of prospects' contact information based on the company
+ information you provide.
+ items:
+ properties:
+ name:
+ title: Name
+ description: The name of the prospect.
+ uiOrder: 0
+ format: string
+ job-title:
+ title: Job Title
+ description: The job title of the prospect.
+ uiOrder: 1
+ format: string
+ seniority:
+ title: Seniority
+ description: The seniority of the prospect.
+ uiOrder: 2
+ format: string
+ email:
+ title: Email
+ description: The email address of the prospect.
+ uiOrder: 3
+ format: string
+ linkedin-url:
+ title: LinkedIn URL
+ description: The LinkedIn URL of the prospect.
+ uiOrder: 4
+ format: string
+ company-name:
+ title: Company Name
+ description: The company name of the prospect.
+ uiOrder: 5
+ format: string
+ company-description:
+ title: Company Description
+ description: The description of the company from LeadIQ.
+ uiOrder: 6
+ format: string
+ company-industry:
+ title: Company Industry
+ description: The industry of the company from LeadIQ.
+ uiOrder: 7
+ format: string
+ company-address:
+ title: Company Address
+ description: The address of the company from LeadIQ. It combines the
+ city, state, and country.
+ uiOrder: 8
+ format: string
+ company-technologies:
+ title: Company Technologies
+ description: The technologies used by the company from LeadIQ.
+ uiOrder: 9
+ format: array
+ company-technology-categories:
+ title: Company Technology Categories
+ description: The technology categories of the company from LeadIQ.
+ uiOrder: 10
+ format: array
+ revenue-size:
+ title: Revenue Size
+ description: The revenue size of the company from LeadIQ.
+ properties:
+ min:
+ title: Min
+ description: The minimum revenue size of the company from LeadIQ.
+ acceptFormats:
+ - integer
+ uiOrder: 0
+ format: integer
+ max:
+ title: Max
+ description: The maximum revenue size of the company from LeadIQ.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ format: integer
+ description:
+ title: Description
+ description: The description of the revenue size of the company
+ from LeadIQ.
+ uiOrder: 2
+ format: string
+ required: []
+ uiOrder: 11
+ format: object
+ required: []
+ format: object
+ uiOrder: 0
+ format: array
+ required: []
+ uiOrder: 1
+ format: object
diff --git a/pkg/component/application/leadiq/v0/main.go b/pkg/component/application/leadiq/v0/main.go
index 1e76865a4..2e617bb18 100644
--- a/pkg/component/application/leadiq/v0/main.go
+++ b/pkg/component/application/leadiq/v0/main.go
@@ -25,12 +25,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
//go:embed queries/flat_advanced_search.txt
flatAdvancedSearchQuery string
@@ -59,7 +59,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/numbers/v0/README.mdx b/pkg/component/application/numbers/v0/README.mdx
index c52443fd5..c232a878d 100644
--- a/pkg/component/application/numbers/v0/README.mdx
+++ b/pkg/component/application/numbers/v0/README.mdx
@@ -19,7 +19,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/numbers/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/numbers/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/numbers/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/numbers/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/numbers/v0/config/definition.json b/pkg/component/application/numbers/v0/config/definition.json
deleted file mode 100644
index e41db1b9c..000000000
--- a/pkg/component/application/numbers/v0/config/definition.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "availableTasks": [
- "TASK_REGISTER"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/application/numbers",
- "icon": "assets/numbers.svg",
- "iconUrl": "",
- "id": "numbers",
- "public": true,
- "title": "Numbers Protocol",
- "description": "Seamlessly integrate third-party blockchain services through the Numbers Protocol, providing security, verifiability and traceability to data management.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "70d8664a-d512-4517-a5e8-5d4da81756a7",
- "vendor": "Numbers Protocol",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/numbers/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/numbers/v0/config/definition.yaml b/pkg/component/application/numbers/v0/config/definition.yaml
new file mode 100644
index 000000000..11938101d
--- /dev/null
+++ b/pkg/component/application/numbers/v0/config/definition.yaml
@@ -0,0 +1,19 @@
+availableTasks:
+- TASK_REGISTER
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/application/numbers
+icon: assets/numbers.svg
+iconUrl: ''
+id: numbers
+public: true
+title: Numbers Protocol
+description: Seamlessly integrate third-party blockchain services through the Numbers
+ Protocol, providing security, verifiability and traceability to data management.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: 70d8664a-d512-4517-a5e8-5d4da81756a7
+vendor: Numbers Protocol
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/numbers/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/numbers/v0/config/setup.json b/pkg/component/application/numbers/v0/config/setup.json
deleted file mode 100644
index 2d9c9197c..000000000
--- a/pkg/component/application/numbers/v0/config/setup.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "capture-token": {
- "description": "Fill in your Capture token in the Capture App. To access your tokens, you need a Capture App account and you can sign in with email or wallet to acquire the Capture Token.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "Capture token",
- "format": "string"
- }
- },
- "required": [
- "capture-token"
- ],
- "title": "Numbers Protocol Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/numbers/v0/config/setup.yaml b/pkg/component/application/numbers/v0/config/setup.yaml
new file mode 100644
index 000000000..93b10786b
--- /dev/null
+++ b/pkg/component/application/numbers/v0/config/setup.yaml
@@ -0,0 +1,16 @@
+additionalProperties: false
+properties:
+ capture-token:
+ description: Fill in your Capture token in the Capture App. To access your tokens,
+ you need a Capture App account and you can sign in with email or wallet to acquire
+ the Capture Token.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: Capture token
+ format: string
+required:
+- capture-token
+title: Numbers Protocol Connection
+format: object
diff --git a/pkg/component/application/numbers/v0/config/tasks.json b/pkg/component/application/numbers/v0/config/tasks.json
deleted file mode 100644
index 5b53d6dc7..000000000
--- a/pkg/component/application/numbers/v0/config/tasks.json
+++ /dev/null
@@ -1,153 +0,0 @@
-{
- "TASK_REGISTER": {
- "shortDescription": "Register a file into NumbersProtocol Chain.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "images": {
- "description": "The images you want to upload to blockchain.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "items": {
- "contentEncoding": "base64",
- "format": "string"
- },
- "title": "Images",
- "format": "array"
- },
- "headline": {
- "description": "Headline of the asset.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Headline",
- "format": "string"
- },
- "caption": {
- "description": "Caption of the asset.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Caption",
- "format": "string"
- },
- "asset-creator": {
- "description": "Name of the asset creator.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Asset Creator",
- "format": "string"
- },
- "digital-source-type": {
- "default": "trainedAlgorithmicMedia",
- "description": "Specify the type of the source. More details here.",
- "enum": [
- "trainedAlgorithmicMedia",
- "trainedAlgorithmicData",
- "digitalCapture",
- "digitalArt",
- "algorithmicMedia"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 5,
- "title": "Digital Source Type",
- "format": "string"
- },
- "generated-by": {
- "description": "The AI model used to generate the content.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 6,
- "title": "Generated By",
- "format": "string"
- },
- "license": {
- "description": "License.",
- "uiOrder": 7,
- "properties": {
- "document": {
- "description": "URL of the license file.",
- "acceptFormats": [
- "string"
- ],
- "instillEnableCopyButton": true,
- "uiOrder": 0,
- "title": "License Document",
- "format": "string"
- },
- "name": {
- "description": "License of the asset file.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "License Name",
- "format": "string"
- }
- },
- "required": [],
- "title": "License",
- "format": "object"
- },
- "mining-preference": {
- "default": "notAllowed",
- "description": "Designates the selection made by the asset creators or licensed owners to decide if the asset is suitable for inclusion in a data mining or AI/ML training workflow. More details here.",
- "enum": [
- "dataMining",
- "aiInference",
- "notAllowed",
- "aiGenerativeTraining",
- "aiGenerativeTrainingWithAuthorship",
- "aiTraining",
- "aiTrainingWithAuthorship"
- ],
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Designates the selection made by the asset creators or licensed owners. More details here",
- "uiOrder": 8,
- "title": "Mining Preference",
- "format": "string"
- }
- },
- "required": [
- "images"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "asset-urls": {
- "description": "Asset Urls.",
- "instillEnableCopyButton": true,
- "uiOrder": 0,
- "items": {
- "instillEnableCopyButton": true,
- "title": "Asset Url",
- "format": "string"
- },
- "title": "Asset Urls",
- "format": "array"
- }
- },
- "required": [
- "asset-urls"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/numbers/v0/config/tasks.yaml b/pkg/component/application/numbers/v0/config/tasks.yaml
new file mode 100644
index 000000000..1ad9ebb3b
--- /dev/null
+++ b/pkg/component/application/numbers/v0/config/tasks.yaml
@@ -0,0 +1,122 @@
+TASK_REGISTER:
+ shortDescription: Register a file into NumbersProtocol Chain.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ images:
+ description: The images you want to upload to blockchain.
+ acceptFormats:
+ - array
+ uiOrder: 0
+ items:
+ contentEncoding: base64
+ format: string
+ title: Images
+ format: array
+ headline:
+ description: Headline of the asset.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Headline
+ format: string
+ caption:
+ description: Caption of the asset.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Caption
+ format: string
+ asset-creator:
+ description: Name of the asset creator.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Asset Creator
+ format: string
+ digital-source-type:
+ default: trainedAlgorithmicMedia
+ description: Specify the type of the source. More details here.
+ enum:
+ - trainedAlgorithmicMedia
+ - trainedAlgorithmicData
+ - digitalCapture
+ - digitalArt
+ - algorithmicMedia
+ acceptFormats:
+ - string
+ uiOrder: 5
+ title: Digital Source Type
+ format: string
+ generated-by:
+ description: The AI model used to generate the content.
+ acceptFormats:
+ - string
+ uiOrder: 6
+ title: Generated By
+ format: string
+ license:
+ description: License.
+ uiOrder: 7
+ properties:
+ document:
+ description: URL of the license file.
+ acceptFormats:
+ - string
+ instillEnableCopyButton: true
+ uiOrder: 0
+ title: License Document
+ format: string
+ name:
+ description: License of the asset file.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: License Name
+ format: string
+ required: []
+ title: License
+ format: object
+ mining-preference:
+ default: notAllowed
+ description: Designates the selection made by the asset creators or licensed
+ owners to decide if the asset is suitable for inclusion in a data mining
+ or AI/ML training workflow. More details here.
+ enum:
+ - dataMining
+ - aiInference
+ - notAllowed
+ - aiGenerativeTraining
+ - aiGenerativeTrainingWithAuthorship
+ - aiTraining
+ - aiTrainingWithAuthorship
+ acceptFormats:
+ - string
+ shortDescription: Designates the selection made by the asset creators or licensed
+ owners. More details here
+ uiOrder: 8
+ title: Mining Preference
+ format: string
+ required:
+ - images
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ asset-urls:
+ description: Asset Urls.
+ instillEnableCopyButton: true
+ uiOrder: 0
+ items:
+ instillEnableCopyButton: true
+ title: Asset Url
+ format: string
+ title: Asset Urls
+ format: array
+ required:
+ - asset-urls
+ title: Output
+ format: object
diff --git a/pkg/component/application/numbers/v0/main.go b/pkg/component/application/numbers/v0/main.go
index 41eb05407..39f96f477 100644
--- a/pkg/component/application/numbers/v0/main.go
+++ b/pkg/component/application/numbers/v0/main.go
@@ -28,14 +28,14 @@ const urlUserMe = "https://api.numbersprotocol.io/api/v3/auth/users/me"
var once sync.Once
var comp *component
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
type component struct {
base.Component
@@ -107,7 +107,7 @@ type Output struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/slack/v0/README.mdx b/pkg/component/application/slack/v0/README.mdx
index 905029473..5e052172e 100644
--- a/pkg/component/application/slack/v0/README.mdx
+++ b/pkg/component/application/slack/v0/README.mdx
@@ -20,7 +20,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/slack/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/slack/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/slack/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/slack/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/slack/v0/config/definition.json b/pkg/component/application/slack/v0/config/definition.json
deleted file mode 100644
index ef60b7056..000000000
--- a/pkg/component/application/slack/v0/config/definition.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "availableTasks": [
- "TASK_READ_MESSAGE",
- "TASK_WRITE_MESSAGE"
- ],
- "availableEvents": [
- "EVENT_NEW_MESSAGE"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/application/slack",
- "icon": "assets/slack.svg",
- "iconUrl": "",
- "id": "slack",
- "public": true,
- "title": "Slack",
- "description": "Get and send message on Slack.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "1e9f469e-da5e-46eb-8a89-23466627e3b5",
- "vendor": "Slack",
- "vendorAttributes": {},
- "version": "0.2.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/slack/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/slack/v0/config/definition.yaml b/pkg/component/application/slack/v0/config/definition.yaml
new file mode 100644
index 000000000..423d7eb09
--- /dev/null
+++ b/pkg/component/application/slack/v0/config/definition.yaml
@@ -0,0 +1,21 @@
+availableTasks:
+- TASK_READ_MESSAGE
+- TASK_WRITE_MESSAGE
+availableEvents:
+- EVENT_NEW_MESSAGE
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/application/slack
+icon: assets/slack.svg
+iconUrl: ''
+id: slack
+public: true
+title: Slack
+description: Get and send message on Slack.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: 1e9f469e-da5e-46eb-8a89-23466627e3b5
+vendor: Slack
+vendorAttributes: {}
+version: 0.2.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/slack/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/slack/v0/config/events.json b/pkg/component/application/slack/v0/config/events.json
deleted file mode 100644
index 8b5614ba5..000000000
--- a/pkg/component/application/slack/v0/config/events.json
+++ /dev/null
@@ -1,126 +0,0 @@
-{
- "EVENT_NEW_MESSAGE": {
- "title": "New Message",
- "description": "A new message event from Slack.",
- "configSchema": {
- "properties": {
- "channel-names": {
- "description": "Names of the Slack channels to listen to.",
- "title": "Channel Names",
- "items": {
- "format": "string"
- },
- "format": "array"
- }
- },
- "format": "object"
- },
- "messageSchema": {
- "description": "A new message event from Slack.",
- "properties": {
- "timestamp": {
- "description": "Timestamp of the message.",
- "title": "Timestamp",
- "format": "string"
- },
- "channel": {
- "description": "Channel information.",
- "uiOrder": 1,
- "properties": {
- "id": {
- "description": "Unique ID of the Slack channel.",
- "title": "Channel ID",
- "format": "string"
- },
- "name": {
- "description": "Name of the Slack channel.",
- "title": "Channel Name",
- "format": "string"
- }
- },
- "required": [
- "id",
- "name"
- ],
- "title": "Channel",
- "format": "object"
- },
- "user": {
- "description": "User information.",
- "uiOrder": 2,
- "properties": {
- "id": {
- "description": "Unique ID of the Slack user.",
- "title": "User ID",
- "format": "string"
- },
- "name": {
- "description": "Username of the Slack user.",
- "title": "User Name",
- "format": "string"
- },
- "real-name": {
- "description": "Real name of the Slack user.",
- "title": "Real Name",
- "format": "string"
- },
- "profile": {
- "description": "User profile information.",
- "properties": {
- "display-name": {
- "description": "Display name of the Slack user.",
- "title": "Display Name",
- "format": "string"
- }
- },
- "required": [
- "display-name"
- ],
- "title": "Profile",
- "format": "object"
- }
- },
- "required": [
- "id",
- "name",
- "real-name",
- "profile"
- ],
- "title": "User",
- "format": "object"
- },
- "text": {
- "description": "Content of the message.",
- "title": "Message Text",
- "format": "string"
- }
- },
- "required": [
- "timestamp",
- "channel",
- "user",
- "text"
- ],
- "title": "New Message Event",
- "format": "object"
- },
- "messageExamples": [
- {
- "timestamp": "1715159446.644219",
- "channel": {
- "id": "G0AKFJBEU",
- "name": "test_channel"
- },
- "user": {
- "id": "user123",
- "name": "testuser",
- "real-name": "Test User",
- "profile": {
- "display-name": "testuser"
- }
- },
- "text": "Hello, world!"
- }
- ]
- }
-}
diff --git a/pkg/component/application/slack/v0/config/events.yaml b/pkg/component/application/slack/v0/config/events.yaml
new file mode 100644
index 000000000..59e00be38
--- /dev/null
+++ b/pkg/component/application/slack/v0/config/events.yaml
@@ -0,0 +1,93 @@
+EVENT_NEW_MESSAGE:
+ title: New Message
+ description: A new message event from Slack.
+ configSchema:
+ properties:
+ channel-names:
+ description: Names of the Slack channels to listen to.
+ title: Channel Names
+ items:
+ format: string
+ format: array
+ format: object
+ messageSchema:
+ description: A new message event from Slack.
+ properties:
+ timestamp:
+ description: Timestamp of the message.
+ title: Timestamp
+ format: string
+ channel:
+ description: Channel information.
+ uiOrder: 1
+ properties:
+ id:
+ description: Unique ID of the Slack channel.
+ title: Channel ID
+ format: string
+ name:
+ description: Name of the Slack channel.
+ title: Channel Name
+ format: string
+ required:
+ - id
+ - name
+ title: Channel
+ format: object
+ user:
+ description: User information.
+ uiOrder: 2
+ properties:
+ id:
+ description: Unique ID of the Slack user.
+ title: User ID
+ format: string
+ name:
+ description: Username of the Slack user.
+ title: User Name
+ format: string
+ real-name:
+ description: Real name of the Slack user.
+ title: Real Name
+ format: string
+ profile:
+ description: User profile information.
+ properties:
+ display-name:
+ description: Display name of the Slack user.
+ title: Display Name
+ format: string
+ required:
+ - display-name
+ title: Profile
+ format: object
+ required:
+ - id
+ - name
+ - real-name
+ - profile
+ title: User
+ format: object
+ text:
+ description: Content of the message.
+ title: Message Text
+ format: string
+ required:
+ - timestamp
+ - channel
+ - user
+ - text
+ title: New Message Event
+ format: object
+ messageExamples:
+ - timestamp: '1715159446.644219'
+ channel:
+ id: G0AKFJBEU
+ name: test_channel
+ user:
+ id: user123
+ name: testuser
+ real-name: Test User
+ profile:
+ display-name: testuser
+ text: Hello, world!
diff --git a/pkg/component/application/slack/v0/config/setup.json b/pkg/component/application/slack/v0/config/setup.json
deleted file mode 100644
index 4ff0d412b..000000000
--- a/pkg/component/application/slack/v0/config/setup.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "bot-token": {
- "description": "Token associated to the application bot.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "Bot OAuth Token",
- "format": "string"
- },
- "user-token": {
- "description": "Token to act on behalf of a Slack user.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 1,
- "title": "User OAuth Token",
- "format": "string"
- }
- },
- "required": [
- "bot-token"
- ],
- "instillOAuthConfig": {
- "authUrl": "https://slack.com/oauth/v2/authorize",
- "accessUrl": "https://slack.com/api/oauth.v2.access",
- "scopes": [
- "channels:history",
- "channels:read",
- "groups:history",
- "groups:read",
- "chat:write",
- "users:read",
- "users:read.email",
- "users.profile:read"
- ]
- },
- "title": "Slack Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/slack/v0/config/setup.yaml b/pkg/component/application/slack/v0/config/setup.yaml
new file mode 100644
index 000000000..25a33ccd1
--- /dev/null
+++ b/pkg/component/application/slack/v0/config/setup.yaml
@@ -0,0 +1,34 @@
+additionalProperties: false
+properties:
+ bot-token:
+ description: Token associated to the application bot.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: Bot OAuth Token
+ format: string
+ user-token:
+ description: Token to act on behalf of a Slack user.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 1
+ title: User OAuth Token
+ format: string
+required:
+- bot-token
+instillOAuthConfig:
+ authUrl: https://slack.com/oauth/v2/authorize
+ accessUrl: https://slack.com/api/oauth.v2.access
+ scopes:
+ - channels:history
+ - channels:read
+ - groups:history
+ - groups:read
+ - chat:write
+ - users:read
+ - users:read.email
+ - users.profile:read
+title: Slack Connection
+format: object
diff --git a/pkg/component/application/slack/v0/config/tasks.json b/pkg/component/application/slack/v0/config/tasks.json
deleted file mode 100644
index 174c3ade2..000000000
--- a/pkg/component/application/slack/v0/config/tasks.json
+++ /dev/null
@@ -1,199 +0,0 @@
-{
- "$defs": {
- "user-id": {
- "description": "unique id from Slack.",
- "uiOrder": 0,
- "title": "User UID",
- "format": "string"
- },
- "user-name": {
- "description": "user name in Slack.",
- "uiOrder": 1,
- "title": "User Name",
- "format": "string"
- }
- },
- "TASK_READ_MESSAGE": {
- "shortDescription": "Get the latest message since specific date",
- "input": {
- "description": "Please input the channel name and the date that we want to start to read.",
- "uiOrder": 0,
- "properties": {
- "channel-name": {
- "description": "Channel name, as displayed on Slack.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Channel Name",
- "format": "string"
- },
- "start-to-read-date": {
- "description": "Date (in `YYYY-MM-DD` format) from which messages will start to be fetched. If not provided, it will be 7 days before the current date. The date will be in the UTC timezone.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Start to read date",
- "format": "string"
- }
- },
- "required": [
- "channel-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "All messages in Slack channel.",
- "uiOrder": 0,
- "properties": {
- "conversations": {
- "description": "An array of conversations with thread messages.",
- "uiOrder": 0,
- "title": "Conversations",
- "items": {
- "title": "conversation details",
- "properties": {
- "user-id": {
- "$ref": "#/$defs/user-id"
- },
- "user-name": {
- "$ref": "#/$defs/user-name"
- },
- "message": {
- "description": "message to start a conversation.",
- "uiOrder": 2,
- "title": "Start Conversation Message",
- "format": "string"
- },
- "start-date": {
- "description": "when a conversation starts.",
- "uiOrder": 3,
- "required": [],
- "title": "Start Date",
- "format": "string"
- },
- "last-date": {
- "description": "Date of the last message.",
- "uiOrder": 4,
- "required": [],
- "title": "Last Date",
- "format": "string"
- },
- "thread-reply-messages": {
- "description": "replies in a conversation.",
- "uiOrder": 5,
- "title": "Replied messages",
- "items": {
- "title": "relied details",
- "properties": {
- "user-id": {
- "$ref": "#/$defs/user-id"
- },
- "user-name": {
- "$ref": "#/$defs/user-name"
- },
- "datetime": {
- "description": "replied datetime.",
- "uiOrder": 2,
- "title": "Replied Time",
- "format": "string"
- },
- "message": {
- "description": "message to reply a conversation.",
- "uiOrder": 3,
- "title": "Replied Message",
- "format": "string"
- }
- },
- "required": [
- "user-id",
- "datetime",
- "message"
- ],
- "format": "object"
- },
- "format": "array"
- }
- },
- "required": [
- "user-id",
- "message",
- "start-date"
- ],
- "format": "object"
- },
- "format": "array"
- }
- },
- "required": [
- "conversations"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_WRITE_MESSAGE": {
- "shortDescription": "send message to a specific channel",
- "title": "Send Message",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "channel-name": {
- "description": "Channel name, as displayed on Slack.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Channel Name",
- "format": "string"
- },
- "message": {
- "description": "The message to be sent to the target channel.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Message",
- "format": "string"
- },
- "as-user": {
- "default": false,
- "description": "Send the message on behalf of the user identified by the setup.user-token
field.",
- "uiOrder": 2,
- "title": "Send As User",
- "acceptFormats": [
- "boolean"
- ],
- "format": "boolean"
- }
- },
- "required": [
- "channel-name",
- "message"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "The greeting sentence.",
- "uiOrder": 0,
- "properties": {
- "result": {
- "description": "Result of the message delivery.",
- "uiOrder": 0,
- "required": [],
- "title": "Result",
- "format": "string"
- }
- },
- "required": [
- "result"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/slack/v0/config/tasks.yaml b/pkg/component/application/slack/v0/config/tasks.yaml
new file mode 100644
index 000000000..44f01bd0b
--- /dev/null
+++ b/pkg/component/application/slack/v0/config/tasks.yaml
@@ -0,0 +1,156 @@
+$defs:
+ user-id:
+ description: unique id from Slack.
+ uiOrder: 0
+ title: User UID
+ format: string
+ user-name:
+ description: user name in Slack.
+ uiOrder: 1
+ title: User Name
+ format: string
+TASK_READ_MESSAGE:
+ shortDescription: Get the latest message since specific date
+ input:
+ description: Please input the channel name and the date that we want to start
+ to read.
+ uiOrder: 0
+ properties:
+ channel-name:
+ description: Channel name, as displayed on Slack.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Channel Name
+ format: string
+ start-to-read-date:
+ description: Date (in `YYYY-MM-DD` format) from which messages will start
+ to be fetched. If not provided, it will be 7 days before the current date.
+ The date will be in the UTC timezone.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Start to read date
+ format: string
+ required:
+ - channel-name
+ title: Input
+ format: object
+ output:
+ description: All messages in Slack channel.
+ uiOrder: 0
+ properties:
+ conversations:
+ description: An array of conversations with thread messages.
+ uiOrder: 0
+ title: Conversations
+ items:
+ title: conversation details
+ properties:
+ user-id:
+ $ref: '#/$defs/user-id'
+ user-name:
+ $ref: '#/$defs/user-name'
+ message:
+ description: message to start a conversation.
+ uiOrder: 2
+ title: Start Conversation Message
+ format: string
+ start-date:
+ description: when a conversation starts.
+ uiOrder: 3
+ required: []
+ title: Start Date
+ format: string
+ last-date:
+ description: Date of the last message.
+ uiOrder: 4
+ required: []
+ title: Last Date
+ format: string
+ thread-reply-messages:
+ description: replies in a conversation.
+ uiOrder: 5
+ title: Replied messages
+ items:
+ title: relied details
+ properties:
+ user-id:
+ $ref: '#/$defs/user-id'
+ user-name:
+ $ref: '#/$defs/user-name'
+ datetime:
+ description: replied datetime.
+ uiOrder: 2
+ title: Replied Time
+ format: string
+ message:
+ description: message to reply a conversation.
+ uiOrder: 3
+ title: Replied Message
+ format: string
+ required:
+ - user-id
+ - datetime
+ - message
+ format: object
+ format: array
+ required:
+ - user-id
+ - message
+ - start-date
+ format: object
+ format: array
+ required:
+ - conversations
+ title: Output
+ format: object
+TASK_WRITE_MESSAGE:
+ shortDescription: send message to a specific channel
+ title: Send Message
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ channel-name:
+ description: Channel name, as displayed on Slack.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Channel Name
+ format: string
+ message:
+ description: The message to be sent to the target channel.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Message
+ format: string
+ as-user:
+ default: false
+ description: Send the message on behalf of the user identified by the setup.user-token
+ field.
+ uiOrder: 2
+ title: Send As User
+ acceptFormats:
+ - boolean
+ format: boolean
+ required:
+ - channel-name
+ - message
+ title: Input
+ format: object
+ output:
+ description: The greeting sentence.
+ uiOrder: 0
+ properties:
+ result:
+ description: Result of the message delivery.
+ uiOrder: 0
+ required: []
+ title: Result
+ format: string
+ required:
+ - result
+ title: Output
+ format: object
diff --git a/pkg/component/application/slack/v0/main.go b/pkg/component/application/slack/v0/main.go
index ec109b05e..75c58e78d 100644
--- a/pkg/component/application/slack/v0/main.go
+++ b/pkg/component/application/slack/v0/main.go
@@ -22,13 +22,13 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
- //go:embed config/events.json
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
+ //go:embed config/events.yaml
eventsJSON []byte
once sync.Once
@@ -73,7 +73,7 @@ func (e *execution) userToken() string {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, eventsJSON, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, eventsJSON, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/smartlead/v0/README.mdx b/pkg/component/application/smartlead/v0/README.mdx
index ffdb9078a..bf7ee7755 100644
--- a/pkg/component/application/smartlead/v0/README.mdx
+++ b/pkg/component/application/smartlead/v0/README.mdx
@@ -36,7 +36,7 @@ To achieve the basic use case that creating a campaign from scratch, you need to
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/smartlead/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/smartlead/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/smartlead/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/smartlead/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/smartlead/v0/config/definition.json b/pkg/component/application/smartlead/v0/config/definition.json
deleted file mode 100644
index 5e54376f8..000000000
--- a/pkg/component/application/smartlead/v0/config/definition.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "availableTasks": [
- "TASK_CREATE_CAMPAIGN",
- "TASK_SETUP_CAMPAIGN",
- "TASK_SAVE_SEQUENCES",
- "TASK_GET_SEQUENCES",
- "TASK_ADD_LEADS",
- "TASK_ADD_SENDER_EMAIL",
- "TASK_UPDATE_CAMPAIGN_STATUS",
- "TASK_GET_CAMPAIGN_METRIC",
- "TASK_LIST_LEADS_STATUS"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/application/smartlead",
- "icon": "assets/smartlead.svg",
- "id": "smartlead",
- "public": true,
- "title": "Smartlead",
- "vendor": "Smartlead",
- "description": "Organize your leads and helps you close more deals.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "4a736615-025b-4edf-a736-2a3905b00704",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/smartlead/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/smartlead/v0/config/definition.yaml b/pkg/component/application/smartlead/v0/config/definition.yaml
new file mode 100644
index 000000000..9f5fb4aa0
--- /dev/null
+++ b/pkg/component/application/smartlead/v0/config/definition.yaml
@@ -0,0 +1,23 @@
+availableTasks:
+- TASK_CREATE_CAMPAIGN
+- TASK_SETUP_CAMPAIGN
+- TASK_SAVE_SEQUENCES
+- TASK_GET_SEQUENCES
+- TASK_ADD_LEADS
+- TASK_ADD_SENDER_EMAIL
+- TASK_UPDATE_CAMPAIGN_STATUS
+- TASK_GET_CAMPAIGN_METRIC
+- TASK_LIST_LEADS_STATUS
+documentationUrl: https://www.instill.tech/docs/component/application/smartlead
+icon: assets/smartlead.svg
+id: smartlead
+public: true
+title: Smartlead
+vendor: Smartlead
+description: Organize your leads and helps you close more deals.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: 4a736615-025b-4edf-a736-2a3905b00704
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/smartlead/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/smartlead/v0/config/setup.json b/pkg/component/application/smartlead/v0/config/setup.json
deleted file mode 100644
index 920e9088f..000000000
--- a/pkg/component/application/smartlead/v0/config/setup.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Smartlead API key. You can generate one from your [Smartlead account](https://app.smartlead.ai/app/settings/profile).",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- }
- },
- "required": [
- "api-key"
- ],
- "title": "Smartlead Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/smartlead/v0/config/setup.yaml b/pkg/component/application/smartlead/v0/config/setup.yaml
new file mode 100644
index 000000000..4349a66b8
--- /dev/null
+++ b/pkg/component/application/smartlead/v0/config/setup.yaml
@@ -0,0 +1,15 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Smartlead API key. You can generate one from your [Smartlead
+ account](https://app.smartlead.ai/app/settings/profile).
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: API Key
+ format: string
+required:
+- api-key
+title: Smartlead Connection
+format: object
diff --git a/pkg/component/application/smartlead/v0/config/tasks.json b/pkg/component/application/smartlead/v0/config/tasks.json
deleted file mode 100644
index 3fcd5cb08..000000000
--- a/pkg/component/application/smartlead/v0/config/tasks.json
+++ /dev/null
@@ -1,863 +0,0 @@
-{
- "TASK_CREATE_CAMPAIGN": {
- "title": "Create Campaign",
- "shortDescription": "Create a new campaign. You have to create a campaign before you can start adding leads to it. Please check [Smartlead API document](https://api.smartlead.ai/reference/references#campaign).",
- "input": {
- "title": "Input",
- "description": "Input parameters for creating a campaign.",
- "properties": {
- "name": {
- "title": "Name",
- "description": "Name of the campaign.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "name"
- ],
- "format": "object"
- },
- "output": {
- "title": "Output",
- "description": "Output for creating a campaign. You can use this output in the next task.",
- "properties": {
- "id": {
- "title": "ID",
- "description": "ID of the campaign.",
- "uiOrder": 0,
- "format": "string"
- },
- "created-at": {
- "title": "Created At",
- "description": "Created at timestamp of the campaign.",
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [
- "id",
- "created-at"
- ],
- "format": "object"
- }
- },
- "TASK_SETUP_CAMPAIGN": {
- "title": "Setup Campaign",
- "shortDescription": "Setup a campaign. You can update campaign settings to this campaign. For Smartlead campaign, you will need to setup the schedule settings and general settings.",
- "input": {
- "title": "Input",
- "description": "Input parameters for setting up a campaign.",
- "properties": {
- "campaign-name": {
- "title": "Campaign Name",
- "description": "Name of the campaign.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- },
- "timezone": {
- "title": "Timezone",
- "description": "Timezone of the campaign. Please choose the value in [List of Timezones](https://help.smartlead.ai/Timezones-20fcff9ddbb5441790c7c8e5ce0e9233).",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "days-of-the-week": {
- "title": "Days of the Week",
- "description": "Days of the week when the campaign will run. A number value ranging from 0 to 6; i.e [0,1,2,3,4,5,6]. 0 is Sunday, 1 is Monday, and so on.",
- "items": {
- "acceptFormats": [
- "number"
- ],
- "format": "number"
- },
- "uiOrder": 2,
- "format": "array"
- },
- "start-hour": {
- "title": "Start Hour",
- "description": "Start hour of the campaign. Time to start the campaign in 24-hour format (HH:MM).",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "format": "string"
- },
- "end-hour": {
- "title": "End Hour",
- "description": "End hour of the campaign. Time to end the campaign in 24-hour format (HH:MM).",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "format": "string"
- },
- "min-time-btw-emails": {
- "title": "Minimum Time Between Emails",
- "description": "Minimum time between emails in minutes. The minimum value is 3 minutes.",
- "acceptFormats": [
- "number"
- ],
- "minimum": 3,
- "uiOrder": 5,
- "format": "number"
- },
- "max-new-leads-per-day": {
- "title": "Maximum New Leads Per Day",
- "description": "Maximum new leads per day.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 6,
- "format": "number"
- },
- "schedule-start-time": {
- "title": "Schedule Start Time",
- "description": "Schedule start time of the campaign. Please specify the campaign start time in standard ISO 8601 format. e.g. 2024-11-27T07:29:25.978Z.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 7,
- "format": "string"
- },
- "track-settings": {
- "title": "Track Settings",
- "enum": [
- "DONT_TRACK_EMAIL_OPEN",
- "DONT_TRACK_LINK_CLICK",
- "DONT_TRACK_REPLY_TO_AN_EMAIL"
- ],
- "description": "Tracking settings like not tracking opens or link clicks.",
- "items": {
- "format": "string"
- },
- "uiOrder": 8,
- "format": "array"
- },
- "stop-lead-settings": {
- "title": "Stop Lead Settings",
- "description": "Stops lead if they do the action specified.",
- "enum": [
- "CLICK_ON_A_LINK",
- "OPEN_AN_EMAIL"
- ],
- "uiOrder": 9,
- "format": "string"
- },
- "send-as-plain-text": {
- "title": "Send as Plain Text",
- "description": "Send emails as plain text.",
- "uiOrder": 10,
- "format": "boolean"
- },
- "follow-up-percentage": {
- "title": "Follow Up Percentage",
- "description": "Specifies the percentage of leads in a campaign who should receive follow-up emails.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 11,
- "format": "number"
- },
- "add-unsubscribe-tag": {
- "title": "Add Unsubscribe Tag",
- "description": "Add an unsubscribe tag to the email.",
- "uiOrder": 12,
- "format": "boolean"
- },
- "ignore-ss-mailbox-sending-limit": {
- "title": "Ignore Mailbox Sending Limit",
- "description": "Ignore mailbox sending limits, used when creating a subsequence.",
- "uiOrder": 13,
- "format": "boolean"
- }
- },
- "required": [
- "campaign-name",
- "timezone",
- "days-of-the-week",
- "start-hour",
- "end-hour",
- "min-time-btw-emails",
- "max-new-leads-per-day",
- "schedule-start-time"
- ],
- "format": "object"
- },
- "output": {
- "title": "Output",
- "description": "Output for setting up a campaign.",
- "properties": {
- "result": {
- "title": "Result",
- "description": "Result of setting up a campaign.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "schedule-setting-result",
- "general-setting-result"
- ],
- "format": "object"
- }
- },
- "TASK_SAVE_SEQUENCES": {
- "title": "Save Sequences",
- "shortDescription": "Save sequences to a campaign. A Smartlead sequence is a series of automated emails sent to potential customers based on specific actions, or triggers.",
- "input": {
- "title": "Input",
- "description": "Input parameters for saving sequences.",
- "properties": {
- "campaign-name": {
- "title": "Campaign Name",
- "description": "Name of the campaign.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- },
- "sequences": {
- "title": "Sequences",
- "description": "A Smartlead sequence is a series of automated emails sent to potential customers based on specific actions, or triggers.",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "properties": {
- "seq-number": {
- "title": "Sequence Number",
- "description": "Sequence number means the order of the sequence. If you don't specify this, it will be automatically assigned by the order of the sequences.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 0,
- "format": "number"
- },
- "sequence-delay-days": {
- "title": "Sequence Delay Days",
- "description": "Number of days to wait before sending the next email. If you don't specify this, the default value is 1 day.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 1,
- "default": 1,
- "format": "number"
- },
- "subject": {
- "title": "Subject",
- "description": "Subject of the email. If you want to set the variable according to different leads, you can use {{variable_name}}. It will be replaced by the actual value from the lead.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "format": "string"
- },
- "email-body": {
- "title": "Email Body",
- "description": "Body of the email. If you want to set the variable according to different leads, you can use {{variable_name}}. It will be replaced by the actual value from the lead.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "format": "string"
- }
- },
- "required": [],
- "format": "object"
- },
- "uiOrder": 1,
- "format": "array"
- }
- },
- "required": [
- "campaign-name",
- "sequences"
- ],
- "format": "object"
- },
- "output": {
- "title": "Output",
- "description": "Output for saving sequences.",
- "properties": {
- "result": {
- "title": "Result",
- "description": "Result of saving sequences.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "result"
- ],
- "format": "object"
- }
- },
- "TASK_GET_SEQUENCES": {
- "title": "Get Sequences",
- "shortDescription": "Get sequences of a campaign. If you want to add more sequences to the campaign, you can get the existing sequences and add new sequences to them. And, you can execute `TASK_SAVE_SEQUENCES` to save the sequences.",
- "input": {
- "title": "Input",
- "description": "Input parameters for getting sequences.",
- "properties": {
- "campaign-name": {
- "title": "Campaign Name",
- "description": "Name of the campaign.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "campaign-name"
- ],
- "format": "object"
- },
- "output": {
- "title": "Output",
- "description": "Output for getting sequences.",
- "properties": {
- "sequences": {
- "title": "Sequences",
- "description": "Sequences of the campaign.",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "properties": {
- "seq-id": {
- "title": "Sequence ID",
- "description": "ID of the sequence.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- },
- "seq-number": {
- "title": "Sequence Number",
- "description": "Sequence number means the order of the sequence.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 0,
- "format": "number"
- },
- "sequence-delay-days": {
- "title": "Sequence Delay Days",
- "description": "Number of days to wait before sending the next email.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 1,
- "format": "number"
- },
- "subject": {
- "title": "Subject",
- "description": "Subject of the email when you save the sequence.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "format": "string"
- },
- "email-body": {
- "title": "Email Body",
- "description": "Body of the email when you save the sequence.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "format": "string"
- }
- },
- "required": [],
- "format": "object"
- },
- "uiOrder": 1,
- "format": "array"
- }
- },
- "required": [
- "sequences"
- ],
- "format": "object"
- }
- },
- "TASK_ADD_LEADS": {
- "title": "Add Leads",
- "shortDescription": "Add leads to a campaign.",
- "input": {
- "title": "Input",
- "description": "Input parameters for adding leads.",
- "properties": {
- "campaign-name": {
- "title": "Campaign Name",
- "description": "Name of the campaign.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- },
- "leads": {
- "title": "Leads",
- "description": "Leads to add to the campaign.",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "properties": {
- "email": {
- "title": "Email",
- "description": "Email of the lead.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- },
- "first-name": {
- "title": "First Name",
- "description": "First name of the lead.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "format": "string"
- },
- "last-name": {
- "title": "Last Name",
- "description": "Last name of the lead.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "format": "string"
- },
- "company": {
- "title": "Company",
- "description": "Company name of the lead.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "format": "string"
- },
- "location": {
- "title": "Location",
- "description": "Location of the lead.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "format": "string"
- },
- "custom-fields": {
- "title": "Custom Fields",
- "description": "Custom fields of the lead. You can use custom fields to store additional information about the lead, which can be used in the variable in the sequence email template.",
- "items": {
- "properties": {
- "key": {
- "title": "Key",
- "description": "Key of the custom field.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- },
- "value": {
- "title": "Value",
- "description": "Value of the custom field.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [
- "key",
- "value"
- ]
- },
- "required": [],
- "uiOrder": 5,
- "format": "array"
- }
- },
- "required": [
- "email"
- ],
- "format": "object"
- },
- "uiOrder": 1,
- "format": "array"
- },
- "settings": {
- "title": "Settings",
- "description": "Settings for adding leads.",
- "properties": {
- "ignore-global-block-list": {
- "title": "Ignore Global Block List",
- "description": "Ignore the global block list and add the lead. If true, uploaded leads will BYPASS the global block list and be uploaded to the campaign.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 0,
- "format": "boolean"
- },
- "ignore-unsubscribe-list": {
- "title": "Ignore Unsubscribe List",
- "description": "Ignore the unsubscribe list and add the lead. If true, leads will BYPASS the comparison with unsubscribed leads and be uploaded to the campaign.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 1,
- "format": "boolean"
- },
- "ignore-community-bounce-list": {
- "title": "Ignore Community Bounce List",
- "description": "Ignore the community bounce list and add the lead. If true, uploaded leads will BYPASS any leads that bounced across Smartlead entire user base and be uploaded to the campaign.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 2,
- "format": "boolean"
- },
- "ignore-duplicate-leads-in-other-campaign": {
- "title": "Ignore Duplicate Leads in Other Campaign",
- "description": "Ignore duplicate leads in other campaigns and add the lead. If true, leads will NOT BYPASS the comparison with other campaigns and NOT be added to the campaign if they are part of any other campaign. ",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 3,
- "format": "boolean"
- }
- },
- "uiOrder": 2,
- "required": [
- "ignore-duplicate-leads-in-other-campaign"
- ],
- "format": "object"
- }
- },
- "required": [
- "campaign-name",
- "leads"
- ],
- "format": "object"
- },
- "output": {
- "title": "Output",
- "description": "Output for adding leads.",
- "properties": {
- "upload-count": {
- "title": "Upload Count",
- "description": "Number of leads uploaded.",
- "uiOrder": 0,
- "format": "number"
- },
- "total-leads": {
- "title": "Total Leads",
- "description": "Total number of leads in the campaign.",
- "uiOrder": 1,
- "format": "number"
- },
- "already-added-to-campaign": {
- "title": "Already Added to Campaign",
- "description": "Number of leads already added to the campaign.",
- "uiOrder": 2,
- "format": "number"
- },
- "invalid-email-count": {
- "title": "Invalid Email Count",
- "description": "Number of leads with invalid email.",
- "uiOrder": 3,
- "format": "number"
- },
- "error": {
- "title": "Error",
- "description": "Error message from Smartlead if any.",
- "uiOrder": 4,
- "format": "string"
- }
- },
- "required": [
- "upload-count",
- "total-leads",
- "already-added-to-campaign",
- "invalid-email-count"
- ],
- "format": "object"
- }
- },
- "TASK_ADD_SENDER_EMAIL": {
- "title": "Add Sender Email",
- "shortDescription": "Add a sender email to the campaign. You have to configure the sender email in Smartlead console before adding it to the campaign.",
- "input": {
- "title": "Input",
- "description": "Input parameters for adding a sender email.",
- "properties": {
- "campaign-name": {
- "title": "Campaign Name",
- "description": "Name of the campaign.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- },
- "sender-email": {
- "title": "Sender Email",
- "description": "Email address of the sender. You need to configure the sender email in [Smartlead console](https://app.smartlead.ai/app/email-accounts) before adding it to the campaign.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [
- "campaign-name",
- "sender-email"
- ],
- "format": "object"
- },
- "output": {
- "title": "Output",
- "description": "Output for adding a sender email.",
- "properties": {
- "result": {
- "title": "Result",
- "description": "Result of adding a sender email. If you don't configure your sender email in Smartlead console, you will get an error.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "result"
- ],
- "format": "object"
- }
- },
- "TASK_UPDATE_CAMPAIGN_STATUS": {
- "title": "Update Campaign Status",
- "shortDescription": "Update the status of a campaign. You need to start a campaign to send the emails to the leads.",
- "input": {
- "title": "Input",
- "description": "Input parameters for updating the status of a campaign.",
- "properties": {
- "campaign-name": {
- "title": "Campaign Name",
- "description": "Name of the campaign.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- },
- "status": {
- "title": "Status",
- "description": "Status of the campaign.",
- "enum": [
- "START",
- "PAUSED",
- "STOPPED"
- ],
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [
- "campaign-name",
- "status"
- ],
- "format": "object"
- },
- "output": {
- "title": "Output",
- "description": "Output for updating the status of a campaign.",
- "properties": {
- "result": {
- "title": "Result",
- "description": "Result of updating the status of a campaign.",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "result"
- ],
- "format": "object"
- }
- },
- "TASK_GET_CAMPAIGN_METRIC": {
- "title": "Get Campaign Metric",
- "shortDescription": "Get the metrics of a campaign. You can get the metrics like open count, click count, and reply count of the campaign.",
- "input": {
- "title": "Input",
- "description": "Input parameters for getting the metrics of a campaign.",
- "properties": {
- "campaign-name": {
- "title": "Campaign Name",
- "description": "Name of the campaign.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "campaign-name"
- ],
- "format": "object"
- },
- "output": {
- "title": "Output",
- "description": "Output for getting the metrics of a campaign.",
- "properties": {
- "sent-count": {
- "title": "Sent Count",
- "description": "Number of emails sent.",
- "uiOrder": 0,
- "format": "number"
- },
- "unique-sent-count": {
- "title": "Unique Sent Count",
- "description": "Number of unique emails sent.",
- "uiOrder": 1,
- "format": "number"
- },
- "open-count": {
- "title": "Open Count",
- "description": "Number of emails opened.",
- "uiOrder": 2,
- "format": "number"
- },
- "unique-open-count": {
- "title": "Unique Open Count",
- "description": "Number of unique emails opened.",
- "uiOrder": 3,
- "format": "number"
- },
- "click-count": {
- "title": "Click Count",
- "description": "Number of emails clicked.",
- "uiOrder": 4,
- "format": "number"
- },
- "unique-click-count": {
- "title": "Unique Click Count",
- "description": "Number of unique emails clicked.",
- "uiOrder": 5,
- "format": "number"
- },
- "reply-count": {
- "title": "Reply Count",
- "description": "Number of emails replied.",
- "uiOrder": 6,
- "format": "number"
- },
- "total-count": {
- "title": "Total Count",
- "description": "Total number of emails.",
- "uiOrder": 7,
- "format": "number"
- },
- "bounce-count": {
- "title": "Bounce Count",
- "description": "Number of emails bounced.",
- "uiOrder": 8,
- "format": "number"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "TASK_LIST_LEADS_STATUS": {
- "title": "List Leads Status",
- "shortDescription": "List the status of leads in a campaign. You can get the status of leads like 'STARTED', 'INPROGRESS', 'COMPLETED', 'PAUSED', 'STOPPED'.",
- "input": {
- "title": "Input",
- "description": "Input parameters for listing the status of leads.",
- "properties": {
- "campaign-name": {
- "title": "Campaign Name",
- "description": "Name of the campaign.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "format": "string"
- },
- "limit": {
- "title": "Limit",
- "description": "Number of leads to list. The minimum value is 1.",
- "minimum": 1,
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 1,
- "format": "number"
- }
- },
- "required": [
- "campaign-name",
- "limit"
- ],
- "format": "object"
- },
- "output": {
- "title": "Output",
- "description": "Output for listing the status of leads.",
- "properties": {
- "leads": {
- "title": "Leads",
- "description": "Lead status in the campaign.",
- "items": {
- "properties": {
- "email": {
- "title": "Email",
- "description": "Email of the lead.",
- "uiOrder": 0,
- "format": "string"
- },
- "status": {
- "title": "Status",
- "description": "Status of the lead.",
- "uiOrder": 1,
- "format": "string"
- }
- },
- "required": [
- "email",
- "status"
- ],
- "format": "object"
- },
- "uiOrder": 0,
- "format": "array"
- }
- },
- "required": [
- "leads"
- ],
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/smartlead/v0/config/tasks.yaml b/pkg/component/application/smartlead/v0/config/tasks.yaml
new file mode 100644
index 000000000..dc41cd5ac
--- /dev/null
+++ b/pkg/component/application/smartlead/v0/config/tasks.yaml
@@ -0,0 +1,703 @@
+TASK_CREATE_CAMPAIGN:
+ title: Create Campaign
+ shortDescription: Create a new campaign. You have to create a campaign before you
+ can start adding leads to it. Please check [Smartlead API document](https://api.smartlead.ai/reference/references#campaign).
+ input:
+ title: Input
+ description: Input parameters for creating a campaign.
+ properties:
+ name:
+ title: Name
+ description: Name of the campaign.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ required:
+ - name
+ format: object
+ output:
+ title: Output
+ description: Output for creating a campaign. You can use this output in the next
+ task.
+ properties:
+ id:
+ title: ID
+ description: ID of the campaign.
+ uiOrder: 0
+ format: string
+ created-at:
+ title: Created At
+ description: Created at timestamp of the campaign.
+ uiOrder: 1
+ format: string
+ required:
+ - id
+ - created-at
+ format: object
+TASK_SETUP_CAMPAIGN:
+ title: Setup Campaign
+ shortDescription: Setup a campaign. You can update campaign settings to this campaign.
+ For Smartlead campaign, you will need to setup the schedule settings and general
+ settings.
+ input:
+ title: Input
+ description: Input parameters for setting up a campaign.
+ properties:
+ campaign-name:
+ title: Campaign Name
+ description: Name of the campaign.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ timezone:
+ title: Timezone
+ description: Timezone of the campaign. Please choose the value in [List of
+ Timezones](https://help.smartlead.ai/Timezones-20fcff9ddbb5441790c7c8e5ce0e9233).
+ acceptFormats:
+ - string
+ uiOrder: 1
+ format: string
+ days-of-the-week:
+ title: Days of the Week
+ description: Days of the week when the campaign will run. A number value ranging
+ from 0 to 6; i.e [0,1,2,3,4,5,6]. 0 is Sunday, 1 is Monday, and so on.
+ items:
+ acceptFormats:
+ - number
+ format: number
+ uiOrder: 2
+ format: array
+ start-hour:
+ title: Start Hour
+ description: Start hour of the campaign. Time to start the campaign in 24-hour
+ format (HH:MM).
+ acceptFormats:
+ - string
+ uiOrder: 3
+ format: string
+ end-hour:
+ title: End Hour
+ description: End hour of the campaign. Time to end the campaign in 24-hour
+ format (HH:MM).
+ acceptFormats:
+ - string
+ uiOrder: 4
+ format: string
+ min-time-btw-emails:
+ title: Minimum Time Between Emails
+ description: Minimum time between emails in minutes. The minimum value is
+ 3 minutes.
+ acceptFormats:
+ - number
+ minimum: 3
+ uiOrder: 5
+ format: number
+ max-new-leads-per-day:
+ title: Maximum New Leads Per Day
+ description: Maximum new leads per day.
+ acceptFormats:
+ - number
+ uiOrder: 6
+ format: number
+ schedule-start-time:
+ title: Schedule Start Time
+ description: Schedule start time of the campaign. Please specify the campaign
+ start time in standard ISO 8601 format. e.g. 2024-11-27T07:29:25.978Z.
+ acceptFormats:
+ - string
+ uiOrder: 7
+ format: string
+ track-settings:
+ title: Track Settings
+ enum:
+ - DONT_TRACK_EMAIL_OPEN
+ - DONT_TRACK_LINK_CLICK
+ - DONT_TRACK_REPLY_TO_AN_EMAIL
+ description: Tracking settings like not tracking opens or link clicks.
+ items:
+ format: string
+ uiOrder: 8
+ format: array
+ stop-lead-settings:
+ title: Stop Lead Settings
+ description: Stops lead if they do the action specified.
+ enum:
+ - CLICK_ON_A_LINK
+ - OPEN_AN_EMAIL
+ uiOrder: 9
+ format: string
+ send-as-plain-text:
+ title: Send as Plain Text
+ description: Send emails as plain text.
+ uiOrder: 10
+ format: boolean
+ follow-up-percentage:
+ title: Follow Up Percentage
+ description: Specifies the percentage of leads in a campaign who should receive
+ follow-up emails.
+ acceptFormats:
+ - number
+ uiOrder: 11
+ format: number
+ add-unsubscribe-tag:
+ title: Add Unsubscribe Tag
+ description: Add an unsubscribe tag to the email.
+ uiOrder: 12
+ format: boolean
+ ignore-ss-mailbox-sending-limit:
+ title: Ignore Mailbox Sending Limit
+ description: Ignore mailbox sending limits, used when creating a subsequence.
+ uiOrder: 13
+ format: boolean
+ required:
+ - campaign-name
+ - timezone
+ - days-of-the-week
+ - start-hour
+ - end-hour
+ - min-time-btw-emails
+ - max-new-leads-per-day
+ - schedule-start-time
+ format: object
+ output:
+ title: Output
+ description: Output for setting up a campaign.
+ properties:
+ result:
+ title: Result
+ description: Result of setting up a campaign.
+ uiOrder: 0
+ format: string
+ required:
+ - schedule-setting-result
+ - general-setting-result
+ format: object
+TASK_SAVE_SEQUENCES:
+ title: Save Sequences
+ shortDescription: Save sequences to a campaign. A Smartlead sequence is a series
+ of automated emails sent to potential customers based on specific actions, or
+ triggers.
+ input:
+ title: Input
+ description: Input parameters for saving sequences.
+ properties:
+ campaign-name:
+ title: Campaign Name
+ description: Name of the campaign.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ sequences:
+ title: Sequences
+ description: A Smartlead sequence is a series of automated emails sent to
+ potential customers based on specific actions, or triggers.
+ acceptFormats:
+ - array
+ items:
+ properties:
+ seq-number:
+ title: Sequence Number
+ description: Sequence number means the order of the sequence. If you
+ don't specify this, it will be automatically assigned by the order
+ of the sequences.
+ acceptFormats:
+ - number
+ uiOrder: 0
+ format: number
+ sequence-delay-days:
+ title: Sequence Delay Days
+ description: Number of days to wait before sending the next email. If
+ you don't specify this, the default value is 1 day.
+ acceptFormats:
+ - number
+ uiOrder: 1
+ default: 1
+ format: number
+ subject:
+ title: Subject
+ description: Subject of the email. If you want to set the variable according
+ to different leads, you can use {{variable_name}}. It will be replaced
+ by the actual value from the lead.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ format: string
+ email-body:
+ title: Email Body
+ description: Body of the email. If you want to set the variable according
+ to different leads, you can use {{variable_name}}. It will be replaced
+ by the actual value from the lead.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ format: string
+ required: []
+ format: object
+ uiOrder: 1
+ format: array
+ required:
+ - campaign-name
+ - sequences
+ format: object
+ output:
+ title: Output
+ description: Output for saving sequences.
+ properties:
+ result:
+ title: Result
+ description: Result of saving sequences.
+ uiOrder: 0
+ format: string
+ required:
+ - result
+ format: object
+TASK_GET_SEQUENCES:
+ title: Get Sequences
+ shortDescription: Get sequences of a campaign. If you want to add more sequences
+ to the campaign, you can get the existing sequences and add new sequences to them.
+ And, you can execute `TASK_SAVE_SEQUENCES` to save the sequences.
+ input:
+ title: Input
+ description: Input parameters for getting sequences.
+ properties:
+ campaign-name:
+ title: Campaign Name
+ description: Name of the campaign.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ required:
+ - campaign-name
+ format: object
+ output:
+ title: Output
+ description: Output for getting sequences.
+ properties:
+ sequences:
+ title: Sequences
+ description: Sequences of the campaign.
+ acceptFormats:
+ - array
+ items:
+ properties:
+ seq-id:
+ title: Sequence ID
+ description: ID of the sequence.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ seq-number:
+ title: Sequence Number
+ description: Sequence number means the order of the sequence.
+ acceptFormats:
+ - number
+ uiOrder: 0
+ format: number
+ sequence-delay-days:
+ title: Sequence Delay Days
+ description: Number of days to wait before sending the next email.
+ acceptFormats:
+ - number
+ uiOrder: 1
+ format: number
+ subject:
+ title: Subject
+ description: Subject of the email when you save the sequence.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ format: string
+ email-body:
+ title: Email Body
+ description: Body of the email when you save the sequence.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ format: string
+ required: []
+ format: object
+ uiOrder: 1
+ format: array
+ required:
+ - sequences
+ format: object
+TASK_ADD_LEADS:
+ title: Add Leads
+ shortDescription: Add leads to a campaign.
+ input:
+ title: Input
+ description: Input parameters for adding leads.
+ properties:
+ campaign-name:
+ title: Campaign Name
+ description: Name of the campaign.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ leads:
+ title: Leads
+ description: Leads to add to the campaign.
+ acceptFormats:
+ - array
+ items:
+ properties:
+ email:
+ title: Email
+ description: Email of the lead.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ first-name:
+ title: First Name
+ description: First name of the lead.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ format: string
+ last-name:
+ title: Last Name
+ description: Last name of the lead.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ format: string
+ company:
+ title: Company
+ description: Company name of the lead.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ format: string
+ location:
+ title: Location
+ description: Location of the lead.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ format: string
+ custom-fields:
+ title: Custom Fields
+ description: Custom fields of the lead. You can use custom fields to
+ store additional information about the lead, which can be used in
+ the variable in the sequence email template.
+ items:
+ properties:
+ key:
+ title: Key
+ description: Key of the custom field.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ value:
+ title: Value
+ description: Value of the custom field.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ format: string
+ required:
+ - key
+ - value
+ required: []
+ uiOrder: 5
+ format: array
+ required:
+ - email
+ format: object
+ uiOrder: 1
+ format: array
+ settings:
+ title: Settings
+ description: Settings for adding leads.
+ properties:
+ ignore-global-block-list:
+ title: Ignore Global Block List
+ description: Ignore the global block list and add the lead. If true, uploaded
+ leads will BYPASS the global block list and be uploaded to the campaign.
+ acceptFormats:
+ - boolean
+ uiOrder: 0
+ format: boolean
+ ignore-unsubscribe-list:
+ title: Ignore Unsubscribe List
+ description: Ignore the unsubscribe list and add the lead. If true, leads
+ will BYPASS the comparison with unsubscribed leads and be uploaded to
+ the campaign.
+ acceptFormats:
+ - boolean
+ uiOrder: 1
+ format: boolean
+ ignore-community-bounce-list:
+ title: Ignore Community Bounce List
+ description: Ignore the community bounce list and add the lead. If true,
+ uploaded leads will BYPASS any leads that bounced across Smartlead entire
+ user base and be uploaded to the campaign.
+ acceptFormats:
+ - boolean
+ uiOrder: 2
+ format: boolean
+ ignore-duplicate-leads-in-other-campaign:
+ title: Ignore Duplicate Leads in Other Campaign
+ description: 'Ignore duplicate leads in other campaigns and add the lead.
+ If true, leads will NOT BYPASS the comparison with other campaigns and
+ NOT be added to the campaign if they are part of any other campaign. '
+ acceptFormats:
+ - boolean
+ uiOrder: 3
+ format: boolean
+ uiOrder: 2
+ required:
+ - ignore-duplicate-leads-in-other-campaign
+ format: object
+ required:
+ - campaign-name
+ - leads
+ format: object
+ output:
+ title: Output
+ description: Output for adding leads.
+ properties:
+ upload-count:
+ title: Upload Count
+ description: Number of leads uploaded.
+ uiOrder: 0
+ format: number
+ total-leads:
+ title: Total Leads
+ description: Total number of leads in the campaign.
+ uiOrder: 1
+ format: number
+ already-added-to-campaign:
+ title: Already Added to Campaign
+ description: Number of leads already added to the campaign.
+ uiOrder: 2
+ format: number
+ invalid-email-count:
+ title: Invalid Email Count
+ description: Number of leads with invalid email.
+ uiOrder: 3
+ format: number
+ error:
+ title: Error
+ description: Error message from Smartlead if any.
+ uiOrder: 4
+ format: string
+ required:
+ - upload-count
+ - total-leads
+ - already-added-to-campaign
+ - invalid-email-count
+ format: object
+TASK_ADD_SENDER_EMAIL:
+ title: Add Sender Email
+ shortDescription: Add a sender email to the campaign. You have to configure the
+ sender email in Smartlead console before adding it to the campaign.
+ input:
+ title: Input
+ description: Input parameters for adding a sender email.
+ properties:
+ campaign-name:
+ title: Campaign Name
+ description: Name of the campaign.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ sender-email:
+ title: Sender Email
+ description: Email address of the sender. You need to configure the sender
+ email in [Smartlead console](https://app.smartlead.ai/app/email-accounts)
+ before adding it to the campaign.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ format: string
+ required:
+ - campaign-name
+ - sender-email
+ format: object
+ output:
+ title: Output
+ description: Output for adding a sender email.
+ properties:
+ result:
+ title: Result
+ description: Result of adding a sender email. If you don't configure your
+ sender email in Smartlead console, you will get an error.
+ uiOrder: 0
+ format: string
+ required:
+ - result
+ format: object
+TASK_UPDATE_CAMPAIGN_STATUS:
+ title: Update Campaign Status
+ shortDescription: Update the status of a campaign. You need to start a campaign
+ to send the emails to the leads.
+ input:
+ title: Input
+ description: Input parameters for updating the status of a campaign.
+ properties:
+ campaign-name:
+ title: Campaign Name
+ description: Name of the campaign.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ status:
+ title: Status
+ description: Status of the campaign.
+ enum:
+ - START
+ - PAUSED
+ - STOPPED
+ uiOrder: 1
+ format: string
+ required:
+ - campaign-name
+ - status
+ format: object
+ output:
+ title: Output
+ description: Output for updating the status of a campaign.
+ properties:
+ result:
+ title: Result
+ description: Result of updating the status of a campaign.
+ uiOrder: 0
+ format: string
+ required:
+ - result
+ format: object
+TASK_GET_CAMPAIGN_METRIC:
+ title: Get Campaign Metric
+ shortDescription: Get the metrics of a campaign. You can get the metrics like open
+ count, click count, and reply count of the campaign.
+ input:
+ title: Input
+ description: Input parameters for getting the metrics of a campaign.
+ properties:
+ campaign-name:
+ title: Campaign Name
+ description: Name of the campaign.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ required:
+ - campaign-name
+ format: object
+ output:
+ title: Output
+ description: Output for getting the metrics of a campaign.
+ properties:
+ sent-count:
+ title: Sent Count
+ description: Number of emails sent.
+ uiOrder: 0
+ format: number
+ unique-sent-count:
+ title: Unique Sent Count
+ description: Number of unique emails sent.
+ uiOrder: 1
+ format: number
+ open-count:
+ title: Open Count
+ description: Number of emails opened.
+ uiOrder: 2
+ format: number
+ unique-open-count:
+ title: Unique Open Count
+ description: Number of unique emails opened.
+ uiOrder: 3
+ format: number
+ click-count:
+ title: Click Count
+ description: Number of emails clicked.
+ uiOrder: 4
+ format: number
+ unique-click-count:
+ title: Unique Click Count
+ description: Number of unique emails clicked.
+ uiOrder: 5
+ format: number
+ reply-count:
+ title: Reply Count
+ description: Number of emails replied.
+ uiOrder: 6
+ format: number
+ total-count:
+ title: Total Count
+ description: Total number of emails.
+ uiOrder: 7
+ format: number
+ bounce-count:
+ title: Bounce Count
+ description: Number of emails bounced.
+ uiOrder: 8
+ format: number
+ required: []
+ format: object
+TASK_LIST_LEADS_STATUS:
+ title: List Leads Status
+ shortDescription: List the status of leads in a campaign. You can get the status
+ of leads like 'STARTED', 'INPROGRESS', 'COMPLETED', 'PAUSED', 'STOPPED'.
+ input:
+ title: Input
+ description: Input parameters for listing the status of leads.
+ properties:
+ campaign-name:
+ title: Campaign Name
+ description: Name of the campaign.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ format: string
+ limit:
+ title: Limit
+ description: Number of leads to list. The minimum value is 1.
+ minimum: 1
+ acceptFormats:
+ - number
+ uiOrder: 1
+ format: number
+ required:
+ - campaign-name
+ - limit
+ format: object
+ output:
+ title: Output
+ description: Output for listing the status of leads.
+ properties:
+ leads:
+ title: Leads
+ description: Lead status in the campaign.
+ items:
+ properties:
+ email:
+ title: Email
+ description: Email of the lead.
+ uiOrder: 0
+ format: string
+ status:
+ title: Status
+ description: Status of the lead.
+ uiOrder: 1
+ format: string
+ required:
+ - email
+ - status
+ format: object
+ uiOrder: 0
+ format: array
+ required:
+ - leads
+ format: object
diff --git a/pkg/component/application/smartlead/v0/main.go b/pkg/component/application/smartlead/v0/main.go
index 5650deaa9..0a2bdf769 100644
--- a/pkg/component/application/smartlead/v0/main.go
+++ b/pkg/component/application/smartlead/v0/main.go
@@ -31,12 +31,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -55,7 +55,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/application/whatsapp/v0/README.mdx b/pkg/component/application/whatsapp/v0/README.mdx
index 59d7c14c7..1cd4df68a 100644
--- a/pkg/component/application/whatsapp/v0/README.mdx
+++ b/pkg/component/application/whatsapp/v0/README.mdx
@@ -27,7 +27,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/whatsapp/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/whatsapp/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/whatsapp/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/whatsapp/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/application/whatsapp/v0/config/definition.json b/pkg/component/application/whatsapp/v0/config/definition.json
deleted file mode 100644
index 225186309..000000000
--- a/pkg/component/application/whatsapp/v0/config/definition.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "availableTasks": [
- "TASK_SEND_TEXT_BASED_TEMPLATE_MESSAGE",
- "TASK_SEND_MEDIA_BASED_TEMPLATE_MESSAGE",
- "TASK_SEND_LOCATION_BASED_TEMPLATE_MESSAGE",
- "TASK_SEND_AUTHENTICATION_TEMPLATE_MESSAGE",
- "TASK_SEND_TEXT_MESSAGE",
- "TASK_SEND_MEDIA_MESSAGE",
- "TASK_SEND_LOCATION_MESSAGE",
- "TASK_SEND_CONTACT_MESSAGE",
- "TASK_SEND_INTERACTIVE_CALL_TO_ACTION_URL_BUTTON_MESSAGE"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/application/whatsapp",
- "icon": "assets/whatsapp.svg",
- "id": "whatsapp",
- "public": true,
- "title": "WhatsApp",
- "description": "Use WhatsApp Business Platform API to send template and messages.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_APPLICATION",
- "uid": "028c0ce7-94ff-4ac2-9324-d9a362724eed",
- "vendor": "WhatsApp",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/whatsapp/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/application/whatsapp/v0/config/definition.yaml b/pkg/component/application/whatsapp/v0/config/definition.yaml
new file mode 100644
index 000000000..916669351
--- /dev/null
+++ b/pkg/component/application/whatsapp/v0/config/definition.yaml
@@ -0,0 +1,24 @@
+availableTasks:
+- TASK_SEND_TEXT_BASED_TEMPLATE_MESSAGE
+- TASK_SEND_MEDIA_BASED_TEMPLATE_MESSAGE
+- TASK_SEND_LOCATION_BASED_TEMPLATE_MESSAGE
+- TASK_SEND_AUTHENTICATION_TEMPLATE_MESSAGE
+- TASK_SEND_TEXT_MESSAGE
+- TASK_SEND_MEDIA_MESSAGE
+- TASK_SEND_LOCATION_MESSAGE
+- TASK_SEND_CONTACT_MESSAGE
+- TASK_SEND_INTERACTIVE_CALL_TO_ACTION_URL_BUTTON_MESSAGE
+documentationUrl: https://www.instill.tech/docs/component/application/whatsapp
+icon: assets/whatsapp.svg
+id: whatsapp
+public: true
+title: WhatsApp
+description: Use WhatsApp Business Platform API to send template and messages.
+tombstone: false
+type: COMPONENT_TYPE_APPLICATION
+uid: 028c0ce7-94ff-4ac2-9324-d9a362724eed
+vendor: WhatsApp
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/whatsapp/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/application/whatsapp/v0/config/setup.json b/pkg/component/application/whatsapp/v0/config/setup.json
deleted file mode 100644
index de22458ec..000000000
--- a/pkg/component/application/whatsapp/v0/config/setup.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "token": {
- "description": "Fill in your WhatsApp access token. Go [here](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started) for more information.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "Token",
- "format": "string"
- }
- },
- "required": [
- "token"
- ],
- "title": "WhatsApp Connection",
- "format": "object"
-}
diff --git a/pkg/component/application/whatsapp/v0/config/setup.yaml b/pkg/component/application/whatsapp/v0/config/setup.yaml
new file mode 100644
index 000000000..d650d33f7
--- /dev/null
+++ b/pkg/component/application/whatsapp/v0/config/setup.yaml
@@ -0,0 +1,15 @@
+additionalProperties: false
+properties:
+ token:
+ description: Fill in your WhatsApp access token. Go [here](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started)
+ for more information.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: Token
+ format: string
+required:
+- token
+title: WhatsApp Connection
+format: object
diff --git a/pkg/component/application/whatsapp/v0/config/tasks.json b/pkg/component/application/whatsapp/v0/config/tasks.json
deleted file mode 100644
index 94e1403b2..000000000
--- a/pkg/component/application/whatsapp/v0/config/tasks.json
+++ /dev/null
@@ -1,856 +0,0 @@
-{
- "$defs": {
- "def-input": {
- "phone-number-id": {
- "description": "Phone Number ID. Obtainable through the app dashboard. Note: This is for sender.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Phone Number ID",
- "format": "string"
- },
- "to": {
- "description": "The number of the recipient you are sending the message to.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Recipient Phone Number",
- "format": "string"
- },
- "template": {
- "name": {
- "description": "Name of the template.",
- "acceptFormats": [
- "string"
- ],
- "title": "Template Name",
- "format": "string"
- },
- "language-code": {
- "description": "The code of the language in which the template is used. [Supported languages](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages).",
- "acceptFormats": [
- "string"
- ],
- "title": "Language Code",
- "format": "string"
- },
- "body-parameters": {
- "description": "Specify the parameters for the body section of the template. Leave this blank if there is no parameter.",
- "title": "Body Parameters",
- "items": {
- "title": "Body Parameter",
- "description": "Body parameter.",
- "format": "string"
- },
- "format": "array"
- },
- "button-parameters": {
- "description": "Specify the parameters for button(s). Leave this blank if there is no parameter. Follow this format or it won't work: button_index;button_type;value_of_the_parameter. The seperator is a semicolon. button_index starts at 0. Example: 0;quick_reply;randomvalue. Note: This button parameter only support three types 'quick_reply', 'url' and 'copy_code'.",
- "title": "Button Parameters",
- "items": {
- "title": "Button Parameter",
- "description": "Button parameter.",
- "format": "string"
- },
- "format": "array"
- }
- },
- "media": {
- "id-or-link": {
- "description": "Input either ID or link of the media. If the input has 'http', it will be considered as a link.",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "caption": {
- "description": "Media asset caption. Description of the media. This property cannot be used when the media type is audio. If audio tried to use this property, it will be ignored.",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "filename": {
- "description": "The filename of the document. Only document can use this property. This property will specify what format the document is displayed as in WhatsApp. If other media type tried to use this property, it will be ignored.",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- },
- "location": {
- "latitude": {
- "description": "Location latitude.",
- "acceptFormats": [
- "number"
- ],
- "format": "number"
- },
- "longitude": {
- "description": "Location longitude.",
- "acceptFormats": [
- "number"
- ],
- "format": "number"
- },
- "location-name": {
- "description": "Name of the location.",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- },
- "address": {
- "description": "Address of the location.",
- "acceptFormats": [
- "string"
- ],
- "format": "string"
- }
- }
- },
- "def-output": {
- "recipient-wa-id": {
- "description": "The WhatsApp ID of the recipient. Most likely the same with their phone number.",
- "uiOrder": 0,
- "title": "Recipient WhatsApp ID",
- "format": "string"
- },
- "message-id": {
- "description": "The ID of the message.",
- "uiOrder": 1,
- "title": "Message ID",
- "format": "string"
- },
- "message-status": {
- "description": "The status of the message.",
- "uiOrder": 2,
- "title": "Message Status",
- "format": "string"
- }
- }
- },
- "TASK_SEND_TEXT_BASED_TEMPLATE_MESSAGE": {
- "shortDescription": "Send text-based template message. This task support header(text), body and button parameters.",
- "input": {
- "description": "Template information.",
- "uiOrder": 0,
- "properties": {
- "phone-number-id": {
- "$ref": "#/$defs/def-input/phone-number-id"
- },
- "to": {
- "$ref": "#/$defs/def-input/to"
- },
- "name": {
- "$ref": "#/$defs/def-input/template/name",
- "uiOrder": 2
- },
- "language-code": {
- "$ref": "#/$defs/def-input/template/language-code",
- "uiOrder": 3
- },
- "header-parameters": {
- "description": "Specify the parameters for the header section of the template. Leave this blank if there is no parameter.",
- "uiOrder": 4,
- "title": "Header Parameters",
- "items": {
- "title": "Header Parameter",
- "description": "Header parameter.",
- "format": "string"
- },
- "format": "array"
- },
- "body-parameters": {
- "$ref": "#/$defs/def-input/template/body-parameters",
- "uiOrder": 5
- },
- "button-parameters": {
- "$ref": "#/$defs/def-input/template/button-parameters",
- "uiOrder": 6
- }
- },
- "required": [
- "phone-number-id",
- "to",
- "name",
- "language-code"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "API response.",
- "uiOrder": 0,
- "properties": {
- "recipient-wa-id": {
- "$ref": "#/$defs/def-output/recipient-wa-id"
- },
- "message-id": {
- "$ref": "#/$defs/def-output/message-id"
- },
- "message-status": {
- "$ref": "#/$defs/def-output/message-status"
- }
- },
- "required": [
- "recipient-wa-id",
- "message-id",
- "message-status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEND_MEDIA_BASED_TEMPLATE_MESSAGE": {
- "shortDescription": "Send media-based template message. This task support header(image, document & video), body and button parameters.",
- "input": {
- "description": "Template information.",
- "uiOrder": 0,
- "properties": {
- "phone-number-id": {
- "$ref": "#/$defs/def-input/phone-number-id"
- },
- "to": {
- "$ref": "#/$defs/def-input/to"
- },
- "name": {
- "$ref": "#/$defs/def-input/template/name",
- "uiOrder": 2
- },
- "language-code": {
- "$ref": "#/$defs/def-input/template/language-code",
- "uiOrder": 3
- },
- "media-type": {
- "enum": [
- "image",
- "video",
- "document"
- ],
- "example": "none",
- "description": "Specify the header(media) type for the header section of the template.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Header Type",
- "format": "string"
- },
- "id-or-link": {
- "title": "ID Or Link (Header Parameter)",
- "$ref": "#/$defs/def-input/media/id-or-link",
- "uiOrder": 5
- },
- "filename": {
- "title": "Filename (Header Parameter)",
- "$ref": "#/$defs/def-input/media/filename",
- "uiOrder": 6
- },
- "body-parameters": {
- "$ref": "#/$defs/def-input/template/body-parameters",
- "uiOrder": 7
- },
- "button-parameters": {
- "$ref": "#/$defs/def-input/template/button-parameters",
- "uiOrder": 8
- }
- },
- "required": [
- "phone-number-id",
- "to",
- "name",
- "language-code",
- "media-type",
- "id-or-link"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "API response.",
- "uiOrder": 0,
- "properties": {
- "recipient-wa-id": {
- "$ref": "#/$defs/def-output/recipient-wa-id"
- },
- "message-id": {
- "$ref": "#/$defs/def-output/message-id"
- },
- "message-status": {
- "$ref": "#/$defs/def-output/message-status"
- }
- },
- "required": [
- "recipient-wa-id",
- "message-id",
- "message-status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEND_LOCATION_BASED_TEMPLATE_MESSAGE": {
- "shortDescription": "Send location-based template message. This task support header(location), body and button parameters.",
- "input": {
- "description": "Template information.",
- "uiOrder": 0,
- "properties": {
- "phone-number-id": {
- "$ref": "#/$defs/def-input/phone-number-id"
- },
- "to": {
- "$ref": "#/$defs/def-input/to"
- },
- "name": {
- "$ref": "#/$defs/def-input/template/name",
- "uiOrder": 2
- },
- "language-code": {
- "$ref": "#/$defs/def-input/template/language-code",
- "uiOrder": 3
- },
- "latitude": {
- "title": "Latitude (Header Parameter)",
- "$ref": "#/$defs/def-input/location/latitude",
- "uiOrder": 4
- },
- "longitude": {
- "title": "Longitude (Header Parameter)",
- "$ref": "#/$defs/def-input/location/longitude",
- "uiOrder": 5
- },
- "location-name": {
- "title": "Location Name (Header Parameter)",
- "$ref": "#/$defs/def-input/location/location-name",
- "uiOrder": 6
- },
- "address": {
- "title": "Location Address (Header Parameter)",
- "$ref": "#/$defs/def-input/location/address",
- "uiOrder": 7
- },
- "body-parameters": {
- "$ref": "#/$defs/def-input/template/body-parameters",
- "uiOrder": 8
- },
- "button-parameters": {
- "$ref": "#/$defs/def-input/template/button-parameters",
- "uiOrder": 9
- }
- },
- "required": [
- "phone-number-id",
- "to",
- "name",
- "language-code",
- "latitude",
- "longitude",
- "location-name",
- "address"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "API response.",
- "uiOrder": 0,
- "properties": {
- "recipient-wa-id": {
- "$ref": "#/$defs/def-output/recipient-wa-id"
- },
- "message-id": {
- "$ref": "#/$defs/def-output/message-id"
- },
- "message-status": {
- "$ref": "#/$defs/def-output/message-status"
- }
- },
- "required": [
- "recipient-wa-id",
- "message-id",
- "message-status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEND_AUTHENTICATION_TEMPLATE_MESSAGE": {
- "shortDescription": "Send authentication template message with one-time password button (The button is used to copy the password to clipboard). Authentication template has no header parameters.",
- "input": {
- "description": "Template information.",
- "uiOrder": 0,
- "properties": {
- "phone-number-id": {
- "$ref": "#/$defs/def-input/phone-number-id"
- },
- "to": {
- "$ref": "#/$defs/def-input/to"
- },
- "name": {
- "$ref": "#/$defs/def-input/template/name",
- "uiOrder": 2
- },
- "language-code": {
- "$ref": "#/$defs/def-input/template/language-code",
- "uiOrder": 3
- },
- "one-time-password": {
- "description": "One-time password to be sent to the recipient. Maximum 15 characters.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "One-Time Password",
- "format": "string"
- }
- },
- "required": [
- "phone-number-id",
- "to",
- "name",
- "language-code",
- "one-time-password"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "API response.",
- "uiOrder": 0,
- "properties": {
- "recipient-wa-id": {
- "$ref": "#/$defs/def-output/recipient-wa-id"
- },
- "message-id": {
- "$ref": "#/$defs/def-output/message-id"
- },
- "message-status": {
- "$ref": "#/$defs/def-output/message-status"
- }
- },
- "required": [
- "recipient-wa-id",
- "message-id",
- "message-status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEND_TEXT_MESSAGE": {
- "shortDescription": "Send text message. Note: Message can only be sent when the 24-hour customer service window is open. For more information, please visit [here](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows)",
- "input": {
- "description": "Text input.",
- "uiOrder": 0,
- "properties": {
- "phone-number-id": {
- "$ref": "#/$defs/def-input/phone-number-id"
- },
- "to": {
- "$ref": "#/$defs/def-input/to"
- },
- "body": {
- "description": "Body of the message.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Text",
- "format": "string"
- },
- "preview-url": {
- "enum": [
- "false",
- "true"
- ],
- "example": "false",
- "description": "Specify whether URL should be previewed or not. This will have no affect if the message does not contain any URL.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Preview URL",
- "format": "string"
- }
- },
- "required": [
- "phone-number-id",
- "to",
- "body",
- "preview-url"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "API response.",
- "uiOrder": 0,
- "properties": {
- "recipient-wa-id": {
- "$ref": "#/$defs/def-output/recipient-wa-id"
- },
- "message-id": {
- "$ref": "#/$defs/def-output/message-id"
- }
- },
- "required": [
- "recipient-wa-id",
- "message-id"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEND_MEDIA_MESSAGE": {
- "shortDescription": "Send media message. Media supported: video, audio, document, image. Note: Message can only be sent when the 24-hour customer service window is open. For more information, please visit [here](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows)",
- "input": {
- "description": "Media input.",
- "uiOrder": 0,
- "properties": {
- "phone-number-id": {
- "$ref": "#/$defs/def-input/phone-number-id"
- },
- "to": {
- "$ref": "#/$defs/def-input/to"
- },
- "media-type": {
- "enum": [
- "image",
- "audio",
- "document",
- "video"
- ],
- "example": "image",
- "description": "Specify what media to send.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Media Type",
- "format": "string"
- },
- "id-or-link": {
- "title": "ID Or Link",
- "$ref": "#/$defs/def-input/media/id-or-link",
- "uiOrder": 3
- },
- "caption": {
- "title": "Caption",
- "$ref": "#/$defs/def-input/media/caption",
- "uiOrder": 4
- },
- "filename": {
- "title": "Filename",
- "$ref": "#/$defs/def-input/media/filename",
- "uiOrder": 5
- }
- },
- "required": [
- "phone-number-id",
- "to",
- "media-type",
- "id-or-link"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "API response.",
- "uiOrder": 0,
- "properties": {
- "recipient-wa-id": {
- "$ref": "#/$defs/def-output/recipient-wa-id"
- },
- "message-id": {
- "$ref": "#/$defs/def-output/message-id"
- }
- },
- "required": [
- "recipient-wa-id",
- "message-id"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEND_LOCATION_MESSAGE": {
- "shortDescription": "Send location message. Note: Message can only be sent when the 24-hour customer service window is open. For more information, please visit [here](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows)",
- "input": {
- "description": "Location input.",
- "uiOrder": 0,
- "properties": {
- "phone-number-id": {
- "$ref": "#/$defs/def-input/phone-number-id"
- },
- "to": {
- "$ref": "#/$defs/def-input/to"
- },
- "latitude": {
- "title": "Latitude",
- "$ref": "#/$defs/def-input/location/latitude",
- "uiOrder": 2
- },
- "longitude": {
- "title": "Longitude",
- "$ref": "#/$defs/def-input/location/longitude",
- "uiOrder": 3
- },
- "location-name": {
- "title": "Location Name",
- "$ref": "#/$defs/def-input/location/location-name",
- "uiOrder": 4
- },
- "address": {
- "title": "Location Address",
- "$ref": "#/$defs/def-input/location/address",
- "uiOrder": 5
- }
- },
- "required": [
- "phone-number-id",
- "to",
- "latitude",
- "longitude",
- "location-name",
- "address"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "API response.",
- "uiOrder": 0,
- "properties": {
- "recipient-wa-id": {
- "$ref": "#/$defs/def-output/recipient-wa-id"
- },
- "message-id": {
- "$ref": "#/$defs/def-output/message-id"
- }
- },
- "required": [
- "recipient-wa-id",
- "message-id"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEND_CONTACT_MESSAGE": {
- "shortDescription": "Send contact message. Note: Message can only be sent when the 24-hour customer service window is open. For more information, please visit [here](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows)",
- "input": {
- "description": "Contact input.",
- "uiOrder": 0,
- "properties": {
- "phone-number-id": {
- "$ref": "#/$defs/def-input/phone-number-id"
- },
- "to": {
- "$ref": "#/$defs/def-input/to"
- },
- "first-name": {
- "description": "First name of the contact.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "First Name",
- "format": "string"
- },
- "middle-name": {
- "description": "Middle name of the contact.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Middle Name",
- "format": "string"
- },
- "last-name": {
- "description": "Last name of the contact.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Last Name",
- "format": "string"
- },
- "phone-number": {
- "description": "Phone number of the contact.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 5,
- "title": "Phone Number",
- "format": "string"
- },
- "phone-number-type": {
- "enum": [
- "none",
- "CELL",
- "MAIN",
- "PHONE",
- "HOME",
- "WORK"
- ],
- "example": "none",
- "description": "Phone number type of the contact. If there is no phone number, pick none.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 6,
- "title": "Phone Number Type",
- "format": "string"
- },
- "email": {
- "description": "Email of the contact.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 7,
- "title": "Email",
- "format": "string"
- },
- "email-type": {
- "enum": [
- "none",
- "HOME",
- "WORK"
- ],
- "example": "none",
- "description": "Email type of the contact. If there is no email, pick none.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 8,
- "title": "Email Type",
- "format": "string"
- },
- "birthday": {
- "description": "Birthday of the contact. Format is in 'YYYY-MM-DD'.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 9,
- "title": "Birthday",
- "format": "string"
- }
- },
- "required": [
- "phone-number-id",
- "to",
- "first-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "API response.",
- "uiOrder": 0,
- "properties": {
- "recipient-wa-id": {
- "$ref": "#/$defs/def-output/recipient-wa-id"
- },
- "message-id": {
- "$ref": "#/$defs/def-output/message-id"
- }
- },
- "required": [
- "recipient-wa-id",
- "message-id"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEND_INTERACTIVE_CALL_TO_ACTION_URL_BUTTON_MESSAGE": {
- "shortDescription": "Send interactive Call-To-Action URL button message. Note: Message can only be sent when the 24-hour customer service window is open. For more information, please visit [here](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows).",
- "input": {
- "description": "Interactive CTA URL button input.",
- "uiOrder": 0,
- "properties": {
- "phone-number-id": {
- "$ref": "#/$defs/def-input/phone-number-id"
- },
- "to": {
- "$ref": "#/$defs/def-input/to"
- },
- "header-text": {
- "description": "Message header text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Header Text",
- "format": "string"
- },
- "body-text": {
- "description": "Message body text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Body Text",
- "format": "string"
- },
- "footer-text": {
- "description": "Message footer text.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Footer Text",
- "format": "string"
- },
- "button-display-text": {
- "description": "The text displayed on the button.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 5,
- "title": "Button Display Text",
- "format": "string"
- },
- "button-url": {
- "description": "URL to load when the user tapped the button.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 6,
- "title": "Button URL",
- "format": "string"
- }
- },
- "required": [
- "phone-number-id",
- "to",
- "body-text",
- "button-display-text",
- "button-url"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "API response.",
- "uiOrder": 0,
- "properties": {
- "recipient-wa-id": {
- "$ref": "#/$defs/def-output/recipient-wa-id"
- },
- "message-id": {
- "$ref": "#/$defs/def-output/message-id"
- }
- },
- "required": [
- "recipient-wa-id",
- "message-id"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/application/whatsapp/v0/config/tasks.yaml b/pkg/component/application/whatsapp/v0/config/tasks.yaml
new file mode 100644
index 000000000..70a4064ae
--- /dev/null
+++ b/pkg/component/application/whatsapp/v0/config/tasks.yaml
@@ -0,0 +1,675 @@
+$defs:
+ def-input:
+ phone-number-id:
+ description: 'Phone Number ID. Obtainable through the app dashboard. Note: This
+ is for sender.'
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Phone Number ID
+ format: string
+ to:
+ description: The number of the recipient you are sending the message to.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Recipient Phone Number
+ format: string
+ template:
+ name:
+ description: Name of the template.
+ acceptFormats:
+ - string
+ title: Template Name
+ format: string
+ language-code:
+ description: The code of the language in which the template is used. [Supported
+ languages](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages).
+ acceptFormats:
+ - string
+ title: Language Code
+ format: string
+ body-parameters:
+ description: Specify the parameters for the body section of the template.
+ Leave this blank if there is no parameter.
+ title: Body Parameters
+ items:
+ title: Body Parameter
+ description: Body parameter.
+ format: string
+ format: array
+ button-parameters:
+ description: 'Specify the parameters for button(s). Leave this blank if there
+ is no parameter. Follow this format or it won''t work: button_index;button_type;value_of_the_parameter.
+ The seperator is a semicolon. button_index starts at 0. Example: 0;quick_reply;randomvalue.
+ Note: This button parameter only support three types ''quick_reply'', ''url''
+ and ''copy_code''.'
+ title: Button Parameters
+ items:
+ title: Button Parameter
+ description: Button parameter.
+ format: string
+ format: array
+ media:
+ id-or-link:
+ description: Input either ID or link of the media. If the input has 'http',
+ it will be considered as a link.
+ acceptFormats:
+ - string
+ format: string
+ caption:
+ description: Media asset caption. Description of the media. This property
+ cannot be used when the media type is audio. If audio tried to use this
+ property, it will be ignored.
+ acceptFormats:
+ - string
+ format: string
+ filename:
+ description: The filename of the document. Only document can use this property.
+ This property will specify what format the document is displayed as in WhatsApp.
+ If other media type tried to use this property, it will be ignored.
+ acceptFormats:
+ - string
+ format: string
+ location:
+ latitude:
+ description: Location latitude.
+ acceptFormats:
+ - number
+ format: number
+ longitude:
+ description: Location longitude.
+ acceptFormats:
+ - number
+ format: number
+ location-name:
+ description: Name of the location.
+ acceptFormats:
+ - string
+ format: string
+ address:
+ description: Address of the location.
+ acceptFormats:
+ - string
+ format: string
+ def-output:
+ recipient-wa-id:
+ description: The WhatsApp ID of the recipient. Most likely the same with their
+ phone number.
+ uiOrder: 0
+ title: Recipient WhatsApp ID
+ format: string
+ message-id:
+ description: The ID of the message.
+ uiOrder: 1
+ title: Message ID
+ format: string
+ message-status:
+ description: The status of the message.
+ uiOrder: 2
+ title: Message Status
+ format: string
+TASK_SEND_TEXT_BASED_TEMPLATE_MESSAGE:
+ shortDescription: Send text-based template message. This task support header(text),
+ body and button parameters.
+ input:
+ description: Template information.
+ uiOrder: 0
+ properties:
+ phone-number-id:
+ $ref: '#/$defs/def-input/phone-number-id'
+ to:
+ $ref: '#/$defs/def-input/to'
+ name:
+ $ref: '#/$defs/def-input/template/name'
+ uiOrder: 2
+ language-code:
+ $ref: '#/$defs/def-input/template/language-code'
+ uiOrder: 3
+ header-parameters:
+ description: Specify the parameters for the header section of the template.
+ Leave this blank if there is no parameter.
+ uiOrder: 4
+ title: Header Parameters
+ items:
+ title: Header Parameter
+ description: Header parameter.
+ format: string
+ format: array
+ body-parameters:
+ $ref: '#/$defs/def-input/template/body-parameters'
+ uiOrder: 5
+ button-parameters:
+ $ref: '#/$defs/def-input/template/button-parameters'
+ uiOrder: 6
+ required:
+ - phone-number-id
+ - to
+ - name
+ - language-code
+ title: Input
+ format: object
+ output:
+ description: API response.
+ uiOrder: 0
+ properties:
+ recipient-wa-id:
+ $ref: '#/$defs/def-output/recipient-wa-id'
+ message-id:
+ $ref: '#/$defs/def-output/message-id'
+ message-status:
+ $ref: '#/$defs/def-output/message-status'
+ required:
+ - recipient-wa-id
+ - message-id
+ - message-status
+ title: Output
+ format: object
+TASK_SEND_MEDIA_BASED_TEMPLATE_MESSAGE:
+ shortDescription: Send media-based template message. This task support header(image,
+ document & video), body and button parameters.
+ input:
+ description: Template information.
+ uiOrder: 0
+ properties:
+ phone-number-id:
+ $ref: '#/$defs/def-input/phone-number-id'
+ to:
+ $ref: '#/$defs/def-input/to'
+ name:
+ $ref: '#/$defs/def-input/template/name'
+ uiOrder: 2
+ language-code:
+ $ref: '#/$defs/def-input/template/language-code'
+ uiOrder: 3
+ media-type:
+ enum:
+ - image
+ - video
+ - document
+ example: none
+ description: Specify the header(media) type for the header section of the
+ template.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Header Type
+ format: string
+ id-or-link:
+ title: ID Or Link (Header Parameter)
+ $ref: '#/$defs/def-input/media/id-or-link'
+ uiOrder: 5
+ filename:
+ title: Filename (Header Parameter)
+ $ref: '#/$defs/def-input/media/filename'
+ uiOrder: 6
+ body-parameters:
+ $ref: '#/$defs/def-input/template/body-parameters'
+ uiOrder: 7
+ button-parameters:
+ $ref: '#/$defs/def-input/template/button-parameters'
+ uiOrder: 8
+ required:
+ - phone-number-id
+ - to
+ - name
+ - language-code
+ - media-type
+ - id-or-link
+ title: Input
+ format: object
+ output:
+ description: API response.
+ uiOrder: 0
+ properties:
+ recipient-wa-id:
+ $ref: '#/$defs/def-output/recipient-wa-id'
+ message-id:
+ $ref: '#/$defs/def-output/message-id'
+ message-status:
+ $ref: '#/$defs/def-output/message-status'
+ required:
+ - recipient-wa-id
+ - message-id
+ - message-status
+ title: Output
+ format: object
+TASK_SEND_LOCATION_BASED_TEMPLATE_MESSAGE:
+ shortDescription: Send location-based template message. This task support header(location),
+ body and button parameters.
+ input:
+ description: Template information.
+ uiOrder: 0
+ properties:
+ phone-number-id:
+ $ref: '#/$defs/def-input/phone-number-id'
+ to:
+ $ref: '#/$defs/def-input/to'
+ name:
+ $ref: '#/$defs/def-input/template/name'
+ uiOrder: 2
+ language-code:
+ $ref: '#/$defs/def-input/template/language-code'
+ uiOrder: 3
+ latitude:
+ title: Latitude (Header Parameter)
+ $ref: '#/$defs/def-input/location/latitude'
+ uiOrder: 4
+ longitude:
+ title: Longitude (Header Parameter)
+ $ref: '#/$defs/def-input/location/longitude'
+ uiOrder: 5
+ location-name:
+ title: Location Name (Header Parameter)
+ $ref: '#/$defs/def-input/location/location-name'
+ uiOrder: 6
+ address:
+ title: Location Address (Header Parameter)
+ $ref: '#/$defs/def-input/location/address'
+ uiOrder: 7
+ body-parameters:
+ $ref: '#/$defs/def-input/template/body-parameters'
+ uiOrder: 8
+ button-parameters:
+ $ref: '#/$defs/def-input/template/button-parameters'
+ uiOrder: 9
+ required:
+ - phone-number-id
+ - to
+ - name
+ - language-code
+ - latitude
+ - longitude
+ - location-name
+ - address
+ title: Input
+ format: object
+ output:
+ description: API response.
+ uiOrder: 0
+ properties:
+ recipient-wa-id:
+ $ref: '#/$defs/def-output/recipient-wa-id'
+ message-id:
+ $ref: '#/$defs/def-output/message-id'
+ message-status:
+ $ref: '#/$defs/def-output/message-status'
+ required:
+ - recipient-wa-id
+ - message-id
+ - message-status
+ title: Output
+ format: object
+TASK_SEND_AUTHENTICATION_TEMPLATE_MESSAGE:
+ shortDescription: Send authentication template message with one-time password button
+ (The button is used to copy the password to clipboard). Authentication template
+ has no header parameters.
+ input:
+ description: Template information.
+ uiOrder: 0
+ properties:
+ phone-number-id:
+ $ref: '#/$defs/def-input/phone-number-id'
+ to:
+ $ref: '#/$defs/def-input/to'
+ name:
+ $ref: '#/$defs/def-input/template/name'
+ uiOrder: 2
+ language-code:
+ $ref: '#/$defs/def-input/template/language-code'
+ uiOrder: 3
+ one-time-password:
+ description: One-time password to be sent to the recipient. Maximum 15 characters.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: One-Time Password
+ format: string
+ required:
+ - phone-number-id
+ - to
+ - name
+ - language-code
+ - one-time-password
+ title: Input
+ format: object
+ output:
+ description: API response.
+ uiOrder: 0
+ properties:
+ recipient-wa-id:
+ $ref: '#/$defs/def-output/recipient-wa-id'
+ message-id:
+ $ref: '#/$defs/def-output/message-id'
+ message-status:
+ $ref: '#/$defs/def-output/message-status'
+ required:
+ - recipient-wa-id
+ - message-id
+ - message-status
+ title: Output
+ format: object
+TASK_SEND_TEXT_MESSAGE:
+ shortDescription: 'Send text message. Note: Message can only be sent when the 24-hour
+ customer service window is open. For more information, please visit [here](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows)'
+ input:
+ description: Text input.
+ uiOrder: 0
+ properties:
+ phone-number-id:
+ $ref: '#/$defs/def-input/phone-number-id'
+ to:
+ $ref: '#/$defs/def-input/to'
+ body:
+ description: Body of the message.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Text
+ format: string
+ preview-url:
+ enum:
+ - 'false'
+ - 'true'
+ example: 'false'
+ description: Specify whether URL should be previewed or not. This will have
+ no affect if the message does not contain any URL.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Preview URL
+ format: string
+ required:
+ - phone-number-id
+ - to
+ - body
+ - preview-url
+ title: Input
+ format: object
+ output:
+ description: API response.
+ uiOrder: 0
+ properties:
+ recipient-wa-id:
+ $ref: '#/$defs/def-output/recipient-wa-id'
+ message-id:
+ $ref: '#/$defs/def-output/message-id'
+ required:
+ - recipient-wa-id
+ - message-id
+ title: Output
+ format: object
+TASK_SEND_MEDIA_MESSAGE:
+ shortDescription: 'Send media message. Media supported: video, audio, document,
+ image. Note: Message can only be sent when the 24-hour customer service window
+ is open. For more information, please visit [here](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows)'
+ input:
+ description: Media input.
+ uiOrder: 0
+ properties:
+ phone-number-id:
+ $ref: '#/$defs/def-input/phone-number-id'
+ to:
+ $ref: '#/$defs/def-input/to'
+ media-type:
+ enum:
+ - image
+ - audio
+ - document
+ - video
+ example: image
+ description: Specify what media to send.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Media Type
+ format: string
+ id-or-link:
+ title: ID Or Link
+ $ref: '#/$defs/def-input/media/id-or-link'
+ uiOrder: 3
+ caption:
+ title: Caption
+ $ref: '#/$defs/def-input/media/caption'
+ uiOrder: 4
+ filename:
+ title: Filename
+ $ref: '#/$defs/def-input/media/filename'
+ uiOrder: 5
+ required:
+ - phone-number-id
+ - to
+ - media-type
+ - id-or-link
+ title: Input
+ format: object
+ output:
+ description: API response.
+ uiOrder: 0
+ properties:
+ recipient-wa-id:
+ $ref: '#/$defs/def-output/recipient-wa-id'
+ message-id:
+ $ref: '#/$defs/def-output/message-id'
+ required:
+ - recipient-wa-id
+ - message-id
+ title: Output
+ format: object
+TASK_SEND_LOCATION_MESSAGE:
+ shortDescription: 'Send location message. Note: Message can only be sent when the
+ 24-hour customer service window is open. For more information, please visit [here](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows)'
+ input:
+ description: Location input.
+ uiOrder: 0
+ properties:
+ phone-number-id:
+ $ref: '#/$defs/def-input/phone-number-id'
+ to:
+ $ref: '#/$defs/def-input/to'
+ latitude:
+ title: Latitude
+ $ref: '#/$defs/def-input/location/latitude'
+ uiOrder: 2
+ longitude:
+ title: Longitude
+ $ref: '#/$defs/def-input/location/longitude'
+ uiOrder: 3
+ location-name:
+ title: Location Name
+ $ref: '#/$defs/def-input/location/location-name'
+ uiOrder: 4
+ address:
+ title: Location Address
+ $ref: '#/$defs/def-input/location/address'
+ uiOrder: 5
+ required:
+ - phone-number-id
+ - to
+ - latitude
+ - longitude
+ - location-name
+ - address
+ title: Input
+ format: object
+ output:
+ description: API response.
+ uiOrder: 0
+ properties:
+ recipient-wa-id:
+ $ref: '#/$defs/def-output/recipient-wa-id'
+ message-id:
+ $ref: '#/$defs/def-output/message-id'
+ required:
+ - recipient-wa-id
+ - message-id
+ title: Output
+ format: object
+TASK_SEND_CONTACT_MESSAGE:
+ shortDescription: 'Send contact message. Note: Message can only be sent when the
+ 24-hour customer service window is open. For more information, please visit [here](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows)'
+ input:
+ description: Contact input.
+ uiOrder: 0
+ properties:
+ phone-number-id:
+ $ref: '#/$defs/def-input/phone-number-id'
+ to:
+ $ref: '#/$defs/def-input/to'
+ first-name:
+ description: First name of the contact.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: First Name
+ format: string
+ middle-name:
+ description: Middle name of the contact.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Middle Name
+ format: string
+ last-name:
+ description: Last name of the contact.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Last Name
+ format: string
+ phone-number:
+ description: Phone number of the contact.
+ acceptFormats:
+ - string
+ uiOrder: 5
+ title: Phone Number
+ format: string
+ phone-number-type:
+ enum:
+ - none
+ - CELL
+ - MAIN
+ - PHONE
+ - HOME
+ - WORK
+ example: none
+ description: Phone number type of the contact. If there is no phone number,
+ pick none.
+ acceptFormats:
+ - string
+ uiOrder: 6
+ title: Phone Number Type
+ format: string
+ email:
+ description: Email of the contact.
+ acceptFormats:
+ - string
+ uiOrder: 7
+ title: Email
+ format: string
+ email-type:
+ enum:
+ - none
+ - HOME
+ - WORK
+ example: none
+ description: Email type of the contact. If there is no email, pick none.
+ acceptFormats:
+ - string
+ uiOrder: 8
+ title: Email Type
+ format: string
+ birthday:
+ description: Birthday of the contact. Format is in 'YYYY-MM-DD'.
+ acceptFormats:
+ - string
+ uiOrder: 9
+ title: Birthday
+ format: string
+ required:
+ - phone-number-id
+ - to
+ - first-name
+ title: Input
+ format: object
+ output:
+ description: API response.
+ uiOrder: 0
+ properties:
+ recipient-wa-id:
+ $ref: '#/$defs/def-output/recipient-wa-id'
+ message-id:
+ $ref: '#/$defs/def-output/message-id'
+ required:
+ - recipient-wa-id
+ - message-id
+ title: Output
+ format: object
+TASK_SEND_INTERACTIVE_CALL_TO_ACTION_URL_BUTTON_MESSAGE:
+ shortDescription: 'Send interactive Call-To-Action URL button message. Note: Message
+ can only be sent when the 24-hour customer service window is open. For more information,
+ please visit [here](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows).'
+ input:
+ description: Interactive CTA URL button input.
+ uiOrder: 0
+ properties:
+ phone-number-id:
+ $ref: '#/$defs/def-input/phone-number-id'
+ to:
+ $ref: '#/$defs/def-input/to'
+ header-text:
+ description: Message header text.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Header Text
+ format: string
+ body-text:
+ description: Message body text.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Body Text
+ format: string
+ footer-text:
+ description: Message footer text.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Footer Text
+ format: string
+ button-display-text:
+ description: The text displayed on the button.
+ acceptFormats:
+ - string
+ uiOrder: 5
+ title: Button Display Text
+ format: string
+ button-url:
+ description: URL to load when the user tapped the button.
+ acceptFormats:
+ - string
+ uiOrder: 6
+ title: Button URL
+ format: string
+ required:
+ - phone-number-id
+ - to
+ - body-text
+ - button-display-text
+ - button-url
+ title: Input
+ format: object
+ output:
+ description: API response.
+ uiOrder: 0
+ properties:
+ recipient-wa-id:
+ $ref: '#/$defs/def-output/recipient-wa-id'
+ message-id:
+ $ref: '#/$defs/def-output/message-id'
+ required:
+ - recipient-wa-id
+ - message-id
+ title: Output
+ format: object
diff --git a/pkg/component/application/whatsapp/v0/main.go b/pkg/component/application/whatsapp/v0/main.go
index c91a28c2a..12c1e6751 100644
--- a/pkg/component/application/whatsapp/v0/main.go
+++ b/pkg/component/application/whatsapp/v0/main.go
@@ -31,12 +31,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
once sync.Once
comp *component
@@ -57,7 +57,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/base/component.go b/pkg/component/base/component.go
index 6b9e9c6c6..c7497cc39 100644
--- a/pkg/component/base/component.go
+++ b/pkg/component/base/component.go
@@ -14,6 +14,7 @@ import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/structpb"
+ "gopkg.in/yaml.v3"
jsoniter "github.com/json-iterator/go"
temporalclient "go.temporal.io/sdk/client"
@@ -438,7 +439,6 @@ func generateComponentEventCards(events []string, eventStructs map[string]*struc
func generateComponentSpec(title string, tasks []*pb.ComponentTask, taskStructs map[string]*structpb.Struct) (*structpb.Struct, error) {
var err error
componentSpec := &structpb.Struct{Fields: map[string]*structpb.Value{}}
- componentSpec.Fields["$schema"] = structpb.NewStringValue("http://json-schema.org/draft-07/schema#")
componentSpec.Fields["title"] = structpb.NewStringValue(fmt.Sprintf("%s Component", title))
componentSpec.Fields["format"] = structpb.NewStringValue("object")
@@ -746,10 +746,48 @@ func (c *Component) GetDefinition(sysVars map[string]any, compConfig *ComponentC
return definition, nil
}
+func convertYAMLToJSON(yamlBytes []byte) ([]byte, error) {
+ if yamlBytes == nil {
+ return nil, nil
+ }
+ var d any
+ err := yaml.Unmarshal(yamlBytes, &d)
+ if err != nil {
+ return nil, err
+ }
+ return json.Marshal(d)
+}
+
// LoadDefinition loads the component definition, setup, tasks, events and additional JSON files.
// The definition files are currently loaded together but could be refactored to load separately.
-func (c *Component) LoadDefinition(definitionJSONBytes, setupJSONBytes, tasksJSONBytes []byte, eventsJSONBytes []byte, additionalJSONBytes map[string][]byte) error {
+func (c *Component) LoadDefinition(definitionYAMLBytes, setupYAMLBytes, tasksYAMLBytes, eventsYAMLBytes []byte, additionalYAMLBytes map[string][]byte) error {
+
var err error
+ definitionJSONBytes, err := convertYAMLToJSON(definitionYAMLBytes)
+ if err != nil {
+ return err
+ }
+ setupJSONBytes, err := convertYAMLToJSON(setupYAMLBytes)
+ if err != nil {
+ return err
+ }
+ eventsJSONBytes, err := convertYAMLToJSON(eventsYAMLBytes)
+ if err != nil {
+ return err
+ }
+ tasksJSONBytes, err := convertYAMLToJSON(tasksYAMLBytes)
+ if err != nil {
+ return err
+ }
+ additionalJSONBytes := map[string][]byte{}
+ for k, v := range additionalYAMLBytes {
+ v, err = convertYAMLToJSON(v)
+ if err != nil {
+ return err
+ }
+ additionalJSONBytes[k] = v
+ }
+
var definitionJSON any
c.secretFields = []string{}
diff --git a/pkg/component/base/component_test.go b/pkg/component/base/component_test.go
index 89ff0be69..95da7c00a 100644
--- a/pkg/component/base/component_test.go
+++ b/pkg/component/base/component_test.go
@@ -1,12 +1,12 @@
package base
import (
- "encoding/json"
"testing"
_ "embed"
"google.golang.org/protobuf/encoding/protojson"
+ "gopkg.in/yaml.v3"
qt "github.com/frankban/quicktest"
@@ -14,16 +14,16 @@ import (
)
var (
- //go:embed testdata/componentDef.json
- componentDefJSON []byte
- //go:embed testdata/componentTasks.json
- componentTasksJSON []byte
- //go:embed testdata/componentConfig.json
- componentConfigJSON []byte
- //go:embed testdata/componentAdditional.json
- componentAdditionalJSON []byte
- //go:embed testdata/wantComponentDefinition.json
- wantComponentDefinitionJSON []byte
+ //go:embed testdata/componentDef.yaml
+ componentDefYAML []byte
+ //go:embed testdata/componentTasks.yaml
+ componentTasksYAML []byte
+ //go:embed testdata/componentConfig.yaml
+ componentConfigYAML []byte
+ //go:embed testdata/componentAdditional.yaml
+ componentAdditionalYAML []byte
+ //go:embed testdata/wantComponentDefinition.yaml
+ wantComponentDefinitionYAML []byte
)
func TestComponent_ListComponentDefinitions(t *testing.T) {
@@ -31,13 +31,13 @@ func TestComponent_ListComponentDefinitions(t *testing.T) {
conn := new(Component)
err := conn.LoadDefinition(
- componentDefJSON,
- componentConfigJSON,
- componentTasksJSON,
+ componentDefYAML,
+ componentConfigYAML,
+ componentTasksYAML,
nil,
map[string][]byte{
- "additional.json": componentAdditionalJSON,
- "schema.json": schemas.SchemaJSON,
+ "additional.yaml": componentAdditionalYAML,
+ "schema.yaml": schemas.SchemaYAML,
})
c.Assert(err, qt.IsNil)
@@ -47,7 +47,7 @@ func TestComponent_ListComponentDefinitions(t *testing.T) {
c.Assert(err, qt.IsNil)
wantComponentDefinitionStruct := map[string]any{}
- err = json.Unmarshal(wantComponentDefinitionJSON, &wantComponentDefinitionStruct)
+ err = yaml.Unmarshal(wantComponentDefinitionYAML, &wantComponentDefinitionStruct)
c.Assert(err, qt.IsNil)
c.Check(gotJSON, qt.JSONEquals, wantComponentDefinitionStruct)
}
diff --git a/pkg/component/base/executionwrapper_test.go b/pkg/component/base/executionwrapper_test.go
index 9c3a67226..89daa967e 100644
--- a/pkg/component/base/executionwrapper_test.go
+++ b/pkg/component/base/executionwrapper_test.go
@@ -16,14 +16,14 @@ import (
)
var (
- //go:embed testdata/componentDef.json
- componentDefJSON []byte
- //go:embed testdata/componentTasks.json
- componentTasksJSON []byte
- //go:embed testdata/componentConfig.json
- componentConfigJSON []byte
- //go:embed testdata/componentAdditional.json
- componentAdditionalJSON []byte
+ //go:embed testdata/componentDef.yaml
+ componentDefYAML []byte
+ //go:embed testdata/componentTasks.yaml
+ componentTasksYAML []byte
+ //go:embed testdata/componentConfig.yaml
+ componentConfigYAML []byte
+ //go:embed testdata/componentAdditional.yaml
+ componentAdditionalYAML []byte
)
func TestExecutionWrapper_GetComponent(t *testing.T) {
@@ -35,13 +35,13 @@ func TestExecutionWrapper_GetComponent(t *testing.T) {
},
}
err := cmp.LoadDefinition(
- componentDefJSON,
- componentConfigJSON,
- componentTasksJSON,
+ componentDefYAML,
+ componentConfigYAML,
+ componentTasksYAML,
nil,
map[string][]byte{
- "additional.json": componentAdditionalJSON,
- "schema.json": schemas.SchemaJSON,
+ "additional.yaml": componentAdditionalYAML,
+ "schema.yaml": schemas.SchemaYAML,
})
c.Assert(err, qt.IsNil)
@@ -127,13 +127,13 @@ func TestExecutionWrapper_Execute(t *testing.T) {
}
err := cmp.LoadDefinition(
- componentDefJSON,
- componentConfigJSON,
- componentTasksJSON,
+ componentDefYAML,
+ componentConfigYAML,
+ componentTasksYAML,
nil,
map[string][]byte{
- "additional.json": componentAdditionalJSON,
- "schema.json": schemas.SchemaJSON,
+ "additional.yaml": componentAdditionalYAML,
+ "schema.yaml": schemas.SchemaYAML,
})
c.Assert(err, qt.IsNil)
diff --git a/pkg/component/base/testdata/componentAdditional.json b/pkg/component/base/testdata/componentAdditional.json
deleted file mode 100644
index 15fb62abc..000000000
--- a/pkg/component/base/testdata/componentAdditional.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "components": {
- "schemas": {
- "CreateEmbeddingRequest": {
- "additionalProperties": false,
- "properties": {
- "model": {
- "description": "ID of the model to use",
- "enum": [
- "text-embedding-ada-002"
- ],
- "type": "string"
- }
- },
- "required": [
- "model"
- ],
- "type": "object"
- }
- }
- }
-}
diff --git a/pkg/component/base/testdata/componentAdditional.yaml b/pkg/component/base/testdata/componentAdditional.yaml
new file mode 100644
index 000000000..21dc95cc4
--- /dev/null
+++ b/pkg/component/base/testdata/componentAdditional.yaml
@@ -0,0 +1,13 @@
+components:
+ schemas:
+ CreateEmbeddingRequest:
+ additionalProperties: false
+ properties:
+ model:
+ description: ID of the model to use
+ enum:
+ - text-embedding-ada-002
+ type: string
+ required:
+ - model
+ type: object
diff --git a/pkg/component/base/testdata/componentConfig.json b/pkg/component/base/testdata/componentConfig.json
deleted file mode 100644
index e11747d8e..000000000
--- a/pkg/component/base/testdata/componentConfig.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": true,
- "properties": {
- "api-key": {
- "description": "Fill in your OpenAI API key. To find your keys, visit your OpenAI's API Keys page.",
- "instillSecret": true,
- "uiOrder": 0,
- "title": "API Key",
- "type": "string"
- }
- },
- "required": [
- "api-key"
- ],
- "title": "OpenAI Connection",
- "type": "object"
-}
diff --git a/pkg/component/base/testdata/componentConfig.yaml b/pkg/component/base/testdata/componentConfig.yaml
new file mode 100644
index 000000000..95f48245b
--- /dev/null
+++ b/pkg/component/base/testdata/componentConfig.yaml
@@ -0,0 +1,13 @@
+additionalProperties: true
+properties:
+ api-key:
+ description: Fill in your OpenAI API key. To find your keys, visit your OpenAI's
+ API Keys page.
+ instillSecret: true
+ uiOrder: 0
+ title: API Key
+ type: string
+required:
+- api-key
+title: OpenAI Connection
+type: object
diff --git a/pkg/component/base/testdata/componentDef.json b/pkg/component/base/testdata/componentDef.json
deleted file mode 100644
index c8862e8fb..000000000
--- a/pkg/component/base/testdata/componentDef.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "version": "1.0.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/base",
- "availableTasks": [
- "TASK_TEXT_EMBEDDINGS"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/ai/openai",
- "icon": "OpenAI/openai.svg",
- "id": "openai",
- "public": true,
- "title": "OpenAI",
- "type": "COMPONENT_TYPE_AI",
- "uid": "9fb6a2cb-bff5-4c69-bc6d-4538dd8e3362",
- "vendor": "OpenAI",
- "vendorAttributes": {}
-}
diff --git a/pkg/component/base/testdata/componentDef.yaml b/pkg/component/base/testdata/componentDef.yaml
new file mode 100644
index 000000000..52353dba0
--- /dev/null
+++ b/pkg/component/base/testdata/componentDef.yaml
@@ -0,0 +1,14 @@
+version: 1.0.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/base
+availableTasks:
+- TASK_TEXT_EMBEDDINGS
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/ai/openai
+icon: OpenAI/openai.svg
+id: openai
+public: true
+title: OpenAI
+type: COMPONENT_TYPE_AI
+uid: 9fb6a2cb-bff5-4c69-bc6d-4538dd8e3362
+vendor: OpenAI
+vendorAttributes: {}
diff --git a/pkg/component/base/testdata/componentTasks.json b/pkg/component/base/testdata/componentTasks.json
index 62c1289c3..70ed0fdd6 100644
--- a/pkg/component/base/testdata/componentTasks.json
+++ b/pkg/component/base/testdata/componentTasks.json
@@ -5,7 +5,7 @@
"uiOrder": 0,
"properties": {
"model": {
- "$ref": "additional.json#/components/schemas/CreateEmbeddingRequest/properties/model",
+ "$ref": "additional.yaml#/components/schemas/CreateEmbeddingRequest/properties/model",
"acceptFormats": [
"string"
],
@@ -34,7 +34,7 @@
"uiOrder": 0,
"properties": {
"embedding": {
- "$ref": "schema.json#/$defs/instill-types/embedding",
+ "$ref": "schema.yaml#/$defs/instill-types/embedding",
"uiOrder": 0,
"title": "Embedding"
}
diff --git a/pkg/component/base/testdata/componentTasks.yaml b/pkg/component/base/testdata/componentTasks.yaml
new file mode 100644
index 000000000..a2c8eaaa7
--- /dev/null
+++ b/pkg/component/base/testdata/componentTasks.yaml
@@ -0,0 +1,35 @@
+TASK_TEXT_EMBEDDINGS:
+ shortDescription: Turn text into numbers, unlocking use cases like search.
+ input:
+ uiOrder: 0
+ properties:
+ model:
+ $ref: additional.yaml#/components/schemas/CreateEmbeddingRequest/properties/model
+ acceptFormats:
+ - string
+ shortDescription: ID of the model to use
+ uiOrder: 0
+ title: Model
+ text:
+ description: The text
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Text
+ type: string
+ required:
+ - text
+ - model
+ title: Input
+ type: object
+ output:
+ uiOrder: 0
+ properties:
+ embedding:
+ $ref: schema.yaml#/$defs/instill-types/embedding
+ uiOrder: 0
+ title: Embedding
+ required:
+ - embedding
+ title: Output
+ type: object
diff --git a/pkg/component/base/testdata/operatorDef.json b/pkg/component/base/testdata/operatorDef.json
deleted file mode 100644
index 53f8cd728..000000000
--- a/pkg/component/base/testdata/operatorDef.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "version": "1.0.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/base",
- "availableTasks": [
- "TASK_MARSHAL"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/operator/json",
- "icon": "Instill AI/json.svg",
- "iconUrl": "",
- "id": "json",
- "public": true,
- "spec": {},
- "title": "JSON",
- "uid": "28f53d15-6150-46e6-99aa-f76b70a926c0"
-}
diff --git a/pkg/component/base/testdata/operatorDef.yaml b/pkg/component/base/testdata/operatorDef.yaml
new file mode 100644
index 000000000..eb61b054d
--- /dev/null
+++ b/pkg/component/base/testdata/operatorDef.yaml
@@ -0,0 +1,13 @@
+version: 1.0.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/base
+availableTasks:
+- TASK_MARSHAL
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/operator/json
+icon: Instill AI/json.svg
+iconUrl: ''
+id: json
+public: true
+spec: {}
+title: JSON
+uid: 28f53d15-6150-46e6-99aa-f76b70a926c0
diff --git a/pkg/component/base/testdata/operatorTasks.json b/pkg/component/base/testdata/operatorTasks.json
deleted file mode 100644
index 41b5053e2..000000000
--- a/pkg/component/base/testdata/operatorTasks.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "TASK_MARSHAL": {
- "input": {
- "description": "Input",
- "instillEditOnNodeFields": [
- "object"
- ],
- "uiOrder": 0,
- "properties": {
- "object": {
- "description": "Json object to be marshaled",
- "instillAcceptFormats": [
- "object",
- "semi-structured/*",
- "structured/*"
- ],
- "instillEditOnNodeFields": [],
- "uiOrder": 0,
- "instillUpstreamTypes": [
- "reference"
- ],
- "required": [],
- "title": "Object",
- "type": "object"
- }
- },
- "required": [
- "object"
- ],
- "title": "Input",
- "type": "object"
- },
- "output": {
- "description": "Output",
- "instillEditOnNodeFields": [
- "string"
- ],
- "uiOrder": 0,
- "properties": {
- "string": {
- "description": "Data",
- "instillFormat": "string",
- "instillUIMultiline": true,
- "uiOrder": 0,
- "title": "Data",
- "type": "string"
- }
- },
- "required": [
- "string"
- ],
- "title": "Output",
- "type": "object"
- }
- }
-}
diff --git a/pkg/component/base/testdata/operatorTasks.yaml b/pkg/component/base/testdata/operatorTasks.yaml
new file mode 100644
index 000000000..ba2d99ec1
--- /dev/null
+++ b/pkg/component/base/testdata/operatorTasks.yaml
@@ -0,0 +1,41 @@
+TASK_MARSHAL:
+ input:
+ description: Input
+ instillEditOnNodeFields:
+ - object
+ uiOrder: 0
+ properties:
+ object:
+ description: Json object to be marshaled
+ instillAcceptFormats:
+ - object
+ - semi-structured/*
+ - structured/*
+ instillEditOnNodeFields: []
+ uiOrder: 0
+ instillUpstreamTypes:
+ - reference
+ required: []
+ title: Object
+ type: object
+ required:
+ - object
+ title: Input
+ type: object
+ output:
+ description: Output
+ instillEditOnNodeFields:
+ - string
+ uiOrder: 0
+ properties:
+ string:
+ description: Data
+ instillFormat: string
+ instillUIMultiline: true
+ uiOrder: 0
+ title: Data
+ type: string
+ required:
+ - string
+ title: Output
+ type: object
diff --git a/pkg/component/base/testdata/wantComponentDefinition.json b/pkg/component/base/testdata/wantComponentDefinition.json
deleted file mode 100644
index 6d6b9efb0..000000000
--- a/pkg/component/base/testdata/wantComponentDefinition.json
+++ /dev/null
@@ -1,209 +0,0 @@
-{
- "name": "component-definitions/openai",
- "uid": "9fb6a2cb-bff5-4c69-bc6d-4538dd8e3362",
- "id": "openai",
- "title": "OpenAI",
- "documentationUrl": "https://www.instill.tech/docs/component/ai/openai",
- "icon": "OpenAI/openai.svg",
- "spec": {
- "componentSpecification": {
- "$schema": "http://json-schema.org/draft-07/schema#",
- "instillFormat": "object",
- "oneOf": [
- {
- "instillFormat": "object",
- "properties": {
- "condition": {
- "instillAcceptFormats": [
- "string"
- ],
- "instillShortDescription": "config whether the component will be executed or skipped",
- "instillUIOrder": 1,
- "instillUpstreamTypes": [
- "value",
- "template"
- ],
- "type": "string"
- },
- "input": {
- "instillUIOrder": 0,
- "properties": {
- "model": {
- "anyOf": [
- {
- "enum": [
- "text-embedding-ada-002"
- ],
- "instillUpstreamType": "value",
- "type": "string"
- },
- {
- "instillUpstreamType": "reference",
- "pattern": "^\\{.*\\}$",
- "type": "string"
- },
- {
- "instillUpstreamType": "template",
- "type": "string"
- }
- ],
- "description": "ID of the model to use",
- "instillAcceptFormats": [
- "string"
- ],
- "instillShortDescription": "ID of the model to use",
- "instillUIOrder": 0,
- "instillUpstreamTypes": [
- "value",
- "reference",
- "template"
- ],
- "title": "Model",
- "type": "string"
- },
- "text": {
- "anyOf": [
- {
- "instillUpstreamType": "value",
- "type": "string"
- },
- {
- "instillUpstreamType": "reference",
- "pattern": "^\\{.*\\}$",
- "type": "string"
- },
- {
- "instillUpstreamType": "template",
- "type": "string"
- }
- ],
- "description": "The text",
- "instillAcceptFormats": [
- "string"
- ],
- "instillShortDescription": "The text",
- "instillUIOrder": 1,
- "instillUpstreamTypes": [
- "value",
- "reference",
- "template"
- ],
- "title": "Text",
- "type": "string"
- }
- },
- "required": [
- "text",
- "model"
- ],
- "title": "Input",
- "type": "object"
- },
- "task": {
- "const": "TASK_TEXT_EMBEDDINGS",
- "instillShortDescription": "Turn text into numbers, unlocking use cases like search.",
- "title": "Text Embeddings"
- }
- },
- "type": "object"
- }
- ],
- "properties": {
- "setup": {
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": true,
- "instillShortDescription": "",
- "properties": {
- "api-key": {
- "description": "Fill in your OpenAI API key. To find your keys, visit your OpenAI's API Keys page.",
- "instillSecret": true,
- "instillShortDescription": "Fill in your OpenAI API key. To find your keys, visit your OpenAI's API Keys page.",
- "instillUIOrder": 0,
- "title": "API Key",
- "type": "string"
- }
- },
- "required": [
- "api-key"
- ],
- "title": "OpenAI Connection",
- "type": "object"
- }
- },
- "title": "OpenAI Component",
- "type": "object"
- },
- "dataSpecifications": {
- "TASK_TEXT_EMBEDDINGS": {
- "input": {
- "instillUIOrder": 0,
- "properties": {
- "model": {
- "description": "ID of the model to use",
- "instillAcceptFormats": [
- "string"
- ],
- "enum": [
- "text-embedding-ada-002"
- ],
- "instillShortDescription": "ID of the model to use",
- "instillUIOrder": 0,
- "title": "Model",
- "type": "string"
- },
- "text": {
- "description": "The text",
- "instillAcceptFormats": [
- "string"
- ],
- "instillShortDescription": "The text",
- "instillUIOrder": 1,
- "title": "Text",
- "type": "string"
- }
- },
- "required": [
- "text",
- "model"
- ],
- "title": "Input",
- "type": "object"
- },
- "output": {
- "instillUIOrder": 0,
- "properties": {
- "embedding": {
- "instillUIOrder": 0,
- "instillFormat": "array",
- "items": {
- "instillFormat": "number",
- "title": "Embedding",
- "type": "number"
- },
- "title": "Embedding",
- "type": "array"
- }
- },
- "required": [
- "embedding"
- ],
- "title": "Output",
- "type": "object"
- }
- }
- }
- },
- "type": "COMPONENT_TYPE_AI",
- "public": true,
- "vendor": "OpenAI",
- "vendorAttributes": {},
- "tasks": [
- {
- "name": "TASK_TEXT_EMBEDDINGS",
- "title": "Text Embeddings",
- "description": "Turn text into numbers, unlocking use cases like search."
- }
- ],
- "version": "1.0.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/base"
-}
diff --git a/pkg/component/base/testdata/wantComponentDefinition.yaml b/pkg/component/base/testdata/wantComponentDefinition.yaml
new file mode 100644
index 000000000..d44c00d91
--- /dev/null
+++ b/pkg/component/base/testdata/wantComponentDefinition.yaml
@@ -0,0 +1,152 @@
+name: component-definitions/openai
+uid: 9fb6a2cb-bff5-4c69-bc6d-4538dd8e3362
+id: openai
+title: OpenAI
+documentationUrl: https://www.instill.tech/docs/component/ai/openai
+icon: OpenAI/openai.svg
+spec:
+ componentSpecification:
+ instillFormat: object
+ oneOf:
+ - instillFormat: object
+ properties:
+ condition:
+ instillAcceptFormats:
+ - string
+ instillShortDescription: config whether the component will be executed or
+ skipped
+ instillUIOrder: 1
+ instillUpstreamTypes:
+ - value
+ - template
+ type: string
+ input:
+ instillUIOrder: 0
+ properties:
+ model:
+ anyOf:
+ - enum:
+ - text-embedding-ada-002
+ instillUpstreamType: value
+ type: string
+ - instillUpstreamType: reference
+ pattern: ^\{.*\}$
+ type: string
+ - instillUpstreamType: template
+ type: string
+ description: ID of the model to use
+ instillAcceptFormats:
+ - string
+ instillShortDescription: ID of the model to use
+ instillUIOrder: 0
+ instillUpstreamTypes:
+ - value
+ - reference
+ - template
+ title: Model
+ type: string
+ text:
+ anyOf:
+ - instillUpstreamType: value
+ type: string
+ - instillUpstreamType: reference
+ pattern: ^\{.*\}$
+ type: string
+ - instillUpstreamType: template
+ type: string
+ description: The text
+ instillAcceptFormats:
+ - string
+ instillShortDescription: The text
+ instillUIOrder: 1
+ instillUpstreamTypes:
+ - value
+ - reference
+ - template
+ title: Text
+ type: string
+ required:
+ - text
+ - model
+ title: Input
+ type: object
+ task:
+ const: TASK_TEXT_EMBEDDINGS
+ instillShortDescription: Turn text into numbers, unlocking use cases like
+ search.
+ title: Text Embeddings
+ type: object
+ properties:
+ setup:
+ additionalProperties: true
+ instillShortDescription: ''
+ properties:
+ api-key:
+ description: Fill in your OpenAI API key. To find your keys, visit your
+ OpenAI's API Keys page.
+ instillSecret: true
+ instillShortDescription: Fill in your OpenAI API key. To find your keys,
+ visit your OpenAI's API Keys page.
+ instillUIOrder: 0
+ title: API Key
+ type: string
+ required:
+ - api-key
+ title: OpenAI Connection
+ type: object
+ title: OpenAI Component
+ type: object
+ dataSpecifications:
+ TASK_TEXT_EMBEDDINGS:
+ input:
+ instillUIOrder: 0
+ properties:
+ model:
+ description: ID of the model to use
+ instillAcceptFormats:
+ - string
+ enum:
+ - text-embedding-ada-002
+ instillShortDescription: ID of the model to use
+ instillUIOrder: 0
+ title: Model
+ type: string
+ text:
+ description: The text
+ instillAcceptFormats:
+ - string
+ instillShortDescription: The text
+ instillUIOrder: 1
+ title: Text
+ type: string
+ required:
+ - text
+ - model
+ title: Input
+ type: object
+ output:
+ instillUIOrder: 0
+ properties:
+ embedding:
+ instillUIOrder: 0
+ instillFormat: array
+ items:
+ instillFormat: number
+ title: Embedding
+ type: number
+ title: Embedding
+ type: array
+ required:
+ - embedding
+ title: Output
+ type: object
+type: COMPONENT_TYPE_AI
+public: true
+vendor: OpenAI
+vendorAttributes: {}
+tasks:
+- name: TASK_TEXT_EMBEDDINGS
+ title: Text Embeddings
+ description: Turn text into numbers, unlocking use cases like search.
+version: 1.0.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/base
diff --git a/pkg/component/base/testdata/wantOperatorDefinition.json b/pkg/component/base/testdata/wantOperatorDefinition.json
deleted file mode 100644
index eb4d3fc1f..000000000
--- a/pkg/component/base/testdata/wantOperatorDefinition.json
+++ /dev/null
@@ -1,129 +0,0 @@
-{
- "name": "component-definitions/json",
- "uid": "28f53d15-6150-46e6-99aa-f76b70a926c0",
- "id": "json",
- "title": "JSON",
- "documentationUrl": "https://www.instill.tech/docs/component/operator/json",
- "icon": "Instill AI/json.svg",
- "spec": {
- "componentSpecification": {
- "$schema": "http://json-schema.org/draft-07/schema#",
- "oneOf": [
- {
- "properties": {
- "condition": {
- "instillAcceptFormats": [
- "string"
- ],
- "instillShortDescription": "config whether the component will be executed or skipped",
- "instillUIOrder": 1,
- "instillUpstreamTypes": [
- "value",
- "template"
- ],
- "type": "string"
- },
- "input": {
- "description": "Input",
- "instillUIOrder": 0,
- "properties": {
- "object": {
- "anyOf": [
- {
- "instillUpstreamType": "reference",
- "pattern": "^\\{.*\\}$",
- "type": "string"
- }
- ],
- "description": "Json object to be marshaled",
- "instillAcceptFormats": [
- "object",
- "semi-structured/*",
- "structured/*"
- ],
- "instillShortDescription": "Json object to be marshaled",
- "instillUIOrder": 0,
- "instillUpstreamTypes": [
- "reference"
- ],
- "title": "Object"
- }
- },
- "required": [
- "object"
- ],
- "title": "Input",
- "type": "object"
- },
- "task": {
- "const": "TASK_MARSHAL",
- "title": "Marshal"
- }
- },
- "title": "Marshal",
- "type": "object"
- }
- ],
- "title": "JSON Component",
- "type": "object"
- },
- "dataSpecifications": {
- "TASK_MARSHAL": {
- "input": {
- "description": "Input",
- "instillUIOrder": 0,
- "properties": {
- "object": {
- "description": "Json object to be marshaled",
- "instillAcceptFormats": [
- "object",
- "semi-structured/*",
- "structured/*"
- ],
- "instillUIOrder": 0,
- "instillUpstreamTypes": [
- "reference"
- ],
- "required": [],
- "title": "Object",
- "type": "object"
- }
- },
- "required": [
- "object"
- ],
- "title": "Input",
- "type": "object"
- },
- "output": {
- "description": "Output",
- "instillUIOrder": 0,
- "properties": {
- "string": {
- "description": "Data",
- "instillFormat": "string",
- "instillShortDescription": "Data",
- "instillUIOrder": 0,
- "title": "Data",
- "type": "string"
- }
- },
- "required": [
- "string"
- ],
- "title": "Output",
- "type": "object"
- }
- }
- }
- },
- "public": true,
- "version": "1.0.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/base",
- "tasks": [
- {
- "name": "TASK_MARSHAL",
- "title": "Marshal"
- }
- ]
-}
diff --git a/pkg/component/base/testdata/wantOperatorDefinition.yaml b/pkg/component/base/testdata/wantOperatorDefinition.yaml
new file mode 100644
index 000000000..654a9490b
--- /dev/null
+++ b/pkg/component/base/testdata/wantOperatorDefinition.yaml
@@ -0,0 +1,93 @@
+name: component-definitions/json
+uid: 28f53d15-6150-46e6-99aa-f76b70a926c0
+id: json
+title: JSON
+documentationUrl: https://www.instill.tech/docs/component/operator/json
+icon: Instill AI/json.svg
+spec:
+ componentSpecification:
+ oneOf:
+ - properties:
+ condition:
+ instillAcceptFormats:
+ - string
+ instillShortDescription: config whether the component will be executed or
+ skipped
+ instillUIOrder: 1
+ instillUpstreamTypes:
+ - value
+ - template
+ type: string
+ input:
+ description: Input
+ instillUIOrder: 0
+ properties:
+ object:
+ anyOf:
+ - instillUpstreamType: reference
+ pattern: ^\{.*\}$
+ type: string
+ description: Json object to be marshaled
+ instillAcceptFormats:
+ - object
+ - semi-structured/*
+ - structured/*
+ instillShortDescription: Json object to be marshaled
+ instillUIOrder: 0
+ instillUpstreamTypes:
+ - reference
+ title: Object
+ required:
+ - object
+ title: Input
+ type: object
+ task:
+ const: TASK_MARSHAL
+ title: Marshal
+ title: Marshal
+ type: object
+ title: JSON Component
+ type: object
+ dataSpecifications:
+ TASK_MARSHAL:
+ input:
+ description: Input
+ instillUIOrder: 0
+ properties:
+ object:
+ description: Json object to be marshaled
+ instillAcceptFormats:
+ - object
+ - semi-structured/*
+ - structured/*
+ instillUIOrder: 0
+ instillUpstreamTypes:
+ - reference
+ required: []
+ title: Object
+ type: object
+ required:
+ - object
+ title: Input
+ type: object
+ output:
+ description: Output
+ instillUIOrder: 0
+ properties:
+ string:
+ description: Data
+ instillFormat: string
+ instillShortDescription: Data
+ instillUIOrder: 0
+ title: Data
+ type: string
+ required:
+ - string
+ title: Output
+ type: object
+public: true
+version: 1.0.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/base
+tasks:
+- name: TASK_MARSHAL
+ title: Marshal
diff --git a/pkg/component/data/bigquery/v0/README.mdx b/pkg/component/data/bigquery/v0/README.mdx
index 8323c30c6..148a57daf 100644
--- a/pkg/component/data/bigquery/v0/README.mdx
+++ b/pkg/component/data/bigquery/v0/README.mdx
@@ -20,7 +20,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/bigquery/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/bigquery/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/bigquery/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/bigquery/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/bigquery/v0/config/definition.json b/pkg/component/data/bigquery/v0/config/definition.json
deleted file mode 100644
index 96736061d..000000000
--- a/pkg/component/data/bigquery/v0/config/definition.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "availableTasks": [
- "TASK_INSERT",
- "TASK_READ"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/data/bigquery",
- "icon": "assets/bigquery.svg",
- "iconUrl": "",
- "id": "bigquery",
- "public": true,
- "title": "BigQuery",
- "description": "Insert data to BigQuery tables.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "e2ffe076-ab2c-4e5e-9587-a613a6b1c146",
- "vendor": "Google",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/bigquery/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/bigquery/v0/config/definition.yaml b/pkg/component/data/bigquery/v0/config/definition.yaml
new file mode 100644
index 000000000..74bd46a78
--- /dev/null
+++ b/pkg/component/data/bigquery/v0/config/definition.yaml
@@ -0,0 +1,19 @@
+availableTasks:
+- TASK_INSERT
+- TASK_READ
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/data/bigquery
+icon: assets/bigquery.svg
+iconUrl: ''
+id: bigquery
+public: true
+title: BigQuery
+description: Insert data to BigQuery tables.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: e2ffe076-ab2c-4e5e-9587-a613a6b1c146
+vendor: Google
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/bigquery/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/bigquery/v0/config/setup.json b/pkg/component/data/bigquery/v0/config/setup.json
deleted file mode 100644
index 2dcea9c35..000000000
--- a/pkg/component/data/bigquery/v0/config/setup.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "dataset-id": {
- "description": "Fill in your BigQuery Dataset ID.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "BigQuery Dataset ID",
- "format": "string"
- },
- "json-key": {
- "description": "Contents of the JSON key file with access to the bucket.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "JSON Key File contents",
- "format": "string"
- },
- "project-id": {
- "description": "Fill in your BigQuery Project ID.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "BigQuery Project ID",
- "format": "string"
- },
- "table-name": {
- "description": "Fill in your BigQuery Table Name.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "BigQuery Table Name",
- "format": "string"
- }
- },
- "required": [
- "json-key",
- "project-id",
- "dataset-id",
- "table-name"
- ],
- "title": "BigQuery Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/bigquery/v0/config/setup.yaml b/pkg/component/data/bigquery/v0/config/setup.yaml
new file mode 100644
index 000000000..c3198ecbb
--- /dev/null
+++ b/pkg/component/data/bigquery/v0/config/setup.yaml
@@ -0,0 +1,38 @@
+additionalProperties: false
+properties:
+ dataset-id:
+ description: Fill in your BigQuery Dataset ID.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: BigQuery Dataset ID
+ format: string
+ json-key:
+ description: Contents of the JSON key file with access to the bucket.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: JSON Key File contents
+ format: string
+ project-id:
+ description: Fill in your BigQuery Project ID.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: BigQuery Project ID
+ format: string
+ table-name:
+ description: Fill in your BigQuery Table Name.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: BigQuery Table Name
+ format: string
+required:
+- json-key
+- project-id
+- dataset-id
+- table-name
+title: BigQuery Connection
+format: object
diff --git a/pkg/component/data/bigquery/v0/config/tasks.json b/pkg/component/data/bigquery/v0/config/tasks.json
deleted file mode 100644
index d80e4d009..000000000
--- a/pkg/component/data/bigquery/v0/config/tasks.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "TASK_INSERT": {
- "shortDescription": "Insert data to BigQuery.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "data": {
- "additionalProperties": true,
- "shortDescription": "The data to be inserted to BigQuery",
- "description": "The data to be inserted to BigQuery.",
- "uiOrder": 0,
- "required": [],
- "title": "Data",
- "format": "object"
- }
- },
- "required": [],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Status of the upload operation.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_READ": {
- "shortDescription": "Read data from BigQuery.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "filtering": {
- "shortDescription": "The filter to be applied to the data",
- "description": "The filter to be applied to the data with SQL syntax, which starts with WHERE clause.",
- "uiOrder": 0,
- "required": [],
- "title": "Filtering",
- "format": "string"
- }
- },
- "required": [],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "description": "The data to be read from BigQuery.",
- "properties": {
- "data": {
- "description": "The data to be read from BigQuery.",
- "uiOrder": 0,
- "title": "Data",
- "items": {
- "title": "Data item",
- "required": [],
- "format": "object"
- },
- "format": "array"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/bigquery/v0/config/tasks.yaml b/pkg/component/data/bigquery/v0/config/tasks.yaml
new file mode 100644
index 000000000..2115d6b7d
--- /dev/null
+++ b/pkg/component/data/bigquery/v0/config/tasks.yaml
@@ -0,0 +1,61 @@
+TASK_INSERT:
+ shortDescription: Insert data to BigQuery.
+ input:
+ uiOrder: 0
+ properties:
+ data:
+ additionalProperties: true
+ shortDescription: The data to be inserted to BigQuery
+ description: The data to be inserted to BigQuery.
+ uiOrder: 0
+ required: []
+ title: Data
+ format: object
+ required: []
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Status of the upload operation.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_READ:
+ shortDescription: Read data from BigQuery.
+ input:
+ uiOrder: 0
+ properties:
+ filtering:
+ shortDescription: The filter to be applied to the data
+ description: The filter to be applied to the data with SQL syntax, which starts
+ with WHERE clause.
+ uiOrder: 0
+ required: []
+ title: Filtering
+ format: string
+ required: []
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ description: The data to be read from BigQuery.
+ properties:
+ data:
+ description: The data to be read from BigQuery.
+ uiOrder: 0
+ title: Data
+ items:
+ title: Data item
+ required: []
+ format: object
+ format: array
+ required:
+ - data
+ title: Output
+ format: object
diff --git a/pkg/component/data/bigquery/v0/main.go b/pkg/component/data/bigquery/v0/main.go
index 1f85b63ec..3328ca8b8 100644
--- a/pkg/component/data/bigquery/v0/main.go
+++ b/pkg/component/data/bigquery/v0/main.go
@@ -27,14 +27,14 @@ const (
var instillUpstreamTypes = []string{"value", "reference", "template"}
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -50,7 +50,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/chroma/v0/README.mdx b/pkg/component/data/chroma/v0/README.mdx
index 9c97f3944..728f22414 100644
--- a/pkg/component/data/chroma/v0/README.mdx
+++ b/pkg/component/data/chroma/v0/README.mdx
@@ -24,7 +24,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/chroma/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/chroma/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/chroma/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/chroma/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/chroma/v0/config/definition.json b/pkg/component/data/chroma/v0/config/definition.json
deleted file mode 100644
index 0d6057f27..000000000
--- a/pkg/component/data/chroma/v0/config/definition.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "availableTasks": [
- "TASK_BATCH_UPSERT",
- "TASK_UPSERT",
- "TASK_QUERY",
- "TASK_DELETE",
- "TASK_CREATE_COLLECTION",
- "TASK_DELETE_COLLECTION"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/data/chroma",
- "icon": "assets/chroma.svg",
- "id": "chroma",
- "public": true,
- "title": "Chroma",
- "description": "Build and search vector datasets.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "cb69cb22-c1e6-4ebd-aee5-6c1838429de7",
- "vendor": "Chroma",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/chroma/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/chroma/v0/config/definition.yaml b/pkg/component/data/chroma/v0/config/definition.yaml
new file mode 100644
index 000000000..5772061dc
--- /dev/null
+++ b/pkg/component/data/chroma/v0/config/definition.yaml
@@ -0,0 +1,21 @@
+availableTasks:
+- TASK_BATCH_UPSERT
+- TASK_UPSERT
+- TASK_QUERY
+- TASK_DELETE
+- TASK_CREATE_COLLECTION
+- TASK_DELETE_COLLECTION
+documentationUrl: https://www.instill.tech/docs/component/data/chroma
+icon: assets/chroma.svg
+id: chroma
+public: true
+title: Chroma
+description: Build and search vector datasets.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: cb69cb22-c1e6-4ebd-aee5-6c1838429de7
+vendor: Chroma
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/chroma/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/chroma/v0/config/setup.json b/pkg/component/data/chroma/v0/config/setup.json
deleted file mode 100644
index df3f05a7d..000000000
--- a/pkg/component/data/chroma/v0/config/setup.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Chroma API key.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- },
- "url": {
- "description": "Fill in your Chroma hosted public URL endpoint with port, e.g http://1.2.3:8000.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 1,
- "title": "Chroma URL Endpoint",
- "format": "string"
- }
- },
- "required": [
- "api-key",
- "url"
- ],
- "title": "Chroma Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/chroma/v0/config/setup.yaml b/pkg/component/data/chroma/v0/config/setup.yaml
new file mode 100644
index 000000000..eaa4a2890
--- /dev/null
+++ b/pkg/component/data/chroma/v0/config/setup.yaml
@@ -0,0 +1,23 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Chroma API key.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: API Key
+ format: string
+ url:
+ description: Fill in your Chroma hosted public URL endpoint with port, e.g http://1.2.3:8000.
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 1
+ title: Chroma URL Endpoint
+ format: string
+required:
+- api-key
+- url
+title: Chroma Connection
+format: object
diff --git a/pkg/component/data/chroma/v0/config/tasks.json b/pkg/component/data/chroma/v0/config/tasks.json
deleted file mode 100644
index 9118c039a..000000000
--- a/pkg/component/data/chroma/v0/config/tasks.json
+++ /dev/null
@@ -1,562 +0,0 @@
-{
- "TASK_QUERY": {
- "shortDescription": "Perform a vector search on a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to perform vector similarity search on.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "vector": {
- "description": "An array of dimensions for the vector query.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Vector",
- "format": "array"
- },
- "n-results": {
- "description": "The N amount of items to return from the vector search operation.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "title": "N Results",
- "format": "integer"
- },
- "filter": {
- "description": "The metadata filter to be applied to the data with Chroma where filter, please refer to [using-where-filters](https://docs.trychroma.com/guides#using-where-filters).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 3,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "filter-document": {
- "description": "The document content filter to be applied to the data, please refer to [filtering-by-document-contents](https://docs.trychroma.com/guides#filtering-by-document-contents).",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Filter Document",
- "format": "string"
- },
- "fields": {
- "description": "The fields to be returned from the vector search operation.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 5,
- "items": {
- "description": "A field to be returned.",
- "example": "field",
- "format": "string"
- },
- "minItems": 1,
- "title": "Fields",
- "format": "array"
- }
- },
- "required": [
- "collection-name",
- "vector",
- "n-results"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Vector search status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- },
- "result": {
- "description": "Result of the vector search operation.",
- "uiOrder": 0,
- "title": "Result",
- "properties": {
- "ids": {
- "description": "The ids returned from the vector search operation.",
- "uiOrder": 0,
- "title": "IDs",
- "required": [],
- "items": {
- "description": "An id of the item.",
- "example": "c8faa-4b3b-4b3b-4b3b",
- "format": "string"
- },
- "format": "array"
- },
- "items": {
- "description": "The items returned from the vector search operation.",
- "uiOrder": 1,
- "required": [],
- "title": "Items",
- "items": {
- "title": "Point",
- "format": "object",
- "required": []
- },
- "format": "array"
- },
- "vectors": {
- "description": "The vectors returned from the vector search operation.",
- "uiOrder": 2,
- "title": "Vectors",
- "required": [],
- "items": {
- "description": "The vector from array vectors.",
- "required": [],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "format": "array"
- },
- "format": "array"
- },
- "metadata": {
- "description": "The metadata returned from the vector search operation.",
- "uiOrder": 3,
- "title": "Metadata",
- "required": [],
- "items": {
- "title": "Metadatum",
- "format": "object",
- "required": []
- },
- "format": "array"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "status",
- "result"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_BATCH_UPSERT": {
- "shortDescription": "Upsert multiple vector items into a collection, existing items will be updated",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to upsert the item into.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "array-id": {
- "description": "The array of id.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "An id of the point.",
- "example": 1,
- "format": "string"
- },
- "minItems": 1,
- "title": "Array ID",
- "format": "array"
- },
- "array-metadata": {
- "description": "The array of vector metadata.",
- "acceptFormats": [
- "array",
- "array",
- "array",
- "array"
- ],
- "uiOrder": 2,
- "minItems": 1,
- "title": "Array Metadata",
- "items": {
- "description": "The vector metadata.",
- "title": "Metadatum",
- "required": [],
- "format": "object"
- },
- "format": "array"
- },
- "array-vector": {
- "description": "The array of vector values.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "description": "An array of dimensions for the vector value.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "format": "array"
- },
- "minItems": 1,
- "title": "Array Vector",
- "format": "array"
- },
- "array-document": {
- "description": "The array of document string values.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 4,
- "items": {
- "description": "A document string value.",
- "example": "document",
- "format": "string"
- },
- "minItems": 1,
- "title": "Array Document",
- "format": "array"
- },
- "array-uri": {
- "description": "The array of uri.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 5,
- "items": {
- "description": "An uri of the point.",
- "format": "string"
- },
- "minItems": 1,
- "title": "Array URI",
- "format": "array"
- }
- },
- "required": [
- "collection-name",
- "array-id",
- "array-metadata",
- "array-vector"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Batch add status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPSERT": {
- "shortDescription": "Upsert a vector item into a collection, existing item will be updated",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to upsert the item into.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the item.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- },
- "metadata": {
- "description": "The vector metadata.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 2,
- "title": "Metadata",
- "required": [],
- "format": "object"
- },
- "vector": {
- "description": "An array of dimensions for the vector value.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Vector",
- "format": "array"
- },
- "document": {
- "description": "The document string value.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Document",
- "format": "string"
- },
- "uri": {
- "description": "The uri of the item.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 5,
- "title": "URI",
- "format": "string"
- }
- },
- "required": [
- "collection-name",
- "id",
- "metadata",
- "vector"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Add status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE": {
- "shortDescription": "Delete vector items from a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to delete the object from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the item.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- },
- "filter": {
- "description": "The metadata filter to be applied to the data with Chroma where filter, please refer to [using-where-filters](https://docs.trychroma.com/guides#using-where-filters).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 2,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "filter-document": {
- "description": "The document content filter to be applied to the data, please refer to [filtering-by-document-contents](https://docs.trychroma.com/guides#filtering-by-document-contents).",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Filter Document",
- "format": "string"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_COLLECTION": {
- "shortDescription": "Create a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to create.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "metadata": {
- "description": "The metadata of the collection. Please refer to [creating-inspecting-and-deleting-collection](https://docs.trychroma.com/guides#creating,-inspecting,-and-deleting-collections).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 1,
- "title": "Config",
- "required": [],
- "format": "object"
- },
- "configuration": {
- "description": "The configuration of the collection. Please refer to [creating-inspecting-and-deleting-collection](https://docs.trychroma.com/guides#creating,-inspecting,-and-deleting-collections).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 2,
- "title": "Configuration",
- "required": [],
- "format": "object"
- },
- "get-or-create": {
- "description": "If true, the collection will be created if it does not exist.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 3,
- "title": "Get or Create",
- "default": false,
- "format": "boolean"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Create collection status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE_COLLECTION": {
- "shortDescription": "Delete a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to delete.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete collection status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/chroma/v0/config/tasks.yaml b/pkg/component/data/chroma/v0/config/tasks.yaml
new file mode 100644
index 000000000..dc780af12
--- /dev/null
+++ b/pkg/component/data/chroma/v0/config/tasks.yaml
@@ -0,0 +1,444 @@
+TASK_QUERY:
+ shortDescription: Perform a vector search on a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to perform vector similarity search
+ on.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ vector:
+ description: An array of dimensions for the vector query.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 1
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Vector
+ format: array
+ n-results:
+ description: The N amount of items to return from the vector search operation.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: N Results
+ format: integer
+ filter:
+ description: The metadata filter to be applied to the data with Chroma where
+ filter, please refer to [using-where-filters](https://docs.trychroma.com/guides#using-where-filters).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 3
+ title: Filter
+ required: []
+ format: object
+ filter-document:
+ description: The document content filter to be applied to the data, please
+ refer to [filtering-by-document-contents](https://docs.trychroma.com/guides#filtering-by-document-contents).
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Filter Document
+ format: string
+ fields:
+ description: The fields to be returned from the vector search operation.
+ acceptFormats:
+ - array
+ uiOrder: 5
+ items:
+ description: A field to be returned.
+ example: field
+ format: string
+ minItems: 1
+ title: Fields
+ format: array
+ required:
+ - collection-name
+ - vector
+ - n-results
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Vector search status.
+ uiOrder: 0
+ title: Status
+ format: string
+ result:
+ description: Result of the vector search operation.
+ uiOrder: 0
+ title: Result
+ properties:
+ ids:
+ description: The ids returned from the vector search operation.
+ uiOrder: 0
+ title: IDs
+ required: []
+ items:
+ description: An id of the item.
+ example: c8faa-4b3b-4b3b-4b3b
+ format: string
+ format: array
+ items:
+ description: The items returned from the vector search operation.
+ uiOrder: 1
+ required: []
+ title: Items
+ items:
+ title: Point
+ format: object
+ required: []
+ format: array
+ vectors:
+ description: The vectors returned from the vector search operation.
+ uiOrder: 2
+ title: Vectors
+ required: []
+ items:
+ description: The vector from array vectors.
+ required: []
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ format: array
+ format: array
+ metadata:
+ description: The metadata returned from the vector search operation.
+ uiOrder: 3
+ title: Metadata
+ required: []
+ items:
+ title: Metadatum
+ format: object
+ required: []
+ format: array
+ required: []
+ format: object
+ required:
+ - status
+ - result
+ title: Output
+ format: object
+TASK_BATCH_UPSERT:
+ shortDescription: Upsert multiple vector items into a collection, existing items
+ will be updated
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to upsert the item into.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ array-id:
+ description: The array of id.
+ acceptFormats:
+ - array
+ uiOrder: 1
+ items:
+ description: An id of the point.
+ example: 1
+ format: string
+ minItems: 1
+ title: Array ID
+ format: array
+ array-metadata:
+ description: The array of vector metadata.
+ acceptFormats:
+ - array
+ - array
+ - array
+ - array
+ uiOrder: 2
+ minItems: 1
+ title: Array Metadata
+ items:
+ description: The vector metadata.
+ title: Metadatum
+ required: []
+ format: object
+ format: array
+ array-vector:
+ description: The array of vector values.
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ description: An array of dimensions for the vector value.
+ acceptFormats:
+ - array
+ - array
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ format: array
+ minItems: 1
+ title: Array Vector
+ format: array
+ array-document:
+ description: The array of document string values.
+ acceptFormats:
+ - array
+ uiOrder: 4
+ items:
+ description: A document string value.
+ example: document
+ format: string
+ minItems: 1
+ title: Array Document
+ format: array
+ array-uri:
+ description: The array of uri.
+ acceptFormats:
+ - array
+ uiOrder: 5
+ items:
+ description: An uri of the point.
+ format: string
+ minItems: 1
+ title: Array URI
+ format: array
+ required:
+ - collection-name
+ - array-id
+ - array-metadata
+ - array-vector
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Batch add status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_UPSERT:
+ shortDescription: Upsert a vector item into a collection, existing item will be
+ updated
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to upsert the item into.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the item.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ metadata:
+ description: The vector metadata.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 2
+ title: Metadata
+ required: []
+ format: object
+ vector:
+ description: An array of dimensions for the vector value.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 3
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Vector
+ format: array
+ document:
+ description: The document string value.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Document
+ format: string
+ uri:
+ description: The uri of the item.
+ acceptFormats:
+ - string
+ uiOrder: 5
+ title: URI
+ format: string
+ required:
+ - collection-name
+ - id
+ - metadata
+ - vector
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Add status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DELETE:
+ shortDescription: Delete vector items from a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to delete the object from.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the item.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ filter:
+ description: The metadata filter to be applied to the data with Chroma where
+ filter, please refer to [using-where-filters](https://docs.trychroma.com/guides#using-where-filters).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 2
+ title: Filter
+ required: []
+ format: object
+ filter-document:
+ description: The document content filter to be applied to the data, please
+ refer to [filtering-by-document-contents](https://docs.trychroma.com/guides#filtering-by-document-contents).
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Filter Document
+ format: string
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_CREATE_COLLECTION:
+ shortDescription: Create a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to create.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ metadata:
+ description: The metadata of the collection. Please refer to [creating-inspecting-and-deleting-collection](https://docs.trychroma.com/guides#creating,-inspecting,-and-deleting-collections).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 1
+ title: Config
+ required: []
+ format: object
+ configuration:
+ description: The configuration of the collection. Please refer to [creating-inspecting-and-deleting-collection](https://docs.trychroma.com/guides#creating,-inspecting,-and-deleting-collections).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 2
+ title: Configuration
+ required: []
+ format: object
+ get-or-create:
+ description: If true, the collection will be created if it does not exist.
+ acceptFormats:
+ - boolean
+ uiOrder: 3
+ title: Get or Create
+ default: false
+ format: boolean
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Create collection status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DELETE_COLLECTION:
+ shortDescription: Delete a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to delete.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete collection status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
diff --git a/pkg/component/data/chroma/v0/main.go b/pkg/component/data/chroma/v0/main.go
index 9f641000a..88bf394d8 100644
--- a/pkg/component/data/chroma/v0/main.go
+++ b/pkg/component/data/chroma/v0/main.go
@@ -24,14 +24,14 @@ const (
TaskCreateCollection = "TASK_CREATE_COLLECTION"
)
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -50,7 +50,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/elasticsearch/v0/README.mdx b/pkg/component/data/elasticsearch/v0/README.mdx
index aebd281cf..3fef0508b 100644
--- a/pkg/component/data/elasticsearch/v0/README.mdx
+++ b/pkg/component/data/elasticsearch/v0/README.mdx
@@ -26,7 +26,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/elasticsearch/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/elasticsearch/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/elasticsearch/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/elasticsearch/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/elasticsearch/v0/config/definition.json b/pkg/component/data/elasticsearch/v0/config/definition.json
deleted file mode 100644
index fd4080d8a..000000000
--- a/pkg/component/data/elasticsearch/v0/config/definition.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "availableTasks": [
- "TASK_SEARCH",
- "TASK_VECTOR_SEARCH",
- "TASK_INDEX",
- "TASK_MULTI_INDEX",
- "TASK_UPDATE",
- "TASK_DELETE",
- "TASK_CREATE_INDEX",
- "TASK_DELETE_INDEX"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/data/elasticsearch",
- "icon": "assets/elasticsearch.svg",
- "id": "elasticsearch",
- "public": true,
- "title": "Elasticsearch",
- "description": "Access the Elasticsearch database.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "f253a0c1-eb8e-45e1-a677-adb8895f5ceb",
- "vendor": "Elastic",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/elasticsearch/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/elasticsearch/v0/config/definition.yaml b/pkg/component/data/elasticsearch/v0/config/definition.yaml
new file mode 100644
index 000000000..523442fc5
--- /dev/null
+++ b/pkg/component/data/elasticsearch/v0/config/definition.yaml
@@ -0,0 +1,22 @@
+availableTasks:
+- TASK_SEARCH
+- TASK_VECTOR_SEARCH
+- TASK_INDEX
+- TASK_MULTI_INDEX
+- TASK_UPDATE
+- TASK_DELETE
+- TASK_CREATE_INDEX
+- TASK_DELETE_INDEX
+documentationUrl: https://www.instill.tech/docs/component/data/elasticsearch
+icon: assets/elasticsearch.svg
+id: elasticsearch
+public: true
+title: Elasticsearch
+description: Access the Elasticsearch database.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: f253a0c1-eb8e-45e1-a677-adb8895f5ceb
+vendor: Elastic
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/application/elasticsearch/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/elasticsearch/v0/config/setup.json b/pkg/component/data/elasticsearch/v0/config/setup.json
deleted file mode 100644
index 6bbe55cfa..000000000
--- a/pkg/component/data/elasticsearch/v0/config/setup.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in the API key for the Elasticsearch instance (please use encoded one).",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 1,
- "title": "API Key",
- "format": "string"
- },
- "cloud-id": {
- "description": "Fill in the Cloud ID for the Elasticsearch instance.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "Cloud ID",
- "format": "string"
- }
- },
- "required": [
- "api-key",
- "cloud-id"
- ],
- "title": "Elasticsearch Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/elasticsearch/v0/config/setup.yaml b/pkg/component/data/elasticsearch/v0/config/setup.yaml
new file mode 100644
index 000000000..0fe5ca9e8
--- /dev/null
+++ b/pkg/component/data/elasticsearch/v0/config/setup.yaml
@@ -0,0 +1,24 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in the API key for the Elasticsearch instance (please use encoded
+ one).
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 1
+ title: API Key
+ format: string
+ cloud-id:
+ description: Fill in the Cloud ID for the Elasticsearch instance.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: Cloud ID
+ format: string
+required:
+- api-key
+- cloud-id
+title: Elasticsearch Connection
+format: object
diff --git a/pkg/component/data/elasticsearch/v0/config/tasks.json b/pkg/component/data/elasticsearch/v0/config/tasks.json
deleted file mode 100644
index edd1ddc24..000000000
--- a/pkg/component/data/elasticsearch/v0/config/tasks.json
+++ /dev/null
@@ -1,752 +0,0 @@
-{
- "TASK_INDEX": {
- "shortDescription": "Index a document into Elasticsearch",
- "input": {
- "uiOrder": 0,
- "properties": {
- "index-name": {
- "description": "Name of the Elasticsearch index.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Index Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the document.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- },
- "data": {
- "description": "Data to be indexed.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 2,
- "title": "Data",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "index-name",
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Index operation status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_MULTI_INDEX": {
- "shortDescription": "Index multiple documents into Elasticsearch with bulk API",
- "input": {
- "uiOrder": 0,
- "properties": {
- "index-name": {
- "description": "Name of the Elasticsearch index.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Index Name",
- "format": "string"
- },
- "array-id": {
- "description": "The array of id.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "An id of the document.",
- "example": 1,
- "format": "string"
- },
- "minItems": 1,
- "title": "Array ID",
- "format": "array"
- },
- "array-data": {
- "description": "Array data to be indexed.",
- "acceptFormats": [
- "array",
- "array",
- "array",
- "array"
- ],
- "uiOrder": 2,
- "title": "Array Data",
- "items": {
- "description": "The data to be inserted.",
- "title": "Data",
- "required": [],
- "format": "object"
- },
- "minItems": 1,
- "format": "array"
- }
- },
- "required": [
- "index-name",
- "array-data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Index operation status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPDATE": {
- "shortDescription": "Update a document in Elasticsearch",
- "input": {
- "uiOrder": 0,
- "properties": {
- "index-name": {
- "description": "Name of the Elasticsearch index.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Index Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the document.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- },
- "query": {
- "description": "Full text search query for update task, query will be prioritised over filter if both are provided, if both query and filter are not provided, all documents will be selected.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Full text search query, (empty for all documents)",
- "uiOrder": 2,
- "title": "Query",
- "format": "string"
- },
- "filter": {
- "description": "The query dsl filter which starts with \"query\" field, please refer to [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 3,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "filter-sql": {
- "shortDescription": "The filter sql to be applied to the data, if filter or id is provided, this field will be ignored",
- "description": "The filter to be applied to the data with SQL syntax, which starts with WHERE clause, empty for no filter.",
- "uiOrder": 4,
- "acceptFormats": [
- "string"
- ],
- "title": "Filter SQL",
- "format": "string"
- },
- "update-data": {
- "description": "Update data.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 4,
- "title": "Update",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "index-name",
- "update-data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Update operation status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEARCH": {
- "shortDescription": "Search for documents in Elasticsearch, support full text search",
- "input": {
- "uiOrder": 0,
- "properties": {
- "index-name": {
- "description": "Name of the Elasticsearch index.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Index Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the document.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "ID",
- "format": "string"
- },
- "query": {
- "description": "Full text search query for search task, query will be prioritised over filter if both are provided, if both query and filter are not provided, all documents will be selected.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Full text search query, (empty for all documents)",
- "uiOrder": 3,
- "title": "Query",
- "format": "string"
- },
- "filter": {
- "description": "The query dsl filter which starts with \"query\" field, please refer to [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 4,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "filter-sql": {
- "shortDescription": "The filter sql to be applied to the data, if filter or id is provided, this field will be ignored",
- "description": "The filter to be applied to the data with SQL syntax, which starts with WHERE clause, empty for no filter.",
- "uiOrder": 5,
- "acceptFormats": [
- "string"
- ],
- "title": "Filter SQL",
- "format": "string"
- },
- "size": {
- "description": "Number of documents to return. If empty then all documents will be returned.",
- "acceptFormats": [
- "integer"
- ],
- "shortDescription": "Size of documents to return, (empty for all documents)",
- "uiOrder": 6,
- "title": "Size",
- "format": "integer"
- },
- "fields": {
- "description": "The fields to return in the documents. If empty then all fields will be returned.",
- "acceptFormats": [
- "array"
- ],
- "shortDescription": "Fields to be returned, empty for all fields",
- "uiOrder": 7,
- "title": "Fields",
- "items": {
- "title": "Field",
- "format": "string"
- },
- "minItems": 1,
- "format": "array"
- },
- "min-score": {
- "description": "Minimum score to consider for search results. If empty then no minimum score will be considered.",
- "acceptFormats": [
- "number"
- ],
- "shortDescription": "Minimum Score",
- "uiOrder": 8,
- "title": "Minimum Score",
- "format": "number"
- }
- },
- "required": [
- "index-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Search operation status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- },
- "result": {
- "description": "Result of the search operation.",
- "uiOrder": 1,
- "title": "Result",
- "properties": {
- "ids": {
- "description": "The ids returned from the search operation.",
- "uiOrder": 0,
- "title": "IDs",
- "required": [],
- "items": {
- "description": "An id of the document.",
- "example": "c8faa-4b3b-4b3b-4b3b",
- "format": "string"
- },
- "format": "array"
- },
- "documents": {
- "description": "The documents returned from the search operation.",
- "uiOrder": 1,
- "required": [],
- "title": "Documents",
- "items": {
- "title": "Document",
- "format": "object",
- "required": []
- },
- "format": "array"
- },
- "data": {
- "description": "The data returned from the search operation.",
- "uiOrder": 2,
- "title": "Data",
- "required": [],
- "items": {
- "title": "Datum",
- "format": "object",
- "required": []
- },
- "format": "array"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "result",
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_VECTOR_SEARCH": {
- "shortDescription": "Search for vector similarity search in Elasticsearch",
- "input": {
- "uiOrder": 0,
- "properties": {
- "index-name": {
- "description": "Name of the Elasticsearch index.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Index Name",
- "format": "string"
- },
- "field": {
- "description": "Field name of the vector to search for similar vectors.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Field name of the vector",
- "uiOrder": 2,
- "title": "Field",
- "format": "string"
- },
- "query-vector": {
- "description": "Query vector to search for similar vectors.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "shortDescription": "",
- "uiOrder": 3,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Query Vector",
- "format": "array"
- },
- "k": {
- "description": "K of documents to do kNN vector search.",
- "acceptFormats": [
- "integer"
- ],
- "shortDescription": "K of documents to return",
- "uiOrder": 4,
- "title": "K",
- "format": "integer"
- },
- "num-candidates": {
- "description": "Number of candidates to be considered for kNN vector search. Default to 2 times of k.",
- "acceptFormats": [
- "integer"
- ],
- "shortDescription": "Number of candidates to be considered for kNN, default to 2 times of k",
- "uiOrder": 5,
- "title": "Num Candidates",
- "format": "integer"
- },
- "filter": {
- "description": "The query dsl filter which starts with \"filter\" field, please refer to [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search.html#knn-search-filter-example).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 6,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "filter-sql": {
- "shortDescription": "The filter sql to be applied to the data, if filter or id is provided, this field will be ignored",
- "description": "The filter to be applied to the data with SQL syntax, which starts with WHERE clause, empty for no filter.",
- "uiOrder": 7,
- "acceptFormats": [
- "string"
- ],
- "title": "Filter SQL",
- "format": "string"
- },
- "fields": {
- "description": "The fields to return in the documents. If empty then all fields will be returned.",
- "acceptFormats": [
- "array"
- ],
- "shortDescription": "Fields to be returned, empty for all fields",
- "uiOrder": 8,
- "title": "Fields",
- "items": {
- "title": "Field",
- "format": "string"
- },
- "minItems": 1,
- "format": "array"
- },
- "min-score": {
- "description": "Minimum score to consider for search results. If empty then no minimum score will be considered.",
- "acceptFormats": [
- "number"
- ],
- "shortDescription": "Minimum Score",
- "uiOrder": 9,
- "title": "Minimum Score",
- "format": "number"
- }
- },
- "required": [
- "index-name",
- "field"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Search operation status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- },
- "result": {
- "description": "Result of the vector search operation.",
- "uiOrder": 1,
- "title": "Result",
- "properties": {
- "ids": {
- "description": "The ids returned from the vector search operation.",
- "uiOrder": 0,
- "title": "IDs",
- "required": [],
- "items": {
- "description": "An id of the document.",
- "example": "c8faa-4b3b-4b3b-4b3b",
- "format": "string"
- },
- "format": "array"
- },
- "documents": {
- "description": "The documents returned from the vector search operation.",
- "uiOrder": 1,
- "required": [],
- "title": "Documents",
- "items": {
- "title": "Document",
- "format": "object",
- "required": []
- },
- "format": "array"
- },
- "vectors": {
- "description": "The vectors returned from the vector search operation.",
- "uiOrder": 2,
- "title": "Vectors",
- "required": [],
- "items": {
- "description": "The vector from array vectors.",
- "required": [],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "format": "array"
- },
- "format": "array"
- },
- "metadata": {
- "description": "The metadata returned from the vector search operation.",
- "uiOrder": 3,
- "title": "Metadata",
- "required": [],
- "items": {
- "title": "Metadatum",
- "format": "object",
- "required": []
- },
- "format": "array"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "result",
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE": {
- "shortDescription": "Delete documents from Elasticsearch",
- "input": {
- "uiOrder": 0,
- "properties": {
- "index-name": {
- "description": "Name of the Elasticsearch index.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Index Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the document.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- },
- "query": {
- "description": "Full text search query for delete task, query will be prioritised over filter if both are provided, if both query and filter are not provided, all documents will be selected.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Full text search query, (empty for all documents)",
- "uiOrder": 2,
- "title": "Query",
- "format": "string"
- },
- "filter": {
- "description": "The query dsl filter which starts with \"query\" field, please refer to [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 3,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "filter-sql": {
- "shortDescription": "The filter sql to be applied to the data, if filter or id is provided, this field will be ignored",
- "description": "The filter to be applied to the data with SQL syntax, which starts with WHERE clause, empty for no filter.",
- "uiOrder": 4,
- "acceptFormats": [
- "string"
- ],
- "required": [],
- "title": "Filter SQL",
- "format": "string"
- }
- },
- "required": [
- "index-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete operation status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_INDEX": {
- "shortDescription": "Create an index in Elasticsearch",
- "input": {
- "uiOrder": 0,
- "properties": {
- "index-name": {
- "description": "Name of the Elasticsearch index.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Index Name",
- "format": "string"
- },
- "mappings": {
- "description": "Index mappings which starts with {\"mappings\":{\"properties\"}} field, please refer to [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html) for vector search and [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html) for other mappings.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 1,
- "title": "Mappings",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "index-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Create index operation status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE_INDEX": {
- "shortDescription": "Delete an index in Elasticsearch",
- "input": {
- "uiOrder": 0,
- "properties": {
- "index-name": {
- "description": "Name of the Elasticsearch index.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Index Name",
- "format": "string"
- }
- },
- "required": [
- "index-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete index operation status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/elasticsearch/v0/config/tasks.yaml b/pkg/component/data/elasticsearch/v0/config/tasks.yaml
new file mode 100644
index 000000000..c30c699de
--- /dev/null
+++ b/pkg/component/data/elasticsearch/v0/config/tasks.yaml
@@ -0,0 +1,616 @@
+TASK_INDEX:
+ shortDescription: Index a document into Elasticsearch
+ input:
+ uiOrder: 0
+ properties:
+ index-name:
+ description: Name of the Elasticsearch index.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Index Name
+ format: string
+ id:
+ description: The ID of the document.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ data:
+ description: Data to be indexed.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 2
+ title: Data
+ required: []
+ format: object
+ required:
+ - index-name
+ - data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Index operation status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_MULTI_INDEX:
+ shortDescription: Index multiple documents into Elasticsearch with bulk API
+ input:
+ uiOrder: 0
+ properties:
+ index-name:
+ description: Name of the Elasticsearch index.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Index Name
+ format: string
+ array-id:
+ description: The array of id.
+ acceptFormats:
+ - array
+ uiOrder: 1
+ items:
+ description: An id of the document.
+ example: 1
+ format: string
+ minItems: 1
+ title: Array ID
+ format: array
+ array-data:
+ description: Array data to be indexed.
+ acceptFormats:
+ - array
+ - array
+ - array
+ - array
+ uiOrder: 2
+ title: Array Data
+ items:
+ description: The data to be inserted.
+ title: Data
+ required: []
+ format: object
+ minItems: 1
+ format: array
+ required:
+ - index-name
+ - array-data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Index operation status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_UPDATE:
+ shortDescription: Update a document in Elasticsearch
+ input:
+ uiOrder: 0
+ properties:
+ index-name:
+ description: Name of the Elasticsearch index.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Index Name
+ format: string
+ id:
+ description: The ID of the document.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ query:
+ description: Full text search query for update task, query will be prioritised
+ over filter if both are provided, if both query and filter are not provided,
+ all documents will be selected.
+ acceptFormats:
+ - string
+ shortDescription: Full text search query, (empty for all documents)
+ uiOrder: 2
+ title: Query
+ format: string
+ filter:
+ description: The query dsl filter which starts with "query" field, please
+ refer to [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 3
+ title: Filter
+ required: []
+ format: object
+ filter-sql:
+ shortDescription: The filter sql to be applied to the data, if filter or id
+ is provided, this field will be ignored
+ description: The filter to be applied to the data with SQL syntax, which starts
+ with WHERE clause, empty for no filter.
+ uiOrder: 4
+ acceptFormats:
+ - string
+ title: Filter SQL
+ format: string
+ update-data:
+ description: Update data.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 4
+ title: Update
+ required: []
+ format: object
+ required:
+ - index-name
+ - update-data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Update operation status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_SEARCH:
+ shortDescription: Search for documents in Elasticsearch, support full text search
+ input:
+ uiOrder: 0
+ properties:
+ index-name:
+ description: Name of the Elasticsearch index.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Index Name
+ format: string
+ id:
+ description: The ID of the document.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: ID
+ format: string
+ query:
+ description: Full text search query for search task, query will be prioritised
+ over filter if both are provided, if both query and filter are not provided,
+ all documents will be selected.
+ acceptFormats:
+ - string
+ shortDescription: Full text search query, (empty for all documents)
+ uiOrder: 3
+ title: Query
+ format: string
+ filter:
+ description: The query dsl filter which starts with "query" field, please
+ refer to [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 4
+ title: Filter
+ required: []
+ format: object
+ filter-sql:
+ shortDescription: The filter sql to be applied to the data, if filter or id
+ is provided, this field will be ignored
+ description: The filter to be applied to the data with SQL syntax, which starts
+ with WHERE clause, empty for no filter.
+ uiOrder: 5
+ acceptFormats:
+ - string
+ title: Filter SQL
+ format: string
+ size:
+ description: Number of documents to return. If empty then all documents will
+ be returned.
+ acceptFormats:
+ - integer
+ shortDescription: Size of documents to return, (empty for all documents)
+ uiOrder: 6
+ title: Size
+ format: integer
+ fields:
+ description: The fields to return in the documents. If empty then all fields
+ will be returned.
+ acceptFormats:
+ - array
+ shortDescription: Fields to be returned, empty for all fields
+ uiOrder: 7
+ title: Fields
+ items:
+ title: Field
+ format: string
+ minItems: 1
+ format: array
+ min-score:
+ description: Minimum score to consider for search results. If empty then no
+ minimum score will be considered.
+ acceptFormats:
+ - number
+ shortDescription: Minimum Score
+ uiOrder: 8
+ title: Minimum Score
+ format: number
+ required:
+ - index-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Search operation status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ result:
+ description: Result of the search operation.
+ uiOrder: 1
+ title: Result
+ properties:
+ ids:
+ description: The ids returned from the search operation.
+ uiOrder: 0
+ title: IDs
+ required: []
+ items:
+ description: An id of the document.
+ example: c8faa-4b3b-4b3b-4b3b
+ format: string
+ format: array
+ documents:
+ description: The documents returned from the search operation.
+ uiOrder: 1
+ required: []
+ title: Documents
+ items:
+ title: Document
+ format: object
+ required: []
+ format: array
+ data:
+ description: The data returned from the search operation.
+ uiOrder: 2
+ title: Data
+ required: []
+ items:
+ title: Datum
+ format: object
+ required: []
+ format: array
+ required: []
+ format: object
+ required:
+ - result
+ - status
+ title: Output
+ format: object
+TASK_VECTOR_SEARCH:
+ shortDescription: Search for vector similarity search in Elasticsearch
+ input:
+ uiOrder: 0
+ properties:
+ index-name:
+ description: Name of the Elasticsearch index.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Index Name
+ format: string
+ field:
+ description: Field name of the vector to search for similar vectors.
+ acceptFormats:
+ - string
+ shortDescription: Field name of the vector
+ uiOrder: 2
+ title: Field
+ format: string
+ query-vector:
+ description: Query vector to search for similar vectors.
+ acceptFormats:
+ - array
+ - array
+ shortDescription: ''
+ uiOrder: 3
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Query Vector
+ format: array
+ k:
+ description: K of documents to do kNN vector search.
+ acceptFormats:
+ - integer
+ shortDescription: K of documents to return
+ uiOrder: 4
+ title: K
+ format: integer
+ num-candidates:
+ description: Number of candidates to be considered for kNN vector search.
+ Default to 2 times of k.
+ acceptFormats:
+ - integer
+ shortDescription: Number of candidates to be considered for kNN, default to
+ 2 times of k
+ uiOrder: 5
+ title: Num Candidates
+ format: integer
+ filter:
+ description: The query dsl filter which starts with "filter" field, please
+ refer to [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search.html#knn-search-filter-example).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 6
+ title: Filter
+ required: []
+ format: object
+ filter-sql:
+ shortDescription: The filter sql to be applied to the data, if filter or id
+ is provided, this field will be ignored
+ description: The filter to be applied to the data with SQL syntax, which starts
+ with WHERE clause, empty for no filter.
+ uiOrder: 7
+ acceptFormats:
+ - string
+ title: Filter SQL
+ format: string
+ fields:
+ description: The fields to return in the documents. If empty then all fields
+ will be returned.
+ acceptFormats:
+ - array
+ shortDescription: Fields to be returned, empty for all fields
+ uiOrder: 8
+ title: Fields
+ items:
+ title: Field
+ format: string
+ minItems: 1
+ format: array
+ min-score:
+ description: Minimum score to consider for search results. If empty then no
+ minimum score will be considered.
+ acceptFormats:
+ - number
+ shortDescription: Minimum Score
+ uiOrder: 9
+ title: Minimum Score
+ format: number
+ required:
+ - index-name
+ - field
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Search operation status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ result:
+ description: Result of the vector search operation.
+ uiOrder: 1
+ title: Result
+ properties:
+ ids:
+ description: The ids returned from the vector search operation.
+ uiOrder: 0
+ title: IDs
+ required: []
+ items:
+ description: An id of the document.
+ example: c8faa-4b3b-4b3b-4b3b
+ format: string
+ format: array
+ documents:
+ description: The documents returned from the vector search operation.
+ uiOrder: 1
+ required: []
+ title: Documents
+ items:
+ title: Document
+ format: object
+ required: []
+ format: array
+ vectors:
+ description: The vectors returned from the vector search operation.
+ uiOrder: 2
+ title: Vectors
+ required: []
+ items:
+ description: The vector from array vectors.
+ required: []
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ format: array
+ format: array
+ metadata:
+ description: The metadata returned from the vector search operation.
+ uiOrder: 3
+ title: Metadata
+ required: []
+ items:
+ title: Metadatum
+ format: object
+ required: []
+ format: array
+ required: []
+ format: object
+ required:
+ - result
+ - status
+ title: Output
+ format: object
+TASK_DELETE:
+ shortDescription: Delete documents from Elasticsearch
+ input:
+ uiOrder: 0
+ properties:
+ index-name:
+ description: Name of the Elasticsearch index.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Index Name
+ format: string
+ id:
+ description: The ID of the document.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ query:
+ description: Full text search query for delete task, query will be prioritised
+ over filter if both are provided, if both query and filter are not provided,
+ all documents will be selected.
+ acceptFormats:
+ - string
+ shortDescription: Full text search query, (empty for all documents)
+ uiOrder: 2
+ title: Query
+ format: string
+ filter:
+ description: The query dsl filter which starts with "query" field, please
+ refer to [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 3
+ title: Filter
+ required: []
+ format: object
+ filter-sql:
+ shortDescription: The filter sql to be applied to the data, if filter or id
+ is provided, this field will be ignored
+ description: The filter to be applied to the data with SQL syntax, which starts
+ with WHERE clause, empty for no filter.
+ uiOrder: 4
+ acceptFormats:
+ - string
+ required: []
+ title: Filter SQL
+ format: string
+ required:
+ - index-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete operation status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_CREATE_INDEX:
+ shortDescription: Create an index in Elasticsearch
+ input:
+ uiOrder: 0
+ properties:
+ index-name:
+ description: Name of the Elasticsearch index.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Index Name
+ format: string
+ mappings:
+ description: Index mappings which starts with {"mappings":{"properties"}}
+ field, please refer to [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html)
+ for vector search and [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html)
+ for other mappings.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 1
+ title: Mappings
+ required: []
+ format: object
+ required:
+ - index-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Create index operation status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DELETE_INDEX:
+ shortDescription: Delete an index in Elasticsearch
+ input:
+ uiOrder: 0
+ properties:
+ index-name:
+ description: Name of the Elasticsearch index.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Index Name
+ format: string
+ required:
+ - index-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete index operation status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
diff --git a/pkg/component/data/elasticsearch/v0/main.go b/pkg/component/data/elasticsearch/v0/main.go
index 11b75fd1f..5c9b80e68 100644
--- a/pkg/component/data/elasticsearch/v0/main.go
+++ b/pkg/component/data/elasticsearch/v0/main.go
@@ -28,12 +28,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -83,7 +83,7 @@ type ESBulk func(body io.Reader, o ...func(*esapi.BulkRequest)) (*esapi.Response
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/googlecloudstorage/v0/README.mdx b/pkg/component/data/googlecloudstorage/v0/README.mdx
index ddc5910ab..cbd60f2ec 100644
--- a/pkg/component/data/googlecloudstorage/v0/README.mdx
+++ b/pkg/component/data/googlecloudstorage/v0/README.mdx
@@ -21,7 +21,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlecloudstorage/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlecloudstorage/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlecloudstorage/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlecloudstorage/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/googlecloudstorage/v0/config/definition.json b/pkg/component/data/googlecloudstorage/v0/config/definition.json
deleted file mode 100644
index d87ca4f57..000000000
--- a/pkg/component/data/googlecloudstorage/v0/config/definition.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "availableTasks": [
- "TASK_UPLOAD",
- "TASK_READ_OBJECTS",
- "TASK_CREATE_BUCKET"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/data/gcs",
- "icon": "assets/gcs.svg",
- "iconUrl": "",
- "id": "gcs",
- "public": true,
- "title": "Google Cloud Storage",
- "description": "Upload data to Google's Cloud Storage.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "205cbeff-6f45-4abe-b0a8-cec1a310137f",
- "vendor": "Google",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlecloudstorage/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/googlecloudstorage/v0/config/definition.yaml b/pkg/component/data/googlecloudstorage/v0/config/definition.yaml
new file mode 100644
index 000000000..612fc34dd
--- /dev/null
+++ b/pkg/component/data/googlecloudstorage/v0/config/definition.yaml
@@ -0,0 +1,20 @@
+availableTasks:
+- TASK_UPLOAD
+- TASK_READ_OBJECTS
+- TASK_CREATE_BUCKET
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/data/gcs
+icon: assets/gcs.svg
+iconUrl: ''
+id: gcs
+public: true
+title: Google Cloud Storage
+description: Upload data to Google's Cloud Storage.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: 205cbeff-6f45-4abe-b0a8-cec1a310137f
+vendor: Google
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlecloudstorage/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/googlecloudstorage/v0/config/setup.json b/pkg/component/data/googlecloudstorage/v0/config/setup.json
deleted file mode 100644
index d6cfc77b1..000000000
--- a/pkg/component/data/googlecloudstorage/v0/config/setup.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "json-key": {
- "description": "Contents of the JSON key file with access to the bucket.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 1,
- "title": "JSON Key File contents",
- "format": "string"
- }
- },
- "required": [
- "json-key"
- ],
- "title": "Google Cloud Storage Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/googlecloudstorage/v0/config/setup.yaml b/pkg/component/data/googlecloudstorage/v0/config/setup.yaml
new file mode 100644
index 000000000..8f421e321
--- /dev/null
+++ b/pkg/component/data/googlecloudstorage/v0/config/setup.yaml
@@ -0,0 +1,14 @@
+additionalProperties: false
+properties:
+ json-key:
+ description: Contents of the JSON key file with access to the bucket.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 1
+ title: JSON Key File contents
+ format: string
+required:
+- json-key
+title: Google Cloud Storage Connection
+format: object
diff --git a/pkg/component/data/googlecloudstorage/v0/config/tasks.json b/pkg/component/data/googlecloudstorage/v0/config/tasks.json
deleted file mode 100644
index 24ae4a536..000000000
--- a/pkg/component/data/googlecloudstorage/v0/config/tasks.json
+++ /dev/null
@@ -1,434 +0,0 @@
-{
- "$defs": {
- "bucket-name": {
- "description": "Name of the bucket to be used for object storage.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 0,
- "title": "Bucket Name",
- "format": "string"
- },
- "data": {
- "description": "The data of the object.",
- "uiOrder": 0,
- "title": "Data",
- "format": "string"
- },
- "attributes": {
- "description": "The attributes of the object.",
- "properties": {
- "name": {
- "description": "The name of the object.",
- "uiOrder": 0,
- "title": "Object Name",
- "format": "string"
- },
- "content-type": {
- "description": "The content type of the object.",
- "uiOrder": 1,
- "title": "Content Type",
- "format": "string"
- },
- "content-language": {
- "description": "The content language of the object.",
- "uiOrder": 2,
- "title": "Content Language",
- "format": "string"
- },
- "owner": {
- "description": "The owner of the object.",
- "uiOrder": 3,
- "title": "Owner",
- "format": "string"
- },
- "size": {
- "description": "The size of the object.",
- "uiOrder": 4,
- "title": "Size",
- "format": "integer"
- },
- "content-encoding": {
- "description": "The content encoding of the object.",
- "uiOrder": 5,
- "title": "Content Encoding",
- "format": "string"
- },
- "content-disposition": {
- "description": "The content disposition of the object.",
- "uiOrder": 6,
- "title": "Content Disposition",
- "format": "string"
- },
- "media-link": {
- "description": "The media link of the object.",
- "uiOrder": 7,
- "title": "Media Link",
- "format": "string"
- },
- "metadata": {
- "description": "The object metadata.",
- "uiOrder": 8,
- "title": "Metadata",
- "required": [],
- "format": "object"
- },
- "storage-class": {
- "description": "The storage class of the object.",
- "uiOrder": 9,
- "title": "Storage Class",
- "format": "string"
- }
- },
- "acceptFormats": [
- "object"
- ],
- "required": [],
- "uiOrder": 1,
- "title": "Attributes",
- "format": "object"
- }
- },
- "TASK_UPLOAD": {
- "shortDescription": "Upload data to Google Cloud Storage.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "bucket-name": {
- "$ref": "#/$defs/bucket-name"
- },
- "data": {
- "description": "The data to be saved in the object.",
- "acceptFormats": [
- "*"
- ],
- "uiOrder": 1,
- "title": "Data",
- "format": "string"
- },
- "object-name": {
- "description": "The name of the object to be created.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Object Name",
- "format": "string"
- }
- },
- "required": [
- "object-name",
- "bucket-name",
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "authenticated-url": {
- "description": "Only users granted permission can access the object with this link.",
- "format": "string",
- "uiOrder": 0,
- "title": "Authenticated URL"
- },
- "gsutil-uri": {
- "description": "File path to this resource in Cloud Storage.",
- "format": "string",
- "uiOrder": 1,
- "title": "Gsutil URI"
- },
- "public-access": {
- "description": "Whether the object is publicly accessible.",
- "uiOrder": 2,
- "title": "Public Access",
- "format": "boolean"
- },
- "public-url": {
- "description": "Anyone with this link can access the object on the public Internet.",
- "uiOrder": 3,
- "title": "Public URL",
- "format": "string"
- },
- "status": {
- "description": "Status of the upload operation.",
- "uiOrder": 4,
- "title": "Upload Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_READ_OBJECTS": {
- "shortDescription": "Read objects from Google Cloud Storage.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "bucket-name": {
- "$ref": "#/$defs/bucket-name"
- },
- "delimiter": {
- "description": "The delimiter to use when listing objects.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Delimiter",
- "format": "string"
- },
- "prefix": {
- "description": "The prefix to use when listing objects.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Prefix",
- "format": "string"
- },
- "versions": {
- "description": "Whether to list all versions of an object.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 3,
- "title": "Versions",
- "format": "boolean"
- },
- "start-offset": {
- "description": "The offset to start listing objects from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Start Offset",
- "format": "string"
- },
- "end-offset": {
- "description": "The offset to stop listing objects at.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 5,
- "title": "End Offset",
- "format": "string"
- },
- "include-trailing-delimiter": {
- "description": "Whether to include the delimiter in the object name.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 6,
- "title": "Include Trailing Delimiter",
- "format": "boolean"
- },
- "match-glob": {
- "description": "Whether to match objects using a glob pattern.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 7,
- "title": "Match Glob",
- "format": "string"
- },
- "include-folders-as-prefixes": {
- "description": "Whether to include folders as prefixes.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 8,
- "title": "Include Folders As Prefixes",
- "format": "boolean"
- }
- },
- "required": [
- "bucket-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "text-objects": {
- "description": "The text objects in the bucket.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "title": "Text Objects",
- "items": {
- "properties": {
- "data": {
- "$ref": "#/$defs/data"
- },
- "attributes": {
- "$ref": "#/$defs/attributes"
- }
- },
- "required": [],
- "format": "object"
- },
- "format": "array"
- },
- "image-objects": {
- "description": "The image objects in the bucket.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 1,
- "title": "Image Objects",
- "items": {
- "properties": {
- "data": {
- "$ref": "#/$defs/data"
- },
- "attributes": {
- "$ref": "#/$defs/attributes"
- }
- },
- "required": [],
- "format": "object"
- },
- "format": "array"
- },
- "document-objects": {
- "description": "The document objects in the bucket.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 2,
- "title": "Document Objects",
- "items": {
- "properties": {
- "data": {
- "$ref": "#/$defs/data"
- },
- "attributes": {
- "$ref": "#/$defs/attributes"
- }
- },
- "required": [],
- "title": "Object",
- "format": "object"
- },
- "format": "array"
- },
- "audio-objects": {
- "description": "The audio objects in the bucket.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "title": "Audio Objects",
- "items": {
- "properties": {
- "data": {
- "$ref": "#/$defs/data"
- },
- "attributes": {
- "$ref": "#/$defs/attributes"
- }
- },
- "required": [],
- "title": "Object",
- "format": "object"
- },
- "format": "array"
- },
- "video-objects": {
- "description": "The video objects in the bucket.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 4,
- "title": "Video Objects",
- "items": {
- "properties": {
- "data": {
- "$ref": "#/$defs/data"
- },
- "attributes": {
- "$ref": "#/$defs/attributes"
- }
- },
- "required": [],
- "title": "Object",
- "format": "object"
- },
- "format": "array"
- }
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_BUCKET": {
- "shortDescription": "Read objects from Google Cloud Storage.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "bucket-name": {
- "$ref": "#/$defs/bucket-name"
- },
- "project-id": {
- "description": "The project ID to create the bucket in.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Project ID",
- "format": "string"
- },
- "location": {
- "description": "The location to create the bucket in.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Location",
- "format": "string"
- }
- },
- "required": [
- "bucket-name",
- "project-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "result": {
- "description": "The result of the operation.",
- "uiOrder": 0,
- "title": "Result",
- "format": "string"
- },
- "name": {
- "description": "The name of the bucket.",
- "uiOrder": 1,
- "title": "Bucket Name",
- "format": "string"
- },
- "location": {
- "description": "The location of the bucket.",
- "uiOrder": 2,
- "title": "Location",
- "format": "string"
- }
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/googlecloudstorage/v0/config/tasks.yaml b/pkg/component/data/googlecloudstorage/v0/config/tasks.yaml
new file mode 100644
index 000000000..7ed1783ee
--- /dev/null
+++ b/pkg/component/data/googlecloudstorage/v0/config/tasks.yaml
@@ -0,0 +1,332 @@
+$defs:
+ bucket-name:
+ description: Name of the bucket to be used for object storage.
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 0
+ title: Bucket Name
+ format: string
+ data:
+ description: The data of the object.
+ uiOrder: 0
+ title: Data
+ format: string
+ attributes:
+ description: The attributes of the object.
+ properties:
+ name:
+ description: The name of the object.
+ uiOrder: 0
+ title: Object Name
+ format: string
+ content-type:
+ description: The content type of the object.
+ uiOrder: 1
+ title: Content Type
+ format: string
+ content-language:
+ description: The content language of the object.
+ uiOrder: 2
+ title: Content Language
+ format: string
+ owner:
+ description: The owner of the object.
+ uiOrder: 3
+ title: Owner
+ format: string
+ size:
+ description: The size of the object.
+ uiOrder: 4
+ title: Size
+ format: integer
+ content-encoding:
+ description: The content encoding of the object.
+ uiOrder: 5
+ title: Content Encoding
+ format: string
+ content-disposition:
+ description: The content disposition of the object.
+ uiOrder: 6
+ title: Content Disposition
+ format: string
+ media-link:
+ description: The media link of the object.
+ uiOrder: 7
+ title: Media Link
+ format: string
+ metadata:
+ description: The object metadata.
+ uiOrder: 8
+ title: Metadata
+ required: []
+ format: object
+ storage-class:
+ description: The storage class of the object.
+ uiOrder: 9
+ title: Storage Class
+ format: string
+ acceptFormats:
+ - object
+ required: []
+ uiOrder: 1
+ title: Attributes
+ format: object
+TASK_UPLOAD:
+ shortDescription: Upload data to Google Cloud Storage.
+ input:
+ uiOrder: 0
+ properties:
+ bucket-name:
+ $ref: '#/$defs/bucket-name'
+ data:
+ description: The data to be saved in the object.
+ acceptFormats:
+ - '*'
+ uiOrder: 1
+ title: Data
+ format: string
+ object-name:
+ description: The name of the object to be created.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Object Name
+ format: string
+ required:
+ - object-name
+ - bucket-name
+ - data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ authenticated-url:
+ description: Only users granted permission can access the object with this
+ link.
+ format: string
+ uiOrder: 0
+ title: Authenticated URL
+ gsutil-uri:
+ description: File path to this resource in Cloud Storage.
+ format: string
+ uiOrder: 1
+ title: Gsutil URI
+ public-access:
+ description: Whether the object is publicly accessible.
+ uiOrder: 2
+ title: Public Access
+ format: boolean
+ public-url:
+ description: Anyone with this link can access the object on the public Internet.
+ uiOrder: 3
+ title: Public URL
+ format: string
+ status:
+ description: Status of the upload operation.
+ uiOrder: 4
+ title: Upload Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_READ_OBJECTS:
+ shortDescription: Read objects from Google Cloud Storage.
+ input:
+ uiOrder: 0
+ properties:
+ bucket-name:
+ $ref: '#/$defs/bucket-name'
+ delimiter:
+ description: The delimiter to use when listing objects.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Delimiter
+ format: string
+ prefix:
+ description: The prefix to use when listing objects.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Prefix
+ format: string
+ versions:
+ description: Whether to list all versions of an object.
+ acceptFormats:
+ - boolean
+ uiOrder: 3
+ title: Versions
+ format: boolean
+ start-offset:
+ description: The offset to start listing objects from.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Start Offset
+ format: string
+ end-offset:
+ description: The offset to stop listing objects at.
+ acceptFormats:
+ - string
+ uiOrder: 5
+ title: End Offset
+ format: string
+ include-trailing-delimiter:
+ description: Whether to include the delimiter in the object name.
+ acceptFormats:
+ - boolean
+ uiOrder: 6
+ title: Include Trailing Delimiter
+ format: boolean
+ match-glob:
+ description: Whether to match objects using a glob pattern.
+ acceptFormats:
+ - string
+ uiOrder: 7
+ title: Match Glob
+ format: string
+ include-folders-as-prefixes:
+ description: Whether to include folders as prefixes.
+ acceptFormats:
+ - boolean
+ uiOrder: 8
+ title: Include Folders As Prefixes
+ format: boolean
+ required:
+ - bucket-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ text-objects:
+ description: The text objects in the bucket.
+ acceptFormats:
+ - array
+ uiOrder: 0
+ title: Text Objects
+ items:
+ properties:
+ data:
+ $ref: '#/$defs/data'
+ attributes:
+ $ref: '#/$defs/attributes'
+ required: []
+ format: object
+ format: array
+ image-objects:
+ description: The image objects in the bucket.
+ acceptFormats:
+ - array
+ uiOrder: 1
+ title: Image Objects
+ items:
+ properties:
+ data:
+ $ref: '#/$defs/data'
+ attributes:
+ $ref: '#/$defs/attributes'
+ required: []
+ format: object
+ format: array
+ document-objects:
+ description: The document objects in the bucket.
+ acceptFormats:
+ - array
+ uiOrder: 2
+ title: Document Objects
+ items:
+ properties:
+ data:
+ $ref: '#/$defs/data'
+ attributes:
+ $ref: '#/$defs/attributes'
+ required: []
+ title: Object
+ format: object
+ format: array
+ audio-objects:
+ description: The audio objects in the bucket.
+ acceptFormats:
+ - array
+ uiOrder: 3
+ title: Audio Objects
+ items:
+ properties:
+ data:
+ $ref: '#/$defs/data'
+ attributes:
+ $ref: '#/$defs/attributes'
+ required: []
+ title: Object
+ format: object
+ format: array
+ video-objects:
+ description: The video objects in the bucket.
+ acceptFormats:
+ - array
+ uiOrder: 4
+ title: Video Objects
+ items:
+ properties:
+ data:
+ $ref: '#/$defs/data'
+ attributes:
+ $ref: '#/$defs/attributes'
+ required: []
+ title: Object
+ format: object
+ format: array
+ required: []
+ title: Output
+ format: object
+TASK_CREATE_BUCKET:
+ shortDescription: Read objects from Google Cloud Storage.
+ input:
+ uiOrder: 0
+ properties:
+ bucket-name:
+ $ref: '#/$defs/bucket-name'
+ project-id:
+ description: The project ID to create the bucket in.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Project ID
+ format: string
+ location:
+ description: The location to create the bucket in.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Location
+ format: string
+ required:
+ - bucket-name
+ - project-id
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ result:
+ description: The result of the operation.
+ uiOrder: 0
+ title: Result
+ format: string
+ name:
+ description: The name of the bucket.
+ uiOrder: 1
+ title: Bucket Name
+ format: string
+ location:
+ description: The location of the bucket.
+ uiOrder: 2
+ title: Location
+ format: string
+ required: []
+ title: Output
+ format: object
diff --git a/pkg/component/data/googlecloudstorage/v0/main.go b/pkg/component/data/googlecloudstorage/v0/main.go
index 52b99a966..73aa99481 100644
--- a/pkg/component/data/googlecloudstorage/v0/main.go
+++ b/pkg/component/data/googlecloudstorage/v0/main.go
@@ -21,14 +21,14 @@ const (
taskCreateBucket = "TASK_CREATE_BUCKET"
)
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -44,7 +44,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/googledrive/v0/README.mdx b/pkg/component/data/googledrive/v0/README.mdx
index f9d6a3d4c..d815edb5d 100644
--- a/pkg/component/data/googledrive/v0/README.mdx
+++ b/pkg/component/data/googledrive/v0/README.mdx
@@ -21,7 +21,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googledrive/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googledrive/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googledrive/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googledrive/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/googledrive/v0/config/definition.json b/pkg/component/data/googledrive/v0/config/definition.json
deleted file mode 100644
index 6ba8c6c50..000000000
--- a/pkg/component/data/googledrive/v0/config/definition.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "availableTasks": [
- "TASK_READ_FILE",
- "TASK_READ_FOLDER"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/data/google-drive",
- "icon": "assets/google-drive.svg",
- "id": "google-drive",
- "public": true,
- "title": "Google Drive",
- "description": "Connect to, and read files and folders within an existing Google Drive.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "cd220d2d-3d19-468e-8b95-37dd6a57c15f",
- "vendor": "Google",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googledrive/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/googledrive/v0/config/definition.yaml b/pkg/component/data/googledrive/v0/config/definition.yaml
new file mode 100644
index 000000000..fec7d70ee
--- /dev/null
+++ b/pkg/component/data/googledrive/v0/config/definition.yaml
@@ -0,0 +1,18 @@
+availableTasks:
+- TASK_READ_FILE
+- TASK_READ_FOLDER
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/data/google-drive
+icon: assets/google-drive.svg
+id: google-drive
+public: true
+title: Google Drive
+description: Connect to, and read files and folders within an existing Google Drive.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: cd220d2d-3d19-468e-8b95-37dd6a57c15f
+vendor: Google
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googledrive/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/googledrive/v0/config/setup.json b/pkg/component/data/googledrive/v0/config/setup.json
deleted file mode 100644
index 45a591383..000000000
--- a/pkg/component/data/googledrive/v0/config/setup.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "properties": {
- "refresh-token": {
- "description": "Refresh token for the Google Drive API. For more information about how to create tokens, please refer to the Google Drive API documentation and OAuth 2.0 documentation.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 1,
- "title": "Refresh Token",
- "format": "string"
- }
- },
- "required": [],
- "instillOAuthConfig": {
- "authUrl": "https://accounts.google.com/o/oauth2/auth",
- "accessUrl": "https://oauth2.googleapis.com/token",
- "scopes": [
- "https://www.googleapis.com/auth/drive.readonly",
- "https://www.googleapis.com/auth/drive.file",
- "https://www.googleapis.com/auth/userinfo.email",
- "https://www.googleapis.com/auth/userinfo.profile"
- ]
- },
- "title": "Google Drive Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/googledrive/v0/config/setup.yaml b/pkg/component/data/googledrive/v0/config/setup.yaml
new file mode 100644
index 000000000..50ec74404
--- /dev/null
+++ b/pkg/component/data/googledrive/v0/config/setup.yaml
@@ -0,0 +1,23 @@
+properties:
+ refresh-token:
+ description: Refresh token for the Google Drive API. For more information about
+ how to create tokens, please refer to the Google
+ Drive API documentation and OAuth 2.0 documentation.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 1
+ title: Refresh Token
+ format: string
+required: []
+instillOAuthConfig:
+ authUrl: https://accounts.google.com/o/oauth2/auth
+ accessUrl: https://oauth2.googleapis.com/token
+ scopes:
+ - https://www.googleapis.com/auth/drive.readonly
+ - https://www.googleapis.com/auth/drive.file
+ - https://www.googleapis.com/auth/userinfo.email
+ - https://www.googleapis.com/auth/userinfo.profile
+title: Google Drive Connection
+format: object
diff --git a/pkg/component/data/googledrive/v0/config/tasks.json b/pkg/component/data/googledrive/v0/config/tasks.json
deleted file mode 100644
index ad1e86328..000000000
--- a/pkg/component/data/googledrive/v0/config/tasks.json
+++ /dev/null
@@ -1,168 +0,0 @@
-{
- "$defs": {
- "file": {
- "description": "File in Google Drive.",
- "uiOrder": 0,
- "properties": {
- "id": {
- "description": "Unique ID of the file.",
- "uiOrder": 0,
- "title": "ID",
- "format": "string"
- },
- "name": {
- "description": "Name of the file. The file extension will be added automatically based on the exported MIME type. For example, Google Sheets will be exported as CSV, Google Docs as PDF, and Google Slides as PDF. If the file is a Google Sheet and the name is `MySheet`, the exported file will be `MySheet.csv`. If the file is not a Google file, the name will be used as is.",
- "uiOrder": 1,
- "title": "Name",
- "format": "string"
- },
- "content": {
- "description": "Base64 encoded content of the binary file without the `data:[MIME_TYPE];base64,` prefix. Google Sheets will be exported as CSV, Google Docs as PDF, and Google Slides as PDF. If the file is not a Google file, the content will be the same as the original file.",
- "uiOrder": 2,
- "title": "Content",
- "format": "string"
- },
- "created-time": {
- "description": "Time when the file was created. Format: `YYYY-MM-DDTHH:MM:SSZ`.",
- "uiOrder": 3,
- "title": "Created time",
- "format": "string"
- },
- "modified-time": {
- "description": "Time when the file was last modified. Format: `YYYY-MM-DDTHH:MM:SSZ`.",
- "uiOrder": 4,
- "title": "Modified time",
- "format": "string"
- },
- "size": {
- "description": "Size of the file in bytes.",
- "uiOrder": 5,
- "title": "Size",
- "format": "integer"
- },
- "mime-type": {
- "description": "MIME type of the file. For example, `application/pdf`, `text/csv`, `image/jpeg`, etc.",
- "uiOrder": 6,
- "title": "MIME type",
- "format": "string"
- },
- "md5-checksum": {
- "description": "MD5 checksum of the file. This reflects every change made to the file on the server, even those not visible to the user.",
- "uiOrder": 7,
- "title": "MD5 checksum",
- "format": "string"
- },
- "version": {
- "description": "Version of the file in Google Drive.",
- "uiOrder": 8,
- "title": "Version",
- "format": "integer"
- },
- "web-view-link": {
- "description": "Link for opening the file in a relevant Google editor or viewer in a browser. Usually, web view link is same as shared link.",
- "uiOrder": 9,
- "title": "Web View Link",
- "format": "string"
- },
- "web-content-link": {
- "description": "Link for downloading the content of the file in a browser.",
- "uiOrder": 10,
- "title": "Web Content Link",
- "format": "string"
- }
- },
- "required": [
- "id",
- "name",
- "created-time",
- "modified-time",
- "size",
- "mime-type",
- "version",
- "web-view-link"
- ],
- "title": "File",
- "format": "object"
- },
- "shared-link": {
- "description": "Shared link of the file. You can get the shared link by right-clicking on the file and selecting `Copy link`.",
- "uiOrder": 0,
- "title": "File ID",
- "format": "string"
- }
- },
- "TASK_READ_FILE": {
- "shortDescription": "Read a file content and metadata from Google Drive.",
- "input": {
- "description": "Please provide the shared link of the file to read from Google Drive.",
- "uiOrder": 0,
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- }
- },
- "required": [
- "shared-link"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 1,
- "properties": {
- "file": {
- "$ref": "#/$defs/file"
- }
- },
- "required": [
- "file"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_READ_FOLDER": {
- "shortDescription": "Read metadata and content of files under the specified folder in Google Drive.",
- "input": {
- "description": "Please provide the shared link of the folder to read from Google Drive.",
- "uiOrder": 0,
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "read-content": {
- "description": "Whether to read the content of the files under the folder.",
- "uiOrder": 1,
- "title": "Read Content",
- "format": "boolean"
- }
- },
- "required": [
- "shared-link"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 1,
- "properties": {
- "files": {
- "description": "List of files under the specified folder.",
- "uiOrder": 0,
- "items": {
- "$ref": "#/$defs/file"
- },
- "required": [],
- "title": "Files",
- "format": "array"
- }
- },
- "required": [
- "files"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/googledrive/v0/config/tasks.yaml b/pkg/component/data/googledrive/v0/config/tasks.yaml
new file mode 100644
index 000000000..eb1481ad7
--- /dev/null
+++ b/pkg/component/data/googledrive/v0/config/tasks.yaml
@@ -0,0 +1,143 @@
+$defs:
+ file:
+ description: File in Google Drive.
+ uiOrder: 0
+ properties:
+ id:
+ description: Unique ID of the file.
+ uiOrder: 0
+ title: ID
+ format: string
+ name:
+ description: Name of the file. The file extension will be added automatically
+ based on the exported MIME type. For example, Google Sheets will be exported
+ as CSV, Google Docs as PDF, and Google Slides as PDF. If the file is a Google
+ Sheet and the name is `MySheet`, the exported file will be `MySheet.csv`.
+ If the file is not a Google file, the name will be used as is.
+ uiOrder: 1
+ title: Name
+ format: string
+ content:
+ description: Base64 encoded content of the binary file without the `data:[MIME_TYPE];base64,`
+ prefix. Google Sheets will be exported as CSV, Google Docs as PDF, and Google
+ Slides as PDF. If the file is not a Google file, the content will be the
+ same as the original file.
+ uiOrder: 2
+ title: Content
+ format: string
+ created-time:
+ description: 'Time when the file was created. Format: `YYYY-MM-DDTHH:MM:SSZ`.'
+ uiOrder: 3
+ title: Created time
+ format: string
+ modified-time:
+ description: 'Time when the file was last modified. Format: `YYYY-MM-DDTHH:MM:SSZ`.'
+ uiOrder: 4
+ title: Modified time
+ format: string
+ size:
+ description: Size of the file in bytes.
+ uiOrder: 5
+ title: Size
+ format: integer
+ mime-type:
+ description: MIME type of the file. For example, `application/pdf`, `text/csv`,
+ `image/jpeg`, etc.
+ uiOrder: 6
+ title: MIME type
+ format: string
+ md5-checksum:
+ description: MD5 checksum of the file. This reflects every change made to
+ the file on the server, even those not visible to the user.
+ uiOrder: 7
+ title: MD5 checksum
+ format: string
+ version:
+ description: Version of the file in Google Drive.
+ uiOrder: 8
+ title: Version
+ format: integer
+ web-view-link:
+ description: Link for opening the file in a relevant Google editor or viewer
+ in a browser. Usually, web view link is same as shared link.
+ uiOrder: 9
+ title: Web View Link
+ format: string
+ web-content-link:
+ description: Link for downloading the content of the file in a browser.
+ uiOrder: 10
+ title: Web Content Link
+ format: string
+ required:
+ - id
+ - name
+ - created-time
+ - modified-time
+ - size
+ - mime-type
+ - version
+ - web-view-link
+ title: File
+ format: object
+ shared-link:
+ description: Shared link of the file. You can get the shared link by right-clicking
+ on the file and selecting `Copy link`.
+ uiOrder: 0
+ title: File ID
+ format: string
+TASK_READ_FILE:
+ shortDescription: Read a file content and metadata from Google Drive.
+ input:
+ description: Please provide the shared link of the file to read from Google Drive.
+ uiOrder: 0
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ required:
+ - shared-link
+ title: Input
+ format: object
+ output:
+ uiOrder: 1
+ properties:
+ file:
+ $ref: '#/$defs/file'
+ required:
+ - file
+ title: Output
+ format: object
+TASK_READ_FOLDER:
+ shortDescription: Read metadata and content of files under the specified folder
+ in Google Drive.
+ input:
+ description: Please provide the shared link of the folder to read from Google
+ Drive.
+ uiOrder: 0
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ read-content:
+ description: Whether to read the content of the files under the folder.
+ uiOrder: 1
+ title: Read Content
+ format: boolean
+ required:
+ - shared-link
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 1
+ properties:
+ files:
+ description: List of files under the specified folder.
+ uiOrder: 0
+ items:
+ $ref: '#/$defs/file'
+ required: []
+ title: Files
+ format: array
+ required:
+ - files
+ title: Output
+ format: object
diff --git a/pkg/component/data/googledrive/v0/main.go b/pkg/component/data/googledrive/v0/main.go
index d1183423d..b2833e9a5 100644
--- a/pkg/component/data/googledrive/v0/main.go
+++ b/pkg/component/data/googledrive/v0/main.go
@@ -28,12 +28,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -55,7 +55,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/googlesheets/v0/README.mdx b/pkg/component/data/googlesheets/v0/README.mdx
index c956fec28..016af00e0 100644
--- a/pkg/component/data/googlesheets/v0/README.mdx
+++ b/pkg/component/data/googlesheets/v0/README.mdx
@@ -34,7 +34,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlesheets/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlesheets/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlesheets/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlesheets/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/googlesheets/v0/config/definition.json b/pkg/component/data/googlesheets/v0/config/definition.json
deleted file mode 100644
index 297f40141..000000000
--- a/pkg/component/data/googlesheets/v0/config/definition.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "availableTasks": [
- "TASK_CREATE_SPREADSHEET",
- "TASK_DELETE_SPREADSHEET",
- "TASK_ADD_SHEET",
- "TASK_DELETE_SHEET",
- "TASK_CREATE_SPREADSHEET_COLUMN",
- "TASK_DELETE_SPREADSHEET_COLUMN",
- "TASK_LIST_ROWS",
- "TASK_LOOKUP_ROWS",
- "TASK_GET_ROW",
- "TASK_GET_MULTIPLE_ROWS",
- "TASK_INSERT_ROW",
- "TASK_INSERT_MULTIPLE_ROWS",
- "TASK_UPDATE_ROW",
- "TASK_UPDATE_MULTIPLE_ROWS",
- "TASK_DELETE_ROW",
- "TASK_DELETE_MULTIPLE_ROWS"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/data/google-sheets",
- "icon": "assets/google-sheets.svg",
- "id": "google-sheets",
- "public": true,
- "title": "Google Sheets",
- "description": "Connect to and interact with Google Sheets spreadsheets to read and write data.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "c4f8e3d2-a1b9-4c7e-9f5d-6b2e8a7d3c1f",
- "vendor": "Google",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlesheets/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/googlesheets/v0/config/definition.yaml b/pkg/component/data/googlesheets/v0/config/definition.yaml
new file mode 100644
index 000000000..5cf5ecee7
--- /dev/null
+++ b/pkg/component/data/googlesheets/v0/config/definition.yaml
@@ -0,0 +1,33 @@
+availableTasks:
+- TASK_CREATE_SPREADSHEET
+- TASK_DELETE_SPREADSHEET
+- TASK_ADD_SHEET
+- TASK_DELETE_SHEET
+- TASK_CREATE_SPREADSHEET_COLUMN
+- TASK_DELETE_SPREADSHEET_COLUMN
+- TASK_LIST_ROWS
+- TASK_LOOKUP_ROWS
+- TASK_GET_ROW
+- TASK_GET_MULTIPLE_ROWS
+- TASK_INSERT_ROW
+- TASK_INSERT_MULTIPLE_ROWS
+- TASK_UPDATE_ROW
+- TASK_UPDATE_MULTIPLE_ROWS
+- TASK_DELETE_ROW
+- TASK_DELETE_MULTIPLE_ROWS
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/data/google-sheets
+icon: assets/google-sheets.svg
+id: google-sheets
+public: true
+title: Google Sheets
+description: Connect to and interact with Google Sheets spreadsheets to read and write
+ data.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: c4f8e3d2-a1b9-4c7e-9f5d-6b2e8a7d3c1f
+vendor: Google
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/googlesheets/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/googlesheets/v0/config/setup.json b/pkg/component/data/googlesheets/v0/config/setup.json
deleted file mode 100644
index 3da7f199a..000000000
--- a/pkg/component/data/googlesheets/v0/config/setup.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "properties": {
- "refresh-token": {
- "description": "Refresh token for the Google Sheets API. For more information about how to create tokens, please refer to the Google Sheets API documentation and OAuth 2.0 documentation.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 1,
- "title": "Refresh Token",
- "format": "string"
- }
- },
- "required": [],
- "instillOAuthConfig": {
- "authUrl": "https://accounts.google.com/o/oauth2/auth",
- "accessUrl": "https://oauth2.googleapis.com/token",
- "scopes": [
- "https://www.googleapis.com/auth/spreadsheets",
- "https://www.googleapis.com/auth/drive.file",
- "https://www.googleapis.com/auth/userinfo.email",
- "https://www.googleapis.com/auth/userinfo.profile"
- ]
- },
- "title": "Google Drive Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/googlesheets/v0/config/setup.yaml b/pkg/component/data/googlesheets/v0/config/setup.yaml
new file mode 100644
index 000000000..e45a35759
--- /dev/null
+++ b/pkg/component/data/googlesheets/v0/config/setup.yaml
@@ -0,0 +1,23 @@
+properties:
+ refresh-token:
+ description: Refresh token for the Google Sheets API. For more information about
+ how to create tokens, please refer to the Google
+ Sheets API documentation and OAuth 2.0 documentation.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 1
+ title: Refresh Token
+ format: string
+required: []
+instillOAuthConfig:
+ authUrl: https://accounts.google.com/o/oauth2/auth
+ accessUrl: https://oauth2.googleapis.com/token
+ scopes:
+ - https://www.googleapis.com/auth/spreadsheets
+ - https://www.googleapis.com/auth/drive.file
+ - https://www.googleapis.com/auth/userinfo.email
+ - https://www.googleapis.com/auth/userinfo.profile
+title: Google Drive Connection
+format: object
diff --git a/pkg/component/data/googlesheets/v0/config/tasks.json b/pkg/component/data/googlesheets/v0/config/tasks.json
deleted file mode 100644
index b6ab88f78..000000000
--- a/pkg/component/data/googlesheets/v0/config/tasks.json
+++ /dev/null
@@ -1,711 +0,0 @@
-{
- "$defs": {
- "shared-link": {
- "description": "Shared link of the spreadsheet. You can get the shared link by clicking 'Share' button and selecting 'Copy link'.",
- "uiOrder": 0,
- "title": "Spreadsheet ID",
- "format": "string"
- },
- "headers": {
- "description": "Column headers for the sheet.",
- "items": {
- "format": "string"
- },
- "uiOrder": 1,
- "title": "Headers",
- "format": "array"
- },
- "sheet-name": {
- "description": "Name of the sheet.",
- "uiOrder": 2,
- "title": "Sheet Name",
- "format": "string"
- },
- "column-name": {
- "description": "Name of the column.",
- "uiOrder": 3,
- "title": "Column Name",
- "format": "string"
- },
- "row-number": {
- "description": "Row number to update (1-based index).",
- "uiOrder": 4,
- "title": "Row Number",
- "format": "number"
- },
- "row-numbers": {
- "description": "Row numbers to update (1-based indices).",
- "items": {
- "format": "integer"
- },
- "uiOrder": 5,
- "title": "Row Numbers",
- "format": "array"
- },
- "row-value": {
- "description": "Row data in JSON format where keys are column names and values are the corresponding cell values",
- "title": "Row Data",
- "uiOrder": 6,
- "additionalProperties": {
- "description": "Cell value for the corresponding column",
- "format": "string"
- },
- "required": [],
- "format": "json"
- },
- "row": {
- "description": "Row data with row number and data.",
- "uiOrder": 7,
- "title": "Row Data",
- "properties": {
- "row-number": {
- "description": "Row number to update (1-based index)",
- "title": "Row Number",
- "uiOrder": 0,
- "format": "number"
- },
- "row-value": {
- "$ref": "#/$defs/row-value",
- "uiOrder": 1
- }
- },
- "required": [
- "row-number",
- "data"
- ],
- "format": "object"
- },
- "rows": {
- "description": "Multiple rows data with row numbers and data.",
- "items": {
- "$ref": "#/$defs/row"
- },
- "uiOrder": 8,
- "title": "Rows Data",
- "format": "array"
- },
- "success": {
- "description": "Result of the operation.",
- "uiOrder": 9,
- "title": "Success",
- "format": "boolean"
- }
- },
- "TASK_CREATE_SPREADSHEET": {
- "shortDescription": "Create a new Google Sheets spreadsheet with multiple sheets.",
- "input": {
- "description": "Please provide the name and sheets configuration for the new spreadsheet.",
- "properties": {
- "title": {
- "description": "Title of the new spreadsheet.",
- "uiOrder": 0,
- "title": "Title",
- "format": "string"
- },
- "sheets": {
- "title": "Sheets",
- "description": "Configuration for sheets to create.",
- "items": {
- "properties": {
- "name": {
- "$ref": "#/$defs/sheet-name"
- },
- "headers": {
- "$ref": "#/$defs/headers"
- }
- },
- "required": [
- "name"
- ],
- "format": "object"
- },
- "uiOrder": 1,
- "format": "array"
- }
- },
- "required": [
- "name",
- "sheets"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- }
- },
- "required": [
- "shared-link"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE_SPREADSHEET": {
- "shortDescription": "Delete a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the shared link of the spreadsheet to delete.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- }
- },
- "required": [
- "shared-link"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "success": {
- "$ref": "#/$defs/success"
- }
- },
- "required": [
- "success"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_ADD_SHEET": {
- "shortDescription": "Add a new sheet to an existing Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and new sheet configuration.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "headers": {
- "$ref": "#/$defs/headers"
- }
- },
- "required": [
- "shared-link",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "success": {
- "$ref": "#/$defs/success"
- }
- },
- "required": [
- "success"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE_SHEET": {
- "shortDescription": "Remove a sheet from a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and sheet to remove.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- }
- },
- "required": [
- "shared-link",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "success": {
- "$ref": "#/$defs/success"
- }
- },
- "required": [
- "success"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_SPREADSHEET_COLUMN": {
- "shortDescription": "Add a new column to a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and new column information.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "column-name": {
- "$ref": "#/$defs/column-name"
- }
- },
- "required": [
- "shared-link",
- "column-name",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "success": {
- "$ref": "#/$defs/success"
- }
- },
- "required": [
- "success"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE_SPREADSHEET_COLUMN": {
- "shortDescription": "Delete a column from a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and column to delete.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "column-name": {
- "$ref": "#/$defs/column-name"
- }
- },
- "required": [
- "shared-link",
- "column-name",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "success": {
- "$ref": "#/$defs/success"
- }
- },
- "required": [
- "success"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_ROW": {
- "shortDescription": "Get a single row from a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and row number.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "row-number": {
- "description": "The row number to retrieve (1-based index).",
- "minimum": 1,
- "title": "Row Number",
- "uiOrder": 0,
- "format": "number"
- }
- },
- "required": [
- "shared-link",
- "row-number",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "row": {
- "$ref": "#/$defs/row"
- }
- },
- "required": [
- "row"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_MULTIPLE_ROWS": {
- "shortDescription": "Get multiple rows from a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and row numbers.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "row-numbers": {
- "description": "The row numbers to retrieve (1-based indices).",
- "items": {
- "minimum": 1,
- "format": "integer"
- },
- "title": "Row Numbers",
- "uiOrder": 0,
- "format": "array"
- }
- },
- "required": [
- "shared-link",
- "row-numbers",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "rows": {
- "$ref": "#/$defs/rows"
- }
- },
- "required": [
- "rows"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_LIST_ROWS": {
- "shortDescription": "List all rows in a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details to list all rows.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "start-row": {
- "description": "The starting row number to retrieve (1-based index).",
- "minimum": 1,
- "default": 2,
- "title": "Start Row",
- "uiOrder": 0,
- "format": "number"
- },
- "end-row": {
- "description": "The ending row number to retrieve (1-based index).",
- "minimum": 1,
- "title": "End Row",
- "uiOrder": 1,
- "format": "number"
- }
- },
- "required": [
- "shared-link",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "rows": {
- "$ref": "#/$defs/rows"
- }
- },
- "required": [
- "rows"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_LOOKUP_ROWS": {
- "shortDescription": "Find multiple rows based on column value in a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and lookup criteria.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "column-name": {
- "$ref": "#/$defs/column-name"
- },
- "value": {
- "description": "Value to search for in the specified column.",
- "title": "Search Value",
- "uiOrder": 10,
- "format": "string"
- }
- },
- "required": [
- "shared-link",
- "column-name",
- "value",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "rows": {
- "$ref": "#/$defs/rows"
- }
- },
- "required": [
- "rows"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_INSERT_ROW": {
- "shortDescription": "Insert a single row into a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and row data to insert.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "row-value": {
- "$ref": "#/$defs/row-value"
- }
- },
- "required": [
- "shared-link",
- "row",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "row": {
- "$ref": "#/$defs/row"
- }
- },
- "required": [
- "row",
- "row-number"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_INSERT_MULTIPLE_ROWS": {
- "shortDescription": "Insert multiple rows into a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and rows data to insert.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "row-values": {
- "description": "Array of row data in JSON format where keys are column names and values are the corresponding cell values",
- "items": {
- "$ref": "#/$defs/row-value"
- },
- "uiOrder": 2,
- "title": "Row Values",
- "format": "array"
- }
- },
- "required": [
- "shared-link",
- "rows",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "rows": {
- "$ref": "#/$defs/rows"
- }
- },
- "required": [
- "rows"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPDATE_ROW": {
- "shortDescription": "Update a row in a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and row data to update.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "row": {
- "$ref": "#/$defs/row"
- }
- },
- "required": [
- "shared-link",
- "row-number",
- "row",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "row": {
- "$ref": "#/$defs/row"
- }
- },
- "required": [
- "row"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPDATE_MULTIPLE_ROWS": {
- "shortDescription": "Update multiple rows in a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and rows data to update.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "rows": {
- "$ref": "#/$defs/rows"
- }
- },
- "required": [
- "shared-link",
- "row-numbers",
- "rows",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "rows": {
- "$ref": "#/$defs/rows"
- }
- },
- "required": [
- "rows"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE_ROW": {
- "shortDescription": "Delete a row from a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and Row number to delete.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "row-number": {
- "$ref": "#/$defs/row-number"
- }
- },
- "required": [
- "shared-link",
- "row-number",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "success": {
- "$ref": "#/$defs/success"
- }
- },
- "required": [
- "success"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE_MULTIPLE_ROWS": {
- "shortDescription": "Delete multiple rows from a Google Sheets spreadsheet.",
- "input": {
- "description": "Please provide the spreadsheet details and Row numbers to delete.",
- "properties": {
- "shared-link": {
- "$ref": "#/$defs/shared-link"
- },
- "sheet-name": {
- "$ref": "#/$defs/sheet-name"
- },
- "row-numbers": {
- "$ref": "#/$defs/row-numbers"
- }
- },
- "required": [
- "shared-link",
- "row-numbers",
- "sheet-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "properties": {
- "success": {
- "$ref": "#/$defs/success"
- }
- },
- "required": [
- "success"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/googlesheets/v0/config/tasks.yaml b/pkg/component/data/googlesheets/v0/config/tasks.yaml
new file mode 100644
index 000000000..33e3d6a86
--- /dev/null
+++ b/pkg/component/data/googlesheets/v0/config/tasks.yaml
@@ -0,0 +1,512 @@
+$defs:
+ shared-link:
+ description: Shared link of the spreadsheet. You can get the shared link by clicking
+ 'Share' button and selecting 'Copy link'.
+ uiOrder: 0
+ title: Spreadsheet ID
+ format: string
+ headers:
+ description: Column headers for the sheet.
+ items:
+ format: string
+ uiOrder: 1
+ title: Headers
+ format: array
+ sheet-name:
+ description: Name of the sheet.
+ uiOrder: 2
+ title: Sheet Name
+ format: string
+ column-name:
+ description: Name of the column.
+ uiOrder: 3
+ title: Column Name
+ format: string
+ row-number:
+ description: Row number to update (1-based index).
+ uiOrder: 4
+ title: Row Number
+ format: number
+ row-numbers:
+ description: Row numbers to update (1-based indices).
+ items:
+ format: integer
+ uiOrder: 5
+ title: Row Numbers
+ format: array
+ row-value:
+ description: Row data in JSON format where keys are column names and values are
+ the corresponding cell values
+ title: Row Data
+ uiOrder: 6
+ additionalProperties:
+ description: Cell value for the corresponding column
+ format: string
+ required: []
+ format: json
+ row:
+ description: Row data with row number and data.
+ uiOrder: 7
+ title: Row Data
+ properties:
+ row-number:
+ description: Row number to update (1-based index)
+ title: Row Number
+ uiOrder: 0
+ format: number
+ row-value:
+ $ref: '#/$defs/row-value'
+ uiOrder: 1
+ required:
+ - row-number
+ - data
+ format: object
+ rows:
+ description: Multiple rows data with row numbers and data.
+ items:
+ $ref: '#/$defs/row'
+ uiOrder: 8
+ title: Rows Data
+ format: array
+ success:
+ description: Result of the operation.
+ uiOrder: 9
+ title: Success
+ format: boolean
+TASK_CREATE_SPREADSHEET:
+ shortDescription: Create a new Google Sheets spreadsheet with multiple sheets.
+ input:
+ description: Please provide the name and sheets configuration for the new spreadsheet.
+ properties:
+ title:
+ description: Title of the new spreadsheet.
+ uiOrder: 0
+ title: Title
+ format: string
+ sheets:
+ title: Sheets
+ description: Configuration for sheets to create.
+ items:
+ properties:
+ name:
+ $ref: '#/$defs/sheet-name'
+ headers:
+ $ref: '#/$defs/headers'
+ required:
+ - name
+ format: object
+ uiOrder: 1
+ format: array
+ required:
+ - name
+ - sheets
+ title: Input
+ format: object
+ output:
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ required:
+ - shared-link
+ title: Output
+ format: object
+TASK_DELETE_SPREADSHEET:
+ shortDescription: Delete a Google Sheets spreadsheet.
+ input:
+ description: Please provide the shared link of the spreadsheet to delete.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ required:
+ - shared-link
+ title: Input
+ format: object
+ output:
+ properties:
+ success:
+ $ref: '#/$defs/success'
+ required:
+ - success
+ title: Output
+ format: object
+TASK_ADD_SHEET:
+ shortDescription: Add a new sheet to an existing Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and new sheet configuration.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ headers:
+ $ref: '#/$defs/headers'
+ required:
+ - shared-link
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ success:
+ $ref: '#/$defs/success'
+ required:
+ - success
+ title: Output
+ format: object
+TASK_DELETE_SHEET:
+ shortDescription: Remove a sheet from a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and sheet to remove.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ required:
+ - shared-link
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ success:
+ $ref: '#/$defs/success'
+ required:
+ - success
+ title: Output
+ format: object
+TASK_CREATE_SPREADSHEET_COLUMN:
+ shortDescription: Add a new column to a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and new column information.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ column-name:
+ $ref: '#/$defs/column-name'
+ required:
+ - shared-link
+ - column-name
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ success:
+ $ref: '#/$defs/success'
+ required:
+ - success
+ title: Output
+ format: object
+TASK_DELETE_SPREADSHEET_COLUMN:
+ shortDescription: Delete a column from a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and column to delete.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ column-name:
+ $ref: '#/$defs/column-name'
+ required:
+ - shared-link
+ - column-name
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ success:
+ $ref: '#/$defs/success'
+ required:
+ - success
+ title: Output
+ format: object
+TASK_GET_ROW:
+ shortDescription: Get a single row from a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and row number.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ row-number:
+ description: The row number to retrieve (1-based index).
+ minimum: 1
+ title: Row Number
+ uiOrder: 0
+ format: number
+ required:
+ - shared-link
+ - row-number
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ row:
+ $ref: '#/$defs/row'
+ required:
+ - row
+ title: Output
+ format: object
+TASK_GET_MULTIPLE_ROWS:
+ shortDescription: Get multiple rows from a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and row numbers.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ row-numbers:
+ description: The row numbers to retrieve (1-based indices).
+ items:
+ minimum: 1
+ format: integer
+ title: Row Numbers
+ uiOrder: 0
+ format: array
+ required:
+ - shared-link
+ - row-numbers
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ rows:
+ $ref: '#/$defs/rows'
+ required:
+ - rows
+ title: Output
+ format: object
+TASK_LIST_ROWS:
+ shortDescription: List all rows in a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details to list all rows.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ start-row:
+ description: The starting row number to retrieve (1-based index).
+ minimum: 1
+ default: 2
+ title: Start Row
+ uiOrder: 0
+ format: number
+ end-row:
+ description: The ending row number to retrieve (1-based index).
+ minimum: 1
+ title: End Row
+ uiOrder: 1
+ format: number
+ required:
+ - shared-link
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ rows:
+ $ref: '#/$defs/rows'
+ required:
+ - rows
+ title: Output
+ format: object
+TASK_LOOKUP_ROWS:
+ shortDescription: Find multiple rows based on column value in a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and lookup criteria.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ column-name:
+ $ref: '#/$defs/column-name'
+ value:
+ description: Value to search for in the specified column.
+ title: Search Value
+ uiOrder: 10
+ format: string
+ required:
+ - shared-link
+ - column-name
+ - value
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ rows:
+ $ref: '#/$defs/rows'
+ required:
+ - rows
+ title: Output
+ format: object
+TASK_INSERT_ROW:
+ shortDescription: Insert a single row into a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and row data to insert.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ row-value:
+ $ref: '#/$defs/row-value'
+ required:
+ - shared-link
+ - row
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ row:
+ $ref: '#/$defs/row'
+ required:
+ - row
+ - row-number
+ title: Output
+ format: object
+TASK_INSERT_MULTIPLE_ROWS:
+ shortDescription: Insert multiple rows into a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and rows data to insert.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ row-values:
+ description: Array of row data in JSON format where keys are column names
+ and values are the corresponding cell values
+ items:
+ $ref: '#/$defs/row-value'
+ uiOrder: 2
+ title: Row Values
+ format: array
+ required:
+ - shared-link
+ - rows
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ rows:
+ $ref: '#/$defs/rows'
+ required:
+ - rows
+ title: Output
+ format: object
+TASK_UPDATE_ROW:
+ shortDescription: Update a row in a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and row data to update.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ row:
+ $ref: '#/$defs/row'
+ required:
+ - shared-link
+ - row-number
+ - row
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ row:
+ $ref: '#/$defs/row'
+ required:
+ - row
+ title: Output
+ format: object
+TASK_UPDATE_MULTIPLE_ROWS:
+ shortDescription: Update multiple rows in a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and rows data to update.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ rows:
+ $ref: '#/$defs/rows'
+ required:
+ - shared-link
+ - row-numbers
+ - rows
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ rows:
+ $ref: '#/$defs/rows'
+ required:
+ - rows
+ title: Output
+ format: object
+TASK_DELETE_ROW:
+ shortDescription: Delete a row from a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and Row number to delete.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ row-number:
+ $ref: '#/$defs/row-number'
+ required:
+ - shared-link
+ - row-number
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ success:
+ $ref: '#/$defs/success'
+ required:
+ - success
+ title: Output
+ format: object
+TASK_DELETE_MULTIPLE_ROWS:
+ shortDescription: Delete multiple rows from a Google Sheets spreadsheet.
+ input:
+ description: Please provide the spreadsheet details and Row numbers to delete.
+ properties:
+ shared-link:
+ $ref: '#/$defs/shared-link'
+ sheet-name:
+ $ref: '#/$defs/sheet-name'
+ row-numbers:
+ $ref: '#/$defs/row-numbers'
+ required:
+ - shared-link
+ - row-numbers
+ - sheet-name
+ title: Input
+ format: object
+ output:
+ properties:
+ success:
+ $ref: '#/$defs/success'
+ required:
+ - success
+ title: Output
+ format: object
diff --git a/pkg/component/data/googlesheets/v0/main.go b/pkg/component/data/googlesheets/v0/main.go
index db9450ce0..dc676e428 100644
--- a/pkg/component/data/googlesheets/v0/main.go
+++ b/pkg/component/data/googlesheets/v0/main.go
@@ -23,12 +23,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
once sync.Once
comp *component
@@ -68,7 +68,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/instillartifact/v0/README.mdx b/pkg/component/data/instillartifact/v0/README.mdx
index e036bc3ed..637c1675e 100644
--- a/pkg/component/data/instillartifact/v0/README.mdx
+++ b/pkg/component/data/instillartifact/v0/README.mdx
@@ -30,7 +30,7 @@ p.s. In Instill Cloud case, you do not need to set up the OpenAI API key.
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/instillartifact/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/instillartifact/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/instillartifact/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/instillartifact/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/instillartifact/v0/config/definition.json b/pkg/component/data/instillartifact/v0/config/definition.json
deleted file mode 100644
index 44cc77bf8..000000000
--- a/pkg/component/data/instillartifact/v0/config/definition.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "availableTasks": [
- "TASK_UPLOAD_FILE",
- "TASK_UPLOAD_FILES",
- "TASK_GET_FILES_METADATA",
- "TASK_GET_CHUNKS_METADATA",
- "TASK_GET_FILE_IN_MARKDOWN",
- "TASK_MATCH_FILE_STATUS",
- "TASK_RETRIEVE",
- "TASK_ASK"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/data/instill-artifact",
- "icon": "assets/instill-artifact.svg",
- "id": "instill-artifact",
- "public": true,
- "title": "Instill Artifact",
- "description": "Manipulate and smart search files and data in the artifact store.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "6ec46048-f82f-4452-ba19-79698af9186e",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/instillartifact/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/instillartifact/v0/config/definition.yaml b/pkg/component/data/instillartifact/v0/config/definition.yaml
new file mode 100644
index 000000000..ced5d36da
--- /dev/null
+++ b/pkg/component/data/instillartifact/v0/config/definition.yaml
@@ -0,0 +1,21 @@
+availableTasks:
+- TASK_UPLOAD_FILE
+- TASK_UPLOAD_FILES
+- TASK_GET_FILES_METADATA
+- TASK_GET_CHUNKS_METADATA
+- TASK_GET_FILE_IN_MARKDOWN
+- TASK_MATCH_FILE_STATUS
+- TASK_RETRIEVE
+- TASK_ASK
+documentationUrl: https://www.instill.tech/docs/component/data/instill-artifact
+icon: assets/instill-artifact.svg
+id: instill-artifact
+public: true
+title: Instill Artifact
+description: Manipulate and smart search files and data in the artifact store.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: 6ec46048-f82f-4452-ba19-79698af9186e
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/instillartifact/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/instillartifact/v0/config/tasks.json b/pkg/component/data/instillartifact/v0/config/tasks.json
deleted file mode 100644
index a041d9132..000000000
--- a/pkg/component/data/instillartifact/v0/config/tasks.json
+++ /dev/null
@@ -1,1047 +0,0 @@
-{
- "$defs": {
- "file": {
- "description": "Base64 encoded PDF/DOCX/DOC/PPTX/PPT/HTML file to be uploaded into catalog.",
- "uiOrder": 2,
- "acceptFormats": [
- "*/*"
- ],
- "title": "File",
- "format": "string"
- },
- "files": {
- "description": "Base64 encoded PDF/DOCX/DOC/PPTX/PPT/HTML files to be uploaded into catalog.",
- "uiOrder": 2,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "title": "Files",
- "format": "array"
- },
- "file-item": {
- "properties": {
- "file-uid": {
- "description": "Unique identifier of the file.",
- "uiOrder": 0,
- "title": "File UID",
- "format": "string"
- },
- "file-name": {
- "description": "Name of the file.",
- "uiOrder": 1,
- "title": "File Name",
- "format": "string"
- },
- "file-type": {
- "description": "Type of the file.",
- "uiOrder": 2,
- "title": "Type",
- "format": "string"
- },
- "create-time": {
- "description": "Creation time of the file in ISO 8601 format.",
- "uiOrder": 3,
- "title": "Create Time",
- "format": "string"
- },
- "update-time": {
- "description": "Update time of the file in ISO 8601 format.",
- "uiOrder": 4,
- "title": "Update Time",
- "format": "string"
- },
- "size": {
- "description": "Size of the file in bytes.",
- "uiOrder": 5,
- "title": "Size",
- "format": "number"
- },
- "catalog-id": {
- "description": "ID of the catalog that you upload files.",
- "uiOrder": 8,
- "title": "Catalog ID",
- "format": "string"
- }
- },
- "required": [
- "catalog-id"
- ],
- "title": "File",
- "format": "object"
- },
- "chunk-item": {
- "properties": {
- "chunk-uid": {
- "description": "The unique identifier of the chunk.",
- "uiOrder": 0,
- "title": "Chunk UID",
- "format": "string"
- },
- "similarity-score": {
- "description": "The similarity score of the chunk.",
- "uiOrder": 1,
- "title": "Similarity",
- "format": "number"
- },
- "text-content": {
- "description": "The text content of the chunk.",
- "uiOrder": 2,
- "title": "Text Content",
- "format": "string"
- },
- "source-file-name": {
- "description": "The name of the source file.",
- "uiOrder": 3,
- "title": "Source File Name",
- "format": "string"
- }
- },
- "required": [
- "chunk-uid",
- "similarity-score",
- "text-content",
- "source-file-name"
- ],
- "title": "Chunk",
- "format": "object"
- },
- "namespace": {
- "description": "Fill in your namespace, you can get namespace through the tab of switching namespace.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Namespace",
- "format": "string"
- },
- "third-party-files": {
- "description": "File contents and metadata from third-part data storage.",
- "uiOrder": 2,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "properties": {
- "id": {
- "description": "Unique ID of the file from third-party data storage.",
- "uiOrder": 0,
- "title": "ID",
- "format": "string"
- },
- "name": {
- "description": "Name of the file from third-party data storage.",
- "uiOrder": 1,
- "title": "Name",
- "format": "string"
- },
- "content": {
- "description": "Base64 encoded content of the binary file without the `data:[MIME_TYPE];base64,` prefix.",
- "uiOrder": 2,
- "title": "Content",
- "format": "string"
- },
- "created-time": {
- "description": "Time when the file was created. Format: `YYYY-MM-DDTHH:MM:SSZ`.",
- "uiOrder": 3,
- "title": "Created time",
- "format": "string"
- },
- "modified-time": {
- "description": "Time when the file was last modified. Format: `YYYY-MM-DDTHH:MM:SSZ`. It will be used to check if the file has been updated.",
- "uiOrder": 4,
- "title": "Modified time",
- "format": "string"
- },
- "size": {
- "description": "Size of the file in bytes.",
- "uiOrder": 5,
- "title": "Size",
- "format": "integer"
- },
- "mime-type": {
- "description": "MIME type of the file.",
- "uiOrder": 6,
- "title": "MIME type",
- "format": "string"
- },
- "md5-checksum": {
- "description": "MD5 checksum of the file. This reflects every change made to the file on the server, even those not visible to the user.",
- "uiOrder": 7,
- "title": "MD5 checksum",
- "format": "string"
- },
- "version": {
- "description": "Version of the file.",
- "uiOrder": 8,
- "title": "Version",
- "format": "integer"
- },
- "web-view-link": {
- "description": "Link for opening the file in a relevant third-party data storage editor or viewer in a browser. It will be used to check the source of the file.",
- "uiOrder": 9,
- "title": "Web View Link",
- "format": "string"
- },
- "web-content-link": {
- "description": "Link for downloading the content of the file in a browser.",
- "uiOrder": 10,
- "title": "Web Content Link",
- "format": "string"
- }
- },
- "required": [
- "id",
- "name",
- "created-time",
- "modified-time",
- "size",
- "mime-type",
- "version",
- "web-view-link"
- ],
- "title": "Third Party File",
- "format": "object"
- },
- "title": "Third Party Files",
- "format": "array"
- }
- },
- "TASK_UPLOAD_FILE": {
- "shortDescription": "Upload and process the files into chunks into Catalog.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "options": {
- "description": "Choose to upload the files to existing catalog or create a new catalog.",
- "title": "Options",
- "additionalProperties": true,
- "uiOrder": 0,
- "required": [
- "option"
- ],
- "oneOf": [
- {
- "properties": {
- "option": {
- "const": "existing catalog",
- "title": "Option",
- "description": "Existing catalog.",
- "uiOrder": 0,
- "format": "string"
- },
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID that you input in the Catalog.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- },
- "file": {
- "$ref": "#/$defs/file"
- },
- "file-name": {
- "description": "Name of the file, including the extension (e.g. `example.pdf`). The length of this field is limited to 100 characters.",
- "uiOrder": 2,
- "acceptFormats": [
- "string"
- ],
- "title": "File Name",
- "format": "string"
- }
- },
- "required": [
- "option",
- "namespace",
- "catalog-id",
- "file",
- "file-name"
- ],
- "title": "Existing Catalog",
- "format": "object"
- },
- {
- "properties": {
- "option": {
- "const": "create new catalog",
- "title": "Option",
- "description": "Create new catalog.",
- "uiOrder": 0,
- "format": "string"
- },
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID for new catalog you want to create.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- },
- "file": {
- "$ref": "#/$defs/file"
- },
- "file-name": {
- "description": "Name of the file, including the extension (e.g. `example.pdf`). The length of this field is limited to 100 characters.",
- "uiOrder": 3,
- "acceptFormats": [
- "string"
- ],
- "title": "File Name",
- "format": "string"
- },
- "description": {
- "description": "Description of the catalog.",
- "uiOrder": 4,
- "acceptFormats": [
- "string"
- ],
- "title": "Description",
- "format": "string"
- },
- "tags": {
- "description": "Tags for the catalog.",
- "uiOrder": 5,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "title": "Tags",
- "format": "array"
- }
- },
- "required": [
- "option",
- "namespace",
- "catalog-id",
- "file",
- "file-name"
- ],
- "title": "Create New Catalog",
- "format": "object"
- }
- ],
- "format": "object"
- }
- },
- "required": [
- "options"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Result of uploading file into catalog.",
- "properties": {
- "file": {
- "description": "Result of uploading file into catalog.",
- "uiOrder": 0,
- "properties": {
- "$ref": "#/$defs/file-item/properties"
- },
- "required": [
- "file-uid",
- "file-name",
- "file-type",
- "create-time",
- "update-time",
- "size",
- "catalog-id"
- ],
- "title": "File",
- "format": "object"
- },
- "status": {
- "description": "The status of trigger file processing, if succeeded, return true.",
- "uiOrder": 1,
- "title": "Status",
- "format": "boolean"
- }
- },
- "required": [
- "file",
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPLOAD_FILES": {
- "shortDescription": "Upload and process the files into chunks into Catalog.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "options": {
- "description": "Choose to upload the files to existing catalog or create a new catalog.",
- "title": "Options",
- "additionalProperties": true,
- "uiOrder": 0,
- "required": [
- "option"
- ],
- "oneOf": [
- {
- "properties": {
- "option": {
- "const": "existing catalog",
- "title": "Option",
- "description": "Existing catalog.",
- "uiOrder": 0,
- "format": "string"
- },
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID that you input in the Catalog.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- },
- "files": {
- "$ref": "#/$defs/files"
- },
- "file-names": {
- "description": "Name of the file, including the extension (e.g. `example.pdf`). The length of this field is limited to 100 characters.",
- "uiOrder": 2,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "title": "File Names",
- "format": "array"
- }
- },
- "required": [
- "option",
- "namespace",
- "catalog-id",
- "files",
- "file-names"
- ],
- "title": "Existing Catalog",
- "format": "object"
- },
- {
- "properties": {
- "option": {
- "const": "create new catalog",
- "title": "Option",
- "description": "Create new catalog.",
- "uiOrder": 0,
- "format": "string"
- },
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID for new catalog you want to create.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- },
- "files": {
- "$ref": "#/$defs/files"
- },
- "file-names": {
- "description": "Name of the file, including the extension (e.g. `example.pdf`). The length of this field is limited to 100 characters.",
- "uiOrder": 3,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "title": "File Names",
- "format": "array"
- },
- "description": {
- "description": "Description of the catalog.",
- "uiOrder": 4,
- "acceptFormats": [
- "string"
- ],
- "title": "Description",
- "format": "string"
- },
- "tags": {
- "description": "Tags for the catalog.",
- "uiOrder": 5,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "title": "Tags",
- "format": "array"
- }
- },
- "required": [
- "option",
- "namespace",
- "catalog-id",
- "files",
- "file-names"
- ],
- "title": "Create New Catalog",
- "format": "object"
- }
- ],
- "format": "object"
- }
- },
- "required": [
- "options"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Result of uploading files into catalog.",
- "properties": {
- "files": {
- "description": "Files metadata in catalog.",
- "uiOrder": 0,
- "items": {
- "$ref": "#/$defs/file-item"
- },
- "title": "Files",
- "format": "array"
- },
- "status": {
- "description": "The status of trigger file processing, if ALL succeeded, return true.",
- "uiOrder": 1,
- "title": "Status",
- "format": "boolean"
- }
- },
- "required": [
- "files",
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_FILES_METADATA": {
- "shortDescription": "get the metadata of the files in the catalog.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID that you input to search files in the Catalog.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- }
- },
- "required": [
- "namespace",
- "catalog-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Files metadata into catalog.",
- "uiOrder": 1,
- "properties": {
- "files": {
- "description": "Files metadata in catalog.",
- "uiOrder": 0,
- "items": {
- "$ref": "#/$defs/file-item"
- },
- "title": "Files",
- "format": "array"
- }
- },
- "required": [
- "files"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_CHUNKS_METADATA": {
- "shortDescription": "get the metadata of the chunks from a file in the catalog.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID that you input to search files in the Catalog.",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- },
- "file-uid": {
- "description": "The unique identifier of the file.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "File UID",
- "format": "string"
- }
- },
- "required": [
- "namespace",
- "catalog-id",
- "file-uid"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Chunks metadata of the file in catalog.",
- "uiOrder": 1,
- "properties": {
- "chunks": {
- "description": "Chunks metadata of the file in catalog.",
- "uiOrder": 0,
- "items": {
- "properties": {
- "chunk-uid": {
- "description": "The unique identifier of the chunk.",
- "uiOrder": 0,
- "title": "Chunk UID",
- "format": "string"
- },
- "retrievable": {
- "description": "The retrievable status of the chunk.",
- "uiOrder": 1,
- "title": "Retrievable",
- "format": "boolean"
- },
- "start-position": {
- "description": "The start position of the chunk in the file.",
- "uiOrder": 2,
- "title": "Start Position",
- "format": "integer"
- },
- "end-position": {
- "description": "The end position of the chunk in the file.",
- "uiOrder": 3,
- "title": "End Position",
- "format": "integer"
- },
- "token-count": {
- "description": "The token count of the chunk.",
- "uiOrder": 4,
- "title": "Token Count",
- "format": "integer"
- },
- "create-time": {
- "description": "The creation time of the chunk in ISO 8601 format.",
- "uiOrder": 5,
- "title": "Create Time",
- "format": "string"
- },
- "original-file-uid": {
- "description": "The unique identifier of the file.",
- "uiOrder": 6,
- "title": "File UID",
- "format": "string"
- }
- },
- "required": [
- "chunk-uid",
- "retrievable",
- "start-position",
- "end-position",
- "token-count",
- "create-time",
- "original-file-uid"
- ],
- "title": "Chunk",
- "format": "object"
- },
- "title": "Chunks",
- "format": "array"
- }
- },
- "required": [
- "chunks"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_GET_FILE_IN_MARKDOWN": {
- "shortDescription": "get the file content in markdown format.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID that you input to search files in the Catalog.",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- },
- "file-uid": {
- "description": "The unique identifier of the file.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "File UID",
- "format": "string"
- }
- },
- "required": [
- "namespace",
- "catalog-id",
- "file-uid"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "File content in markdown format.",
- "uiOrder": 1,
- "properties": {
- "original-file-uid": {
- "description": "The unique identifier of the file.",
- "uiOrder": 0,
- "title": "File UID",
- "format": "string"
- },
- "content": {
- "description": "The content of the file in markdown format.",
- "uiOrder": 1,
- "title": "Content",
- "format": "string"
- },
- "create-time": {
- "description": "The creation time of the source file in ISO 8601 format.",
- "uiOrder": 2,
- "title": "Create Time",
- "format": "string"
- },
- "update-time": {
- "description": "The update time of the source file in ISO 8601 format.",
- "uiOrder": 3,
- "title": "Update Time",
- "format": "string"
- }
- },
- "required": [
- "original-file-uid",
- "content",
- "create-time",
- "update-time"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_RETRIEVE": {
- "shortDescription": "search the chunks in the catalog.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID that you input to search files in the Catalog.",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- },
- "text-prompt": {
- "description": "The prompt string to search the chunks.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Text Prompt",
- "format": "string"
- },
- "top-k": {
- "description": "The number of top chunks to return. The range is from 1~20, and default is 5.",
- "default": 5,
- "uiOrder": 2,
- "acceptFormats": [
- "integer"
- ],
- "title": "Top K",
- "format": "integer"
- }
- },
- "required": [
- "namespace",
- "catalog-id",
- "text-prompt"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 1,
- "properties": {
- "chunks": {
- "description": "Chunks data from smart search.",
- "uiOrder": 0,
- "items": {
- "$ref": "#/$defs/chunk-item"
- },
- "title": "Chunks",
- "format": "array"
- }
- },
- "required": [
- "chunks"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_ASK": {
- "shortDescription": "Reply the questions based on the files in the catalog.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID that you input to search files in the Catalog.",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- },
- "question": {
- "description": "The question to reply.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Question",
- "format": "string"
- },
- "top-k": {
- "description": "The number of top answers to return. The range is from 1~20, and default is 5.",
- "default": 5,
- "uiOrder": 2,
- "acceptFormats": [
- "integer"
- ],
- "title": "Top K",
- "format": "integer"
- }
- },
- "required": [
- "namespace",
- "catalog-id",
- "question"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 1,
- "properties": {
- "answer": {
- "description": "Answers data from smart search.",
- "uiOrder": 0,
- "title": "Answer",
- "format": "string"
- },
- "chunks": {
- "description": "Chunks data to answer question.",
- "uiOrder": 1,
- "items": {
- "$ref": "#/$defs/chunk-item"
- },
- "title": "Chunks",
- "format": "array"
- }
- },
- "required": [
- "answer"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_MATCH_FILE_STATUS": {
- "shortDescription": "Check if the specified file's processing status is done.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID that you input to check files' processing status in the Catalog.",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- },
- "file-uid": {
- "description": "The unique identifier of the file.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "File UID",
- "format": "string"
- }
- },
- "required": [
- "namespace",
- "catalog-id",
- "file-uid"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 1,
- "properties": {
- "succeeded": {
- "description": "The status of the file processing, if succeeded, return true.",
- "uiOrder": 0,
- "title": "Status",
- "format": "boolean"
- }
- },
- "required": [
- "succeeded"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SYNC_FILES": {
- "shortDescription": "This task synchronizes files from third-party storage to Instill Catalog. New files are uploaded, and updated files are overwritten based on third-party metadata. Files added through other channels, like the Artifact API or additional storage services, will not be removed. Currently, only Google Drive is supported as a third-party storage service.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "namespace": {
- "$ref": "#/$defs/namespace"
- },
- "catalog-id": {
- "description": "Catalog ID that you input to synchronize files from third-party data storage to catalog.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Catalog ID",
- "format": "string"
- },
- "third-party-files": {
- "$ref": "#/$defs/third-party-files"
- }
- },
- "required": [
- "namespace",
- "catalog-id",
- "third-party-files"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 1,
- "properties": {
- "uploaded-files": {
- "description": "Files metadata in catalog. The metadata here is from Instill Artifact rather than third-party storage.",
- "uiOrder": 0,
- "items": {
- "$ref": "#/$defs/file-item"
- },
- "title": "Uploaded Files",
- "format": "array"
- },
- "updated_files": {
- "description": "Files that were updated. The metadata here is from Instill Artifact rather than third-party storage.",
- "uiOrder": 1,
- "items": {
- "$ref": "#/$defs/file-item"
- },
- "title": "Updated Files",
- "format": "array"
- },
- "failure-files": {
- "description": "Files that failed to upload or overwrite. The metadata here is from third-party storage.",
- "uiOrder": 2,
- "items": {
- "$ref": "#/$defs/third-party-files/items"
- },
- "title": "Failure Files",
- "format": "array"
- },
- "error-messages": {
- "description": "Error messages for files that failed to upload or overwrite.",
- "uiOrder": 3,
- "items": {
- "format": "string"
- },
- "title": "Error Messages",
- "format": "array"
- },
- "status": {
- "description": "The status of the triggering processing files, if succeeded, return true.",
- "uiOrder": 4,
- "title": "Status",
- "format": "boolean"
- }
- },
- "required": [],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/instillartifact/v0/config/tasks.yaml b/pkg/component/data/instillartifact/v0/config/tasks.yaml
new file mode 100644
index 000000000..829bacc2f
--- /dev/null
+++ b/pkg/component/data/instillartifact/v0/config/tasks.yaml
@@ -0,0 +1,832 @@
+$defs:
+ file:
+ description: Base64 encoded PDF/DOCX/DOC/PPTX/PPT/HTML file to be uploaded into
+ catalog.
+ uiOrder: 2
+ acceptFormats:
+ - '*/*'
+ title: File
+ format: string
+ files:
+ description: Base64 encoded PDF/DOCX/DOC/PPTX/PPT/HTML files to be uploaded into
+ catalog.
+ uiOrder: 2
+ acceptFormats:
+ - array
+ items:
+ format: string
+ title: Files
+ format: array
+ file-item:
+ properties:
+ file-uid:
+ description: Unique identifier of the file.
+ uiOrder: 0
+ title: File UID
+ format: string
+ file-name:
+ description: Name of the file.
+ uiOrder: 1
+ title: File Name
+ format: string
+ file-type:
+ description: Type of the file.
+ uiOrder: 2
+ title: Type
+ format: string
+ create-time:
+ description: Creation time of the file in ISO 8601 format.
+ uiOrder: 3
+ title: Create Time
+ format: string
+ update-time:
+ description: Update time of the file in ISO 8601 format.
+ uiOrder: 4
+ title: Update Time
+ format: string
+ size:
+ description: Size of the file in bytes.
+ uiOrder: 5
+ title: Size
+ format: number
+ catalog-id:
+ description: ID of the catalog that you upload files.
+ uiOrder: 8
+ title: Catalog ID
+ format: string
+ required:
+ - catalog-id
+ title: File
+ format: object
+ chunk-item:
+ properties:
+ chunk-uid:
+ description: The unique identifier of the chunk.
+ uiOrder: 0
+ title: Chunk UID
+ format: string
+ similarity-score:
+ description: The similarity score of the chunk.
+ uiOrder: 1
+ title: Similarity
+ format: number
+ text-content:
+ description: The text content of the chunk.
+ uiOrder: 2
+ title: Text Content
+ format: string
+ source-file-name:
+ description: The name of the source file.
+ uiOrder: 3
+ title: Source File Name
+ format: string
+ required:
+ - chunk-uid
+ - similarity-score
+ - text-content
+ - source-file-name
+ title: Chunk
+ format: object
+ namespace:
+ description: Fill in your namespace, you can get namespace through the tab of
+ switching namespace.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Namespace
+ format: string
+ third-party-files:
+ description: File contents and metadata from third-part data storage.
+ uiOrder: 2
+ acceptFormats:
+ - array
+ items:
+ properties:
+ id:
+ description: Unique ID of the file from third-party data storage.
+ uiOrder: 0
+ title: ID
+ format: string
+ name:
+ description: Name of the file from third-party data storage.
+ uiOrder: 1
+ title: Name
+ format: string
+ content:
+ description: Base64 encoded content of the binary file without the `data:[MIME_TYPE];base64,`
+ prefix.
+ uiOrder: 2
+ title: Content
+ format: string
+ created-time:
+ description: 'Time when the file was created. Format: `YYYY-MM-DDTHH:MM:SSZ`.'
+ uiOrder: 3
+ title: Created time
+ format: string
+ modified-time:
+ description: 'Time when the file was last modified. Format: `YYYY-MM-DDTHH:MM:SSZ`.
+ It will be used to check if the file has been updated.'
+ uiOrder: 4
+ title: Modified time
+ format: string
+ size:
+ description: Size of the file in bytes.
+ uiOrder: 5
+ title: Size
+ format: integer
+ mime-type:
+ description: MIME type of the file.
+ uiOrder: 6
+ title: MIME type
+ format: string
+ md5-checksum:
+ description: MD5 checksum of the file. This reflects every change made to
+ the file on the server, even those not visible to the user.
+ uiOrder: 7
+ title: MD5 checksum
+ format: string
+ version:
+ description: Version of the file.
+ uiOrder: 8
+ title: Version
+ format: integer
+ web-view-link:
+ description: Link for opening the file in a relevant third-party data storage
+ editor or viewer in a browser. It will be used to check the source of
+ the file.
+ uiOrder: 9
+ title: Web View Link
+ format: string
+ web-content-link:
+ description: Link for downloading the content of the file in a browser.
+ uiOrder: 10
+ title: Web Content Link
+ format: string
+ required:
+ - id
+ - name
+ - created-time
+ - modified-time
+ - size
+ - mime-type
+ - version
+ - web-view-link
+ title: Third Party File
+ format: object
+ title: Third Party Files
+ format: array
+TASK_UPLOAD_FILE:
+ shortDescription: Upload and process the files into chunks into Catalog.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ options:
+ description: Choose to upload the files to existing catalog or create a new
+ catalog.
+ title: Options
+ additionalProperties: true
+ uiOrder: 0
+ required:
+ - option
+ oneOf:
+ - properties:
+ option:
+ const: existing catalog
+ title: Option
+ description: Existing catalog.
+ uiOrder: 0
+ format: string
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID that you input in the Catalog.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ file:
+ $ref: '#/$defs/file'
+ file-name:
+ description: Name of the file, including the extension (e.g. `example.pdf`).
+ The length of this field is limited to 100 characters.
+ uiOrder: 2
+ acceptFormats:
+ - string
+ title: File Name
+ format: string
+ required:
+ - option
+ - namespace
+ - catalog-id
+ - file
+ - file-name
+ title: Existing Catalog
+ format: object
+ - properties:
+ option:
+ const: create new catalog
+ title: Option
+ description: Create new catalog.
+ uiOrder: 0
+ format: string
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID for new catalog you want to create.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ file:
+ $ref: '#/$defs/file'
+ file-name:
+ description: Name of the file, including the extension (e.g. `example.pdf`).
+ The length of this field is limited to 100 characters.
+ uiOrder: 3
+ acceptFormats:
+ - string
+ title: File Name
+ format: string
+ description:
+ description: Description of the catalog.
+ uiOrder: 4
+ acceptFormats:
+ - string
+ title: Description
+ format: string
+ tags:
+ description: Tags for the catalog.
+ uiOrder: 5
+ acceptFormats:
+ - array
+ items:
+ format: string
+ title: Tags
+ format: array
+ required:
+ - option
+ - namespace
+ - catalog-id
+ - file
+ - file-name
+ title: Create New Catalog
+ format: object
+ format: object
+ required:
+ - options
+ title: Input
+ format: object
+ output:
+ description: Result of uploading file into catalog.
+ properties:
+ file:
+ description: Result of uploading file into catalog.
+ uiOrder: 0
+ properties:
+ $ref: '#/$defs/file-item/properties'
+ required:
+ - file-uid
+ - file-name
+ - file-type
+ - create-time
+ - update-time
+ - size
+ - catalog-id
+ title: File
+ format: object
+ status:
+ description: The status of trigger file processing, if succeeded, return true.
+ uiOrder: 1
+ title: Status
+ format: boolean
+ required:
+ - file
+ - status
+ title: Output
+ format: object
+TASK_UPLOAD_FILES:
+ shortDescription: Upload and process the files into chunks into Catalog.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ options:
+ description: Choose to upload the files to existing catalog or create a new
+ catalog.
+ title: Options
+ additionalProperties: true
+ uiOrder: 0
+ required:
+ - option
+ oneOf:
+ - properties:
+ option:
+ const: existing catalog
+ title: Option
+ description: Existing catalog.
+ uiOrder: 0
+ format: string
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID that you input in the Catalog.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ files:
+ $ref: '#/$defs/files'
+ file-names:
+ description: Name of the file, including the extension (e.g. `example.pdf`).
+ The length of this field is limited to 100 characters.
+ uiOrder: 2
+ acceptFormats:
+ - array
+ items:
+ format: string
+ title: File Names
+ format: array
+ required:
+ - option
+ - namespace
+ - catalog-id
+ - files
+ - file-names
+ title: Existing Catalog
+ format: object
+ - properties:
+ option:
+ const: create new catalog
+ title: Option
+ description: Create new catalog.
+ uiOrder: 0
+ format: string
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID for new catalog you want to create.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ files:
+ $ref: '#/$defs/files'
+ file-names:
+ description: Name of the file, including the extension (e.g. `example.pdf`).
+ The length of this field is limited to 100 characters.
+ uiOrder: 3
+ acceptFormats:
+ - array
+ items:
+ format: string
+ title: File Names
+ format: array
+ description:
+ description: Description of the catalog.
+ uiOrder: 4
+ acceptFormats:
+ - string
+ title: Description
+ format: string
+ tags:
+ description: Tags for the catalog.
+ uiOrder: 5
+ acceptFormats:
+ - array
+ items:
+ format: string
+ title: Tags
+ format: array
+ required:
+ - option
+ - namespace
+ - catalog-id
+ - files
+ - file-names
+ title: Create New Catalog
+ format: object
+ format: object
+ required:
+ - options
+ title: Input
+ format: object
+ output:
+ description: Result of uploading files into catalog.
+ properties:
+ files:
+ description: Files metadata in catalog.
+ uiOrder: 0
+ items:
+ $ref: '#/$defs/file-item'
+ title: Files
+ format: array
+ status:
+ description: The status of trigger file processing, if ALL succeeded, return
+ true.
+ uiOrder: 1
+ title: Status
+ format: boolean
+ required:
+ - files
+ - status
+ title: Output
+ format: object
+TASK_GET_FILES_METADATA:
+ shortDescription: get the metadata of the files in the catalog.
+ input:
+ uiOrder: 0
+ properties:
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID that you input to search files in the Catalog.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ required:
+ - namespace
+ - catalog-id
+ title: Input
+ format: object
+ output:
+ description: Files metadata into catalog.
+ uiOrder: 1
+ properties:
+ files:
+ description: Files metadata in catalog.
+ uiOrder: 0
+ items:
+ $ref: '#/$defs/file-item'
+ title: Files
+ format: array
+ required:
+ - files
+ title: Output
+ format: object
+TASK_GET_CHUNKS_METADATA:
+ shortDescription: get the metadata of the chunks from a file in the catalog.
+ input:
+ uiOrder: 0
+ properties:
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID that you input to search files in the Catalog.
+ uiOrder: 0
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ file-uid:
+ description: The unique identifier of the file.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: File UID
+ format: string
+ required:
+ - namespace
+ - catalog-id
+ - file-uid
+ title: Input
+ format: object
+ output:
+ description: Chunks metadata of the file in catalog.
+ uiOrder: 1
+ properties:
+ chunks:
+ description: Chunks metadata of the file in catalog.
+ uiOrder: 0
+ items:
+ properties:
+ chunk-uid:
+ description: The unique identifier of the chunk.
+ uiOrder: 0
+ title: Chunk UID
+ format: string
+ retrievable:
+ description: The retrievable status of the chunk.
+ uiOrder: 1
+ title: Retrievable
+ format: boolean
+ start-position:
+ description: The start position of the chunk in the file.
+ uiOrder: 2
+ title: Start Position
+ format: integer
+ end-position:
+ description: The end position of the chunk in the file.
+ uiOrder: 3
+ title: End Position
+ format: integer
+ token-count:
+ description: The token count of the chunk.
+ uiOrder: 4
+ title: Token Count
+ format: integer
+ create-time:
+ description: The creation time of the chunk in ISO 8601 format.
+ uiOrder: 5
+ title: Create Time
+ format: string
+ original-file-uid:
+ description: The unique identifier of the file.
+ uiOrder: 6
+ title: File UID
+ format: string
+ required:
+ - chunk-uid
+ - retrievable
+ - start-position
+ - end-position
+ - token-count
+ - create-time
+ - original-file-uid
+ title: Chunk
+ format: object
+ title: Chunks
+ format: array
+ required:
+ - chunks
+ title: Output
+ format: object
+TASK_GET_FILE_IN_MARKDOWN:
+ shortDescription: get the file content in markdown format.
+ input:
+ uiOrder: 0
+ properties:
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID that you input to search files in the Catalog.
+ uiOrder: 0
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ file-uid:
+ description: The unique identifier of the file.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: File UID
+ format: string
+ required:
+ - namespace
+ - catalog-id
+ - file-uid
+ title: Input
+ format: object
+ output:
+ description: File content in markdown format.
+ uiOrder: 1
+ properties:
+ original-file-uid:
+ description: The unique identifier of the file.
+ uiOrder: 0
+ title: File UID
+ format: string
+ content:
+ description: The content of the file in markdown format.
+ uiOrder: 1
+ title: Content
+ format: string
+ create-time:
+ description: The creation time of the source file in ISO 8601 format.
+ uiOrder: 2
+ title: Create Time
+ format: string
+ update-time:
+ description: The update time of the source file in ISO 8601 format.
+ uiOrder: 3
+ title: Update Time
+ format: string
+ required:
+ - original-file-uid
+ - content
+ - create-time
+ - update-time
+ title: Output
+ format: object
+TASK_RETRIEVE:
+ shortDescription: search the chunks in the catalog.
+ input:
+ uiOrder: 0
+ properties:
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID that you input to search files in the Catalog.
+ uiOrder: 0
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ text-prompt:
+ description: The prompt string to search the chunks.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Text Prompt
+ format: string
+ top-k:
+ description: The number of top chunks to return. The range is from 1~20, and
+ default is 5.
+ default: 5
+ uiOrder: 2
+ acceptFormats:
+ - integer
+ title: Top K
+ format: integer
+ required:
+ - namespace
+ - catalog-id
+ - text-prompt
+ title: Input
+ format: object
+ output:
+ uiOrder: 1
+ properties:
+ chunks:
+ description: Chunks data from smart search.
+ uiOrder: 0
+ items:
+ $ref: '#/$defs/chunk-item'
+ title: Chunks
+ format: array
+ required:
+ - chunks
+ title: Output
+ format: object
+TASK_ASK:
+ shortDescription: Reply the questions based on the files in the catalog.
+ input:
+ uiOrder: 0
+ properties:
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID that you input to search files in the Catalog.
+ uiOrder: 0
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ question:
+ description: The question to reply.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Question
+ format: string
+ top-k:
+ description: The number of top answers to return. The range is from 1~20,
+ and default is 5.
+ default: 5
+ uiOrder: 2
+ acceptFormats:
+ - integer
+ title: Top K
+ format: integer
+ required:
+ - namespace
+ - catalog-id
+ - question
+ title: Input
+ format: object
+ output:
+ uiOrder: 1
+ properties:
+ answer:
+ description: Answers data from smart search.
+ uiOrder: 0
+ title: Answer
+ format: string
+ chunks:
+ description: Chunks data to answer question.
+ uiOrder: 1
+ items:
+ $ref: '#/$defs/chunk-item'
+ title: Chunks
+ format: array
+ required:
+ - answer
+ title: Output
+ format: object
+TASK_MATCH_FILE_STATUS:
+ shortDescription: Check if the specified file's processing status is done.
+ input:
+ uiOrder: 0
+ properties:
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID that you input to check files' processing status in
+ the Catalog.
+ uiOrder: 0
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ file-uid:
+ description: The unique identifier of the file.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: File UID
+ format: string
+ required:
+ - namespace
+ - catalog-id
+ - file-uid
+ title: Input
+ format: object
+ output:
+ uiOrder: 1
+ properties:
+ succeeded:
+ description: The status of the file processing, if succeeded, return true.
+ uiOrder: 0
+ title: Status
+ format: boolean
+ required:
+ - succeeded
+ title: Output
+ format: object
+TASK_SYNC_FILES:
+ shortDescription: This task synchronizes files from third-party storage to Instill
+ Catalog. New files are uploaded, and updated files are overwritten based on third-party
+ metadata. Files added through other channels, like the Artifact API or additional
+ storage services, will not be removed. Currently, only Google Drive is supported
+ as a third-party storage service.
+ input:
+ uiOrder: 0
+ properties:
+ namespace:
+ $ref: '#/$defs/namespace'
+ catalog-id:
+ description: Catalog ID that you input to synchronize files from third-party
+ data storage to catalog.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Catalog ID
+ format: string
+ third-party-files:
+ $ref: '#/$defs/third-party-files'
+ required:
+ - namespace
+ - catalog-id
+ - third-party-files
+ title: Input
+ format: object
+ output:
+ uiOrder: 1
+ properties:
+ uploaded-files:
+ description: Files metadata in catalog. The metadata here is from Instill
+ Artifact rather than third-party storage.
+ uiOrder: 0
+ items:
+ $ref: '#/$defs/file-item'
+ title: Uploaded Files
+ format: array
+ updated_files:
+ description: Files that were updated. The metadata here is from Instill Artifact
+ rather than third-party storage.
+ uiOrder: 1
+ items:
+ $ref: '#/$defs/file-item'
+ title: Updated Files
+ format: array
+ failure-files:
+ description: Files that failed to upload or overwrite. The metadata here is
+ from third-party storage.
+ uiOrder: 2
+ items:
+ $ref: '#/$defs/third-party-files/items'
+ title: Failure Files
+ format: array
+ error-messages:
+ description: Error messages for files that failed to upload or overwrite.
+ uiOrder: 3
+ items:
+ format: string
+ title: Error Messages
+ format: array
+ status:
+ description: The status of the triggering processing files, if succeeded,
+ return true.
+ uiOrder: 4
+ title: Status
+ format: boolean
+ required: []
+ title: Output
+ format: object
diff --git a/pkg/component/data/instillartifact/v0/main.go b/pkg/component/data/instillartifact/v0/main.go
index 7ac5c2bb6..85e933f25 100644
--- a/pkg/component/data/instillartifact/v0/main.go
+++ b/pkg/component/data/instillartifact/v0/main.go
@@ -28,10 +28,10 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
)
@@ -52,7 +52,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/milvus/v0/README.mdx b/pkg/component/data/milvus/v0/README.mdx
index c4c697645..fd05703d6 100644
--- a/pkg/component/data/milvus/v0/README.mdx
+++ b/pkg/component/data/milvus/v0/README.mdx
@@ -28,7 +28,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/milvus/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/milvus/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/milvus/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/milvus/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/milvus/v0/config/definition.json b/pkg/component/data/milvus/v0/config/definition.json
deleted file mode 100644
index 377a06e4b..000000000
--- a/pkg/component/data/milvus/v0/config/definition.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "availableTasks": [
- "TASK_VECTOR_SEARCH",
- "TASK_UPSERT",
- "TASK_BATCH_UPSERT",
- "TASK_DELETE",
- "TASK_CREATE_COLLECTION",
- "TASK_DROP_COLLECTION",
- "TASK_CREATE_PARTITION",
- "TASK_DROP_PARTITION",
- "TASK_CREATE_INDEX",
- "TASK_DROP_INDEX"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/data/milvus",
- "icon": "assets/milvus.svg",
- "id": "milvus",
- "public": true,
- "title": "Milvus",
- "description": "Build and search vector datasets.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "51a5246e-2f2c-4597-bbca-4baaa0dc8994",
- "vendor": "Milvus",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/milvus/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/milvus/v0/config/definition.yaml b/pkg/component/data/milvus/v0/config/definition.yaml
new file mode 100644
index 000000000..542c172d5
--- /dev/null
+++ b/pkg/component/data/milvus/v0/config/definition.yaml
@@ -0,0 +1,25 @@
+availableTasks:
+- TASK_VECTOR_SEARCH
+- TASK_UPSERT
+- TASK_BATCH_UPSERT
+- TASK_DELETE
+- TASK_CREATE_COLLECTION
+- TASK_DROP_COLLECTION
+- TASK_CREATE_PARTITION
+- TASK_DROP_PARTITION
+- TASK_CREATE_INDEX
+- TASK_DROP_INDEX
+documentationUrl: https://www.instill.tech/docs/component/data/milvus
+icon: assets/milvus.svg
+id: milvus
+public: true
+title: Milvus
+description: Build and search vector datasets.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: 51a5246e-2f2c-4597-bbca-4baaa0dc8994
+vendor: Milvus
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/milvus/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/milvus/v0/config/setup.json b/pkg/component/data/milvus/v0/config/setup.json
deleted file mode 100644
index 7d1263e7a..000000000
--- a/pkg/component/data/milvus/v0/config/setup.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "url": {
- "description": "Fill in your Milvus public URL endpoint with port number, e.g http://3.25.202.142:19530.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 0,
- "title": "Milvus URL Endpoint",
- "format": "string"
- },
- "username": {
- "description": "Fill in your Milvus username.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 1,
- "title": "Milvus Username",
- "format": "string"
- },
- "password": {
- "description": "Fill in your Milvus password.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 2,
- "title": "Milvus Password",
- "format": "string"
- }
- },
- "required": [
- "url",
- "username",
- "password"
- ],
- "title": "Milvus Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/milvus/v0/config/setup.yaml b/pkg/component/data/milvus/v0/config/setup.yaml
new file mode 100644
index 000000000..0fa4e9c82
--- /dev/null
+++ b/pkg/component/data/milvus/v0/config/setup.yaml
@@ -0,0 +1,32 @@
+additionalProperties: false
+properties:
+ url:
+ description: Fill in your Milvus public URL endpoint with port number, e.g http://3.25.202.142:19530.
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 0
+ title: Milvus URL Endpoint
+ format: string
+ username:
+ description: Fill in your Milvus username.
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 1
+ title: Milvus Username
+ format: string
+ password:
+ description: Fill in your Milvus password.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 2
+ title: Milvus Password
+ format: string
+required:
+- url
+- username
+- password
+title: Milvus Connection
+format: object
diff --git a/pkg/component/data/milvus/v0/config/tasks.json b/pkg/component/data/milvus/v0/config/tasks.json
deleted file mode 100644
index ae8cec37a..000000000
--- a/pkg/component/data/milvus/v0/config/tasks.json
+++ /dev/null
@@ -1,734 +0,0 @@
-{
- "TASK_VECTOR_SEARCH": {
- "shortDescription": "Perform a vector search on a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to perform vector search on.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to vector search the data from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- },
- "vector": {
- "description": "An array of dimensions for the vector search.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 2,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Vector",
- "format": "array"
- },
- "vector-field": {
- "description": "The name of the field to perform vector search on.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Vector Field",
- "format": "string"
- },
- "limit": {
- "description": "The limit of the data to return.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Limit",
- "format": "integer"
- },
- "fields": {
- "description": "The fields to return in the data. If empty then all fields will be returned.",
- "acceptFormats": [
- "array"
- ],
- "shortDescription": "Fields to be returned, empty for all fields",
- "uiOrder": 4,
- "title": "Fields",
- "minItems": 1,
- "items": {
- "title": "Field",
- "format": "string"
- },
- "format": "array"
- },
- "filter": {
- "description": "The properties filter to be applied to the data with milvus scalar filter, please refer to [filter-search](https://milvus.io/docs/single-vector-search.md#Filtered-search).",
- "uiOrder": 5,
- "acceptFormats": [
- "string"
- ],
- "title": "Filter",
- "format": "string"
- },
- "offset": {
- "description": "The offset of the data to return.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Offset",
- "format": "integer"
- },
- "grouping-field": {
- "description": "The name of the field to group the data by, please refer to [Grouping-search](https://milvus.io/docs/single-vector-search.md#Grouping-search).",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 7,
- "title": "Grouping Field",
- "format": "string"
- },
- "search-params": {
- "description": "The search parameters to be applied to the data with milvus search parameters, please refer to [Search-parameters](https://milvus.io/docs/single-vector-search.md#Search-parameters).",
- "uiOrder": 8,
- "acceptFormats": [
- "json",
- "object"
- ],
- "title": "Search Parameters",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name",
- "vector",
- "vector-field",
- "limit"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Vector search status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- },
- "result": {
- "description": "Result of the vector search operation.",
- "uiOrder": 0,
- "title": "Result",
- "properties": {
- "ids": {
- "description": "The ids returned from the vector search operation.",
- "uiOrder": 0,
- "title": "IDs",
- "required": [],
- "items": {
- "description": "An id of the point.",
- "example": "c8faa-4b3b-4b3b-4b3b",
- "format": "string"
- },
- "format": "array"
- },
- "data": {
- "description": "The points returned from the vector search operation.",
- "uiOrder": 1,
- "required": [],
- "title": "Data",
- "items": {
- "title": "Datum",
- "format": "object",
- "required": []
- },
- "format": "array"
- },
- "vectors": {
- "description": "The vectors returned from the vector search operation.",
- "uiOrder": 2,
- "title": "Vectors",
- "required": [],
- "items": {
- "description": "The vector from array vectors.",
- "required": [],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "format": "array"
- },
- "format": "array"
- },
- "metadata": {
- "description": "The metadata returned from the vector search operation.",
- "uiOrder": 3,
- "title": "Metadata",
- "required": [],
- "items": {
- "title": "Metadatum",
- "format": "object",
- "required": []
- },
- "format": "array"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "status",
- "result"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPSERT": {
- "shortDescription": "Insert a vector data into a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to upsert the data into.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to upsert the data from. If empty then default partition will be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- },
- "data": {
- "description": "The data.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 2,
- "title": "Data",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name",
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Upsert status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_BATCH_UPSERT": {
- "shortDescription": "Insert a batch of vector data into a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to upsert the data into.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to upsert the data from. If empty then default partition will be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- },
- "array-data": {
- "description": "The data.",
- "acceptFormats": [
- "array",
- "array",
- "array",
- "array"
- ],
- "uiOrder": 2,
- "title": "Array Data",
- "items": {
- "description": "A datum.",
- "required": [],
- "format": "object"
- },
- "format": "array"
- }
- },
- "required": [
- "collection-name",
- "array-data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Batch upsert status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE": {
- "shortDescription": "Delete vector data from a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to delete the data from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to delete the data from. If empty then default partition will be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- },
- "filter": {
- "description": "The properties filter to be applied to the data with milvus scalar filter, please refer to [Filtered-search](https://milvus.io/docs/single-vector-search.md#Filtered-search).",
- "uiOrder": 2,
- "acceptFormats": [
- "string"
- ],
- "title": "Filter",
- "format": "string"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_COLLECTION": {
- "shortDescription": "Create a collectio, please refer to [Create-Collection](https://milvus.io/docs/manage-collections.md#Create-Collection)",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to create.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "dimension": {
- "description": "The dimension of the collection.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "title": "Dimension",
- "format": "integer"
- },
- "id-type": {
- "description": "The type of the id.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "ID Type",
- "format": "string"
- },
- "schema": {
- "description": "The schema of the collection.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 4,
- "title": "Schema",
- "required": [],
- "format": "object"
- },
- "auto-id": {
- "description": "Whether to auto generate id.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 5,
- "title": "Auto ID",
- "default": false,
- "format": "boolean"
- },
- "metric-type": {
- "description": "The metric type of the collection.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 6,
- "title": "Metric Type",
- "enum": [
- "L2",
- "IP",
- "COSINE"
- ],
- "default": "L2",
- "format": "string"
- },
- "index-params": {
- "description": "The index parameters to be applied to the collection with milvus index parameters, please refer to [Create](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/Create.md).",
- "uiOrder": 7,
- "acceptFormats": [
- "array",
- "array"
- ],
- "title": "Index Parameters",
- "required": [],
- "items": {
- "description": "Index parameter.",
- "required": [],
- "format": "object"
- },
- "format": "array"
- },
- "params": {
- "description": "The parameters to be applied to the collection with milvus parameters, please refer to [Parameters](https://milvus.io/docs/single-vector-search.md#Parameters).",
- "uiOrder": 8,
- "acceptFormats": [
- "json",
- "object"
- ],
- "title": "Parameters",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name",
- "dimension"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Create collection status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DROP_COLLECTION": {
- "shortDescription": "Drop a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to drop.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Drop collection status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_PARTITION": {
- "shortDescription": "Create a partition in a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to create the partition in.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to create.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- }
- },
- "required": [
- "collection-name",
- "partition-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Create partition status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DROP_PARTITION": {
- "shortDescription": "Drop a partition from a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to drop the partition from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to drop.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- }
- },
- "required": [
- "collection-name",
- "partition-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Drop partition status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_INDEX": {
- "shortDescription": "Create an index in a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to create the index in.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "index-params": {
- "description": "The index parameters to be applied to the collection with milvus index parameters, please refer to [Create](https://milvus.io/api-reference/restful/v2.4.x/v2/Index%20(v2)/Create.md).",
- "uiOrder": 7,
- "acceptFormats": [
- "json",
- "object"
- ],
- "title": "Index Parameters",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name",
- "index-params"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Create index status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DROP_INDEX": {
- "shortDescription": "Drop an index from a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to drop the index from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "index-name": {
- "description": "The name of the index to drop.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Index Name",
- "format": "string"
- }
- },
- "required": [
- "collection-name",
- "index-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Drop index status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/milvus/v0/config/tasks.yaml b/pkg/component/data/milvus/v0/config/tasks.yaml
new file mode 100644
index 000000000..b309231ba
--- /dev/null
+++ b/pkg/component/data/milvus/v0/config/tasks.yaml
@@ -0,0 +1,574 @@
+TASK_VECTOR_SEARCH:
+ shortDescription: Perform a vector search on a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to perform vector search on.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to vector search the data from.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ vector:
+ description: An array of dimensions for the vector search.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 2
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Vector
+ format: array
+ vector-field:
+ description: The name of the field to perform vector search on.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Vector Field
+ format: string
+ limit:
+ description: The limit of the data to return.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Limit
+ format: integer
+ fields:
+ description: The fields to return in the data. If empty then all fields will
+ be returned.
+ acceptFormats:
+ - array
+ shortDescription: Fields to be returned, empty for all fields
+ uiOrder: 4
+ title: Fields
+ minItems: 1
+ items:
+ title: Field
+ format: string
+ format: array
+ filter:
+ description: The properties filter to be applied to the data with milvus scalar
+ filter, please refer to [filter-search](https://milvus.io/docs/single-vector-search.md#Filtered-search).
+ uiOrder: 5
+ acceptFormats:
+ - string
+ title: Filter
+ format: string
+ offset:
+ description: The offset of the data to return.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Offset
+ format: integer
+ grouping-field:
+ description: The name of the field to group the data by, please refer to [Grouping-search](https://milvus.io/docs/single-vector-search.md#Grouping-search).
+ acceptFormats:
+ - string
+ uiOrder: 7
+ title: Grouping Field
+ format: string
+ search-params:
+ description: The search parameters to be applied to the data with milvus search
+ parameters, please refer to [Search-parameters](https://milvus.io/docs/single-vector-search.md#Search-parameters).
+ uiOrder: 8
+ acceptFormats:
+ - json
+ - object
+ title: Search Parameters
+ required: []
+ format: object
+ required:
+ - collection-name
+ - vector
+ - vector-field
+ - limit
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Vector search status.
+ uiOrder: 0
+ title: Status
+ format: string
+ result:
+ description: Result of the vector search operation.
+ uiOrder: 0
+ title: Result
+ properties:
+ ids:
+ description: The ids returned from the vector search operation.
+ uiOrder: 0
+ title: IDs
+ required: []
+ items:
+ description: An id of the point.
+ example: c8faa-4b3b-4b3b-4b3b
+ format: string
+ format: array
+ data:
+ description: The points returned from the vector search operation.
+ uiOrder: 1
+ required: []
+ title: Data
+ items:
+ title: Datum
+ format: object
+ required: []
+ format: array
+ vectors:
+ description: The vectors returned from the vector search operation.
+ uiOrder: 2
+ title: Vectors
+ required: []
+ items:
+ description: The vector from array vectors.
+ required: []
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ format: array
+ format: array
+ metadata:
+ description: The metadata returned from the vector search operation.
+ uiOrder: 3
+ title: Metadata
+ required: []
+ items:
+ title: Metadatum
+ format: object
+ required: []
+ format: array
+ required: []
+ format: object
+ required:
+ - status
+ - result
+ title: Output
+ format: object
+TASK_UPSERT:
+ shortDescription: Insert a vector data into a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to upsert the data into.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to upsert the data from. If empty then
+ default partition will be used.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ data:
+ description: The data.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 2
+ title: Data
+ required: []
+ format: object
+ required:
+ - collection-name
+ - data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Upsert status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_BATCH_UPSERT:
+ shortDescription: Insert a batch of vector data into a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to upsert the data into.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to upsert the data from. If empty then
+ default partition will be used.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ array-data:
+ description: The data.
+ acceptFormats:
+ - array
+ - array
+ - array
+ - array
+ uiOrder: 2
+ title: Array Data
+ items:
+ description: A datum.
+ required: []
+ format: object
+ format: array
+ required:
+ - collection-name
+ - array-data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Batch upsert status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DELETE:
+ shortDescription: Delete vector data from a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to delete the data from.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to delete the data from. If empty then
+ default partition will be used.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ filter:
+ description: The properties filter to be applied to the data with milvus scalar
+ filter, please refer to [Filtered-search](https://milvus.io/docs/single-vector-search.md#Filtered-search).
+ uiOrder: 2
+ acceptFormats:
+ - string
+ title: Filter
+ format: string
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_CREATE_COLLECTION:
+ shortDescription: Create a collectio, please refer to [Create-Collection](https://milvus.io/docs/manage-collections.md#Create-Collection)
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to create.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ dimension:
+ description: The dimension of the collection.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ title: Dimension
+ format: integer
+ id-type:
+ description: The type of the id.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: ID Type
+ format: string
+ schema:
+ description: The schema of the collection.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 4
+ title: Schema
+ required: []
+ format: object
+ auto-id:
+ description: Whether to auto generate id.
+ acceptFormats:
+ - boolean
+ uiOrder: 5
+ title: Auto ID
+ default: false
+ format: boolean
+ metric-type:
+ description: The metric type of the collection.
+ acceptFormats:
+ - string
+ uiOrder: 6
+ title: Metric Type
+ enum:
+ - L2
+ - IP
+ - COSINE
+ default: L2
+ format: string
+ index-params:
+ description: The index parameters to be applied to the collection with milvus
+ index parameters, please refer to [Create](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/Create.md).
+ uiOrder: 7
+ acceptFormats:
+ - array
+ - array
+ title: Index Parameters
+ required: []
+ items:
+ description: Index parameter.
+ required: []
+ format: object
+ format: array
+ params:
+ description: The parameters to be applied to the collection with milvus parameters,
+ please refer to [Parameters](https://milvus.io/docs/single-vector-search.md#Parameters).
+ uiOrder: 8
+ acceptFormats:
+ - json
+ - object
+ title: Parameters
+ required: []
+ format: object
+ required:
+ - collection-name
+ - dimension
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Create collection status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DROP_COLLECTION:
+ shortDescription: Drop a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to drop.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Drop collection status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_CREATE_PARTITION:
+ shortDescription: Create a partition in a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to create the partition in.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to create.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ required:
+ - collection-name
+ - partition-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Create partition status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DROP_PARTITION:
+ shortDescription: Drop a partition from a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to drop the partition from.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to drop.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ required:
+ - collection-name
+ - partition-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Drop partition status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_CREATE_INDEX:
+ shortDescription: Create an index in a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to create the index in.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ index-params:
+ description: The index parameters to be applied to the collection with milvus
+ index parameters, please refer to [Create](https://milvus.io/api-reference/restful/v2.4.x/v2/Index%20(v2)/Create.md).
+ uiOrder: 7
+ acceptFormats:
+ - json
+ - object
+ title: Index Parameters
+ required: []
+ format: object
+ required:
+ - collection-name
+ - index-params
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Create index status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DROP_INDEX:
+ shortDescription: Drop an index from a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to drop the index from.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ index-name:
+ description: The name of the index to drop.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Index Name
+ format: string
+ required:
+ - collection-name
+ - index-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Drop index status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
diff --git a/pkg/component/data/milvus/v0/main.go b/pkg/component/data/milvus/v0/main.go
index de56fe618..4189d0ac9 100644
--- a/pkg/component/data/milvus/v0/main.go
+++ b/pkg/component/data/milvus/v0/main.go
@@ -28,14 +28,14 @@ const (
TaskDropIndex = "TASK_DROP_INDEX"
)
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -54,7 +54,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/mongodb/v0/README.mdx b/pkg/component/data/mongodb/v0/README.mdx
index 9c5f1b019..81239ec8d 100644
--- a/pkg/component/data/mongodb/v0/README.mdx
+++ b/pkg/component/data/mongodb/v0/README.mdx
@@ -28,7 +28,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/mongodb/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/mongodb/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/mongodb/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/mongodb/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/mongodb/v0/config/definition.json b/pkg/component/data/mongodb/v0/config/definition.json
deleted file mode 100644
index 5086b4511..000000000
--- a/pkg/component/data/mongodb/v0/config/definition.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "availableTasks": [
- "TASK_INSERT",
- "TASK_INSERT_MANY",
- "TASK_FIND",
- "TASK_UPDATE",
- "TASK_DELETE",
- "TASK_DROP_COLLECTION",
- "TASK_DROP_DATABASE",
- "TASK_CREATE_SEARCH_INDEX",
- "TASK_DROP_SEARCH_INDEX",
- "TASK_VECTOR_SEARCH"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/data/mongodb",
- "icon": "assets/mongodb.svg",
- "id": "mongodb",
- "public": true,
- "title": "MongoDB",
- "description": "Access the MongoDB NoSQL database.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "1547711c-864b-4983-b0ca-cb79eafa2f7f",
- "vendor": "MongoDB",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/mongodb/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/mongodb/v0/config/definition.yaml b/pkg/component/data/mongodb/v0/config/definition.yaml
new file mode 100644
index 000000000..aefb72698
--- /dev/null
+++ b/pkg/component/data/mongodb/v0/config/definition.yaml
@@ -0,0 +1,25 @@
+availableTasks:
+- TASK_INSERT
+- TASK_INSERT_MANY
+- TASK_FIND
+- TASK_UPDATE
+- TASK_DELETE
+- TASK_DROP_COLLECTION
+- TASK_DROP_DATABASE
+- TASK_CREATE_SEARCH_INDEX
+- TASK_DROP_SEARCH_INDEX
+- TASK_VECTOR_SEARCH
+documentationUrl: https://www.instill.tech/docs/component/data/mongodb
+icon: assets/mongodb.svg
+id: mongodb
+public: true
+title: MongoDB
+description: Access the MongoDB NoSQL database.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: 1547711c-864b-4983-b0ca-cb79eafa2f7f
+vendor: MongoDB
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/mongodb/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/mongodb/v0/config/setup.json b/pkg/component/data/mongodb/v0/config/setup.json
deleted file mode 100644
index b348e098e..000000000
--- a/pkg/component/data/mongodb/v0/config/setup.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "uri": {
- "description": "Fill in your MongoDB URI.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "URI",
- "format": "string"
- }
- },
- "required": [
- "uri"
- ],
- "title": "MongoDB Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/mongodb/v0/config/setup.yaml b/pkg/component/data/mongodb/v0/config/setup.yaml
new file mode 100644
index 000000000..29ecc8de6
--- /dev/null
+++ b/pkg/component/data/mongodb/v0/config/setup.yaml
@@ -0,0 +1,14 @@
+additionalProperties: false
+properties:
+ uri:
+ description: Fill in your MongoDB URI.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: URI
+ format: string
+required:
+- uri
+title: MongoDB Connection
+format: object
diff --git a/pkg/component/data/mongodb/v0/config/tasks.json b/pkg/component/data/mongodb/v0/config/tasks.json
deleted file mode 100644
index 62a6a48ac..000000000
--- a/pkg/component/data/mongodb/v0/config/tasks.json
+++ /dev/null
@@ -1,895 +0,0 @@
-{
- "TASK_INSERT": {
- "shortDescription": "Perform an insert operation",
- "input": {
- "uiOrder": 0,
- "properties": {
- "database-name": {
- "description": "The name of the database in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Database Name",
- "format": "string"
- },
- "collection-name": {
- "description": "The name of the collection in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the document.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "ID",
- "format": "string"
- },
- "data": {
- "description": "The data to be inserted.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 3,
- "title": "Data",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "database-name",
- "collection-name",
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Insert status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_INSERT_MANY": {
- "shortDescription": "Perform an insert many operation",
- "input": {
- "uiOrder": 0,
- "properties": {
- "database-name": {
- "description": "The name of the database in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Database Name",
- "format": "string"
- },
- "collection-name": {
- "description": "The name of the collection in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Collection Name",
- "format": "string"
- },
- "array-id": {
- "description": "The array of id.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 2,
- "items": {
- "description": "An id of the document.",
- "example": 1,
- "format": "string"
- },
- "minItems": 1,
- "title": "Array ID",
- "format": "array"
- },
- "array-data": {
- "description": "The array data to be inserted.",
- "acceptFormats": [
- "array",
- "array",
- "array",
- "array"
- ],
- "uiOrder": 3,
- "title": "Data",
- "items": {
- "description": "The data to be inserted.",
- "title": "Data",
- "required": [],
- "format": "object"
- },
- "minItems": 1,
- "format": "array"
- }
- },
- "required": [
- "database-name",
- "collection-name",
- "array-data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Insert many status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_FIND": {
- "shortDescription": "Perform a find operation",
- "input": {
- "uiOrder": 0,
- "properties": {
- "database-name": {
- "description": "The name of the database in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Database Name",
- "format": "string"
- },
- "collection-name": {
- "description": "The name of the collection in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the document.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "ID",
- "format": "string"
- },
- "filter": {
- "description": "The filter to find documents, please refer to [the documentations](https://www.mongodb.com/docs/manual/reference/operator/query/). If empty then all documents will be returned.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "shortDescription": "The mongodb language query to filter the documents, empty for no filter",
- "uiOrder": 3,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "limit": {
- "description": "The number of documents to return. If empty then all documents will be returned.",
- "acceptFormats": [
- "integer"
- ],
- "shortDescription": "Limit the documents, empty for all documents",
- "uiOrder": 4,
- "title": "Limit",
- "format": "integer"
- },
- "fields": {
- "description": "The fields to return in the documents. If empty then all fields will be returned.",
- "acceptFormats": [
- "array"
- ],
- "shortDescription": "Fields to be returned, empty for all fields",
- "uiOrder": 5,
- "title": "Fields",
- "items": {
- "title": "Field",
- "format": "string"
- },
- "minItems": 1,
- "format": "array"
- }
- },
- "required": [
- "database-name",
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Find status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- },
- "result": {
- "description": "Result of the find operation.",
- "uiOrder": 0,
- "title": "Result",
- "properties": {
- "ids": {
- "description": "The ids returned from the find operation.",
- "uiOrder": 0,
- "title": "IDs",
- "required": [],
- "items": {
- "description": "An id of the document.",
- "example": "c8faa-4b3b-4b3b-4b3b",
- "format": "string"
- },
- "format": "array"
- },
- "documents": {
- "description": "The documents returned from the find operation.",
- "uiOrder": 1,
- "required": [],
- "title": "Documents",
- "items": {
- "title": "Document",
- "format": "object",
- "required": []
- },
- "format": "array"
- },
- "data": {
- "description": "The data returned from the find operation.",
- "uiOrder": 2,
- "title": "Metadata",
- "required": [],
- "items": {
- "title": "Datum",
- "format": "object",
- "required": []
- },
- "format": "array"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "status",
- "result"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPDATE": {
- "shortDescription": "Perform an update operation",
- "input": {
- "uiOrder": 0,
- "properties": {
- "database-name": {
- "description": "The name of the database in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Database Name",
- "format": "string"
- },
- "collection-name": {
- "description": "The name of the collection in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the document.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "ID",
- "format": "string"
- },
- "filter": {
- "description": "The filter to update documents, please refer to [the documentations](https://www.mongodb.com/docs/manual/reference/operator/query/). If empty then all documents will be returned.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "shortDescription": "The mongodb language query to filter the documents",
- "uiOrder": 3,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "update-data": {
- "description": "The updated data to be applied to the documents.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 4,
- "title": "Update",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "database-name",
- "collection-name",
- "update-data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Update status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE": {
- "shortDescription": "Perform a delete operation",
- "input": {
- "uiOrder": 0,
- "properties": {
- "database-name": {
- "description": "The name of the database in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Database Name",
- "format": "string"
- },
- "collection-name": {
- "description": "The name of the collection in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the document.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "ID",
- "format": "string"
- },
- "filter": {
- "description": "The filter to delete documents, please refer to [the documentations](https://www.mongodb.com/docs/manual/reference/operator/query/). If empty then all documents will be returned.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "shortDescription": "The mongodb language query to filter the documents",
- "uiOrder": 3,
- "title": "Filter",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "database-name",
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DROP_COLLECTION": {
- "shortDescription": "Delete the collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "database-name": {
- "description": "The name of the database in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Database Name",
- "format": "string"
- },
- "collection-name": {
- "description": "The name of the collection in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Collection Name",
- "format": "string"
- }
- },
- "required": [
- "database-name",
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete collection status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DROP_DATABASE": {
- "shortDescription": "Delete the database",
- "input": {
- "uiOrder": 0,
- "properties": {
- "database-name": {
- "description": "The name of the database in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Database Name",
- "format": "string"
- }
- },
- "required": [
- "database-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete database status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_SEARCH_INDEX": {
- "shortDescription": "Create a search index, only works for M10 or larger clusters",
- "input": {
- "uiOrder": 0,
- "properties": {
- "database-name": {
- "description": "The name of the database in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Database Name",
- "format": "string"
- },
- "collection-name": {
- "description": "The name of the collection in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Collection Name",
- "format": "string"
- },
- "index-name": {
- "description": "The name of the index to be created.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Index Name",
- "uiOrder": 2,
- "title": "Index Name",
- "format": "string"
- },
- "index-type": {
- "description": "The type of the index to be created.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Index Type",
- "uiOrder": 3,
- "enum": [
- "search",
- "vectorSearch"
- ],
- "title": "Index Type",
- "format": "string"
- },
- "syntax": {
- "description": "The syntax structure of the search index, please refer to the MongoDB documentation for more information. search [here](https://www.mongodb.com/docs/atlas/atlas-search/create-index/). vectorSearch [here](https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "shortDescription": "Syntax Structure, please refer to the MongoDB documentation",
- "uiOrder": 4,
- "title": "Syntax",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "database-name",
- "collection-name",
- "index-type",
- "index-name",
- "syntax"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Create index status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DROP_SEARCH_INDEX": {
- "shortDescription": "Drop a search index, only works for M10 or larger clusters",
- "input": {
- "uiOrder": 0,
- "properties": {
- "database-name": {
- "description": "The name of the database in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Database Name",
- "format": "string"
- },
- "collection-name": {
- "description": "The name of the collection in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Collection Name",
- "format": "string"
- },
- "index-name": {
- "description": "The name of the index to be dropped.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Index Name",
- "uiOrder": 2,
- "title": "Index Name",
- "format": "string"
- }
- },
- "required": [
- "database-name",
- "collection-name",
- "index-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete index status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_VECTOR_SEARCH": {
- "shortDescription": "Perform a vector search operation",
- "input": {
- "uiOrder": 0,
- "properties": {
- "database-name": {
- "description": "The name of the database in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Database Name",
- "format": "string"
- },
- "collection-name": {
- "description": "The name of the collection in MongoDB.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Collection Name",
- "format": "string"
- },
- "index-name": {
- "description": "The name of the index to be used for vector search.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Index Name",
- "uiOrder": 2,
- "title": "Index Name",
- "format": "string"
- },
- "query-vector": {
- "description": "The query vector to be used for vector search.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "shortDescription": "Query Vector",
- "uiOrder": 3,
- "title": "Query Vector",
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "format": "array"
- },
- "exact": {
- "description": "The exact value for vector search. If true, then ENN search will be performed, otherwise ANN search will be performed. Default to false.",
- "acceptFormats": [
- "boolean"
- ],
- "shortDescription": "Exact Search, true for ENN search, false for ANN search",
- "uiOrder": 4,
- "title": "Exact",
- "default": false,
- "format": "boolean"
- },
- "limit": {
- "description": "Limit the documents to be returned.",
- "acceptFormats": [
- "integer"
- ],
- "shortDescription": "Limit Documents",
- "uiOrder": 5,
- "title": "Limit",
- "format": "integer"
- },
- "num-candidates": {
- "description": "The number of candidates to the field to be used for vector search. Default to 3 times limit.",
- "acceptFormats": [
- "integer"
- ],
- "shortDescription": "Number of Candidates, default to 3 times limit",
- "uiOrder": 6,
- "title": "Number of Candidates",
- "format": "integer"
- },
- "path": {
- "description": "The path to the field to be used for vector search.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Path, need to first create vectorSearch search index",
- "uiOrder": 7,
- "title": "Path",
- "format": "string"
- },
- "filter": {
- "description": "The filter to be used for vector search, need to first create filter vectorSearch search index, please refer to [the documentations](https://www.mongodb.com/docs/manual/reference/operator/query/). If empty then all documents will be returned to be used for vector search.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "shortDescription": "The mongodb language query to filter the documents, empty for all documents",
- "uiOrder": 8,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "fields": {
- "description": "The fields to return in the documents. If empty then all fields will be returned.",
- "acceptFormats": [
- "array"
- ],
- "shortDescription": "Fields to be returned, empty for all fields",
- "uiOrder": 9,
- "title": "Fields",
- "items": {
- "title": "Field",
- "format": "string"
- },
- "minItems": 1,
- "format": "array"
- }
- },
- "required": [
- "database-name",
- "collection-name",
- "index-name",
- "query-vector",
- "path",
- "limit"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Vector search status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- },
- "result": {
- "description": "Result of the vector search operation.",
- "uiOrder": 0,
- "title": "Result",
- "properties": {
- "ids": {
- "description": "The ids returned from the vector search operation.",
- "uiOrder": 0,
- "title": "IDs",
- "required": [],
- "items": {
- "description": "An id of the document.",
- "example": "c8faa-4b3b-4b3b-4b3b",
- "format": "string"
- },
- "format": "array"
- },
- "documents": {
- "description": "The documents returned from the vector search operation.",
- "uiOrder": 1,
- "required": [],
- "title": "Documents",
- "items": {
- "title": "Document",
- "format": "object",
- "required": []
- },
- "format": "array"
- },
- "vectors": {
- "description": "The vectors returned from the vector search operation.",
- "uiOrder": 2,
- "title": "Vectors",
- "required": [],
- "items": {
- "description": "The vector from array vectors.",
- "required": [],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "format": "array"
- },
- "format": "array"
- },
- "metadata": {
- "description": "The metadata returned from the vector search operation.",
- "uiOrder": 3,
- "title": "Metadata",
- "required": [],
- "items": {
- "title": "Metadatum",
- "format": "object",
- "required": []
- },
- "format": "array"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "status",
- "result"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/mongodb/v0/config/tasks.yaml b/pkg/component/data/mongodb/v0/config/tasks.yaml
new file mode 100644
index 000000000..64ce223e6
--- /dev/null
+++ b/pkg/component/data/mongodb/v0/config/tasks.yaml
@@ -0,0 +1,714 @@
+TASK_INSERT:
+ shortDescription: Perform an insert operation
+ input:
+ uiOrder: 0
+ properties:
+ database-name:
+ description: The name of the database in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Database Name
+ format: string
+ collection-name:
+ description: The name of the collection in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the document.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: ID
+ format: string
+ data:
+ description: The data to be inserted.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 3
+ title: Data
+ required: []
+ format: object
+ required:
+ - database-name
+ - collection-name
+ - data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Insert status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_INSERT_MANY:
+ shortDescription: Perform an insert many operation
+ input:
+ uiOrder: 0
+ properties:
+ database-name:
+ description: The name of the database in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Database Name
+ format: string
+ collection-name:
+ description: The name of the collection in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Collection Name
+ format: string
+ array-id:
+ description: The array of id.
+ acceptFormats:
+ - array
+ uiOrder: 2
+ items:
+ description: An id of the document.
+ example: 1
+ format: string
+ minItems: 1
+ title: Array ID
+ format: array
+ array-data:
+ description: The array data to be inserted.
+ acceptFormats:
+ - array
+ - array
+ - array
+ - array
+ uiOrder: 3
+ title: Data
+ items:
+ description: The data to be inserted.
+ title: Data
+ required: []
+ format: object
+ minItems: 1
+ format: array
+ required:
+ - database-name
+ - collection-name
+ - array-data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Insert many status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_FIND:
+ shortDescription: Perform a find operation
+ input:
+ uiOrder: 0
+ properties:
+ database-name:
+ description: The name of the database in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Database Name
+ format: string
+ collection-name:
+ description: The name of the collection in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the document.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: ID
+ format: string
+ filter:
+ description: The filter to find documents, please refer to [the documentations](https://www.mongodb.com/docs/manual/reference/operator/query/).
+ If empty then all documents will be returned.
+ acceptFormats:
+ - json
+ - object
+ shortDescription: The mongodb language query to filter the documents, empty
+ for no filter
+ uiOrder: 3
+ title: Filter
+ required: []
+ format: object
+ limit:
+ description: The number of documents to return. If empty then all documents
+ will be returned.
+ acceptFormats:
+ - integer
+ shortDescription: Limit the documents, empty for all documents
+ uiOrder: 4
+ title: Limit
+ format: integer
+ fields:
+ description: The fields to return in the documents. If empty then all fields
+ will be returned.
+ acceptFormats:
+ - array
+ shortDescription: Fields to be returned, empty for all fields
+ uiOrder: 5
+ title: Fields
+ items:
+ title: Field
+ format: string
+ minItems: 1
+ format: array
+ required:
+ - database-name
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Find status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ result:
+ description: Result of the find operation.
+ uiOrder: 0
+ title: Result
+ properties:
+ ids:
+ description: The ids returned from the find operation.
+ uiOrder: 0
+ title: IDs
+ required: []
+ items:
+ description: An id of the document.
+ example: c8faa-4b3b-4b3b-4b3b
+ format: string
+ format: array
+ documents:
+ description: The documents returned from the find operation.
+ uiOrder: 1
+ required: []
+ title: Documents
+ items:
+ title: Document
+ format: object
+ required: []
+ format: array
+ data:
+ description: The data returned from the find operation.
+ uiOrder: 2
+ title: Metadata
+ required: []
+ items:
+ title: Datum
+ format: object
+ required: []
+ format: array
+ required: []
+ format: object
+ required:
+ - status
+ - result
+ title: Output
+ format: object
+TASK_UPDATE:
+ shortDescription: Perform an update operation
+ input:
+ uiOrder: 0
+ properties:
+ database-name:
+ description: The name of the database in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Database Name
+ format: string
+ collection-name:
+ description: The name of the collection in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the document.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: ID
+ format: string
+ filter:
+ description: The filter to update documents, please refer to [the documentations](https://www.mongodb.com/docs/manual/reference/operator/query/).
+ If empty then all documents will be returned.
+ acceptFormats:
+ - json
+ - object
+ shortDescription: The mongodb language query to filter the documents
+ uiOrder: 3
+ title: Filter
+ required: []
+ format: object
+ update-data:
+ description: The updated data to be applied to the documents.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 4
+ title: Update
+ required: []
+ format: object
+ required:
+ - database-name
+ - collection-name
+ - update-data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Update status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DELETE:
+ shortDescription: Perform a delete operation
+ input:
+ uiOrder: 0
+ properties:
+ database-name:
+ description: The name of the database in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Database Name
+ format: string
+ collection-name:
+ description: The name of the collection in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the document.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: ID
+ format: string
+ filter:
+ description: The filter to delete documents, please refer to [the documentations](https://www.mongodb.com/docs/manual/reference/operator/query/).
+ If empty then all documents will be returned.
+ acceptFormats:
+ - json
+ - object
+ shortDescription: The mongodb language query to filter the documents
+ uiOrder: 3
+ title: Filter
+ required: []
+ format: object
+ required:
+ - database-name
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DROP_COLLECTION:
+ shortDescription: Delete the collection
+ input:
+ uiOrder: 0
+ properties:
+ database-name:
+ description: The name of the database in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Database Name
+ format: string
+ collection-name:
+ description: The name of the collection in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Collection Name
+ format: string
+ required:
+ - database-name
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete collection status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DROP_DATABASE:
+ shortDescription: Delete the database
+ input:
+ uiOrder: 0
+ properties:
+ database-name:
+ description: The name of the database in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Database Name
+ format: string
+ required:
+ - database-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete database status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_CREATE_SEARCH_INDEX:
+ shortDescription: Create a search index, only works for M10 or larger clusters
+ input:
+ uiOrder: 0
+ properties:
+ database-name:
+ description: The name of the database in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Database Name
+ format: string
+ collection-name:
+ description: The name of the collection in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Collection Name
+ format: string
+ index-name:
+ description: The name of the index to be created.
+ acceptFormats:
+ - string
+ shortDescription: Index Name
+ uiOrder: 2
+ title: Index Name
+ format: string
+ index-type:
+ description: The type of the index to be created.
+ acceptFormats:
+ - string
+ shortDescription: Index Type
+ uiOrder: 3
+ enum:
+ - search
+ - vectorSearch
+ title: Index Type
+ format: string
+ syntax:
+ description: The syntax structure of the search index, please refer to the
+ MongoDB documentation for more information. search [here](https://www.mongodb.com/docs/atlas/atlas-search/create-index/).
+ vectorSearch [here](https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/).
+ acceptFormats:
+ - json
+ - object
+ shortDescription: Syntax Structure, please refer to the MongoDB documentation
+ uiOrder: 4
+ title: Syntax
+ required: []
+ format: object
+ required:
+ - database-name
+ - collection-name
+ - index-type
+ - index-name
+ - syntax
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Create index status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DROP_SEARCH_INDEX:
+ shortDescription: Drop a search index, only works for M10 or larger clusters
+ input:
+ uiOrder: 0
+ properties:
+ database-name:
+ description: The name of the database in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Database Name
+ format: string
+ collection-name:
+ description: The name of the collection in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Collection Name
+ format: string
+ index-name:
+ description: The name of the index to be dropped.
+ acceptFormats:
+ - string
+ shortDescription: Index Name
+ uiOrder: 2
+ title: Index Name
+ format: string
+ required:
+ - database-name
+ - collection-name
+ - index-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete index status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_VECTOR_SEARCH:
+ shortDescription: Perform a vector search operation
+ input:
+ uiOrder: 0
+ properties:
+ database-name:
+ description: The name of the database in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Database Name
+ format: string
+ collection-name:
+ description: The name of the collection in MongoDB.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Collection Name
+ format: string
+ index-name:
+ description: The name of the index to be used for vector search.
+ acceptFormats:
+ - string
+ shortDescription: Index Name
+ uiOrder: 2
+ title: Index Name
+ format: string
+ query-vector:
+ description: The query vector to be used for vector search.
+ acceptFormats:
+ - array
+ - array
+ shortDescription: Query Vector
+ uiOrder: 3
+ title: Query Vector
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ format: array
+ exact:
+ description: The exact value for vector search. If true, then ENN search will
+ be performed, otherwise ANN search will be performed. Default to false.
+ acceptFormats:
+ - boolean
+ shortDescription: Exact Search, true for ENN search, false for ANN search
+ uiOrder: 4
+ title: Exact
+ default: false
+ format: boolean
+ limit:
+ description: Limit the documents to be returned.
+ acceptFormats:
+ - integer
+ shortDescription: Limit Documents
+ uiOrder: 5
+ title: Limit
+ format: integer
+ num-candidates:
+ description: The number of candidates to the field to be used for vector search.
+ Default to 3 times limit.
+ acceptFormats:
+ - integer
+ shortDescription: Number of Candidates, default to 3 times limit
+ uiOrder: 6
+ title: Number of Candidates
+ format: integer
+ path:
+ description: The path to the field to be used for vector search.
+ acceptFormats:
+ - string
+ shortDescription: Path, need to first create vectorSearch search index
+ uiOrder: 7
+ title: Path
+ format: string
+ filter:
+ description: The filter to be used for vector search, need to first create
+ filter vectorSearch search index, please refer to [the documentations](https://www.mongodb.com/docs/manual/reference/operator/query/).
+ If empty then all documents will be returned to be used for vector search.
+ acceptFormats:
+ - json
+ - object
+ shortDescription: The mongodb language query to filter the documents, empty
+ for all documents
+ uiOrder: 8
+ title: Filter
+ required: []
+ format: object
+ fields:
+ description: The fields to return in the documents. If empty then all fields
+ will be returned.
+ acceptFormats:
+ - array
+ shortDescription: Fields to be returned, empty for all fields
+ uiOrder: 9
+ title: Fields
+ items:
+ title: Field
+ format: string
+ minItems: 1
+ format: array
+ required:
+ - database-name
+ - collection-name
+ - index-name
+ - query-vector
+ - path
+ - limit
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Vector search status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ result:
+ description: Result of the vector search operation.
+ uiOrder: 0
+ title: Result
+ properties:
+ ids:
+ description: The ids returned from the vector search operation.
+ uiOrder: 0
+ title: IDs
+ required: []
+ items:
+ description: An id of the document.
+ example: c8faa-4b3b-4b3b-4b3b
+ format: string
+ format: array
+ documents:
+ description: The documents returned from the vector search operation.
+ uiOrder: 1
+ required: []
+ title: Documents
+ items:
+ title: Document
+ format: object
+ required: []
+ format: array
+ vectors:
+ description: The vectors returned from the vector search operation.
+ uiOrder: 2
+ title: Vectors
+ required: []
+ items:
+ description: The vector from array vectors.
+ required: []
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ format: array
+ format: array
+ metadata:
+ description: The metadata returned from the vector search operation.
+ uiOrder: 3
+ title: Metadata
+ required: []
+ items:
+ title: Metadatum
+ format: object
+ required: []
+ format: array
+ required: []
+ format: object
+ required:
+ - status
+ - result
+ title: Output
+ format: object
diff --git a/pkg/component/data/mongodb/v0/main.go b/pkg/component/data/mongodb/v0/main.go
index 56336ee2f..eb9a0ee40 100644
--- a/pkg/component/data/mongodb/v0/main.go
+++ b/pkg/component/data/mongodb/v0/main.go
@@ -29,14 +29,14 @@ const (
TaskVectorSearch = "TASK_VECTOR_SEARCH"
)
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -85,7 +85,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/pinecone/v0/README.mdx b/pkg/component/data/pinecone/v0/README.mdx
index 1b38c9674..0a4a2497b 100644
--- a/pkg/component/data/pinecone/v0/README.mdx
+++ b/pkg/component/data/pinecone/v0/README.mdx
@@ -22,7 +22,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/pinecone/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/pinecone/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/pinecone/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/pinecone/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/pinecone/v0/config/definition.json b/pkg/component/data/pinecone/v0/config/definition.json
deleted file mode 100644
index a35bd3595..000000000
--- a/pkg/component/data/pinecone/v0/config/definition.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "availableTasks": [
- "TASK_QUERY",
- "TASK_UPSERT",
- "TASK_BATCH_UPSERT",
- "TASK_RERANK"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/data/pinecone",
- "icon": "assets/pinecone.svg",
- "iconUrl": "https://www.pinecone.io/favicon.ico",
- "id": "pinecone",
- "public": true,
- "title": "Pinecone",
- "description": "Build and search vector datasets.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "4b1dcf82-e134-4ba7-992f-f9a02536ec2b",
- "vendor": "Pinecone",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/pinecone/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/pinecone/v0/config/definition.yaml b/pkg/component/data/pinecone/v0/config/definition.yaml
new file mode 100644
index 000000000..862b507f7
--- /dev/null
+++ b/pkg/component/data/pinecone/v0/config/definition.yaml
@@ -0,0 +1,21 @@
+availableTasks:
+- TASK_QUERY
+- TASK_UPSERT
+- TASK_BATCH_UPSERT
+- TASK_RERANK
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/data/pinecone
+icon: assets/pinecone.svg
+iconUrl: https://www.pinecone.io/favicon.ico
+id: pinecone
+public: true
+title: Pinecone
+description: Build and search vector datasets.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: 4b1dcf82-e134-4ba7-992f-f9a02536ec2b
+vendor: Pinecone
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/pinecone/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/pinecone/v0/config/setup.json b/pkg/component/data/pinecone/v0/config/setup.json
deleted file mode 100644
index 9960c170b..000000000
--- a/pkg/component/data/pinecone/v0/config/setup.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Pinecone AI API key. You can create an api key in Pinecone Console.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- },
- "url": {
- "description": "Fill in your Pinecone index URL. It is in the form.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 1,
- "title": "Pinecone Index URL",
- "format": "string"
- }
- },
- "required": [
- "api-key"
- ],
- "title": "Pinecone Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/pinecone/v0/config/setup.yaml b/pkg/component/data/pinecone/v0/config/setup.yaml
new file mode 100644
index 000000000..1452c66f6
--- /dev/null
+++ b/pkg/component/data/pinecone/v0/config/setup.yaml
@@ -0,0 +1,23 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Pinecone AI API key. You can create an api key in Pinecone
+ Console.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: API Key
+ format: string
+ url:
+ description: Fill in your Pinecone index URL. It is in the form.
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 1
+ title: Pinecone Index URL
+ format: string
+required:
+- api-key
+title: Pinecone Connection
+format: object
diff --git a/pkg/component/data/pinecone/v0/config/tasks.json b/pkg/component/data/pinecone/v0/config/tasks.json
deleted file mode 100644
index ac8558f59..000000000
--- a/pkg/component/data/pinecone/v0/config/tasks.json
+++ /dev/null
@@ -1,407 +0,0 @@
-{
- "TASK_QUERY": {
- "shortDescription": "Retrieve the ids of the most similar items in a namespace, along with their similarity scores.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "id": {
- "description": "The unique ID of the vector to be used as a query vector. If present, the vector parameter will be ignored.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Query by vector ID instead of by vector",
- "uiOrder": 0,
- "title": "ID",
- "format": "string"
- },
- "vector": {
- "description": "An array of dimensions for the query vector.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Vector",
- "format": "array"
- },
- "top-k": {
- "description": "The number of results to return for each query.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "title": "Top K",
- "format": "integer"
- },
- "namespace": {
- "description": "The namespace to query.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Namespace",
- "format": "string"
- },
- "filter": {
- "description": "The filter to apply. You can use vector metadata to limit your search. See more details here.",
- "acceptFormats": [
- "json"
- ],
- "shortDescription": "The filter to apply on vector metadata",
- "uiOrder": 4,
- "order": 1,
- "required": [],
- "title": "Filter",
- "format": "object"
- },
- "min-score": {
- "description": "Exclude results whose score is below this value.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 5,
- "title": "Minimum Score",
- "format": "number"
- },
- "include-metadata": {
- "default": false,
- "description": "Indicates whether metadata is included in the response as well as the IDs.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 6,
- "title": "Include Metadata",
- "format": "boolean"
- },
- "include-values": {
- "default": false,
- "description": "Indicates whether vector values are included in the response.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 7,
- "title": "Include Values",
- "format": "boolean"
- }
- },
- "required": [
- "top-k",
- "vector"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "matches": {
- "description": "The matches returned for the query.",
- "uiOrder": 1,
- "items": {
- "properties": {
- "id": {
- "description": "The ID of the matched vector.",
- "uiOrder": 0,
- "title": "ID",
- "format": "string"
- },
- "metadata": {
- "description": "Metadata.",
- "uiOrder": 3,
- "required": [],
- "title": "Metadata",
- "format": "json"
- },
- "score": {
- "description": "A measure of similarity between this vector and the query vector. The higher the score, the more similar they are.",
- "uiOrder": 1,
- "title": "Score",
- "format": "number"
- },
- "values": {
- "description": "Vector data values.",
- "uiOrder": 2,
- "items": {
- "description": "Each float value represents one dimension.",
- "title": "Value",
- "format": "number"
- },
- "title": "Values",
- "format": "array"
- }
- },
- "required": [
- "id",
- "score"
- ],
- "title": "Match",
- "format": "object"
- },
- "title": "Matches",
- "format": "array"
- },
- "namespace": {
- "description": "The namespace of the query.",
- "uiOrder": 0,
- "title": "Namespace",
- "format": "string"
- }
- },
- "required": [
- "namespace",
- "matches"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPSERT": {
- "shortDescription": "Writes vectors into a namespace. If a new value is upserted for an existing vector id, it will overwrite the previous value.",
- "description": "Writes vectors into a namespace. If a new value is upserted for an existing vector id, it will overwrite the previous value. This task will be soon replaced by `TASK_BATCH_UPSERT`, which extends its functionality.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "id": {
- "description": "This is the vector's unique id.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "ID",
- "format": "string"
- },
- "metadata": {
- "description": "The vector metadata.",
- "acceptFormats": [
- "json"
- ],
- "shortDescription": "The vector metadata",
- "uiOrder": 3,
- "order": 1,
- "required": [],
- "title": "Metadata",
- "format": "object"
- },
- "values": {
- "description": "An array of dimensions for the vector to be saved.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Values",
- "format": "array"
- },
- "namespace": {
- "description": "The namespace to query.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Namespace",
- "format": "string"
- }
- },
- "required": [
- "id",
- "values"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "upserted-count": {
- "description": "Number of records modified or added.",
- "uiOrder": 0,
- "title": "Upserted Count",
- "format": "integer"
- }
- },
- "required": [
- "upserted-count"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_BATCH_UPSERT": {
- "shortDescription": "Writes vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "vectors": {
- "description": "Array of vectors to upsert",
- "uiOrder": 0,
- "items": {
- "properties": {
- "id": {
- "description": "The unique ID of the vector.",
- "uiOrder": 0,
- "acceptFormats": [
- "string"
- ],
- "title": "ID",
- "format": "string"
- },
- "metadata": {
- "description": "The vector metadata. This is a set of key-value pairs that can be used to store additional information about the vector. The values can have the following types: string, number, boolean, or array of strings.",
- "uiOrder": 1,
- "acceptFormats": [
- "json"
- ],
- "shortDescription": "The vector metadata",
- "required": [],
- "title": "Metadata",
- "format": "object"
- },
- "values": {
- "description": "An array of dimensions for the vector to be saved.",
- "uiOrder": 2,
- "acceptFormats": [
- "array",
- "array"
- ],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Values",
- "format": "array"
- }
- },
- "required": [
- "id",
- "values"
- ],
- "format": "object"
- },
- "minItems": 1,
- "title": "Vectors",
- "format": "array"
- },
- "namespace": {
- "description": "The namespace to query.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Namespace",
- "format": "string"
- }
- },
- "required": [
- "vectors"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "upserted-count": {
- "description": "Number of records modified or added.",
- "uiOrder": 0,
- "title": "Upserted Count",
- "format": "integer"
- }
- },
- "required": [
- "upserted-count"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_RERANK": {
- "shortDescription": "Rerank documents, such as text passages, according to their relevance to a query.",
- "description": "Rerank documents, such as text passages, according to their relevance to a query. The input is a list of documents and a query. The output is a list of documents, sorted by relevance to the query.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "query": {
- "description": "The query to rerank the documents.",
- "acceptFormats": [
- "string"
- ],
- "instullUIMultiline": false,
- "uiOrder": 0,
- "title": "Query",
- "format": "string"
- },
- "documents": {
- "description": "The documents to rerank.",
- "uiOrder": 1,
- "items": {
- "format": "string"
- },
- "minItems": 1,
- "title": "Documents",
- "format": "array"
- },
- "top-n": {
- "description": "The number of results to return sorted by relevance. Defaults to the number of inputs.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "title": "Top N",
- "format": "integer"
- }
- },
- "required": [
- "query",
- "documents"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "documents": {
- "description": "Reranked documents.",
- "items": {
- "title": "Documents",
- "format": "string"
- },
- "uiOrder": 0,
- "title": "Reranked documents.",
- "format": "array"
- },
- "scores": {
- "description": "The relevance score of the documents normalized between 0 and 1.",
- "items": {
- "title": "Score",
- "format": "number"
- },
- "uiOrder": 1,
- "title": "Scores",
- "format": "array"
- }
- },
- "required": [
- "documents",
- "scores"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/pinecone/v0/config/tasks.yaml b/pkg/component/data/pinecone/v0/config/tasks.yaml
new file mode 100644
index 000000000..febfe4b4c
--- /dev/null
+++ b/pkg/component/data/pinecone/v0/config/tasks.yaml
@@ -0,0 +1,333 @@
+TASK_QUERY:
+ shortDescription: Retrieve the ids of the most similar items in a namespace, along
+ with their similarity scores.
+ input:
+ uiOrder: 0
+ properties:
+ id:
+ description: The unique ID of the vector to be used as a query vector. If
+ present, the vector parameter will be ignored.
+ acceptFormats:
+ - string
+ shortDescription: Query by vector ID instead of by vector
+ uiOrder: 0
+ title: ID
+ format: string
+ vector:
+ description: An array of dimensions for the query vector.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 1
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Vector
+ format: array
+ top-k:
+ description: The number of results to return for each query.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: Top K
+ format: integer
+ namespace:
+ description: The namespace to query.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Namespace
+ format: string
+ filter:
+ description: The filter to apply. You can use vector metadata to limit your
+ search. See more details here.
+ acceptFormats:
+ - json
+ shortDescription: The filter to apply on vector metadata
+ uiOrder: 4
+ order: 1
+ required: []
+ title: Filter
+ format: object
+ min-score:
+ description: Exclude results whose score is below this value.
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 5
+ title: Minimum Score
+ format: number
+ include-metadata:
+ default: false
+ description: Indicates whether metadata is included in the response as well
+ as the IDs.
+ acceptFormats:
+ - boolean
+ uiOrder: 6
+ title: Include Metadata
+ format: boolean
+ include-values:
+ default: false
+ description: Indicates whether vector values are included in the response.
+ acceptFormats:
+ - boolean
+ uiOrder: 7
+ title: Include Values
+ format: boolean
+ required:
+ - top-k
+ - vector
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ matches:
+ description: The matches returned for the query.
+ uiOrder: 1
+ items:
+ properties:
+ id:
+ description: The ID of the matched vector.
+ uiOrder: 0
+ title: ID
+ format: string
+ metadata:
+ description: Metadata.
+ uiOrder: 3
+ required: []
+ title: Metadata
+ format: json
+ score:
+ description: A measure of similarity between this vector and the query
+ vector. The higher the score, the more similar they are.
+ uiOrder: 1
+ title: Score
+ format: number
+ values:
+ description: Vector data values.
+ uiOrder: 2
+ items:
+ description: Each float value represents one dimension.
+ title: Value
+ format: number
+ title: Values
+ format: array
+ required:
+ - id
+ - score
+ title: Match
+ format: object
+ title: Matches
+ format: array
+ namespace:
+ description: The namespace of the query.
+ uiOrder: 0
+ title: Namespace
+ format: string
+ required:
+ - namespace
+ - matches
+ title: Output
+ format: object
+TASK_UPSERT:
+ shortDescription: Writes vectors into a namespace. If a new value is upserted for
+ an existing vector id, it will overwrite the previous value.
+ description: Writes vectors into a namespace. If a new value is upserted for an
+ existing vector id, it will overwrite the previous value. This task will be soon
+ replaced by `TASK_BATCH_UPSERT`, which extends its functionality.
+ input:
+ uiOrder: 0
+ properties:
+ id:
+ description: This is the vector's unique id.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: ID
+ format: string
+ metadata:
+ description: The vector metadata.
+ acceptFormats:
+ - json
+ shortDescription: The vector metadata
+ uiOrder: 3
+ order: 1
+ required: []
+ title: Metadata
+ format: object
+ values:
+ description: An array of dimensions for the vector to be saved.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 1
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Values
+ format: array
+ namespace:
+ description: The namespace to query.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Namespace
+ format: string
+ required:
+ - id
+ - values
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ upserted-count:
+ description: Number of records modified or added.
+ uiOrder: 0
+ title: Upserted Count
+ format: integer
+ required:
+ - upserted-count
+ title: Output
+ format: object
+TASK_BATCH_UPSERT:
+ shortDescription: Writes vectors into a namespace. If a new value is upserted for
+ an existing vector ID, it will overwrite the previous value.
+ input:
+ uiOrder: 0
+ properties:
+ vectors:
+ description: Array of vectors to upsert
+ uiOrder: 0
+ items:
+ properties:
+ id:
+ description: The unique ID of the vector.
+ uiOrder: 0
+ acceptFormats:
+ - string
+ title: ID
+ format: string
+ metadata:
+ description: 'The vector metadata. This is a set of key-value pairs
+ that can be used to store additional information about the vector.
+ The values can have the following types: string, number, boolean,
+ or array of strings.'
+ uiOrder: 1
+ acceptFormats:
+ - json
+ shortDescription: The vector metadata
+ required: []
+ title: Metadata
+ format: object
+ values:
+ description: An array of dimensions for the vector to be saved.
+ uiOrder: 2
+ acceptFormats:
+ - array
+ - array
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Values
+ format: array
+ required:
+ - id
+ - values
+ format: object
+ minItems: 1
+ title: Vectors
+ format: array
+ namespace:
+ description: The namespace to query.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Namespace
+ format: string
+ required:
+ - vectors
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ upserted-count:
+ description: Number of records modified or added.
+ uiOrder: 0
+ title: Upserted Count
+ format: integer
+ required:
+ - upserted-count
+ title: Output
+ format: object
+TASK_RERANK:
+ shortDescription: Rerank documents, such as text passages, according to their relevance
+ to a query.
+ description: Rerank documents, such as text passages, according to their relevance
+ to a query. The input is a list of documents and a query. The output is a list
+ of documents, sorted by relevance to the query.
+ input:
+ uiOrder: 0
+ properties:
+ query:
+ description: The query to rerank the documents.
+ acceptFormats:
+ - string
+ instullUIMultiline: false
+ uiOrder: 0
+ title: Query
+ format: string
+ documents:
+ description: The documents to rerank.
+ uiOrder: 1
+ items:
+ format: string
+ minItems: 1
+ title: Documents
+ format: array
+ top-n:
+ description: The number of results to return sorted by relevance. Defaults
+ to the number of inputs.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: Top N
+ format: integer
+ required:
+ - query
+ - documents
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ documents:
+ description: Reranked documents.
+ items:
+ title: Documents
+ format: string
+ uiOrder: 0
+ title: Reranked documents.
+ format: array
+ scores:
+ description: The relevance score of the documents normalized between 0 and
+ 1.
+ items:
+ title: Score
+ format: number
+ uiOrder: 1
+ title: Scores
+ format: array
+ required:
+ - documents
+ - scores
+ title: Output
+ format: object
diff --git a/pkg/component/data/pinecone/v0/main.go b/pkg/component/data/pinecone/v0/main.go
index 9a594a7e4..01f25bd6d 100644
--- a/pkg/component/data/pinecone/v0/main.go
+++ b/pkg/component/data/pinecone/v0/main.go
@@ -25,14 +25,14 @@ const (
rerankPath = "/rerank"
)
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -51,7 +51,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/qdrant/v0/README.mdx b/pkg/component/data/qdrant/v0/README.mdx
index 1eef22896..512e5efce 100644
--- a/pkg/component/data/qdrant/v0/README.mdx
+++ b/pkg/component/data/qdrant/v0/README.mdx
@@ -24,7 +24,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/qdrant/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/qdrant/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/qdrant/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/qdrant/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/qdrant/v0/config/definition.json b/pkg/component/data/qdrant/v0/config/definition.json
deleted file mode 100644
index d00fdcbff..000000000
--- a/pkg/component/data/qdrant/v0/config/definition.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "availableTasks": [
- "TASK_VECTOR_SEARCH",
- "TASK_BATCH_UPSERT",
- "TASK_UPSERT",
- "TASK_DELETE",
- "TASK_CREATE_COLLECTION",
- "TASK_DELETE_COLLECTION"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/data/qdrant",
- "icon": "assets/qdrant.svg",
- "id": "qdrant",
- "public": true,
- "title": "Qdrant",
- "description": "Build and search vector datasets.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "628c91b8-1cf0-4141-b9e4-256b2ed109f2",
- "vendor": "Qdrant",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/qdrant/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/qdrant/v0/config/definition.yaml b/pkg/component/data/qdrant/v0/config/definition.yaml
new file mode 100644
index 000000000..e7941ca59
--- /dev/null
+++ b/pkg/component/data/qdrant/v0/config/definition.yaml
@@ -0,0 +1,21 @@
+availableTasks:
+- TASK_VECTOR_SEARCH
+- TASK_BATCH_UPSERT
+- TASK_UPSERT
+- TASK_DELETE
+- TASK_CREATE_COLLECTION
+- TASK_DELETE_COLLECTION
+documentationUrl: https://www.instill.tech/docs/component/data/qdrant
+icon: assets/qdrant.svg
+id: qdrant
+public: true
+title: Qdrant
+description: Build and search vector datasets.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: 628c91b8-1cf0-4141-b9e4-256b2ed109f2
+vendor: Qdrant
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/qdrant/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/qdrant/v0/config/setup.json b/pkg/component/data/qdrant/v0/config/setup.json
deleted file mode 100644
index d3bba51bb..000000000
--- a/pkg/component/data/qdrant/v0/config/setup.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Qdrant API key. Please refer to clusters in Qdrant data access control.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- },
- "url": {
- "description": "Fill in your Qdrant URL endpoint. Please refer to clusters in Qdrant cluster details.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 1,
- "title": "Qdrant URL Endpoint",
- "format": "string"
- }
- },
- "required": [
- "api-key",
- "url"
- ],
- "title": "Qdrant Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/qdrant/v0/config/setup.yaml b/pkg/component/data/qdrant/v0/config/setup.yaml
new file mode 100644
index 000000000..3c8acffbe
--- /dev/null
+++ b/pkg/component/data/qdrant/v0/config/setup.yaml
@@ -0,0 +1,25 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Qdrant API key. Please refer to clusters in Qdrant data
+ access control.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: API Key
+ format: string
+ url:
+ description: Fill in your Qdrant URL endpoint. Please refer to clusters in Qdrant
+ cluster details.
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 1
+ title: Qdrant URL Endpoint
+ format: string
+required:
+- api-key
+- url
+title: Qdrant Connection
+format: object
diff --git a/pkg/component/data/qdrant/v0/config/tasks.json b/pkg/component/data/qdrant/v0/config/tasks.json
deleted file mode 100644
index cbc1c3e8d..000000000
--- a/pkg/component/data/qdrant/v0/config/tasks.json
+++ /dev/null
@@ -1,541 +0,0 @@
-{
- "TASK_VECTOR_SEARCH": {
- "shortDescription": "Perform a vector search on a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to perform vector similarity search on.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "vector": {
- "description": "An array of dimensions for the vector query.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Vector",
- "format": "array"
- },
- "limit": {
- "description": "The limit of points, empty for all points.",
- "acceptFormats": [
- "integer"
- ],
- "shortDescription": "Limit Rows",
- "uiOrder": 2,
- "title": "Limit",
- "format": "integer"
- },
- "payloads": {
- "description": "The payloads to return in the points. If empty then all payloads will be returned.",
- "acceptFormats": [
- "array"
- ],
- "shortDescription": "Payloads to be returned, empty for all payloads",
- "uiOrder": 3,
- "title": "Payloads",
- "minItems": 1,
- "items": {
- "title": "Field",
- "format": "string"
- },
- "format": "array"
- },
- "filter": {
- "description": "The properties filter to be applied to the data with Qdrant filter, please refer to [filter section](https://api.qdrant.tech/api-reference/search/points).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 4,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "params": {
- "description": "The additional parameters to be passed to the search, please refer to [params section](https://api.qdrant.tech/api-reference/search/points).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 5,
- "title": "Params",
- "required": [],
- "format": "object"
- },
- "min-score": {
- "description": "The minimum score of the points to be returned.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 6,
- "title": "Min Score",
- "format": "number"
- }
- },
- "required": [
- "collection-name",
- "vector",
- "limit"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Vector search status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- },
- "result": {
- "description": "Result of the vector search operation.",
- "uiOrder": 0,
- "title": "Result",
- "properties": {
- "ids": {
- "description": "The ids returned from the vector search operation.",
- "uiOrder": 0,
- "title": "IDs",
- "required": [],
- "items": {
- "description": "An id of the point.",
- "example": "c8faa-4b3b-4b3b-4b3b",
- "format": "string"
- },
- "format": "array"
- },
- "points": {
- "description": "The points returned from the vector search operation.",
- "uiOrder": 1,
- "required": [],
- "title": "Points",
- "items": {
- "title": "Point",
- "format": "object",
- "required": []
- },
- "format": "array"
- },
- "vectors": {
- "description": "The vectors returned from the vector search operation.",
- "uiOrder": 2,
- "title": "Vectors",
- "required": [],
- "items": {
- "description": "The vector from array vectors.",
- "required": [],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "format": "array"
- },
- "format": "array"
- },
- "metadata": {
- "description": "The metadata returned from the vector search operation.",
- "uiOrder": 3,
- "title": "Metadata",
- "required": [],
- "items": {
- "title": "Metadatum",
- "format": "object",
- "required": []
- },
- "format": "array"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "status",
- "result"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_BATCH_UPSERT": {
- "shortDescription": "Insert multiple vector points into a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to upsert the point into.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "array-id": {
- "description": "The array of id.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "An id of the point.",
- "example": 1,
- "format": "string"
- },
- "minItems": 1,
- "title": "Array ID",
- "format": "array"
- },
- "array-metadata": {
- "description": "The array of vector metadata payload.",
- "acceptFormats": [
- "array",
- "array",
- "array",
- "array"
- ],
- "uiOrder": 2,
- "minItems": 1,
- "title": "Array Metadata",
- "items": {
- "description": "The vector metadata payload.",
- "title": "Metadatum",
- "required": [],
- "format": "object"
- },
- "format": "array"
- },
- "array-vector": {
- "description": "The array of vector values.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "description": "An array of dimensions for the vector value.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "format": "array"
- },
- "minItems": 1,
- "title": "Array Vector",
- "format": "array"
- },
- "ordering": {
- "description": "The ordering guarantees of the batch upsert.",
- "acceptFormats": [
- "string"
- ],
- "default": "weak",
- "uiOrder": 4,
- "title": "Ordering",
- "enum": [
- "weak",
- "medium",
- "strong"
- ],
- "format": "string"
- }
- },
- "required": [
- "collection-name",
- "array-id",
- "array-vector"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Batch upsert status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPSERT": {
- "shortDescription": "Upsert a vector point into a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to upsert the point into.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the point.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- },
- "metadata": {
- "description": "The vector metadata payload.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 2,
- "title": "Metadata",
- "required": [],
- "format": "object"
- },
- "vector": {
- "description": "An array of dimensions for the vector value.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Vector",
- "format": "array"
- },
- "ordering": {
- "description": "The ordering guarantees of the batch upsert.",
- "acceptFormats": [
- "string"
- ],
- "default": "weak",
- "uiOrder": 4,
- "title": "Ordering",
- "enum": [
- "weak",
- "medium",
- "strong"
- ],
- "format": "string"
- }
- },
- "required": [
- "collection-name",
- "id",
- "vector"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Upsert status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE": {
- "shortDescription": "Delete vector points from a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to delete the object from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the point.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- },
- "filter": {
- "description": "The properties filter to be applied to the data with Qdrant filter, please refer to [filter section](https://api.qdrant.tech/api-reference/points/delete-points).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 2,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "ordering": {
- "description": "The ordering guarantees of the batch upsert.",
- "acceptFormats": [
- "string"
- ],
- "default": "weak",
- "uiOrder": 3,
- "title": "Ordering",
- "enum": [
- "weak",
- "medium",
- "strong"
- ],
- "format": "string"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_COLLECTION": {
- "shortDescription": "Create a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to create.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "config": {
- "description": "The configuration of the collection. Please refer to [here](https://api.qdrant.tech/api-reference/collections/create-collection).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 1,
- "title": "Config",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name",
- "config"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Create collection status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE_COLLECTION": {
- "shortDescription": "Delete a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to delete.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete collection status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/qdrant/v0/config/tasks.yaml b/pkg/component/data/qdrant/v0/config/tasks.yaml
new file mode 100644
index 000000000..c8e4359cf
--- /dev/null
+++ b/pkg/component/data/qdrant/v0/config/tasks.yaml
@@ -0,0 +1,426 @@
+TASK_VECTOR_SEARCH:
+ shortDescription: Perform a vector search on a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to perform vector similarity search
+ on.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ vector:
+ description: An array of dimensions for the vector query.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 1
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Vector
+ format: array
+ limit:
+ description: The limit of points, empty for all points.
+ acceptFormats:
+ - integer
+ shortDescription: Limit Rows
+ uiOrder: 2
+ title: Limit
+ format: integer
+ payloads:
+ description: The payloads to return in the points. If empty then all payloads
+ will be returned.
+ acceptFormats:
+ - array
+ shortDescription: Payloads to be returned, empty for all payloads
+ uiOrder: 3
+ title: Payloads
+ minItems: 1
+ items:
+ title: Field
+ format: string
+ format: array
+ filter:
+ description: The properties filter to be applied to the data with Qdrant filter,
+ please refer to [filter section](https://api.qdrant.tech/api-reference/search/points).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 4
+ title: Filter
+ required: []
+ format: object
+ params:
+ description: The additional parameters to be passed to the search, please
+ refer to [params section](https://api.qdrant.tech/api-reference/search/points).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 5
+ title: Params
+ required: []
+ format: object
+ min-score:
+ description: The minimum score of the points to be returned.
+ acceptFormats:
+ - number
+ uiOrder: 6
+ title: Min Score
+ format: number
+ required:
+ - collection-name
+ - vector
+ - limit
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Vector search status.
+ uiOrder: 0
+ title: Status
+ format: string
+ result:
+ description: Result of the vector search operation.
+ uiOrder: 0
+ title: Result
+ properties:
+ ids:
+ description: The ids returned from the vector search operation.
+ uiOrder: 0
+ title: IDs
+ required: []
+ items:
+ description: An id of the point.
+ example: c8faa-4b3b-4b3b-4b3b
+ format: string
+ format: array
+ points:
+ description: The points returned from the vector search operation.
+ uiOrder: 1
+ required: []
+ title: Points
+ items:
+ title: Point
+ format: object
+ required: []
+ format: array
+ vectors:
+ description: The vectors returned from the vector search operation.
+ uiOrder: 2
+ title: Vectors
+ required: []
+ items:
+ description: The vector from array vectors.
+ required: []
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ format: array
+ format: array
+ metadata:
+ description: The metadata returned from the vector search operation.
+ uiOrder: 3
+ title: Metadata
+ required: []
+ items:
+ title: Metadatum
+ format: object
+ required: []
+ format: array
+ required: []
+ format: object
+ required:
+ - status
+ - result
+ title: Output
+ format: object
+TASK_BATCH_UPSERT:
+ shortDescription: Insert multiple vector points into a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to upsert the point into.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ array-id:
+ description: The array of id.
+ acceptFormats:
+ - array
+ uiOrder: 1
+ items:
+ description: An id of the point.
+ example: 1
+ format: string
+ minItems: 1
+ title: Array ID
+ format: array
+ array-metadata:
+ description: The array of vector metadata payload.
+ acceptFormats:
+ - array
+ - array
+ - array
+ - array
+ uiOrder: 2
+ minItems: 1
+ title: Array Metadata
+ items:
+ description: The vector metadata payload.
+ title: Metadatum
+ required: []
+ format: object
+ format: array
+ array-vector:
+ description: The array of vector values.
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ description: An array of dimensions for the vector value.
+ acceptFormats:
+ - array
+ - array
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ format: array
+ minItems: 1
+ title: Array Vector
+ format: array
+ ordering:
+ description: The ordering guarantees of the batch upsert.
+ acceptFormats:
+ - string
+ default: weak
+ uiOrder: 4
+ title: Ordering
+ enum:
+ - weak
+ - medium
+ - strong
+ format: string
+ required:
+ - collection-name
+ - array-id
+ - array-vector
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Batch upsert status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_UPSERT:
+ shortDescription: Upsert a vector point into a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to upsert the point into.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the point.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ metadata:
+ description: The vector metadata payload.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 2
+ title: Metadata
+ required: []
+ format: object
+ vector:
+ description: An array of dimensions for the vector value.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 3
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Vector
+ format: array
+ ordering:
+ description: The ordering guarantees of the batch upsert.
+ acceptFormats:
+ - string
+ default: weak
+ uiOrder: 4
+ title: Ordering
+ enum:
+ - weak
+ - medium
+ - strong
+ format: string
+ required:
+ - collection-name
+ - id
+ - vector
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Upsert status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DELETE:
+ shortDescription: Delete vector points from a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to delete the object from.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the point.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ filter:
+ description: The properties filter to be applied to the data with Qdrant filter,
+ please refer to [filter section](https://api.qdrant.tech/api-reference/points/delete-points).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 2
+ title: Filter
+ required: []
+ format: object
+ ordering:
+ description: The ordering guarantees of the batch upsert.
+ acceptFormats:
+ - string
+ default: weak
+ uiOrder: 3
+ title: Ordering
+ enum:
+ - weak
+ - medium
+ - strong
+ format: string
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_CREATE_COLLECTION:
+ shortDescription: Create a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to create.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ config:
+ description: The configuration of the collection. Please refer to [here](https://api.qdrant.tech/api-reference/collections/create-collection).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 1
+ title: Config
+ required: []
+ format: object
+ required:
+ - collection-name
+ - config
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Create collection status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DELETE_COLLECTION:
+ shortDescription: Delete a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to delete.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete collection status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
diff --git a/pkg/component/data/qdrant/v0/main.go b/pkg/component/data/qdrant/v0/main.go
index 56d6de505..0ffb7d66e 100644
--- a/pkg/component/data/qdrant/v0/main.go
+++ b/pkg/component/data/qdrant/v0/main.go
@@ -24,14 +24,14 @@ const (
TaskDeleteCollection = "TASK_DELETE_COLLECTION"
)
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -50,7 +50,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/redis/v0/README.mdx b/pkg/component/data/redis/v0/README.mdx
index 7b0945e74..5956d7811 100644
--- a/pkg/component/data/redis/v0/README.mdx
+++ b/pkg/component/data/redis/v0/README.mdx
@@ -21,7 +21,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/redis/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/redis/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/redis/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/redis/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/redis/v0/config/definition.json b/pkg/component/data/redis/v0/config/definition.json
deleted file mode 100644
index ef89501d1..000000000
--- a/pkg/component/data/redis/v0/config/definition.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "availableTasks": [
- "TASK_RETRIEVE_CHAT_HISTORY",
- "TASK_WRITE_CHAT_MESSAGE",
- "TASK_WRITE_MULTI_MODAL_CHAT_MESSAGE"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/data/redis",
- "icon": "assets/redis.svg",
- "iconUrl": "",
- "id": "redis",
- "public": true,
- "title": "Redis",
- "description": "Manage data in NoSQL Redis databases.",
- "type": "COMPONENT_TYPE_DATA",
- "uid": "fd0ad325-f2f7-41f3-b247-6c71d571b1b8",
- "vendor": "Redis Labs",
- "vendorAttributes": {},
- "version": "0.1.1",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/redis/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/redis/v0/config/definition.yaml b/pkg/component/data/redis/v0/config/definition.yaml
new file mode 100644
index 000000000..a6a1d01cc
--- /dev/null
+++ b/pkg/component/data/redis/v0/config/definition.yaml
@@ -0,0 +1,19 @@
+availableTasks:
+- TASK_RETRIEVE_CHAT_HISTORY
+- TASK_WRITE_CHAT_MESSAGE
+- TASK_WRITE_MULTI_MODAL_CHAT_MESSAGE
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/data/redis
+icon: assets/redis.svg
+iconUrl: ''
+id: redis
+public: true
+title: Redis
+description: Manage data in NoSQL Redis databases.
+type: COMPONENT_TYPE_DATA
+uid: fd0ad325-f2f7-41f3-b247-6c71d571b1b8
+vendor: Redis Labs
+vendorAttributes: {}
+version: 0.1.1
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/redis/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/redis/v0/config/setup.json b/pkg/component/data/redis/v0/config/setup.json
deleted file mode 100644
index 0fdf20fce..000000000
--- a/pkg/component/data/redis/v0/config/setup.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "host": {
- "default": "localhost",
- "description": "Redis host to connect to.",
- "examples": [
- "localhost,127.0.0.1"
- ],
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 0,
- "title": "Host",
- "format": "string"
- },
- "password": {
- "description": "Password associated with Redis.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 3,
- "title": "Password",
- "format": "string"
- },
- "port": {
- "default": 6379,
- "description": "Port of Redis.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "maximum": 65536,
- "minimum": 0,
- "title": "Port",
- "format": "integer"
- },
- "ssl": {
- "default": false,
- "description": "Indicates whether SSL encryption protocol will be used to connect to Redis. It is recommended to use SSL connection if possible.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 4,
- "title": "SSL Connection",
- "format": "boolean"
- },
- "username": {
- "description": "Username associated with Redis.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Username",
- "format": "string"
- }
- },
- "required": [
- "host",
- "port"
- ],
- "title": "Redis Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/redis/v0/config/setup.yaml b/pkg/component/data/redis/v0/config/setup.yaml
new file mode 100644
index 000000000..211ad3383
--- /dev/null
+++ b/pkg/component/data/redis/v0/config/setup.yaml
@@ -0,0 +1,52 @@
+additionalProperties: false
+properties:
+ host:
+ default: localhost
+ description: Redis host to connect to.
+ examples:
+ - localhost,127.0.0.1
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 0
+ title: Host
+ format: string
+ password:
+ description: Password associated with Redis.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 3
+ title: Password
+ format: string
+ port:
+ default: 6379
+ description: Port of Redis.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ maximum: 65536
+ minimum: 0
+ title: Port
+ format: integer
+ ssl:
+ default: false
+ description: Indicates whether SSL encryption protocol will be used to connect
+ to Redis. It is recommended to use SSL connection if possible.
+ acceptFormats:
+ - boolean
+ uiOrder: 4
+ title: SSL Connection
+ format: boolean
+ username:
+ description: Username associated with Redis.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Username
+ format: string
+required:
+- host
+- port
+title: Redis Connection
+format: object
diff --git a/pkg/component/data/redis/v0/config/tasks.json b/pkg/component/data/redis/v0/config/tasks.json
deleted file mode 100644
index 34412c431..000000000
--- a/pkg/component/data/redis/v0/config/tasks.json
+++ /dev/null
@@ -1,193 +0,0 @@
-{
- "TASK_RETRIEVE_CHAT_HISTORY": {
- "shortDescription": "Retrieve chat history from Redis.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "include-system-message": {
- "default": true,
- "description": "Include system message in the retrieved conversation turns if exists.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 2,
- "title": "Include System Message If Exists",
- "format": "boolean"
- },
- "latest-k": {
- "default": 5,
- "description": "The number of latest conversation turns to retrieve. A conversation turn typically includes one participant speaking or sending a message, and the other participant(s) responding to it.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "minimum": 1,
- "title": "Latest K",
- "format": "integer"
- },
- "session-id": {
- "description": "A unique identifier for the chat session.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Session ID",
- "format": "string"
- }
- },
- "required": [
- "session-id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "messages": {
- "$ref": "schema.json#/$defs/instill-types/chat-messages",
- "description": "Messages.",
- "uiOrder": 0
- }
- },
- "required": [
- "messages"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_WRITE_CHAT_MESSAGE": {
- "shortDescription": "Write chat message into Redis.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "content": {
- "description": "The message content.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Content",
- "format": "string"
- },
- "metadata": {
- "additionalProperties": true,
- "description": "The message metadata.",
- "uiOrder": 3,
- "required": [],
- "title": "Metadata",
- "format": "object"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Role",
- "format": "string"
- },
- "session-id": {
- "description": "A unique identifier for the chat session.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Session ID",
- "format": "string"
- }
- },
- "required": [
- "session-id",
- "role",
- "content"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "The status of the write operation.",
- "uiOrder": 0,
- "title": "Status",
- "format": "boolean"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_WRITE_MULTI_MODAL_CHAT_MESSAGE": {
- "shortDescription": "Write multi-modal chat message into Redis.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "content": {
- "$ref": "schema.json#/$defs/instill-types/multi-modal-content",
- "description": "The multi-modal message content.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 2,
- "title": "Content",
- "format": "string"
- },
- "metadata": {
- "additionalProperties": true,
- "description": "The message metadata.",
- "uiOrder": 3,
- "required": [],
- "title": "Metadata",
- "format": "object"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Role",
- "format": "string"
- },
- "session-id": {
- "description": "A unique identifier for the chat session.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Session ID",
- "format": "string"
- }
- },
- "required": [
- "session-id",
- "role",
- "content"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "The status of the write operation.",
- "uiOrder": 0,
- "title": "Status",
- "format": "boolean"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/redis/v0/config/tasks.yaml b/pkg/component/data/redis/v0/config/tasks.yaml
new file mode 100644
index 000000000..ab98de538
--- /dev/null
+++ b/pkg/component/data/redis/v0/config/tasks.yaml
@@ -0,0 +1,150 @@
+TASK_RETRIEVE_CHAT_HISTORY:
+ shortDescription: Retrieve chat history from Redis.
+ input:
+ uiOrder: 0
+ properties:
+ include-system-message:
+ default: true
+ description: Include system message in the retrieved conversation turns if
+ exists.
+ acceptFormats:
+ - boolean
+ uiOrder: 2
+ title: Include System Message If Exists
+ format: boolean
+ latest-k:
+ default: 5
+ description: The number of latest conversation turns to retrieve. A conversation
+ turn typically includes one participant speaking or sending a message, and
+ the other participant(s) responding to it.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ minimum: 1
+ title: Latest K
+ format: integer
+ session-id:
+ description: A unique identifier for the chat session.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Session ID
+ format: string
+ required:
+ - session-id
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ messages:
+ $ref: schema.yaml#/$defs/instill-types/chat-messages
+ description: Messages.
+ uiOrder: 0
+ required:
+ - messages
+ title: Output
+ format: object
+TASK_WRITE_CHAT_MESSAGE:
+ shortDescription: Write chat message into Redis.
+ input:
+ uiOrder: 0
+ properties:
+ content:
+ description: The message content.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Content
+ format: string
+ metadata:
+ additionalProperties: true
+ description: The message metadata.
+ uiOrder: 3
+ required: []
+ title: Metadata
+ format: object
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Role
+ format: string
+ session-id:
+ description: A unique identifier for the chat session.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Session ID
+ format: string
+ required:
+ - session-id
+ - role
+ - content
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: The status of the write operation.
+ uiOrder: 0
+ title: Status
+ format: boolean
+ required:
+ - status
+ title: Output
+ format: object
+TASK_WRITE_MULTI_MODAL_CHAT_MESSAGE:
+ shortDescription: Write multi-modal chat message into Redis.
+ input:
+ uiOrder: 0
+ properties:
+ content:
+ $ref: schema.yaml#/$defs/instill-types/multi-modal-content
+ description: The multi-modal message content.
+ acceptFormats:
+ - array
+ uiOrder: 2
+ title: Content
+ format: string
+ metadata:
+ additionalProperties: true
+ description: The message metadata.
+ uiOrder: 3
+ required: []
+ title: Metadata
+ format: object
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Role
+ format: string
+ session-id:
+ description: A unique identifier for the chat session.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Session ID
+ format: string
+ required:
+ - session-id
+ - role
+ - content
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: The status of the write operation.
+ uiOrder: 0
+ title: Status
+ format: boolean
+ required:
+ - status
+ title: Output
+ format: object
diff --git a/pkg/component/data/redis/v0/main.go b/pkg/component/data/redis/v0/main.go
index 1333f0113..0ced03b97 100644
--- a/pkg/component/data/redis/v0/main.go
+++ b/pkg/component/data/redis/v0/main.go
@@ -21,12 +21,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -44,9 +44,9 @@ func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
additionalJSONBytes := map[string][]byte{
- "schema.json": schemas.SchemaJSON,
+ "schema.yaml": schemas.SchemaYAML,
}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, additionalJSONBytes)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, additionalJSONBytes)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/sql/v0/README.mdx b/pkg/component/data/sql/v0/README.mdx
index daad0c456..730137009 100644
--- a/pkg/component/data/sql/v0/README.mdx
+++ b/pkg/component/data/sql/v0/README.mdx
@@ -25,7 +25,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/sql/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/sql/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/sql/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/sql/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/sql/v0/config/definition.json b/pkg/component/data/sql/v0/config/definition.json
deleted file mode 100644
index 395d732e7..000000000
--- a/pkg/component/data/sql/v0/config/definition.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "availableTasks": [
- "TASK_INSERT",
- "TASK_INSERT_MANY",
- "TASK_UPDATE",
- "TASK_SELECT",
- "TASK_DELETE",
- "TASK_CREATE_TABLE",
- "TASK_DROP_TABLE"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/data/sql",
- "icon": "assets/sql.svg",
- "id": "sql",
- "public": true,
- "title": "SQL",
- "description": "Access the SQL database of your choice.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "5861fc8f-1a07-42f6-a6b8-0e5a2664de00",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/sql/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/sql/v0/config/definition.yaml b/pkg/component/data/sql/v0/config/definition.yaml
new file mode 100644
index 000000000..641b0aebe
--- /dev/null
+++ b/pkg/component/data/sql/v0/config/definition.yaml
@@ -0,0 +1,20 @@
+availableTasks:
+- TASK_INSERT
+- TASK_INSERT_MANY
+- TASK_UPDATE
+- TASK_SELECT
+- TASK_DELETE
+- TASK_CREATE_TABLE
+- TASK_DROP_TABLE
+documentationUrl: https://www.instill.tech/docs/component/data/sql
+icon: assets/sql.svg
+id: sql
+public: true
+title: SQL
+description: Access the SQL database of your choice.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: 5861fc8f-1a07-42f6-a6b8-0e5a2664de00
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/sql/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/sql/v0/config/setup.json b/pkg/component/data/sql/v0/config/setup.json
deleted file mode 100644
index 3500d49f1..000000000
--- a/pkg/component/data/sql/v0/config/setup.json
+++ /dev/null
@@ -1,186 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "engine": {
- "description": "Choose the engine of your database.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Engine",
- "enum": [
- "MySQL",
- "PostgreSQL",
- "SQL Server",
- "Oracle",
- "MariaDB",
- "Firebird"
- ],
- "format": "string"
- },
- "username": {
- "description": "Fill in your account username.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Username",
- "format": "string"
- },
- "password": {
- "description": "Fill in your account password.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 2,
- "title": "Password",
- "format": "string"
- },
- "database-name": {
- "description": "Fill in the name of your database.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Database Name",
- "format": "string"
- },
- "host": {
- "description": "Fill in the host of your database.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 4,
- "title": "Host",
- "format": "string"
- },
- "port": {
- "description": "Fill in the port of your database.",
- "default": 3306,
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 5,
- "title": "Port",
- "format": "number"
- },
- "ssl-tls": {
- "description": "Enable SSL / TLS.",
- "uiOrder": 6,
- "oneOf": [
- {
- "properties": {
- "ssl-tls-type": {
- "const": "NO TLS",
- "description": "Choose the type of SSL / TLS.",
- "uiOrder": 0,
- "order": 0,
- "title": "SSL / TLS Type",
- "format": "string"
- }
- },
- "required": [
- "ssl-tls-type"
- ],
- "title": "No SSL / TLS"
- },
- {
- "properties": {
- "ssl-tls-type": {
- "const": "TLS",
- "description": "Choose the type of SSL / TLS.",
- "uiOrder": 0,
- "order": 0,
- "title": "SSL / TLS Type",
- "format": "string"
- },
- "ssl-tls-ca": {
- "description": "Base64 encoded CA certificate file.",
- "shortDescription": "Base64 encoded CA certificate file",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "order": 1,
- "title": "CA Certificate",
- "format": "string"
- }
- },
- "required": [
- "ssl-tls-type",
- "ssl-tls-ca"
- ],
- "title": "TLS"
- },
- {
- "properties": {
- "ssl-tls-type": {
- "const": "mTLS",
- "description": "Choose the type of SSL / TLS.",
- "uiOrder": 0,
- "order": 0,
- "title": "SSL / TLS Type",
- "format": "string"
- },
- "ssl-tls-ca": {
- "description": "Base64 encoded CA certificate file.",
- "shortDescription": "Base64 encoded CA certificate file",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "order": 1,
- "title": "CA Certificate",
- "format": "string"
- },
- "ssl-tls-cert": {
- "description": "Base64 encoded client certificate file.",
- "shortDescription": "Base64 encoded client certificate file",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "order": 2,
- "title": "Client Certificate",
- "format": "string"
- },
- "ssl-tls-key": {
- "description": "Base64 encoded client key file.",
- "shortDescription": "Base64 encoded client key file",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "order": 3,
- "title": "Client Key",
- "format": "string"
- }
- },
- "required": [
- "ssl-tls-type",
- "ssl-tls-ca",
- "ssl-tls-cert",
- "ssl-tls-key"
- ],
- "title": "mTLS"
- }
- ],
- "order": 6,
- "title": "SSL / TLS",
- "format": "object"
- }
- },
- "required": [
- "engine",
- "username",
- "password",
- "database-name",
- "host",
- "port",
- "ssl-tls"
- ],
- "title": "SQL Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/sql/v0/config/setup.yaml b/pkg/component/data/sql/v0/config/setup.yaml
new file mode 100644
index 000000000..9a3b6fc68
--- /dev/null
+++ b/pkg/component/data/sql/v0/config/setup.yaml
@@ -0,0 +1,143 @@
+additionalProperties: false
+properties:
+ engine:
+ description: Choose the engine of your database.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Engine
+ enum:
+ - MySQL
+ - PostgreSQL
+ - SQL Server
+ - Oracle
+ - MariaDB
+ - Firebird
+ format: string
+ username:
+ description: Fill in your account username.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Username
+ format: string
+ password:
+ description: Fill in your account password.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 2
+ title: Password
+ format: string
+ database-name:
+ description: Fill in the name of your database.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Database Name
+ format: string
+ host:
+ description: Fill in the host of your database.
+ acceptFormats:
+ - string
+ uiOrder: 4
+ title: Host
+ format: string
+ port:
+ description: Fill in the port of your database.
+ default: 3306
+ acceptFormats:
+ - number
+ uiOrder: 5
+ title: Port
+ format: number
+ ssl-tls:
+ description: Enable SSL / TLS.
+ uiOrder: 6
+ oneOf:
+ - properties:
+ ssl-tls-type:
+ const: NO TLS
+ description: Choose the type of SSL / TLS.
+ uiOrder: 0
+ order: 0
+ title: SSL / TLS Type
+ format: string
+ required:
+ - ssl-tls-type
+ title: No SSL / TLS
+ - properties:
+ ssl-tls-type:
+ const: TLS
+ description: Choose the type of SSL / TLS.
+ uiOrder: 0
+ order: 0
+ title: SSL / TLS Type
+ format: string
+ ssl-tls-ca:
+ description: Base64 encoded CA certificate file.
+ shortDescription: Base64 encoded CA certificate file
+ acceptFormats:
+ - string
+ uiOrder: 1
+ order: 1
+ title: CA Certificate
+ format: string
+ required:
+ - ssl-tls-type
+ - ssl-tls-ca
+ title: TLS
+ - properties:
+ ssl-tls-type:
+ const: mTLS
+ description: Choose the type of SSL / TLS.
+ uiOrder: 0
+ order: 0
+ title: SSL / TLS Type
+ format: string
+ ssl-tls-ca:
+ description: Base64 encoded CA certificate file.
+ shortDescription: Base64 encoded CA certificate file
+ acceptFormats:
+ - string
+ uiOrder: 1
+ order: 1
+ title: CA Certificate
+ format: string
+ ssl-tls-cert:
+ description: Base64 encoded client certificate file.
+ shortDescription: Base64 encoded client certificate file
+ acceptFormats:
+ - string
+ uiOrder: 2
+ order: 2
+ title: Client Certificate
+ format: string
+ ssl-tls-key:
+ description: Base64 encoded client key file.
+ shortDescription: Base64 encoded client key file
+ acceptFormats:
+ - string
+ uiOrder: 3
+ order: 3
+ title: Client Key
+ format: string
+ required:
+ - ssl-tls-type
+ - ssl-tls-ca
+ - ssl-tls-cert
+ - ssl-tls-key
+ title: mTLS
+ order: 6
+ title: SSL / TLS
+ format: object
+required:
+- engine
+- username
+- password
+- database-name
+- host
+- port
+- ssl-tls
+title: SQL Connection
+format: object
diff --git a/pkg/component/data/sql/v0/config/tasks.json b/pkg/component/data/sql/v0/config/tasks.json
deleted file mode 100644
index 1f8eee711..000000000
--- a/pkg/component/data/sql/v0/config/tasks.json
+++ /dev/null
@@ -1,418 +0,0 @@
-{
- "TASK_INSERT": {
- "shortDescription": "Perform insert operation",
- "input": {
- "uiOrder": 0,
- "properties": {
- "table-name": {
- "description": "The table name in the database to insert data into.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Database Table Name",
- "uiOrder": 0,
- "title": "Table Name",
- "format": "string"
- },
- "data": {
- "description": "The data to be inserted.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 1,
- "items": {
- "title": "Object",
- "format": "json"
- },
- "title": "Data",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "data",
- "table-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Insert status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_INSERT_MANY": {
- "shortDescription": "Perform insert operation with multiple rows",
- "input": {
- "uiOrder": 0,
- "properties": {
- "table-name": {
- "description": "The table name in the database to insert data into.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Database Table Name",
- "uiOrder": 0,
- "title": "Table Name",
- "format": "string"
- },
- "array-data": {
- "description": "The array data to be inserted.",
- "acceptFormats": [
- "array",
- "array",
- "array",
- "array"
- ],
- "uiOrder": 1,
- "title": "Data",
- "items": {
- "description": "The data to be inserted.",
- "title": "Data",
- "required": [],
- "format": "object"
- },
- "minItems": 1,
- "format": "array"
- }
- },
- "required": [
- "array-data",
- "table-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Insert many status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPDATE": {
- "shortDescription": "Perform update operation",
- "input": {
- "uiOrder": 0,
- "properties": {
- "table-name": {
- "description": "The table name in the database to update data into.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Database Table Name",
- "uiOrder": 0,
- "title": "Table Name",
- "format": "string"
- },
- "filter": {
- "shortDescription": "The filter to be applied to the data",
- "description": "The filter to be applied to the data with SQL syntax, which starts with WHERE clause.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Filter",
- "format": "string"
- },
- "update-data": {
- "description": "The new data to be updated to.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 2,
- "items": {
- "title": "Object",
- "format": "json"
- },
- "title": "Update",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "filter",
- "update-data",
- "table-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Update status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SELECT": {
- "shortDescription": "Perform select operation",
- "input": {
- "uiOrder": 0,
- "properties": {
- "table-name": {
- "description": "The table name in the database to be selected.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Database Table Name",
- "uiOrder": 0,
- "title": "Table Name",
- "format": "string"
- },
- "filter": {
- "shortDescription": "The filter to be applied to the data. If empty, then all rows will be updated",
- "description": "The filter to be applied to the data with SQL syntax, which starts with WHERE clause, empty for all rows.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Filter",
- "format": "string"
- },
- "limit": {
- "description": "The limit of rows to be selected, empty for all rows.",
- "acceptFormats": [
- "integer"
- ],
- "shortDescription": "Limit Rows",
- "uiOrder": 2,
- "title": "Limit",
- "format": "integer"
- },
- "columns": {
- "description": "The columns to return in the rows. If empty then all columns will be returned.",
- "acceptFormats": [
- "array"
- ],
- "shortDescription": "Columns to be returned, empty for all columns",
- "uiOrder": 3,
- "title": "Columns",
- "items": {
- "title": "Column",
- "format": "string"
- },
- "minItems": 1,
- "format": "array"
- }
- },
- "required": [
- "table-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "rows": {
- "description": "The rows returned from the select operation.",
- "uiOrder": 0,
- "required": [],
- "title": "Rows",
- "items": {
- "title": "Row",
- "required": [],
- "format": "json"
- },
- "format": "array"
- },
- "status": {
- "description": "Select status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status",
- "rows"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE": {
- "shortDescription": "Perform delete operation",
- "input": {
- "uiOrder": 0,
- "properties": {
- "table-name": {
- "description": "The table name in the database to be deleted.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Database Table Name",
- "uiOrder": 0,
- "title": "Table Name",
- "format": "string"
- },
- "filter": {
- "shortDescription": "The filter to be applied to the data",
- "description": "The filter to be applied to the data with SQL syntax, which starts with WHERE clause.",
- "uiOrder": 1,
- "acceptFormats": [
- "string"
- ],
- "title": "Filter",
- "format": "string"
- }
- },
- "required": [
- "filter",
- "table-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_TABLE": {
- "shortDescription": "Create a table in the database",
- "input": {
- "uiOrder": 0,
- "properties": {
- "table-name": {
- "description": "The table name in the database to be created.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Database Table Name",
- "uiOrder": 0,
- "title": "Table Name",
- "format": "string"
- },
- "columns-structure": {
- "description": "The columns structure to be created in the table, json with value string, e.g {\"name\": \"VARCHAR(255)\", \"age\": \"INT not null\"}.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "shortDescription": "Columns Structure, e.g {\"name\": \"VARCHAR(255)\", \"age\": \"INT not null\"}",
- "uiOrder": 1,
- "title": "Columns",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "table-name",
- "columns-structure"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Create table status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DROP_TABLE": {
- "shortDescription": "Drop a table in the database",
- "input": {
- "uiOrder": 0,
- "properties": {
- "table-name": {
- "description": "The table name in the database to be dropped.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "Database Table Name",
- "uiOrder": 0,
- "title": "Table Name",
- "format": "string"
- }
- },
- "required": [
- "table-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Drop table status.",
- "required": [],
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/sql/v0/config/tasks.yaml b/pkg/component/data/sql/v0/config/tasks.yaml
new file mode 100644
index 000000000..ec06c8bc5
--- /dev/null
+++ b/pkg/component/data/sql/v0/config/tasks.yaml
@@ -0,0 +1,329 @@
+TASK_INSERT:
+ shortDescription: Perform insert operation
+ input:
+ uiOrder: 0
+ properties:
+ table-name:
+ description: The table name in the database to insert data into.
+ acceptFormats:
+ - string
+ shortDescription: Database Table Name
+ uiOrder: 0
+ title: Table Name
+ format: string
+ data:
+ description: The data to be inserted.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 1
+ items:
+ title: Object
+ format: json
+ title: Data
+ required: []
+ format: object
+ required:
+ - data
+ - table-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Insert status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_INSERT_MANY:
+ shortDescription: Perform insert operation with multiple rows
+ input:
+ uiOrder: 0
+ properties:
+ table-name:
+ description: The table name in the database to insert data into.
+ acceptFormats:
+ - string
+ shortDescription: Database Table Name
+ uiOrder: 0
+ title: Table Name
+ format: string
+ array-data:
+ description: The array data to be inserted.
+ acceptFormats:
+ - array
+ - array
+ - array
+ - array
+ uiOrder: 1
+ title: Data
+ items:
+ description: The data to be inserted.
+ title: Data
+ required: []
+ format: object
+ minItems: 1
+ format: array
+ required:
+ - array-data
+ - table-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Insert many status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_UPDATE:
+ shortDescription: Perform update operation
+ input:
+ uiOrder: 0
+ properties:
+ table-name:
+ description: The table name in the database to update data into.
+ acceptFormats:
+ - string
+ shortDescription: Database Table Name
+ uiOrder: 0
+ title: Table Name
+ format: string
+ filter:
+ shortDescription: The filter to be applied to the data
+ description: The filter to be applied to the data with SQL syntax, which starts
+ with WHERE clause.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Filter
+ format: string
+ update-data:
+ description: The new data to be updated to.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 2
+ items:
+ title: Object
+ format: json
+ title: Update
+ required: []
+ format: object
+ required:
+ - filter
+ - update-data
+ - table-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Update status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_SELECT:
+ shortDescription: Perform select operation
+ input:
+ uiOrder: 0
+ properties:
+ table-name:
+ description: The table name in the database to be selected.
+ acceptFormats:
+ - string
+ shortDescription: Database Table Name
+ uiOrder: 0
+ title: Table Name
+ format: string
+ filter:
+ shortDescription: The filter to be applied to the data. If empty, then all
+ rows will be updated
+ description: The filter to be applied to the data with SQL syntax, which starts
+ with WHERE clause, empty for all rows.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Filter
+ format: string
+ limit:
+ description: The limit of rows to be selected, empty for all rows.
+ acceptFormats:
+ - integer
+ shortDescription: Limit Rows
+ uiOrder: 2
+ title: Limit
+ format: integer
+ columns:
+ description: The columns to return in the rows. If empty then all columns
+ will be returned.
+ acceptFormats:
+ - array
+ shortDescription: Columns to be returned, empty for all columns
+ uiOrder: 3
+ title: Columns
+ items:
+ title: Column
+ format: string
+ minItems: 1
+ format: array
+ required:
+ - table-name
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ rows:
+ description: The rows returned from the select operation.
+ uiOrder: 0
+ required: []
+ title: Rows
+ items:
+ title: Row
+ required: []
+ format: json
+ format: array
+ status:
+ description: Select status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ - rows
+ title: Output
+ format: object
+TASK_DELETE:
+ shortDescription: Perform delete operation
+ input:
+ uiOrder: 0
+ properties:
+ table-name:
+ description: The table name in the database to be deleted.
+ acceptFormats:
+ - string
+ shortDescription: Database Table Name
+ uiOrder: 0
+ title: Table Name
+ format: string
+ filter:
+ shortDescription: The filter to be applied to the data
+ description: The filter to be applied to the data with SQL syntax, which starts
+ with WHERE clause.
+ uiOrder: 1
+ acceptFormats:
+ - string
+ title: Filter
+ format: string
+ required:
+ - filter
+ - table-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_CREATE_TABLE:
+ shortDescription: Create a table in the database
+ input:
+ uiOrder: 0
+ properties:
+ table-name:
+ description: The table name in the database to be created.
+ acceptFormats:
+ - string
+ shortDescription: Database Table Name
+ uiOrder: 0
+ title: Table Name
+ format: string
+ columns-structure:
+ description: 'The columns structure to be created in the table, json with
+ value string, e.g {"name": "VARCHAR(255)", "age": "INT not null"}.'
+ acceptFormats:
+ - json
+ - object
+ shortDescription: 'Columns Structure, e.g {"name": "VARCHAR(255)", "age":
+ "INT not null"}'
+ uiOrder: 1
+ title: Columns
+ required: []
+ format: object
+ required:
+ - table-name
+ - columns-structure
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Create table status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DROP_TABLE:
+ shortDescription: Drop a table in the database
+ input:
+ uiOrder: 0
+ properties:
+ table-name:
+ description: The table name in the database to be dropped.
+ acceptFormats:
+ - string
+ shortDescription: Database Table Name
+ uiOrder: 0
+ title: Table Name
+ format: string
+ required:
+ - table-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Drop table status.
+ required: []
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
diff --git a/pkg/component/data/sql/v0/main.go b/pkg/component/data/sql/v0/main.go
index 301708e15..8c83f3b0e 100644
--- a/pkg/component/data/sql/v0/main.go
+++ b/pkg/component/data/sql/v0/main.go
@@ -26,14 +26,14 @@ const (
TaskDropTable = "TASK_DROP_TABLE"
)
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -57,7 +57,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/weaviate/v0/README.mdx b/pkg/component/data/weaviate/v0/README.mdx
index 0bd64d812..61567b755 100644
--- a/pkg/component/data/weaviate/v0/README.mdx
+++ b/pkg/component/data/weaviate/v0/README.mdx
@@ -24,7 +24,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/weaviate/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/weaviate/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/weaviate/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/weaviate/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/weaviate/v0/config/definition.json b/pkg/component/data/weaviate/v0/config/definition.json
deleted file mode 100644
index 4f969aa31..000000000
--- a/pkg/component/data/weaviate/v0/config/definition.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "availableTasks": [
- "TASK_VECTOR_SEARCH",
- "TASK_BATCH_INSERT",
- "TASK_INSERT",
- "TASK_UPDATE",
- "TASK_DELETE",
- "TASK_DELETE_COLLECTION"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/data/weaviate",
- "icon": "assets/weaviate.svg",
- "id": "weaviate",
- "public": true,
- "title": "Weaviate",
- "description": "Build and search vector datasets.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "8833d994-ab21-4627-910f-6612ae5526c0",
- "vendor": "Weaviate",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/weaviate/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/weaviate/v0/config/definition.yaml b/pkg/component/data/weaviate/v0/config/definition.yaml
new file mode 100644
index 000000000..5388a19c8
--- /dev/null
+++ b/pkg/component/data/weaviate/v0/config/definition.yaml
@@ -0,0 +1,21 @@
+availableTasks:
+- TASK_VECTOR_SEARCH
+- TASK_BATCH_INSERT
+- TASK_INSERT
+- TASK_UPDATE
+- TASK_DELETE
+- TASK_DELETE_COLLECTION
+documentationUrl: https://www.instill.tech/docs/component/data/weaviate
+icon: assets/weaviate.svg
+id: weaviate
+public: true
+title: Weaviate
+description: Build and search vector datasets.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: 8833d994-ab21-4627-910f-6612ae5526c0
+vendor: Weaviate
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/weaviate/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/weaviate/v0/config/setup.json b/pkg/component/data/weaviate/v0/config/setup.json
deleted file mode 100644
index a803545df..000000000
--- a/pkg/component/data/weaviate/v0/config/setup.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "api-key": {
- "description": "Fill in your Weaviate API key. Please refer to clusters in Weaviate Console.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- },
- "url": {
- "description": "Fill in your Weaviate base URL without https:// or http://. Please refer to clusters in Weaviate Console.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 1,
- "title": "Weaviate URL Endpoint",
- "format": "string"
- }
- },
- "required": [
- "api-key",
- "url"
- ],
- "title": "Weaviate Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/weaviate/v0/config/setup.yaml b/pkg/component/data/weaviate/v0/config/setup.yaml
new file mode 100644
index 000000000..dae666fb0
--- /dev/null
+++ b/pkg/component/data/weaviate/v0/config/setup.yaml
@@ -0,0 +1,25 @@
+additionalProperties: false
+properties:
+ api-key:
+ description: Fill in your Weaviate API key. Please refer to clusters in Weaviate
+ Console.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 0
+ title: API Key
+ format: string
+ url:
+ description: Fill in your Weaviate base URL without https:// or http://. Please
+ refer to clusters in Weaviate Console.
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 1
+ title: Weaviate URL Endpoint
+ format: string
+required:
+- api-key
+- url
+title: Weaviate Connection
+format: object
diff --git a/pkg/component/data/weaviate/v0/config/tasks.json b/pkg/component/data/weaviate/v0/config/tasks.json
deleted file mode 100644
index 66777e17b..000000000
--- a/pkg/component/data/weaviate/v0/config/tasks.json
+++ /dev/null
@@ -1,508 +0,0 @@
-{
- "TASK_VECTOR_SEARCH": {
- "shortDescription": "Perform a vector search on a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to perform vector search on.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "vector": {
- "description": "An array of dimensions for the vector query, optional. If not provided, all objects will be returned.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Vector",
- "format": "array"
- },
- "limit": {
- "description": "The limit of objects, empty for all objects.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "title": "Limit",
- "format": "integer"
- },
- "fields": {
- "description": "The fields to return in the objects. If empty then all fields will be returned.",
- "acceptFormats": [
- "array"
- ],
- "shortDescription": "Fields to be returned, empty for all fields",
- "uiOrder": 3,
- "title": "Fields",
- "minItems": 1,
- "items": {
- "title": "Field",
- "format": "string"
- },
- "format": "array"
- },
- "filter": {
- "description": "The properties filter to be applied to the data with GraphQL queries, which starts with WHERE field, please refer to [here](https://weaviate.io/developers/weaviate/search/filters).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 4,
- "title": "Filter",
- "required": [],
- "format": "object"
- },
- "tenant": {
- "description": "The tenant to perform the vector search on.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 5,
- "title": "Tenant",
- "format": "string"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Upsert status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- },
- "result": {
- "description": "Result of the vector search operation.",
- "uiOrder": 0,
- "title": "Result",
- "properties": {
- "ids": {
- "description": "The ids returned from the vector search operation.",
- "uiOrder": 0,
- "title": "IDs",
- "required": [],
- "items": {
- "description": "An id of the object.",
- "example": "c8faa-4b3b-4b3b-4b3b",
- "format": "string"
- },
- "format": "array"
- },
- "objects": {
- "description": "The objects returned from the vector search operation.",
- "uiOrder": 1,
- "required": [],
- "title": "Objects",
- "items": {
- "title": "Object",
- "format": "object",
- "required": []
- },
- "format": "array"
- },
- "vectors": {
- "description": "The vectors returned from the vector search operation.",
- "uiOrder": 2,
- "title": "Vectors",
- "required": [],
- "items": {
- "description": "The vector from array vectors.",
- "required": [],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "format": "array"
- },
- "format": "array"
- },
- "metadata": {
- "description": "The metadata returned from the vector search operation.",
- "uiOrder": 3,
- "title": "Metadata",
- "required": [],
- "items": {
- "title": "Metadatum",
- "format": "object",
- "required": []
- },
- "format": "array"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "status",
- "result"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_INSERT": {
- "shortDescription": "Insert a vector object into a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to upsert the object into.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the object.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- },
- "vector": {
- "description": "An array of dimensions for the vector value.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 2,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Vector",
- "format": "array"
- },
- "metadata": {
- "description": "The vector metadata properties.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 3,
- "title": "Metadata",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name",
- "vector",
- "metadata"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Upsert status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_BATCH_INSERT": {
- "shortDescription": "Insert multiple vector objects into a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to upsert the object into.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "array-id": {
- "description": "The array of id.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "description": "An id of the object.",
- "example": 1,
- "format": "string"
- },
- "minItems": 1,
- "title": "Array ID",
- "format": "array"
- },
- "array-metadata": {
- "description": "The array of vector metadata properties.",
- "acceptFormats": [
- "array",
- "array",
- "array",
- "array"
- ],
- "shortDescription": "The vector metadata properties",
- "uiOrder": 2,
- "minItems": 1,
- "title": "Array Metadata",
- "items": {
- "description": "The vector metadata properties.",
- "title": "Metadatum",
- "required": [],
- "format": "object"
- },
- "format": "array"
- },
- "array-vector": {
- "description": "The array of vector values.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "description": "An array of dimensions for the vector value.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "format": "array"
- },
- "minItems": 1,
- "title": "Array Vector",
- "format": "array"
- }
- },
- "required": [
- "collection-name",
- "array-metadata",
- "array-vector"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Batch insert status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE": {
- "shortDescription": "Delete vector objects from a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to delete the object from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the object.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- },
- "filter": {
- "description": "The properties filter to be applied to the data with GraphQL queries, which starts with WHERE field, please refer to [here](https://weaviate.io/developers/weaviate/search/filters).",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 2,
- "title": "Filter",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPDATE": {
- "shortDescription": "Update vector object in a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to update the object in.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "id": {
- "description": "The ID of the object.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "ID",
- "format": "string"
- },
- "update-vector": {
- "description": "The updated vector value, optional.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 2,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Update Vector",
- "format": "array"
- },
- "update-metadata": {
- "description": "The updated vector metadata properties, optional.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 3,
- "title": "Update Metadata",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name",
- "id"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Update status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE_COLLECTION": {
- "shortDescription": "Delete a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to delete.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete collection status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/weaviate/v0/config/tasks.yaml b/pkg/component/data/weaviate/v0/config/tasks.yaml
new file mode 100644
index 000000000..20a4fc76c
--- /dev/null
+++ b/pkg/component/data/weaviate/v0/config/tasks.yaml
@@ -0,0 +1,398 @@
+TASK_VECTOR_SEARCH:
+ shortDescription: Perform a vector search on a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to perform vector search on.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ vector:
+ description: An array of dimensions for the vector query, optional. If not
+ provided, all objects will be returned.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 1
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Vector
+ format: array
+ limit:
+ description: The limit of objects, empty for all objects.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: Limit
+ format: integer
+ fields:
+ description: The fields to return in the objects. If empty then all fields
+ will be returned.
+ acceptFormats:
+ - array
+ shortDescription: Fields to be returned, empty for all fields
+ uiOrder: 3
+ title: Fields
+ minItems: 1
+ items:
+ title: Field
+ format: string
+ format: array
+ filter:
+ description: The properties filter to be applied to the data with GraphQL
+ queries, which starts with WHERE field, please refer to [here](https://weaviate.io/developers/weaviate/search/filters).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 4
+ title: Filter
+ required: []
+ format: object
+ tenant:
+ description: The tenant to perform the vector search on.
+ acceptFormats:
+ - string
+ uiOrder: 5
+ title: Tenant
+ format: string
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Upsert status.
+ uiOrder: 0
+ title: Status
+ format: string
+ result:
+ description: Result of the vector search operation.
+ uiOrder: 0
+ title: Result
+ properties:
+ ids:
+ description: The ids returned from the vector search operation.
+ uiOrder: 0
+ title: IDs
+ required: []
+ items:
+ description: An id of the object.
+ example: c8faa-4b3b-4b3b-4b3b
+ format: string
+ format: array
+ objects:
+ description: The objects returned from the vector search operation.
+ uiOrder: 1
+ required: []
+ title: Objects
+ items:
+ title: Object
+ format: object
+ required: []
+ format: array
+ vectors:
+ description: The vectors returned from the vector search operation.
+ uiOrder: 2
+ title: Vectors
+ required: []
+ items:
+ description: The vector from array vectors.
+ required: []
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ format: array
+ format: array
+ metadata:
+ description: The metadata returned from the vector search operation.
+ uiOrder: 3
+ title: Metadata
+ required: []
+ items:
+ title: Metadatum
+ format: object
+ required: []
+ format: array
+ required: []
+ format: object
+ required:
+ - status
+ - result
+ title: Output
+ format: object
+TASK_INSERT:
+ shortDescription: Insert a vector object into a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to upsert the object into.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the object.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ vector:
+ description: An array of dimensions for the vector value.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 2
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Vector
+ format: array
+ metadata:
+ description: The vector metadata properties.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 3
+ title: Metadata
+ required: []
+ format: object
+ required:
+ - collection-name
+ - vector
+ - metadata
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Upsert status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_BATCH_INSERT:
+ shortDescription: Insert multiple vector objects into a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to upsert the object into.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ array-id:
+ description: The array of id.
+ acceptFormats:
+ - array
+ uiOrder: 1
+ items:
+ description: An id of the object.
+ example: 1
+ format: string
+ minItems: 1
+ title: Array ID
+ format: array
+ array-metadata:
+ description: The array of vector metadata properties.
+ acceptFormats:
+ - array
+ - array
+ - array
+ - array
+ shortDescription: The vector metadata properties
+ uiOrder: 2
+ minItems: 1
+ title: Array Metadata
+ items:
+ description: The vector metadata properties.
+ title: Metadatum
+ required: []
+ format: object
+ format: array
+ array-vector:
+ description: The array of vector values.
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ description: An array of dimensions for the vector value.
+ acceptFormats:
+ - array
+ - array
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ format: array
+ minItems: 1
+ title: Array Vector
+ format: array
+ required:
+ - collection-name
+ - array-metadata
+ - array-vector
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Batch insert status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DELETE:
+ shortDescription: Delete vector objects from a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to delete the object from.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the object.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ filter:
+ description: The properties filter to be applied to the data with GraphQL
+ queries, which starts with WHERE field, please refer to [here](https://weaviate.io/developers/weaviate/search/filters).
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 2
+ title: Filter
+ required: []
+ format: object
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_UPDATE:
+ shortDescription: Update vector object in a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to update the object in.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ id:
+ description: The ID of the object.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: ID
+ format: string
+ update-vector:
+ description: The updated vector value, optional.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 2
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Update Vector
+ format: array
+ update-metadata:
+ description: The updated vector metadata properties, optional.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 3
+ title: Update Metadata
+ required: []
+ format: object
+ required:
+ - collection-name
+ - id
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Update status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DELETE_COLLECTION:
+ shortDescription: Delete a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to delete.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete collection status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
diff --git a/pkg/component/data/weaviate/v0/main.go b/pkg/component/data/weaviate/v0/main.go
index 8d6f35f3b..33d125563 100644
--- a/pkg/component/data/weaviate/v0/main.go
+++ b/pkg/component/data/weaviate/v0/main.go
@@ -24,14 +24,14 @@ const (
TaskDeleteCollection = "TASK_DELETE_COLLECTION"
)
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -56,7 +56,7 @@ type MockWeaviateClient struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/data/zilliz/v0/README.mdx b/pkg/component/data/zilliz/v0/README.mdx
index aac7b9331..70d35823e 100644
--- a/pkg/component/data/zilliz/v0/README.mdx
+++ b/pkg/component/data/zilliz/v0/README.mdx
@@ -26,7 +26,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/zilliz/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/zilliz/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/zilliz/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/zilliz/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/data/zilliz/v0/config/definition.json b/pkg/component/data/zilliz/v0/config/definition.json
deleted file mode 100644
index 6da70fc2c..000000000
--- a/pkg/component/data/zilliz/v0/config/definition.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "availableTasks": [
- "TASK_VECTOR_SEARCH",
- "TASK_UPSERT",
- "TASK_BATCH_UPSERT",
- "TASK_DELETE",
- "TASK_CREATE_COLLECTION",
- "TASK_DROP_COLLECTION",
- "TASK_CREATE_PARTITION",
- "TASK_DROP_PARTITION"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/data/zilliz",
- "icon": "assets/zilliz.svg",
- "id": "zilliz",
- "public": true,
- "title": "Zilliz",
- "description": "Build and search vector datasets.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_DATA",
- "uid": "7995e58f-de2c-4754-99d9-0876008faece",
- "vendor": "Zilliz",
- "vendorAttributes": {},
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/zilliz/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/data/zilliz/v0/config/definition.yaml b/pkg/component/data/zilliz/v0/config/definition.yaml
new file mode 100644
index 000000000..f0a3b2240
--- /dev/null
+++ b/pkg/component/data/zilliz/v0/config/definition.yaml
@@ -0,0 +1,23 @@
+availableTasks:
+- TASK_VECTOR_SEARCH
+- TASK_UPSERT
+- TASK_BATCH_UPSERT
+- TASK_DELETE
+- TASK_CREATE_COLLECTION
+- TASK_DROP_COLLECTION
+- TASK_CREATE_PARTITION
+- TASK_DROP_PARTITION
+documentationUrl: https://www.instill.tech/docs/component/data/zilliz
+icon: assets/zilliz.svg
+id: zilliz
+public: true
+title: Zilliz
+description: Build and search vector datasets.
+tombstone: false
+type: COMPONENT_TYPE_DATA
+uid: 7995e58f-de2c-4754-99d9-0876008faece
+vendor: Zilliz
+vendorAttributes: {}
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/data/zilliz/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/data/zilliz/v0/config/setup.json b/pkg/component/data/zilliz/v0/config/setup.json
deleted file mode 100644
index 76718f3bd..000000000
--- a/pkg/component/data/zilliz/v0/config/setup.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "url": {
- "description": "Fill in your Zilliz public URL endpoint.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": false,
- "uiOrder": 0,
- "title": "Zilliz URL Endpoint",
- "format": "string"
- },
- "api-key": {
- "description": "Fill in your Zilliz API key.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 1,
- "title": "Zilliz API Key",
- "format": "string"
- }
- },
- "required": [
- "url",
- "api-key"
- ],
- "title": "Zilliz Connection",
- "format": "object"
-}
diff --git a/pkg/component/data/zilliz/v0/config/setup.yaml b/pkg/component/data/zilliz/v0/config/setup.yaml
new file mode 100644
index 000000000..90ff0f5bc
--- /dev/null
+++ b/pkg/component/data/zilliz/v0/config/setup.yaml
@@ -0,0 +1,23 @@
+additionalProperties: false
+properties:
+ url:
+ description: Fill in your Zilliz public URL endpoint.
+ acceptFormats:
+ - string
+ instillSecret: false
+ uiOrder: 0
+ title: Zilliz URL Endpoint
+ format: string
+ api-key:
+ description: Fill in your Zilliz API key.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 1
+ title: Zilliz API Key
+ format: string
+required:
+- url
+- api-key
+title: Zilliz Connection
+format: object
diff --git a/pkg/component/data/zilliz/v0/config/tasks.json b/pkg/component/data/zilliz/v0/config/tasks.json
deleted file mode 100644
index 977dcb0df..000000000
--- a/pkg/component/data/zilliz/v0/config/tasks.json
+++ /dev/null
@@ -1,631 +0,0 @@
-{
- "TASK_VECTOR_SEARCH": {
- "shortDescription": "Perform a vector search on a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to perform vector search on.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to vector search the data from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- },
- "vector": {
- "description": "An array of dimensions for the vector search.",
- "acceptFormats": [
- "array",
- "array"
- ],
- "uiOrder": 2,
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "minItems": 1,
- "title": "Vector",
- "format": "array"
- },
- "vector-field": {
- "description": "The name of the field to perform vector search on.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Vector Field",
- "format": "string"
- },
- "limit": {
- "description": "The limit of the data to return.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Limit",
- "format": "integer"
- },
- "fields": {
- "description": "The fields to return in the data. If empty then all fields will be returned.",
- "acceptFormats": [
- "array"
- ],
- "shortDescription": "Fields to be returned, empty for all fields",
- "uiOrder": 4,
- "title": "Fields",
- "minItems": 1,
- "items": {
- "title": "Field",
- "format": "string"
- },
- "format": "array"
- },
- "filter": {
- "description": "The properties filter to be applied to the data with zilliz scalar filter, please refer to [filtered-search](https://docs.zilliz.com/docs/single-vector-search?_highlight=filter/docs/single-vector-search#filtered-search).",
- "uiOrder": 5,
- "acceptFormats": [
- "string"
- ],
- "title": "Filter",
- "format": "string"
- },
- "offset": {
- "description": "The offset of the data to return.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Offset",
- "format": "integer"
- },
- "grouping-field": {
- "description": "The name of the field to group the data by, please refer to [grouping-search](https://docs.zilliz.com/docs/release-notes-290?_highlight=grouping&_highlight=field/docs/release-notes-290#grouping-search).",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 7,
- "title": "Grouping Field",
- "format": "string"
- },
- "search-params": {
- "description": "The search parameters to be applied to the data with zilliz search parameters, please refer to [search-parameters](https://docs.zilliz.com/docs/single-vector-search?_highlight=search&_highlight=params/docs/single-vector-search#search-parameters).",
- "uiOrder": 8,
- "acceptFormats": [
- "json",
- "object"
- ],
- "title": "Search Parameters",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name",
- "vector",
- "vector-field",
- "limit"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Vector search status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- },
- "result": {
- "description": "Result of the vector search operation.",
- "uiOrder": 0,
- "title": "Result",
- "properties": {
- "ids": {
- "description": "The ids returned from the vector search operation.",
- "uiOrder": 0,
- "title": "IDs",
- "required": [],
- "items": {
- "description": "An id of the point.",
- "example": "c8faa-4b3b-4b3b-4b3b",
- "format": "string"
- },
- "format": "array"
- },
- "data": {
- "description": "The points returned from the vector search operation.",
- "uiOrder": 1,
- "required": [],
- "title": "Data",
- "items": {
- "title": "Datum",
- "format": "object",
- "required": []
- },
- "format": "array"
- },
- "vectors": {
- "description": "The vectors returned from the vector search operation.",
- "uiOrder": 2,
- "title": "Vectors",
- "required": [],
- "items": {
- "description": "The vector from array vectors.",
- "required": [],
- "items": {
- "description": "A dimension of the vector.",
- "example": 0.8167237,
- "format": "number"
- },
- "format": "array"
- },
- "format": "array"
- },
- "metadata": {
- "description": "The metadata returned from the vector search operation.",
- "uiOrder": 3,
- "title": "Metadata",
- "required": [],
- "items": {
- "title": "Metadatum",
- "format": "object",
- "required": []
- },
- "format": "array"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "status",
- "result"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UPSERT": {
- "shortDescription": "Insert a vector data into a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to upsert the data into.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to upsert the data from. If empty then default partition will be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- },
- "data": {
- "description": "The data.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 2,
- "title": "Data",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name",
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Upsert status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_BATCH_UPSERT": {
- "shortDescription": "Insert a batch of vector data into a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to upsert the data into.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to upsert the data from. If empty then default partition will be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- },
- "array-data": {
- "description": "The data.",
- "acceptFormats": [
- "array",
- "array",
- "array",
- "array"
- ],
- "uiOrder": 2,
- "title": "Array Data",
- "items": {
- "description": "A datum.",
- "required": [],
- "format": "object"
- },
- "format": "array"
- }
- },
- "required": [
- "collection-name",
- "array-data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Batch upsert status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE": {
- "shortDescription": "Delete vector data from a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to delete the data from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to delete the data from. If empty then default partition will be used.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- },
- "filter": {
- "description": "The properties filter to be applied to the data with zilliz scalar filter, please refer to [filtered-search](https://docs.zilliz.com/docs/single-vector-search?_highlight=filter/docs/single-vector-search#filtered-search).",
- "uiOrder": 2,
- "acceptFormats": [
- "string"
- ],
- "title": "Filter",
- "format": "string"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Delete status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_COLLECTION": {
- "shortDescription": "Create a collection, please refer to [create-collection-v2](https://docs.zilliz.com/reference/restful/create-collection-v2)",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to create.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "dimension": {
- "description": "The dimension of the collection.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "title": "Dimension",
- "format": "integer"
- },
- "id-type": {
- "description": "The type of the id.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "ID Type",
- "format": "string"
- },
- "schema": {
- "description": "The schema of the collection.",
- "acceptFormats": [
- "json",
- "object"
- ],
- "uiOrder": 4,
- "title": "Schema",
- "required": [],
- "format": "object"
- },
- "auto-id": {
- "description": "Whether to auto generate id.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 5,
- "title": "Auto ID",
- "default": false,
- "format": "boolean"
- },
- "metric-type": {
- "description": "The metric type of the collection.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 6,
- "title": "Metric Type",
- "enum": [
- "L2",
- "IP",
- "COSINE"
- ],
- "default": "L2",
- "format": "string"
- },
- "index-params": {
- "description": "The index parameters to be applied to the collection with zilliz index parameters, please refer to [index-parameter](https://zilliz.io/docs/single-vector-search.md#Index-parameters).",
- "uiOrder": 7,
- "acceptFormats": [
- "json",
- "object"
- ],
- "title": "Index Parameters",
- "required": [],
- "format": "object"
- },
- "params": {
- "description": "The parameters to be applied to the collection with zilliz parameters, please refer to [parameters](https://zilliz.io/docs/single-vector-search.md#Parameters).",
- "uiOrder": 8,
- "acceptFormats": [
- "json",
- "object"
- ],
- "title": "Parameters",
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "collection-name",
- "dimension"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Create collection status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DROP_COLLECTION": {
- "shortDescription": "Drop a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to drop.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- }
- },
- "required": [
- "collection-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Drop collection status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CREATE_PARTITION": {
- "shortDescription": "Create a partition in a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to create the partition in.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to create.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- }
- },
- "required": [
- "collection-name",
- "partition-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Create partition status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DROP_PARTITION": {
- "shortDescription": "Drop a partition from a collection",
- "input": {
- "uiOrder": 0,
- "properties": {
- "collection-name": {
- "description": "The name of the collection to drop the partition from.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Collection Name",
- "format": "string"
- },
- "partition-name": {
- "description": "The name of the partition to drop.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Partition Name",
- "format": "string"
- }
- },
- "required": [
- "collection-name",
- "partition-name"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "status": {
- "description": "Drop partition status.",
- "uiOrder": 0,
- "title": "Status",
- "format": "string"
- }
- },
- "required": [
- "status"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/data/zilliz/v0/config/tasks.yaml b/pkg/component/data/zilliz/v0/config/tasks.yaml
new file mode 100644
index 000000000..b309dcd4c
--- /dev/null
+++ b/pkg/component/data/zilliz/v0/config/tasks.yaml
@@ -0,0 +1,495 @@
+TASK_VECTOR_SEARCH:
+ shortDescription: Perform a vector search on a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to perform vector search on.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to vector search the data from.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ vector:
+ description: An array of dimensions for the vector search.
+ acceptFormats:
+ - array
+ - array
+ uiOrder: 2
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ minItems: 1
+ title: Vector
+ format: array
+ vector-field:
+ description: The name of the field to perform vector search on.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Vector Field
+ format: string
+ limit:
+ description: The limit of the data to return.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Limit
+ format: integer
+ fields:
+ description: The fields to return in the data. If empty then all fields will
+ be returned.
+ acceptFormats:
+ - array
+ shortDescription: Fields to be returned, empty for all fields
+ uiOrder: 4
+ title: Fields
+ minItems: 1
+ items:
+ title: Field
+ format: string
+ format: array
+ filter:
+ description: The properties filter to be applied to the data with zilliz scalar
+ filter, please refer to [filtered-search](https://docs.zilliz.com/docs/single-vector-search?_highlight=filter/docs/single-vector-search#filtered-search).
+ uiOrder: 5
+ acceptFormats:
+ - string
+ title: Filter
+ format: string
+ offset:
+ description: The offset of the data to return.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Offset
+ format: integer
+ grouping-field:
+ description: The name of the field to group the data by, please refer to [grouping-search](https://docs.zilliz.com/docs/release-notes-290?_highlight=grouping&_highlight=field/docs/release-notes-290#grouping-search).
+ acceptFormats:
+ - string
+ uiOrder: 7
+ title: Grouping Field
+ format: string
+ search-params:
+ description: The search parameters to be applied to the data with zilliz search
+ parameters, please refer to [search-parameters](https://docs.zilliz.com/docs/single-vector-search?_highlight=search&_highlight=params/docs/single-vector-search#search-parameters).
+ uiOrder: 8
+ acceptFormats:
+ - json
+ - object
+ title: Search Parameters
+ required: []
+ format: object
+ required:
+ - collection-name
+ - vector
+ - vector-field
+ - limit
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Vector search status.
+ uiOrder: 0
+ title: Status
+ format: string
+ result:
+ description: Result of the vector search operation.
+ uiOrder: 0
+ title: Result
+ properties:
+ ids:
+ description: The ids returned from the vector search operation.
+ uiOrder: 0
+ title: IDs
+ required: []
+ items:
+ description: An id of the point.
+ example: c8faa-4b3b-4b3b-4b3b
+ format: string
+ format: array
+ data:
+ description: The points returned from the vector search operation.
+ uiOrder: 1
+ required: []
+ title: Data
+ items:
+ title: Datum
+ format: object
+ required: []
+ format: array
+ vectors:
+ description: The vectors returned from the vector search operation.
+ uiOrder: 2
+ title: Vectors
+ required: []
+ items:
+ description: The vector from array vectors.
+ required: []
+ items:
+ description: A dimension of the vector.
+ example: 0.8167237
+ format: number
+ format: array
+ format: array
+ metadata:
+ description: The metadata returned from the vector search operation.
+ uiOrder: 3
+ title: Metadata
+ required: []
+ items:
+ title: Metadatum
+ format: object
+ required: []
+ format: array
+ required: []
+ format: object
+ required:
+ - status
+ - result
+ title: Output
+ format: object
+TASK_UPSERT:
+ shortDescription: Insert a vector data into a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to upsert the data into.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to upsert the data from. If empty then
+ default partition will be used.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ data:
+ description: The data.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 2
+ title: Data
+ required: []
+ format: object
+ required:
+ - collection-name
+ - data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Upsert status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_BATCH_UPSERT:
+ shortDescription: Insert a batch of vector data into a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to upsert the data into.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to upsert the data from. If empty then
+ default partition will be used.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ array-data:
+ description: The data.
+ acceptFormats:
+ - array
+ - array
+ - array
+ - array
+ uiOrder: 2
+ title: Array Data
+ items:
+ description: A datum.
+ required: []
+ format: object
+ format: array
+ required:
+ - collection-name
+ - array-data
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Batch upsert status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DELETE:
+ shortDescription: Delete vector data from a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to delete the data from.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to delete the data from. If empty then
+ default partition will be used.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ filter:
+ description: The properties filter to be applied to the data with zilliz scalar
+ filter, please refer to [filtered-search](https://docs.zilliz.com/docs/single-vector-search?_highlight=filter/docs/single-vector-search#filtered-search).
+ uiOrder: 2
+ acceptFormats:
+ - string
+ title: Filter
+ format: string
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Delete status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_CREATE_COLLECTION:
+ shortDescription: Create a collection, please refer to [create-collection-v2](https://docs.zilliz.com/reference/restful/create-collection-v2)
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to create.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ dimension:
+ description: The dimension of the collection.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ title: Dimension
+ format: integer
+ id-type:
+ description: The type of the id.
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: ID Type
+ format: string
+ schema:
+ description: The schema of the collection.
+ acceptFormats:
+ - json
+ - object
+ uiOrder: 4
+ title: Schema
+ required: []
+ format: object
+ auto-id:
+ description: Whether to auto generate id.
+ acceptFormats:
+ - boolean
+ uiOrder: 5
+ title: Auto ID
+ default: false
+ format: boolean
+ metric-type:
+ description: The metric type of the collection.
+ acceptFormats:
+ - string
+ uiOrder: 6
+ title: Metric Type
+ enum:
+ - L2
+ - IP
+ - COSINE
+ default: L2
+ format: string
+ index-params:
+ description: The index parameters to be applied to the collection with zilliz
+ index parameters, please refer to [index-parameter](https://zilliz.io/docs/single-vector-search.md#Index-parameters).
+ uiOrder: 7
+ acceptFormats:
+ - json
+ - object
+ title: Index Parameters
+ required: []
+ format: object
+ params:
+ description: The parameters to be applied to the collection with zilliz parameters,
+ please refer to [parameters](https://zilliz.io/docs/single-vector-search.md#Parameters).
+ uiOrder: 8
+ acceptFormats:
+ - json
+ - object
+ title: Parameters
+ required: []
+ format: object
+ required:
+ - collection-name
+ - dimension
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Create collection status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DROP_COLLECTION:
+ shortDescription: Drop a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to drop.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ required:
+ - collection-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Drop collection status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_CREATE_PARTITION:
+ shortDescription: Create a partition in a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to create the partition in.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to create.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ required:
+ - collection-name
+ - partition-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Create partition status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
+TASK_DROP_PARTITION:
+ shortDescription: Drop a partition from a collection
+ input:
+ uiOrder: 0
+ properties:
+ collection-name:
+ description: The name of the collection to drop the partition from.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Collection Name
+ format: string
+ partition-name:
+ description: The name of the partition to drop.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Partition Name
+ format: string
+ required:
+ - collection-name
+ - partition-name
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ status:
+ description: Drop partition status.
+ uiOrder: 0
+ title: Status
+ format: string
+ required:
+ - status
+ title: Output
+ format: object
diff --git a/pkg/component/data/zilliz/v0/main.go b/pkg/component/data/zilliz/v0/main.go
index ecf34aee5..a4f8857d3 100644
--- a/pkg/component/data/zilliz/v0/main.go
+++ b/pkg/component/data/zilliz/v0/main.go
@@ -26,14 +26,14 @@ const (
TaskDropPartition = "TASK_DROP_PARTITION"
)
-//go:embed config/definition.json
-var definitionJSON []byte
+//go:embed config/definition.yaml
+var definitionYAML []byte
-//go:embed config/setup.json
-var setupJSON []byte
+//go:embed config/setup.yaml
+var setupYAML []byte
-//go:embed config/tasks.json
-var tasksJSON []byte
+//go:embed config/tasks.yaml
+var tasksYAML []byte
var once sync.Once
var comp *component
@@ -52,7 +52,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/generic/collection/v0/README.mdx b/pkg/component/generic/collection/v0/README.mdx
index bf144e219..588b1ee0e 100644
--- a/pkg/component/generic/collection/v0/README.mdx
+++ b/pkg/component/generic/collection/v0/README.mdx
@@ -26,7 +26,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/collection/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/collection/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/collection/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/collection/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/generic/collection/v0/config/definition.json b/pkg/component/generic/collection/v0/config/definition.json
deleted file mode 100644
index e2048a19a..000000000
--- a/pkg/component/generic/collection/v0/config/definition.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "availableTasks": [
- "TASK_APPEND",
- "TASK_ASSIGN",
- "TASK_CONCAT",
- "TASK_DIFFERENCE",
- "TASK_INTERSECTION",
- "TASK_SPLIT",
- "TASK_SYMMETRIC_DIFFERENCE",
- "TASK_UNION"
- ],
- "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/pipeline-backend/blob/main/pkg/component/generic/collection/v0",
- "description": "Manipulate collection-type data.",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/generic/collection/v0/config/definition.yaml b/pkg/component/generic/collection/v0/config/definition.yaml
new file mode 100644
index 000000000..7bdaf8620
--- /dev/null
+++ b/pkg/component/generic/collection/v0/config/definition.yaml
@@ -0,0 +1,23 @@
+availableTasks:
+- TASK_APPEND
+- TASK_ASSIGN
+- TASK_CONCAT
+- TASK_DIFFERENCE
+- TASK_INTERSECTION
+- TASK_SPLIT
+- TASK_SYMMETRIC_DIFFERENCE
+- TASK_UNION
+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/pipeline-backend/blob/main/pkg/component/generic/collection/v0
+description: Manipulate collection-type data.
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/generic/collection/v0/config/tasks.json b/pkg/component/generic/collection/v0/config/tasks.json
deleted file mode 100644
index bdd58833a..000000000
--- a/pkg/component/generic/collection/v0/config/tasks.json
+++ /dev/null
@@ -1,381 +0,0 @@
-{
- "TASK_APPEND": {
- "shortDescription": "Append values to create or extend an array, or add key-value pairs to an object.",
- "input": {
- "description": "Input parameters for append operation.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "The input data. If it's an array, the value will be appended. If it's an object, the key-value pairs from value will be added. If it's a primitive type (string, number, boolean), it will be converted to a single-element array before appending.",
- "acceptFormats": [
- "*"
- ],
- "uiOrder": 0,
- "title": "Data",
- "format": "*"
- },
- "value": {
- "description": "The value to append. For arrays: the value will be appended as a new element. For objects: if value is an object, its key-value pairs will be added to the input object. For primitives: value will be appended to create/extend an array.",
- "acceptFormats": [
- "*"
- ],
- "uiOrder": 1,
- "title": "Value",
- "format": "*"
- }
- },
- "required": [
- "data",
- "value"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output containing the modified data structure.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "The resulting data structure after the append operation. Will be either an array (if input was array or primitive) or an object (if input was object). Examples: [1,2,3], {'name':'John', 'age':25}, or ['hello','world'].",
- "uiOrder": 0,
- "required": [],
- "title": "Data",
- "format": "*"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_ASSIGN": {
- "shortDescription": "Assign a value to a specific path in a data structure.",
- "input": {
- "description": "Input parameters for assign operation.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "The input data structure to modify. Can be an array, object, or primitive value.",
- "acceptFormats": [
- "*"
- ],
- "uiOrder": 0,
- "title": "Data",
- "format": "*"
- },
- "path": {
- "description": "The path where to assign the value. Use dot notation for nested objects and [n] for array indices. Examples: 'users.[0].name', '.[0].key', 'metadata.tags.[2]'.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Path",
- "format": "string"
- },
- "value": {
- "description": "The value to assign at the specified path. Can be any type (string, number, boolean, array, or object).",
- "acceptFormats": [
- "*"
- ],
- "uiOrder": 2,
- "title": "Value",
- "format": "*"
- }
- },
- "required": [
- "data",
- "path",
- "value"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output containing the modified data structure.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "The resulting data structure after the assign operation.",
- "uiOrder": 0,
- "title": "Data",
- "format": "*"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CONCAT": {
- "shortDescription": "Concatenate multiple arrays or merge multiple objects into a single collection.",
- "input": {
- "description": "Input parameters for concat operation. Can handle both arrays and objects.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "An array of arrays or objects to be concatenated/merged. For arrays: [[1, 2], [3, 4]] becomes [1, 2, 3, 4]. For objects: [{'a': 1}, {'b': 2}] becomes {'a': 1, 'b': 2}. Later values override earlier ones for objects.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "items": {
- "format": "*"
- },
- "title": "Data",
- "format": "array"
- }
- },
- "required": [
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output containing the concatenated/merged result.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "The resulting array or object after concat operation.",
- "uiOrder": 0,
- "title": "Data",
- "format": "*"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DIFFERENCE": {
- "shortDescription": "Find elements that exist in the first array or object but not in any of the other arrays or objects.",
- "input": {
- "description": "Input parameters for difference operation. Can handle both arrays and objects.",
- "properties": {
- "data": {
- "description": "An array of arrays or objects to find the difference. The first element is compared against all subsequent elements. For example, given arrays [[1, 2, 3], [2, 3, 4], [3, 4, 5]], the result will be [1]. For objects, given [{'a': 1, 'b': 2}, {'b': 2, 'c': 3}], the result will be {'a': 1}.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "items": {
- "format": "*"
- },
- "required": [],
- "title": "Data",
- "format": "array"
- }
- },
- "required": [
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output containing the difference result.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "The resulting array or object after the difference operation.",
- "uiOrder": 0,
- "title": "Data",
- "format": "*"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_INTERSECTION": {
- "shortDescription": "Find common elements that exist in all input arrays or objects.",
- "input": {
- "description": "Input parameters for intersection operation. Can handle both arrays and objects.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "An array of arrays or objects to find common elements. For arrays: given [[1, 2, 3], [2, 3, 4]], the result will be [2, 3]. For objects: given [{'a': 1, 'b': 2}, {'b': 2, 'c': 3}], the result will be {'b': 2}.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "items": {
- "format": "*"
- },
- "title": "Data",
- "format": "array"
- }
- },
- "required": [
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output containing the intersection result.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "The resulting array or object after the intersection operation.",
- "uiOrder": 0,
- "title": "Data",
- "format": "*"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SPLIT": {
- "shortDescription": "Split arrays or objects into smaller chunks.",
- "input": {
- "description": "Input parameters for split operation.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "The source data to be split. Can be: 1) An array to split into groups 2) An object to split by property count (keys are sorted alphabetically for consistent ordering)",
- "acceptFormats": [
- "*"
- ],
- "uiOrder": 0,
- "title": "Data",
- "format": "*"
- },
- "size": {
- "description": "Number of elements per group",
- "uiOrder": 1,
- "acceptFormats": [
- "integer"
- ],
- "title": "Size",
- "format": "integer"
- }
- },
- "required": [
- "data",
- "size"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output containing the split results. For objects, the properties in each chunk maintain alphabetical ordering of keys.",
- "uiOrder": 1,
- "properties": {
- "data": {
- "description": "The resulting array after splitting. For arrays: array of subarrays. For objects: array of smaller objects with alphabetically ordered keys",
- "uiOrder": 0,
- "items": {
- "format": "*"
- },
- "title": "Data",
- "format": "array"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SYMMETRIC_DIFFERENCE": {
- "shortDescription": "Find elements that exist in exactly one of the input arrays or objects, but not in multiple inputs.",
- "input": {
- "description": "Input parameters for symmetric difference operation. Can handle both arrays and objects.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "An array of arrays or objects to find symmetric difference. For arrays: given [[1, 2], [2, 3]], the result will be [1, 3]. For objects: given [{'a': 1, 'b': 2}, {'b': 2, 'c': 3}], the result will be {'a': 1, 'c': 3}.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "items": {
- "format": "*"
- },
- "title": "Data",
- "format": "array"
- }
- },
- "required": [
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output containing the symmetric difference result.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "The resulting array or object after the symmetric difference operation.",
- "uiOrder": 0,
- "title": "Data",
- "format": "*"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UNION": {
- "shortDescription": "Find unique elements that exist in any of the input arrays or objects.",
- "input": {
- "description": "Input parameters for union operation. Can handle both arrays and objects.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "An array of arrays or objects to find unique elements. For arrays: given [[1, 2], [2, 3]], the result will be [1, 2, 3]. For objects: given [{'a': 1, 'b': 2}, {'b': 2, 'c': 3}], the result will be {'a': 1, 'b': 2, 'c': 3}.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "items": {
- "format": "*"
- },
- "title": "Data",
- "format": "array"
- }
- },
- "required": [
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output containing the union result.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "The resulting array or object after the union operation.",
- "uiOrder": 0,
- "title": "Data",
- "format": "*"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/generic/collection/v0/config/tasks.yaml b/pkg/component/generic/collection/v0/config/tasks.yaml
new file mode 100644
index 000000000..f4839432a
--- /dev/null
+++ b/pkg/component/generic/collection/v0/config/tasks.yaml
@@ -0,0 +1,328 @@
+TASK_APPEND:
+ shortDescription: Append values to create or extend an array, or add key-value pairs
+ to an object.
+ input:
+ description: Input parameters for append operation.
+ uiOrder: 0
+ properties:
+ data:
+ description: The input data. If it's an array, the value will be appended.
+ If it's an object, the key-value pairs from value will be added. If it's
+ a primitive type (string, number, boolean), it will be converted to a single-element
+ array before appending.
+ acceptFormats:
+ - '*'
+ uiOrder: 0
+ title: Data
+ format: '*'
+ value:
+ description: 'The value to append. For arrays: the value will be appended
+ as a new element. For objects: if value is an object, its key-value pairs
+ will be added to the input object. For primitives: value will be appended
+ to create/extend an array.'
+ acceptFormats:
+ - '*'
+ uiOrder: 1
+ title: Value
+ format: '*'
+ required:
+ - data
+ - value
+ title: Input
+ format: object
+ output:
+ description: Output containing the modified data structure.
+ uiOrder: 0
+ properties:
+ data:
+ description: 'The resulting data structure after the append operation. Will
+ be either an array (if input was array or primitive) or an object (if input
+ was object). Examples: [1,2,3], {''name'':''John'', ''age'':25}, or [''hello'',''world''].'
+ uiOrder: 0
+ required: []
+ title: Data
+ format: '*'
+ required:
+ - data
+ title: Output
+ format: object
+TASK_ASSIGN:
+ shortDescription: Assign a value to a specific path in a data structure.
+ input:
+ description: Input parameters for assign operation.
+ uiOrder: 0
+ properties:
+ data:
+ description: The input data structure to modify. Can be an array, object,
+ or primitive value.
+ acceptFormats:
+ - '*'
+ uiOrder: 0
+ title: Data
+ format: '*'
+ path:
+ description: 'The path where to assign the value. Use dot notation for nested
+ objects and [n] for array indices. Examples: ''users.[0].name'', ''.[0].key'',
+ ''metadata.tags.[2]''.'
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Path
+ format: string
+ value:
+ description: The value to assign at the specified path. Can be any type (string,
+ number, boolean, array, or object).
+ acceptFormats:
+ - '*'
+ uiOrder: 2
+ title: Value
+ format: '*'
+ required:
+ - data
+ - path
+ - value
+ title: Input
+ format: object
+ output:
+ description: Output containing the modified data structure.
+ uiOrder: 0
+ properties:
+ data:
+ description: The resulting data structure after the assign operation.
+ uiOrder: 0
+ title: Data
+ format: '*'
+ required:
+ - data
+ title: Output
+ format: object
+TASK_CONCAT:
+ shortDescription: Concatenate multiple arrays or merge multiple objects into a single
+ collection.
+ input:
+ description: Input parameters for concat operation. Can handle both arrays and
+ objects.
+ uiOrder: 0
+ properties:
+ data:
+ description: 'An array of arrays or objects to be concatenated/merged. For
+ arrays: [[1, 2], [3, 4]] becomes [1, 2, 3, 4]. For objects: [{''a'': 1},
+ {''b'': 2}] becomes {''a'': 1, ''b'': 2}. Later values override earlier
+ ones for objects.'
+ acceptFormats:
+ - array
+ uiOrder: 0
+ items:
+ format: '*'
+ title: Data
+ format: array
+ required:
+ - data
+ title: Input
+ format: object
+ output:
+ description: Output containing the concatenated/merged result.
+ uiOrder: 0
+ properties:
+ data:
+ description: The resulting array or object after concat operation.
+ uiOrder: 0
+ title: Data
+ format: '*'
+ required:
+ - data
+ title: Output
+ format: object
+TASK_DIFFERENCE:
+ shortDescription: Find elements that exist in the first array or object but not
+ in any of the other arrays or objects.
+ input:
+ description: Input parameters for difference operation. Can handle both arrays
+ and objects.
+ properties:
+ data:
+ description: 'An array of arrays or objects to find the difference. The first
+ element is compared against all subsequent elements. For example, given
+ arrays [[1, 2, 3], [2, 3, 4], [3, 4, 5]], the result will be [1]. For objects,
+ given [{''a'': 1, ''b'': 2}, {''b'': 2, ''c'': 3}], the result will be {''a'':
+ 1}.'
+ acceptFormats:
+ - array
+ uiOrder: 0
+ items:
+ format: '*'
+ required: []
+ title: Data
+ format: array
+ required:
+ - data
+ title: Input
+ format: object
+ output:
+ description: Output containing the difference result.
+ uiOrder: 0
+ properties:
+ data:
+ description: The resulting array or object after the difference operation.
+ uiOrder: 0
+ title: Data
+ format: '*'
+ required:
+ - data
+ title: Output
+ format: object
+TASK_INTERSECTION:
+ shortDescription: Find common elements that exist in all input arrays or objects.
+ input:
+ description: Input parameters for intersection operation. Can handle both arrays
+ and objects.
+ uiOrder: 0
+ properties:
+ data:
+ description: 'An array of arrays or objects to find common elements. For arrays:
+ given [[1, 2, 3], [2, 3, 4]], the result will be [2, 3]. For objects: given
+ [{''a'': 1, ''b'': 2}, {''b'': 2, ''c'': 3}], the result will be {''b'':
+ 2}.'
+ acceptFormats:
+ - array
+ uiOrder: 0
+ items:
+ format: '*'
+ title: Data
+ format: array
+ required:
+ - data
+ title: Input
+ format: object
+ output:
+ description: Output containing the intersection result.
+ uiOrder: 0
+ properties:
+ data:
+ description: The resulting array or object after the intersection operation.
+ uiOrder: 0
+ title: Data
+ format: '*'
+ required:
+ - data
+ title: Output
+ format: object
+TASK_SPLIT:
+ shortDescription: Split arrays or objects into smaller chunks.
+ input:
+ description: Input parameters for split operation.
+ uiOrder: 0
+ properties:
+ data:
+ description: 'The source data to be split. Can be: 1) An array to split into
+ groups 2) An object to split by property count (keys are sorted alphabetically
+ for consistent ordering)'
+ acceptFormats:
+ - '*'
+ uiOrder: 0
+ title: Data
+ format: '*'
+ size:
+ description: Number of elements per group
+ uiOrder: 1
+ acceptFormats:
+ - integer
+ title: Size
+ format: integer
+ required:
+ - data
+ - size
+ title: Input
+ format: object
+ output:
+ description: Output containing the split results. For objects, the properties
+ in each chunk maintain alphabetical ordering of keys.
+ uiOrder: 1
+ properties:
+ data:
+ description: 'The resulting array after splitting. For arrays: array of subarrays.
+ For objects: array of smaller objects with alphabetically ordered keys'
+ uiOrder: 0
+ items:
+ format: '*'
+ title: Data
+ format: array
+ required:
+ - data
+ title: Output
+ format: object
+TASK_SYMMETRIC_DIFFERENCE:
+ shortDescription: Find elements that exist in exactly one of the input arrays or
+ objects, but not in multiple inputs.
+ input:
+ description: Input parameters for symmetric difference operation. Can handle both
+ arrays and objects.
+ uiOrder: 0
+ properties:
+ data:
+ description: 'An array of arrays or objects to find symmetric difference.
+ For arrays: given [[1, 2], [2, 3]], the result will be [1, 3]. For objects:
+ given [{''a'': 1, ''b'': 2}, {''b'': 2, ''c'': 3}], the result will be {''a'':
+ 1, ''c'': 3}.'
+ acceptFormats:
+ - array
+ uiOrder: 0
+ items:
+ format: '*'
+ title: Data
+ format: array
+ required:
+ - data
+ title: Input
+ format: object
+ output:
+ description: Output containing the symmetric difference result.
+ uiOrder: 0
+ properties:
+ data:
+ description: The resulting array or object after the symmetric difference
+ operation.
+ uiOrder: 0
+ title: Data
+ format: '*'
+ required:
+ - data
+ title: Output
+ format: object
+TASK_UNION:
+ shortDescription: Find unique elements that exist in any of the input arrays or
+ objects.
+ input:
+ description: Input parameters for union operation. Can handle both arrays and
+ objects.
+ uiOrder: 0
+ properties:
+ data:
+ description: 'An array of arrays or objects to find unique elements. For arrays:
+ given [[1, 2], [2, 3]], the result will be [1, 2, 3]. For objects: given
+ [{''a'': 1, ''b'': 2}, {''b'': 2, ''c'': 3}], the result will be {''a'':
+ 1, ''b'': 2, ''c'': 3}.'
+ acceptFormats:
+ - array
+ uiOrder: 0
+ items:
+ format: '*'
+ title: Data
+ format: array
+ required:
+ - data
+ title: Input
+ format: object
+ output:
+ description: Output containing the union result.
+ uiOrder: 0
+ properties:
+ data:
+ description: The resulting array or object after the union operation.
+ uiOrder: 0
+ title: Data
+ format: '*'
+ required:
+ - data
+ title: Output
+ format: object
diff --git a/pkg/component/generic/collection/v0/main.go b/pkg/component/generic/collection/v0/main.go
index 656040e1a..f3bda2af4 100644
--- a/pkg/component/generic/collection/v0/main.go
+++ b/pkg/component/generic/collection/v0/main.go
@@ -24,10 +24,10 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -47,7 +47,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/generic/http/v0/README.mdx b/pkg/component/generic/http/v0/README.mdx
index 048d8d4d9..4e8126f45 100644
--- a/pkg/component/generic/http/v0/README.mdx
+++ b/pkg/component/generic/http/v0/README.mdx
@@ -25,7 +25,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/http/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/http/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/http/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/http/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/generic/http/v0/config/definition.json b/pkg/component/generic/http/v0/config/definition.json
deleted file mode 100644
index 1026e37e2..000000000
--- a/pkg/component/generic/http/v0/config/definition.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "availableTasks": [
- "TASK_GET",
- "TASK_POST",
- "TASK_PATCH",
- "TASK_PUT",
- "TASK_DELETE",
- "TASK_HEAD",
- "TASK_OPTIONS"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/generic/http",
- "icon": "assets/http.svg",
- "iconUrl": "",
- "id": "http",
- "public": true,
- "title": "HTTP",
- "description": "Make requests to external HTTP APIs.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_GENERIC",
- "uid": "5ee55a5c-6e30-4c7a-80e8-90165a729e0a",
- "vendor": "",
- "vendorAttributes": {},
- "version": "0.2.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/http/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/generic/http/v0/config/definition.yaml b/pkg/component/generic/http/v0/config/definition.yaml
new file mode 100644
index 000000000..4dcd8c07e
--- /dev/null
+++ b/pkg/component/generic/http/v0/config/definition.yaml
@@ -0,0 +1,24 @@
+availableTasks:
+- TASK_GET
+- TASK_POST
+- TASK_PATCH
+- TASK_PUT
+- TASK_DELETE
+- TASK_HEAD
+- TASK_OPTIONS
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/generic/http
+icon: assets/http.svg
+iconUrl: ''
+id: http
+public: true
+title: HTTP
+description: Make requests to external HTTP APIs.
+tombstone: false
+type: COMPONENT_TYPE_GENERIC
+uid: 5ee55a5c-6e30-4c7a-80e8-90165a729e0a
+vendor: ''
+vendorAttributes: {}
+version: 0.2.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/http/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/generic/http/v0/config/setup.json b/pkg/component/generic/http/v0/config/setup.json
deleted file mode 100644
index 6767444cb..000000000
--- a/pkg/component/generic/http/v0/config/setup.json
+++ /dev/null
@@ -1,159 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": false,
- "properties": {
- "authentication": {
- "description": "Authentication method to use for the REST API.",
- "uiOrder": 0,
- "oneOf": [
- {
- "properties": {
- "auth-type": {
- "const": "NO_AUTH",
- "description": "No Authentication.",
- "uiOrder": 0,
- "order": 0,
- "title": "Auth Type",
- "format": "string"
- }
- },
- "required": [
- "auth-type"
- ],
- "title": "No Auth"
- },
- {
- "properties": {
- "auth-type": {
- "const": "BASIC_AUTH",
- "description": "Basic auth.",
- "uiOrder": 0,
- "order": 0,
- "title": "Auth Type",
- "format": "string"
- },
- "password": {
- "description": "Password for Basic auth.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 2,
- "order": 2,
- "title": "Password",
- "format": "string"
- },
- "username": {
- "description": "Username for Basic Auth.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "order": 1,
- "title": "Username",
- "format": "string"
- }
- },
- "required": [
- "auth-type",
- "username",
- "password"
- ],
- "title": "Basic Auth"
- },
- {
- "properties": {
- "auth-location": {
- "default": "header",
- "description": "Add the API key to the header or query params.",
- "enum": [
- "header",
- "query"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "order": 3,
- "title": "Auth Location",
- "format": "string"
- },
- "auth-type": {
- "const": "API_KEY",
- "description": "API key authentication.",
- "uiOrder": 0,
- "order": 0,
- "title": "Auth Type",
- "format": "string"
- },
- "key": {
- "default": "X-API-Key",
- "description": "Key name for API key authentication.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "order": 1,
- "title": "Key Name",
- "format": "string"
- },
- "value": {
- "description": "Key value for API key authentication.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 2,
- "order": 2,
- "title": "Key Value",
- "format": "string"
- }
- },
- "required": [
- "auth-type",
- "key",
- "value",
- "auth-location"
- ],
- "title": "API Key"
- },
- {
- "properties": {
- "auth-type": {
- "const": "BEARER_TOKEN",
- "description": "Bearer token authentication.",
- "uiOrder": 0,
- "order": 0,
- "title": "Auth Type",
- "format": "string"
- },
- "token": {
- "description": "Bearer token.",
- "acceptFormats": [
- "string"
- ],
- "instillSecret": true,
- "uiOrder": 1,
- "order": 1,
- "title": "Token",
- "format": "string"
- }
- },
- "required": [
- "auth-type",
- "token"
- ],
- "title": "Bearer Token"
- }
- ],
- "order": 1,
- "title": "Authentication",
- "format": "object"
- }
- },
- "required": [
- "authentication"
- ],
- "title": "REST API Connection",
- "format": "object"
-}
diff --git a/pkg/component/generic/http/v0/config/setup.yaml b/pkg/component/generic/http/v0/config/setup.yaml
new file mode 100644
index 000000000..013f56b73
--- /dev/null
+++ b/pkg/component/generic/http/v0/config/setup.yaml
@@ -0,0 +1,119 @@
+additionalProperties: false
+properties:
+ authentication:
+ description: Authentication method to use for the REST API.
+ uiOrder: 0
+ oneOf:
+ - properties:
+ auth-type:
+ const: NO_AUTH
+ description: No Authentication.
+ uiOrder: 0
+ order: 0
+ title: Auth Type
+ format: string
+ required:
+ - auth-type
+ title: No Auth
+ - properties:
+ auth-type:
+ const: BASIC_AUTH
+ description: Basic auth.
+ uiOrder: 0
+ order: 0
+ title: Auth Type
+ format: string
+ password:
+ description: Password for Basic auth.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 2
+ order: 2
+ title: Password
+ format: string
+ username:
+ description: Username for Basic Auth.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ order: 1
+ title: Username
+ format: string
+ required:
+ - auth-type
+ - username
+ - password
+ title: Basic Auth
+ - properties:
+ auth-location:
+ default: header
+ description: Add the API key to the header or query params.
+ enum:
+ - header
+ - query
+ acceptFormats:
+ - string
+ uiOrder: 3
+ order: 3
+ title: Auth Location
+ format: string
+ auth-type:
+ const: API_KEY
+ description: API key authentication.
+ uiOrder: 0
+ order: 0
+ title: Auth Type
+ format: string
+ key:
+ default: X-API-Key
+ description: Key name for API key authentication.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ order: 1
+ title: Key Name
+ format: string
+ value:
+ description: Key value for API key authentication.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 2
+ order: 2
+ title: Key Value
+ format: string
+ required:
+ - auth-type
+ - key
+ - value
+ - auth-location
+ title: API Key
+ - properties:
+ auth-type:
+ const: BEARER_TOKEN
+ description: Bearer token authentication.
+ uiOrder: 0
+ order: 0
+ title: Auth Type
+ format: string
+ token:
+ description: Bearer token.
+ acceptFormats:
+ - string
+ instillSecret: true
+ uiOrder: 1
+ order: 1
+ title: Token
+ format: string
+ required:
+ - auth-type
+ - token
+ title: Bearer Token
+ order: 1
+ title: Authentication
+ format: object
+required:
+- authentication
+title: REST API Connection
+format: object
diff --git a/pkg/component/generic/http/v0/config/tasks.json b/pkg/component/generic/http/v0/config/tasks.json
deleted file mode 100644
index a4bb1ed42..000000000
--- a/pkg/component/generic/http/v0/config/tasks.json
+++ /dev/null
@@ -1,173 +0,0 @@
-{
- "$defs": {
- "inputWithBody": {
- "uiOrder": 0,
- "properties": {
- "body": {
- "description": "The request body.",
- "acceptFormats": [
- "*"
- ],
- "shortDescription": "The request body",
- "uiOrder": 1,
- "order": 1,
- "required": [],
- "title": "Body"
- },
- "endpoint-url": {
- "description": "The API endpoint url.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Endpoint Url",
- "format": "string"
- },
- "output-body-schema": {
- "description": "The JSON schema of output body.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The JSON schema of output body",
- "uiOrder": 1,
- "order": 2,
- "required": [],
- "title": "Body",
- "format": "string"
- }
- },
- "required": [
- "endpoint-url"
- ],
- "title": "Input",
- "format": "object"
- },
- "inputWithoutBody": {
- "uiOrder": 0,
- "properties": {
- "endpoint-url": {
- "description": "The API endpoint url.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Endpoint Url",
- "format": "string"
- },
- "output-body-schema": {
- "description": "The request body.",
- "acceptFormats": [
- "string"
- ],
- "shortDescription": "The request body",
- "uiOrder": 1,
- "order": 1,
- "required": [],
- "title": "Body",
- "format": "string"
- }
- },
- "required": [
- "endpoint-url"
- ],
- "title": "Input Without Body",
- "format": "object"
- },
- "output": {
- "description": "The HTTP response from the API.",
- "uiOrder": 0,
- "properties": {
- "body": {
- "description": "The body of the response.",
- "uiOrder": 1,
- "required": [],
- "title": "Body",
- "format": "*"
- },
- "header": {
- "description": "The HTTP header of the response.",
- "uiOrder": 2,
- "required": [],
- "title": "Header",
- "format": "json"
- },
- "status-code": {
- "description": "The HTTP status code of the response.",
- "uiOrder": 0,
- "title": "Status Code",
- "format": "integer"
- }
- },
- "required": [
- "status-code",
- "body",
- "header"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DELETE": {
- "shortDescription": "Send a HTTP DELETE request.",
- "input": {
- "$ref": "#/$defs/inputWithBody"
- },
- "output": {
- "$ref": "#/$defs/output"
- }
- },
- "TASK_GET": {
- "shortDescription": "Send a HTTP GET request.",
- "input": {
- "$ref": "#/$defs/inputWithoutBody"
- },
- "output": {
- "$ref": "#/$defs/output"
- }
- },
- "TASK_HEAD": {
- "shortDescription": "Send a HTTP HEAD request.",
- "input": {
- "$ref": "#/$defs/inputWithoutBody"
- },
- "output": {
- "$ref": "#/$defs/output"
- }
- },
- "TASK_OPTIONS": {
- "shortDescription": "Send a HTTP OPTIONS request.",
- "input": {
- "$ref": "#/$defs/inputWithBody"
- },
- "output": {
- "$ref": "#/$defs/output"
- }
- },
- "TASK_PATCH": {
- "shortDescription": "Send a HTTP PATCH request.",
- "input": {
- "$ref": "#/$defs/inputWithBody"
- },
- "output": {
- "$ref": "#/$defs/output"
- }
- },
- "TASK_POST": {
- "shortDescription": "Send a HTTP POST request.",
- "input": {
- "$ref": "#/$defs/inputWithBody"
- },
- "output": {
- "$ref": "#/$defs/output"
- }
- },
- "TASK_PUT": {
- "shortDescription": "Send a HTTP PUT request.",
- "input": {
- "$ref": "#/$defs/inputWithBody"
- },
- "output": {
- "$ref": "#/$defs/output"
- }
- }
-}
diff --git a/pkg/component/generic/http/v0/config/tasks.yaml b/pkg/component/generic/http/v0/config/tasks.yaml
new file mode 100644
index 000000000..ddf173e1c
--- /dev/null
+++ b/pkg/component/generic/http/v0/config/tasks.yaml
@@ -0,0 +1,127 @@
+$defs:
+ inputWithBody:
+ uiOrder: 0
+ properties:
+ body:
+ description: The request body.
+ acceptFormats:
+ - '*'
+ shortDescription: The request body
+ uiOrder: 1
+ order: 1
+ required: []
+ title: Body
+ endpoint-url:
+ description: The API endpoint url.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Endpoint Url
+ format: string
+ output-body-schema:
+ description: The JSON schema of output body.
+ acceptFormats:
+ - string
+ shortDescription: The JSON schema of output body
+ uiOrder: 1
+ order: 2
+ required: []
+ title: Body
+ format: string
+ required:
+ - endpoint-url
+ title: Input
+ format: object
+ inputWithoutBody:
+ uiOrder: 0
+ properties:
+ endpoint-url:
+ description: The API endpoint url.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Endpoint Url
+ format: string
+ output-body-schema:
+ description: The request body.
+ acceptFormats:
+ - string
+ shortDescription: The request body
+ uiOrder: 1
+ order: 1
+ required: []
+ title: Body
+ format: string
+ required:
+ - endpoint-url
+ title: Input Without Body
+ format: object
+ output:
+ description: The HTTP response from the API.
+ uiOrder: 0
+ properties:
+ body:
+ description: The body of the response.
+ uiOrder: 1
+ required: []
+ title: Body
+ format: '*'
+ header:
+ description: The HTTP header of the response.
+ uiOrder: 2
+ required: []
+ title: Header
+ format: json
+ status-code:
+ description: The HTTP status code of the response.
+ uiOrder: 0
+ title: Status Code
+ format: integer
+ required:
+ - status-code
+ - body
+ - header
+ title: Output
+ format: object
+TASK_DELETE:
+ shortDescription: Send a HTTP DELETE request.
+ input:
+ $ref: '#/$defs/inputWithBody'
+ output:
+ $ref: '#/$defs/output'
+TASK_GET:
+ shortDescription: Send a HTTP GET request.
+ input:
+ $ref: '#/$defs/inputWithoutBody'
+ output:
+ $ref: '#/$defs/output'
+TASK_HEAD:
+ shortDescription: Send a HTTP HEAD request.
+ input:
+ $ref: '#/$defs/inputWithoutBody'
+ output:
+ $ref: '#/$defs/output'
+TASK_OPTIONS:
+ shortDescription: Send a HTTP OPTIONS request.
+ input:
+ $ref: '#/$defs/inputWithBody'
+ output:
+ $ref: '#/$defs/output'
+TASK_PATCH:
+ shortDescription: Send a HTTP PATCH request.
+ input:
+ $ref: '#/$defs/inputWithBody'
+ output:
+ $ref: '#/$defs/output'
+TASK_POST:
+ shortDescription: Send a HTTP POST request.
+ input:
+ $ref: '#/$defs/inputWithBody'
+ output:
+ $ref: '#/$defs/output'
+TASK_PUT:
+ shortDescription: Send a HTTP PUT request.
+ input:
+ $ref: '#/$defs/inputWithBody'
+ output:
+ $ref: '#/$defs/output'
diff --git a/pkg/component/generic/http/v0/main.go b/pkg/component/generic/http/v0/main.go
index 0b8cc6320..e0b7c1463 100644
--- a/pkg/component/generic/http/v0/main.go
+++ b/pkg/component/generic/http/v0/main.go
@@ -35,12 +35,12 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/setup.json
- setupJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/setup.yaml
+ setupYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -70,7 +70,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, setupJSON, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, setupYAML, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/generic/scheduler/v0/README.mdx b/pkg/component/generic/scheduler/v0/README.mdx
index a7e482e70..8c7d52685 100644
--- a/pkg/component/generic/scheduler/v0/README.mdx
+++ b/pkg/component/generic/scheduler/v0/README.mdx
@@ -18,7 +18,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/scheduler/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/scheduler/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/scheduler/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/scheduler/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/generic/scheduler/v0/config/definition.json b/pkg/component/generic/scheduler/v0/config/definition.json
deleted file mode 100644
index 3f456f4cd..000000000
--- a/pkg/component/generic/scheduler/v0/config/definition.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "availableTasks": [],
- "availableEvents": [
- "EVENT_CRON_JOB_TRIGGERED"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/generic/scheduler",
- "icon": "assets/scheduler.svg",
- "id": "scheduler",
- "public": true,
- "title": "Scheduler",
- "vendor": "Generic",
- "description": "Trigger pipelines on a scheduler using cron expressions.",
- "tombstone": false,
- "type": "COMPONENT_TYPE_GENERIC",
- "uid": "f2a89c6d-e315-4b7a-9d8f-c83e45a92c10",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/scheduler/v0",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/generic/scheduler/v0/config/definition.yaml b/pkg/component/generic/scheduler/v0/config/definition.yaml
new file mode 100644
index 000000000..52c700ac8
--- /dev/null
+++ b/pkg/component/generic/scheduler/v0/config/definition.yaml
@@ -0,0 +1,16 @@
+availableTasks: []
+availableEvents:
+- EVENT_CRON_JOB_TRIGGERED
+documentationUrl: https://www.instill.tech/docs/component/generic/scheduler
+icon: assets/scheduler.svg
+id: scheduler
+public: true
+title: Scheduler
+vendor: Generic
+description: Trigger pipelines on a scheduler using cron expressions.
+tombstone: false
+type: COMPONENT_TYPE_GENERIC
+uid: f2a89c6d-e315-4b7a-9d8f-c83e45a92c10
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/generic/scheduler/v0
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/generic/scheduler/v0/config/events.json b/pkg/component/generic/scheduler/v0/config/events.json
deleted file mode 100644
index 82a270db5..000000000
--- a/pkg/component/generic/scheduler/v0/config/events.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "EVENT_CRON_JOB_TRIGGERED": {
- "title": "Cron Job Triggered",
- "description": "An event triggered on a cron job",
- "configSchema": {
- "required": [
- "cron"
- ],
- "properties": {
- "cron": {
- "pattern": "^[0-9*,-/]+\\s+[0-9*,-/]+\\s+[0-9*,-/]+\\s+[0-9*,-/]+\\s+[0-9*,-/]+$",
- "format": "string"
- }
- },
- "format": "object"
- },
- "messageSchema": {
- "$schema": "http://json-schema.org/draft-07/schema",
- "required": [
- "triggered-at"
- ],
- "properties": {
- "triggered-at": {
- "description": "The ISO 8601 timestamp when the cron job was triggered",
- "format": "string"
- }
- },
- "additionalProperties": false,
- "title": "Cron job triggered event",
- "format": "object"
- },
- "messageExamples": [
- {
- "triggered-at": "2024-01-01T00:00:00.000Z"
- }
- ]
- }
-}
diff --git a/pkg/component/generic/scheduler/v0/config/events.yaml b/pkg/component/generic/scheduler/v0/config/events.yaml
new file mode 100644
index 000000000..a413b42aa
--- /dev/null
+++ b/pkg/component/generic/scheduler/v0/config/events.yaml
@@ -0,0 +1,24 @@
+EVENT_CRON_JOB_TRIGGERED:
+ title: Cron Job Triggered
+ description: An event triggered on a cron job
+ configSchema:
+ required:
+ - cron
+ properties:
+ cron:
+ pattern: ^[0-9*,-/]+\s+[0-9*,-/]+\s+[0-9*,-/]+\s+[0-9*,-/]+\s+[0-9*,-/]+$
+ format: string
+ format: object
+ messageSchema:
+ $schema: http://json-schema.org/draft-07/schema
+ required:
+ - triggered-at
+ properties:
+ triggered-at:
+ description: The ISO 8601 timestamp when the cron job was triggered
+ format: string
+ additionalProperties: false
+ title: Cron job triggered event
+ format: object
+ messageExamples:
+ - triggered-at: '2024-01-01T00:00:00.000Z'
diff --git a/pkg/component/generic/scheduler/v0/config/tasks.yaml b/pkg/component/generic/scheduler/v0/config/tasks.yaml
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/pkg/component/generic/scheduler/v0/config/tasks.yaml
@@ -0,0 +1 @@
+{}
diff --git a/pkg/component/generic/scheduler/v0/main.go b/pkg/component/generic/scheduler/v0/main.go
index 1492eed81..d39dc5e04 100644
--- a/pkg/component/generic/scheduler/v0/main.go
+++ b/pkg/component/generic/scheduler/v0/main.go
@@ -19,12 +19,12 @@ import (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/events.json
- eventsJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/events.yaml
+ eventsYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -38,7 +38,7 @@ type component struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, eventsJSON, nil)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, eventsYAML, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/operator/audio/v0/README.mdx b/pkg/component/operator/audio/v0/README.mdx
index 4244488b6..77c1b5a54 100644
--- a/pkg/component/operator/audio/v0/README.mdx
+++ b/pkg/component/operator/audio/v0/README.mdx
@@ -20,7 +20,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/audio/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/audio/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/audio/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/audio/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/operator/audio/v0/config/definition.json b/pkg/component/operator/audio/v0/config/definition.json
deleted file mode 100644
index 15f83127a..000000000
--- a/pkg/component/operator/audio/v0/config/definition.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "availableTasks": [
- "TASK_DETECT_ACTIVITY",
- "TASK_SEGMENT"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/operator/audio",
- "icon": "assets/audio.svg",
- "id": "audio",
- "public": true,
- "spec": {},
- "title": "Audio",
- "type": "COMPONENT_TYPE_OPERATOR",
- "uid": "b5c75caa-9261-4757-bfbf-12e908f59f16",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/audio/v0",
- "description": "Operate audio data.",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/operator/audio/v0/config/definition.yaml b/pkg/component/operator/audio/v0/config/definition.yaml
new file mode 100644
index 000000000..10571264c
--- /dev/null
+++ b/pkg/component/operator/audio/v0/config/definition.yaml
@@ -0,0 +1,15 @@
+availableTasks:
+- TASK_DETECT_ACTIVITY
+- TASK_SEGMENT
+documentationUrl: https://www.instill.tech/docs/component/operator/audio
+icon: assets/audio.svg
+id: audio
+public: true
+spec: {}
+title: Audio
+type: COMPONENT_TYPE_OPERATOR
+uid: b5c75caa-9261-4757-bfbf-12e908f59f16
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/audio/v0
+description: Operate audio data.
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/operator/audio/v0/config/tasks.json b/pkg/component/operator/audio/v0/config/tasks.json
deleted file mode 100644
index e7d517493..000000000
--- a/pkg/component/operator/audio/v0/config/tasks.json
+++ /dev/null
@@ -1,149 +0,0 @@
-{
- "$defs": {
- "segment": {
- "properties": {
- "start-time": {
- "title": "Start Time",
- "description": "The number of seconds from the beginning of the audio file to the start of this segment.",
- "uiOrder": 0,
- "format": "number"
- },
- "end-time": {
- "title": "End Time",
- "description": "The number of seconds from the beginning of the audio file to the end of this segment.",
- "uiOrder": 1,
- "format": "number"
- }
- },
- "required": [
- "start-time",
- "end-time"
- ],
- "title": "Segment",
- "description": "A time segment of audio data, defined by its start and end times in seconds.",
- "format": "object"
- }
- },
- "TASK_DETECT_ACTIVITY": {
- "shortDescription": "Detect speech segments in audio data using Voice Activity Detection (VAD). This task processes the input audio to 16kHz mono format, identifies periods of human speech, and outputs time segments for each detected speech activity.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "audio": {
- "description": "Audio file to analyze for speech activity.",
- "acceptFormats": [
- "audio/wav",
- "application/octet-stream"
- ],
- "uiOrder": 0,
- "title": "Audio",
- "format": "string"
- },
- "min-silence-duration": {
- "description": "Minimum duration of silence (in milliseconds) required to split speech segments. Longer values result in fewer, longer segments.",
- "acceptFormats": [
- "integer",
- "number"
- ],
- "uiOrder": 1,
- "minimum": 0,
- "title": "Minimum Silence Duration",
- "default": 100,
- "format": "integer"
- },
- "speech-pad": {
- "description": "Additional padding (in milliseconds) added to the start and end of each detected speech segment to prevent cutting off speech.",
- "acceptFormats": [
- "integer",
- "number"
- ],
- "uiOrder": 2,
- "minimum": 0,
- "title": "Speech Pad",
- "default": 30,
- "format": "integer"
- }
- },
- "required": [
- "audio"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "segments": {
- "description": "Array of time segments representing detected speech activity. Each segment contains start and end times in seconds.",
- "uiOrder": 0,
- "items": {
- "$ref": "#/$defs/segment"
- },
- "title": "Segments",
- "format": "array"
- }
- },
- "required": [
- "segments"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SEGMENT": {
- "shortDescription": "Segment audio data into pieces based on the provided time segments.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "audio": {
- "description": "Audio data to segment.",
- "acceptFormats": [
- "audio/*",
- "application/octet-stream"
- ],
- "uiOrder": 0,
- "title": "Audio",
- "format": "string"
- },
- "segments": {
- "description": "A list of time segments of audio data.",
- "uiOrder": 1,
- "items": {
- "$ref": "#/$defs/segment"
- },
- "title": "Segments",
- "format": "array"
- }
- },
- "required": [
- "audio",
- "segments"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "audio-segments": {
- "description": "A list of segmented audio data.",
- "uiOrder": 0,
- "items": {
- "format": "string"
- },
- "title": "Audios",
- "format": "array"
- }
- },
- "required": [
- "audio-segments"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/operator/audio/v0/config/tasks.yaml b/pkg/component/operator/audio/v0/config/tasks.yaml
new file mode 100644
index 000000000..e879bf601
--- /dev/null
+++ b/pkg/component/operator/audio/v0/config/tasks.yaml
@@ -0,0 +1,121 @@
+$defs:
+ segment:
+ properties:
+ start-time:
+ title: Start Time
+ description: The number of seconds from the beginning of the audio file to
+ the start of this segment.
+ uiOrder: 0
+ format: number
+ end-time:
+ title: End Time
+ description: The number of seconds from the beginning of the audio file to
+ the end of this segment.
+ uiOrder: 1
+ format: number
+ required:
+ - start-time
+ - end-time
+ title: Segment
+ description: A time segment of audio data, defined by its start and end times
+ in seconds.
+ format: object
+TASK_DETECT_ACTIVITY:
+ shortDescription: Detect speech segments in audio data using Voice Activity Detection
+ (VAD). This task processes the input audio to 16kHz mono format, identifies periods
+ of human speech, and outputs time segments for each detected speech activity.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ audio:
+ description: Audio file to analyze for speech activity.
+ acceptFormats:
+ - audio/wav
+ - application/octet-stream
+ uiOrder: 0
+ title: Audio
+ format: string
+ min-silence-duration:
+ description: Minimum duration of silence (in milliseconds) required to split
+ speech segments. Longer values result in fewer, longer segments.
+ acceptFormats:
+ - integer
+ - number
+ uiOrder: 1
+ minimum: 0
+ title: Minimum Silence Duration
+ default: 100
+ format: integer
+ speech-pad:
+ description: Additional padding (in milliseconds) added to the start and end
+ of each detected speech segment to prevent cutting off speech.
+ acceptFormats:
+ - integer
+ - number
+ uiOrder: 2
+ minimum: 0
+ title: Speech Pad
+ default: 30
+ format: integer
+ required:
+ - audio
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ segments:
+ description: Array of time segments representing detected speech activity.
+ Each segment contains start and end times in seconds.
+ uiOrder: 0
+ items:
+ $ref: '#/$defs/segment'
+ title: Segments
+ format: array
+ required:
+ - segments
+ title: Output
+ format: object
+TASK_SEGMENT:
+ shortDescription: Segment audio data into pieces based on the provided time segments.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ audio:
+ description: Audio data to segment.
+ acceptFormats:
+ - audio/*
+ - application/octet-stream
+ uiOrder: 0
+ title: Audio
+ format: string
+ segments:
+ description: A list of time segments of audio data.
+ uiOrder: 1
+ items:
+ $ref: '#/$defs/segment'
+ title: Segments
+ format: array
+ required:
+ - audio
+ - segments
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ audio-segments:
+ description: A list of segmented audio data.
+ uiOrder: 0
+ items:
+ format: string
+ title: Audios
+ format: array
+ required:
+ - audio-segments
+ title: Output
+ format: object
diff --git a/pkg/component/operator/audio/v0/main.go b/pkg/component/operator/audio/v0/main.go
index 58fd5db4c..0521ecfb1 100644
--- a/pkg/component/operator/audio/v0/main.go
+++ b/pkg/component/operator/audio/v0/main.go
@@ -17,10 +17,10 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
)
@@ -37,7 +37,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/operator/base64/v0/README.mdx b/pkg/component/operator/base64/v0/README.mdx
index 676cf23f9..5f1b3725b 100644
--- a/pkg/component/operator/base64/v0/README.mdx
+++ b/pkg/component/operator/base64/v0/README.mdx
@@ -20,7 +20,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/base64/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/base64/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/base64/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/base64/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/operator/base64/v0/config/definition.json b/pkg/component/operator/base64/v0/config/definition.json
deleted file mode 100644
index 0ff22f68d..000000000
--- a/pkg/component/operator/base64/v0/config/definition.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "availableTasks": [
- "TASK_ENCODE",
- "TASK_DECODE"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/operator/base64",
- "icon": "assets/base64.svg",
- "iconUrl": "",
- "id": "base64",
- "public": true,
- "spec": {},
- "title": "Base64",
- "type": "COMPONENT_TYPE_OPERATOR",
- "tombstone": false,
- "uid": "3a836447-c211-4134-9cc5-ad45e1cc467e",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/base64/v0",
- "description": "Encode or decode a string in Base64 format.",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/operator/base64/v0/config/definition.yaml b/pkg/component/operator/base64/v0/config/definition.yaml
new file mode 100644
index 000000000..a87704bea
--- /dev/null
+++ b/pkg/component/operator/base64/v0/config/definition.yaml
@@ -0,0 +1,18 @@
+availableTasks:
+- TASK_ENCODE
+- TASK_DECODE
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/operator/base64
+icon: assets/base64.svg
+iconUrl: ''
+id: base64
+public: true
+spec: {}
+title: Base64
+type: COMPONENT_TYPE_OPERATOR
+tombstone: false
+uid: 3a836447-c211-4134-9cc5-ad45e1cc467e
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/base64/v0
+description: Encode or decode a string in Base64 format.
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/operator/base64/v0/config/tasks.json b/pkg/component/operator/base64/v0/config/tasks.json
deleted file mode 100644
index 136201025..000000000
--- a/pkg/component/operator/base64/v0/config/tasks.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "TASK_DECODE": {
- "shortDescription": "Decode the base64 string.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "Base64 string to be decoded.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Data",
- "format": "string"
- }
- },
- "required": [
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "Data.",
- "uiOrder": 0,
- "title": "Data",
- "format": "string"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_ENCODE": {
- "shortDescription": "Encode data into base64 string",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "Data to be encoded.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Data",
- "format": "string"
- }
- },
- "required": [
- "data"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "data": {
- "description": "Data.",
- "uiOrder": 0,
- "title": "Data",
- "format": "string"
- }
- },
- "required": [
- "data"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/operator/base64/v0/config/tasks.yaml b/pkg/component/operator/base64/v0/config/tasks.yaml
new file mode 100644
index 000000000..0736a1702
--- /dev/null
+++ b/pkg/component/operator/base64/v0/config/tasks.yaml
@@ -0,0 +1,60 @@
+TASK_DECODE:
+ shortDescription: Decode the base64 string.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ data:
+ description: Base64 string to be decoded.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Data
+ format: string
+ required:
+ - data
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ data:
+ description: Data.
+ uiOrder: 0
+ title: Data
+ format: string
+ required:
+ - data
+ title: Output
+ format: object
+TASK_ENCODE:
+ shortDescription: Encode data into base64 string
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ data:
+ description: Data to be encoded.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Data
+ format: string
+ required:
+ - data
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ data:
+ description: Data.
+ uiOrder: 0
+ title: Data
+ format: string
+ required:
+ - data
+ title: Output
+ format: object
diff --git a/pkg/component/operator/base64/v0/main.go b/pkg/component/operator/base64/v0/main.go
index 4e5c7bc74..02ed59003 100644
--- a/pkg/component/operator/base64/v0/main.go
+++ b/pkg/component/operator/base64/v0/main.go
@@ -23,10 +23,10 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
)
@@ -46,7 +46,7 @@ type Base64 struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/operator/document/v0/README.mdx b/pkg/component/operator/document/v0/README.mdx
index 3d36f52ac..5d6c1249b 100644
--- a/pkg/component/operator/document/v0/README.mdx
+++ b/pkg/component/operator/document/v0/README.mdx
@@ -21,7 +21,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/document/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/document/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/document/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/document/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/operator/document/v0/config/definition.json b/pkg/component/operator/document/v0/config/definition.json
deleted file mode 100644
index 09fc1c7fa..000000000
--- a/pkg/component/operator/document/v0/config/definition.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "availableTasks": [
- "TASK_CONVERT_TO_MARKDOWN",
- "TASK_CONVERT_TO_TEXT",
- "TASK_CONVERT_TO_IMAGES"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/operator/document",
- "icon": "assets/document.svg",
- "id": "document",
- "public": true,
- "spec": {},
- "title": "Document",
- "type": "COMPONENT_TYPE_OPERATOR",
- "uid": "e5b290ae-ad53-47c9-a64e-efbc5358520b",
- "version": "0.1.1",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/document/v0",
- "description": "Manipulate Document files.",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/operator/document/v0/config/definition.yaml b/pkg/component/operator/document/v0/config/definition.yaml
new file mode 100644
index 000000000..aac70b207
--- /dev/null
+++ b/pkg/component/operator/document/v0/config/definition.yaml
@@ -0,0 +1,17 @@
+availableTasks:
+- TASK_CONVERT_TO_MARKDOWN
+- TASK_CONVERT_TO_TEXT
+- TASK_CONVERT_TO_IMAGES
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/operator/document
+icon: assets/document.svg
+id: document
+public: true
+spec: {}
+title: Document
+type: COMPONENT_TYPE_OPERATOR
+uid: e5b290ae-ad53-47c9-a64e-efbc5358520b
+version: 0.1.1
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/document/v0
+description: Manipulate Document files.
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/operator/document/v0/config/tasks.json b/pkg/component/operator/document/v0/config/tasks.json
deleted file mode 100644
index 5b0c60e27..000000000
--- a/pkg/component/operator/document/v0/config/tasks.json
+++ /dev/null
@@ -1,259 +0,0 @@
-{
- "$defs": {
- "resolution": {
- "description": "Desired number pixels per inch. Defaults to 300. Minimum is 72.",
- "title": "Resolution",
- "minimum": 72,
- "default": 300,
- "format": "number"
- }
- },
- "TASK_CONVERT_TO_MARKDOWN": {
- "shortDescription": "Convert document to text in Markdown format.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "document": {
- "description": "Base64 encoded PDF/DOCX/DOC/PPTX/PPT/HTML/XLSX/XLS/CSV to be converted to text in Markdown format.",
- "acceptFormats": [
- "*/*"
- ],
- "uiOrder": 0,
- "title": "Document",
- "format": "string"
- },
- "filename": {
- "description": "The name of the file, please remember to add the file extension in the end of file name. e.g. 'example.pdf'.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Filename",
- "format": "string"
- },
- "display-image-tag": {
- "default": false,
- "description": "Whether to display image tag in the markdown text. Default is 'false'. It is only applicable for convert-2024-08-28 converter. And, it is only applicable for the type of PPTX/PPT/DOCX/DOC/PDF.",
- "uiOrder": 2,
- "title": "Display Image Tag",
- "format": "boolean"
- },
- "display-all-page-image": {
- "default": false,
- "description": "Whether to respond the whole page as the images if we detect there could be images in the page. It will only support DOCX/DOC/PPTX/PPT/PDF.",
- "uiOrder": 3,
- "title": "Display All Page Image",
- "format": "boolean"
- },
- "resolution": {
- "$ref": "#/$defs/resolution",
- "uiOrder": 4
- }
- },
- "required": [
- "document"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "body": {
- "description": "Markdown text converted from the PDF document.",
- "uiOrder": 0,
- "title": "Body",
- "format": "string"
- },
- "filename": {
- "description": "The name of the file.",
- "uiOrder": 1,
- "title": "Filename",
- "format": "string"
- },
- "images": {
- "description": "Images extracted from the document.",
- "uiOrder": 2,
- "items": {
- "format": "string"
- },
- "title": "Images",
- "format": "array"
- },
- "error": {
- "description": "Error message if any during the conversion process.",
- "uiOrder": 3,
- "title": "Error",
- "format": "string"
- },
- "all-page-images": {
- "description": "The image contains all the pages in the document if we detect there could be images in the page. It will only support DOCX/DOC/PPTX/PPT/PDF.",
- "uiOrder": 4,
- "items": {
- "format": "string"
- },
- "title": "All Page Images",
- "format": "array"
- },
- "markdowns": {
- "description": "Markdown text converted from the PDF document, separated by page.",
- "uiOrder": 5,
- "items": {
- "format": "string"
- },
- "title": "Markdowns",
- "format": "array"
- }
- },
- "required": [
- "body"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CONVERT_TO_TEXT": {
- "shortDescription": "Convert document to text.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "document": {
- "description": "Base64 encoded PDF/DOC/DOCX/XML/HTML/RTF/MD/PPTX/ODT/TIF/CSV/TXT/PNG document to be converted to plain text.",
- "acceptFormats": [
- "*/*"
- ],
- "uiOrder": 0,
- "title": "Document",
- "format": "string"
- },
- "filename": {
- "description": "The name of the file, please remember to add the file extension in the end of file name. e.g. 'example.pdf'.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Filename",
- "format": "string"
- }
- },
- "required": [
- "document"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "body": {
- "description": "Plain text converted from the document.",
- "uiOrder": 0,
- "title": "Body",
- "format": "string"
- },
- "error": {
- "description": "Error message if any during the conversion process.",
- "uiOrder": 3,
- "title": "Error",
- "format": "string"
- },
- "meta": {
- "description": "Metadata extracted from the document.",
- "uiOrder": 1,
- "required": [],
- "title": "Meta",
- "format": "json"
- },
- "msecs": {
- "description": "Time taken to convert the document.",
- "uiOrder": 2,
- "title": "Milliseconds",
- "format": "number"
- },
- "filename": {
- "description": "The name of the file.",
- "uiOrder": 1,
- "title": "Filename",
- "format": "string"
- }
- },
- "required": [
- "body",
- "meta",
- "msecs",
- "error"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CONVERT_TO_IMAGES": {
- "shortDescription": "Convert Document to images.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "document": {
- "description": "Base64 encoded PDF/DOCX/DOC/PPT/PPTX to be converted to images.",
- "acceptFormats": [
- "*/*"
- ],
- "uiOrder": 0,
- "title": "PDF",
- "format": "string"
- },
- "filename": {
- "description": "The name of the file, please remember to add the file extension in the end of file name. e.g. 'example.pdf'.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Filename",
- "format": "string"
- },
- "resolution": {
- "$ref": "#/$defs/resolution",
- "uiOrder": 4
- }
- },
- "required": [
- "document"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "images": {
- "description": "Images converted from the document.",
- "uiOrder": 0,
- "items": {
- "format": "string"
- },
- "title": "Images",
- "format": "array"
- },
- "filenames": {
- "description": "The filenames of the images. The filenames will be appended with the page number. e.g. 'example-1.jpg'.",
- "uiOrder": 1,
- "items": {
- "format": "string"
- },
- "title": "Filenames",
- "format": "array"
- }
- },
- "required": [
- "images"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/operator/document/v0/config/tasks.yaml b/pkg/component/operator/document/v0/config/tasks.yaml
new file mode 100644
index 000000000..1b8035c12
--- /dev/null
+++ b/pkg/component/operator/document/v0/config/tasks.yaml
@@ -0,0 +1,210 @@
+$defs:
+ resolution:
+ description: Desired number pixels per inch. Defaults to 300. Minimum is 72.
+ title: Resolution
+ minimum: 72
+ default: 300
+ format: number
+TASK_CONVERT_TO_MARKDOWN:
+ shortDescription: Convert document to text in Markdown format.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ document:
+ description: Base64 encoded PDF/DOCX/DOC/PPTX/PPT/HTML/XLSX/XLS/CSV to be
+ converted to text in Markdown format.
+ acceptFormats:
+ - '*/*'
+ uiOrder: 0
+ title: Document
+ format: string
+ filename:
+ description: The name of the file, please remember to add the file extension
+ in the end of file name. e.g. 'example.pdf'.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Filename
+ format: string
+ display-image-tag:
+ default: false
+ description: Whether to display image tag in the markdown text. Default is
+ 'false'. It is only applicable for convert-2024-08-28 converter. And, it
+ is only applicable for the type of PPTX/PPT/DOCX/DOC/PDF.
+ uiOrder: 2
+ title: Display Image Tag
+ format: boolean
+ display-all-page-image:
+ default: false
+ description: Whether to respond the whole page as the images if we detect
+ there could be images in the page. It will only support DOCX/DOC/PPTX/PPT/PDF.
+ uiOrder: 3
+ title: Display All Page Image
+ format: boolean
+ resolution:
+ $ref: '#/$defs/resolution'
+ uiOrder: 4
+ required:
+ - document
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ body:
+ description: Markdown text converted from the PDF document.
+ uiOrder: 0
+ title: Body
+ format: string
+ filename:
+ description: The name of the file.
+ uiOrder: 1
+ title: Filename
+ format: string
+ images:
+ description: Images extracted from the document.
+ uiOrder: 2
+ items:
+ format: string
+ title: Images
+ format: array
+ error:
+ description: Error message if any during the conversion process.
+ uiOrder: 3
+ title: Error
+ format: string
+ all-page-images:
+ description: The image contains all the pages in the document if we detect
+ there could be images in the page. It will only support DOCX/DOC/PPTX/PPT/PDF.
+ uiOrder: 4
+ items:
+ format: string
+ title: All Page Images
+ format: array
+ markdowns:
+ description: Markdown text converted from the PDF document, separated by page.
+ uiOrder: 5
+ items:
+ format: string
+ title: Markdowns
+ format: array
+ required:
+ - body
+ title: Output
+ format: object
+TASK_CONVERT_TO_TEXT:
+ shortDescription: Convert document to text.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ document:
+ description: Base64 encoded PDF/DOC/DOCX/XML/HTML/RTF/MD/PPTX/ODT/TIF/CSV/TXT/PNG
+ document to be converted to plain text.
+ acceptFormats:
+ - '*/*'
+ uiOrder: 0
+ title: Document
+ format: string
+ filename:
+ description: The name of the file, please remember to add the file extension
+ in the end of file name. e.g. 'example.pdf'.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Filename
+ format: string
+ required:
+ - document
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ body:
+ description: Plain text converted from the document.
+ uiOrder: 0
+ title: Body
+ format: string
+ error:
+ description: Error message if any during the conversion process.
+ uiOrder: 3
+ title: Error
+ format: string
+ meta:
+ description: Metadata extracted from the document.
+ uiOrder: 1
+ required: []
+ title: Meta
+ format: json
+ msecs:
+ description: Time taken to convert the document.
+ uiOrder: 2
+ title: Milliseconds
+ format: number
+ filename:
+ description: The name of the file.
+ uiOrder: 1
+ title: Filename
+ format: string
+ required:
+ - body
+ - meta
+ - msecs
+ - error
+ title: Output
+ format: object
+TASK_CONVERT_TO_IMAGES:
+ shortDescription: Convert Document to images.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ document:
+ description: Base64 encoded PDF/DOCX/DOC/PPT/PPTX to be converted to images.
+ acceptFormats:
+ - '*/*'
+ uiOrder: 0
+ title: PDF
+ format: string
+ filename:
+ description: The name of the file, please remember to add the file extension
+ in the end of file name. e.g. 'example.pdf'.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Filename
+ format: string
+ resolution:
+ $ref: '#/$defs/resolution'
+ uiOrder: 4
+ required:
+ - document
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ images:
+ description: Images converted from the document.
+ uiOrder: 0
+ items:
+ format: string
+ title: Images
+ format: array
+ filenames:
+ description: The filenames of the images. The filenames will be appended with
+ the page number. e.g. 'example-1.jpg'.
+ uiOrder: 1
+ items:
+ format: string
+ title: Filenames
+ format: array
+ required:
+ - images
+ title: Output
+ format: object
diff --git a/pkg/component/operator/document/v0/main.go b/pkg/component/operator/document/v0/main.go
index de7c92fc3..69a5d18a1 100644
--- a/pkg/component/operator/document/v0/main.go
+++ b/pkg/component/operator/document/v0/main.go
@@ -20,10 +20,10 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -42,7 +42,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/operator/image/v0/README.mdx b/pkg/component/operator/image/v0/README.mdx
index 609326a90..3d836e427 100644
--- a/pkg/component/operator/image/v0/README.mdx
+++ b/pkg/component/operator/image/v0/README.mdx
@@ -27,7 +27,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/image/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/image/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/image/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/image/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/operator/image/v0/config/definition.json b/pkg/component/operator/image/v0/config/definition.json
deleted file mode 100644
index d72ce1c2c..000000000
--- a/pkg/component/operator/image/v0/config/definition.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "availableTasks": [
- "TASK_CONCAT",
- "TASK_CROP",
- "TASK_RESIZE",
- "TASK_DRAW_CLASSIFICATION",
- "TASK_DRAW_DETECTION",
- "TASK_DRAW_KEYPOINT",
- "TASK_DRAW_OCR",
- "TASK_DRAW_INSTANCE_SEGMENTATION",
- "TASK_DRAW_SEMANTIC_SEGMENTATION"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/operator/image",
- "icon": "assets/image.svg",
- "iconUrl": "",
- "id": "image",
- "public": true,
- "spec": {},
- "title": "Image",
- "type": "COMPONENT_TYPE_OPERATOR",
- "uid": "e9eb8fc8-f249-4e11-ad50-5035d79ffc18",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/image/v0",
- "description": "Manipulate image files.",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/operator/image/v0/config/definition.yaml b/pkg/component/operator/image/v0/config/definition.yaml
new file mode 100644
index 000000000..00110ae99
--- /dev/null
+++ b/pkg/component/operator/image/v0/config/definition.yaml
@@ -0,0 +1,24 @@
+availableTasks:
+- TASK_CONCAT
+- TASK_CROP
+- TASK_RESIZE
+- TASK_DRAW_CLASSIFICATION
+- TASK_DRAW_DETECTION
+- TASK_DRAW_KEYPOINT
+- TASK_DRAW_OCR
+- TASK_DRAW_INSTANCE_SEGMENTATION
+- TASK_DRAW_SEMANTIC_SEGMENTATION
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/operator/image
+icon: assets/image.svg
+iconUrl: ''
+id: image
+public: true
+spec: {}
+title: Image
+type: COMPONENT_TYPE_OPERATOR
+uid: e9eb8fc8-f249-4e11-ad50-5035d79ffc18
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/image/v0
+description: Manipulate image files.
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/operator/image/v0/config/schema.json b/pkg/component/operator/image/v0/config/schema.json
deleted file mode 120000
index 446b0c634..000000000
--- a/pkg/component/operator/image/v0/config/schema.json
+++ /dev/null
@@ -1 +0,0 @@
-../../../../resources/schemas/schema.json
\ No newline at end of file
diff --git a/pkg/component/operator/image/v0/config/schema.yaml b/pkg/component/operator/image/v0/config/schema.yaml
new file mode 100644
index 000000000..899f59662
--- /dev/null
+++ b/pkg/component/operator/image/v0/config/schema.yaml
@@ -0,0 +1,312 @@
+$defs:
+ instill-types:
+ bounding-box:
+ additionalProperties: false
+ description: The detected bounding box in (left, top, width, height) format.
+ properties:
+ height:
+ description: Bounding box height value
+ uiOrder: 3
+ title: Height
+ format: number
+ left:
+ description: Bounding box left x-axis value
+ uiOrder: 0
+ title: Left
+ format: number
+ top:
+ description: Bounding box top y-axis value
+ uiOrder: 1
+ title: Top
+ format: number
+ width:
+ description: Bounding box width value
+ uiOrder: 2
+ title: Width
+ format: number
+ required:
+ - left
+ - top
+ - width
+ - height
+ title: Bounding Box
+ format: object
+ chat-messages:
+ items:
+ properties:
+ content:
+ $ref: '#/$defs/instill-types/multi-modal-content'
+ description: The message content
+ uiOrder: 1
+ title: Content
+ metadata:
+ additionalProperties: true
+ description: The message metadata
+ uiOrder: 2
+ required: []
+ title: Metadata
+ format: json
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'
+ uiOrder: 0
+ title: Role
+ format: string
+ required:
+ - role
+ - content
+ format: object
+ title: Chat Message
+ format: array
+ classification:
+ additionalProperties: false
+ properties:
+ category:
+ description: The predicted category of the input.
+ uiOrder: 0
+ title: Category
+ format: string
+ score:
+ description: The confidence score of the predicted category of the input.
+ uiOrder: 1
+ title: Score
+ format: number
+ required:
+ - category
+ - score
+ format: object
+ detection:
+ additionalProperties: false
+ properties:
+ objects:
+ description: A list of detected objects.
+ uiOrder: 0
+ items:
+ additionalProperties: false
+ properties:
+ bounding-box:
+ $ref: '#/$defs/instill-types/bounding-box'
+ uiOrder: 1
+ title: Bounding box
+ category:
+ description: The predicted category of the bounding box.
+ uiOrder: 2
+ title: Category
+ format: string
+ score:
+ description: The confidence score of the predicted category of the
+ bounding box.
+ uiOrder: 3
+ title: Score
+ format: number
+ required:
+ - bounding-box
+ - category
+ - score
+ title: Object
+ format: object
+ title: Objects
+ format: array
+ required:
+ - objects
+ format: object
+ embedding:
+ items:
+ title: Embedding
+ format: number
+ title: Embedding
+ format: array
+ instance-segmentation:
+ additionalProperties: false
+ properties:
+ objects:
+ description: A list of detected instance bounding boxes.
+ uiOrder: 0
+ items:
+ properties:
+ bounding-box:
+ $ref: '#/$defs/instill-types/bounding-box'
+ uiOrder: 1
+ title: Bounding Box
+ category:
+ description: The predicted category of the bounding box.
+ uiOrder: 2
+ title: Category
+ format: string
+ rle:
+ description: Run Length Encoding (RLE) of instance mask within the
+ bounding box.
+ uiOrder: 0
+ title: RLE
+ format: string
+ score:
+ description: The confidence score of the predicted instance object.
+ uiOrder: 3
+ title: Score
+ format: number
+ required:
+ - rle
+ - bounding-box
+ - category
+ - score
+ title: Object
+ format: object
+ title: Objects
+ format: array
+ required:
+ - objects
+ format: 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.
+ uiOrder: 0
+ items:
+ properties:
+ bounding-box:
+ $ref: '#/$defs/instill-types/bounding-box'
+ uiOrder: 2
+ title: Bounding Box
+ keypoints:
+ description: A keypoint group is composed of a list of pre-defined
+ keypoints of a detected object.
+ uiOrder: 0
+ items:
+ uiOrder: 0
+ properties:
+ v:
+ description: visibility score of the keypoint.
+ uiOrder: 2
+ title: Visibility Score
+ format: number
+ x:
+ description: x coordinate of the keypoint.
+ uiOrder: 0
+ title: X Coordinate
+ format: number
+ y:
+ description: y coordinate of the keypoint.
+ uiOrder: 1
+ title: Y Coordinate
+ format: number
+ required:
+ - x
+ - y
+ - v
+ title: Keypoints
+ format: object
+ title: Keypoints
+ format: array
+ score:
+ description: The confidence score of the predicted object.
+ uiOrder: 1
+ title: Score
+ format: number
+ required:
+ - keypoints
+ - score
+ - bounding-box
+ title: Object
+ format: object
+ title: Objects
+ format: array
+ required:
+ - objects
+ format: object
+ multi-modal-content:
+ items:
+ properties:
+ image-url:
+ properties:
+ url:
+ description: Either a URL of the image or the base64 encoded image
+ data.
+ title: URL
+ uiOrder: 0
+ format: string
+ required:
+ - url
+ title: Image URL
+ description: The image URL
+ uiOrder: 0
+ format: object
+ text:
+ description: The text content.
+ title: Text
+ uiOrder: 1
+ format: string
+ type:
+ description: The type of the content part.
+ enum:
+ - text
+ - image-url
+ title: Type
+ uiOrder: 2
+ format: string
+ required:
+ - type
+ format: object
+ format: array
+ ocr:
+ additionalProperties: false
+ properties:
+ objects:
+ description: A list of detected bounding boxes.
+ uiOrder: 0
+ items:
+ properties:
+ bounding-box:
+ $ref: '#/$defs/instill-types/bounding-box'
+ uiOrder: 0
+ title: Bounding Box
+ score:
+ description: The confidence score of the predicted object.
+ uiOrder: 2
+ title: Score
+ format: number
+ text:
+ description: Text string recognised per bounding box.
+ uiOrder: 1
+ title: Text
+ format: string
+ required:
+ - bounding-box
+ - text
+ - score
+ title: Object
+ format: object
+ title: Objects
+ format: array
+ required:
+ - objects
+ format: object
+ semantic-segmentation:
+ additionalProperties: false
+ properties:
+ stuffs:
+ description: A list of RLE binary masks.
+ uiOrder: 0
+ items:
+ properties:
+ category:
+ description: Category text string corresponding to each stuff mask.
+ uiOrder: 1
+ title: Category
+ format: string
+ rle:
+ description: Run Length Encoding (RLE) of each stuff mask within the
+ image.
+ uiOrder: 0
+ title: RLE
+ format: string
+ required:
+ - rle
+ - category
+ title: Object
+ format: object
+ title: Stuffs
+ format: array
+ required:
+ - stuffs
+ format: object
diff --git a/pkg/component/operator/image/v0/config/tasks.json b/pkg/component/operator/image/v0/config/tasks.json
deleted file mode 100644
index df71c674e..000000000
--- a/pkg/component/operator/image/v0/config/tasks.json
+++ /dev/null
@@ -1,565 +0,0 @@
-{
- "TASK_CONCAT": {
- "shortDescription": "Concatenate images horizontally or vertically. All images must have the same width and height. If `grid-width` and `grid-height` are not provided, the images will be concatenated to a square grid.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "images": {
- "description": "Input images.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 0,
- "title": "Images",
- "format": "array"
- },
- "grid-width": {
- "description": "Grid width. If `grid-width` is provided, `grid-height` will be ignored.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "title": "Grid Width",
- "format": "integer"
- },
- "grid-height": {
- "description": "Grid height. If `grid-height` is provided, `grid-width` will be ignored.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "title": "Grid Height",
- "format": "integer"
- },
- "padding": {
- "description": "Padding between images. If `padding` is provided, it will be applied to all four sides of the image.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 3,
- "title": "Padding",
- "format": "integer"
- }
- },
- "required": [
- "images"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output concatenated image.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Output image.",
- "uiOrder": 0,
- "title": "Image",
- "format": "image/png"
- }
- },
- "required": [
- "image"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_CROP": {
- "shortDescription": "Crop image to the specified size.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Input image.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 0,
- "title": "Image",
- "format": "string"
- },
- "corner-radius": {
- "description": "Radius from the corner of the image to crop the image. If `corner-radius` is provided, `circle-radius` will be ignored. If the `corner-radius` is larger than half of min(width, height), the min(width, height) will be applied to `corner-radius` .",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "title": "Corner Radius",
- "format": "integer"
- },
- "circle-radius": {
- "description": "Radius from the center of the circle to crop the image. If `circle-radius` is provided, `corner-radius` will be ignored. If the `circle-radius` is larger than half of min(width, height), the min(width, height) will be applied to `circle-radius`.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "title": "Circle Radius",
- "format": "integer"
- },
- "top-offset": {
- "description": "Top offset of the crop.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 3,
- "title": "Top Offset",
- "format": "integer"
- },
- "right-offset": {
- "description": "Right offset of the crop.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "title": "Right Offset",
- "format": "integer"
- },
- "bottom-offset": {
- "description": "Bottom offset of the crop.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 5,
- "title": "Bottom Offset",
- "format": "integer"
- },
- "left-offset": {
- "description": "Left offset of the crop.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "title": "Left Offset",
- "format": "integer"
- }
- },
- "required": [
- "image"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output cropped image.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Output image.",
- "uiOrder": 0,
- "title": "Image",
- "format": "image/png"
- }
- },
- "required": [
- "image"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_RESIZE": {
- "shortDescription": "Resize image to the specified size.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Input image.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 0,
- "title": "Image",
- "format": "string"
- },
- "ratio": {
- "description": "Resize ratio (e.g., 0.5 for half size, 2 for double size) to resize the image. If ratio is provided, width and height will be ignored.",
- "acceptFormats": [
- "number"
- ],
- "uiOrder": 1,
- "title": "Ratio",
- "format": "number"
- },
- "width": {
- "description": "Width of the output image.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "title": "Width",
- "format": "integer"
- },
- "height": {
- "description": "Height of the output image.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 3,
- "title": "Height",
- "format": "integer"
- }
- },
- "required": [
- "image"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output resized image.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Output image.",
- "uiOrder": 0,
- "title": "Image",
- "format": "image/png"
- }
- },
- "required": [
- "image"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DRAW_CLASSIFICATION": {
- "shortDescription": "Draw classification result on the image.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "category": {
- "$ref": "schema.json#/$defs/instill-types/classification/properties/category",
- "acceptFormats": [
- "string"
- ]
- },
- "image": {
- "description": "Input image.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 0,
- "title": "Image",
- "format": "string"
- },
- "score": {
- "$ref": "schema.json#/$defs/instill-types/classification/properties/score",
- "acceptFormats": [
- "number",
- "integer"
- ]
- },
- "show-score": {
- "description": "Show model confidence score on each instance.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 0,
- "title": "Show Score",
- "format": "boolean"
- }
- },
- "required": [
- "image",
- "category",
- "score"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Output image.",
- "uiOrder": 0,
- "title": "Image",
- "format": "image/png"
- }
- },
- "required": [
- "image"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DRAW_DETECTION": {
- "shortDescription": "Draw detection result on the image.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Input image.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 0,
- "title": "Image",
- "format": "string"
- },
- "objects": {
- "$ref": "schema.json#/$defs/instill-types/detection/properties/objects",
- "acceptFormats": [
- "array"
- ]
- },
- "show-score": {
- "description": "Show model confidence score on each instance.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 0,
- "title": "Show Score",
- "format": "boolean"
- }
- },
- "required": [
- "image",
- "objects"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Output image.",
- "uiOrder": 0,
- "title": "Image",
- "format": "image/png"
- }
- },
- "required": [
- "image"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DRAW_KEYPOINT": {
- "shortDescription": "Draw keypoint result on the image.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Input image.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 0,
- "title": "Image",
- "format": "string"
- },
- "objects": {
- "$ref": "schema.json#/$defs/instill-types/keypoint/properties/objects",
- "acceptFormats": [
- "array"
- ]
- },
- "show-score": {
- "description": "Show model confidence score on each instance.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 0,
- "title": "Show Score",
- "format": "boolean"
- }
- },
- "required": [
- "image",
- "objects"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Output image.",
- "uiOrder": 0,
- "title": "Image",
- "format": "image/png"
- }
- },
- "required": [
- "image"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DRAW_SEMANTIC_SEGMENTATION": {
- "shortDescription": "Draw semantic segmentation result on the image.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Input image.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 0,
- "title": "Image",
- "format": "string"
- },
- "stuffs": {
- "$ref": "schema.json#/$defs/instill-types/semantic-segmentation/properties/stuffs",
- "acceptFormats": [
- "array"
- ]
- }
- },
- "required": [
- "image",
- "stuffs"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Output image.",
- "uiOrder": 0,
- "title": "Image",
- "format": "image/png"
- }
- },
- "required": [
- "image"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DRAW_INSTANCE_SEGMENTATION": {
- "shortDescription": "Draw instance segmentation result on the image.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Input image.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 0,
- "title": "Image",
- "format": "string"
- },
- "objects": {
- "$ref": "schema.json#/$defs/instill-types/instance-segmentation/properties/objects",
- "acceptFormats": [
- "array"
- ]
- },
- "show-score": {
- "description": "Show model confidence score on each instance.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 0,
- "title": "Show Score",
- "format": "boolean"
- }
- },
- "required": [
- "image",
- "objects"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Output image.",
- "uiOrder": 0,
- "title": "Image",
- "format": "image/png"
- }
- },
- "required": [
- "image"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_DRAW_OCR": {
- "shortDescription": "Draw OCR result on the image.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Input image.",
- "acceptFormats": [
- "image/*"
- ],
- "uiOrder": 0,
- "title": "Image",
- "format": "string"
- },
- "objects": {
- "$ref": "schema.json#/$defs/instill-types/ocr/properties/objects",
- "acceptFormats": [
- "array"
- ]
- },
- "show-score": {
- "description": "Show model confidence score on each instance.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 0,
- "title": "Show Score",
- "format": "boolean"
- }
- },
- "required": [
- "image",
- "objects"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "image": {
- "description": "Output image.",
- "uiOrder": 0,
- "title": "Image",
- "format": "image/png"
- }
- },
- "required": [
- "image"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/operator/image/v0/config/tasks.yaml b/pkg/component/operator/image/v0/config/tasks.yaml
new file mode 100644
index 000000000..b405fb872
--- /dev/null
+++ b/pkg/component/operator/image/v0/config/tasks.yaml
@@ -0,0 +1,437 @@
+TASK_CONCAT:
+ shortDescription: Concatenate images horizontally or vertically. All images must
+ have the same width and height. If `grid-width` and `grid-height` are not provided,
+ the images will be concatenated to a square grid.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ images:
+ description: Input images.
+ acceptFormats:
+ - array
+ uiOrder: 0
+ title: Images
+ format: array
+ grid-width:
+ description: Grid width. If `grid-width` is provided, `grid-height` will be
+ ignored.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ title: Grid Width
+ format: integer
+ grid-height:
+ description: Grid height. If `grid-height` is provided, `grid-width` will
+ be ignored.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: Grid Height
+ format: integer
+ padding:
+ description: Padding between images. If `padding` is provided, it will be
+ applied to all four sides of the image.
+ acceptFormats:
+ - integer
+ uiOrder: 3
+ title: Padding
+ format: integer
+ required:
+ - images
+ title: Input
+ format: object
+ output:
+ description: Output concatenated image.
+ uiOrder: 0
+ properties:
+ image:
+ description: Output image.
+ uiOrder: 0
+ title: Image
+ format: image/png
+ required:
+ - image
+ title: Output
+ format: object
+TASK_CROP:
+ shortDescription: Crop image to the specified size.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ image:
+ description: Input image.
+ acceptFormats:
+ - image/*
+ uiOrder: 0
+ title: Image
+ format: string
+ corner-radius:
+ description: Radius from the corner of the image to crop the image. If `corner-radius`
+ is provided, `circle-radius` will be ignored. If the `corner-radius` is
+ larger than half of min(width, height), the min(width, height) will be applied
+ to `corner-radius` .
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ title: Corner Radius
+ format: integer
+ circle-radius:
+ description: Radius from the center of the circle to crop the image. If `circle-radius`
+ is provided, `corner-radius` will be ignored. If the `circle-radius` is
+ larger than half of min(width, height), the min(width, height) will be applied
+ to `circle-radius`.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: Circle Radius
+ format: integer
+ top-offset:
+ description: Top offset of the crop.
+ acceptFormats:
+ - integer
+ uiOrder: 3
+ title: Top Offset
+ format: integer
+ right-offset:
+ description: Right offset of the crop.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ title: Right Offset
+ format: integer
+ bottom-offset:
+ description: Bottom offset of the crop.
+ acceptFormats:
+ - integer
+ uiOrder: 5
+ title: Bottom Offset
+ format: integer
+ left-offset:
+ description: Left offset of the crop.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ title: Left Offset
+ format: integer
+ required:
+ - image
+ title: Input
+ format: object
+ output:
+ description: Output cropped image.
+ uiOrder: 0
+ properties:
+ image:
+ description: Output image.
+ uiOrder: 0
+ title: Image
+ format: image/png
+ required:
+ - image
+ title: Output
+ format: object
+TASK_RESIZE:
+ shortDescription: Resize image to the specified size.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ image:
+ description: Input image.
+ acceptFormats:
+ - image/*
+ uiOrder: 0
+ title: Image
+ format: string
+ ratio:
+ description: Resize ratio (e.g., 0.5 for half size, 2 for double size) to
+ resize the image. If ratio is provided, width and height will be ignored.
+ acceptFormats:
+ - number
+ uiOrder: 1
+ title: Ratio
+ format: number
+ width:
+ description: Width of the output image.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: Width
+ format: integer
+ height:
+ description: Height of the output image.
+ acceptFormats:
+ - integer
+ uiOrder: 3
+ title: Height
+ format: integer
+ required:
+ - image
+ title: Input
+ format: object
+ output:
+ description: Output resized image.
+ uiOrder: 0
+ properties:
+ image:
+ description: Output image.
+ uiOrder: 0
+ title: Image
+ format: image/png
+ required:
+ - image
+ title: Output
+ format: object
+TASK_DRAW_CLASSIFICATION:
+ shortDescription: Draw classification result on the image.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ category:
+ $ref: schema.yaml#/$defs/instill-types/classification/properties/category
+ acceptFormats:
+ - string
+ image:
+ description: Input image.
+ acceptFormats:
+ - image/*
+ uiOrder: 0
+ title: Image
+ format: string
+ score:
+ $ref: schema.yaml#/$defs/instill-types/classification/properties/score
+ acceptFormats:
+ - number
+ - integer
+ show-score:
+ description: Show model confidence score on each instance.
+ acceptFormats:
+ - boolean
+ uiOrder: 0
+ title: Show Score
+ format: boolean
+ required:
+ - image
+ - category
+ - score
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ image:
+ description: Output image.
+ uiOrder: 0
+ title: Image
+ format: image/png
+ required:
+ - image
+ title: Output
+ format: object
+TASK_DRAW_DETECTION:
+ shortDescription: Draw detection result on the image.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ image:
+ description: Input image.
+ acceptFormats:
+ - image/*
+ uiOrder: 0
+ title: Image
+ format: string
+ objects:
+ $ref: schema.yaml#/$defs/instill-types/detection/properties/objects
+ acceptFormats:
+ - array
+ show-score:
+ description: Show model confidence score on each instance.
+ acceptFormats:
+ - boolean
+ uiOrder: 0
+ title: Show Score
+ format: boolean
+ required:
+ - image
+ - objects
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ image:
+ description: Output image.
+ uiOrder: 0
+ title: Image
+ format: image/png
+ required:
+ - image
+ title: Output
+ format: object
+TASK_DRAW_KEYPOINT:
+ shortDescription: Draw keypoint result on the image.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ image:
+ description: Input image.
+ acceptFormats:
+ - image/*
+ uiOrder: 0
+ title: Image
+ format: string
+ objects:
+ $ref: schema.yaml#/$defs/instill-types/keypoint/properties/objects
+ acceptFormats:
+ - array
+ show-score:
+ description: Show model confidence score on each instance.
+ acceptFormats:
+ - boolean
+ uiOrder: 0
+ title: Show Score
+ format: boolean
+ required:
+ - image
+ - objects
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ image:
+ description: Output image.
+ uiOrder: 0
+ title: Image
+ format: image/png
+ required:
+ - image
+ title: Output
+ format: object
+TASK_DRAW_SEMANTIC_SEGMENTATION:
+ shortDescription: Draw semantic segmentation result on the image.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ image:
+ description: Input image.
+ acceptFormats:
+ - image/*
+ uiOrder: 0
+ title: Image
+ format: string
+ stuffs:
+ $ref: schema.yaml#/$defs/instill-types/semantic-segmentation/properties/stuffs
+ acceptFormats:
+ - array
+ required:
+ - image
+ - stuffs
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ image:
+ description: Output image.
+ uiOrder: 0
+ title: Image
+ format: image/png
+ required:
+ - image
+ title: Output
+ format: object
+TASK_DRAW_INSTANCE_SEGMENTATION:
+ shortDescription: Draw instance segmentation result on the image.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ image:
+ description: Input image.
+ acceptFormats:
+ - image/*
+ uiOrder: 0
+ title: Image
+ format: string
+ objects:
+ $ref: schema.yaml#/$defs/instill-types/instance-segmentation/properties/objects
+ acceptFormats:
+ - array
+ show-score:
+ description: Show model confidence score on each instance.
+ acceptFormats:
+ - boolean
+ uiOrder: 0
+ title: Show Score
+ format: boolean
+ required:
+ - image
+ - objects
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ image:
+ description: Output image.
+ uiOrder: 0
+ title: Image
+ format: image/png
+ required:
+ - image
+ title: Output
+ format: object
+TASK_DRAW_OCR:
+ shortDescription: Draw OCR result on the image.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ image:
+ description: Input image.
+ acceptFormats:
+ - image/*
+ uiOrder: 0
+ title: Image
+ format: string
+ objects:
+ $ref: schema.yaml#/$defs/instill-types/ocr/properties/objects
+ acceptFormats:
+ - array
+ show-score:
+ description: Show model confidence score on each instance.
+ acceptFormats:
+ - boolean
+ uiOrder: 0
+ title: Show Score
+ format: boolean
+ required:
+ - image
+ - objects
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ image:
+ description: Output image.
+ uiOrder: 0
+ title: Image
+ format: image/png
+ required:
+ - image
+ title: Output
+ format: object
diff --git a/pkg/component/operator/image/v0/main.go b/pkg/component/operator/image/v0/main.go
index 78d58ad24..f22cc6b31 100644
--- a/pkg/component/operator/image/v0/main.go
+++ b/pkg/component/operator/image/v0/main.go
@@ -15,10 +15,10 @@ import (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
)
@@ -36,9 +36,9 @@ func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
additionalJSONBytes := map[string][]byte{
- "schema.json": schemas.SchemaJSON,
+ "schema.yaml": schemas.SchemaYAML,
}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, additionalJSONBytes)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, additionalJSONBytes)
if err != nil {
panic(err)
}
diff --git a/pkg/component/operator/json/v0/README.mdx b/pkg/component/operator/json/v0/README.mdx
index e2f85fbb8..da2b6211c 100644
--- a/pkg/component/operator/json/v0/README.mdx
+++ b/pkg/component/operator/json/v0/README.mdx
@@ -22,7 +22,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/json/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/json/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/json/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/json/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/operator/json/v0/config/definition.json b/pkg/component/operator/json/v0/config/definition.json
deleted file mode 100644
index 15db34c90..000000000
--- a/pkg/component/operator/json/v0/config/definition.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "availableTasks": [
- "TASK_MARSHAL",
- "TASK_UNMARSHAL",
- "TASK_JQ",
- "TASK_RENAME_FIELDS"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/operator/json",
- "icon": "assets/json.svg",
- "iconUrl": "",
- "id": "json",
- "public": true,
- "spec": {},
- "title": "JSON",
- "type": "COMPONENT_TYPE_OPERATOR",
- "uid": "28f53d15-6150-46e6-99aa-f76b70a926c0",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/json/v0",
- "description": "Manipulate and convert JSON entities.",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/operator/json/v0/config/definition.yaml b/pkg/component/operator/json/v0/config/definition.yaml
new file mode 100644
index 000000000..ce1c0b515
--- /dev/null
+++ b/pkg/component/operator/json/v0/config/definition.yaml
@@ -0,0 +1,19 @@
+availableTasks:
+- TASK_MARSHAL
+- TASK_UNMARSHAL
+- TASK_JQ
+- TASK_RENAME_FIELDS
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/operator/json
+icon: assets/json.svg
+iconUrl: ''
+id: json
+public: true
+spec: {}
+title: JSON
+type: COMPONENT_TYPE_OPERATOR
+uid: 28f53d15-6150-46e6-99aa-f76b70a926c0
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/json/v0
+description: Manipulate and convert JSON entities.
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/operator/json/v0/config/tasks.json b/pkg/component/operator/json/v0/config/tasks.json
deleted file mode 100644
index 43e2ea422..000000000
--- a/pkg/component/operator/json/v0/config/tasks.json
+++ /dev/null
@@ -1,255 +0,0 @@
-{
- "TASK_MARSHAL": {
- "shortDescription": "Convert JSON to a string",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "json": {
- "description": "JSON entity to be marshaled. It can be any valid JSON datatype (e.g. number, string, hash, array).",
- "shortDescription": "JSON entity to be marshaled",
- "acceptFormats": [
- "object",
- "json",
- "object"
- ],
- "uiOrder": 0,
- "required": [],
- "title": "JSON"
- }
- },
- "required": [
- "json"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "string": {
- "description": "String representation of the JSON input.",
- "uiOrder": 0,
- "title": "JSON string",
- "format": "string"
- }
- },
- "required": [
- "string"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_UNMARSHAL": {
- "shortDescription": "Convert a string to JSON",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "string": {
- "description": "JSON string to be unmarshaled. It can represent any valid JSON datatype (e.g. number, string, hash, array).",
- "shortDescription": "JSON string to be unmarshaled",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "String",
- "format": "string"
- }
- },
- "required": [
- "string"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "json": {
- "description": "JSON entity extracted from the string input.",
- "uiOrder": 0,
- "required": [],
- "title": "JSON",
- "format": "json"
- }
- },
- "required": [
- "json"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_JQ": {
- "shortDescription": "Process JSON through a `jq` command",
- "title": "jq",
- "input": {
- "description": "Source JSON and `jq` command.",
- "uiOrder": 0,
- "properties": {
- "json-string": {
- "deprecated": true,
- "uiOrder": 2,
- "description": "(DEPRECATED, use 'JSON value' instead) String with the JSON value to be processed. This field allows templated inputs, but the data might require preprocessing (marshalling). This field will be used in absence of 'JSON value' for backwards compatibility reasons.",
- "shortDescription": "(DEPRECATED) JSON string to be processed",
- "acceptFormats": [
- "string"
- ],
- "title": "(DEPRECATED) JSON string",
- "format": "string"
- },
- "json-value": {
- "uiOrder": 0,
- "description": "JSON entity to be processed by the filter. It can be any valid JSON datatype (e.g. number, string, hash, array).",
- "acceptFormats": [
- "object",
- "object",
- "json"
- ],
- "title": "JSON value"
- },
- "jq-filter": {
- "uiOrder": 1,
- "description": "Filter, in `jq` syntax, that will be applied to the JSON input.",
- "acceptFormats": [
- "string"
- ],
- "title": "Filter",
- "format": "string"
- }
- },
- "required": [
- "jq-filter"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Results of the `jq` command applied to the input JSON.",
- "uiOrder": 0,
- "properties": {
- "results": {
- "description": "The `jq` command results.",
- "uiOrder": 0,
- "required": [],
- "title": "Results",
- "items": {
- "title": "Result",
- "format": "json"
- },
- "format": "array"
- }
- },
- "required": [
- "results"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_RENAME_FIELDS": {
- "shortDescription": "Rename fields in a JSON object with a conflict resolution strategy. If the new field already exists, it will be overwritten by default.",
- "title": "Rename Fields",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "json": {
- "description": "JSON object to be edited. It can be any valid JSON datatype (e.g. number, string, hash, array).",
- "shortDescription": "JSON object to be edited.",
- "acceptFormats": [
- "object",
- "json",
- "object"
- ],
- "uiOrder": 0,
- "required": [],
- "title": "JSON"
- },
- "fields": {
- "description": "An array of objects specifying the fields to be renamed.",
- "shortDescription": "Array of fields to be renamed.",
- "uiOrder": 1,
- "acceptFormats": [
- "array"
- ],
- "items": {
- "description": "Field to be renamed.",
- "shortDescription": "Field to be renamed.",
- "properties": {
- "from": {
- "description": "The field in the original data that needs to be renamed.",
- "shortDescription": "Field to be renamed.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "From",
- "format": "string"
- },
- "to": {
- "description": "The new name for the field.",
- "shortDescription": "New name for the field.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "To",
- "format": "string"
- }
- },
- "required": [
- "from",
- "to"
- ],
- "title": "Field",
- "format": "object"
- },
- "title": "Fields",
- "format": "array"
- },
- "conflict-resolution": {
- "description": "Defines how conflicts are handled when the new field already exists in the data. If the new field already exists, it will be overwritten by default. If the new field does not exist, it will be created. When set to 'error', the component will throw an error if the new field already exists. When set to 'skip', the new field will be skipped if it already exists.",
- "shortDescription": "Conflict resolution strategy.",
- "uiOrder": 2,
- "title": "Conflict Resolution",
- "enum": [
- "overwrite",
- "skip",
- "error"
- ],
- "default": "overwrite",
- "format": "string"
- }
- },
- "required": [
- "json",
- "fields"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 1,
- "properties": {
- "json": {
- "description": "JSON object with the renamed fields.",
- "uiOrder": 0,
- "required": [],
- "title": "JSON",
- "format": "json"
- }
- },
- "required": [
- "json"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/operator/json/v0/config/tasks.yaml b/pkg/component/operator/json/v0/config/tasks.yaml
new file mode 100644
index 000000000..611342261
--- /dev/null
+++ b/pkg/component/operator/json/v0/config/tasks.yaml
@@ -0,0 +1,209 @@
+TASK_MARSHAL:
+ shortDescription: Convert JSON to a string
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ json:
+ description: JSON entity to be marshaled. It can be any valid JSON datatype
+ (e.g. number, string, hash, array).
+ shortDescription: JSON entity to be marshaled
+ acceptFormats:
+ - object
+ - json
+ - object
+ uiOrder: 0
+ required: []
+ title: JSON
+ required:
+ - json
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ string:
+ description: String representation of the JSON input.
+ uiOrder: 0
+ title: JSON string
+ format: string
+ required:
+ - string
+ title: Output
+ format: object
+TASK_UNMARSHAL:
+ shortDescription: Convert a string to JSON
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ string:
+ description: JSON string to be unmarshaled. It can represent any valid JSON
+ datatype (e.g. number, string, hash, array).
+ shortDescription: JSON string to be unmarshaled
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: String
+ format: string
+ required:
+ - string
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ json:
+ description: JSON entity extracted from the string input.
+ uiOrder: 0
+ required: []
+ title: JSON
+ format: json
+ required:
+ - json
+ title: Output
+ format: object
+TASK_JQ:
+ shortDescription: Process JSON through a `jq` command
+ title: jq
+ input:
+ description: Source JSON and `jq` command.
+ uiOrder: 0
+ properties:
+ json-string:
+ deprecated: true
+ uiOrder: 2
+ description: (DEPRECATED, use 'JSON value' instead) String with the JSON value
+ to be processed. This field allows templated inputs, but the data might
+ require preprocessing (marshalling). This field will be used in absence
+ of 'JSON value' for backwards compatibility reasons.
+ shortDescription: (DEPRECATED) JSON string to be processed
+ acceptFormats:
+ - string
+ title: (DEPRECATED) JSON string
+ format: string
+ json-value:
+ uiOrder: 0
+ description: JSON entity to be processed by the filter. It can be any valid
+ JSON datatype (e.g. number, string, hash, array).
+ acceptFormats:
+ - object
+ - object
+ - json
+ title: JSON value
+ jq-filter:
+ uiOrder: 1
+ description: Filter, in `jq` syntax, that will be applied to the JSON input.
+ acceptFormats:
+ - string
+ title: Filter
+ format: string
+ required:
+ - jq-filter
+ title: Input
+ format: object
+ output:
+ description: Results of the `jq` command applied to the input JSON.
+ uiOrder: 0
+ properties:
+ results:
+ description: The `jq` command results.
+ uiOrder: 0
+ required: []
+ title: Results
+ items:
+ title: Result
+ format: json
+ format: array
+ required:
+ - results
+ title: Output
+ format: object
+TASK_RENAME_FIELDS:
+ shortDescription: Rename fields in a JSON object with a conflict resolution strategy.
+ If the new field already exists, it will be overwritten by default.
+ title: Rename Fields
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ json:
+ description: JSON object to be edited. It can be any valid JSON datatype (e.g.
+ number, string, hash, array).
+ shortDescription: JSON object to be edited.
+ acceptFormats:
+ - object
+ - json
+ - object
+ uiOrder: 0
+ required: []
+ title: JSON
+ fields:
+ description: An array of objects specifying the fields to be renamed.
+ shortDescription: Array of fields to be renamed.
+ uiOrder: 1
+ acceptFormats:
+ - array
+ items:
+ description: Field to be renamed.
+ shortDescription: Field to be renamed.
+ properties:
+ from:
+ description: The field in the original data that needs to be renamed.
+ shortDescription: Field to be renamed.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: From
+ format: string
+ to:
+ description: The new name for the field.
+ shortDescription: New name for the field.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: To
+ format: string
+ required:
+ - from
+ - to
+ title: Field
+ format: object
+ title: Fields
+ format: array
+ conflict-resolution:
+ description: Defines how conflicts are handled when the new field already
+ exists in the data. If the new field already exists, it will be overwritten
+ by default. If the new field does not exist, it will be created. When set
+ to 'error', the component will throw an error if the new field already exists.
+ When set to 'skip', the new field will be skipped if it already exists.
+ shortDescription: Conflict resolution strategy.
+ uiOrder: 2
+ title: Conflict Resolution
+ enum:
+ - overwrite
+ - skip
+ - error
+ default: overwrite
+ format: string
+ required:
+ - json
+ - fields
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 1
+ properties:
+ json:
+ description: JSON object with the renamed fields.
+ uiOrder: 0
+ required: []
+ title: JSON
+ format: json
+ required:
+ - json
+ title: Output
+ format: object
diff --git a/pkg/component/operator/json/v0/main.go b/pkg/component/operator/json/v0/main.go
index 789e043cf..00e07673f 100644
--- a/pkg/component/operator/json/v0/main.go
+++ b/pkg/component/operator/json/v0/main.go
@@ -25,10 +25,10 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -48,7 +48,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/operator/text/v0/README.mdx b/pkg/component/operator/text/v0/README.mdx
index 2542a1a5d..d3d786832 100644
--- a/pkg/component/operator/text/v0/README.mdx
+++ b/pkg/component/operator/text/v0/README.mdx
@@ -19,7 +19,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/text/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/text/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/text/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/text/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/operator/text/v0/config/definition.json b/pkg/component/operator/text/v0/config/definition.json
deleted file mode 100644
index ea87014f4..000000000
--- a/pkg/component/operator/text/v0/config/definition.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "availableTasks": [
- "TASK_CHUNK_TEXT"
- ],
- "custom": false,
- "documentationUrl": "https://www.instill.tech/docs/component/operator/text",
- "icon": "assets/text.svg",
- "iconUrl": "",
- "id": "text",
- "public": true,
- "spec": {},
- "title": "Text",
- "type": "COMPONENT_TYPE_OPERATOR",
- "uid": "5b7aca5b-1ae3-477f-bf60-d34e1c993c87",
- "version": "0.1.1",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/text/v0",
- "description": "Extract and manipulate text from different sources.",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/operator/text/v0/config/definition.yaml b/pkg/component/operator/text/v0/config/definition.yaml
new file mode 100644
index 000000000..22ed94f83
--- /dev/null
+++ b/pkg/component/operator/text/v0/config/definition.yaml
@@ -0,0 +1,16 @@
+availableTasks:
+- TASK_CHUNK_TEXT
+custom: false
+documentationUrl: https://www.instill.tech/docs/component/operator/text
+icon: assets/text.svg
+iconUrl: ''
+id: text
+public: true
+spec: {}
+title: Text
+type: COMPONENT_TYPE_OPERATOR
+uid: 5b7aca5b-1ae3-477f-bf60-d34e1c993c87
+version: 0.1.1
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/text/v0
+description: Extract and manipulate text from different sources.
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/operator/text/v0/config/tasks.json b/pkg/component/operator/text/v0/config/tasks.json
deleted file mode 100644
index f37aaf0d1..000000000
--- a/pkg/component/operator/text/v0/config/tasks.json
+++ /dev/null
@@ -1,329 +0,0 @@
-{
- "$defs": {
- "text": {
- "description": "Text to be chunked.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "Text",
- "format": "string"
- },
- "chunk-size": {
- "default": 512,
- "description": "Specifies the maximum size of each chunk in terms of the number of tokens.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 1,
- "minimum": 1,
- "title": "Chunk Size",
- "format": "integer"
- },
- "chunk-overlap": {
- "default": 100,
- "description": "Determines the number of tokens that overlap between consecutive chunks.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "minimum": 1,
- "title": "Chunk Overlap",
- "format": "integer"
- },
- "model-name": {
- "description": "The name of the model used for tokenization.",
- "enum": [
- "gpt-4",
- "gpt-3.5-turbo",
- "text-davinci-003",
- "text-davinci-002",
- "text-davinci-001",
- "text-curie-001",
- "text-babbage-001",
- "text-ada-001",
- "davinci",
- "curie",
- "babbage",
- "ada",
- "code-davinci-002",
- "code-davinci-001",
- "code-cushman-002",
- "code-cushman-001",
- "davinci-codex",
- "cushman-codex",
- "text-davinci-edit-001",
- "code-davinci-edit-001",
- "text-embedding-ada-002",
- "text-similarity-davinci-001",
- "text-similarity-curie-001",
- "text-similarity-babbage-001",
- "text-similarity-ada-001",
- "text-search-davinci-doc-001",
- "text-search-curie-doc-001",
- "text-search-babbage-doc-001",
- "text-search-ada-doc-001",
- "code-search-babbage-code-001",
- "code-search-ada-code-001",
- "gpt2"
- ],
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 3,
- "title": "Model",
- "format": "string"
- }
- },
- "TASK_CHUNK_TEXT": {
- "shortDescription": "Chunk text with different strategies",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "text": {
- "$ref": "#/$defs/text"
- },
- "strategy": {
- "description": "Chunking strategy.",
- "uiOrder": 1,
- "properties": {
- "setting": {
- "description": "Chunk Setting.",
- "additionalProperties": true,
- "title": "Setting",
- "uiOrder": 0,
- "required": [
- "chunk-method"
- ],
- "oneOf": [
- {
- "properties": {
- "chunk-method": {
- "const": "Token",
- "title": "Chunk Method",
- "description": "Chunking based on tokenization.",
- "uiOrder": 0,
- "format": "string"
- },
- "chunk-size": {
- "$ref": "#/$defs/chunk-size"
- },
- "chunk-overlap": {
- "$ref": "#/$defs/chunk-overlap"
- },
- "model-name": {
- "$ref": "#/$defs/model-name"
- },
- "allowed-special": {
- "default": [],
- "description": "A list of special tokens that are allowed within chunks.",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "uiOrder": 4,
- "title": "Allowed Special Tokens",
- "format": "array"
- },
- "disallowed-special": {
- "default": [],
- "description": "A list of special tokens that should not appear within chunks.",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "uiOrder": 5,
- "title": "Disallowed Special Tokens",
- "format": "array"
- }
- },
- "required": [
- "chunk-method"
- ],
- "title": "Token",
- "description": "Language models have a token limit. You should not exceed the token limit. When you split your text into chunks it is therefore a good idea to count the number of tokens. There are many tokenizers. When you count tokens in your text you should use the same tokenizer as used in the language model.",
- "format": "object"
- },
- {
- "properties": {
- "chunk-method": {
- "const": "Recursive",
- "title": "Chunk Method",
- "description": "Chunking based on recursive splitting.",
- "uiOrder": 0,
- "format": "string"
- },
- "chunk-size": {
- "$ref": "#/$defs/chunk-size"
- },
- "chunk-overlap": {
- "$ref": "#/$defs/chunk-overlap"
- },
- "model-name": {
- "$ref": "#/$defs/model-name"
- },
- "separators": {
- "default": [],
- "description": "A list of strings representing the separators used to split the text.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 3,
- "items": {
- "format": "string"
- },
- "title": "Separators",
- "format": "array"
- },
- "keep-separator": {
- "description": "A flag indicating whether to keep the separator characters at the beginning or end of chunks.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 4,
- "title": "Keep Separator",
- "format": "boolean"
- }
- },
- "required": [
- "chunk-method"
- ],
- "title": "Recursive",
- "description": "This text splitter is the recommended one for generic text. It is parameterized by a list of characters. It tries to split on them in order until the chunks are small enough. The default list is [\"\\n\\n\", \"\\n\", \"\", \"\"]. This has the effect of trying to keep all paragraphs (and then sentences, and then words) together as long as possible, as those would generically seem to be the strongest semantically related pieces of text.",
- "format": "object"
- },
- {
- "properties": {
- "chunk-method": {
- "const": "Markdown",
- "title": "Chunk Method",
- "description": "Chunking based on recursive splitting with markdown format.",
- "uiOrder": 0,
- "format": "string"
- },
- "chunk-size": {
- "$ref": "#/$defs/chunk-size"
- },
- "chunk-overlap": {
- "$ref": "#/$defs/chunk-overlap"
- },
- "model-name": {
- "$ref": "#/$defs/model-name"
- },
- "code-blocks": {
- "description": "A flag indicating whether code blocks should be treated as a single unit.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 3,
- "title": "Code Blocks",
- "format": "boolean"
- }
- },
- "required": [
- "chunk-method"
- ],
- "title": "Markdown",
- "description": "This text splitter is specially designed for Markdown format.",
- "format": "object"
- }
- ],
- "format": "object"
- }
- },
- "title": "Strategy",
- "required": [
- "setting"
- ],
- "format": "object"
- }
- },
- "required": [
- "text",
- "strategy"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "chunk-num": {
- "description": "Total number of output text chunks.",
- "uiOrder": 2,
- "title": "Number of Text Chunks",
- "format": "integer"
- },
- "text-chunks": {
- "description": "Text chunks after splitting.",
- "uiOrder": 1,
- "items": {
- "title": "Text Chunk",
- "description": "Text chunk after splitting.",
- "properties": {
- "text": {
- "title": "Text",
- "description": "Text chunk after splitting.",
- "uiOrder": 0,
- "format": "string"
- },
- "start-position": {
- "title": "Start Position",
- "description": "The starting position of the chunk in the original text.",
- "uiOrder": 1,
- "format": "integer"
- },
- "end-position": {
- "title": "End Position",
- "description": "The ending position of the chunk in the original text.",
- "uiOrder": 2,
- "format": "integer"
- },
- "token-count": {
- "title": "Token Count",
- "description": "Count of tokens in a chunk.",
- "uiOrder": 3,
- "format": "integer"
- }
- },
- "required": [
- "text",
- "start-position",
- "end-position",
- "token-count"
- ],
- "format": "object"
- },
- "title": "Text Chunks",
- "format": "array"
- },
- "token-count": {
- "description": "Total count of tokens in the original input text.",
- "uiOrder": 0,
- "title": "Token Count",
- "format": "integer"
- },
- "chunks-token-count": {
- "description": "Total count of tokens in the output text chunks.",
- "uiOrder": 3,
- "title": "Token Count Chunks",
- "format": "integer"
- }
- },
- "required": [
- "text-chunks",
- "chunk-num",
- "token-count",
- "chunks-token-count"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/operator/text/v0/config/tasks.yaml b/pkg/component/operator/text/v0/config/tasks.yaml
new file mode 100644
index 000000000..f68be9b15
--- /dev/null
+++ b/pkg/component/operator/text/v0/config/tasks.yaml
@@ -0,0 +1,272 @@
+$defs:
+ text:
+ description: Text to be chunked.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: Text
+ format: string
+ chunk-size:
+ default: 512
+ description: Specifies the maximum size of each chunk in terms of the number of
+ tokens.
+ acceptFormats:
+ - integer
+ uiOrder: 1
+ minimum: 1
+ title: Chunk Size
+ format: integer
+ chunk-overlap:
+ default: 100
+ description: Determines the number of tokens that overlap between consecutive
+ chunks.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ minimum: 1
+ title: Chunk Overlap
+ format: integer
+ model-name:
+ description: The name of the model used for tokenization.
+ enum:
+ - gpt-4
+ - gpt-3.5-turbo
+ - text-davinci-003
+ - text-davinci-002
+ - text-davinci-001
+ - text-curie-001
+ - text-babbage-001
+ - text-ada-001
+ - davinci
+ - curie
+ - babbage
+ - ada
+ - code-davinci-002
+ - code-davinci-001
+ - code-cushman-002
+ - code-cushman-001
+ - davinci-codex
+ - cushman-codex
+ - text-davinci-edit-001
+ - code-davinci-edit-001
+ - text-embedding-ada-002
+ - text-similarity-davinci-001
+ - text-similarity-curie-001
+ - text-similarity-babbage-001
+ - text-similarity-ada-001
+ - text-search-davinci-doc-001
+ - text-search-curie-doc-001
+ - text-search-babbage-doc-001
+ - text-search-ada-doc-001
+ - code-search-babbage-code-001
+ - code-search-ada-code-001
+ - gpt2
+ acceptFormats:
+ - string
+ uiOrder: 3
+ title: Model
+ format: string
+TASK_CHUNK_TEXT:
+ shortDescription: Chunk text with different strategies
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ text:
+ $ref: '#/$defs/text'
+ strategy:
+ description: Chunking strategy.
+ uiOrder: 1
+ properties:
+ setting:
+ description: Chunk Setting.
+ additionalProperties: true
+ title: Setting
+ uiOrder: 0
+ required:
+ - chunk-method
+ oneOf:
+ - properties:
+ chunk-method:
+ const: Token
+ title: Chunk Method
+ description: Chunking based on tokenization.
+ uiOrder: 0
+ format: string
+ chunk-size:
+ $ref: '#/$defs/chunk-size'
+ chunk-overlap:
+ $ref: '#/$defs/chunk-overlap'
+ model-name:
+ $ref: '#/$defs/model-name'
+ allowed-special:
+ default: []
+ description: A list of special tokens that are allowed within chunks.
+ acceptFormats:
+ - array
+ items:
+ format: string
+ uiOrder: 4
+ title: Allowed Special Tokens
+ format: array
+ disallowed-special:
+ default: []
+ description: A list of special tokens that should not appear within
+ chunks.
+ acceptFormats:
+ - array
+ items:
+ format: string
+ uiOrder: 5
+ title: Disallowed Special Tokens
+ format: array
+ required:
+ - chunk-method
+ title: Token
+ description: Language models have a token limit. You should not exceed
+ the token limit. When you split your text into chunks it is therefore
+ a good idea to count the number of tokens. There are many tokenizers.
+ When you count tokens in your text you should use the same tokenizer
+ as used in the language model.
+ format: object
+ - properties:
+ chunk-method:
+ const: Recursive
+ title: Chunk Method
+ description: Chunking based on recursive splitting.
+ uiOrder: 0
+ format: string
+ chunk-size:
+ $ref: '#/$defs/chunk-size'
+ chunk-overlap:
+ $ref: '#/$defs/chunk-overlap'
+ model-name:
+ $ref: '#/$defs/model-name'
+ separators:
+ default: []
+ description: A list of strings representing the separators used
+ to split the text.
+ acceptFormats:
+ - array
+ uiOrder: 3
+ items:
+ format: string
+ title: Separators
+ format: array
+ keep-separator:
+ description: A flag indicating whether to keep the separator characters
+ at the beginning or end of chunks.
+ acceptFormats:
+ - boolean
+ uiOrder: 4
+ title: Keep Separator
+ format: boolean
+ required:
+ - chunk-method
+ title: Recursive
+ description: This text splitter is the recommended one for generic text.
+ It is parameterized by a list of characters. It tries to split on
+ them in order until the chunks are small enough. The default list
+ is ["\n\n", "\n", "", ""]. This has the effect of trying to keep all
+ paragraphs (and then sentences, and then words) together as long as
+ possible, as those would generically seem to be the strongest semantically
+ related pieces of text.
+ format: object
+ - properties:
+ chunk-method:
+ const: Markdown
+ title: Chunk Method
+ description: Chunking based on recursive splitting with markdown
+ format.
+ uiOrder: 0
+ format: string
+ chunk-size:
+ $ref: '#/$defs/chunk-size'
+ chunk-overlap:
+ $ref: '#/$defs/chunk-overlap'
+ model-name:
+ $ref: '#/$defs/model-name'
+ code-blocks:
+ description: A flag indicating whether code blocks should be treated
+ as a single unit.
+ acceptFormats:
+ - boolean
+ uiOrder: 3
+ title: Code Blocks
+ format: boolean
+ required:
+ - chunk-method
+ title: Markdown
+ description: This text splitter is specially designed for Markdown format.
+ format: object
+ format: object
+ title: Strategy
+ required:
+ - setting
+ format: object
+ required:
+ - text
+ - strategy
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ chunk-num:
+ description: Total number of output text chunks.
+ uiOrder: 2
+ title: Number of Text Chunks
+ format: integer
+ text-chunks:
+ description: Text chunks after splitting.
+ uiOrder: 1
+ items:
+ title: Text Chunk
+ description: Text chunk after splitting.
+ properties:
+ text:
+ title: Text
+ description: Text chunk after splitting.
+ uiOrder: 0
+ format: string
+ start-position:
+ title: Start Position
+ description: The starting position of the chunk in the original text.
+ uiOrder: 1
+ format: integer
+ end-position:
+ title: End Position
+ description: The ending position of the chunk in the original text.
+ uiOrder: 2
+ format: integer
+ token-count:
+ title: Token Count
+ description: Count of tokens in a chunk.
+ uiOrder: 3
+ format: integer
+ required:
+ - text
+ - start-position
+ - end-position
+ - token-count
+ format: object
+ title: Text Chunks
+ format: array
+ token-count:
+ description: Total count of tokens in the original input text.
+ uiOrder: 0
+ title: Token Count
+ format: integer
+ chunks-token-count:
+ description: Total count of tokens in the output text chunks.
+ uiOrder: 3
+ title: Token Count Chunks
+ format: integer
+ required:
+ - text-chunks
+ - chunk-num
+ - token-count
+ - chunks-token-count
+ title: Output
+ format: object
diff --git a/pkg/component/operator/text/v0/main.go b/pkg/component/operator/text/v0/main.go
index 87304c5ea..8bf16f88e 100644
--- a/pkg/component/operator/text/v0/main.go
+++ b/pkg/component/operator/text/v0/main.go
@@ -16,10 +16,10 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
)
@@ -38,7 +38,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/operator/video/v0/README.mdx b/pkg/component/operator/video/v0/README.mdx
index 6e34fd186..fe1f0c25c 100644
--- a/pkg/component/operator/video/v0/README.mdx
+++ b/pkg/component/operator/video/v0/README.mdx
@@ -23,7 +23,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/video/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/video/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/video/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/video/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/operator/video/v0/config/definition.json b/pkg/component/operator/video/v0/config/definition.json
deleted file mode 100644
index 61180f01b..000000000
--- a/pkg/component/operator/video/v0/config/definition.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "availableTasks": [
- "TASK_SEGMENT",
- "TASK_SUBSAMPLE",
- "TASK_EXTRACT_AUDIO",
- "TASK_EXTRACT_FRAMES",
- "TASK_EMBED_AUDIO"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/operator/video",
- "icon": "assets/video.svg",
- "id": "video",
- "public": true,
- "spec": {},
- "title": "Video",
- "type": "COMPONENT_TYPE_OPERATOR",
- "uid": "f0be2fd3-7266-4eeb-88eb-3bbbcc2a6b32",
- "version": "0.1.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/video/v0",
- "description": "Operate video data.",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/operator/video/v0/config/definition.yaml b/pkg/component/operator/video/v0/config/definition.yaml
new file mode 100644
index 000000000..67a88753f
--- /dev/null
+++ b/pkg/component/operator/video/v0/config/definition.yaml
@@ -0,0 +1,18 @@
+availableTasks:
+- TASK_SEGMENT
+- TASK_SUBSAMPLE
+- TASK_EXTRACT_AUDIO
+- TASK_EXTRACT_FRAMES
+- TASK_EMBED_AUDIO
+documentationUrl: https://www.instill.tech/docs/component/operator/video
+icon: assets/video.svg
+id: video
+public: true
+spec: {}
+title: Video
+type: COMPONENT_TYPE_OPERATOR
+uid: f0be2fd3-7266-4eeb-88eb-3bbbcc2a6b32
+version: 0.1.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/video/v0
+description: Operate video data.
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/operator/video/v0/config/tasks.json b/pkg/component/operator/video/v0/config/tasks.json
deleted file mode 100644
index 7a8d85e6e..000000000
--- a/pkg/component/operator/video/v0/config/tasks.json
+++ /dev/null
@@ -1,325 +0,0 @@
-{
- "$defs": {
- "segment": {
- "additionalProperties": false,
- "properties": {
- "start-time": {
- "title": "Start Time",
- "description": "The number of seconds from the beginning of the audio file to the start of this segment.",
- "uiOrder": 0,
- "format": "number"
- },
- "end-time": {
- "title": "End Time",
- "description": "The number of seconds from the beginning of the audio file to the end of this segment.",
- "uiOrder": 1,
- "format": "number"
- }
- },
- "required": [
- "start-time",
- "end-time"
- ],
- "title": "Segment",
- "description": "A time segment of audio data, defined by its start and end times in seconds.",
- "format": "object"
- }
- },
- "TASK_SEGMENT": {
- "shortDescription": "Split a video into multiple shorter clips based on user-defined time segments. This task takes a video input and an optional list of time ranges, then produces an array of video segments corresponding to those ranges. Each segment becomes a separate video clip, enabling precise extraction of specific portions from the original content for targeted use or analysis.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "video": {
- "description": "The source video file to be segmented. This video will be split into multiple clips based on the specified time segments.",
- "acceptFormats": [
- "video/*",
- "application/octet-stream"
- ],
- "uiOrder": 0,
- "title": "Video",
- "format": "string"
- },
- "segments": {
- "description": "An array of time segments defining the portions of the video to be extracted. Each segment specifies a start and end time, and the task will create separate video clips for each of these segments. If not provided, the entire video will be treated as a single segment.",
- "uiOrder": 1,
- "items": {
- "$ref": "#/$defs/segment"
- },
- "title": "Segments",
- "format": "array"
- }
- },
- "required": [
- "video"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 0,
- "properties": {
- "video-segments": {
- "description": "An array of video clips resulting from the segmentation process. Each element in this array corresponds to one of the input segments and contains the video data for that specific time range from the original video.",
- "uiOrder": 0,
- "items": {
- "format": "string"
- },
- "title": "Videos",
- "format": "array"
- }
- },
- "required": [
- "video-segments"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SUBSAMPLE": {
- "shortDescription": "Reduce video file size by adjusting frame rate, bitrate, and dimensions while maintaining visual content. This task optimizes storage and bandwidth requirements with minimal quality loss.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "video": {
- "description": "The source video file to be subsampled.",
- "acceptFormats": [
- "video/*",
- "application/octet-stream"
- ],
- "uiOrder": 0,
- "title": "Video",
- "format": "string"
- },
- "video-bitrate": {
- "description": "The target video bitrate for the subsampled video, in bits per second. Controls the output video's data rate, affecting file size and quality. Must provide at least one of: video-bitrate, audio-bitrate, fps, width, or height.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 2,
- "title": "Video Bitrate",
- "format": "number"
- },
- "audio-bitrate": {
- "description": "The target audio bitrate for the subsampled video, in bits per second. Controls the output video's audio data rate, affecting file size and quality. Must provide at least one of: video-bitrate, audio-bitrate, fps, width, or height.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 3,
- "title": "Audio Bitrate",
- "format": "number"
- },
- "fps": {
- "description": "The target frame rate for the subsampled video, in frames per second. Determines the number of frames in the output video. Must provide at least one of: video-bitrate, audio-bitrate, fps, width, or height.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 1,
- "title": "FPS",
- "format": "number"
- },
- "width": {
- "description": "The width of the subsampled video, in pixels. Controls the output video's horizontal resolution. If only width is provided, height is auto-calculated to maintain aspect ratio. Must provide at least one of: video-bitrate, audio-bitrate, fps, width, or height.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "title": "Width",
- "format": "integer"
- },
- "height": {
- "description": "The height of the subsampled video, in pixels. Controls the output video's vertical resolution. If only height is provided, width is auto-calculated to maintain aspect ratio. Must provide at least one of: video-bitrate, audio-bitrate, fps, width, or height.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 3,
- "title": "Height",
- "format": "integer"
- }
- },
- "required": [
- "video"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 1,
- "properties": {
- "video": {
- "description": "The subsampled video data, processed according to the specified input parameters. Maintains the content of the original video with potentially reduced file size due to changes in frame rate, bitrate, or dimensions.",
- "uiOrder": 0,
- "title": "Video",
- "format": "video/*"
- }
- },
- "required": [
- "video"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_EXTRACT_AUDIO": {
- "shortDescription": "Extract the audio track from a video file, creating a standalone audio output. This task takes a video input and isolates its sound component, removing all visual elements. The resulting audio data is provided as a single output, suitable for further audio processing, analysis, or use in audio-only applications.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "video": {
- "description": "The source video file from which the audio will be extracted. The video's visual content will be discarded, and only the audio track will be processed.",
- "acceptFormats": [
- "video/*",
- "application/octet-stream"
- ],
- "uiOrder": 0,
- "title": "Video",
- "format": "string"
- }
- },
- "required": [
- "video"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 1,
- "properties": {
- "audio": {
- "description": "The extracted audio data from the input video. This is a standalone audio file containing only the sound component of the original video, with all visual elements removed. The audio format may vary depending on the original video's audio codec and the extraction process.",
- "uiOrder": 0,
- "title": "Audio",
- "format": "audio/*"
- }
- },
- "required": [
- "audio"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_EMBED_AUDIO": {
- "shortDescription": "Embed an audio to the existing video",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "audio": {
- "description": "Audio data to embed to video",
- "acceptFormats": [
- "audio",
- "application/octet-stream"
- ],
- "uiOrder": 0,
- "title": "Audio",
- "type": "string"
- },
- "video": {
- "description": "Video input to be embedded with provided audio",
- "acceptFormats": [
- "video",
- "application/octet-stream"
- ],
- "uiOrder": 1,
- "title": "Video",
- "type": "string"
- }
- },
- "required": [
- "video",
- "audio"
- ],
- "title": "Input",
- "type": "object"
- },
- "output": {
- "description": "Output for embedding audio task",
- "uiOrder": 0,
- "properties": {
- "video": {
- "description": "Final video embedded with audio",
- "format": "video",
- "uiOrder": 0,
- "title": "Video",
- "type": "string"
- }
- },
- "required": [
- "video"
- ],
- "title": "Output",
- "type": "object"
- }
- },
- "TASK_EXTRACT_FRAMES": {
- "shortDescription": "Extract image frames from a video at regular intervals or specified timestamps. This task takes a video input and either an interval value or a list of timestamps. It then produces an array of image frames corresponding to these specifications, allowing for precise capture of key moments or creation of a sequence of still images from the video content.",
- "input": {
- "description": "Input.",
- "uiOrder": 0,
- "properties": {
- "video": {
- "description": "The source video file from which frames will be extracted.",
- "acceptFormats": [
- "video/*",
- "application/octet-stream"
- ],
- "uiOrder": 0,
- "title": "Video",
- "format": "string"
- },
- "interval": {
- "description": "The time interval between extracted frames, in seconds. If specified, frames will be extracted at regular intervals throughout the video. This parameter is mutually exclusive with `timestamps`.",
- "acceptFormats": [
- "number",
- "integer"
- ],
- "uiOrder": 1,
- "title": "Interval",
- "format": "number"
- },
- "timestamps": {
- "description": "An array of specific timestamps (in seconds) at which to extract frames from the video. If provided, frames will be extracted only at these exact times. This parameter is mutually exclusive with `interval`.",
- "uiOrder": 2,
- "title": "Timestamps",
- "format": "array"
- }
- },
- "required": [
- "video"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "description": "Output.",
- "uiOrder": 1,
- "properties": {
- "frames": {
- "description": "Extracted video frames.",
- "uiOrder": 0,
- "items": {
- "title": "Frame",
- "format": "string"
- },
- "title": "Frames",
- "format": "array"
- }
- },
- "required": [
- "frames"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/operator/video/v0/config/tasks.yaml b/pkg/component/operator/video/v0/config/tasks.yaml
new file mode 100644
index 000000000..1167184b1
--- /dev/null
+++ b/pkg/component/operator/video/v0/config/tasks.yaml
@@ -0,0 +1,296 @@
+$defs:
+ segment:
+ additionalProperties: false
+ properties:
+ start-time:
+ title: Start Time
+ description: The number of seconds from the beginning of the audio file to
+ the start of this segment.
+ uiOrder: 0
+ format: number
+ end-time:
+ title: End Time
+ description: The number of seconds from the beginning of the audio file to
+ the end of this segment.
+ uiOrder: 1
+ format: number
+ required:
+ - start-time
+ - end-time
+ title: Segment
+ description: A time segment of audio data, defined by its start and end times
+ in seconds.
+ format: object
+TASK_SEGMENT:
+ shortDescription: Split a video into multiple shorter clips based on user-defined
+ time segments. This task takes a video input and an optional list of time ranges,
+ then produces an array of video segments corresponding to those ranges. Each segment
+ becomes a separate video clip, enabling precise extraction of specific portions
+ from the original content for targeted use or analysis.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ video:
+ description: The source video file to be segmented. This video will be split
+ into multiple clips based on the specified time segments.
+ acceptFormats:
+ - video/*
+ - application/octet-stream
+ uiOrder: 0
+ title: Video
+ format: string
+ segments:
+ description: An array of time segments defining the portions of the video
+ to be extracted. Each segment specifies a start and end time, and the task
+ will create separate video clips for each of these segments. If not provided,
+ the entire video will be treated as a single segment.
+ uiOrder: 1
+ items:
+ $ref: '#/$defs/segment'
+ title: Segments
+ format: array
+ required:
+ - video
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 0
+ properties:
+ video-segments:
+ description: An array of video clips resulting from the segmentation process.
+ Each element in this array corresponds to one of the input segments and
+ contains the video data for that specific time range from the original video.
+ uiOrder: 0
+ items:
+ format: string
+ title: Videos
+ format: array
+ required:
+ - video-segments
+ title: Output
+ format: object
+TASK_SUBSAMPLE:
+ shortDescription: Reduce video file size by adjusting frame rate, bitrate, and dimensions
+ while maintaining visual content. This task optimizes storage and bandwidth requirements
+ with minimal quality loss.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ video:
+ description: The source video file to be subsampled.
+ acceptFormats:
+ - video/*
+ - application/octet-stream
+ uiOrder: 0
+ title: Video
+ format: string
+ video-bitrate:
+ description: 'The target video bitrate for the subsampled video, in bits per
+ second. Controls the output video''s data rate, affecting file size and
+ quality. Must provide at least one of: video-bitrate, audio-bitrate, fps,
+ width, or height.'
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 2
+ title: Video Bitrate
+ format: number
+ audio-bitrate:
+ description: 'The target audio bitrate for the subsampled video, in bits per
+ second. Controls the output video''s audio data rate, affecting file size
+ and quality. Must provide at least one of: video-bitrate, audio-bitrate,
+ fps, width, or height.'
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 3
+ title: Audio Bitrate
+ format: number
+ fps:
+ description: 'The target frame rate for the subsampled video, in frames per
+ second. Determines the number of frames in the output video. Must provide
+ at least one of: video-bitrate, audio-bitrate, fps, width, or height.'
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 1
+ title: FPS
+ format: number
+ width:
+ description: 'The width of the subsampled video, in pixels. Controls the output
+ video''s horizontal resolution. If only width is provided, height is auto-calculated
+ to maintain aspect ratio. Must provide at least one of: video-bitrate, audio-bitrate,
+ fps, width, or height.'
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ title: Width
+ format: integer
+ height:
+ description: 'The height of the subsampled video, in pixels. Controls the
+ output video''s vertical resolution. If only height is provided, width is
+ auto-calculated to maintain aspect ratio. Must provide at least one of:
+ video-bitrate, audio-bitrate, fps, width, or height.'
+ acceptFormats:
+ - integer
+ uiOrder: 3
+ title: Height
+ format: integer
+ required:
+ - video
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 1
+ properties:
+ video:
+ description: The subsampled video data, processed according to the specified
+ input parameters. Maintains the content of the original video with potentially
+ reduced file size due to changes in frame rate, bitrate, or dimensions.
+ uiOrder: 0
+ title: Video
+ format: video/*
+ required:
+ - video
+ title: Output
+ format: object
+TASK_EXTRACT_AUDIO:
+ shortDescription: Extract the audio track from a video file, creating a standalone
+ audio output. This task takes a video input and isolates its sound component,
+ removing all visual elements. The resulting audio data is provided as a single
+ output, suitable for further audio processing, analysis, or use in audio-only
+ applications.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ video:
+ description: The source video file from which the audio will be extracted.
+ The video's visual content will be discarded, and only the audio track will
+ be processed.
+ acceptFormats:
+ - video/*
+ - application/octet-stream
+ uiOrder: 0
+ title: Video
+ format: string
+ required:
+ - video
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 1
+ properties:
+ audio:
+ description: The extracted audio data from the input video. This is a standalone
+ audio file containing only the sound component of the original video, with
+ all visual elements removed. The audio format may vary depending on the
+ original video's audio codec and the extraction process.
+ uiOrder: 0
+ title: Audio
+ format: audio/*
+ required:
+ - audio
+ title: Output
+ format: object
+TASK_EMBED_AUDIO:
+ shortDescription: Embed an audio to the existing video
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ audio:
+ description: Audio data to embed to video
+ acceptFormats:
+ - audio
+ - application/octet-stream
+ uiOrder: 0
+ title: Audio
+ type: string
+ video:
+ description: Video input to be embedded with provided audio
+ acceptFormats:
+ - video
+ - application/octet-stream
+ uiOrder: 1
+ title: Video
+ type: string
+ required:
+ - video
+ - audio
+ title: Input
+ type: object
+ output:
+ description: Output for embedding audio task
+ uiOrder: 0
+ properties:
+ video:
+ description: Final video embedded with audio
+ format: video
+ uiOrder: 0
+ title: Video
+ type: string
+ required:
+ - video
+ title: Output
+ type: object
+TASK_EXTRACT_FRAMES:
+ shortDescription: Extract image frames from a video at regular intervals or specified
+ timestamps. This task takes a video input and either an interval value or a list
+ of timestamps. It then produces an array of image frames corresponding to these
+ specifications, allowing for precise capture of key moments or creation of a sequence
+ of still images from the video content.
+ input:
+ description: Input.
+ uiOrder: 0
+ properties:
+ video:
+ description: The source video file from which frames will be extracted.
+ acceptFormats:
+ - video/*
+ - application/octet-stream
+ uiOrder: 0
+ title: Video
+ format: string
+ interval:
+ description: The time interval between extracted frames, in seconds. If specified,
+ frames will be extracted at regular intervals throughout the video. This
+ parameter is mutually exclusive with `timestamps`.
+ acceptFormats:
+ - number
+ - integer
+ uiOrder: 1
+ title: Interval
+ format: number
+ timestamps:
+ description: An array of specific timestamps (in seconds) at which to extract
+ frames from the video. If provided, frames will be extracted only at these
+ exact times. This parameter is mutually exclusive with `interval`.
+ uiOrder: 2
+ title: Timestamps
+ format: array
+ required:
+ - video
+ title: Input
+ format: object
+ output:
+ description: Output.
+ uiOrder: 1
+ properties:
+ frames:
+ description: Extracted video frames.
+ uiOrder: 0
+ items:
+ title: Frame
+ format: string
+ title: Frames
+ format: array
+ required:
+ - frames
+ title: Output
+ format: object
diff --git a/pkg/component/operator/video/v0/main.go b/pkg/component/operator/video/v0/main.go
index ce5e6cf3d..9c376cc13 100644
--- a/pkg/component/operator/video/v0/main.go
+++ b/pkg/component/operator/video/v0/main.go
@@ -20,10 +20,10 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
)
@@ -40,7 +40,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/operator/web/v0/README.mdx b/pkg/component/operator/web/v0/README.mdx
index 3ae3cdab9..9120cb799 100644
--- a/pkg/component/operator/web/v0/README.mdx
+++ b/pkg/component/operator/web/v0/README.mdx
@@ -21,7 +21,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/web/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/web/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/web/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/web/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/operator/web/v0/config/definition.json b/pkg/component/operator/web/v0/config/definition.json
deleted file mode 100644
index c721d2b10..000000000
--- a/pkg/component/operator/web/v0/config/definition.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "availableTasks": [
- "TASK_CRAWL_SITE",
- "TASK_SCRAPE_PAGES",
- "TASK_SCRAPE_SITEMAP"
- ],
- "documentationUrl": "https://www.instill.tech/docs/component/operator/web",
- "icon": "assets/web.svg",
- "id": "web",
- "public": true,
- "title": "Web",
- "type": "COMPONENT_TYPE_OPERATOR",
- "uid": "98909958-db7d-4dfe-9858-7761904be17e",
- "version": "0.4.0",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/web/v0",
- "description": "Scrape websites.",
- "releaseStage": "RELEASE_STAGE_ALPHA"
-}
diff --git a/pkg/component/operator/web/v0/config/definition.yaml b/pkg/component/operator/web/v0/config/definition.yaml
new file mode 100644
index 000000000..3a31a88dc
--- /dev/null
+++ b/pkg/component/operator/web/v0/config/definition.yaml
@@ -0,0 +1,15 @@
+availableTasks:
+- TASK_CRAWL_SITE
+- TASK_SCRAPE_PAGES
+- TASK_SCRAPE_SITEMAP
+documentationUrl: https://www.instill.tech/docs/component/operator/web
+icon: assets/web.svg
+id: web
+public: true
+title: Web
+type: COMPONENT_TYPE_OPERATOR
+uid: 98909958-db7d-4dfe-9858-7761904be17e
+version: 0.4.0
+sourceUrl: https://github.com/instill-ai/pipeline-backend/blob/main/pkg/component/operator/web/v0
+description: Scrape websites.
+releaseStage: RELEASE_STAGE_ALPHA
diff --git a/pkg/component/operator/web/v0/config/tasks.json b/pkg/component/operator/web/v0/config/tasks.json
deleted file mode 100644
index dd7853bde..000000000
--- a/pkg/component/operator/web/v0/config/tasks.json
+++ /dev/null
@@ -1,390 +0,0 @@
-{
- "$defs": {
- "page-info": {
- "properties": {
- "link": {
- "description": "The full URL to which the webpage link is pointing, e.g., http://www.example.com/foo/bar.",
- "uiOrder": 0,
- "title": "Link",
- "format": "string"
- },
- "title": {
- "description": "The title of a webpage link in plain text.",
- "uiOrder": 1,
- "title": "Title",
- "format": "string"
- }
- },
- "required": [
- "link"
- ],
- "title": "Page Information",
- "format": "object"
- }
- },
- "TASK_CRAWL_SITE": {
- "shortDescription": "This task involves systematically navigating through a website, starting from a designated page (typically the homepage), and following internal links to discover and retrieve page titles and URLs. The process is limited to 120 seconds and only collects links and titles from multiple pages; it does not extract the content of the pages themselves. If you need to collect specific content from individual pages, please use the Scrape Page task instead.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "url": {
- "description": "The root URL to scrape. All links on this page will be scraped, and all links on those pages, and so on.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "URL",
- "format": "string"
- },
- "allowed-domains": {
- "description": "A list of domains that are allowed to be scraped. If empty, all domains are allowed.",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 1,
- "items": {
- "format": "string"
- },
- "title": "Allowed Domains",
- "format": "array"
- },
- "max-k": {
- "default": 10,
- "description": "Max-K sets a limit on the number of pages to fetch. If Max-K is set to 0, all available pages will be fetched within the time limit of 120 seconds. If Max-K is a positive number, the fetch will return up to that many pages, but no more.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 2,
- "minimum": 0,
- "title": "Max Number of Pages",
- "format": "integer"
- },
- "timeout": {
- "default": 1000,
- "description": "The time to wait for a page to load in milliseconds. Min 0, Max 60000. Please notice the timeout here is set for each page rather than the whole crawl task.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 3,
- "minimum": 0,
- "maximum": 60000,
- "title": "Timeout",
- "format": "integer"
- },
- "max-depth": {
- "default": 0,
- "description": "Max Depth specifies how deep the crawler will navigate from the root URL. If max depth is set to 1, the crawler will only scrape the root URL and will not follow any links to other pages. If max depth is set to 0, the crawler will scrape all reachable pages until the total number of scraped pages reaches max-k. If both max-k and max depth are defined, the crawler will prioritize the max-k setting when determining how many pages to scrape.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 4,
- "minimum": 0,
- "title": "Max Depth",
- "format": "integer"
- },
- "filter": {
- "description": "Filtering based on [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions). The URL will be crawled if it matches either include-pattern or not match exclude-pattern. When both include-pattern and exclude-pattern are empty, all URLs will be crawled. It will process exclude-pattern first, then include-pattern. When exclude-pattern is not empty, only URLs that do not match exclude-pattern will be crawled. When include-pattern is not empty, only URLs that match include-pattern will be crawled.",
- "uiOrder": 5,
- "title": "Filter",
- "properties": {
- "exclude-pattern": {
- "description": "When the URL is matched, the URL will not be crawled.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 1,
- "title": "Exclude Pattern",
- "format": "string"
- },
- "include-pattern": {
- "description": "When the URL is matched, the URL will be crawled.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 2,
- "title": "Include Pattern",
- "format": "string"
- }
- },
- "required": [],
- "format": "object"
- }
- },
- "required": [
- "url",
- "max-k"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "pages": {
- "description": "The link and title of webpages crawled by the crawler.",
- "uiOrder": 0,
- "items": {
- "$ref": "#/$defs/page-info",
- "title": "Page"
- },
- "title": "Pages",
- "format": "array"
- }
- },
- "required": [
- "pages"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SCRAPE_SITEMAP": {
- "shortDescription": "This task extracts data directly from a website’s sitemap. A sitemap is typically an XML file that lists all URLs and other relevant metadata, providing a structured overview of the site’s pages. This method efficiently gathers key information from the sitemap without navigating through the site’s internal pages.",
- "input": {
- "description": "The URL contains sitemap.",
- "uiOrder": 0,
- "properties": {
- "url": {
- "description": "The URL of the sitemap to scrape.",
- "acceptFormats": [
- "string"
- ],
- "uiOrder": 0,
- "title": "URL",
- "format": "string"
- }
- },
- "required": [
- "url"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "list": {
- "description": "The list of information in a sitemap.",
- "uiOrder": 0,
- "items": {
- "properties": {
- "loc": {
- "description": "The URL of the webpage.",
- "title": "URL",
- "uiOrder": 0,
- "format": "string"
- },
- "lastmod": {
- "description": "The last modified time of the webpage with ISO 8601 format.",
- "title": "Last Modified",
- "uiOrder": 1,
- "format": "string"
- },
- "changefreq": {
- "description": "The change frequency of the webpage.",
- "title": "Change Frequency",
- "uiOrder": 2,
- "format": "string"
- },
- "priority": {
- "description": "The priority of the webpage.",
- "title": "Priority",
- "uiOrder": 3,
- "format": "number"
- }
- },
- "required": [
- "loc",
- "lastmod"
- ],
- "title": "List",
- "format": "json"
- },
- "title": "List",
- "format": "array"
- }
- },
- "required": [
- "list"
- ],
- "title": "Output",
- "format": "object"
- }
- },
- "TASK_SCRAPE_PAGES": {
- "shortDescription": "This task focuses on extracting specific data from targeted webpages by parsing its HTML structure. Unlike crawling, which navigates across multiple pages, scraping retrieves content only from the specified page. After scraping, the data can be further processed using a defined [jQuery](https://www.w3schools.com/jquery/jquery_syntax.asp) in a specified sequence. The sequence of jQuery filtering data will be executed in the order of `only-main-content`, `remove-tags`, and `only-include-tags`. Refer to the [jQuery Syntax Examples](#jquery-syntax-examples) for more details on how to filter and manipulate the data. To avoid a single URL failure from affecting all requests, we will not return an error when an individual URL fails. Instead, we will return all contents that are successfully scraped.",
- "input": {
- "uiOrder": 0,
- "properties": {
- "urls": {
- "description": "The URLs to scrape the webpage contents.",
- "acceptFormats": [
- "array"
- ],
- "items": {
- "format": "string"
- },
- "uiOrder": 0,
- "title": "URLs",
- "format": "array"
- },
- "scrape-method": {
- "description": "Defines the method used for web scraping. Available options include 'http' for standard HTTP-based scraping and 'chrome-simulator' for scraping through a simulated Chrome browser environment.",
- "acceptFormats": [
- "string"
- ],
- "enum": [
- "http",
- "chrome-simulator"
- ],
- "uiOrder": 1,
- "default": "http",
- "title": "Scrape Method",
- "format": "string"
- },
- "include-html": {
- "description": "Indicate whether to include the raw HTML of the webpage in the output. If you want to include the raw HTML, set this to true.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 2,
- "title": "Include HTML",
- "format": "boolean"
- },
- "only-main-content": {
- "description": "Only return the main content of the page by excluding the content of the tag of header, nav, footer.",
- "acceptFormats": [
- "boolean"
- ],
- "uiOrder": 3,
- "title": "Only Main Content",
- "format": "boolean"
- },
- "remove-tags": {
- "description": "A list of tags, classes, and ids to remove from the output. You can use [jQuery](https://www.w3schools.com/jquery/jquery_syntax.asp) to remove data. If empty, no tags will be removed. Example: 'script, .ad, #footer'. Please check the [jQuery Syntax Examples](#jquery-syntax-examples).",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 4,
- "items": {
- "format": "string"
- },
- "title": "Remove Tags",
- "format": "array"
- },
- "only-include-tags": {
- "description": "A list of tags, classes, and ids to include in the output. You can use [jQuery](https://www.w3schools.com/jquery/jquery_syntax.asp) to include data. If empty, all tags will be included. Example: 'script, .ad, #footer'. Please check the [jQuery Syntax Examples](#jquery-syntax-examples).",
- "acceptFormats": [
- "array"
- ],
- "uiOrder": 5,
- "items": {
- "format": "string"
- },
- "title": "Only Include Tags",
- "format": "array"
- },
- "timeout": {
- "default": 1000,
- "description": "This parameter specifies the time to wait for a page to load, measured in milliseconds. The minimum value is 0, and the maximum value is 60,000. Please note that if you set a short timeout, the page may not fully load. Conversely, setting a long timeout could significantly increase the time it takes for the task to complete. This timeout setting applies only to the Chrome simulator.",
- "acceptFormats": [
- "integer"
- ],
- "uiOrder": 6,
- "minimum": 0,
- "maximum": 60000,
- "title": "Timeout",
- "format": "integer"
- }
- },
- "required": [
- "urls",
- "scrape-method"
- ],
- "title": "Input",
- "format": "object"
- },
- "output": {
- "uiOrder": 0,
- "properties": {
- "pages": {
- "description": "A list of page objects that have been scraped.",
- "uiOrder": 0,
- "items": {
- "properties": {
- "content": {
- "description": "The scraped plain content without html tags of the webpage.",
- "uiOrder": 0,
- "title": "Content",
- "format": "string"
- },
- "markdown": {
- "description": "The scraped markdown of the webpage.",
- "uiOrder": 1,
- "title": "Markdown",
- "format": "string"
- },
- "html": {
- "description": "The scraped html of the webpage.",
- "uiOrder": 2,
- "title": "HTML",
- "format": "string"
- },
- "metadata": {
- "description": "The metadata of the webpage.",
- "uiOrder": 3,
- "properties": {
- "title": {
- "description": "The title of the webpage.",
- "title": "Title",
- "uiOrder": 0,
- "format": "string"
- },
- "description": {
- "description": "The description of the webpage.",
- "title": "Description",
- "uiOrder": 1,
- "format": "string"
- },
- "source-url": {
- "description": "The source URL of the webpage.",
- "title": "Source URL",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [
- "title",
- "source-url"
- ],
- "title": "Metadata",
- "format": "object"
- },
- "links-on-page": {
- "description": "The list of links on the webpage.",
- "uiOrder": 4,
- "items": {
- "format": "string"
- },
- "title": "Links on Page",
- "format": "array"
- }
- },
- "required": [
- "content",
- "markdown"
- ],
- "format": "object"
- },
- "title": "Pages",
- "format": "array"
- }
- },
- "required": [
- "pages"
- ],
- "title": "Output",
- "format": "object"
- }
- }
-}
diff --git a/pkg/component/operator/web/v0/config/tasks.yaml b/pkg/component/operator/web/v0/config/tasks.yaml
new file mode 100644
index 000000000..521cd6959
--- /dev/null
+++ b/pkg/component/operator/web/v0/config/tasks.yaml
@@ -0,0 +1,350 @@
+$defs:
+ page-info:
+ properties:
+ link:
+ description: The full URL to which the webpage link is pointing, e.g., http://www.example.com/foo/bar.
+ uiOrder: 0
+ title: Link
+ format: string
+ title:
+ description: The title of a webpage link in plain text.
+ uiOrder: 1
+ title: Title
+ format: string
+ required:
+ - link
+ title: Page Information
+ format: object
+TASK_CRAWL_SITE:
+ shortDescription: This task involves systematically navigating through a website,
+ starting from a designated page (typically the homepage), and following internal
+ links to discover and retrieve page titles and URLs. The process is limited to
+ 120 seconds and only collects links and titles from multiple pages; it does not
+ extract the content of the pages themselves. If you need to collect specific content
+ from individual pages, please use the Scrape Page task instead.
+ input:
+ uiOrder: 0
+ properties:
+ url:
+ description: The root URL to scrape. All links on this page will be scraped,
+ and all links on those pages, and so on.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: URL
+ format: string
+ allowed-domains:
+ description: A list of domains that are allowed to be scraped. If empty, all
+ domains are allowed.
+ acceptFormats:
+ - array
+ uiOrder: 1
+ items:
+ format: string
+ title: Allowed Domains
+ format: array
+ max-k:
+ default: 10
+ description: Max-K sets a limit on the number of pages to fetch. If Max-K
+ is set to 0, all available pages will be fetched within the time limit of
+ 120 seconds. If Max-K is a positive number, the fetch will return up to
+ that many pages, but no more.
+ acceptFormats:
+ - integer
+ uiOrder: 2
+ minimum: 0
+ title: Max Number of Pages
+ format: integer
+ timeout:
+ default: 1000
+ description: The time to wait for a page to load in milliseconds. Min 0, Max
+ 60000. Please notice the timeout here is set for each page rather than the
+ whole crawl task.
+ acceptFormats:
+ - integer
+ uiOrder: 3
+ minimum: 0
+ maximum: 60000
+ title: Timeout
+ format: integer
+ max-depth:
+ default: 0
+ description: Max Depth specifies how deep the crawler will navigate from the
+ root URL. If max depth is set to 1, the crawler will only scrape the root
+ URL and will not follow any links to other pages. If max depth is set to
+ 0, the crawler will scrape all reachable pages until the total number of
+ scraped pages reaches max-k. If both max-k and max depth are defined, the
+ crawler will prioritize the max-k setting when determining how many pages
+ to scrape.
+ acceptFormats:
+ - integer
+ uiOrder: 4
+ minimum: 0
+ title: Max Depth
+ format: integer
+ filter:
+ description: Filtering based on [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions).
+ The URL will be crawled if it matches either include-pattern or not match
+ exclude-pattern. When both include-pattern and exclude-pattern are empty,
+ all URLs will be crawled. It will process exclude-pattern first, then include-pattern.
+ When exclude-pattern is not empty, only URLs that do not match exclude-pattern
+ will be crawled. When include-pattern is not empty, only URLs that match
+ include-pattern will be crawled.
+ uiOrder: 5
+ title: Filter
+ properties:
+ exclude-pattern:
+ description: When the URL is matched, the URL will not be crawled.
+ acceptFormats:
+ - string
+ uiOrder: 1
+ title: Exclude Pattern
+ format: string
+ include-pattern:
+ description: When the URL is matched, the URL will be crawled.
+ acceptFormats:
+ - string
+ uiOrder: 2
+ title: Include Pattern
+ format: string
+ required: []
+ format: object
+ required:
+ - url
+ - max-k
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ pages:
+ description: The link and title of webpages crawled by the crawler.
+ uiOrder: 0
+ items:
+ $ref: '#/$defs/page-info'
+ title: Page
+ title: Pages
+ format: array
+ required:
+ - pages
+ title: Output
+ format: object
+TASK_SCRAPE_SITEMAP:
+ shortDescription: This task extracts data directly from a website’s sitemap. A sitemap
+ is typically an XML file that lists all URLs and other relevant metadata, providing
+ a structured overview of the site’s pages. This method efficiently gathers key
+ information from the sitemap without navigating through the site’s internal pages.
+ input:
+ description: The URL contains sitemap.
+ uiOrder: 0
+ properties:
+ url:
+ description: The URL of the sitemap to scrape.
+ acceptFormats:
+ - string
+ uiOrder: 0
+ title: URL
+ format: string
+ required:
+ - url
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ list:
+ description: The list of information in a sitemap.
+ uiOrder: 0
+ items:
+ properties:
+ loc:
+ description: The URL of the webpage.
+ title: URL
+ uiOrder: 0
+ format: string
+ lastmod:
+ description: The last modified time of the webpage with ISO 8601 format.
+ title: Last Modified
+ uiOrder: 1
+ format: string
+ changefreq:
+ description: The change frequency of the webpage.
+ title: Change Frequency
+ uiOrder: 2
+ format: string
+ priority:
+ description: The priority of the webpage.
+ title: Priority
+ uiOrder: 3
+ format: number
+ required:
+ - loc
+ - lastmod
+ title: List
+ format: json
+ title: List
+ format: array
+ required:
+ - list
+ title: Output
+ format: object
+TASK_SCRAPE_PAGES:
+ shortDescription: This task focuses on extracting specific data from targeted webpages
+ by parsing its HTML structure. Unlike crawling, which navigates across multiple
+ pages, scraping retrieves content only from the specified page. After scraping,
+ the data can be further processed using a defined [jQuery](https://www.w3schools.com/jquery/jquery_syntax.asp)
+ in a specified sequence. The sequence of jQuery filtering data will be executed
+ in the order of `only-main-content`, `remove-tags`, and `only-include-tags`. Refer
+ to the [jQuery Syntax Examples](#jquery-syntax-examples) for more details on how
+ to filter and manipulate the data. To avoid a single URL failure from affecting
+ all requests, we will not return an error when an individual URL fails. Instead,
+ we will return all contents that are successfully scraped.
+ input:
+ uiOrder: 0
+ properties:
+ urls:
+ description: The URLs to scrape the webpage contents.
+ acceptFormats:
+ - array
+ items:
+ format: string
+ uiOrder: 0
+ title: URLs
+ format: array
+ scrape-method:
+ description: Defines the method used for web scraping. Available options include
+ 'http' for standard HTTP-based scraping and 'chrome-simulator' for scraping
+ through a simulated Chrome browser environment.
+ acceptFormats:
+ - string
+ enum:
+ - http
+ - chrome-simulator
+ uiOrder: 1
+ default: http
+ title: Scrape Method
+ format: string
+ include-html:
+ description: Indicate whether to include the raw HTML of the webpage in the
+ output. If you want to include the raw HTML, set this to true.
+ acceptFormats:
+ - boolean
+ uiOrder: 2
+ title: Include HTML
+ format: boolean
+ only-main-content:
+ description: Only return the main content of the page by excluding the content
+ of the tag of header, nav, footer.
+ acceptFormats:
+ - boolean
+ uiOrder: 3
+ title: Only Main Content
+ format: boolean
+ remove-tags:
+ description: 'A list of tags, classes, and ids to remove from the output.
+ You can use [jQuery](https://www.w3schools.com/jquery/jquery_syntax.asp)
+ to remove data. If empty, no tags will be removed. Example: ''script, .ad,
+ #footer''. Please check the [jQuery Syntax Examples](#jquery-syntax-examples).'
+ acceptFormats:
+ - array
+ uiOrder: 4
+ items:
+ format: string
+ title: Remove Tags
+ format: array
+ only-include-tags:
+ description: 'A list of tags, classes, and ids to include in the output. You
+ can use [jQuery](https://www.w3schools.com/jquery/jquery_syntax.asp) to
+ include data. If empty, all tags will be included. Example: ''script, .ad,
+ #footer''. Please check the [jQuery Syntax Examples](#jquery-syntax-examples).'
+ acceptFormats:
+ - array
+ uiOrder: 5
+ items:
+ format: string
+ title: Only Include Tags
+ format: array
+ timeout:
+ default: 1000
+ description: This parameter specifies the time to wait for a page to load,
+ measured in milliseconds. The minimum value is 0, and the maximum value
+ is 60,000. Please note that if you set a short timeout, the page may not
+ fully load. Conversely, setting a long timeout could significantly increase
+ the time it takes for the task to complete. This timeout setting applies
+ only to the Chrome simulator.
+ acceptFormats:
+ - integer
+ uiOrder: 6
+ minimum: 0
+ maximum: 60000
+ title: Timeout
+ format: integer
+ required:
+ - urls
+ - scrape-method
+ title: Input
+ format: object
+ output:
+ uiOrder: 0
+ properties:
+ pages:
+ description: A list of page objects that have been scraped.
+ uiOrder: 0
+ items:
+ properties:
+ content:
+ description: The scraped plain content without html tags of the webpage.
+ uiOrder: 0
+ title: Content
+ format: string
+ markdown:
+ description: The scraped markdown of the webpage.
+ uiOrder: 1
+ title: Markdown
+ format: string
+ html:
+ description: The scraped html of the webpage.
+ uiOrder: 2
+ title: HTML
+ format: string
+ metadata:
+ description: The metadata of the webpage.
+ uiOrder: 3
+ properties:
+ title:
+ description: The title of the webpage.
+ title: Title
+ uiOrder: 0
+ format: string
+ description:
+ description: The description of the webpage.
+ title: Description
+ uiOrder: 1
+ format: string
+ source-url:
+ description: The source URL of the webpage.
+ title: Source URL
+ uiOrder: 2
+ format: string
+ required:
+ - title
+ - source-url
+ title: Metadata
+ format: object
+ links-on-page:
+ description: The list of links on the webpage.
+ uiOrder: 4
+ items:
+ format: string
+ title: Links on Page
+ format: array
+ required:
+ - content
+ - markdown
+ format: object
+ title: Pages
+ format: array
+ required:
+ - pages
+ title: Output
+ format: object
diff --git a/pkg/component/operator/web/v0/main.go b/pkg/component/operator/web/v0/main.go
index 172238d36..c617c14f7 100644
--- a/pkg/component/operator/web/v0/main.go
+++ b/pkg/component/operator/web/v0/main.go
@@ -22,10 +22,10 @@ const (
)
var (
- //go:embed config/definition.json
- definitionJSON []byte
- //go:embed config/tasks.json
- tasksJSON []byte
+ //go:embed config/definition.yaml
+ definitionYAML []byte
+ //go:embed config/tasks.yaml
+ tasksYAML []byte
once sync.Once
comp *component
@@ -45,7 +45,7 @@ type execution struct {
func Init(bc base.Component) *component {
once.Do(func() {
comp = &component{Component: bc}
- err := comp.LoadDefinition(definitionJSON, nil, tasksJSON, nil, nil)
+ err := comp.LoadDefinition(definitionYAML, nil, tasksYAML, nil, nil)
if err != nil {
panic(err)
}
diff --git a/pkg/component/resources/schemas/schema.go b/pkg/component/resources/schemas/schema.go
index b6bb6b31d..10235ca82 100644
--- a/pkg/component/resources/schemas/schema.go
+++ b/pkg/component/resources/schemas/schema.go
@@ -4,5 +4,5 @@ import (
_ "embed"
)
-//go:embed schema.json
-var SchemaJSON []byte
+//go:embed schema.yaml
+var SchemaYAML []byte
diff --git a/pkg/component/resources/schemas/schema.json b/pkg/component/resources/schemas/schema.json
deleted file mode 100644
index ab4ef4d0d..000000000
--- a/pkg/component/resources/schemas/schema.json
+++ /dev/null
@@ -1,398 +0,0 @@
-{
- "$defs": {
- "instill-types": {
- "bounding-box": {
- "additionalProperties": false,
- "description": "The detected bounding box in (left, top, width, height) format.",
- "properties": {
- "height": {
- "description": "Bounding box height value",
- "uiOrder": 3,
- "title": "Height",
- "format": "number"
- },
- "left": {
- "description": "Bounding box left x-axis value",
- "uiOrder": 0,
- "title": "Left",
- "format": "number"
- },
- "top": {
- "description": "Bounding box top y-axis value",
- "uiOrder": 1,
- "title": "Top",
- "format": "number"
- },
- "width": {
- "description": "Bounding box width value",
- "uiOrder": 2,
- "title": "Width",
- "format": "number"
- }
- },
- "required": [
- "left",
- "top",
- "width",
- "height"
- ],
- "title": "Bounding Box",
- "format": "object"
- },
- "chat-messages": {
- "items": {
- "properties": {
- "content": {
- "$ref": "#/$defs/instill-types/multi-modal-content",
- "description": "The message content",
- "uiOrder": 1,
- "title": "Content"
- },
- "metadata": {
- "additionalProperties": true,
- "description": "The message metadata",
- "uiOrder": 2,
- "required": [],
- "title": "Metadata",
- "format": "json"
- },
- "role": {
- "description": "The message role, i.e. 'system', 'user' or 'assistant'",
- "uiOrder": 0,
- "title": "Role",
- "format": "string"
- }
- },
- "required": [
- "role",
- "content"
- ],
- "format": "object"
- },
- "title": "Chat Message",
- "format": "array"
- },
- "classification": {
- "additionalProperties": false,
- "properties": {
- "category": {
- "description": "The predicted category of the input.",
- "uiOrder": 0,
- "title": "Category",
- "format": "string"
- },
- "score": {
- "description": "The confidence score of the predicted category of the input.",
- "uiOrder": 1,
- "title": "Score",
- "format": "number"
- }
- },
- "required": [
- "category",
- "score"
- ],
- "format": "object"
- },
- "detection": {
- "additionalProperties": false,
- "properties": {
- "objects": {
- "description": "A list of detected objects.",
- "uiOrder": 0,
- "items": {
- "additionalProperties": false,
- "properties": {
- "bounding-box": {
- "$ref": "#/$defs/instill-types/bounding-box",
- "uiOrder": 1,
- "title": "Bounding box"
- },
- "category": {
- "description": "The predicted category of the bounding box.",
- "uiOrder": 2,
- "title": "Category",
- "format": "string"
- },
- "score": {
- "description": "The confidence score of the predicted category of the bounding box.",
- "uiOrder": 3,
- "title": "Score",
- "format": "number"
- }
- },
- "required": [
- "bounding-box",
- "category",
- "score"
- ],
- "title": "Object",
- "format": "object"
- },
- "title": "Objects",
- "format": "array"
- }
- },
- "required": [
- "objects"
- ],
- "format": "object"
- },
- "embedding": {
- "items": {
- "title": "Embedding",
- "format": "number"
- },
- "title": "Embedding",
- "format": "array"
- },
- "instance-segmentation": {
- "additionalProperties": false,
- "properties": {
- "objects": {
- "description": "A list of detected instance bounding boxes.",
- "uiOrder": 0,
- "items": {
- "properties": {
- "bounding-box": {
- "$ref": "#/$defs/instill-types/bounding-box",
- "uiOrder": 1,
- "title": "Bounding Box"
- },
- "category": {
- "description": "The predicted category of the bounding box.",
- "uiOrder": 2,
- "title": "Category",
- "format": "string"
- },
- "rle": {
- "description": "Run Length Encoding (RLE) of instance mask within the bounding box.",
- "uiOrder": 0,
- "title": "RLE",
- "format": "string"
- },
- "score": {
- "description": "The confidence score of the predicted instance object.",
- "uiOrder": 3,
- "title": "Score",
- "format": "number"
- }
- },
- "required": [
- "rle",
- "bounding-box",
- "category",
- "score"
- ],
- "title": "Object",
- "format": "object"
- },
- "title": "Objects",
- "format": "array"
- }
- },
- "required": [
- "objects"
- ],
- "format": "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.",
- "uiOrder": 0,
- "items": {
- "properties": {
- "bounding-box": {
- "$ref": "#/$defs/instill-types/bounding-box",
- "uiOrder": 2,
- "title": "Bounding Box"
- },
- "keypoints": {
- "description": "A keypoint group is composed of a list of pre-defined keypoints of a detected object.",
- "uiOrder": 0,
- "items": {
- "uiOrder": 0,
- "properties": {
- "v": {
- "description": "visibility score of the keypoint.",
- "uiOrder": 2,
- "title": "Visibility Score",
- "format": "number"
- },
- "x": {
- "description": "x coordinate of the keypoint.",
- "uiOrder": 0,
- "title": "X Coordinate",
- "format": "number"
- },
- "y": {
- "description": "y coordinate of the keypoint.",
- "uiOrder": 1,
- "title": "Y Coordinate",
- "format": "number"
- }
- },
- "required": [
- "x",
- "y",
- "v"
- ],
- "title": "Keypoints",
- "format": "object"
- },
- "title": "Keypoints",
- "format": "array"
- },
- "score": {
- "description": "The confidence score of the predicted object.",
- "uiOrder": 1,
- "title": "Score",
- "format": "number"
- }
- },
- "required": [
- "keypoints",
- "score",
- "bounding-box"
- ],
- "title": "Object",
- "format": "object"
- },
- "title": "Objects",
- "format": "array"
- }
- },
- "required": [
- "objects"
- ],
- "format": "object"
- },
- "multi-modal-content": {
- "items": {
- "properties": {
- "image-url": {
- "properties": {
- "url": {
- "description": "Either a URL of the image or the base64 encoded image data.",
- "title": "URL",
- "uiOrder": 0,
- "format": "string"
- }
- },
- "required": [
- "url"
- ],
- "title": "Image URL",
- "description": "The image URL",
- "uiOrder": 0,
- "format": "object"
- },
- "text": {
- "description": "The text content.",
- "title": "Text",
- "uiOrder": 1,
- "format": "string"
- },
- "type": {
- "description": "The type of the content part.",
- "enum": [
- "text",
- "image-url"
- ],
- "title": "Type",
- "uiOrder": 2,
- "format": "string"
- }
- },
- "required": [
- "type"
- ],
- "format": "object"
- },
- "format": "array"
- },
- "ocr": {
- "additionalProperties": false,
- "properties": {
- "objects": {
- "description": "A list of detected bounding boxes.",
- "uiOrder": 0,
- "items": {
- "properties": {
- "bounding-box": {
- "$ref": "#/$defs/instill-types/bounding-box",
- "uiOrder": 0,
- "title": "Bounding Box"
- },
- "score": {
- "description": "The confidence score of the predicted object.",
- "uiOrder": 2,
- "title": "Score",
- "format": "number"
- },
- "text": {
- "description": "Text string recognised per bounding box.",
- "uiOrder": 1,
- "title": "Text",
- "format": "string"
- }
- },
- "required": [
- "bounding-box",
- "text",
- "score"
- ],
- "title": "Object",
- "format": "object"
- },
- "title": "Objects",
- "format": "array"
- }
- },
- "required": [
- "objects"
- ],
- "format": "object"
- },
- "semantic-segmentation": {
- "additionalProperties": false,
- "properties": {
- "stuffs": {
- "description": "A list of RLE binary masks.",
- "uiOrder": 0,
- "items": {
- "properties": {
- "category": {
- "description": "Category text string corresponding to each stuff mask.",
- "uiOrder": 1,
- "title": "Category",
- "format": "string"
- },
- "rle": {
- "description": "Run Length Encoding (RLE) of each stuff mask within the image.",
- "uiOrder": 0,
- "title": "RLE",
- "format": "string"
- }
- },
- "required": [
- "rle",
- "category"
- ],
- "title": "Object",
- "format": "object"
- },
- "title": "Stuffs",
- "format": "array"
- }
- },
- "required": [
- "stuffs"
- ],
- "format": "object"
- }
- }
- }
-}
diff --git a/pkg/component/resources/schemas/schema.yaml b/pkg/component/resources/schemas/schema.yaml
new file mode 100644
index 000000000..899f59662
--- /dev/null
+++ b/pkg/component/resources/schemas/schema.yaml
@@ -0,0 +1,312 @@
+$defs:
+ instill-types:
+ bounding-box:
+ additionalProperties: false
+ description: The detected bounding box in (left, top, width, height) format.
+ properties:
+ height:
+ description: Bounding box height value
+ uiOrder: 3
+ title: Height
+ format: number
+ left:
+ description: Bounding box left x-axis value
+ uiOrder: 0
+ title: Left
+ format: number
+ top:
+ description: Bounding box top y-axis value
+ uiOrder: 1
+ title: Top
+ format: number
+ width:
+ description: Bounding box width value
+ uiOrder: 2
+ title: Width
+ format: number
+ required:
+ - left
+ - top
+ - width
+ - height
+ title: Bounding Box
+ format: object
+ chat-messages:
+ items:
+ properties:
+ content:
+ $ref: '#/$defs/instill-types/multi-modal-content'
+ description: The message content
+ uiOrder: 1
+ title: Content
+ metadata:
+ additionalProperties: true
+ description: The message metadata
+ uiOrder: 2
+ required: []
+ title: Metadata
+ format: json
+ role:
+ description: The message role, i.e. 'system', 'user' or 'assistant'
+ uiOrder: 0
+ title: Role
+ format: string
+ required:
+ - role
+ - content
+ format: object
+ title: Chat Message
+ format: array
+ classification:
+ additionalProperties: false
+ properties:
+ category:
+ description: The predicted category of the input.
+ uiOrder: 0
+ title: Category
+ format: string
+ score:
+ description: The confidence score of the predicted category of the input.
+ uiOrder: 1
+ title: Score
+ format: number
+ required:
+ - category
+ - score
+ format: object
+ detection:
+ additionalProperties: false
+ properties:
+ objects:
+ description: A list of detected objects.
+ uiOrder: 0
+ items:
+ additionalProperties: false
+ properties:
+ bounding-box:
+ $ref: '#/$defs/instill-types/bounding-box'
+ uiOrder: 1
+ title: Bounding box
+ category:
+ description: The predicted category of the bounding box.
+ uiOrder: 2
+ title: Category
+ format: string
+ score:
+ description: The confidence score of the predicted category of the
+ bounding box.
+ uiOrder: 3
+ title: Score
+ format: number
+ required:
+ - bounding-box
+ - category
+ - score
+ title: Object
+ format: object
+ title: Objects
+ format: array
+ required:
+ - objects
+ format: object
+ embedding:
+ items:
+ title: Embedding
+ format: number
+ title: Embedding
+ format: array
+ instance-segmentation:
+ additionalProperties: false
+ properties:
+ objects:
+ description: A list of detected instance bounding boxes.
+ uiOrder: 0
+ items:
+ properties:
+ bounding-box:
+ $ref: '#/$defs/instill-types/bounding-box'
+ uiOrder: 1
+ title: Bounding Box
+ category:
+ description: The predicted category of the bounding box.
+ uiOrder: 2
+ title: Category
+ format: string
+ rle:
+ description: Run Length Encoding (RLE) of instance mask within the
+ bounding box.
+ uiOrder: 0
+ title: RLE
+ format: string
+ score:
+ description: The confidence score of the predicted instance object.
+ uiOrder: 3
+ title: Score
+ format: number
+ required:
+ - rle
+ - bounding-box
+ - category
+ - score
+ title: Object
+ format: object
+ title: Objects
+ format: array
+ required:
+ - objects
+ format: 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.
+ uiOrder: 0
+ items:
+ properties:
+ bounding-box:
+ $ref: '#/$defs/instill-types/bounding-box'
+ uiOrder: 2
+ title: Bounding Box
+ keypoints:
+ description: A keypoint group is composed of a list of pre-defined
+ keypoints of a detected object.
+ uiOrder: 0
+ items:
+ uiOrder: 0
+ properties:
+ v:
+ description: visibility score of the keypoint.
+ uiOrder: 2
+ title: Visibility Score
+ format: number
+ x:
+ description: x coordinate of the keypoint.
+ uiOrder: 0
+ title: X Coordinate
+ format: number
+ y:
+ description: y coordinate of the keypoint.
+ uiOrder: 1
+ title: Y Coordinate
+ format: number
+ required:
+ - x
+ - y
+ - v
+ title: Keypoints
+ format: object
+ title: Keypoints
+ format: array
+ score:
+ description: The confidence score of the predicted object.
+ uiOrder: 1
+ title: Score
+ format: number
+ required:
+ - keypoints
+ - score
+ - bounding-box
+ title: Object
+ format: object
+ title: Objects
+ format: array
+ required:
+ - objects
+ format: object
+ multi-modal-content:
+ items:
+ properties:
+ image-url:
+ properties:
+ url:
+ description: Either a URL of the image or the base64 encoded image
+ data.
+ title: URL
+ uiOrder: 0
+ format: string
+ required:
+ - url
+ title: Image URL
+ description: The image URL
+ uiOrder: 0
+ format: object
+ text:
+ description: The text content.
+ title: Text
+ uiOrder: 1
+ format: string
+ type:
+ description: The type of the content part.
+ enum:
+ - text
+ - image-url
+ title: Type
+ uiOrder: 2
+ format: string
+ required:
+ - type
+ format: object
+ format: array
+ ocr:
+ additionalProperties: false
+ properties:
+ objects:
+ description: A list of detected bounding boxes.
+ uiOrder: 0
+ items:
+ properties:
+ bounding-box:
+ $ref: '#/$defs/instill-types/bounding-box'
+ uiOrder: 0
+ title: Bounding Box
+ score:
+ description: The confidence score of the predicted object.
+ uiOrder: 2
+ title: Score
+ format: number
+ text:
+ description: Text string recognised per bounding box.
+ uiOrder: 1
+ title: Text
+ format: string
+ required:
+ - bounding-box
+ - text
+ - score
+ title: Object
+ format: object
+ title: Objects
+ format: array
+ required:
+ - objects
+ format: object
+ semantic-segmentation:
+ additionalProperties: false
+ properties:
+ stuffs:
+ description: A list of RLE binary masks.
+ uiOrder: 0
+ items:
+ properties:
+ category:
+ description: Category text string corresponding to each stuff mask.
+ uiOrder: 1
+ title: Category
+ format: string
+ rle:
+ description: Run Length Encoding (RLE) of each stuff mask within the
+ image.
+ uiOrder: 0
+ title: RLE
+ format: string
+ required:
+ - rle
+ - category
+ title: Object
+ format: object
+ title: Stuffs
+ format: array
+ required:
+ - stuffs
+ format: object
diff --git a/pkg/component/tools/compogen/README.md b/pkg/component/tools/compogen/README.md
index 3350ff03f..fdef08255 100644
--- a/pkg/component/tools/compogen/README.md
+++ b/pkg/component/tools/compogen/README.md
@@ -22,10 +22,10 @@ compogen readme path/to/component/config path/to/component/README.mdx
### Validation & guidelines
-In order to successfully build the README of a component, the `definition.json`
-and `tasks.json` files must be present in the component configuration directory.
+In order to successfully build the README of a component, the `definition.yaml`
+and `tasks.yaml` files must be present in the component configuration directory.
-The `definition.json` file must contain an array with one object in which the
+The `definition.yaml` file must contain an array with one object in which the
following fields must be present and comply with the following guidelines:
- `id`.
@@ -39,7 +39,7 @@ following fields must be present and comply with the following guidelines:
- `type` - Component definitions must contain this field and its value must
match one of the (string) values, defined in [protobufs](https://github.com/instill-ai/protobufs/blob/main/vdp/pipeline/v1beta/component_definition.proto).
- `availableTasks` - This array must have at least one value, which should be
- one of the root-level keys in the `tasks.json` file.
+ one of the root-level keys in the `tasks.yaml` file.
- `sourceUrl` - Must be a valid URL. It must not end with a slash, as the
definitions path will be appended.
@@ -48,7 +48,7 @@ Certain optional fields modify the document behaviour:
- `public`, when `true`, will set the `draft` property to `false`.
- The content of `prerequisites` will be displayed in
an info block next to the resource configuration details.
-- A table will be built for the `setup` properties described in `setup.json`. They
+- A table will be built for the `setup` properties described in `setup.yaml`. They
must contain an `instillUIOrder` field so the row order is deterministic.
### Injecting extra content
@@ -70,7 +70,7 @@ The following section IDs are accepted:
- `release`
- `config`
- `setup`
-- Any task ID defined in `tasks.json` (e.g. `TASK_CHUNK_TEXT`)
+- Any task ID defined in `tasks.yaml` (e.g. `TASK_CHUNK_TEXT`)
- `bottom`
More than one section can be extended with this flag:
@@ -83,7 +83,7 @@ compogen readme path/to/component/config path/to/component/README.mdx \
## TODO
-- Support `oneOf` schemas for resource properties, present in, e.g., the [REST API](https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/application/restapi/v0/config/definition.json#L26) component.
+- Support `oneOf` schemas for resource properties, present in, e.g., the [REST API](https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/application/restapi/v0/config/definition.yaml#L26) component.
- We might leverage some Go implementation of JSON schema. Some candidates:
- [santhosh-tekuri/jsonschema](https://pkg.go.dev/github.com/santhosh-tekuri/jsonschema/v5#Schema)
- [omissis/go-jsonschema](https://github.com/omissis/go-jsonschema/blob/934012d/pkg/schemas/model.go#L107)
diff --git a/pkg/component/tools/compogen/cmd/testdata/readme-component1.txt b/pkg/component/tools/compogen/cmd/testdata/readme-component1.txt
index ca9d632f9..cadc976a8 100644
--- a/pkg/component/tools/compogen/cmd/testdata/readme-component1.txt
+++ b/pkg/component/tools/compogen/cmd/testdata/readme-component1.txt
@@ -1,9 +1,9 @@
# Setup
mkdir -p pkg/dummy/config
-cp definition.json pkg/dummy/config/definition.json
-cp setup.json pkg/dummy/config/setup.json
-cp tasks.json pkg/dummy/config/tasks.json
+cp definition.yaml pkg/dummy/config/definition.yaml
+cp setup.yaml pkg/dummy/config/setup.yaml
+cp tasks.yaml pkg/dummy/config/tasks.yaml
mkdir -p pkg/dummy/.compogen
cp extra-setup.mdx pkg/dummy/.compogen/extra-setup.mdx
@@ -13,285 +13,217 @@ cp extra-setup.mdx pkg/dummy/.compogen/extra-setup.mdx
compogen readme ./pkg/dummy/config ./pkg/dummy/README.mdx --extraContents setup=./pkg/dummy/.compogen/extra-setup.mdx
cmp pkg/dummy/README.mdx want-readme.mdx
--- definition.json --
-{
- "availableTasks": [
- "TASK_DUMMY"
- ],
- "public": true,
- "id": "dummy",
- "title": "Dummy",
- "vendor": "Dummy Inc.",
- "description": "Perform an action.",
- "prerequisites": "An account at [dummy.io](https://dummy.io) is required.",
- "type": "COMPONENT_TYPE_DATA",
- "releaseStage": "RELEASE_STAGE_COMING_SOON",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/data/dummy/v0"
-}
-
--- setup.json --
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": true,
- "properties": {
- "organization": {
- "description": "Specify which organization is used for the requests",
- "uiOrder": 1,
- "title": "Organization ID",
- "format": "string"
- },
- "api-key": {
- "description": "Fill in your Dummy API key",
- "uiOrder": 0,
- "title": "API Key",
- "format": "string"
- },
- "authentication": {
- "description": "Authentication method to use for the Dummy",
- "uiOrder": 0,
- "oneOf": [
- {
- "properties": {
- "auth-type": {
- "const": "NO_AUTH",
- "description": "No Authentication",
- "uiOrder": 0,
- "order": 0,
- "title": "Auth Format",
- "format": "string"
- }
- },
- "required": [
- "auth-type"
- ],
- "title": "No Auth"
- },
- {
- "properties": {
- "auth-type": {
- "const": "AUTH_1",
- "description": "Auth 1",
- "uiOrder": 0,
- "order": 0,
- "title": "Auth Format",
- "format": "string"
- },
- "auth-way": {
- "description": "ways for Auth 1",
- "acceptFormats": [
- "string"
- ],
- "enum": [
- "header",
- "query"
- ],
- "uiOrder": 1,
- "order": 1,
- "title": "Auth Way",
- "format": "string"
- }
- },
- "required": [
- "auth-type",
- "auth-way"
- ],
- "title": "Auth 1"
- }
- ],
- "order": 1,
- "title": "Authentication",
- "format": "object"
- }
- },
- "required": [
- "api-key"
- ],
- "title": "OpenAI Connection",
- "format": "object"
-}
-
--- tasks.json --
-{
- "TASK_DUMMY": {
- "description": "Perform a dummy task.",
- "input": {
- "properties": {
- "durna": {
- "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
- "uiOrder": 0,
- "title": "Durna",
- "format": "string"
- },
- "strategy": {
- "description": "Chunking strategy",
- "uiOrder": 1,
- "properties": {
- "setting": {
- "description": "Chunk Setting",
- "additionalProperties": true,
- "format": "object",
- "title": "Chunk Setting",
- "uiOrder": 0,
- "required": [
- "chunk-method"
- ],
- "oneOf": [
- {
- "properties": {
- "chunk-method": {
- "const": "Token",
- "format": "string",
- "title": "Chunk Method",
- "description": "Chunking based on tokenization.",
- "uiOrder": 0
- },
- "model-name": {
- "description": "The name of the model used for tokenization.",
- "enum": [
- "gpt-4",
- "gpt-3.5-turbo"
- ],
- "uiOrder": 1,
- "title": "Model",
- "format": "string"
- }
- },
- "title": "Token",
- "required": ["chunk-method"],
- "format": "object",
- "description": "Language models have a token limit. You should not exceed the token limit. When you split your text into chunks it is therefore a good idea to count the number of tokens. There are many tokenizers. When you count tokens in your text you should use the same tokenizer as used in the language model."
- },
- {
- "properties": {
- "chunk-method": {
- "const": "Markdown",
- "format": "string",
- "title": "Chunk Method",
- "description": "Chunking based on recursive splitting with markdown format.",
- "uiOrder": 0
- },
- "model-name": {
- "description": "The name of the model used for tokenization.",
- "enum": [
- "gpt-4",
- "gpt-3.5-turbo"
- ],
- "uiOrder": 1,
- "title": "Model",
- "format": "string"
- }
- },
- "title": "Markdown",
- "required": ["chunk-method"],
- "format": "object",
- "description": "This text splitter is specially designed for Markdown format."
- }
- ]
- }
- },
- "title": "Strategy",
- "required": [
- "setting"
- ],
- "format": "object"
- },
- "dummy-string": {
- "description": "{{dummy_string}}",
- "uiOrder": 0,
- "title": "Dummy String",
- "format": "string"
- },
- "dummy-file": {
- "description": "this is a file",
- "uiOrder": 0,
- "title": "Dummy File",
- "format": "*"
- },
- "dummy-array": {
- "description": "this is an array",
- "uiOrder": 0,
- "title": "Dummy Array",
- "format": "array",
- "items": {
- "format": "*"
- }
- }
- },
- "required": [
- "durna"
- ],
- "title": "Input"
- },
- "output": {
- "properties": {
- "orci": {
- "description": "Orci sagittis eu volutpat odio facilisis mauris sit",
- "format": "string",
- "uiOrder": 0,
- "title": "Orci",
- "format": "string"
- },
- "conversations": {
- "description": "An array of conversations with thread messages",
- "uiOrder": 0,
- "title": "Conversations",
- "format": "array",
- "items": {
- "title": "conversation details",
- "format": "object",
- "properties": {
- "message": {
- "description": "message to start a conversation",
- "uiOrder": 0,
- "title": "Start Conversation Message",
- "format": "string"
- },
- "start-date": {
- "description": "when a conversation starts",
- "uiOrder": 1,
- "title": "Start Date",
- "format": "string"
- },
- "last-date": {
- "description": "Date of the last message",
- "uiOrder": 2,
- "title": "Last Date",
- "format": "string"
- },
- "thread-reply-messages": {
- "description": "replies in a conversation",
- "uiOrder": 0,
- "title": "Replied messages",
- "format": "array",
- "items": {
- "title": "relied details",
- "format": "object",
- "properties": {
- "message": {
- "description": "message to reply a conversation",
- "instillFormat": "string",
- "uiOrder": 3,
- "title": "Replied Message",
- "format": "string"
- }
- },
- "required": [
- "message"
- ]
- }
- }
- },
- "required": [
- "message",
- "start-date"
- ]
- }
- }
- },
- "title": "Output"
- }
- }
-}
+-- definition.yaml --
+availableTasks:
+ - TASK_DUMMY
+public: true
+id: dummy
+title: Dummy
+vendor: Dummy Inc.
+description: Perform an action.
+prerequisites: An account at [dummy.io](https://dummy.io) is required.
+type: COMPONENT_TYPE_DATA
+releaseStage: RELEASE_STAGE_COMING_SOON
+sourceUrl: https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/data/dummy/v0
+
+-- setup.yaml --
+additionalProperties: true
+properties:
+ organization:
+ description: Specify which organization is used for the requests
+ uiOrder: 1
+ title: Organization ID
+ format: string
+ api-key:
+ description: Fill in your Dummy API key
+ uiOrder: 0
+ title: API Key
+ format: string
+ authentication:
+ description: Authentication method to use for the Dummy
+ uiOrder: 0
+ oneOf:
+ - properties:
+ auth-type:
+ const: NO_AUTH
+ description: No Authentication
+ uiOrder: 0
+ order: 0
+ title: Auth Format
+ format: string
+ required:
+ - auth-type
+ title: No Auth
+ - properties:
+ auth-type:
+ const: AUTH_1
+ description: Auth 1
+ uiOrder: 0
+ order: 0
+ title: Auth Format
+ format: string
+ auth-way:
+ description: ways for Auth 1
+ acceptFormats:
+ - string
+ enum:
+ - header
+ - query
+ uiOrder: 1
+ order: 1
+ title: Auth Way
+ format: string
+ required:
+ - auth-type
+ - auth-way
+ title: Auth 1
+ order: 1
+ title: Authentication
+ format: object
+required:
+ - api-key
+title: OpenAI Connection
+format: object
+
+-- tasks.yaml --
+TASK_DUMMY:
+ description: Perform a dummy task.
+ input:
+ properties:
+ durna:
+ description: Lorem ipsum dolor sit amet, consectetur adipiscing elit
+ uiOrder: 0
+ title: Durna
+ format: string
+ strategy:
+ description: Chunking strategy
+ uiOrder: 1
+ properties:
+ setting:
+ description: Chunk Setting
+ additionalProperties: true
+ format: object
+ title: Chunk Setting
+ uiOrder: 0
+ required:
+ - chunk-method
+ oneOf:
+ - properties:
+ chunk-method:
+ const: Token
+ format: string
+ title: Chunk Method
+ description: Chunking based on tokenization.
+ uiOrder: 0
+ model-name:
+ description: The name of the model used for tokenization.
+ enum:
+ - gpt-4
+ - gpt-3.5-turbo
+ uiOrder: 1
+ title: Model
+ format: string
+ title: Token
+ required:
+ - chunk-method
+ format: object
+ description: Language models have a token limit. You should not exceed the token limit. When you split your text into chunks it is therefore a good idea to count the number of tokens. There are many tokenizers. When you count tokens in your text you should use the same tokenizer as used in the language model.
+ - properties:
+ chunk-method:
+ const: Markdown
+ format: string
+ title: Chunk Method
+ description: Chunking based on recursive splitting with markdown format.
+ uiOrder: 0
+ model-name:
+ description: The name of the model used for tokenization.
+ enum:
+ - gpt-4
+ - gpt-3.5-turbo
+ uiOrder: 1
+ title: Model
+ format: string
+ title: Markdown
+ required:
+ - chunk-method
+ format: object
+ description: This text splitter is specially designed for Markdown format.
+ title: Strategy
+ required:
+ - setting
+ format: object
+ dummy-string:
+ description: '{{dummy_string}}'
+ uiOrder: 0
+ title: Dummy String
+ format: string
+ dummy-file:
+ description: this is a file
+ uiOrder: 0
+ title: Dummy File
+ format: '*'
+ dummy-array:
+ description: this is an array
+ uiOrder: 0
+ title: Dummy Array
+ format: array
+ items:
+ format: '*'
+ required:
+ - durna
+ title: Input
+ output:
+ properties:
+ orci:
+ description: Orci sagittis eu volutpat odio facilisis mauris sit
+ format: string
+ uiOrder: 0
+ title: Orci
+ conversations:
+ description: An array of conversations with thread messages
+ uiOrder: 0
+ title: Conversations
+ format: array
+ items:
+ title: conversation details
+ format: object
+ properties:
+ message:
+ description: message to start a conversation
+ uiOrder: 0
+ title: Start Conversation Message
+ format: string
+ start-date:
+ description: when a conversation starts
+ uiOrder: 1
+ title: Start Date
+ format: string
+ last-date:
+ description: Date of the last message
+ uiOrder: 2
+ title: Last Date
+ format: string
+ thread-reply-messages:
+ description: replies in a conversation
+ uiOrder: 0
+ title: Replied messages
+ format: array
+ items:
+ title: relied details
+ format: object
+ properties:
+ message:
+ description: message to reply a conversation
+ instillFormat: string
+ uiOrder: 3
+ title: Replied Message
+ format: string
+ required:
+ - message
+ required:
+ - message
+ - start-date
+ title: Output
-- extra-setup.mdx --
This is some crucial information about setup: do it before execution.
-- want-readme.mdx --
@@ -316,7 +248,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/data/dummy/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/data/dummy/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/data/dummy/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/data/dummy/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/tools/compogen/cmd/testdata/readme-component2.txt b/pkg/component/tools/compogen/cmd/testdata/readme-component2.txt
index f23ccd0d7..556b6f87a 100644
--- a/pkg/component/tools/compogen/cmd/testdata/readme-component2.txt
+++ b/pkg/component/tools/compogen/cmd/testdata/readme-component2.txt
@@ -1,8 +1,8 @@
# Setup
mkdir -p pkg/dummy/config
-cp definition.json pkg/dummy/config/definition.json
-cp tasks.json pkg/dummy/config/tasks.json
+cp definition.yaml pkg/dummy/config/definition.yaml
+cp tasks.yaml pkg/dummy/config/tasks.yaml
mkdir -p pkg/dummy/.compogen
cp extra-dummy.mdx pkg/dummy/.compogen/extra-dummy.mdx
@@ -14,7 +14,7 @@ cp extra-bottom.mdx pkg/dummy/.compogen/extra-bottom.mdx
cmp stderr want-no-defs
mkdir -p pkg/dummy/wrong
-cp definition.json pkg/dummy/wrong/definition.json
+cp definition.yaml pkg/dummy/wrong/definition.yaml
! compogen readme pkg/dummy/wrong pkg/dummy/README.mdx
cmp stderr want-no-tasks
@@ -26,137 +26,108 @@ cmp stderr want-wrong-target
compogen readme ./pkg/dummy/config ./pkg/dummy/README.mdx --extraContents TASK_DUMMY=./pkg/dummy/.compogen/extra-dummy.mdx --extraContents bottom=./pkg/dummy/.compogen/extra-bottom.mdx
cmp pkg/dummy/README.mdx want-readme.mdx
--- definition.json --
-{
- "availableTasks": [
- "TASK_DUMMY",
- "TASK_DUMMIER_THAN_DUMMY"
- ],
- "public": true,
- "spec": {},
- "id": "dummy",
- "title": "Dummy",
- "type": "COMPONENT_TYPE_OPERATOR",
- "description": "Perform an action.",
- "releaseStage": "RELEASE_STAGE_BETA",
- "sourceUrl": "https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/operator/dummy/v0"
-}
--- tasks.json --
-{
- "TASK_DUMMY": {
- "description": "Perform a dummy task.",
- "input": {
- "properties": {
- "durna": {
- "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
- "uiOrder": 0,
- "title": "Durna",
- "format": "string"
- },
- "parra": {
- "deprecated": true,
- "description": "Shouldn't appear, it's deprecated",
- "uiOrder": 1,
- "title": "Parra",
- "format": "string"
- }
- },
- "required": [
- "durna"
- ],
- "title": "Input"
- },
- "output": {
- "properties": {
- "orci": {
- "description": "Orci sagittis eu volutpat odio facilisis mauris sit",
- "format": "string",
- "uiOrder": 0,
- "title": "Orci",
- "format": "string"
- }
- },
- "title": "Output"
- }
- },
- "TASK_DUMMIER_THAN_DUMMY": {
- "title": "Dummier",
- "description": "This task is dummier than `TASK_DUMMY`.",
- "input": {
- "properties": {
- "cursus": {
- "description": "Cursus mattis molestie a iaculis at erat pellentesque adipiscing commodo",
- "uiOrder": 0,
- "title": "Cursus",
- "format": "string"
- }
- },
- "required": [
- "cursus"
- ],
- "title": "Input"
- },
- "output": {
- "properties": {
- "elementum": {
- "description": "Tellus elementum sagittis vitae et",
- "uiOrder": 0,
- "title": "Elementum",
- "format": "string"
- },
- "errors": {
- "description": "Error messages, if any, during the dummy process",
- "uiOrder": 3,
- "title": "Errors",
- "items": {
- "format": "string"
- },
- "format": "array"
- },
- "context": {
- "description": "Free-form metadata",
- "uiOrder": 4,
- "required": [],
- "title": "Meta"
- },
- "atem": {
- "description": "This object should comply witht he format {\"tortor\": \"something\", \"arcu\": \"something else\"}",
- "uiOrder": 1,
- "title": "Atem",
- "format": "object",
- "properties": {
- "tortor": {
- "description": "Tincidunt tortor aliquam nulla",
- "uiOrder": 0,
- "title": "Tincidunt tortor",
- "format": "string"
- },
- "arcu": {
- "description": "Bibendum arcu vitae elementum curabitur vitae nunc sed velit",
- "uiOrder": 1,
- "title": "Arcu",
- "format": "string"
- }
- },
- "required": []
- },
- "nullam_non": {
- "description": "Id faucibus nisl tincidunt eget nullam non",
- "uiOrder": 2,
- "title": "Nullam non",
- "format": "number"
- }
- },
- "required": [
- "elementum",
- "atem",
- "nullam_non",
- "error"
- ],
- "title": "Output"
- }
- }
-}
+-- definition.yaml --
+availableTasks:
+ - TASK_DUMMY
+ - TASK_DUMMIER_THAN_DUMMY
+public: true
+spec: {}
+id: dummy
+title: Dummy
+type: COMPONENT_TYPE_OPERATOR
+description: Perform an action.
+releaseStage: RELEASE_STAGE_BETA
+sourceUrl: https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/operator/dummy/v0
+
+-- tasks.yaml --
+TASK_DUMMY:
+ description: Perform a dummy task.
+ input:
+ properties:
+ durna:
+ description: Lorem ipsum dolor sit amet, consectetur adipiscing elit
+ uiOrder: 0
+ title: Durna
+ format: string
+ parra:
+ deprecated: true
+ description: Shouldn't appear, it's deprecated
+ uiOrder: 1
+ title: Parra
+ format: string
+ required:
+ - durna
+ title: Input
+ output:
+ properties:
+ orci:
+ description: Orci sagittis eu volutpat odio facilisis mauris sit
+ uiOrder: 0
+ title: Orci
+ format: string
+ title: Output
+
+TASK_DUMMIER_THAN_DUMMY:
+ title: Dummier
+ description: This task is dummier than `TASK_DUMMY`.
+ input:
+ properties:
+ cursus:
+ description: Cursus mattis molestie a iaculis at erat pellentesque adipiscing commodo
+ uiOrder: 0
+ title: Cursus
+ format: string
+ required:
+ - cursus
+ title: Input
+ output:
+ properties:
+ elementum:
+ description: Tellus elementum sagittis vitae et
+ uiOrder: 0
+ title: Elementum
+ format: string
+ errors:
+ description: Error messages, if any, during the dummy process
+ uiOrder: 3
+ title: Errors
+ items:
+ format: string
+ format: array
+ context:
+ description: Free-form metadata
+ uiOrder: 4
+ required: []
+ title: Meta
+ atem:
+ description: 'This object should comply witht he format {"tortor": "something", "arcu": "something else"}'
+ uiOrder: 1
+ title: Atem
+ format: object
+ properties:
+ tortor:
+ description: Tincidunt tortor aliquam nulla
+ uiOrder: 0
+ title: Tincidunt tortor
+ format: string
+ arcu:
+ description: Bibendum arcu vitae elementum curabitur vitae nunc sed velit
+ uiOrder: 1
+ title: Arcu
+ format: string
+ required: []
+ nullam_non:
+ description: Id faucibus nisl tincidunt eget nullam non
+ uiOrder: 2
+ title: Nullam non
+ format: number
+ required:
+ - elementum
+ - atem
+ - nullam_non
+ - error
+ title: Output
+
-- extra-dummy.mdx --
#### How to use the dummy task
@@ -167,9 +138,9 @@ one might be wise when choosing between them.
Thanks for reaching this point! No one really reads documentation thoroughly (:
-- want-no-defs --
-Error: open pkg/dummy/wrong/definition.json: no such file or directory
+Error: open pkg/dummy/wrong/definition.yaml: no such file or directory
-- want-no-tasks --
-Error: open pkg/dummy/wrong/tasks.json: no such file or directory
+Error: open pkg/dummy/wrong/tasks.yaml: no such file or directory
-- want-wrong-target --
Error: open pkg/wrong/README.mdx: no such file or directory
-- want-invalid-def --
@@ -198,7 +169,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/operator/dummy/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/operator/dummy/v0/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml](https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/operator/dummy/v0/config/definition.yaml) and [tasks.yaml](https://github.com/instill-ai/pipeline-backend/pkg/component/blob/main/operator/dummy/v0/config/tasks.yaml) files respectively.
diff --git a/pkg/component/tools/compogen/pkg/gen/readme.go b/pkg/component/tools/compogen/pkg/gen/readme.go
index 75066b038..a500e5e0e 100644
--- a/pkg/component/tools/compogen/pkg/gen/readme.go
+++ b/pkg/component/tools/compogen/pkg/gen/readme.go
@@ -24,9 +24,9 @@ import (
)
const (
- definitionsFile = "definition.json"
- setupFile = "setup.json"
- tasksFile = "tasks.json"
+ definitionsFile = "definition.yaml"
+ setupFile = "setup.yaml"
+ tasksFile = "tasks.yaml"
)
//go:embed resources/templates/readme.mdx.tmpl
@@ -53,7 +53,11 @@ func NewREADMEGenerator(configDir, outputFile string, extraContentPaths map[stri
}
func (g *READMEGenerator) parseDefinition(configDir string) (d definition, err error) {
- definitionJSON, err := os.ReadFile(filepath.Join(configDir, definitionsFile))
+ definitionYAML, err := os.ReadFile(filepath.Join(configDir, definitionsFile))
+ if err != nil {
+ return d, err
+ }
+ definitionJSON, err := convertYAMLToJSON(definitionYAML)
if err != nil {
return d, err
}
@@ -76,13 +80,17 @@ func (g *READMEGenerator) parseDefinition(configDir string) (d definition, err e
}
func (g *READMEGenerator) parseSetup(configDir string) (s *objectSchema, err error) {
- setupJSON, err := os.ReadFile(filepath.Join(configDir, setupFile))
+ setupYAML, err := os.ReadFile(filepath.Join(configDir, setupFile))
if err != nil {
if os.IsNotExist(err) {
return nil, nil
}
return nil, err
}
+ setupJSON, err := convertYAMLToJSON(setupYAML)
+ if err != nil {
+ return nil, err
+ }
renderedSetupJSON, err := componentbase.RenderJSON(setupJSON, nil)
if err != nil {
@@ -102,7 +110,11 @@ func (g *READMEGenerator) parseSetup(configDir string) (s *objectSchema, err err
}
func (g *READMEGenerator) parseTasks(configDir string) (map[string]task, error) {
- tasksJSON, err := os.ReadFile(filepath.Join(configDir, tasksFile))
+ tasksYAML, err := os.ReadFile(filepath.Join(configDir, tasksFile))
+ if err != nil {
+ return nil, err
+ }
+ tasksJSON, err := convertYAMLToJSON(tasksYAML)
if err != nil {
return nil, err
}
@@ -112,7 +124,11 @@ func (g *READMEGenerator) parseTasks(configDir string) (map[string]task, error)
}
additionalJSONs := map[string][]byte{}
for _, file := range files {
- additionalJSON, err := os.ReadFile(filepath.Join(configDir, file.Name()))
+ additionalYAML, err := os.ReadFile(filepath.Join(configDir, file.Name()))
+ if err != nil {
+ return nil, err
+ }
+ additionalJSON, err := convertYAMLToJSON(additionalYAML)
if err != nil {
return nil, err
}
@@ -120,8 +136,12 @@ func (g *READMEGenerator) parseTasks(configDir string) (map[string]task, error)
}
+ schemaJSON, err := convertYAMLToJSON(schemas.SchemaYAML)
+ if err != nil {
+ return nil, err
+ }
additionalJSONBytes := map[string][]byte{
- "schema.json": schemas.SchemaJSON,
+ "schema.yaml": schemaJSON,
}
renderedTasksJSON, err := componentbase.RenderJSON(tasksJSON, additionalJSONBytes)
if err != nil {
diff --git a/pkg/component/tools/compogen/pkg/gen/resources/templates/readme.mdx.tmpl b/pkg/component/tools/compogen/pkg/gen/resources/templates/readme.mdx.tmpl
index eb49a030b..9fb9337cb 100644
--- a/pkg/component/tools/compogen/pkg/gen/resources/templates/readme.mdx.tmpl
+++ b/pkg/component/tools/compogen/pkg/gen/resources/templates/readme.mdx.tmpl
@@ -20,7 +20,7 @@ It can carry out the following tasks:
## Configuration
-The component definition and tasks are defined in the [definition.json]({{ .SourceURL }}/config/definition.json) and [tasks.json]({{ .SourceURL }}/config/tasks.json) files respectively.
+The component definition and tasks are defined in the [definition.yaml]({{ .SourceURL }}/config/definition.yaml) and [tasks.yaml]({{ .SourceURL }}/config/tasks.yaml) files respectively.
{{ loadExtraContent "config" }}
diff --git a/pkg/component/tools/compogen/pkg/gen/utils.go b/pkg/component/tools/compogen/pkg/gen/utils.go
new file mode 100644
index 000000000..dcd5ce0b4
--- /dev/null
+++ b/pkg/component/tools/compogen/pkg/gen/utils.go
@@ -0,0 +1,19 @@
+package gen
+
+import (
+ "encoding/json"
+
+ "gopkg.in/yaml.v3"
+)
+
+func convertYAMLToJSON(yamlBytes []byte) ([]byte, error) {
+ if yamlBytes == nil {
+ return nil, nil
+ }
+ var d any
+ err := yaml.Unmarshal(yamlBytes, &d)
+ if err != nil {
+ return nil, err
+ }
+ return json.Marshal(d)
+}