Skip to content

Commit 5613ee3

Browse files
committed
chore(compogen): update component document layout (#1090)
Because - `readme.go` didn't render objects in order, causing inconsistent outcomes misleading commit cycle. This commit - fixes the ordering issue. - cleans up a bit the template layout.
1 parent cea127a commit 5613ee3

File tree

54 files changed

+2598
-2493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2598
-2493
lines changed

pkg/component/ai/anthropic/v0/README.mdx

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,15 @@ The Anthropic component is an AI component that allows users to connect the AI m
99
It can carry out the following tasks:
1010
- [Text Generation Chat](#text-generation-chat)
1111

12-
13-
1412
## Release Stage
1513

1614
`Alpha`
1715

18-
19-
2016
## Configuration
2117

2218
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.
2319

2420

25-
26-
2721
## Setup
2822

2923

@@ -38,14 +32,11 @@ ${connection.<my-connection-id>}`.
3832

3933
| Field | Field ID | Type | Note |
4034
| :--- | :--- | :--- | :--- |
41-
| API Key | `api-key` | string | Fill in your Anthropic API key. To find your keys, visit the Anthropic console page. |
42-
35+
| API Key | `api-key` | string | Fill in your Anthropic API key. To find your keys, visit the Anthropic console page. |
4336
</div>
4437

4538

4639

47-
48-
4940
## Supported Tasks
5041

5142
### Text Generation Chat
@@ -57,7 +48,7 @@ Anthropic's text generation models (often called generative pre-trained transfor
5748
| Input | Field ID | Type | Description |
5849
| :--- | :--- | :--- | :--- |
5950
| Task ID (required) | `task` | string | `TASK_TEXT_GENERATION_CHAT` |
60-
| 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> |
51+
| 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> |
6152
| Prompt (required) | `prompt` | string | The prompt text. |
6253
| 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.". |
6354
| 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). |
@@ -66,57 +57,59 @@ Anthropic's text generation models (often called generative pre-trained transfor
6657
| Temperature | `temperature` | number | The temperature for sampling. |
6758
| Top K | `top-k` | integer | Top k for sampling. |
6859
| Max New Tokens | `max-new-tokens` | integer | The maximum number of tokens for model to generate. |
69-
</div>
70-
7160

61+
</div>
7262
<details>
7363
<summary> Input Objects in Text Generation Chat</summary>
7464

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

7767
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"}.
7868

69+
7970
<div class="markdown-col-no-wrap" data-col-1 data-col-2>
8071

8172
| Field | Field ID | Type | Note |
8273
| :--- | :--- | :--- | :--- |
83-
| [Content](#text-generation-chat-content) | `content` | array | The message content. |
84-
| Role | `role` | string | The message role, i.e. 'system', 'user' or 'assistant'. |
74+
| [Content](#text-generation-chat-content) | `content` | array | The message content. |
75+
| Role | `role` | string | The message role, i.e. 'system', 'user' or 'assistant'. |
8576
</div>
8677
<h4 id="text-generation-chat-content">Content</h4>
8778

8879
The message content.
8980

81+
9082
<div class="markdown-col-no-wrap" data-col-1 data-col-2>
9183

9284
| Field | Field ID | Type | Note |
9385
| :--- | :--- | :--- | :--- |
94-
| [Image URL](#text-generation-chat-image-url) | `image-url` | object | The image URL. |
95-
| Text | `text` | string | The text content. |
96-
| Type | `type` | string | The type of the content part. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`text`</li><li>`image_url`</li></ul></details> |
86+
| [Image URL](#text-generation-chat-image-url) | `image-url` | object | The image URL. |
87+
| Text | `text` | string | The text content. |
88+
| Type | `type` | string | The type of the content part. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`text`</li><li>`image_url`</li></ul></details> |
9789
</div>
9890
<h4 id="text-generation-chat-image-url">Image URL</h4>
9991

10092
The image URL.
10193

94+
10295
<div class="markdown-col-no-wrap" data-col-1 data-col-2>
10396

10497
| Field | Field ID | Type | Note |
10598
| :--- | :--- | :--- | :--- |
106-
| URL | `url` | string | Either a URL of the image or the base64 encoded image data. |
99+
| URL | `url` | string | Either a URL of the image or the base64 encoded image data. |
107100
</div>
108101
</details>
109102

110-
111-
112103
<div class="markdown-col-no-wrap" data-col-1 data-col-2>
113104

114105
| Output | Field ID | Type | Description |
115106
| :--- | :--- | :--- | :--- |
116107
| Text | `text` | string | Model Output. |
117108
| [Usage](#text-generation-chat-usage) (optional) | `usage` | object | Usage tokens in Anthropic. |
109+
118110
</div>
119111

112+
120113
<details>
121114
<summary> Output Objects in Text Generation Chat</summary>
122115

@@ -128,11 +121,10 @@ The image URL.
128121
| :--- | :--- | :--- | :--- |
129122
| Input Tokens | `input-tokens` | number | The input tokens used by Anthropic. |
130123
| Output Tokens | `output-tokens` | number | The output tokens used by Anthropic. |
124+
131125
</div>
132126
</details>
133127

134-
135-
136128
## Example Recipes
137129

138130
```yaml

pkg/component/ai/cohere/v0/README.mdx

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,15 @@ It can carry out the following tasks:
1111
- [Text Embeddings](#text-embeddings)
1212
- [Text Reranking](#text-reranking)
1313

14-
15-
1614
## Release Stage
1715

1816
`Alpha`
1917

20-
21-
2218
## Configuration
2319

2420
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.
2521

2622

27-
28-
2923
## Setup
3024

3125

@@ -40,14 +34,11 @@ ${connection.<my-connection-id>}`.
4034

4135
| Field | Field ID | Type | Note |
4236
| :--- | :--- | :--- | :--- |
43-
| API Key | `api-key` | string | Fill in your Cohere API key. To find your keys, visit the Cohere dashboard page. |
44-
37+
| API Key | `api-key` | string | Fill in your Cohere API key. To find your keys, visit the Cohere dashboard page. |
4538
</div>
4639

4740

4841

49-
50-
5142
## Supported Tasks
5243

5344
### Text Generation Chat
@@ -59,7 +50,7 @@ Cohere's text generation models (often called generative pre-trained transformer
5950
| Input | Field ID | Type | Description |
6051
| :--- | :--- | :--- | :--- |
6152
| Task ID (required) | `task` | string | `TASK_TEXT_GENERATION_CHAT` |
62-
| Model Name (required) | `model-name` | string | The Cohere command model to be used. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`command-r-plus`</li><li>`command-r`</li><li>`command`</li><li>`command-nightly`</li><li>`command-light`</li><li>`command-light-nightly`</li></ul></details> |
53+
| Model Name (required) | `model-name` | string | The Cohere command model to be used. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`command-r-plus`</li><li>`command-r`</li><li>`command`</li><li>`command-nightly`</li><li>`command-light`</li><li>`command-light-nightly`</li></ul></details> |
6354
| Prompt (required) | `prompt` | string | The prompt text. |
6455
| 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 using a generic message as "You are a helpful assistant.". |
6556
| Documents | `documents` | array[string] | The documents to be used for the model, for optimal performance, the length of each document should be less than 300 words. |
@@ -69,58 +60,60 @@ Cohere's text generation models (often called generative pre-trained transformer
6960
| Temperature | `temperature` | number | The temperature for sampling (default=0.7). |
7061
| Top K | `top-k` | integer | Top k for sampling (default=10). |
7162
| Max New Tokens | `max-new-tokens` | integer | The maximum number of tokens for model to generate (default=50). |
72-
</div>
73-
7463

64+
</div>
7565
<details>
7666
<summary> Input Objects in Text Generation Chat</summary>
7767

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

8070
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"}.
8171

72+
8273
<div class="markdown-col-no-wrap" data-col-1 data-col-2>
8374

8475
| Field | Field ID | Type | Note |
8576
| :--- | :--- | :--- | :--- |
86-
| [Content](#text-generation-chat-content) | `content` | array | The message content. |
87-
| Role | `role` | string | The message role, i.e. 'system', 'user' or 'assistant'. |
77+
| [Content](#text-generation-chat-content) | `content` | array | The message content. |
78+
| Role | `role` | string | The message role, i.e. 'system', 'user' or 'assistant'. |
8879
</div>
8980
<h4 id="text-generation-chat-content">Content</h4>
9081

9182
The message content.
9283

84+
9385
<div class="markdown-col-no-wrap" data-col-1 data-col-2>
9486

9587
| Field | Field ID | Type | Note |
9688
| :--- | :--- | :--- | :--- |
97-
| [Image URL](#text-generation-chat-image-url) | `image-url` | object | The image URL. |
98-
| Text | `text` | string | The text content. |
99-
| Type | `type` | string | The type of the content part. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`text`</li><li>`image_url`</li></ul></details> |
89+
| [Image URL](#text-generation-chat-image-url) | `image-url` | object | The image URL. |
90+
| Text | `text` | string | The text content. |
91+
| Type | `type` | string | The type of the content part. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`text`</li><li>`image_url`</li></ul></details> |
10092
</div>
10193
<h4 id="text-generation-chat-image-url">Image URL</h4>
10294

10395
The image URL.
10496

97+
10598
<div class="markdown-col-no-wrap" data-col-1 data-col-2>
10699

107100
| Field | Field ID | Type | Note |
108101
| :--- | :--- | :--- | :--- |
109-
| URL | `url` | string | Either a URL of the image or the base64 encoded image data. |
102+
| URL | `url` | string | Either a URL of the image or the base64 encoded image data. |
110103
</div>
111104
</details>
112105

113-
114-
115106
<div class="markdown-col-no-wrap" data-col-1 data-col-2>
116107

117108
| Output | Field ID | Type | Description |
118109
| :--- | :--- | :--- | :--- |
119110
| Text | `text` | string | Model Output. |
120111
| [Citations](#text-generation-chat-citations) (optional) | `citations` | array[object] | Citations. |
121112
| [Usage](#text-generation-chat-usage) (optional) | `usage` | object | Token Usage on the Cohere Platform Command Models. |
113+
122114
</div>
123115

116+
124117
<details>
125118
<summary> Output Objects in Text Generation Chat</summary>
126119

@@ -133,6 +126,7 @@ The image URL.
133126
| End | `end` | integer | The end position of the citation. |
134127
| Start | `start` | integer | The start position of the citation. |
135128
| Text | `text` | string | The text body of the citation. |
129+
136130
</div>
137131

138132
<h4 id="text-generation-chat-usage">Usage</h4>
@@ -143,6 +137,7 @@ The image URL.
143137
| :--- | :--- | :--- | :--- |
144138
| Input Tokens | `input-tokens` | number | The input tokens used by Cohere Models. |
145139
| Output Tokens | `output-tokens` | number | The output tokens generated by Cohere Models. |
140+
146141
</div>
147142
</details>
148143

@@ -156,15 +151,12 @@ An embedding is a list of floating point numbers that captures semantic informat
156151
| Input | Field ID | Type | Description |
157152
| :--- | :--- | :--- | :--- |
158153
| Task ID (required) | `task` | string | `TASK_TEXT_EMBEDDINGS` |
159-
| Embedding Type (required) | `embedding-type` | string | 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. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`float`</li><li>`int8`</li><li>`uint8`</li><li>`binary`</li><li>`ubinary`</li></ul></details> |
160-
| Input Type (required) | `input-type` | string | Specifies the type of input passed to the model. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`search_document`</li><li>`search_query`</li><li>`classification`</li><li>`clustering`</li></ul></details> |
161-
| Model Name (required) | `model-name` | string | The Cohere embed model to be used. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`embed-english-v3.0`</li><li>`embed-multilingual-v3.0`</li><li>`embed-english-light-v3.0`</li><li>`embed-multilingual-light-v3.0`</li></ul></details> |
154+
| Embedding Type (required) | `embedding-type` | string | 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. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`float`</li><li>`int8`</li><li>`uint8`</li><li>`binary`</li><li>`ubinary`</li></ul></details> |
155+
| Input Type (required) | `input-type` | string | Specifies the type of input passed to the model. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`search_document`</li><li>`search_query`</li><li>`classification`</li><li>`clustering`</li></ul></details> |
156+
| Model Name (required) | `model-name` | string | The Cohere embed model to be used. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`embed-english-v3.0`</li><li>`embed-multilingual-v3.0`</li><li>`embed-english-light-v3.0`</li><li>`embed-multilingual-light-v3.0`</li></ul></details> |
162157
| Text (required) | `text` | string | The text. |
163-
</div>
164-
165-
166-
167158

159+
</div>
168160

169161

170162
<div class="markdown-col-no-wrap" data-col-1 data-col-2>
@@ -173,8 +165,10 @@ An embedding is a list of floating point numbers that captures semantic informat
173165
| :--- | :--- | :--- | :--- |
174166
| Embedding | `embedding` | array[number] | Embedding of the input text. |
175167
| [Usage](#text-embeddings-usage) (optional) | `usage` | object | Token usage on the Cohere platform embed models. |
168+
176169
</div>
177170

171+
178172
<details>
179173
<summary> Output Objects in Text Embeddings</summary>
180174

@@ -185,6 +179,7 @@ An embedding is a list of floating point numbers that captures semantic informat
185179
| Field | Field ID | Type | Note |
186180
| :--- | :--- | :--- | :--- |
187181
| Token Count | `tokens` | number | The token count used by Cohere Models. |
182+
188183
</div>
189184
</details>
190185

@@ -198,16 +193,13 @@ Rerank models sort text inputs by semantic relevance to a specified query. They
198193
| Input | Field ID | Type | Description |
199194
| :--- | :--- | :--- | :--- |
200195
| Task ID (required) | `task` | string | `TASK_TEXT_RERANKING` |
201-
| Model Name (required) | `model-name` | string | The Cohere rerank model to be used. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`rerank-english-v3.0`</li><li>`rerank-multilingual-v3.0`</li></ul></details> |
196+
| Model Name (required) | `model-name` | string | The Cohere rerank model to be used. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`rerank-english-v3.0`</li><li>`rerank-multilingual-v3.0`</li></ul></details> |
202197
| Query (required) | `query` | string | The query. |
203198
| Documents (required) | `documents` | array[string] | The documents to be used for reranking. |
204199
| Top N | `top-n` | integer | The number of most relevant documents or indices to return. Defaults to the length of the documents (default=3). |
205200
| Maximum Number of Chunks per Document | `max-chunks-per-doc` | integer | The maximum number of chunks to produce internally from a document (default=10). |
206-
</div>
207-
208-
209-
210201

202+
</div>
211203

212204

213205
<div class="markdown-col-no-wrap" data-col-1 data-col-2>
@@ -218,8 +210,10 @@ Rerank models sort text inputs by semantic relevance to a specified query. They
218210
| Reranked Documents Index | `indexes` | array[integer] | The index of the reranked documents. |
219211
| Reranked Documents Relevance | `relevance` | array[number] | The relevance scores of the reranked documents. |
220212
| [Usage](#text-reranking-usage) (optional) | `usage` | object | Search Usage on the Cohere Platform Rerank Models. |
213+
221214
</div>
222215

216+
223217
<details>
224218
<summary> Output Objects in Text Reranking</summary>
225219

@@ -230,8 +224,7 @@ Rerank models sort text inputs by semantic relevance to a specified query. They
230224
| Field | Field ID | Type | Note |
231225
| :--- | :--- | :--- | :--- |
232226
| Search Counts | `search-counts` | number | The search count used by Cohere Models. |
227+
233228
</div>
234229
</details>
235230

236-
237-

0 commit comments

Comments
 (0)