improvement(docs): overhaul docs (#1680)

* improvement(docs): overhaul docs

* lint

* light mode

* more light mode

* added llms.txt and llms-full.txt and sitemap

* fixed mobile styling and position for zoom in out

* finished styling

* improvement(docs): overhaul docs

* lint

* remove dups

* renaming components

* cleanup
This commit is contained in:
Waleed
2025-10-17 22:29:55 -07:00
committed by GitHub
parent 90c34b2c46
commit d1c08daaf4
35 changed files with 1268 additions and 599 deletions

View File

@@ -1,5 +1,5 @@
---
title: Blocks
title: Overview
description: The building components of your AI workflows
---

View File

@@ -0,0 +1,16 @@
{
"pages": [
"index",
"agent",
"api",
"condition",
"evaluator",
"function",
"guardrails",
"loop",
"parallel",
"response",
"router",
"workflow"
]
}

View File

@@ -1,5 +1,5 @@
---
title: Connection Basics
title: Basics
---
import { Callout } from 'fumadocs-ui/components/callout'

View File

@@ -1,5 +1,5 @@
---
title: Connection Data Structure
title: Data Structure
---
import { Callout } from 'fumadocs-ui/components/callout'

View File

@@ -1,5 +1,5 @@
---
title: Connections
title: Overview
description: Connect your blocks to one another.
---

View File

@@ -0,0 +1,3 @@
{
"pages": ["index", "basics", "data-structure", "tags"]
}

View File

@@ -1,5 +1,5 @@
---
title: Connection Tags
title: Tags
---
import { Callout } from 'fumadocs-ui/components/callout'

View File

@@ -1,5 +1,5 @@
---
title: Execution Basics
title: Basics
---
import { Callout } from 'fumadocs-ui/components/callout'

View File

@@ -1,5 +1,5 @@
---
title: Execution
title: Overview
---
import { Callout } from 'fumadocs-ui/components/callout'

View File

@@ -0,0 +1,3 @@
{
"pages": ["index", "basics", "api", "logging", "costs"]
}

View File

@@ -3,7 +3,6 @@
"pages": [
"./introduction/index",
"./getting-started/index",
"---Building Workflows---",
"triggers",
"blocks",
"tools",
@@ -11,14 +10,9 @@
"mcp",
"copilot",
"knowledgebase",
"---Configuration---",
"variables",
"---Execution---",
"execution",
"---Advanced---",
"permissions",
"yaml",
"---SDKs---",
"sdks"
],
"defaultOpen": false

View File

@@ -0,0 +1,4 @@
{
"title": "SDKs",
"pages": ["python", "typescript"]
}

View File

@@ -1,5 +1,5 @@
---
title: Python SDK
title: Python
---
import { Callout } from 'fumadocs-ui/components/callout'
@@ -752,10 +752,6 @@ Configure the client using environment variables:
</Step>
</Steps>
<Callout type="warning">
Keep your API key secure and never commit it to version control. Use environment variables or secure configuration management.
</Callout>
## Requirements
- Python 3.8+

View File

@@ -1,5 +1,5 @@
---
title: TypeScript/JavaScript SDK
title: TypeScript
---
import { Callout } from 'fumadocs-ui/components/callout'
@@ -1026,10 +1026,6 @@ function StreamingWorkflow() {
</Step>
</Steps>
<Callout type="warning">
Keep your API key secure and never commit it to version control. Use environment variables or secure configuration management.
</Callout>
## Requirements
- Node.js 16+

View File

@@ -1,5 +1,5 @@
---
title: Tools
title: Overview
description: Powerful tools to enhance your agentic workflows
---

View File

@@ -1,5 +1,5 @@
{
"items": [
"pages": [
"index",
"airtable",
"arxiv",

View File

@@ -1,5 +1,5 @@
---
title: Triggers
title: Overview
description: Core ways to start Sim workflows
---

View File

@@ -0,0 +1,3 @@
{
"pages": ["index", "api", "chat", "input-form", "manual", "schedule", "starter", "webhook"]
}

View File

@@ -1,357 +0,0 @@
---
title: Loop Block YAML Schema
description: YAML configuration reference for Loop blocks
---
## Schema Definition
```yaml
type: object
required:
- type
- name
- connections
properties:
type:
type: string
enum: [loop]
description: Block type identifier
name:
type: string
description: Display name for this loop block
inputs:
type: object
description: Optional. If omitted, defaults will be applied.
properties:
loopType:
type: string
enum: [for, forEach]
description: Type of loop to execute
default: for
iterations:
type: number
description: Number of iterations (for 'for' loops)
default: 5
minimum: 1
maximum: 1000
collection:
type: string
description: Collection to iterate over (for 'forEach' loops)
default: ""
maxConcurrency:
type: number
description: Maximum concurrent executions
default: 1
minimum: 1
maximum: 10
connections:
type: object
properties:
# Nested format (recommended)
loop:
type: object
properties:
start:
type: string
description: Target block ID to execute inside the loop
end:
type: string
description: Target block ID for loop completion (optional)
# Direct handle format (alternative)
loop-start-source:
type: string | string[]
description: Target block ID to execute inside the loop (direct format)
loop-end-source:
type: string | string[]
description: Target block ID for loop completion (direct format, optional)
error:
type: string
description: Target block ID for error handling
note: Use either the nested 'loop' format OR the direct 'loop-start-source' format, not both
```
## Connection Configuration
Loop blocks support two connection formats:
### Direct Handle Format (Alternative)
```yaml
connections:
loop-start-source: <string> # Target block ID to execute inside the loop
loop-end-source: <string> # Target block ID after loop completion (optional)
error: <string> # Target block ID for error handling (optional)
```
Both formats work identically. Use whichever you prefer.
## Child Block Configuration
Blocks inside a loop must have their `parentId` set to the loop block ID. The `extent` property is automatically set to `'parent'` and doesn't need to be specified:
```yaml
loop-1:
type: loop
name: "Process Items"
inputs:
loopType: forEach
collection: <start.items>
connections:
loop:
start: process-item
end: final-results
# Child block inside the loop
process-item:
type: agent
name: "Process Item"
parentId: loop-1 # References the loop block
inputs:
systemPrompt: "Process this item"
userPrompt: <loop.currentItem>
model: gpt-4o
apiKey: '{{OPENAI_API_KEY}}'
```
## Examples
### For Loop (Fixed Iterations)
```yaml
countdown-loop:
type: loop
name: "Countdown Loop"
inputs:
loopType: for
iterations: 5
connections:
loop:
start: countdown-agent
end: countdown-complete
countdown-agent:
type: agent
name: "Countdown Agent"
parentId: countdown-loop
inputs:
systemPrompt: "Generate a countdown message"
userPrompt: "Count down from 5. Current number: <loop.index>"
model: gpt-4o
apiKey: '{{OPENAI_API_KEY}}'
```
### ForEach Loop (Collection Processing)
```yaml
email-processor-loop:
type: loop
name: "Email Processor Loop"
inputs:
loopType: forEach
collection: <start.emails>
connections:
loop:
start: process-single-email
end: all-emails-processed
process-single-email:
type: agent
name: "Process Single Email"
parentId: email-processor-loop
inputs:
systemPrompt: "Classify and respond to this email"
userPrompt: "Email content: <loop.currentItem>"
model: gpt-4o
apiKey: '{{OPENAI_API_KEY}}'
```
### Loop with Multiple Child Blocks
```yaml
data-analysis-loop:
type: loop
name: "Data Analysis Loop"
inputs:
loopType: forEach
collection: <data-fetcher.records>
maxConcurrency: 3
connections:
loop:
start: validate-record
end: generate-report
error: handle-loop-error
validate-record:
type: function
name: "Validate Record"
parentId: data-analysis-loop
inputs:
code: |
const record = <loop.currentItem>;
const index = <loop.index>;
// Validate the record
if (!record.id || !record.data) {
throw new Error(`Invalid record at index ${index}`);
}
return {
valid: true,
recordId: record.id,
processedAt: new Date().toISOString()
};
connections:
success: analyze-record
error: record-error
analyze-record:
type: agent
name: "Analyze Record"
parentId: data-analysis-loop
inputs:
systemPrompt: "Analyze this data record and extract insights"
userPrompt: |
Record ID: <validaterecord.recordId>
Data: <loop.currentItem.data>
Position in collection: <loop.index>
model: gpt-4o
apiKey: '{{OPENAI_API_KEY}}'
connections:
success: store-analysis
store-analysis:
type: function
name: "Store Analysis"
parentId: data-analysis-loop
inputs:
code: |
const analysis = <analyzerecord.content>;
const recordId = <validaterecord.recordId>;
// Store analysis result
return {
recordId,
analysis,
completedAt: new Date().toISOString()
};
```
### Concurrent Processing Loop
```yaml
parallel-processing-loop:
type: loop
name: "Parallel Processing Loop"
inputs:
loopType: forEach
collection: <start.tasks>
maxConcurrency: 5
connections:
loop:
start: process-task
end: aggregate-results
process-task:
type: api
name: "Process Task"
parentId: parallel-processing-loop
inputs:
url: "https://api.example.com/process"
method: POST
headers:
- key: "Authorization"
value: "Bearer {{API_TOKEN}}"
body: |
{
"taskId": "<loop.currentItem.id>",
"data": "<loop.currentItem.data>"
}
connections:
success: task-completed
```
### Direct Handle Format Example
The same loop can be written using the direct handle format:
```yaml
my-loop:
type: loop
name: "Process Items"
inputs:
loopType: forEach
collection: <start.items>
connections:
loop-start-source: process-item # Direct handle format
loop-end-source: final-results # Direct handle format
error: handle-error
process-item:
type: agent
name: "Process Item"
parentId: my-loop
inputs:
systemPrompt: "Process this item"
userPrompt: <loop.currentItem>
model: gpt-4o
apiKey: '{{OPENAI_API_KEY}}'
```
### Minimal Loop Example (Using Defaults)
You can omit the `inputs` section entirely, and defaults will be applied:
```yaml
simple-loop:
type: loop
name: "Simple Loop"
# No inputs section - defaults to loopType: 'for', iterations: 5
connections:
loop-start-source: process-step
loop-end-source: complete
process-step:
type: agent
name: "Process Step"
parentId: simple-loop
inputs:
systemPrompt: "Execute step"
userPrompt: "Step <loop.index>"
model: gpt-4o
apiKey: '{{OPENAI_API_KEY}}'
```
This loop will execute 5 iterations by default.
## Loop Variables
Inside loop child blocks, these special variables are available:
```yaml
# Available in all child blocks of the loop
<loop.index> # Current iteration number (0-based)
<loop.currentItem> # Current item being processed (forEach loops)
<loop.items> # Full collection (forEach loops)
```
## Output References
After a loop completes, you can reference its aggregated results:
```yaml
# In blocks after the loop
final-processor:
inputs:
all-results: <loop-name.results> # Array of all iteration results
total-count: <loop-name.count> # Number of iterations completed
```
## Best Practices
- Set reasonable iteration limits to avoid long execution times
- Use forEach for collection processing, for loops for fixed iterations
- Consider using maxConcurrency for I/O bound operations
- Include error handling for robust loop execution
- Use descriptive names for loop child blocks
- Test with small collections first
- Monitor execution time for large collections