Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions apps/docs/content/docs/en/tools/image_generator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ In Sim, the DALL-E integration enables your agents to generate images programmat

## Usage Instructions

Integrate Image Generator into the workflow. Can generate images using DALL-E 3 or GPT Image.
Integrate Image Generator into the workflow. Can generate images using DALL-E 3, GPT Image 1, or GPT Image 2.



Expand All @@ -43,12 +43,14 @@ Generate images using OpenAI

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `model` | string | Yes | The model to use \(gpt-image-1 or dall-e-3\) |
| `model` | string | Yes | The model to use \(dall-e-3, gpt-image-1, or gpt-image-2\) |
| `prompt` | string | Yes | A text description of the desired image |
| `size` | string | Yes | The size of the generated images \(1024x1024, 1024x1792, or 1792x1024\) |
| `quality` | string | No | The quality of the image \(standard or hd\) |
| `style` | string | No | The style of the image \(vivid or natural\) |
| `background` | string | No | The background color, only for gpt-image-1 |
| `size` | string | Yes | Image size. dall-e-3: 1024x1024, 1024x1792, or 1792x1024. gpt-image-1: auto, 1024x1024, 1536x1024, or 1024x1536. gpt-image-2: auto or any size with edges ≤3840px and multiples of 16 \(e.g. 1024x1024, 1536x1024, 1024x1536, 2560x1440, 3840x2160\). |
| `quality` | string | No | Quality. dall-e-3: standard\|hd. gpt-image-1/gpt-image-2: auto\|low\|medium\|high |
| `style` | string | No | The style of the image \(vivid or natural\), only for dall-e-3 |
| `background` | string | No | Background. gpt-image-1: auto\|transparent\|opaque. gpt-image-2: auto\|opaque \(transparent not supported\) |
| `outputFormat` | string | No | Output image format \(png, jpeg, webp\), only for gpt-image-1 and gpt-image-2 |
| `moderation` | string | No | Moderation level \(auto or low\), only for gpt-image-1 and gpt-image-2 |
| `n` | number | No | The number of images to generate \(1-10\) |
| `apiKey` | string | Yes | Your OpenAI API key |

Expand Down
2 changes: 2 additions & 0 deletions apps/docs/content/docs/en/tools/knowledge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Search for similar content in a knowledge base using vector similarity
| `tagValue` | string | No | No description |
| `rerankerEnabled` | boolean | No | Whether to apply Cohere reranking to vector search results |
| `rerankerModel` | string | No | Cohere rerank model to use \(one of: rerank-v4.0-pro, rerank-v4.0-fast, rerank-v3.5\) |
| `rerankerInputCount` | number | No | Number of vector results sent to the Cohere reranker \(1–100\). Defaults to topK × 4 capped at 100. |
| `apiKey` | string | No | Cohere API key for reranker \(self-hosted deployments only\) |
| `tagFilters` | string | No | No description |

#### Output
Expand Down
17 changes: 7 additions & 10 deletions apps/docs/content/docs/en/tools/mem0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,9 @@ Add memories to Mem0 for persistent storage and retrieval

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `ids` | array | Array of memory IDs that were created |
| `memories` | array | Array of memory objects that were created |
| ↳ `id` | string | Unique identifier for the memory |
| ↳ `memory` | string | The content of the memory |
| ↳ `event` | string | Event type indicating operation performed \(ADD, UPDATE, DELETE, NOOP\) |
| ↳ `metadata` | json | Custom metadata associated with the memory |
| `message` | string | Status message for the queued memory processing job |
| `status` | string | Processing status returned by Mem0 |
| `event_id` | string | Event ID for polling memory processing status |

### `mem0_search_memories`

Expand Down Expand Up @@ -102,6 +99,7 @@ Retrieve memories from Mem0 by ID or filter criteria
| `startDate` | string | No | Start date for filtering by created_at \(e.g., "2024-01-15"\) |
| `endDate` | string | No | End date for filtering by created_at \(e.g., "2024-12-31"\) |
| `limit` | number | No | Maximum number of results to return \(e.g., 10, 50, 100\) |
| `page` | number | No | Page number to retrieve for paginated list results |
| `apiKey` | string | Yes | Your Mem0 API key |

#### Output
Expand All @@ -120,10 +118,9 @@ Retrieve memories from Mem0 by ID or filter criteria
| ↳ `categories` | json | Auto-assigned categories for the memory |
| ↳ `created_at` | string | ISO 8601 timestamp when the memory was created |
| ↳ `updated_at` | string | ISO 8601 timestamp when the memory was last updated |
| ↳ `owner` | string | Owner of the memory |
| ↳ `organization` | string | Organization associated with the memory |
| ↳ `immutable` | boolean | Whether the memory can be modified |
| ↳ `expiration_date` | string | Expiration date after which memory is not retrieved |
| `ids` | array | Array of memory IDs that were retrieved |
| `count` | number | Total number of memories matching the filters |
| `next` | string | URL for the next page of results |
| `previous` | string | URL for the previous page of results |


