Skip to content

Commit

Permalink
refactor(component): rename Instill Format to Instill Type
Browse files Browse the repository at this point in the history
  • Loading branch information
donch1989 committed Jan 2, 2025
1 parent 62e7873 commit bd6bd7d
Show file tree
Hide file tree
Showing 177 changed files with 4,828 additions and 10,170 deletions.
23 changes: 10 additions & 13 deletions pkg/component/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,8 @@ should be in the format `TASK_NAME`.
"target": {
"uiOrder": 0,
"description": "The target of the greeting",
"acceptFormats": [
"string"
],
"title": "Greeting target",
"format": "string"
"type": "string",
"title": "Greeting target"
}
},
"required": [
Expand All @@ -163,8 +160,7 @@ should be in the format `TASK_NAME`.
"uiOrder": 0,
"required": [],
"title": "Greeting",
"type": "string",
"format": "string"
"type": "string"
}
},
"required": [
Expand Down Expand Up @@ -207,16 +203,17 @@ This file defines the input and output schema of each task:

**Properties within `input` Objects**

- **`acceptFormats`** is an array indicating the data types of acceptable
input fields. It should be an array of [**Instill
Format**](https://www.instill.tech/docs/vdp/instill-format).
- Currently, we do not support the `time` type. When the input is a `date` or `datetime`, it should be represented as a string. The `date` or `datetime` will be automatically parsed in UTC timezone by the YAML parser. Please ensure this point is noted in the documentation, specifically for the `start-to-read-date` in the Slack component.
- **`type`** indicates the data type of the output field, which should be one
of `string`, `number`, `boolean`, `file`, `document`, `image`, `video`,
`audio`, `array`, or `object`. Please refer to [**Instill
Format**](https://www.instill.tech/docs/vdp/instill-format) for more details.

- **`instillSecret`** indicates the data must reference the secrets and cannot
be used in plaintext.

**Properties within `output` Objects**

- **`format`** indicates the data type of the output field, which should be one
- **`type`** indicates the data type of the output field, which should be one
of `string`, `number`, `boolean`, `file`, `document`, `image`, `video`,
`audio`, `array`, or `object`. Please refer to [**Instill
Format**](https://www.instill.tech/docs/vdp/instill-format) for more details.
Expand Down Expand Up @@ -601,7 +598,7 @@ variable:
who:
title: Who
description: Who should be greeted?
format: string
type: string
component:
hello-0:
type: hello
Expand Down
4 changes: 2 additions & 2 deletions pkg/component/ai/anthropic/v0/.compogen/bottom.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ variable:
repository-name:
title: Repository Name
description: Name of the repository i.e. instill-core
format: string
type: string
repository-owner:
title: Repository Owner
description: Name of the repository owner i.e. instill-ai
format: string
type: string
output:
result:
title: Result
Expand Down
22 changes: 11 additions & 11 deletions pkg/component/ai/anthropic/v0/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ${connection.<my-connection-id>}`.

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Field | Field ID | Format | Note |
| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| API Key | `api-key` | string | Fill in your Anthropic API key. To find your keys, visit the Anthropic console page. |

Expand All @@ -54,14 +54,14 @@ Anthropic's text generation models (often called generative pre-trained transfor

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | Field ID | Format | Description |
| Input | Field ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_TEXT_GENERATION_CHAT` |
| Model Name (required) | `model-name` | string | The Anthropic model to be used. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`claude-3-5-sonnet-latest`</li><li>`claude-3-5-sonnet-20241022`</li><li>`claude-3-5-sonnet-20240620`</li><li>`claude-3-opus-20240229`</li><li>`claude-3-sonnet-20240229`</li><li>`claude-3-haiku-20240307`</li></ul></details> |
| Prompt (required) | `prompt` | string | The prompt text. |
| System Message | `system-message` | string | 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.". |
| Prompt Images | `prompt-images` | array[string] | 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). |
| [Chat History](#text-generation-chat-chat-history) | `chat-history` | array[object] | 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"\}. |
| [Chat History](#text-generation-chat-chat-history) | `chat-history` | array[object] | 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"\}. |
| Seed | `seed` | integer | The seed (Note: Not supported by Anthropic Models). |
| Temperature | `temperature` | number | The temperature for sampling. |
| Top K | `top-k` | integer | Top k for sampling. |
Expand All @@ -74,11 +74,11 @@ Anthropic's text generation models (often called generative pre-trained transfor

<h4 id="text-generation-chat-chat-history">Chat History</h4>

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"\}.
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"\}.

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Field | Field ID | Format | Note |
| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| [Content](#text-generation-chat-content) | `content` | array | The message content. |
| Role | `role` | string | The message role, i.e. 'system', 'user' or 'assistant'. |
Expand All @@ -89,7 +89,7 @@ The message content.

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Field | Field ID | Format | Note |
| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| [Image URL](#text-generation-chat-image-url) | `image-url` | object | The image URL. |
| Text | `text` | string | The text content. |
Expand All @@ -101,7 +101,7 @@ The image URL.

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Field | Field ID | Format | Note |
| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| URL | `url` | string | Either a URL of the image or the base64 encoded image data. |
</div>
Expand All @@ -111,7 +111,7 @@ The image URL.

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | Field ID | Format | Description |
| Output | Field ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Text | `text` | string | Model Output. |
| [Usage](#text-generation-chat-usage) (optional) | `usage` | object | Usage tokens in Anthropic. |
Expand All @@ -124,7 +124,7 @@ The image URL.

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Field | Field ID | Format | Note |
| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| Input Tokens | `input-tokens` | number | The input tokens used by Anthropic. |
| Output Tokens | `output-tokens` | number | The output tokens used by Anthropic. |
Expand Down Expand Up @@ -169,11 +169,11 @@ variable:
repository-name:
title: Repository Name
description: Name of the repository i.e. instill-core
format: string
type: string
repository-owner:
title: Repository Owner
description: Name of the repository owner i.e. instill-ai
format: string
type: string
output:
result:
title: Result
Expand Down
19 changes: 0 additions & 19 deletions pkg/component/ai/anthropic/v0/config/setup.json

This file was deleted.

6 changes: 2 additions & 4 deletions pkg/component/ai/anthropic/v0/config/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ additionalProperties: false
properties:
api-key:
description: Fill in your Anthropic API key. To find your keys, visit the Anthropic console page.
acceptFormats:
- string
type: string
instillSecret: true
instillCredential: true
uiOrder: 0
title: API Key
format: string
required: []
title: Anthropic Connection
format: object
type: object
68 changes: 25 additions & 43 deletions pkg/component/ai/anthropic/v0/config/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ $defs:
description: Either a URL of the image or the base64 encoded image data.
title: URL
uiOrder: 0
format: string
type: string
required:
- url
title: Image URL
description: The image URL.
uiOrder: 0
format: object
type: object
text:
description: The text content.
title: Text
uiOrder: 1
format: string
type: string
type:
description: The type of the content part.
enum:
- text
- image_url
title: Type
uiOrder: 2
format: string
type: string
required:
- type
format: object
format: array
type: object
type: array
chat-message:
properties:
content:
Expand All @@ -43,12 +43,12 @@ $defs:
description: The message role, i.e. 'system', 'user' or 'assistant'.
uiOrder: 0
title: Role
format: string
type: string
required:
- role
- content
title: Chat Message
format: object
type: object
usage:
description: Usage tokens in Anthropic.
uiOrder: 1
Expand All @@ -57,17 +57,17 @@ $defs:
description: The input tokens used by Anthropic.
uiOrder: 2
title: Input Tokens
format: number
type: number
output-tokens:
description: The output tokens used by Anthropic.
uiOrder: 3
title: Output Tokens
format: number
type: number
required:
- input-tokens
- output-tokens
title: Usage
format: object
type: 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
Expand All @@ -80,25 +80,21 @@ TASK_TEXT_GENERATION_CHAT:
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.
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
type: array
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
type: integer
uiOrder: 6
title: Max New Tokens
format: integer
model-name:
enum:
- claude-3-5-sonnet-latest
Expand All @@ -109,8 +105,7 @@ TASK_TEXT_GENERATION_CHAT:
- claude-3-haiku-20240307
example: claude-3-5-sonnet-latest
description: The Anthropic model to be used.
acceptFormats:
- string
type: string
uiOrder: 0
instillCredentialMap:
values:
Expand All @@ -123,63 +118,50 @@ TASK_TEXT_GENERATION_CHAT:
targets:
- setup.api-key
title: Model Name
format: string
prompt:
description: The prompt text.
acceptFormats:
- string
type: 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
type: array
uiOrder: 3
items:
format: string
type: string
title: Prompt Images
format: array
seed:
description: 'The seed (Note: Not supported by Anthropic Models).'
acceptFormats:
- integer
type: 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
type: 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
type: number
uiOrder: 5
title: Temperature
format: number
top-k:
default: 10
description: Top k for sampling.
acceptFormats:
- integer
type: integer
uiOrder: 5
title: Top K
format: integer
required:
- prompt
- model-name
title: Input
format: object
type: object
output:
description: Output.
uiOrder: 0
Expand All @@ -188,10 +170,10 @@ TASK_TEXT_GENERATION_CHAT:
description: Model Output.
uiOrder: 0
title: Text
format: string
type: string
usage:
$ref: '#/$defs/usage'
required:
- text
title: Output
format: object
type: object
Loading

0 comments on commit bd6bd7d

Please sign in to comment.