1 change: 1 addition & 0 deletions apps/docs/content/docs/en/triggers/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"servicenow",
"slack",
"stripe",
"table",
"telegram",
"twilio_voice",
"typeform",
Expand Down
45 changes: 45 additions & 0 deletions apps/docs/content/docs/en/triggers/table.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Table
description: Available Table triggers for automating workflows
---

import { BlockInfoCard } from "@/components/ui/block-info-card"

<BlockInfoCard
type="table"
color="#10B981"
/>

Table provides 1 trigger for automating workflows based on events.

## Triggers

### Table Trigger

Triggers when rows are inserted or updated in a table

#### Configuration

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableSelector` | table-selector | Yes | The table to monitor. |
| `manualTableId` | string | Yes | The table to monitor. |
| `eventType` | string | Yes | The type of event to trigger on. |
| `watchColumns` | string | No | Only fire when these columns change. Leave empty to fire on any update. |
| `includeHeaders` | boolean | No | When enabled, each row is returned as a key-value object mapped to column names. |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `row` | json | Row data mapped to column names \(when header mapping is enabled\) |
| `rawRow` | json | Raw row data object |
| `previousRow` | json | Previous row data before the update \(null for inserts\) |
| `changedColumns` | json | List of column names that changed \(empty for inserts\) |
| `rowId` | string | The unique row ID |
| `headers` | json | Column names from the table schema |
| `rowNumber` | number | The position of the row in the table |
| `tableId` | string | The table ID |
| `tableName` | string | The table name |
| `timestamp` | string | Event timestamp in ISO format |

4 changes: 2 additions & 2 deletions apps/sim/app/(landing)/integrations/data/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -6496,7 +6496,7 @@
"slug": "image-generator",
"name": "Image Generator",
"description": "Generate images",
"longDescription": "Integrate Image Generator into the workflow. Can generate images using DALL-E 3 or GPT Image.",
"longDescription": "Integrate Image Generator into the workflow. Can generate images using DALL-E 3, GPT Image 1, or GPT Image 2.",
"bgColor": "#4D5FFF",
"iconName": "ImageIcon",
"docsUrl": "https://docs.sim.ai/tools/image_generator",
Expand Down Expand Up @@ -7540,7 +7540,7 @@
"operationCount": 14,
"triggers": [],
"triggerCount": 0,
"authType": "none",
"authType": "api-key",
"category": "blocks"
},
{
Expand Down
117 changes: 107 additions & 10 deletions apps/sim/blocks/blocks/image_generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
description: 'Generate images',
authMode: AuthMode.ApiKey,
longDescription:
'Integrate Image Generator into the workflow. Can generate images using DALL-E 3 or GPT Image.',
'Integrate Image Generator into the workflow. Can generate images using DALL-E 3, GPT Image 1, or GPT Image 2.',
docsLink: 'https://docs.sim.ai/tools/image_generator',
category: 'tools',
integrationType: IntegrationType.AI,
Expand All @@ -22,7 +22,8 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
type: 'dropdown',
options: [
{ label: 'DALL-E 3', id: 'dall-e-3' },
{ label: 'GPT Image', id: 'gpt-image-1' },
{ label: 'GPT Image 1', id: 'gpt-image-1' },
{ label: 'GPT Image 2', id: 'gpt-image-2' },
],
value: () => 'dall-e-3',
},
Expand Down Expand Up @@ -60,6 +61,22 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
condition: { field: 'model', value: 'gpt-image-1' },
dependsOn: ['model'],
},
{
id: 'size',
title: 'Size',
type: 'dropdown',
options: [
{ label: 'Auto', id: 'auto' },
{ label: 'Square (1024x1024)', id: '1024x1024' },
{ label: 'Portrait (1024x1536)', id: '1024x1536' },
{ label: 'Landscape (1536x1024)', id: '1536x1024' },
{ label: '2K (2560x1440)', id: '2560x1440' },
{ label: '4K (3840x2160)', id: '3840x2160' },
Comment thread
waleedlatif1 marked this conversation as resolved.
],
value: () => 'auto',
condition: { field: 'model', value: 'gpt-image-2' },
dependsOn: ['model'],
},
{
id: 'quality',
title: 'Quality',
Expand All @@ -72,6 +89,20 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
condition: { field: 'model', value: 'dall-e-3' },
dependsOn: ['model'],
},
{
id: 'quality',
title: 'Quality',
type: 'dropdown',
options: [
{ label: 'Auto', id: 'auto' },
{ label: 'Low', id: 'low' },
{ label: 'Medium', id: 'medium' },
{ label: 'High', id: 'high' },
],
value: () => 'auto',
condition: { field: 'model', value: ['gpt-image-1', 'gpt-image-2'] },
dependsOn: ['model'],
},
Comment thread
waleedlatif1 marked this conversation as resolved.
{
id: 'style',
title: 'Style',
Expand All @@ -97,6 +128,43 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
condition: { field: 'model', value: 'gpt-image-1' },
dependsOn: ['model'],
},
{
id: 'background',
title: 'Background',
type: 'dropdown',
options: [
{ label: 'Auto', id: 'auto' },
{ label: 'Opaque', id: 'opaque' },
],
value: () => 'auto',
condition: { field: 'model', value: 'gpt-image-2' },
dependsOn: ['model'],
},
{
id: 'outputFormat',
title: 'Output Format',
type: 'dropdown',
options: [
{ label: 'PNG', id: 'png' },
{ label: 'JPEG', id: 'jpeg' },
{ label: 'WebP', id: 'webp' },
],
value: () => 'png',
condition: { field: 'model', value: ['gpt-image-1', 'gpt-image-2'] },
dependsOn: ['model'],
},
{
id: 'moderation',
title: 'Moderation',
type: 'dropdown',
options: [
{ label: 'Auto', id: 'auto' },
{ label: 'Low', id: 'low' },
],
value: () => 'auto',
condition: { field: 'model', value: ['gpt-image-1', 'gpt-image-2'] },
dependsOn: ['model'],
},
{
id: 'apiKey',
Comment thread
waleedlatif1 marked this conversation as resolved.
title: 'API Key',
Expand All @@ -120,7 +188,25 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
}

const model = params.model || 'dall-e-3'
const size = params.size || (model === 'gpt-image-1' ? 'auto' : '1024x1024')

const ALLOWED_SIZES: Record<string, string[]> = {
'dall-e-3': ['1024x1024', '1024x1792', '1792x1024'],
'gpt-image-1': ['auto', '1024x1024', '1536x1024', '1024x1536'],
'gpt-image-2': ['auto', '1024x1024', '1536x1024', '1024x1536', '2560x1440', '3840x2160'],
}
const ALLOWED_QUALITIES: Record<string, string[]> = {
'dall-e-3': ['standard', 'hd'],
'gpt-image-1': ['auto', 'low', 'medium', 'high'],
'gpt-image-2': ['auto', 'low', 'medium', 'high'],
}
const ALLOWED_BACKGROUNDS: Record<string, string[]> = {
Comment thread
waleedlatif1 marked this conversation as resolved.
'gpt-image-1': ['auto', 'transparent', 'opaque'],
'gpt-image-2': ['auto', 'opaque'],
}

const defaultSize = model === 'dall-e-3' ? '1024x1024' : 'auto'
const size = ALLOWED_SIZES[model]?.includes(params.size) ? params.size : defaultSize

const baseParams = {
prompt: params.prompt,
model,
Expand All @@ -129,16 +215,25 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
}

if (model === 'dall-e-3') {
return {
...baseParams,
quality: params.quality || 'standard',
style: params.style || 'vivid',
}
const quality = ALLOWED_QUALITIES['dall-e-3'].includes(params.quality)
? params.quality
: 'standard'
const style = ['vivid', 'natural'].includes(params.style) ? params.style : 'vivid'
return { ...baseParams, quality, style }
}
if (model === 'gpt-image-1') {
if (model === 'gpt-image-1' || model === 'gpt-image-2') {
const quality = ALLOWED_QUALITIES[model].includes(params.quality)
? params.quality
: undefined
const background = ALLOWED_BACKGROUNDS[model].includes(params.background)
? params.background
: undefined
return {
...baseParams,
...(params.background && { background: params.background }),
...(quality && { quality }),
...(background && { background }),
...(params.outputFormat && { outputFormat: params.outputFormat }),
...(params.moderation && { moderation: params.moderation }),
}
}

Expand All @@ -153,6 +248,8 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
quality: { type: 'string', description: 'Image quality level' },
style: { type: 'string', description: 'Image style' },
background: { type: 'string', description: 'Background type' },
outputFormat: { type: 'string', description: 'Output image format (png, jpeg, webp)' },
moderation: { type: 'string', description: 'Moderation level (auto or low)' },
apiKey: { type: 'string', description: 'OpenAI API key' },
},
outputs: {
Expand Down
Loading
Loading