mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-11 07:58:06 -05:00
Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da091dfe8a | ||
|
|
29c7827d6f | ||
|
|
22f9d6e2df | ||
|
|
0cb615428d | ||
|
|
74576ec921 | ||
|
|
67e681dd7c | ||
|
|
4b05da31e0 | ||
|
|
82fa4e8bbb | ||
|
|
4cd790b200 | ||
|
|
b7e0b42d48 | ||
|
|
c6ef5785c8 | ||
|
|
04f109c1f4 | ||
|
|
48eab7e744 | ||
|
|
701bf2b510 | ||
|
|
ba8acbba07 | ||
|
|
56d04a9558 | ||
|
|
2ca9044bc6 | ||
|
|
b2009fe467 | ||
|
|
eb4821ff30 | ||
|
|
4cceb22f21 | ||
|
|
fd67fd220c | ||
|
|
061c1dff4e | ||
|
|
1a05ef97d6 | ||
|
|
2bc8c7bf39 | ||
|
|
7595e54dfb | ||
|
|
6c9fce5da4 | ||
|
|
b296323716 | ||
|
|
d325fdde6c | ||
|
|
36f2a62f3f | ||
|
|
e83d3a6b9f | ||
|
|
6723adf3c1 | ||
|
|
9efc08a832 | ||
|
|
f345c4d1d8 | ||
|
|
f147eaee1c | ||
|
|
fb0fa1fd21 | ||
|
|
6f3df271fd | ||
|
|
7f82ed381a | ||
|
|
3dd36a8a35 | ||
|
|
09cccd5487 | ||
|
|
1773530325 | ||
|
|
2da7a6755c | ||
|
|
1e81cd6850 | ||
|
|
ec73e2e9ce | ||
|
|
4937d72d70 |
@@ -1,69 +0,0 @@
|
||||
# Sim Development Environment Bashrc
|
||||
# This gets sourced by post-create.sh
|
||||
|
||||
# Enhanced prompt with git branch info
|
||||
parse_git_branch() {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||
}
|
||||
|
||||
export PS1="\[\033[01;32m\]\u@simstudio\[\033[00m\]:\[\033[01;34m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\]\$ "
|
||||
|
||||
# Helpful aliases
|
||||
alias ll="ls -la"
|
||||
alias ..="cd .."
|
||||
alias ...="cd ../.."
|
||||
|
||||
# Database aliases
|
||||
alias pgc="PGPASSWORD=postgres psql -h db -U postgres -d simstudio"
|
||||
alias check-db="PGPASSWORD=postgres psql -h db -U postgres -c '\l'"
|
||||
|
||||
# Sim specific aliases
|
||||
alias logs="cd /workspace/apps/sim && tail -f logs/*.log 2>/dev/null || echo 'No log files found'"
|
||||
alias sim-start="cd /workspace && bun run dev"
|
||||
alias sim-migrate="cd /workspace/apps/sim && bunx drizzle-kit push"
|
||||
alias sim-generate="cd /workspace/apps/sim && bunx drizzle-kit generate"
|
||||
alias sim-rebuild="cd /workspace && bun run build && bun run start"
|
||||
alias docs-dev="cd /workspace/apps/docs && bun run dev"
|
||||
|
||||
# Turbo related commands
|
||||
alias turbo-build="cd /workspace && bunx turbo run build"
|
||||
alias turbo-dev="cd /workspace && bunx turbo run dev"
|
||||
alias turbo-test="cd /workspace && bunx turbo run test"
|
||||
|
||||
# Bun specific commands
|
||||
alias bun-update="cd /workspace && bun update"
|
||||
alias bun-add="cd /workspace && bun add"
|
||||
alias bun-pm="cd /workspace && bun pm"
|
||||
alias bun-canary="bun upgrade --canary"
|
||||
|
||||
# Default to workspace directory
|
||||
cd /workspace 2>/dev/null || true
|
||||
|
||||
# Welcome message - only show once per session
|
||||
if [ -z "$SIM_WELCOME_SHOWN" ]; then
|
||||
export SIM_WELCOME_SHOWN=1
|
||||
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "🚀 Welcome to Sim development environment!"
|
||||
echo ""
|
||||
echo "Available commands:"
|
||||
echo " sim-start - Start all apps in development mode"
|
||||
echo " sim-migrate - Push schema changes to the database for sim app"
|
||||
echo " sim-generate - Generate new migrations for sim app"
|
||||
echo " sim-rebuild - Build and start all apps"
|
||||
echo " docs-dev - Start only the docs app in development mode"
|
||||
echo ""
|
||||
echo "Turbo commands:"
|
||||
echo " turbo-build - Build all apps using Turborepo"
|
||||
echo " turbo-dev - Start development mode for all apps"
|
||||
echo " turbo-test - Run tests for all packages"
|
||||
echo ""
|
||||
echo "Bun commands:"
|
||||
echo " bun-update - Update dependencies"
|
||||
echo " bun-add - Add a new dependency"
|
||||
echo " bun-pm - Manage dependencies"
|
||||
echo " bun-canary - Upgrade to the latest canary version of Bun"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo ""
|
||||
fi
|
||||
@@ -1,38 +1,43 @@
|
||||
# Use the latest Bun canary image for development
|
||||
FROM oven/bun:canary
|
||||
|
||||
# Avoid warnings by switching to noninteractive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
FROM oven/bun:1.2.22-alpine
|
||||
|
||||
# Install necessary packages for development
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
git curl wget jq sudo postgresql-client vim nano \
|
||||
bash-completion ca-certificates lsb-release gnupg \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN apk add --no-cache \
|
||||
git \
|
||||
curl \
|
||||
wget \
|
||||
jq \
|
||||
sudo \
|
||||
postgresql-client \
|
||||
vim \
|
||||
nano \
|
||||
bash \
|
||||
bash-completion \
|
||||
zsh \
|
||||
zsh-vcs \
|
||||
ca-certificates \
|
||||
shadow
|
||||
|
||||
# Create a non-root user
|
||||
# Create a non-root user with matching UID/GID
|
||||
ARG USERNAME=bun
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Create user group if it doesn't exist
|
||||
RUN if ! getent group $USER_GID >/dev/null; then \
|
||||
addgroup -g $USER_GID $USERNAME; \
|
||||
fi
|
||||
|
||||
# Create user if it doesn't exist
|
||||
RUN if ! getent passwd $USER_UID >/dev/null; then \
|
||||
adduser -D -u $USER_UID -G $(getent group $USER_GID | cut -d: -f1) $USERNAME; \
|
||||
fi
|
||||
|
||||
# Add sudo support
|
||||
RUN echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USERNAME \
|
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME
|
||||
|
||||
# Install global packages for development
|
||||
RUN bun install -g turbo drizzle-kit typescript @types/node
|
||||
|
||||
# Install bun completions
|
||||
RUN bun completions > /etc/bash_completion.d/bun
|
||||
|
||||
# Set up shell environment
|
||||
RUN echo "export PATH=$PATH:/home/$USERNAME/.bun/bin" >> /etc/profile
|
||||
RUN echo "source /etc/profile" >> /etc/bash.bashrc
|
||||
|
||||
# Switch back to dialog for any ad-hoc use of apt-get
|
||||
ENV DEBIAN_FRONTEND=dialog
|
||||
RUN echo "export PATH=\$PATH:/home/$USERNAME/.bun/bin" >> /etc/profile
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
|
||||
@@ -1,78 +1,75 @@
|
||||
# Sim Development Container
|
||||
|
||||
This directory contains configuration files for Visual Studio Code Dev Containers / GitHub Codespaces. Dev containers provide a consistent, isolated development environment for this project.
|
||||
Development container configuration for VS Code Dev Containers and GitHub Codespaces.
|
||||
|
||||
## Contents
|
||||
|
||||
- `devcontainer.json` - The main configuration file that defines the development container settings
|
||||
- `Dockerfile` - Defines the container image and development environment
|
||||
- `docker-compose.yml` - Sets up the application and database containers
|
||||
- `post-create.sh` - Script that runs when the container is created
|
||||
- `.bashrc` - Custom shell configuration with helpful aliases
|
||||
|
||||
## Usage
|
||||
|
||||
### Prerequisites
|
||||
## Prerequisites
|
||||
|
||||
- Visual Studio Code
|
||||
- Docker installation:
|
||||
- Docker Desktop (Windows/macOS)
|
||||
- Docker Engine (Linux)
|
||||
- VS Code Remote - Containers extension
|
||||
- Docker Desktop or Podman Desktop
|
||||
- VS Code Dev Containers extension
|
||||
|
||||
### Getting Started
|
||||
## Getting Started
|
||||
|
||||
1. Open this project in Visual Studio Code
|
||||
2. When prompted, click "Reopen in Container"
|
||||
- Alternatively, press `F1` and select "Remote-Containers: Reopen in Container"
|
||||
1. Open this project in VS Code
|
||||
2. Click "Reopen in Container" when prompted (or press `F1` → "Dev Containers: Reopen in Container")
|
||||
3. Wait for the container to build and initialize
|
||||
4. The post-creation script will automatically:
|
||||
4. Start developing with `sim-start`
|
||||
|
||||
- Install dependencies
|
||||
- Set up environment variables
|
||||
- Run database migrations
|
||||
- Configure helpful aliases
|
||||
The setup script will automatically install dependencies and run migrations.
|
||||
|
||||
5. Start the application with `sim-start` (alias for `bun run dev`)
|
||||
## Development Commands
|
||||
|
||||
### Development Commands
|
||||
### Running Services
|
||||
|
||||
The development environment includes these helpful aliases:
|
||||
You have two options for running the development environment:
|
||||
|
||||
**Option 1: Run everything together (recommended for most development)**
|
||||
```bash
|
||||
sim-start # Runs both app and socket server using concurrently
|
||||
```
|
||||
|
||||
**Option 2: Run services separately (useful for debugging individual services)**
|
||||
- In the **app** container terminal: `sim-app` (starts Next.js app on port 3000)
|
||||
- In the **realtime** container terminal: `sim-sockets` (starts socket server on port 3002)
|
||||
|
||||
### Other Commands
|
||||
|
||||
- `sim-start` - Start the development server
|
||||
- `sim-migrate` - Push schema changes to the database
|
||||
- `sim-generate` - Generate new migrations
|
||||
- `sim-rebuild` - Build and start the production version
|
||||
- `pgc` - Connect to the PostgreSQL database
|
||||
- `check-db` - List all databases
|
||||
|
||||
### Using GitHub Codespaces
|
||||
|
||||
This project is also configured for GitHub Codespaces. To use it:
|
||||
|
||||
1. Go to the GitHub repository
|
||||
2. Click the "Code" button
|
||||
3. Select the "Codespaces" tab
|
||||
4. Click "Create codespace on main"
|
||||
|
||||
This will start a new Codespace with the development environment already set up.
|
||||
|
||||
## Customization
|
||||
|
||||
You can customize the development environment by:
|
||||
|
||||
- Modifying `devcontainer.json` to add VS Code extensions or settings
|
||||
- Updating the `Dockerfile` to install additional packages
|
||||
- Editing `docker-compose.yml` to add services or change configuration
|
||||
- Modifying `.bashrc` to add custom aliases or configurations
|
||||
- `build` - Build the application
|
||||
- `pgc` - Connect to PostgreSQL database
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If you encounter issues:
|
||||
**Build errors**: Rebuild the container with `F1` → "Dev Containers: Rebuild Container"
|
||||
|
||||
1. Rebuild the container: `F1` → "Remote-Containers: Rebuild Container"
|
||||
2. Check Docker logs for build errors
|
||||
3. Verify Docker Desktop is running
|
||||
4. Ensure all prerequisites are installed
|
||||
**Port conflicts**: Ensure ports 3000, 3002, and 5432 are available
|
||||
|
||||
For more information, see the [VS Code Remote Development documentation](https://code.visualstudio.com/docs/remote/containers).
|
||||
**Container runtime issues**: Verify Docker Desktop or Podman Desktop is running
|
||||
|
||||
## Technical Details
|
||||
|
||||
Services:
|
||||
- **App container** (8GB memory limit) - Main Next.js application
|
||||
- **Realtime container** (4GB memory limit) - Socket.io server for real-time features
|
||||
- **Database** - PostgreSQL with pgvector extension
|
||||
- **Migrations** - Runs automatically on container creation
|
||||
|
||||
You can develop with services running together or independently.
|
||||
|
||||
### Personalization
|
||||
|
||||
**Project commands** (`sim-start`, `sim-app`, etc.) are automatically available via `/workspace/.devcontainer/sim-commands.sh`.
|
||||
|
||||
**Personal shell customization** (aliases, prompts, etc.) should use VS Code's dotfiles feature:
|
||||
1. Create a dotfiles repository (e.g., `github.com/youruser/dotfiles`)
|
||||
2. Add your `.bashrc`, `.zshrc`, or other configs
|
||||
3. Configure in VS Code Settings:
|
||||
```json
|
||||
{
|
||||
"dotfiles.repository": "youruser/dotfiles",
|
||||
"dotfiles.installCommand": "install.sh"
|
||||
}
|
||||
```
|
||||
|
||||
This separates project-specific commands from personal preferences, following VS Code best practices.
|
||||
|
||||
@@ -13,13 +13,6 @@
|
||||
"source.fixAll.biome": "explicit",
|
||||
"source.organizeImports.biome": "explicit"
|
||||
},
|
||||
"terminal.integrated.defaultProfile.linux": "bash",
|
||||
"terminal.integrated.profiles.linux": {
|
||||
"bash": {
|
||||
"path": "/bin/bash",
|
||||
"args": ["--login"]
|
||||
}
|
||||
},
|
||||
"terminal.integrated.shellIntegration.enabled": true
|
||||
},
|
||||
"extensions": [
|
||||
@@ -36,18 +29,9 @@
|
||||
}
|
||||
},
|
||||
|
||||
"forwardPorts": [3000, 5432],
|
||||
"forwardPorts": [3000, 3002, 5432],
|
||||
|
||||
"postCreateCommand": "bash -c 'bash .devcontainer/post-create.sh || true'",
|
||||
|
||||
"postStartCommand": "bash -c 'if [ ! -f ~/.bashrc ] || ! grep -q \"sim-start\" ~/.bashrc; then cp .devcontainer/.bashrc ~/.bashrc; fi'",
|
||||
|
||||
"remoteUser": "bun",
|
||||
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/git:1": {},
|
||||
"ghcr.io/prulloac/devcontainer-features/bun:1": {
|
||||
"version": "latest"
|
||||
}
|
||||
}
|
||||
"remoteUser": "bun"
|
||||
}
|
||||
|
||||
@@ -7,52 +7,56 @@ services:
|
||||
- ..:/workspace:cached
|
||||
- bun-cache:/home/bun/.bun/cache:delegated
|
||||
command: sleep infinity
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 8G
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
|
||||
- BETTER_AUTH_URL=http://localhost:3000
|
||||
- NEXT_PUBLIC_APP_URL=http://localhost:3000
|
||||
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET:-your_auth_secret_here}
|
||||
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-your_encryption_key_here}
|
||||
- COPILOT_API_KEY=${COPILOT_API_KEY}
|
||||
- SIM_AGENT_API_URL=${SIM_AGENT_API_URL}
|
||||
- OLLAMA_URL=${OLLAMA_URL:-http://localhost:11434}
|
||||
- NEXT_PUBLIC_SOCKET_URL=${NEXT_PUBLIC_SOCKET_URL:-http://localhost:3002}
|
||||
- BUN_INSTALL_CACHE_DIR=/home/bun/.bun/cache
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
realtime:
|
||||
condition: service_healthy
|
||||
migrations:
|
||||
condition: service_completed_successfully
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "3001:3001"
|
||||
working_dir: /workspace
|
||||
healthcheck:
|
||||
test: ['CMD', 'wget', '--spider', '--quiet', 'http://127.0.0.1:3000']
|
||||
interval: 90s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
realtime:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: .devcontainer/Dockerfile
|
||||
volumes:
|
||||
- ..:/workspace:cached
|
||||
- bun-cache:/home/bun/.bun/cache:delegated
|
||||
command: sleep infinity
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 4G
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
|
||||
- BETTER_AUTH_URL=http://localhost:3000
|
||||
- NEXT_PUBLIC_APP_URL=http://localhost:3000
|
||||
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET:-your_auth_secret_here}
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "3002:3002"
|
||||
working_dir: /workspace
|
||||
healthcheck:
|
||||
test: ['CMD', 'wget', '--spider', '--quiet', 'http://127.0.0.1:3002']
|
||||
interval: 90s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
migrations:
|
||||
build:
|
||||
|
||||
@@ -8,11 +8,43 @@ echo "🔧 Setting up Sim development environment..."
|
||||
# Change to the workspace root directory
|
||||
cd /workspace
|
||||
|
||||
# Setup .bashrc
|
||||
echo "📄 Setting up .bashrc with aliases..."
|
||||
cp /workspace/.devcontainer/.bashrc ~/.bashrc
|
||||
# Add to .profile to ensure .bashrc is sourced in non-interactive shells
|
||||
echo 'if [ -f ~/.bashrc ]; then . ~/.bashrc; fi' >> ~/.profile
|
||||
# Install global packages for development (done at runtime, not build time)
|
||||
echo "📦 Installing global development tools..."
|
||||
bun install -g turbo drizzle-kit typescript @types/node 2>/dev/null || {
|
||||
echo "⚠️ Some global packages may already be installed, continuing..."
|
||||
}
|
||||
|
||||
# Set up bun completions (with proper shell detection)
|
||||
echo "🔧 Setting up shell completions..."
|
||||
if [ -n "$SHELL" ] && [ -f "$SHELL" ]; then
|
||||
SHELL=/bin/bash bun completions 2>/dev/null | sudo tee /etc/bash_completion.d/bun > /dev/null || {
|
||||
echo "⚠️ Could not install bun completions, but continuing..."
|
||||
}
|
||||
fi
|
||||
|
||||
# Add project commands to shell profile
|
||||
echo "📄 Setting up project commands..."
|
||||
# Add sourcing of sim-commands.sh to user's shell config files if they exist
|
||||
for rcfile in ~/.bashrc ~/.zshrc; do
|
||||
if [ -f "$rcfile" ]; then
|
||||
# Check if already added
|
||||
if ! grep -q "sim-commands.sh" "$rcfile"; then
|
||||
echo "" >> "$rcfile"
|
||||
echo "# Sim project commands" >> "$rcfile"
|
||||
echo "if [ -f /workspace/.devcontainer/sim-commands.sh ]; then" >> "$rcfile"
|
||||
echo " source /workspace/.devcontainer/sim-commands.sh" >> "$rcfile"
|
||||
echo "fi" >> "$rcfile"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# If no rc files exist yet, create a minimal one
|
||||
if [ ! -f ~/.bashrc ] && [ ! -f ~/.zshrc ]; then
|
||||
echo "# Source Sim project commands" > ~/.bashrc
|
||||
echo "if [ -f /workspace/.devcontainer/sim-commands.sh ]; then" >> ~/.bashrc
|
||||
echo " source /workspace/.devcontainer/sim-commands.sh" >> ~/.bashrc
|
||||
echo "fi" >> ~/.bashrc
|
||||
fi
|
||||
|
||||
# Clean and reinstall dependencies to ensure platform compatibility
|
||||
echo "📦 Cleaning and reinstalling dependencies..."
|
||||
@@ -29,18 +61,12 @@ chmod 700 ~/.bun ~/.bun/cache
|
||||
|
||||
# Install dependencies with platform-specific binaries
|
||||
echo "Installing dependencies with Bun..."
|
||||
bun install || {
|
||||
echo "⚠️ bun install had issues but continuing setup..."
|
||||
}
|
||||
bun install
|
||||
|
||||
# Check for native dependencies
|
||||
echo "Checking for native dependencies compatibility..."
|
||||
NATIVE_DEPS=$(grep '"trustedDependencies"' apps/sim/package.json || echo "")
|
||||
if [ ! -z "$NATIVE_DEPS" ]; then
|
||||
echo "⚠️ Native dependencies detected. Ensuring compatibility with Bun..."
|
||||
for pkg in $(echo $NATIVE_DEPS | grep -oP '"[^"]*"' | tr -d '"' | grep -v "trustedDependencies"); do
|
||||
echo "Checking compatibility for $pkg..."
|
||||
done
|
||||
if grep -q '"trustedDependencies"' apps/sim/package.json 2>/dev/null; then
|
||||
echo "⚠️ Native dependencies detected. Bun will handle compatibility during install."
|
||||
fi
|
||||
|
||||
# Set up environment variables if .env doesn't exist for the sim app
|
||||
@@ -82,23 +108,6 @@ echo "Waiting for database to be ready..."
|
||||
fi
|
||||
) || echo "⚠️ Database setup had issues but continuing..."
|
||||
|
||||
# Add additional helpful aliases to .bashrc
|
||||
cat << EOF >> ~/.bashrc
|
||||
|
||||
# Additional Sim Development Aliases
|
||||
alias migrate="cd /workspace/apps/sim && DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio bunx drizzle-kit push"
|
||||
alias generate="cd /workspace/apps/sim && bunx drizzle-kit generate"
|
||||
alias dev="cd /workspace && bun run dev"
|
||||
alias build="cd /workspace && bun run build"
|
||||
alias start="cd /workspace && bun run dev"
|
||||
alias lint="cd /workspace/apps/sim && bun run lint"
|
||||
alias test="cd /workspace && bun run test"
|
||||
alias bun-update="cd /workspace && bun update"
|
||||
EOF
|
||||
|
||||
# Source the .bashrc to make aliases available immediately
|
||||
. ~/.bashrc
|
||||
|
||||
# Clear the welcome message flag to ensure it shows after setup
|
||||
unset SIM_WELCOME_SHOWN
|
||||
|
||||
|
||||
42
.devcontainer/sim-commands.sh
Executable file
42
.devcontainer/sim-commands.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# Sim Project Commands
|
||||
# Source this file to add project-specific commands to your shell
|
||||
# Add to your ~/.bashrc or ~/.zshrc: source /workspace/.devcontainer/sim-commands.sh
|
||||
|
||||
# Project-specific aliases for Sim development
|
||||
alias sim-start="cd /workspace && bun run dev:full"
|
||||
alias sim-app="cd /workspace && bun run dev"
|
||||
alias sim-sockets="cd /workspace && bun run dev:sockets"
|
||||
alias sim-migrate="cd /workspace/apps/sim && bunx drizzle-kit push"
|
||||
alias sim-generate="cd /workspace/apps/sim && bunx drizzle-kit generate"
|
||||
alias sim-rebuild="cd /workspace && bun run build && bun run start"
|
||||
alias docs-dev="cd /workspace/apps/docs && bun run dev"
|
||||
|
||||
# Database connection helpers
|
||||
alias pgc="PGPASSWORD=postgres psql -h db -U postgres -d simstudio"
|
||||
alias check-db="PGPASSWORD=postgres psql -h db -U postgres -c '\l'"
|
||||
|
||||
# Default to workspace directory
|
||||
cd /workspace 2>/dev/null || true
|
||||
|
||||
# Welcome message - show once per session
|
||||
if [ -z "$SIM_WELCOME_SHOWN" ]; then
|
||||
export SIM_WELCOME_SHOWN=1
|
||||
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "🚀 Sim Development Environment"
|
||||
echo ""
|
||||
echo "Project commands:"
|
||||
echo " sim-start - Start app + socket server"
|
||||
echo " sim-app - Start only main app"
|
||||
echo " sim-sockets - Start only socket server"
|
||||
echo " sim-migrate - Push schema changes"
|
||||
echo " sim-generate - Generate migrations"
|
||||
echo ""
|
||||
echo "Database:"
|
||||
echo " pgc - Connect to PostgreSQL"
|
||||
echo " check-db - List databases"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo ""
|
||||
fi
|
||||
34
.gitattributes
vendored
Normal file
34
.gitattributes
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
# Set default behavior to automatically normalize line endings
|
||||
* text=auto eol=lf
|
||||
|
||||
# Explicitly declare text files you want to always be normalized and converted
|
||||
# to native line endings on checkout
|
||||
*.ts text eol=lf
|
||||
*.tsx text eol=lf
|
||||
*.js text eol=lf
|
||||
*.jsx text eol=lf
|
||||
*.json text eol=lf
|
||||
*.md text eol=lf
|
||||
*.yml text eol=lf
|
||||
*.yaml text eol=lf
|
||||
*.toml text eol=lf
|
||||
*.css text eol=lf
|
||||
*.scss text eol=lf
|
||||
*.sh text eol=lf
|
||||
*.bash text eol=lf
|
||||
Dockerfile* text eol=lf
|
||||
.dockerignore text eol=lf
|
||||
.gitignore text eol=lf
|
||||
.gitattributes text eol=lf
|
||||
|
||||
# Denote all files that are truly binary and should not be modified
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.jpeg binary
|
||||
*.gif binary
|
||||
*.ico binary
|
||||
*.woff binary
|
||||
*.woff2 binary
|
||||
*.ttf binary
|
||||
*.eot binary
|
||||
*.pdf binary
|
||||
3
.github/workflows/i18n.yml
vendored
3
.github/workflows/i18n.yml
vendored
@@ -3,10 +3,9 @@ name: 'Auto-translate Documentation'
|
||||
on:
|
||||
push:
|
||||
branches: [ staging ]
|
||||
paths:
|
||||
paths:
|
||||
- 'apps/docs/content/docs/en/**'
|
||||
- 'apps/docs/i18n.json'
|
||||
workflow_dispatch: # Allow manual triggers
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
2
.github/workflows/publish-ts-sdk.yml
vendored
2
.github/workflows/publish-ts-sdk.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
- name: Setup Node.js for npm publishing
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: '22'
|
||||
registry-url: 'https://registry.npmjs.org/'
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
250
apps/docs/content/docs/de/blocks/guardrails.mdx
Normal file
250
apps/docs/content/docs/de/blocks/guardrails.mdx
Normal file
@@ -0,0 +1,250 @@
|
||||
---
|
||||
title: Guardrails
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Der Guardrails-Block validiert und schützt Ihre KI-Workflows, indem er Inhalte anhand mehrerer Validierungstypen überprüft. Stellen Sie die Datenqualität sicher, verhindern Sie Halluzinationen, erkennen Sie personenbezogene Daten und erzwingen Sie Formatanforderungen, bevor Inhalte durch Ihren Workflow fließen.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/guardrails.png"
|
||||
alt="Guardrails Block"
|
||||
width={500}
|
||||
height={350}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Übersicht
|
||||
|
||||
Mit dem Guardrails-Block können Sie:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>JSON-Struktur validieren</strong>: Stellen Sie sicher, dass LLM-Ausgaben gültiges JSON sind, bevor sie geparst werden
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Regex-Muster abgleichen</strong>: Überprüfen Sie, ob Inhalte bestimmten Formaten entsprechen (E-Mails, Telefonnummern, URLs usw.)
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Halluzinationen erkennen</strong>: Nutzen Sie RAG + LLM-Scoring, um KI-Ausgaben anhand von Wissensdatenbankinhalten zu validieren
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>PII erkennen</strong>: Identifizieren und optional maskieren Sie personenbezogene Daten über mehr als 40 Entitätstypen hinweg
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Validierungstypen
|
||||
|
||||
### JSON-Validierung
|
||||
|
||||
Überprüft, ob Inhalte korrekt formatiertes JSON sind. Perfekt, um sicherzustellen, dass strukturierte LLM-Ausgaben sicher geparst werden können.
|
||||
|
||||
**Anwendungsfälle:**
|
||||
- Validieren von JSON-Antworten aus Agent-Blöcken vor dem Parsen
|
||||
- Sicherstellen, dass API-Payloads korrekt formatiert sind
|
||||
- Überprüfen der Integrität strukturierter Daten
|
||||
|
||||
**Output:**
|
||||
- `passed`: `true` wenn gültiges JSON, sonst `false`
|
||||
- `error`: Fehlermeldung bei fehlgeschlagener Validierung (z.B. "Invalid JSON: Unexpected token...")
|
||||
|
||||
### Regex-Validierung
|
||||
|
||||
Überprüft, ob Inhalte einem bestimmten regulären Ausdrucksmuster entsprechen.
|
||||
|
||||
**Anwendungsfälle:**
|
||||
- Validieren von E-Mail-Adressen
|
||||
- Überprüfen von Telefonnummernformaten
|
||||
- Verifizieren von URLs oder benutzerdefinierten Kennungen
|
||||
- Durchsetzen spezifischer Textmuster
|
||||
|
||||
**Konfiguration:**
|
||||
- **Regex-Muster**: Der reguläre Ausdruck, der abgeglichen werden soll (z.B. `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$` für E-Mails)
|
||||
|
||||
**Output:**
|
||||
- `passed`: `true` wenn der Inhalt dem Muster entspricht, `false` andernfalls
|
||||
- `error`: Fehlermeldung bei fehlgeschlagener Validierung
|
||||
|
||||
### Halluzinationserkennung
|
||||
|
||||
Verwendet Retrieval-Augmented Generation (RAG) mit LLM-Bewertung, um zu erkennen, wann KI-generierte Inhalte im Widerspruch zu Ihrer Wissensdatenbank stehen oder nicht darin begründet sind.
|
||||
|
||||
**Funktionsweise:**
|
||||
1. Durchsucht Ihre Wissensdatenbank nach relevantem Kontext
|
||||
2. Sendet sowohl die KI-Ausgabe als auch den abgerufenen Kontext an ein LLM
|
||||
3. LLM weist einen Konfidenzwert zu (Skala 0-10)
|
||||
- **0** = Vollständige Halluzination (völlig unbegründet)
|
||||
- **10** = Vollständig fundiert (komplett durch Wissensdatenbank gestützt)
|
||||
4. Validierung besteht, wenn der Wert ≥ Schwellenwert (Standard: 3)
|
||||
|
||||
**Konfiguration:**
|
||||
- **Wissensdatenbank**: Auswahl aus Ihren vorhandenen Wissensdatenbanken
|
||||
- **Modell**: LLM für die Bewertung wählen (erfordert starkes Reasoning - GPT-4o, Claude 3.7 Sonnet empfohlen)
|
||||
- **API-Schlüssel**: Authentifizierung für den ausgewählten LLM-Anbieter (automatisch ausgeblendet für gehostete/Ollama-Modelle)
|
||||
- **Konfidenz-Schwellenwert**: Mindestwert zum Bestehen (0-10, Standard: 3)
|
||||
- **Top K** (Erweitert): Anzahl der abzurufenden Wissensdatenbank-Chunks (Standard: 10)
|
||||
|
||||
**Output:**
|
||||
- `passed`: `true` wenn Konfidenzwert ≥ Schwellenwert
|
||||
- `score`: Konfidenzwert (0-10)
|
||||
- `reasoning`: Erklärung des LLM für den Wert
|
||||
- `error`: Fehlermeldung bei fehlgeschlagener Validierung
|
||||
|
||||
**Anwendungsfälle:**
|
||||
- Validierung von Agent-Antworten anhand der Dokumentation
|
||||
- Sicherstellen, dass Kundenservice-Antworten sachlich korrekt sind
|
||||
- Überprüfen, ob generierte Inhalte mit dem Quellmaterial übereinstimmen
|
||||
- Qualitätskontrolle für RAG-Anwendungen
|
||||
|
||||
### PII-Erkennung
|
||||
|
||||
Erkennt personenbezogene Daten mit Microsoft Presidio. Unterstützt über 40 Entitätstypen in mehreren Ländern und Sprachen.
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="guardrails.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Funktionsweise:**
|
||||
1. Scannt Inhalte nach PII-Entitäten mittels Mustererkennung und NLP
|
||||
2. Gibt erkannte Entitäten mit Positionen und Konfidenzwerten zurück
|
||||
3. Maskiert optional erkannte PII in der Ausgabe
|
||||
|
||||
**Konfiguration:**
|
||||
- **Zu erkennende PII-Typen**: Auswahl aus gruppierten Kategorien über Modal-Selektor
|
||||
- **Allgemein**: Personenname, E-Mail, Telefon, Kreditkarte, IP-Adresse usw.
|
||||
- **USA**: SSN, Führerschein, Reisepass usw.
|
||||
- **UK**: NHS-Nummer, Sozialversicherungsnummer
|
||||
- **Spanien**: NIF, NIE, CIF
|
||||
- **Italien**: Steuernummer, Führerschein, Umsatzsteuer-ID
|
||||
- **Polen**: PESEL, NIP, REGON
|
||||
- **Singapur**: NRIC/FIN, UEN
|
||||
- **Australien**: ABN, ACN, TFN, Medicare
|
||||
- **Indien**: Aadhaar, PAN, Reisepass, Wählernummer
|
||||
- **Modus**:
|
||||
- **Erkennen**: Nur PII identifizieren (Standard)
|
||||
- **Maskieren**: Erkannte PII durch maskierte Werte ersetzen
|
||||
- **Sprache**: Erkennungssprache (Standard: Englisch)
|
||||
|
||||
**Ausgabe:**
|
||||
- `passed`: `false` wenn ausgewählte PII-Typen erkannt werden
|
||||
- `detectedEntities`: Array erkannter PII mit Typ, Position und Konfidenz
|
||||
- `maskedText`: Inhalt mit maskierter PII (nur wenn Modus = "Mask")
|
||||
- `error`: Fehlermeldung, wenn die Validierung fehlschlägt
|
||||
|
||||
**Anwendungsfälle:**
|
||||
- Blockieren von Inhalten mit sensiblen persönlichen Informationen
|
||||
- Maskieren von PII vor der Protokollierung oder Speicherung von Daten
|
||||
- Einhaltung von DSGVO, HIPAA und anderen Datenschutzbestimmungen
|
||||
- Bereinigung von Benutzereingaben vor der Verarbeitung
|
||||
|
||||
## Konfiguration
|
||||
|
||||
### Zu validierender Inhalt
|
||||
|
||||
Der zu validierende Eingabeinhalt. Dieser stammt typischerweise aus:
|
||||
- Ausgaben von Agent-Blöcken: `<agent.content>`
|
||||
- Ergebnisse von Funktionsblöcken: `<function.output>`
|
||||
- API-Antworten: `<api.output>`
|
||||
- Jede andere Blockausgabe
|
||||
|
||||
### Validierungstyp
|
||||
|
||||
Wählen Sie aus vier Validierungstypen:
|
||||
- **Gültiges JSON**: Prüfen, ob der Inhalt korrekt formatiertes JSON ist
|
||||
- **Regex-Übereinstimmung**: Überprüfen, ob der Inhalt einem Regex-Muster entspricht
|
||||
- **Halluzinationsprüfung**: Validierung gegen Wissensdatenbank mit LLM-Bewertung
|
||||
- **PII-Erkennung**: Erkennung und optional Maskierung personenbezogener Daten
|
||||
|
||||
## Ausgaben
|
||||
|
||||
Alle Validierungstypen liefern zurück:
|
||||
|
||||
- **`<guardrails.passed>`**: Boolean, der angibt, ob die Validierung erfolgreich war
|
||||
- **`<guardrails.validationType>`**: Die Art der durchgeführten Validierung
|
||||
- **`<guardrails.input>`**: Die ursprüngliche Eingabe, die validiert wurde
|
||||
- **`<guardrails.error>`**: Fehlermeldung, wenn die Validierung fehlgeschlagen ist (optional)
|
||||
|
||||
Zusätzliche Ausgaben nach Typ:
|
||||
|
||||
**Halluzinationsprüfung:**
|
||||
- **`<guardrails.score>`**: Konfidenzwert (0-10)
|
||||
- **`<guardrails.reasoning>`**: Erklärung des LLM
|
||||
|
||||
**PII-Erkennung:**
|
||||
- **`<guardrails.detectedEntities>`**: Array erkannter PII-Entitäten
|
||||
- **`<guardrails.maskedText>`**: Inhalt mit maskierter PII (wenn Modus = "Mask")
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### JSON vor dem Parsen validieren
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Sicherstellen, dass die Agent-Ausgabe gültiges JSON ist</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent generiert strukturierte JSON-Antwort</li>
|
||||
<li>Guardrails validiert das JSON-Format</li>
|
||||
<li>Bedingungsblock prüft `<guardrails.passed>`</li>
|
||||
<li>Bei Erfolg → Daten parsen und verwenden, Bei Fehler → Wiederholen oder Fehler behandeln</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Halluzinationen verhindern
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Validierung von Kundendienstantworten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent generiert Antwort auf Kundenfrage</li>
|
||||
<li>Guardrails prüft gegen die Wissensdatenbank der Support-Dokumentation</li>
|
||||
<li>Wenn Konfidenzwert ≥ 3 → Antwort senden</li>
|
||||
<li>Wenn Konfidenzwert \< 3 → Für manuelle Überprüfung markieren</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### PII in Benutzereingaben blockieren
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Bereinigung von benutzergenerierten Inhalten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Benutzer reicht Formular mit Textinhalt ein</li>
|
||||
<li>Guardrails erkennt PII (E-Mails, Telefonnummern, Sozialversicherungsnummern usw.)</li>
|
||||
<li>Bei erkannter PII → Einreichung ablehnen oder sensible Daten maskieren</li>
|
||||
<li>Ohne PII → Normal verarbeiten</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="guardrails-example.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
### E-Mail-Format validieren
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: E-Mail-Adressformat überprüfen</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent extrahiert E-Mail aus Text</li>
|
||||
<li>Guardrails validiert mit Regex-Muster</li>
|
||||
<li>Bei Gültigkeit → E-Mail für Benachrichtigung verwenden</li>
|
||||
<li>Bei Ungültigkeit → Korrektur anfordern</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Verkettung mit Condition-Blöcken**: Verwende `<guardrails.passed>` um Workflow-Logik basierend auf Validierungsergebnissen zu verzweigen
|
||||
- **JSON-Validierung vor dem Parsen verwenden**: Validiere immer die JSON-Struktur, bevor du versuchst, LLM-Ausgaben zu parsen
|
||||
- **Passende PII-Typen auswählen**: Wähle nur die PII-Entitätstypen aus, die für deinen Anwendungsfall relevant sind, um bessere Leistung zu erzielen
|
||||
- **Vernünftige Konfidenz-Schwellenwerte festlegen**: Passe für die Halluzinationserkennung den Schwellenwert basierend auf deinen Genauigkeitsanforderungen an (höher = strenger)
|
||||
- **Starke Modelle für Halluzinationserkennung verwenden**: GPT-4o oder Claude 3.7 Sonnet bieten genauere Konfidenz-Bewertungen
|
||||
- **PII für Logging maskieren**: Verwende den "Mask"-Modus, wenn du Inhalte protokollieren oder speichern musst, die PII enthalten könnten
|
||||
- **Regex-Muster testen**: Validiere deine Regex-Muster gründlich, bevor du sie in der Produktion einsetzt
|
||||
- **Validierungsfehler überwachen**: Verfolge `<guardrails.error>` Nachrichten, um häufige Validierungsprobleme zu identifizieren
|
||||
|
||||
<Callout type="info">
|
||||
Guardrails-Validierung erfolgt synchron in deinem Workflow. Für die Halluzinationserkennung solltest du schnellere Modelle (wie GPT-4o-mini) wählen, wenn Latenz kritisch ist.
|
||||
</Callout>
|
||||
@@ -535,7 +535,7 @@ app.post('/sim-webhook', (req, res) => {
|
||||
// Handle error...
|
||||
} else {
|
||||
console.log(`Workflow ${workflowId} completed: ${executionId}`);
|
||||
console.log(`Cost: ${cost.total}`);
|
||||
console.log(`Cost: $${cost.total}`);
|
||||
// Process successful execution...
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -183,4 +183,39 @@ Verschiedene Abonnementpläne haben unterschiedliche Nutzungslimits:
|
||||
- Überprüfen Sie Ihre aktuelle Nutzung unter [Einstellungen → Abonnement](https://sim.ai/settings/subscription)
|
||||
- Erfahren Sie mehr über [Logging](/execution/logging), um Ausführungsdetails zu verfolgen
|
||||
- Erkunden Sie die [Externe API](/execution/api) für programmatische Kostenüberwachung
|
||||
- Sehen Sie sich [Workflow-Optimierungstechniken](/blocks) an, um Kosten zu reduzieren
|
||||
- Sehen Sie sich [Workflow-Optimierungstechniken](/blocks) an, um Kosten zu reduzieren
|
||||
|
||||
**Team-Plan (40 $/Sitz/Monat):**
|
||||
- Gemeinsame Nutzung für alle Teammitglieder
|
||||
- Überschreitung wird anhand der Gesamtnutzung des Teams berechnet
|
||||
- Organisationsinhaber erhält eine Rechnung
|
||||
|
||||
**Enterprise-Pläne:**
|
||||
- Fester monatlicher Preis, keine Überschreitungen
|
||||
- Benutzerdefinierte Nutzungslimits gemäß Vereinbarung
|
||||
|
||||
### Schwellenwertabrechnung
|
||||
|
||||
Wenn die nicht abgerechnete Überschreitung 50 $ erreicht, berechnet Sim automatisch den gesamten nicht abgerechneten Betrag.
|
||||
|
||||
**Beispiel:**
|
||||
- Tag 10: 70 $ Überschreitung → Sofortige Abrechnung von 70 $
|
||||
- Tag 15: Zusätzliche Nutzung von 35 $ (insgesamt 105 $) → Bereits abgerechnet, keine Aktion
|
||||
- Tag 20: Weitere Nutzung von 50 $ (insgesamt 155 $, 85 $ nicht abgerechnet) → Sofortige Abrechnung von 85 $
|
||||
|
||||
Dies verteilt hohe Überschreitungsgebühren über den Monat, anstatt eine große Rechnung am Ende des Abrechnungszeitraums zu stellen.
|
||||
|
||||
## Best Practices für Kostenmanagement
|
||||
|
||||
1. **Regelmäßige Überwachung**: Überprüfen Sie Ihr Nutzungs-Dashboard häufig, um Überraschungen zu vermeiden
|
||||
2. **Budgets festlegen**: Nutzen Sie Planlimits als Leitplanken für Ihre Ausgaben
|
||||
3. **Workflows optimieren**: Überprüfen Sie kostenintensive Ausführungen und optimieren Sie Prompts oder Modellauswahl
|
||||
4. **Geeignete Modelle verwenden**: Passen Sie die Modellkomplexität an die Aufgabenanforderungen an
|
||||
5. **Ähnliche Aufgaben bündeln**: Kombinieren Sie wenn möglich mehrere Anfragen, um den Overhead zu reduzieren
|
||||
|
||||
## Nächste Schritte
|
||||
|
||||
- Überprüfen Sie Ihre aktuelle Nutzung unter [Einstellungen → Abonnement](https://sim.ai/settings/subscription)
|
||||
- Erfahren Sie mehr über [Protokollierung](/execution/logging), um Ausführungsdetails zu verfolgen
|
||||
- Erkunden Sie die [externe API](/execution/api) für programmatische Kostenüberwachung
|
||||
- Sehen Sie sich [Workflow-Optimierungstechniken](/blocks) zur Kostenreduzierung an
|
||||
@@ -81,7 +81,7 @@ new SimStudioClient(config: SimStudioConfig)
|
||||
|
||||
##### executeWorkflow()
|
||||
|
||||
Führen Sie einen Workflow mit optionalen Eingabedaten aus.
|
||||
Führt einen Workflow mit optionalen Eingabedaten aus.
|
||||
|
||||
```typescript
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
@@ -99,7 +99,7 @@ const result = await client.executeWorkflow('workflow-id', {
|
||||
- `selectedOutputs` (string[]): Block-Ausgaben, die im `blockName.attribute`Format gestreamt werden sollen (z.B. `["agent1.content"]`)
|
||||
- `async` (boolean): Asynchron ausführen (Standard: false)
|
||||
|
||||
**Rückgabe:** `Promise<WorkflowExecutionResult | AsyncExecutionResult>`
|
||||
**Rückgabewert:** `Promise<WorkflowExecutionResult | AsyncExecutionResult>`
|
||||
|
||||
Wenn `async: true`, wird sofort mit einer Task-ID zum Abfragen zurückgegeben. Andernfalls wird auf den Abschluss gewartet.
|
||||
|
||||
@@ -115,7 +115,7 @@ console.log('Is deployed:', status.isDeployed);
|
||||
**Parameter:**
|
||||
- `workflowId` (string): Die ID des Workflows
|
||||
|
||||
**Rückgabe:** `Promise<WorkflowStatus>`
|
||||
**Rückgabewert:** `Promise<WorkflowStatus>`
|
||||
|
||||
##### validateWorkflow()
|
||||
|
||||
@@ -131,7 +131,7 @@ if (isReady) {
|
||||
**Parameter:**
|
||||
- `workflowId` (string): Die ID des Workflows
|
||||
|
||||
**Rückgabe:** `Promise<boolean>`
|
||||
**Rückgabewert:** `Promise<boolean>`
|
||||
|
||||
##### getJobStatus()
|
||||
|
||||
@@ -148,7 +148,7 @@ if (status.status === 'completed') {
|
||||
**Parameter:**
|
||||
- `taskId` (string): Die Task-ID, die von der asynchronen Ausführung zurückgegeben wurde
|
||||
|
||||
**Rückgabe:** `Promise<JobStatus>`
|
||||
**Rückgabewert:** `Promise<JobStatus>`
|
||||
|
||||
**Antwortfelder:**
|
||||
- `success` (boolean): Ob die Anfrage erfolgreich war
|
||||
@@ -161,7 +161,7 @@ if (status.status === 'completed') {
|
||||
|
||||
##### executeWithRetry()
|
||||
|
||||
Führt einen Workflow mit automatischer Wiederholung bei Ratenlimitfehlern unter Verwendung von exponentiellem Backoff aus.
|
||||
Einen Workflow mit automatischer Wiederholung bei Rate-Limit-Fehlern unter Verwendung von exponentiellem Backoff ausführen.
|
||||
|
||||
```typescript
|
||||
const result = await client.executeWithRetry('workflow-id', {
|
||||
@@ -184,13 +184,13 @@ const result = await client.executeWithRetry('workflow-id', {
|
||||
- `maxDelay` (number): Maximale Verzögerung in ms (Standard: 30000)
|
||||
- `backoffMultiplier` (number): Backoff-Multiplikator (Standard: 2)
|
||||
|
||||
**Rückgabewert:** `Promise<WorkflowExecutionResult | AsyncExecutionResult>`
|
||||
**Rückgabe:** `Promise<WorkflowExecutionResult | AsyncExecutionResult>`
|
||||
|
||||
Die Wiederholungslogik verwendet exponentiellen Backoff (1s → 2s → 4s → 8s...) mit ±25% Jitter, um den Thundering-Herd-Effekt zu vermeiden. Wenn die API einen `retry-after`Header bereitstellt, wird dieser stattdessen verwendet.
|
||||
Die Wiederholungslogik verwendet exponentielles Backoff (1s → 2s → 4s → 8s...) mit ±25% Jitter, um den Thundering-Herd-Effekt zu vermeiden. Wenn die API einen `retry-after` Header bereitstellt, wird dieser stattdessen verwendet.
|
||||
|
||||
##### getRateLimitInfo()
|
||||
|
||||
Ruft die aktuellen Ratenlimit-Informationen aus der letzten API-Antwort ab.
|
||||
Ruft die aktuellen Rate-Limit-Informationen aus der letzten API-Antwort ab.
|
||||
|
||||
```typescript
|
||||
const rateLimitInfo = client.getRateLimitInfo();
|
||||
@@ -201,7 +201,7 @@ if (rateLimitInfo) {
|
||||
}
|
||||
```
|
||||
|
||||
**Rückgabewert:** `RateLimitInfo | null`
|
||||
**Rückgabe:** `RateLimitInfo | null`
|
||||
|
||||
##### getUsageLimits()
|
||||
|
||||
@@ -215,7 +215,7 @@ console.log('Current period cost:', limits.usage.currentPeriodCost);
|
||||
console.log('Plan:', limits.usage.plan);
|
||||
```
|
||||
|
||||
**Rückgabewert:** `Promise<UsageLimits>`
|
||||
**Rückgabe:** `Promise<UsageLimits>`
|
||||
|
||||
**Antwortstruktur:**
|
||||
|
||||
@@ -357,8 +357,8 @@ class SimStudioError extends Error {
|
||||
**Häufige Fehlercodes:**
|
||||
- `UNAUTHORIZED`: Ungültiger API-Schlüssel
|
||||
- `TIMEOUT`: Zeitüberschreitung der Anfrage
|
||||
- `RATE_LIMIT_EXCEEDED`: Ratengrenze überschritten
|
||||
- `USAGE_LIMIT_EXCEEDED`: Nutzungsgrenze überschritten
|
||||
- `RATE_LIMIT_EXCEEDED`: Rate-Limit überschritten
|
||||
- `USAGE_LIMIT_EXCEEDED`: Nutzungslimit überschritten
|
||||
- `EXECUTION_ERROR`: Workflow-Ausführung fehlgeschlagen
|
||||
|
||||
## Beispiele
|
||||
@@ -604,26 +604,105 @@ async function executeClientSideWorkflow() {
|
||||
});
|
||||
|
||||
console.log('Workflow result:', result);
|
||||
|
||||
|
||||
// Update UI with result
|
||||
document.getElementById('result')!.textContent =
|
||||
document.getElementById('result')!.textContent =
|
||||
JSON.stringify(result.output, null, 2);
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Attach to button click
|
||||
document.getElementById('executeBtn')?.addEventListener('click', executeClientSideWorkflow);
|
||||
```
|
||||
|
||||
### Datei-Upload
|
||||
|
||||
Datei-Objekte werden automatisch erkannt und in das Base64-Format konvertiert. Fügen Sie sie in Ihrem Input unter dem Feldnamen ein, der dem API-Trigger-Inputformat Ihres Workflows entspricht.
|
||||
|
||||
Das SDK konvertiert Datei-Objekte in dieses Format:
|
||||
|
||||
```typescript
|
||||
{
|
||||
type: 'file',
|
||||
data: 'data:mime/type;base64,base64data',
|
||||
name: 'filename',
|
||||
mime: 'mime/type'
|
||||
}
|
||||
```
|
||||
|
||||
Alternativ können Sie Dateien manuell im URL-Format bereitstellen:
|
||||
|
||||
```typescript
|
||||
{
|
||||
type: 'url',
|
||||
data: 'https://example.com/file.pdf',
|
||||
name: 'file.pdf',
|
||||
mime: 'application/pdf'
|
||||
}
|
||||
```
|
||||
|
||||
<Tabs items={['Browser', 'Node.js']}>
|
||||
<Tab value="Browser">
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
|
||||
const client = new SimStudioClient({
|
||||
apiKey: process.env.NEXT_PUBLIC_SIM_API_KEY!
|
||||
});
|
||||
|
||||
// From file input
|
||||
async function handleFileUpload(event: Event) {
|
||||
const input = event.target as HTMLInputElement;
|
||||
const files = Array.from(input.files || []);
|
||||
|
||||
// Include files under the field name from your API trigger's input format
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
input: {
|
||||
documents: files, // Must match your workflow's "files" field name
|
||||
instructions: 'Analyze these documents'
|
||||
}
|
||||
});
|
||||
|
||||
console.log('Result:', result);
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="Node.js">
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
import fs from 'fs';
|
||||
|
||||
const client = new SimStudioClient({
|
||||
apiKey: process.env.SIM_API_KEY!
|
||||
});
|
||||
|
||||
// Read file and create File object
|
||||
const fileBuffer = fs.readFileSync('./document.pdf');
|
||||
const file = new File([fileBuffer], 'document.pdf', {
|
||||
type: 'application/pdf'
|
||||
});
|
||||
|
||||
// Include files under the field name from your API trigger's input format
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
input: {
|
||||
documents: [file], // Must match your workflow's "files" field name
|
||||
query: 'Summarize this document'
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Callout type="warning">
|
||||
Bei der Verwendung des SDK im Browser sollten Sie darauf achten, keine sensiblen API-Schlüssel offenzulegen. Erwägen Sie die Verwendung eines Backend-Proxys oder öffentlicher API-Schlüssel mit eingeschränkten Berechtigungen.
|
||||
</Callout>
|
||||
|
||||
### React Hook-Beispiel
|
||||
### React Hook Beispiel
|
||||
|
||||
Erstellen eines benutzerdefinierten React-Hooks für die Workflow-Ausführung:
|
||||
Erstellen Sie einen benutzerdefinierten React-Hook für die Workflow-Ausführung:
|
||||
|
||||
```typescript
|
||||
import { useState, useCallback } from 'react';
|
||||
@@ -815,11 +894,27 @@ async function checkUsage() {
|
||||
console.log(' Is limited:', limits.rateLimit.async.isLimited);
|
||||
|
||||
console.log('\n=== Usage ===');
|
||||
console.log('Current period cost:
|
||||
console.log('Current period cost: $' + limits.usage.currentPeriodCost.toFixed(2));
|
||||
console.log('Limit: $' + limits.usage.limit.toFixed(2));
|
||||
console.log('Plan:', limits.usage.plan);
|
||||
|
||||
### Streaming Workflow Execution
|
||||
const percentUsed = (limits.usage.currentPeriodCost / limits.usage.limit) * 100;
|
||||
console.log('Usage: ' + percentUsed.toFixed(1) + '%');
|
||||
|
||||
Execute workflows with real-time streaming responses:
|
||||
if (percentUsed > 80) {
|
||||
console.warn('⚠️ Warning: You are approaching your usage limit!');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error checking usage:', error);
|
||||
}
|
||||
}
|
||||
|
||||
checkUsage();
|
||||
```
|
||||
|
||||
### Streaming-Workflow-Ausführung
|
||||
|
||||
Führen Sie Workflows mit Echtzeit-Streaming-Antworten aus:
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
@@ -830,33 +925,33 @@ const client = new SimStudioClient({
|
||||
|
||||
async function executeWithStreaming() {
|
||||
try {
|
||||
// Streaming für bestimmte Block-Ausgaben aktivieren
|
||||
// Enable streaming for specific block outputs
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
input: { message: 'Count to five' },
|
||||
stream: true,
|
||||
selectedOutputs: ['agent1.content'] // Format blockName.attribute verwenden
|
||||
selectedOutputs: ['agent1.content'] // Use blockName.attribute format
|
||||
});
|
||||
|
||||
console.log('Workflow-Ergebnis:', result);
|
||||
console.log('Workflow result:', result);
|
||||
} catch (error) {
|
||||
console.error('Fehler:', error);
|
||||
console.error('Error:', error);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The streaming response follows the Server-Sent Events (SSE) format:
|
||||
Die Streaming-Antwort folgt dem Server-Sent Events (SSE) Format:
|
||||
|
||||
```
|
||||
data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":"One"}
|
||||
|
||||
data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":", zwei"}
|
||||
data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":", two"}
|
||||
|
||||
data: {"event":"done","success":true,"output":{},"metadata":{"duration":610}}
|
||||
|
||||
data: [DONE]
|
||||
```
|
||||
|
||||
**React Streaming Example:**
|
||||
**React Streaming Beispiel:**
|
||||
|
||||
```typescript
|
||||
import { useState, useEffect } from 'react';
|
||||
@@ -869,13 +964,13 @@ function StreamingWorkflow() {
|
||||
setLoading(true);
|
||||
setOutput('');
|
||||
|
||||
// WICHTIG: Führen Sie diesen API-Aufruf von Ihrem Backend-Server aus, nicht vom Browser
|
||||
// Setzen Sie niemals Ihren API-Schlüssel im Client-seitigen Code frei
|
||||
// IMPORTANT: Make this API call from your backend server, not the browser
|
||||
// Never expose your API key in client-side code
|
||||
const response = await fetch('https://sim.ai/api/workflows/WORKFLOW_ID/execute', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-API-Key': process.env.SIM_API_KEY! // Nur serverseitige Umgebungsvariable
|
||||
'X-API-Key': process.env.SIM_API_KEY! // Server-side environment variable only
|
||||
},
|
||||
body: JSON.stringify({
|
||||
message: 'Generate a story',
|
||||
@@ -907,10 +1002,10 @@ function StreamingWorkflow() {
|
||||
if (parsed.chunk) {
|
||||
setOutput(prev => prev + parsed.chunk);
|
||||
} else if (parsed.event === 'done') {
|
||||
console.log('Ausführung abgeschlossen:', parsed.metadata);
|
||||
console.log('Execution complete:', parsed.metadata);
|
||||
}
|
||||
} catch (e) {
|
||||
// Ungültiges JSON überspringen
|
||||
// Skip invalid JSON
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -920,7 +1015,7 @@ function StreamingWorkflow() {
|
||||
return (
|
||||
<div>
|
||||
<button onClick={executeStreaming} disabled={loading}>
|
||||
{loading ? 'Generiere...' : 'Streaming starten'}
|
||||
{loading ? 'Generating...' : 'Start Streaming'}
|
||||
</button>
|
||||
<div style={{ whiteSpace: 'pre-wrap' }}>{output}</div>
|
||||
</div>
|
||||
@@ -928,63 +1023,35 @@ function StreamingWorkflow() {
|
||||
}
|
||||
```
|
||||
|
||||
## Getting Your API Key
|
||||
## API-Schlüssel erhalten
|
||||
|
||||
<Steps>
|
||||
<Step title="Log in to Sim">
|
||||
Navigate to [Sim](https://sim.ai) and log in to your account.
|
||||
<Step title="Bei Sim anmelden">
|
||||
Navigieren Sie zu [Sim](https://sim.ai) und melden Sie sich bei Ihrem Konto an.
|
||||
</Step>
|
||||
<Step title="Open your workflow">
|
||||
Navigate to the workflow you want to execute programmatically.
|
||||
<Step title="Öffnen Sie Ihren Workflow">
|
||||
Navigieren Sie zu dem Workflow, den Sie programmatisch ausführen möchten.
|
||||
</Step>
|
||||
<Step title="Deploy your workflow">
|
||||
Click on "Deploy" to deploy your workflow if it hasn't been deployed yet.
|
||||
<Step title="Deployen Sie Ihren Workflow">
|
||||
Klicken Sie auf "Deploy", um Ihren Workflow zu deployen, falls dies noch nicht geschehen ist.
|
||||
</Step>
|
||||
<Step title="Create or select an API key">
|
||||
During the deployment process, select or create an API key.
|
||||
<Step title="API-Schlüssel erstellen oder auswählen">
|
||||
Wählen Sie während des Deployment-Prozesses einen API-Schlüssel aus oder erstellen Sie einen neuen.
|
||||
</Step>
|
||||
<Step title="Copy the API key">
|
||||
Copy the API key to use in your TypeScript/JavaScript application.
|
||||
<Step title="API-Schlüssel kopieren">
|
||||
Kopieren Sie den API-Schlüssel zur Verwendung in Ihrer TypeScript/JavaScript-Anwendung.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Callout type="warning">
|
||||
Keep your API key secure and never commit it to version control. Use environment variables or secure configuration management.
|
||||
Halten Sie Ihren API-Schlüssel sicher und committen Sie ihn niemals in die Versionskontrolle. Verwenden Sie Umgebungsvariablen oder sicheres Konfigurationsmanagement.
|
||||
</Callout>
|
||||
|
||||
## Requirements
|
||||
## Anforderungen
|
||||
|
||||
- Node.js 16+
|
||||
- TypeScript 5.0+ (for TypeScript projects)
|
||||
- TypeScript 5.0+ (für TypeScript-Projekte)
|
||||
|
||||
## TypeScript Support
|
||||
|
||||
The SDK is written in TypeScript and provides full type safety:
|
||||
|
||||
```typescript
|
||||
import {
|
||||
SimStudioClient,
|
||||
WorkflowExecutionResult,
|
||||
WorkflowStatus,
|
||||
SimStudioError
|
||||
} from 'simstudio-ts-sdk';
|
||||
|
||||
// Typsichere Client-Initialisierung
|
||||
const client: SimStudioClient = new SimStudioClient({
|
||||
apiKey: process.env.SIM_API_KEY!
|
||||
});
|
||||
|
||||
// Typsichere Workflow-Ausführung
|
||||
const result: WorkflowExecutionResult = await client.executeWorkflow('workflow-id', {
|
||||
input: {
|
||||
message: 'Hello, TypeScript!'
|
||||
}
|
||||
});
|
||||
|
||||
// Typsichere Statusprüfung
|
||||
const status: WorkflowStatus = await client.getWorkflowStatus('workflow-id');
|
||||
```
|
||||
|
||||
## License
|
||||
## Lizenz
|
||||
|
||||
Apache-2.0
|
||||
226
apps/docs/content/docs/de/tools/clay.mdx
Normal file
226
apps/docs/content/docs/de/tools/clay.mdx
Normal file
@@ -0,0 +1,226 @@
|
||||
---
|
||||
title: Clay
|
||||
description: Populate Clay workbook
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="clay"
|
||||
color="#E0E0E0"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'>
|
||||
<path
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
fill='#41B9FD'
|
||||
d=' M225.000000,1.000000 C227.042313,1.000000 229.084641,1.000000 231.903046,1.237045
|
||||
C233.981308,1.648251 235.283447,1.974177 236.585678,1.974532 C276.426849,1.985374 316.268005,1.964254 356.349304,2.036658
|
||||
C356.713806,2.242061 356.838165,2.358902 357.013062,2.696568 C357.361633,3.243123 357.659729,3.568854 358.029053,3.919451
|
||||
C358.100250,3.944317 358.064270,4.090822 358.043335,4.397895 C358.300018,5.454089 358.577637,6.203210 358.919647,7.420082
|
||||
C358.919891,27.877140 358.855774,47.866444 358.406097,67.910400 C355.200592,68.111740 352.380737,68.384270 349.560669,68.386124
|
||||
C311.434967,68.411194 273.308777,68.303810 235.184082,68.495499 C229.321579,68.524979 223.465759,69.888084 217.280884,70.633224
|
||||
C216.309952,70.742836 215.664993,70.853645 214.722351,70.824722 C211.834686,71.349052 209.244675,72.013123 206.377716,72.681381
|
||||
C205.743713,72.776283 205.386673,72.866997 204.740524,72.831818 C198.868668,74.719879 193.285919,76.733833 187.518951,78.776100
|
||||
C187.334747,78.804405 187.002716,78.975388 186.619080,78.955429 C183.339905,80.398605 180.444336,81.861732 177.450043,83.356339
|
||||
C177.351318,83.387817 177.199478,83.528885 176.863098,83.476791 C174.940445,84.544197 173.354172,85.663696 171.490601,86.873726
|
||||
C170.873749,87.151909 170.534180,87.339554 169.900208,87.480209 C169.065109,87.950676 168.524414,88.468132 167.772736,89.059799
|
||||
C167.561722,89.134003 167.180191,89.367592 166.874084,89.344360 C166.036011,89.874809 165.504074,90.428497 164.768677,91.071411
|
||||
C164.565247,91.160652 164.195068,91.406326 163.886719,91.361374 C162.847015,91.962418 162.115631,92.608421 161.328308,93.267891
|
||||
C161.272369,93.281357 161.208405,93.377022 160.867157,93.365463 C158.692642,94.907082 156.859375,96.460266 154.780716,98.176086
|
||||
C154.099411,98.731529 153.663513,99.124352 153.029877,99.558502 C152.562164,99.788048 152.505905,100.026695 152.411484,100.477333
|
||||
C151.745850,101.065102 151.332077,101.491318 150.666687,101.980057 C150.244827,102.329651 150.074554,102.616714 149.702332,103.025635
|
||||
C149.247330,103.342041 149.041901,103.578056 148.626404,103.921570 C148.191071,104.281303 148.013428,104.574989 147.660767,104.971512
|
||||
C147.485733,105.074348 147.185501,105.347694 146.854645,105.346924 C145.509140,106.645203 144.494507,107.944252 143.328308,109.398895
|
||||
C143.176773,109.554497 142.944397,109.921532 142.688324,109.990189 C142.263062,110.355179 142.093887,110.651512 141.672485,111.133896
|
||||
C140.733337,112.108200 140.046402,112.896461 139.056610,113.710732 C138.269180,114.554047 137.784592,115.371346 137.263580,116.208557
|
||||
C137.227158,116.228470 137.222885,116.311386 136.910522,116.418571 C134.917343,118.573212 133.067978,120.505791 131.581848,122.685951
|
||||
C117.236908,143.729858 109.909592,167.062012 108.797867,192.458298 C106.874710,236.390839 120.176277,274.069336 154.210175,303.200592
|
||||
C157.543198,306.053497 161.524918,308.148560 165.395065,310.715118 C165.584625,310.834839 166.004089,310.993286 166.112747,311.305908
|
||||
C169.421280,313.480804 172.621170,315.343109 176.067993,317.436401 C196.154831,328.754059 217.585236,333.047546 240.138840,332.968475
|
||||
C276.608368,332.840607 313.078613,332.912872 349.548553,332.932007 C352.369659,332.933472 355.190643,333.181519 358.042847,333.756317
|
||||
C358.105377,352.504913 358.140625,370.812134 358.166443,389.119385 C358.179047,398.047455 357.157593,399.080383 348.101379,399.081543
|
||||
C309.488556,399.086456 270.875702,399.088837 232.262939,399.034698 C229.118195,399.030304 225.976639,398.454163 222.828934,398.396088
|
||||
C219.876633,398.341614 216.918152,398.621979 213.655640,398.750488 C212.946808,398.674561 212.544739,398.603149 211.932861,398.249359
|
||||
C205.139450,396.920532 198.555878,395.874084 191.660583,394.785370 C190.959366,394.590973 190.569855,394.438812 189.976242,394.044556
|
||||
C188.751892,393.631897 187.731628,393.461365 186.520462,393.271667 C186.329559,393.252502 185.966660,393.127686 185.711517,392.875610
|
||||
C179.817810,390.901337 174.179230,389.179169 168.376038,387.422913 C168.211411,387.388824 167.919205,387.222443 167.713623,386.935791
|
||||
C163.177170,384.926636 158.846298,383.204132 154.354828,381.442505 C154.194229,381.403320 153.913010,381.229431 153.720596,380.940063
|
||||
C150.958603,379.507599 148.389023,378.364502 145.862350,377.112976 C145.905273,377.004486 145.834991,377.222992 145.696899,376.907410
|
||||
C143.278778,375.470276 140.998734,374.348724 138.546249,373.152405 C138.373810,373.077606 138.071228,372.854553 137.964508,372.539856
|
||||
C136.491272,371.591217 135.124771,370.957306 133.835419,370.230103 C133.912552,370.136810 133.731659,370.297668 133.638489,369.968719
|
||||
C130.257477,367.557678 126.969620,365.475616 123.676697,363.365906 C123.671616,363.338226 123.618034,363.355438 123.527176,363.037048
|
||||
C122.530983,362.219849 121.625641,361.721039 120.554291,361.141144 C120.388283,361.060028 120.099663,360.829254 120.012115,360.507904
|
||||
C116.854935,357.864441 113.785301,355.542328 110.448624,353.088013 C109.480820,352.261383 108.780060,351.566956 108.005241,350.545807
|
||||
C106.569366,349.183838 105.207550,348.148560 103.618164,346.953125 C102.887856,346.250793 102.385124,345.708649 101.851944,344.819275
|
||||
C99.227608,341.972198 96.633736,339.472412 93.829559,336.814728 C93.315529,336.231140 93.011803,335.805389 92.626633,335.113678
|
||||
C92.241318,334.653351 91.937447,334.458984 91.470352,334.116333 C91.113121,333.744141 90.954285,333.497589 90.815475,332.884094
|
||||
C89.432999,331.125000 88.065689,329.710205 86.750458,328.261658 C86.802551,328.227905 86.679573,328.244812 86.625587,328.004700
|
||||
C86.408173,327.453064 86.154968,327.258301 85.840820,327.092529 C85.869644,327.004852 85.792236,327.175934 85.788193,326.847412
|
||||
C85.086029,325.775726 84.387909,325.032593 83.748154,324.192444 C83.806519,324.095428 83.656967,324.265442 83.677109,323.924805
|
||||
C82.691200,322.493195 81.685143,321.402222 80.701370,320.271667 C80.723648,320.232025 80.638077,320.262756 80.664627,319.911865
|
||||
C79.348137,317.824493 78.005081,316.088074 76.632942,314.335297 C76.603851,314.318970 76.610863,314.252594 76.569603,314.015747
|
||||
C76.383919,313.466492 76.145622,313.265167 75.849998,313.133301 C75.886536,313.091675 75.786301,313.138794 75.787926,312.843567
|
||||
C75.413757,312.136780 75.037964,311.725281 74.650452,311.296570 C74.638725,311.279388 74.605232,311.254669 74.648026,310.925659
|
||||
C74.042847,309.802277 73.394867,309.007935 72.848984,308.101166 C72.951088,307.988739 72.736649,308.207153 72.749344,307.902405
|
||||
C72.247162,307.034119 71.732277,306.470612 71.116684,305.727478 C71.015976,305.547882 70.879890,305.159210 70.904739,304.782593
|
||||
C66.198082,293.805145 61.429871,283.220459 56.753250,272.595459 C54.901436,268.388306 53.253181,264.091522 51.402115,259.538025
|
||||
C51.225922,258.823547 51.159870,258.406525 51.280235,257.681335 C50.130058,252.530197 48.793461,247.687271 47.372990,242.549011
|
||||
C47.250717,241.846664 47.212318,241.439667 47.345688,240.702484 C46.854862,237.196991 46.192276,234.021698 45.439560,230.551788
|
||||
C45.308647,229.849213 45.267864,229.441223 45.399055,228.679535 C45.646000,226.680176 45.810993,225.032898 45.781715,223.389099
|
||||
C45.543224,209.998566 45.243523,196.609085 45.021889,183.218307 C44.965343,179.801880 45.121227,176.381912 45.183868,172.656006
|
||||
C45.260223,171.945328 45.332214,171.542252 45.692661,170.944855 C46.379547,167.156143 46.777977,163.561768 47.196243,159.658173
|
||||
C47.326954,158.952240 47.437832,158.555511 47.816860,157.951569 C48.405701,156.819183 48.802628,155.912750 49.035774,154.966003
|
||||
C53.321564,137.562775 58.709690,120.561356 67.075592,104.614586 C68.431061,102.030846 69.442665,99.266708 70.700943,96.329689
|
||||
C70.963600,95.758194 71.138519,95.442963 71.626465,95.023987 C72.881813,93.185463 73.824142,91.450684 74.833984,89.540924
|
||||
C74.901497,89.365936 75.115746,89.058022 75.414856,88.950439 C76.055374,88.124435 76.396790,87.406006 76.808441,86.516800
|
||||
C76.878685,86.346008 77.099190,86.049721 77.426208,85.968033 C78.773079,84.202591 79.792938,82.518845 80.906425,80.889481
|
||||
C81.000053,80.943871 80.811523,80.846413 81.112083,80.718071 C81.899254,79.675362 82.385872,78.760994 82.980141,77.647797
|
||||
C83.256111,77.193130 83.468399,76.981361 83.972061,76.695953 C84.379341,76.259384 84.539192,75.940521 84.777573,75.467239
|
||||
C84.856110,75.312813 85.091125,75.058212 85.387177,74.957954 C86.071411,74.171829 86.459602,73.485962 86.959831,72.547165
|
||||
C87.574921,71.763893 88.077972,71.233551 88.917511,70.614960 C90.438446,68.934166 91.622894,67.341637 92.892502,65.577087
|
||||
C92.977646,65.405067 93.223930,65.110596 93.540451,65.035034 C94.925735,63.668842 95.994484,62.378204 97.037460,61.053047
|
||||
C97.011688,61.018532 97.086418,61.061367 97.418701,60.997078 C100.387512,58.135143 103.024048,55.337498 105.840828,52.291214
|
||||
C107.274651,50.972633 108.528229,49.902691 110.120842,48.821507 C111.324287,47.898228 112.188705,46.986183 113.028954,46.039188
|
||||
C113.004784,46.004234 113.069771,46.059036 113.418266,46.038719 C115.379044,44.556744 116.991333,43.095085 118.618896,41.600952
|
||||
C118.634186,41.568470 118.705971,41.569565 118.943619,41.531807 C119.496582,41.345333 119.686287,41.099613 119.875092,40.861622
|
||||
C119.999825,40.966347 119.751175,40.750431 120.085175,40.695145 C121.552383,39.660774 122.685600,38.681686 123.971207,37.539024
|
||||
C124.353516,37.180477 124.609665,37.030270 125.248093,36.934944 C127.105858,35.720867 128.607605,34.496674 130.284821,33.157169
|
||||
C130.460281,33.041859 130.850082,32.885620 131.191956,32.879478 C132.720169,31.979248 133.906525,31.085161 135.242615,30.070633
|
||||
C135.392365,29.950191 135.742935,29.792681 136.116943,29.797058 C144.044449,25.665834 151.597931,21.530237 159.443359,17.267967
|
||||
C160.335373,16.929420 160.935471,16.717543 161.932648,16.610218 C166.284805,15.022083 170.239853,13.329394 174.481018,11.497526
|
||||
C175.179947,11.265512 175.592758,11.172676 176.284058,11.232684 C181.045059,9.931384 185.527557,8.477241 190.283020,6.942632
|
||||
C190.929428,6.798172 191.302902,6.734176 192.106628,6.758037 C200.661499,5.630559 208.799301,4.494970 216.903397,3.155535
|
||||
C219.646088,2.702227 222.303574,1.733297 225.000000,1.000000 z'
|
||||
/>
|
||||
<path
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
fill='#CF207F'
|
||||
d=' M139.359467,113.684723 C140.046402,112.896461 140.733337,112.108200 141.935272,111.074768
|
||||
C142.614975,110.526917 142.779678,110.224220 142.944397,109.921524 C142.944397,109.921532 143.176773,109.554497 143.635193,109.340279
|
||||
C145.124252,107.866608 146.154877,106.607147 147.185501,105.347694 C147.185501,105.347694 147.485733,105.074348 147.925735,104.915680
|
||||
C148.538528,104.456520 148.711319,104.156021 148.884109,103.855530 C149.041901,103.578056 149.247330,103.342041 149.974884,103.098984
|
||||
C150.636948,103.055161 150.824478,103.059845 151.047058,103.134651 C151.082077,103.204781 151.296890,103.193550 151.296890,103.193550
|
||||
C151.296890,103.193550 151.065384,103.011589 151.060242,102.733826 C151.009506,102.276550 150.963913,102.097046 150.918304,101.917534
|
||||
C151.332077,101.491318 151.745850,101.065102 152.635773,100.460251 C153.111908,100.281609 153.497894,100.049179 153.789368,100.038872
|
||||
C154.772659,99.452271 155.464478,98.875984 156.408234,98.117584 C157.490311,97.320854 158.320465,96.706223 159.411987,96.018272
|
||||
C160.091385,95.613731 160.509415,95.282509 161.005707,94.693756 C161.125443,94.083160 161.166931,93.730095 161.208405,93.377022
|
||||
C161.208405,93.377022 161.272369,93.281357 161.637833,93.283844 C162.733887,92.659668 163.464478,92.032997 164.195068,91.406326
|
||||
C164.195068,91.406326 164.565247,91.160652 165.074371,91.083725 C166.115738,90.460403 166.647964,89.913994 167.180191,89.367592
|
||||
C167.180191,89.367592 167.561722,89.134003 168.067535,89.083694 C169.113785,88.531319 169.654205,88.029266 170.194611,87.527206
|
||||
C170.534180,87.339554 170.873749,87.151909 171.836243,86.913345 C174.039276,85.751251 175.619370,84.640068 177.199478,83.528885
|
||||
C177.199478,83.528885 177.351318,83.387817 177.799438,83.385483 C179.820572,82.883362 181.393585,82.383591 183.170273,81.808777
|
||||
C183.633362,81.599014 183.861649,81.423775 184.373871,81.123398 C185.491287,80.703987 186.293686,80.369202 187.361908,79.991440
|
||||
C188.096588,79.696411 188.565445,79.444366 189.280243,79.140625 C189.689667,79.052353 189.853149,79.015762 190.210281,78.900085
|
||||
C190.651642,78.688210 190.867310,78.515427 191.369507,78.235207 C192.110519,78.067825 192.532990,77.967896 193.244263,77.853729
|
||||
C194.045349,77.588539 194.557632,77.337585 195.404114,77.018097 C196.821823,76.607903 197.905350,76.266235 199.266159,75.907867
|
||||
C200.036407,75.656876 200.529373,75.422592 201.364365,75.106812 C202.827423,74.692017 203.948425,74.358734 205.380356,74.019363
|
||||
C206.468277,73.766235 207.245285,73.519203 208.389984,73.226074 C209.493317,73.091133 210.228912,73.002289 211.290283,72.935577
|
||||
C212.412201,72.683113 213.208344,72.408524 214.267502,72.100060 C214.705307,72.039871 214.880112,72.013565 215.424881,71.999588
|
||||
C217.201248,71.734070 218.607666,71.456200 220.413910,71.153488 C221.880417,71.070969 222.947083,71.013298 224.279190,71.170303
|
||||
C226.068039,70.992416 227.591461,70.599854 229.423401,70.196625 C230.143173,70.169228 230.554443,70.152512 231.313034,70.332619
|
||||
C235.115021,70.382599 238.569687,70.235756 242.491425,70.087082 C280.953430,70.102844 318.948334,70.120430 357.053223,70.529343
|
||||
C357.455536,73.045441 357.992554,75.169182 358.001373,77.295113 C358.070374,93.940338 358.043671,110.585976 358.034363,127.231491
|
||||
C358.030548,134.046967 358.016937,134.057816 351.099701,134.059860 C310.817535,134.071823 270.534180,133.934753 230.254730,134.268967
|
||||
C225.246338,134.310516 220.258575,136.842316 215.230850,138.283905 C215.200439,138.347610 215.065262,138.306870 214.806305,138.286804
|
||||
C214.115921,138.505325 213.684479,138.743896 213.009598,139.115082 C212.583405,139.275208 212.400635,139.302734 211.833679,139.280731
|
||||
C208.407166,140.913559 205.364853,142.595886 202.282257,144.308472 C202.241974,144.338730 202.168381,144.269897 201.973877,144.345428
|
||||
C201.529541,144.568588 201.364868,144.781921 201.061798,145.322937 C200.647766,145.713150 200.457306,145.841385 199.948059,145.977448
|
||||
C197.417572,147.954681 195.205872,149.924103 192.993881,151.942596 C192.993607,151.991669 192.895477,151.990555 192.549149,152.015503
|
||||
C187.409988,154.769379 184.238312,158.680161 183.252487,164.111267 C183.188980,163.991821 183.294250,164.239044 182.950150,164.345627
|
||||
C180.427338,169.367905 177.154861,174.103409 176.308884,179.238663 C174.781265,188.511490 174.320831,198.014923 174.115677,207.437317
|
||||
C173.843521,219.937164 178.269516,231.196472 184.901489,241.604797 C185.796005,243.008667 187.567444,243.853790 188.990707,244.966980
|
||||
C189.048599,244.976334 189.032700,245.092545 189.039658,245.443787 C189.760330,247.068161 190.225784,248.594147 191.225662,249.575775
|
||||
C202.884888,261.022064 217.215424,267.483948 233.244598,267.746521 C272.873535,268.395599 312.520477,268.025818 352.159454,267.873199
|
||||
C356.777344,267.855408 358.164368,269.300385 358.106323,273.876007 C357.865570,292.859802 357.967224,311.847900 357.480347,330.882874
|
||||
C338.906525,330.962463 320.795410,331.052429 302.684601,331.010834 C276.765686,330.951324 250.846970,330.795715 224.637268,330.524200
|
||||
C223.236160,330.268494 222.125992,330.169708 220.602966,330.058136 C219.095612,329.927734 218.001114,329.810120 216.705780,329.546783
|
||||
C216.025055,329.282104 215.545151,329.163147 214.711487,329.008087 C213.887634,328.910431 213.417526,328.848877 212.660461,328.610291
|
||||
C211.246506,328.304504 210.119537,328.175751 208.744629,328.011780 C208.333069,327.943604 208.169434,327.910645 207.938263,327.637787
|
||||
C207.248444,327.303284 206.626129,327.208649 205.594803,327.076263 C204.102722,326.877716 203.019669,326.716858 201.800995,326.447266
|
||||
C201.471100,326.205719 201.260620,326.107544 200.685684,325.968201 C199.212677,325.508331 198.087952,325.124298 196.745544,324.584839
|
||||
C196.008286,324.314789 195.488724,324.200195 194.630951,324.040466 C193.850174,323.890259 193.407623,323.785156 192.841400,323.544250
|
||||
C192.535934,323.239014 192.330688,323.105682 192.067078,322.987274 C192.032166,322.966125 191.968018,322.915680 191.729294,322.721558
|
||||
C190.699036,322.352661 189.907501,322.177887 188.818344,321.917145 C188.322571,321.773010 188.124420,321.714844 187.806183,321.529083
|
||||
C187.508530,321.243896 187.309464,321.121094 186.809235,320.966248 C186.343460,320.853546 186.157333,320.807709 185.820770,320.618958
|
||||
C185.449020,320.300232 185.201187,320.178223 184.579239,320.017242 C183.123337,319.463867 182.015015,319.003296 180.807480,318.445465
|
||||
C180.565079,318.228424 180.407501,318.132172 179.911469,317.900696 C178.706055,317.357391 177.824753,316.972839 176.813736,316.472290
|
||||
C176.496887,316.208344 176.292038,316.091339 175.768234,315.863037 C174.296906,315.078705 173.126801,314.436676 171.834732,313.642029
|
||||
C171.530289,313.298096 171.319397,313.146332 170.800644,312.938660 C170.334427,312.781097 170.147659,312.718903 169.839874,312.529358
|
||||
C169.543640,312.242981 169.349289,312.112366 168.837830,311.854187 C167.694580,311.463196 166.849335,311.228241 166.004089,310.993286
|
||||
C166.004089,310.993286 165.584625,310.834839 165.340561,310.390503 C163.548645,308.481201 162.131165,306.841003 160.433350,305.577545
|
||||
C135.450775,286.986084 120.418205,262.047058 113.761909,231.918289 C110.147652,215.558807 109.790779,198.967697 111.782127,182.339249
|
||||
C113.832611,165.216965 118.597160,148.944382 127.160858,133.886154 C130.497955,128.018265 133.867905,122.169083 137.222885,116.311386
|
||||
C137.222885,116.311386 137.227158,116.228470 137.540863,116.214661 C138.211945,116.106445 138.569351,116.012032 139.062988,115.851028
|
||||
C139.427094,115.546883 139.469406,115.275383 139.372986,114.756676 C139.495758,114.250427 139.475632,113.964195 139.359467,113.684723 z'
|
||||
/>
|
||||
<path
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
fill='#FFC947'
|
||||
d=' M200.266830,145.969620 C200.457306,145.841385 200.647766,145.713150 201.270264,145.275589
|
||||
C201.994553,144.826004 202.149918,144.593887 202.168381,144.269897 C202.168381,144.269897 202.241974,144.338730 202.627762,144.274597
|
||||
C206.081650,142.583710 209.149765,140.956970 212.217880,139.330231 C212.400635,139.302734 212.583405,139.275208 213.260132,139.131683
|
||||
C214.191147,138.779388 214.628204,138.543121 215.065262,138.306854 C215.065262,138.306870 215.200439,138.347610 215.615753,138.262543
|
||||
C222.236084,137.117767 228.435684,135.178802 234.646988,135.140549 C276.033936,134.885590 317.423431,135.036758 358.812073,135.055969
|
||||
C358.822845,178.409409 358.833618,221.762833 358.350433,265.618347 C317.222778,266.132172 276.588776,266.228516 235.955917,266.054840
|
||||
C230.533264,266.031647 225.031219,265.015839 219.714111,263.807587 C207.453613,261.021515 197.827393,253.684341 189.032700,245.092545
|
||||
C189.032700,245.092545 189.048599,244.976334 188.932205,244.635071 C178.652054,231.033371 175.024597,215.782471 175.030136,199.385284
|
||||
C175.034317,187.007950 178.389404,175.448639 183.294250,164.239044 C183.294250,164.239044 183.188980,163.991821 183.536774,163.962189
|
||||
C186.888184,159.951889 189.891830,155.971222 192.895477,151.990555 C192.895477,151.990555 192.993607,151.991669 193.307098,151.842606
|
||||
C195.835999,149.785568 198.051407,147.877594 200.266830,145.969620 z'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[Clay](https://www.clay.com/) is a data enrichment and workflow automation platform that helps teams streamline lead generation, research, and data operations through powerful integrations and flexible inputs.
|
||||
|
||||
Learn how to use the Clay Tool in Sim to seamlessly insert data into a Clay workbook through webhook triggers. This tutorial walks you through setting up a webhook, configuring data mapping, and automating real-time updates to your Clay workbooks. Perfect for streamlining lead generation and data enrichment directly from your workflow!
|
||||
|
||||
<iframe
|
||||
width="100%"
|
||||
height="400"
|
||||
src="https://www.youtube.com/embed/cx_75X5sI_s"
|
||||
title="Clay Integration with Sim"
|
||||
frameBorder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowFullScreen
|
||||
></iframe>
|
||||
|
||||
With Clay, you can:
|
||||
|
||||
- **Enrich agent outputs**: Automatically feed your Sim agent data into Clay tables for structured tracking and analysis
|
||||
- **Trigger workflows via webhooks**: Use Clay’s webhook support to initiate Sim agent tasks from within Clay
|
||||
- **Leverage data loops**: Seamlessly iterate over enriched data rows with agents that operate across dynamic datasets
|
||||
|
||||
In Sim, the Clay integration allows your agents to push structured data into Clay tables via webhooks. This makes it easy to collect, enrich, and manage dynamic outputs such as leads, research summaries, or action items—all in a collaborative, spreadsheet-like interface. Your agents can populate rows in real time, enabling asynchronous workflows where AI-generated insights are captured, reviewed, and used by your team. Whether you're automating research, enriching CRM data, or tracking operational outcomes, Clay becomes a living data layer that interacts intelligently with your agents. By connecting Sim with Clay, you gain a powerful way to operationalize agent results, loop over datasets with precision, and maintain a clean, auditable record of AI-driven work.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Usage Instructions
|
||||
|
||||
Integrate Clay into the workflow. Can populate a table with data.
|
||||
|
||||
## Tools
|
||||
|
||||
### `clay_populate`
|
||||
|
||||
Populate Clay with data from a JSON file. Enables direct communication and notifications with timestamp tracking and channel confirmation.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `webhookURL` | string | Yes | The webhook URL to populate |
|
||||
| `data` | json | Yes | The data to populate |
|
||||
| `authToken` | string | Yes | Auth token for Clay webhook authentication |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `success` | boolean | Operation success status |
|
||||
| `output` | json | Clay populate operation results including response data from Clay webhook |
|
||||
|
||||
## Notes
|
||||
|
||||
- Category: `tools`
|
||||
- Type: `clay`
|
||||
@@ -23,7 +23,210 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
## Übersicht
|
||||
|
||||
Der Generic Webhook-Block ermöglicht es Ihnen, Webhooks von jedem externen Dienst zu empfangen. Dies ist ein flexibler Auslöser, der jede JSON-Nutzlast verarbeiten kann und sich daher ideal für die Integration mit Diensten eignet, die keinen dedizierten Sim-Block haben.
|
||||
|
||||
## Grundlegende Verwendung
|
||||
|
||||
### Einfacher Durchleitungsmodus
|
||||
|
||||
Ohne ein Eingabeformat zu definieren, leitet der Webhook den gesamten Anforderungstext unverändert weiter:
|
||||
|
||||
```bash
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"message": "Test webhook trigger",
|
||||
"data": {
|
||||
"key": "value"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
Greifen Sie in nachgelagerten Blöcken auf die Daten zu mit:
|
||||
- `<webhook1.message>` → "Test webhook trigger"
|
||||
- `<webhook1.data.key>` → "value"
|
||||
|
||||
### Strukturiertes Eingabeformat (Optional)
|
||||
|
||||
Definieren Sie ein Eingabeschema, um typisierte Felder zu erhalten und erweiterte Funktionen wie Datei-Uploads zu aktivieren:
|
||||
|
||||
**Konfiguration des Eingabeformats:**
|
||||
|
||||
```json
|
||||
[
|
||||
{ "name": "message", "type": "string" },
|
||||
{ "name": "priority", "type": "number" },
|
||||
{ "name": "documents", "type": "files" }
|
||||
]
|
||||
```
|
||||
|
||||
**Webhook-Anfrage:**
|
||||
|
||||
```bash
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"message": "Invoice submission",
|
||||
"priority": 1,
|
||||
"documents": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:application/pdf;base64,JVBERi0xLjQK...",
|
||||
"name": "invoice.pdf",
|
||||
"mime": "application/pdf"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
## Datei-Uploads
|
||||
|
||||
### Unterstützte Dateiformate
|
||||
|
||||
Der Webhook unterstützt zwei Dateieingabeformate:
|
||||
|
||||
#### 1. Base64-kodierte Dateien
|
||||
Zum direkten Hochladen von Dateiinhalten:
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA...",
|
||||
"name": "screenshot.png",
|
||||
"mime": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- **Maximale Größe**: 20MB pro Datei
|
||||
- **Format**: Standard-Daten-URL mit Base64-Kodierung
|
||||
- **Speicherung**: Dateien werden in sicheren Ausführungsspeicher hochgeladen
|
||||
|
||||
#### 2. URL-Referenzen
|
||||
Zum Übergeben vorhandener Datei-URLs:
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [
|
||||
{
|
||||
"type": "url",
|
||||
"data": "https://example.com/files/document.pdf",
|
||||
"name": "document.pdf",
|
||||
"mime": "application/pdf"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Zugriff auf Dateien in nachgelagerten Blöcken
|
||||
|
||||
Dateien werden in `UserFile`Objekte mit folgenden Eigenschaften verarbeitet:
|
||||
|
||||
```typescript
|
||||
{
|
||||
id: string, // Unique file identifier
|
||||
name: string, // Original filename
|
||||
url: string, // Presigned URL (valid for 5 minutes)
|
||||
size: number, // File size in bytes
|
||||
type: string, // MIME type
|
||||
key: string, // Storage key
|
||||
uploadedAt: string, // ISO timestamp
|
||||
expiresAt: string // ISO timestamp (5 minutes)
|
||||
}
|
||||
```
|
||||
|
||||
**Zugriff in Blöcken:**
|
||||
- `<webhook1.documents[0].url>` → Download-URL
|
||||
- `<webhook1.documents[0].name>` → "invoice.pdf"
|
||||
- `<webhook1.documents[0].size>` → 524288
|
||||
- `<webhook1.documents[0].type>` → "application/pdf"
|
||||
|
||||
### Vollständiges Beispiel für Datei-Upload
|
||||
|
||||
```bash
|
||||
# Create a base64-encoded file
|
||||
echo "Hello World" | base64
|
||||
# SGVsbG8gV29ybGQK
|
||||
|
||||
# Send webhook with file
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"subject": "Document for review",
|
||||
"attachments": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:text/plain;base64,SGVsbG8gV29ybGQK",
|
||||
"name": "sample.txt",
|
||||
"mime": "text/plain"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
## Authentifizierung
|
||||
|
||||
### Authentifizierung konfigurieren (optional)
|
||||
|
||||
In der Webhook-Konfiguration:
|
||||
1. Aktiviere "Authentifizierung erforderlich"
|
||||
2. Setze einen geheimen Token
|
||||
3. Wähle den Header-Typ:
|
||||
- **Benutzerdefinierter Header**: `X-Sim-Secret: your-token`
|
||||
- **Authorization Bearer**: `Authorization: Bearer your-token`
|
||||
|
||||
### Verwendung der Authentifizierung
|
||||
|
||||
```bash
|
||||
# With custom header
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret-token" \
|
||||
-d '{"message": "Authenticated request"}'
|
||||
|
||||
# With bearer token
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer your-secret-token" \
|
||||
-d '{"message": "Authenticated request"}'
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Eingabeformat für Struktur verwenden**: Definiere ein Eingabeformat, wenn du das erwartete Schema kennst. Dies bietet:
|
||||
- Typvalidierung
|
||||
- Bessere Autovervollständigung im Editor
|
||||
- Datei-Upload-Funktionen
|
||||
|
||||
2. **Authentifizierung**: Aktiviere immer die Authentifizierung für Produktions-Webhooks, um unbefugten Zugriff zu verhindern.
|
||||
|
||||
3. **Dateigrößenbeschränkungen**: Halte Dateien unter 20 MB. Verwende für größere Dateien stattdessen URL-Referenzen.
|
||||
|
||||
4. **Dateiablauf**: Heruntergeladene Dateien haben URLs mit einer Gültigkeit von 5 Minuten. Verarbeite sie umgehend oder speichere sie an anderer Stelle, wenn sie länger benötigt werden.
|
||||
|
||||
5. **Fehlerbehandlung**: Die Webhook-Verarbeitung erfolgt asynchron. Überprüfe die Ausführungsprotokolle auf Fehler.
|
||||
|
||||
6. **Testen**: Verwende die Schaltfläche "Webhook testen" im Editor, um deine Konfiguration vor der Bereitstellung zu validieren.
|
||||
|
||||
## Anwendungsfälle
|
||||
|
||||
- **Formularübermittlungen**: Empfange Daten von benutzerdefinierten Formularen mit Datei-Uploads
|
||||
- **Drittanbieter-Integrationen**: Verbinde mit Diensten, die Webhooks senden (Stripe, GitHub usw.)
|
||||
- **Dokumentenverarbeitung**: Akzeptiere Dokumente von externen Systemen zur Verarbeitung
|
||||
- **Ereignisbenachrichtigungen**: Empfange Ereignisdaten aus verschiedenen Quellen
|
||||
- **Benutzerdefinierte APIs**: Erstelle benutzerdefinierte API-Endpunkte für deine Anwendungen
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `triggers`
|
||||
- Typ: `generic_webhook`
|
||||
- **Dateiunterstützung**: Verfügbar über Eingabeformat-Konfiguration
|
||||
- **Maximale Dateigröße**: 20 MB pro Datei
|
||||
|
||||
98
apps/docs/content/docs/de/tools/huggingface.mdx
Normal file
98
apps/docs/content/docs/de/tools/huggingface.mdx
Normal file
File diff suppressed because one or more lines are too long
@@ -60,10 +60,10 @@ Suche nach ähnlichen Inhalten in einer Wissensdatenbank mittels Vektorähnlichk
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `knowledgeBaseId` | string | Ja | ID der zu durchsuchenden Wissensdatenbank |
|
||||
| `knowledgeBaseId` | string | Ja | ID der Wissensdatenbank, in der gesucht werden soll |
|
||||
| `query` | string | Nein | Suchanfragentext \(optional bei Verwendung von Tag-Filtern\) |
|
||||
| `topK` | number | Nein | Anzahl der ähnlichsten Ergebnisse, die zurückgegeben werden sollen \(1-100\) |
|
||||
| `tagFilters` | any | Nein | Array von Tag-Filtern mit tagName- und tagValue-Eigenschaften |
|
||||
| `tagFilters` | array | Nein | Array von Tag-Filtern mit tagName- und tagValue-Eigenschaften |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ Inhalte aus einem Microsoft Teams-Chat lesen
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `chatId` | string | Ja | Die ID des Chats, aus dem gelesen werden soll |
|
||||
| `includeAttachments` | boolean | Nein | Nachrichtenanhänge \(gehostete Inhalte\) herunterladen und in den Speicher aufnehmen |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
@@ -119,9 +120,10 @@ Inhalte aus einem Microsoft Teams-Chat lesen
|
||||
| `messageCount` | number | Anzahl der aus dem Chat abgerufenen Nachrichten |
|
||||
| `chatId` | string | ID des Chats, aus dem gelesen wurde |
|
||||
| `messages` | array | Array von Chat-Nachrichtenobjekten |
|
||||
| `attachmentCount` | number | Gesamtzahl der gefundenen Anhänge |
|
||||
| `attachmentCount` | number | Gesamtanzahl der gefundenen Anhänge |
|
||||
| `attachmentTypes` | array | Arten der gefundenen Anhänge |
|
||||
| `content` | string | Formatierter Inhalt der Chat-Nachrichten |
|
||||
| `attachments` | file[] | Hochgeladene Anhänge zur Vereinfachung \(abgeflacht\) |
|
||||
|
||||
### `microsoft_teams_write_chat`
|
||||
|
||||
@@ -155,19 +157,21 @@ Inhalte aus einem Microsoft Teams-Kanal lesen
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `teamId` | string | Ja | Die ID des Teams, aus dem gelesen werden soll |
|
||||
| `channelId` | string | Ja | Die ID des Kanals, aus dem gelesen werden soll |
|
||||
| `includeAttachments` | boolean | Nein | Nachrichtenanhänge \(gehostete Inhalte\) herunterladen und in den Speicher aufnehmen |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `success` | boolean | Erfolgsstatus des Lesevorgangs im Teams-Kanal |
|
||||
| `success` | boolean | Erfolgsstatus des Teams-Kanal-Lesevorgangs |
|
||||
| `messageCount` | number | Anzahl der aus dem Kanal abgerufenen Nachrichten |
|
||||
| `teamId` | string | ID des Teams, aus dem gelesen wurde |
|
||||
| `channelId` | string | ID des Kanals, aus dem gelesen wurde |
|
||||
| `messages` | array | Array von Kanalnachrichtenobjekten |
|
||||
| `messages` | array | Array von Kanal-Nachrichtenobjekten |
|
||||
| `attachmentCount` | number | Gesamtanzahl der gefundenen Anhänge |
|
||||
| `attachmentTypes` | array | Arten der gefundenen Anhänge |
|
||||
| `content` | string | Formatierter Inhalt der Kanalnachrichten |
|
||||
| `content` | string | Formatierter Inhalt der Kanal-Nachrichten |
|
||||
| `attachments` | file[] | Hochgeladene Anhänge zur Vereinfachung \(abgeflacht\) |
|
||||
|
||||
### `microsoft_teams_write_channel`
|
||||
|
||||
|
||||
@@ -203,6 +203,7 @@ E-Mails aus Outlook lesen
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `folder` | string | Nein | Ordner-ID, aus der E-Mails gelesen werden sollen \(Standard: Posteingang\) |
|
||||
| `maxResults` | number | Nein | Maximale Anzahl der abzurufenden E-Mails \(Standard: 1, max: 10\) |
|
||||
| `includeAttachments` | boolean | Nein | E-Mail-Anhänge herunterladen und einschließen |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
@@ -210,6 +211,7 @@ E-Mails aus Outlook lesen
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Erfolgs- oder Statusmeldung |
|
||||
| `results` | array | Array von E-Mail-Nachrichtenobjekten |
|
||||
| `attachments` | file[] | Alle E-Mail-Anhänge, zusammengefasst aus allen E-Mails |
|
||||
|
||||
### `outlook_forward`
|
||||
|
||||
|
||||
219
apps/docs/content/docs/de/tools/stagehand.mdx
Normal file
219
apps/docs/content/docs/de/tools/stagehand.mdx
Normal file
@@ -0,0 +1,219 @@
|
||||
---
|
||||
title: Stagehand Extract
|
||||
description: Extract data from websites
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="stagehand"
|
||||
color="#FFC83C"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
|
||||
|
||||
viewBox='0 0 108 159'
|
||||
fill='none'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
>
|
||||
<path
|
||||
d='M15 26C22.8234 31.822 23.619 41.405 25.3125 50.3867C25.8461 53.1914 26.4211 55.9689 27.0625 58.75C27.7987 61.9868 28.4177 65.2319 29 68.5C29.332 70.3336 29.6653 72.1669 30 74C30.1418 74.7863 30.2836 75.5727 30.4297 76.3828C31.8011 83.2882 33.3851 90.5397 39.4375 94.75C40.3405 95.3069 40.3405 95.3069 41.2617 95.875C43.8517 97.5512 45.826 99.826 48 102C50.6705 102.89 52.3407 103.143 55.0898 103.211C55.8742 103.239 56.6586 103.268 57.4668 103.297C59.1098 103.349 60.7531 103.393 62.3965 103.43C65.8896 103.567 68.4123 103.705 71.5664 105.289C73 107 73 107 73 111C73.66 111 74.32 111 75 111C74.0759 106.912 74.0759 106.912 71.4766 103.828C67.0509 102.348 62.3634 102.64 57.7305 102.609C52.3632 102.449 49.2783 101.537 45 98C41.8212 94.0795 41.5303 90.9791 42 86C44.9846 83.0154 48.2994 83.6556 52.3047 83.6289C53.139 83.6199 53.9734 83.6108 54.833 83.6015C56.6067 83.587 58.3805 83.5782 60.1543 83.5745C62.8304 83.5627 65.5041 83.5137 68.1797 83.4629C81.1788 83.34 91.8042 85.3227 102 94C106.37 100.042 105.483 106.273 104.754 113.406C103.821 119.026 101.968 124.375 100.125 129.75C99.8806 130.471 99.6361 131.193 99.3843 131.936C97.7783 136.447 95.9466 140.206 93 144C92.34 144 91.68 144 91 144C91 144.66 91 145.32 91 146C79.0816 156.115 63.9798 156.979 49 156C36.6394 154.226 26.7567 148.879 19 139C11.0548 125.712 11.6846 105.465 11.3782 90.4719C11.0579 77.4745 8.03411 64.8142 5.4536 52.1135C5.04373 50.0912 4.64233 48.0673 4.24218 46.043C4.00354 44.8573 3.7649 43.6716 3.51903 42.45C2.14425 33.3121 2.14425 33.3121 4.87499 29.125C8.18297 25.817 10.3605 25.4542 15 26Z'
|
||||
fill='#FDFDFD'
|
||||
/>
|
||||
<path
|
||||
d='M91 0.999996C94.8466 2.96604 96.2332 5.08365 97.6091 9.03564C99.203 14.0664 99.4412 18.7459 99.4414 23.9922C99.4538 24.9285 99.4663 25.8647 99.4791 26.8294C99.5049 28.8198 99.5247 30.8103 99.539 32.8008C99.5785 37.9693 99.6682 43.1369 99.7578 48.3047C99.7747 49.3188 99.7917 50.3328 99.8091 51.3776C99.9603 59.6066 100.323 67.7921 100.937 76C101.012 77.0582 101.087 78.1163 101.164 79.2065C101.646 85.1097 102.203 90.3442 105.602 95.3672C107.492 98.9262 107.45 102.194 107.375 106.125C107.366 106.881 107.356 107.638 107.346 108.417C107.18 114.639 106.185 120.152 104 126C103.636 126.996 103.273 127.993 102.898 129.02C98.2182 141.022 92.6784 149.349 80.7891 155.062C67.479 160.366 49.4234 159.559 36 155C32.4272 153.286 29.2162 151.308 26 149C25.0719 148.361 24.1437 147.721 23.1875 147.062C8.32968 133.054 9.60387 109.231 8.73413 90.3208C8.32766 81.776 7.51814 73.4295 5.99999 65C5.82831 64.0338 5.65662 63.0675 5.47973 62.072C4.98196 59.3363 4.46395 56.6053 3.93749 53.875C3.76412 52.9572 3.59074 52.0394 3.4121 51.0938C2.75101 47.6388 2.11387 44.3416 0.999995 41C0.505898 36.899 0.0476353 32.7768 2.04687 29.0469C4.91881 25.5668 6.78357 24.117 11.25 23.6875C15.8364 24.0697 17.5999 24.9021 21 28C24.7763 34.3881 26.047 41.2626 27.1875 48.5C27.5111 50.4693 27.8377 52.4381 28.168 54.4062C28.3733 55.695 28.3733 55.695 28.5828 57.0098C28.8087 58.991 28.8087 58.991 30 60C30.3171 59.4947 30.6342 58.9894 30.9609 58.4688C33.1122 55.4736 34.7097 53.3284 38.3789 52.3945C44.352 52.203 48.1389 53.6183 53 57C53.0928 56.1338 53.0928 56.1338 53.1875 55.25C54.4089 51.8676 55.9015 50.8075 59 49C63.8651 48.104 66.9348 48.3122 71.1487 51.0332C72.0896 51.6822 73.0305 52.3313 74 53C73.9686 51.2986 73.9686 51.2986 73.9365 49.5627C73.8636 45.3192 73.818 41.0758 73.7803 36.8318C73.7603 35.0016 73.733 33.1715 73.6982 31.3415C73.6492 28.6976 73.6269 26.0545 73.6094 23.4102C73.5887 22.6035 73.5681 21.7969 73.5468 20.9658C73.5441 13.8444 75.5121 7.83341 80.25 2.4375C83.9645 0.495841 86.8954 0.209055 91 0.999996ZM3.99999 30C1.56925 34.8615 3.215 40.9393 4.24218 46.043C4.37061 46.6927 4.49905 47.3424 4.63137 48.0118C5.03968 50.0717 5.45687 52.1296 5.87499 54.1875C11.1768 80.6177 11.1768 80.6177 11.4375 93.375C11.7542 120.78 11.7542 120.78 23.5625 144.375C28.5565 149.002 33.5798 151.815 40 154C40.6922 154.244 41.3844 154.487 42.0977 154.738C55.6463 158.576 72.4909 156.79 84.8086 150.316C87.0103 148.994 89.0458 147.669 91 146C91 145.34 91 144.68 91 144C91.66 144 92.32 144 93 144C97.1202 138.98 99.3206 133.053 101.25 126.937C101.505 126.174 101.76 125.41 102.023 124.623C104.94 115.65 107.293 104.629 103.625 95.625C96.3369 88.3369 86.5231 83.6919 76.1988 83.6088C74.9905 83.6226 74.9905 83.6226 73.7578 83.6367C72.9082 83.6362 72.0586 83.6357 71.1833 83.6352C69.4034 83.6375 67.6235 83.6472 65.8437 83.6638C63.1117 83.6876 60.3806 83.6843 57.6484 83.6777C55.9141 83.6833 54.1797 83.6904 52.4453 83.6992C51.6277 83.6983 50.81 83.6974 49.9676 83.6964C45.5122 83.571 45.5122 83.571 42 86C41.517 90.1855 41.733 92.4858 43.6875 96.25C46.4096 99.4871 48.6807 101.674 53.0105 102.282C55.3425 102.411 57.6645 102.473 60 102.5C69.8847 102.612 69.8847 102.612 74 106C74.8125 108.687 74.8125 108.688 75 111C74.34 111 73.68 111 73 111C72.8969 110.216 72.7937 109.432 72.6875 108.625C72.224 105.67 72.224 105.67 69 104C65.2788 103.745 61.5953 103.634 57.8672 103.609C51.1596 103.409 46.859 101.691 41.875 97C41.2562 96.34 40.6375 95.68 40 95C39.175 94.4637 38.35 93.9275 37.5 93.375C30.9449 87.1477 30.3616 77.9789 29.4922 69.418C29.1557 66.1103 29.1557 66.1103 28.0352 63.625C26.5234 59.7915 26.1286 55.8785 25.5625 51.8125C23.9233 38.3 23.9233 38.3 17 27C11.7018 24.3509 7.9915 26.1225 3.99999 30Z'
|
||||
fill='#1F1F1F'
|
||||
/>
|
||||
<path
|
||||
d='M89.0976 2.53906C91 3 91 3 93.4375 5.3125C96.1586 9.99276 96.178 14.1126 96.2461 19.3828C96.2778 21.1137 96.3098 22.8446 96.342 24.5754C96.3574 25.4822 96.3728 26.3889 96.3887 27.3232C96.6322 41.3036 96.9728 55.2117 98.3396 69.1353C98.9824 75.7746 99.0977 82.3308 99 89C96.5041 88.0049 94.0126 87.0053 91.5351 85.9648C90.3112 85.4563 90.3112 85.4563 89.0625 84.9375C87.8424 84.4251 87.8424 84.4251 86.5976 83.9023C83.7463 82.9119 80.9774 82.4654 78 82C76.7702 65.9379 75.7895 49.8907 75.7004 33.7775C75.6919 32.3138 75.6783 30.8501 75.6594 29.3865C75.5553 20.4082 75.6056 12.1544 80.6875 4.4375C83.6031 2.62508 85.7 2.37456 89.0976 2.53906Z'
|
||||
fill='#FBFBFB'
|
||||
/>
|
||||
<path
|
||||
d='M97 13C97.99 13.495 97.99 13.495 99 14C99.0297 15.8781 99.0297 15.8781 99.0601 17.7942C99.4473 46.9184 99.4473 46.9184 100.937 76C101.012 77.0574 101.087 78.1149 101.164 79.2043C101.646 85.1082 102.203 90.3434 105.602 95.3672C107.492 98.9262 107.45 102.194 107.375 106.125C107.366 106.881 107.356 107.638 107.346 108.417C107.18 114.639 106.185 120.152 104 126C103.636 126.996 103.273 127.993 102.898 129.02C98.2182 141.022 92.6784 149.349 80.7891 155.062C67.479 160.366 49.4234 159.559 36 155C32.4272 153.286 29.2162 151.308 26 149C24.6078 148.041 24.6078 148.041 23.1875 147.062C13.5484 137.974 10.832 124.805 9.99999 112C9.91815 101.992 10.4358 91.9898 11 82C11.33 82 11.66 82 12 82C12.0146 82.6118 12.0292 83.2236 12.0442 83.854C11.5946 115.845 11.5946 115.845 24.0625 143.875C28.854 148.273 33.89 150.868 40 153C40.6935 153.245 41.387 153.49 42.1016 153.742C56.9033 157.914 73.8284 155.325 87 148C88.3301 147.327 89.6624 146.658 91 146C91 145.34 91 144.68 91 144C91.66 144 92.32 144 93 144C100.044 130.286 105.786 114.602 104 99C102.157 94.9722 100.121 93.0631 96.3125 90.875C95.5042 90.398 94.696 89.9211 93.8633 89.4297C85.199 85.1035 78.1558 84.4842 68.5 84.3125C67.2006 84.2783 65.9012 84.2442 64.5625 84.209C61.3751 84.127 58.1879 84.0577 55 84C55 83.67 55 83.34 55 83C58.9087 82.7294 62.8179 82.4974 66.7309 82.2981C68.7007 82.1902 70.6688 82.0535 72.6367 81.916C82.854 81.4233 90.4653 83.3102 99 89C98.8637 87.6094 98.8637 87.6094 98.7246 86.1907C96.96 67.8915 95.697 49.7051 95.75 31.3125C95.751 30.5016 95.7521 29.6908 95.7532 28.8554C95.7901 15.4198 95.7901 15.4198 97 13Z'
|
||||
fill='#262114'
|
||||
/>
|
||||
<path
|
||||
d='M68 51C72.86 54.06 74.644 56.5072 76 62C76.249 65.2763 76.2347 68.5285 76.1875 71.8125C76.1868 72.6833 76.1862 73.554 76.1855 74.4512C76.1406 80.8594 76.1406 80.8594 75 82C73.5113 82.0867 72.0185 82.107 70.5273 82.0976C69.6282 82.0944 68.7291 82.0912 67.8027 82.0879C66.8572 82.0795 65.9117 82.0711 64.9375 82.0625C63.9881 82.058 63.0387 82.0535 62.0605 82.0488C59.707 82.037 57.3535 82.0205 55 82C53.6352 77.2188 53.738 72.5029 53.6875 67.5625C53.6585 66.6208 53.6295 65.6792 53.5996 64.709C53.5591 60.2932 53.5488 57.7378 55.8945 53.9023C59.5767 50.5754 63.1766 50.211 68 51Z'
|
||||
fill='#F8F8F8'
|
||||
/>
|
||||
<path
|
||||
d='M46 55C48.7557 57.1816 50.4359 58.8718 52 62C52.0837 63.5215 52.1073 65.0466 52.0977 66.5703C52.0944 67.4662 52.0912 68.3621 52.0879 69.2852C52.0795 70.2223 52.0711 71.1595 52.0625 72.125C52.058 73.0699 52.0535 74.0148 52.0488 74.9883C52.037 77.3256 52.0206 79.6628 52 82C50.9346 82.1992 50.9346 82.1992 49.8477 82.4023C48.9286 82.5789 48.0094 82.7555 47.0625 82.9375C46.146 83.1115 45.2294 83.2855 44.2852 83.4648C42.0471 83.7771 42.0471 83.7771 41 85C40.7692 86.3475 40.5885 87.7038 40.4375 89.0625C40.2931 90.3619 40.1487 91.6613 40 93C37 92 37 92 35.8672 90.1094C35.5398 89.3308 35.2123 88.5522 34.875 87.75C34.5424 86.9817 34.2098 86.2134 33.8672 85.4219C31.9715 80.1277 31.7884 75.065 31.75 69.5C31.7294 68.7536 31.7087 68.0073 31.6875 67.2383C31.6551 62.6607 32.0474 59.7266 35 56C38.4726 54.2637 42.2119 54.3981 46 55Z'
|
||||
fill='#FAFAFA'
|
||||
/>
|
||||
<path
|
||||
d='M97 13C97.66 13.33 98.32 13.66 99 14C99.0297 15.8781 99.0297 15.8781 99.0601 17.7942C99.4473 46.9184 99.4473 46.9184 100.937 76C101.012 77.0574 101.087 78.1149 101.164 79.2043C101.566 84.1265 102.275 88.3364 104 93C103.625 95.375 103.625 95.375 103 97C102.361 96.2781 101.721 95.5563 101.062 94.8125C94.4402 88.1902 85.5236 84.8401 76.2891 84.5859C75.0451 84.5473 73.8012 84.5086 72.5195 84.4688C71.2343 84.4378 69.9491 84.4069 68.625 84.375C66.6624 84.317 66.6624 84.317 64.6601 84.2578C61.4402 84.1638 58.2203 84.0781 55 84C55 83.67 55 83.34 55 83C58.9087 82.7294 62.8179 82.4974 66.7309 82.2981C68.7007 82.1902 70.6688 82.0535 72.6367 81.916C82.854 81.4233 90.4653 83.3102 99 89C98.9091 88.0729 98.8182 87.1458 98.7246 86.1907C96.96 67.8915 95.697 49.7051 95.75 31.3125C95.751 30.5016 95.7521 29.6908 95.7532 28.8554C95.7901 15.4198 95.7901 15.4198 97 13Z'
|
||||
fill='#423B28'
|
||||
/>
|
||||
<path
|
||||
d='M91 0.999996C94.3999 3.06951 96.8587 5.11957 98 9C97.625 12.25 97.625 12.25 97 15C95.804 12.6081 94.6146 10.2139 93.4375 7.8125C92.265 5.16236 92.265 5.16236 91 4C88.074 3.7122 85.8483 3.51695 83 4C79.1128 7.37574 78.178 11.0991 77 16C76.8329 18.5621 76.7615 21.1317 76.7695 23.6992C76.77 24.4155 76.7704 25.1318 76.7709 25.8698C76.7739 27.3783 76.7817 28.8868 76.7942 30.3953C76.8123 32.664 76.8147 34.9324 76.8144 37.2012C76.8329 44.6001 77.0765 51.888 77.7795 59.259C78.1413 63.7564 78.1068 68.2413 78.0625 72.75C78.058 73.6498 78.0535 74.5495 78.0488 75.4766C78.0373 77.6511 78.0193 79.8255 78 82C78.99 82.495 78.99 82.495 80 83C68.78 83.33 57.56 83.66 46 84C46.495 83.01 46.495 83.01 47 82C52.9349 80.7196 58.8909 80.8838 64.9375 80.9375C65.9075 80.942 66.8775 80.9465 67.8769 80.9512C70.2514 80.9629 72.6256 80.9793 75 81C75.0544 77.9997 75.0939 75.0005 75.125 72C75.1418 71.1608 75.1585 70.3216 75.1758 69.457C75.2185 63.9475 74.555 59.2895 73 54C73.66 54 74.32 54 75 54C74.9314 53.2211 74.8629 52.4422 74.7922 51.6396C74.1158 43.5036 73.7568 35.4131 73.6875 27.25C73.644 25.5194 73.644 25.5194 73.5996 23.7539C73.5376 15.3866 74.6189 8.85069 80.25 2.4375C83.9433 0.506911 86.9162 0.173322 91 0.999996Z'
|
||||
fill='#131311'
|
||||
/>
|
||||
<path
|
||||
d='M15 24C20.2332 26.3601 22.1726 29.3732 24.1875 34.5195C26.8667 42.6988 27.2651 50.4282 27 59C26.67 59 26.34 59 26 59C25.8945 58.436 25.7891 57.8721 25.6804 57.291C25.1901 54.6926 24.6889 52.0963 24.1875 49.5C24.0218 48.6131 23.8562 47.7262 23.6855 46.8125C21.7568 35.5689 21.7568 35.5689 15 27C12.0431 26.2498 12.0431 26.2498 8.99999 27C5.97965 28.9369 5.97965 28.9369 3.99999 32C3.67226 36.9682 4.31774 41.4911 5.27733 46.3594C5.40814 47.0304 5.53894 47.7015 5.67371 48.3929C5.94892 49.7985 6.22723 51.2035 6.50854 52.6079C6.93887 54.7569 7.35989 56.9075 7.77929 59.0586C9.09359 66.104 9.09359 66.104 11 73C11.0836 75.2109 11.1073 77.4243 11.0976 79.6367C11.0944 80.9354 11.0912 82.2342 11.0879 83.5723C11.0795 84.944 11.0711 86.3158 11.0625 87.6875C11.0575 89.071 11.0529 90.4544 11.0488 91.8379C11.037 95.2253 11.0206 98.6126 11 102C8.54975 99.5498 8.73228 98.8194 8.65624 95.4492C8.62812 94.53 8.60001 93.6108 8.57104 92.6638C8.54759 91.6816 8.52415 90.6994 8.49999 89.6875C8.20265 81.3063 7.58164 73.2485 5.99999 65C5.67135 63.2175 5.34327 61.435 5.01562 59.6523C4.31985 55.9098 3.62013 52.1681 2.90233 48.4297C2.75272 47.6484 2.60311 46.867 2.44897 46.062C1.99909 43.8187 1.99909 43.8187 0.999995 41C0.505898 36.899 0.0476353 32.7768 2.04687 29.0469C6.06003 24.1839 8.81126 23.4843 15 24Z'
|
||||
fill='#2A2311'
|
||||
/>
|
||||
<path
|
||||
d='M11 82C11.33 82 11.66 82 12 82C12.0146 82.6118 12.0292 83.2236 12.0442 83.854C11.5946 115.845 11.5946 115.845 24.0625 143.875C30.0569 149.404 36.9894 152.617 45 154C42 156 42 156 39.4375 156C29.964 153.244 20.8381 146.677 16 138C8.26993 120.062 9.92611 101.014 11 82Z'
|
||||
fill='#272214'
|
||||
/>
|
||||
<path
|
||||
d='M68 49C70.3478 50.1116 71.9703 51.3346 74 53C73.34 53.66 72.68 54.32 72 55C71.505 54.505 71.01 54.01 70.5 53.5C67.6718 51.8031 65.3662 51.5622 62.0976 51.4062C58.4026 52.4521 57.1992 53.8264 55 57C54.3826 61.2861 54.5302 65.4938 54.6875 69.8125C54.7101 70.9823 54.7326 72.1521 54.7559 73.3574C54.8147 76.2396 54.8968 79.1191 55 82C54.01 82 53.02 82 52 82C51.9854 81.4203 51.9708 80.8407 51.9558 80.2434C51.881 77.5991 51.7845 74.9561 51.6875 72.3125C51.6649 71.4005 51.6424 70.4885 51.6191 69.5488C51.4223 64.6292 51.2621 60.9548 48 57C45.6603 55.8302 44.1661 55.8339 41.5625 55.8125C40.78 55.7983 39.9976 55.7841 39.1914 55.7695C36.7079 55.8591 36.7079 55.8591 34 58C32.7955 60.5518 32.7955 60.5518 32 63C31.34 63 30.68 63 30 63C30.2839 59.6879 31.0332 57.9518 32.9375 55.1875C36.7018 52.4987 38.9555 52.3484 43.4844 52.5586C47.3251 53.2325 49.8148 54.7842 53 57C53.0928 56.1338 53.0928 56.1338 53.1875 55.25C55.6091 48.544 61.7788 47.8649 68 49Z'
|
||||
fill='#1F1A0F'
|
||||
/>
|
||||
<path
|
||||
d='M99 60C99.33 60 99.66 60 100 60C100.05 60.7865 100.1 61.573 100.152 62.3833C100.385 65.9645 100.63 69.5447 100.875 73.125C100.954 74.3625 101.032 75.6 101.113 76.875C101.197 78.0738 101.281 79.2727 101.367 80.5078C101.44 81.6075 101.514 82.7073 101.589 83.8403C102.013 87.1 102.94 89.8988 104 93C103.625 95.375 103.625 95.375 103 97C102.361 96.2781 101.721 95.5563 101.062 94.8125C94.4402 88.1902 85.5236 84.8401 76.2891 84.5859C74.4231 84.5279 74.4231 84.5279 72.5195 84.4688C71.2343 84.4378 69.9491 84.4069 68.625 84.375C67.3166 84.3363 66.0082 84.2977 64.6601 84.2578C61.4402 84.1638 58.2203 84.0781 55 84C55 83.67 55 83.34 55 83C58.9087 82.7294 62.8179 82.4974 66.7309 82.2981C68.7007 82.1902 70.6688 82.0535 72.6367 81.916C82.854 81.4233 90.4653 83.3102 99 89C98.9162 87.912 98.8324 86.8241 98.7461 85.7031C98.1266 77.012 97.9127 68.6814 99 60Z'
|
||||
fill='#332E22'
|
||||
/>
|
||||
<path
|
||||
d='M15 24C20.2332 26.3601 22.1726 29.3732 24.1875 34.5195C26.8667 42.6988 27.2651 50.4282 27 59C26.67 59 26.34 59 26 59C25.8945 58.436 25.7891 57.8721 25.6804 57.291C25.1901 54.6926 24.6889 52.0963 24.1875 49.5C24.0218 48.6131 23.8562 47.7262 23.6855 46.8125C21.7568 35.5689 21.7568 35.5689 15 27C12.0431 26.2498 12.0431 26.2498 8.99999 27C5.2818 29.7267 4.15499 31.2727 3.18749 35.8125C3.12562 36.8644 3.06374 37.9163 2.99999 39C2.33999 39 1.67999 39 0.999992 39C0.330349 31.2321 0.330349 31.2321 3.37499 27.5625C7.31431 23.717 9.51597 23.543 15 24Z'
|
||||
fill='#1D180A'
|
||||
/>
|
||||
<path
|
||||
d='M91 0.999996C94.3999 3.06951 96.8587 5.11957 98 9C97.625 12.25 97.625 12.25 97 15C95.804 12.6081 94.6146 10.2139 93.4375 7.8125C92.265 5.16236 92.265 5.16236 91 4C85.4345 3.33492 85.4345 3.33491 80.6875 5.75C78.5543 9.85841 77.6475 13.9354 76.7109 18.4531C76.4763 19.2936 76.2417 20.1341 76 21C75.34 21.33 74.68 21.66 74 22C73.5207 15.4102 74.5846 10.6998 78 5C81.755 0.723465 85.5463 -0.103998 91 0.999996Z'
|
||||
fill='#16130D'
|
||||
/>
|
||||
<path
|
||||
d='M42 93C42.5569 93.7631 43.1137 94.5263 43.6875 95.3125C46.4238 98.4926 48.7165 100.679 53.0105 101.282C55.3425 101.411 57.6646 101.473 60 101.5C70.6207 101.621 70.6207 101.621 75 106C75.0406 107.666 75.0427 109.334 75 111C74.34 111 73.68 111 73 111C72.7112 110.196 72.4225 109.391 72.125 108.562C71.2674 105.867 71.2674 105.867 69 105C65.3044 104.833 61.615 104.703 57.916 104.658C52.1631 104.454 48.7484 103.292 44 100C41.5625 97.25 41.5625 97.25 40 95C40.66 95 41.32 95 42 95C42 94.34 42 93.68 42 93Z'
|
||||
fill='#2B2B2B'
|
||||
/>
|
||||
<path
|
||||
d='M11 82C11.33 82 11.66 82 12 82C12.1682 86.6079 12.3287 91.216 12.4822 95.8245C12.5354 97.3909 12.5907 98.9574 12.6482 100.524C12.7306 102.78 12.8055 105.036 12.8789 107.293C12.9059 107.989 12.933 108.685 12.9608 109.402C13.0731 113.092 12.9015 116.415 12 120C11.67 120 11.34 120 11 120C9.63778 112.17 10.1119 104.4 10.4375 96.5C10.4908 95.0912 10.5436 93.6823 10.5957 92.2734C10.7247 88.8487 10.8596 85.4243 11 82Z'
|
||||
fill='#4D483B'
|
||||
/>
|
||||
<path
|
||||
d='M43.4844 52.5586C47.3251 53.2325 49.8148 54.7842 53 57C52 59 52 59 50 60C49.5256 59.34 49.0512 58.68 48.5625 58C45.2656 55.4268 43.184 55.5955 39.1211 55.6641C36.7043 55.8955 36.7043 55.8955 34 58C32.7955 60.5518 32.7955 60.5518 32 63C31.34 63 30.68 63 30 63C30.2839 59.6879 31.0332 57.9518 32.9375 55.1875C36.7018 52.4987 38.9555 52.3484 43.4844 52.5586Z'
|
||||
fill='#221F16'
|
||||
/>
|
||||
<path
|
||||
d='M76 73C76.33 73 76.66 73 77 73C77 75.97 77 78.94 77 82C78.485 82.495 78.485 82.495 80 83C68.78 83.33 57.56 83.66 46 84C46.33 83.34 46.66 82.68 47 82C52.9349 80.7196 58.8909 80.8838 64.9375 80.9375C65.9075 80.942 66.8775 80.9465 67.8769 80.9512C70.2514 80.9629 72.6256 80.9793 75 81C75.33 78.36 75.66 75.72 76 73Z'
|
||||
fill='#040404'
|
||||
/>
|
||||
<path
|
||||
d='M27 54C27.33 54 27.66 54 28 54C28.33 56.97 28.66 59.94 29 63C29.99 63 30.98 63 32 63C32 66.96 32 70.92 32 75C31.01 74.67 30.02 74.34 29 74C28.8672 73.2523 28.7344 72.5047 28.5977 71.7344C28.421 70.7495 28.2444 69.7647 28.0625 68.75C27.8885 67.7755 27.7144 66.8009 27.5352 65.7969C27.0533 63.087 27.0533 63.087 26.4062 60.8125C25.8547 58.3515 26.3956 56.4176 27 54Z'
|
||||
fill='#434039'
|
||||
/>
|
||||
<path
|
||||
d='M78 5C78.99 5.33 79.98 5.66 81 6C80.3194 6.92812 80.3194 6.92812 79.625 7.875C77.7233 11.532 77.1555 14.8461 76.5273 18.8906C76.3533 19.5867 76.1793 20.2828 76 21C75.34 21.33 74.68 21.66 74 22C73.5126 15.2987 74.9229 10.9344 78 5Z'
|
||||
fill='#2A2313'
|
||||
/>
|
||||
<path
|
||||
d='M12 115C12.99 115.495 12.99 115.495 14 116C14.5334 118.483 14.9326 120.864 15.25 123.375C15.3531 124.061 15.4562 124.747 15.5625 125.453C16.0763 129.337 16.2441 130.634 14 134C12.6761 127.57 11.752 121.571 12 115Z'
|
||||
fill='#2F2C22'
|
||||
/>
|
||||
<path
|
||||
d='M104 95C107 98 107 98 107.363 101.031C107.347 102.176 107.33 103.321 107.312 104.5C107.309 105.645 107.305 106.789 107.301 107.969C107 111 107 111 105 114C104.67 107.73 104.34 101.46 104 95Z'
|
||||
fill='#120F05'
|
||||
/>
|
||||
<path
|
||||
d='M56 103C58.6048 102.919 61.2071 102.86 63.8125 102.812C64.5505 102.787 65.2885 102.762 66.0488 102.736C71.4975 102.662 71.4975 102.662 74 104.344C75.374 106.619 75.2112 108.396 75 111C74.34 111 73.68 111 73 111C72.7112 110.196 72.4225 109.391 72.125 108.562C71.2674 105.867 71.2674 105.867 69 105C66.7956 104.77 64.5861 104.589 62.375 104.438C61.1865 104.354 59.998 104.27 58.7734 104.184C57.4006 104.093 57.4006 104.093 56 104C56 103.67 56 103.34 56 103Z'
|
||||
fill='#101010'
|
||||
/>
|
||||
<path
|
||||
d='M23 40C23.66 40 24.32 40 25 40C27.3084 46.3482 27.1982 52.2948 27 59C26.67 59 26.34 59 26 59C25.01 52.73 24.02 46.46 23 40Z'
|
||||
fill='#191409'
|
||||
/>
|
||||
<path
|
||||
d='M47 83C46.3606 83.3094 45.7212 83.6187 45.0625 83.9375C41.9023 87.0977 42.181 90.6833 42 95C41.01 94.67 40.02 94.34 39 94C39.3463 85.7409 39.3463 85.7409 41.875 82.875C44 82 44 82 47 83Z'
|
||||
fill='#171717'
|
||||
/>
|
||||
<path
|
||||
d='M53 61C53.33 61 53.66 61 54 61C54.33 67.93 54.66 74.86 55 82C54.01 82 53.02 82 52 82C52.33 75.07 52.66 68.14 53 61Z'
|
||||
fill='#444444'
|
||||
/>
|
||||
<path
|
||||
d='M81 154C78.6696 156.33 77.8129 156.39 74.625 156.75C73.4687 156.897 73.4687 156.897 72.2891 157.047C69.6838 156.994 68.2195 156.317 66 155C67.7478 154.635 69.4984 154.284 71.25 153.938C72.7118 153.642 72.7118 153.642 74.2031 153.34C76.8681 153.016 78.4887 153.145 81 154Z'
|
||||
fill='#332F23'
|
||||
/>
|
||||
<path
|
||||
d='M19 28C19.66 28 20.32 28 21 28C21.6735 29.4343 22.3386 30.8726 23 32.3125C23.5569 33.5133 23.5569 33.5133 24.125 34.7383C25 37 25 37 25 40C22 39 22 39 21.0508 37.2578C20.8071 36.554 20.5635 35.8502 20.3125 35.125C20.0611 34.4263 19.8098 33.7277 19.5508 33.0078C19 31 19 31 19 28Z'
|
||||
fill='#282213'
|
||||
/>
|
||||
<path
|
||||
d='M102 87C104.429 93.2857 104.429 93.2857 103 97C100.437 94.75 100.437 94.75 98 92C98.0625 89.75 98.0625 89.75 99 88C101 87 101 87 102 87Z'
|
||||
fill='#37301F'
|
||||
/>
|
||||
<path
|
||||
d='M53 56C53.33 56 53.66 56 54 56C53.67 62.27 53.34 68.54 53 75C52.67 75 52.34 75 52 75C51.7788 72.2088 51.5726 69.4179 51.375 66.625C51.3105 65.8309 51.2461 65.0369 51.1797 64.2188C51.0394 62.1497 51.0124 60.0737 51 58C51.66 57.34 52.32 56.68 53 56Z'
|
||||
fill='#030303'
|
||||
/>
|
||||
<path
|
||||
d='M100 129C100.33 129 100.66 129 101 129C100.532 133.776 99.7567 137.045 97 141C96.34 140.67 95.68 140.34 95 140C96.65 136.37 98.3 132.74 100 129Z'
|
||||
fill='#1E1A12'
|
||||
/>
|
||||
<path
|
||||
d='M15 131C17.7061 132.353 17.9618 133.81 19.125 136.562C19.4782 137.389 19.8314 138.215 20.1953 139.066C20.4609 139.704 20.7264 140.343 21 141C20.01 141 19.02 141 18 141C15.9656 137.27 15 135.331 15 131Z'
|
||||
fill='#1C1912'
|
||||
/>
|
||||
<path
|
||||
d='M63 49C69.4 49.4923 69.4 49.4923 72.4375 52.0625C73.2109 53.0216 73.2109 53.0216 74 54C70.8039 54 69.5828 53.4533 66.8125 52C66.0971 51.6288 65.3816 51.2575 64.6445 50.875C64.1018 50.5863 63.5591 50.2975 63 50C63 49.67 63 49.34 63 49Z'
|
||||
fill='#13110C'
|
||||
/>
|
||||
<path
|
||||
d='M0.999992 39C1.98999 39 2.97999 39 3.99999 39C5.24999 46.625 5.24999 46.625 2.99999 50C2.33999 46.37 1.67999 42.74 0.999992 39Z'
|
||||
fill='#312C1E'
|
||||
/>
|
||||
<path
|
||||
d='M94 5C94.66 5 95.32 5 96 5C97.8041 7.75924 98.0127 8.88972 97.625 12.25C97.4187 13.1575 97.2125 14.065 97 15C95.1161 11.7345 94.5071 8.71888 94 5Z'
|
||||
fill='#292417'
|
||||
/>
|
||||
<path
|
||||
d='M20 141C23.3672 142.393 24.9859 143.979 27 147C24.625 146.812 24.625 146.812 22 146C20.6875 143.438 20.6875 143.438 20 141Z'
|
||||
fill='#373328'
|
||||
/>
|
||||
<path
|
||||
d='M86 83C86.33 83.99 86.66 84.98 87 86C83.37 85.34 79.74 84.68 76 84C80.3553 81.8223 81.4663 81.9696 86 83Z'
|
||||
fill='#2F2F2F'
|
||||
/>
|
||||
<path
|
||||
d='M42 93C46 97.625 46 97.625 46 101C44.02 99.35 42.04 97.7 40 96C40.66 95.67 41.32 95.34 42 95C42 94.34 42 93.68 42 93Z'
|
||||
fill='#232323'
|
||||
/>
|
||||
<path
|
||||
d='M34 55C34.66 55.33 35.32 55.66 36 56C35.5256 56.7838 35.0512 57.5675 34.5625 58.375C33.661 59.8895 32.7882 61.4236 32 63C31.34 63 30.68 63 30 63C30.4983 59.3125 31.1007 57.3951 34 55Z'
|
||||
fill='#110F0A'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[Stagehand](https://stagehand.com) is a tool that allows you to extract structured data from webpages using Browserbase and OpenAI.
|
||||
|
||||
With Stagehand, you can:
|
||||
|
||||
- **Extract structured data**: Extract structured data from webpages using Browserbase and OpenAI
|
||||
- **Save data to a database**: Save the extracted data to a database
|
||||
- **Automate workflows**: Automate workflows to extract data from webpages
|
||||
|
||||
In Sim, the Stagehand integration enables your agents to extract structured data from webpages using Browserbase and OpenAI. This allows for powerful automation scenarios such as data extraction, data analysis, and data integration. Your agents can extract structured data from webpages, save the extracted data to a database, and automate workflows to extract data from webpages. This integration bridges the gap between your AI workflows and your data management system, enabling seamless data extraction and integration. By connecting Sim with Stagehand, you can automate data extraction processes, maintain up-to-date information repositories, generate reports, and organize information intelligently - all through your intelligent agents.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Usage Instructions
|
||||
|
||||
Integrate Stagehand into the workflow. Can extract structured data from webpages.
|
||||
|
||||
## Tools
|
||||
|
||||
### `stagehand_extract`
|
||||
|
||||
Extract structured data from a webpage using Stagehand
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `url` | string | Yes | URL of the webpage to extract data from |
|
||||
| `instruction` | string | Yes | Instructions for extraction |
|
||||
| `apiKey` | string | Yes | OpenAI API key for extraction \(required by Stagehand\) |
|
||||
| `schema` | json | Yes | JSON schema defining the structure of the data to extract |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `data` | object | Extracted structured data matching the provided schema |
|
||||
|
||||
## Notes
|
||||
|
||||
- Category: `tools`
|
||||
- Type: `stagehand`
|
||||
225
apps/docs/content/docs/de/tools/stagehand_agent.mdx
Normal file
225
apps/docs/content/docs/de/tools/stagehand_agent.mdx
Normal file
@@ -0,0 +1,225 @@
|
||||
---
|
||||
title: Stagehand Agent
|
||||
description: Autonomous web browsing agent
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="stagehand_agent"
|
||||
color="#FFC83C"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
|
||||
|
||||
viewBox='0 0 108 159'
|
||||
fill='none'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
>
|
||||
<path
|
||||
d='M15 26C22.8234 31.822 23.619 41.405 25.3125 50.3867C25.8461 53.1914 26.4211 55.9689 27.0625 58.75C27.7987 61.9868 28.4177 65.2319 29 68.5C29.332 70.3336 29.6653 72.1669 30 74C30.1418 74.7863 30.2836 75.5727 30.4297 76.3828C31.8011 83.2882 33.3851 90.5397 39.4375 94.75C40.3405 95.3069 40.3405 95.3069 41.2617 95.875C43.8517 97.5512 45.826 99.826 48 102C50.6705 102.89 52.3407 103.143 55.0898 103.211C55.8742 103.239 56.6586 103.268 57.4668 103.297C59.1098 103.349 60.7531 103.393 62.3965 103.43C65.8896 103.567 68.4123 103.705 71.5664 105.289C73 107 73 107 73 111C73.66 111 74.32 111 75 111C74.0759 106.912 74.0759 106.912 71.4766 103.828C67.0509 102.348 62.3634 102.64 57.7305 102.609C52.3632 102.449 49.2783 101.537 45 98C41.8212 94.0795 41.5303 90.9791 42 86C44.9846 83.0154 48.2994 83.6556 52.3047 83.6289C53.139 83.6199 53.9734 83.6108 54.833 83.6015C56.6067 83.587 58.3805 83.5782 60.1543 83.5745C62.8304 83.5627 65.5041 83.5137 68.1797 83.4629C81.1788 83.34 91.8042 85.3227 102 94C106.37 100.042 105.483 106.273 104.754 113.406C103.821 119.026 101.968 124.375 100.125 129.75C99.8806 130.471 99.6361 131.193 99.3843 131.936C97.7783 136.447 95.9466 140.206 93 144C92.34 144 91.68 144 91 144C91 144.66 91 145.32 91 146C79.0816 156.115 63.9798 156.979 49 156C36.6394 154.226 26.7567 148.879 19 139C11.0548 125.712 11.6846 105.465 11.3782 90.4719C11.0579 77.4745 8.03411 64.8142 5.4536 52.1135C5.04373 50.0912 4.64233 48.0673 4.24218 46.043C4.00354 44.8573 3.7649 43.6716 3.51903 42.45C2.14425 33.3121 2.14425 33.3121 4.87499 29.125C8.18297 25.817 10.3605 25.4542 15 26Z'
|
||||
fill='#FDFDFD'
|
||||
/>
|
||||
<path
|
||||
d='M91 0.999996C94.8466 2.96604 96.2332 5.08365 97.6091 9.03564C99.203 14.0664 99.4412 18.7459 99.4414 23.9922C99.4538 24.9285 99.4663 25.8647 99.4791 26.8294C99.5049 28.8198 99.5247 30.8103 99.539 32.8008C99.5785 37.9693 99.6682 43.1369 99.7578 48.3047C99.7747 49.3188 99.7917 50.3328 99.8091 51.3776C99.9603 59.6066 100.323 67.7921 100.937 76C101.012 77.0582 101.087 78.1163 101.164 79.2065C101.646 85.1097 102.203 90.3442 105.602 95.3672C107.492 98.9262 107.45 102.194 107.375 106.125C107.366 106.881 107.356 107.638 107.346 108.417C107.18 114.639 106.185 120.152 104 126C103.636 126.996 103.273 127.993 102.898 129.02C98.2182 141.022 92.6784 149.349 80.7891 155.062C67.479 160.366 49.4234 159.559 36 155C32.4272 153.286 29.2162 151.308 26 149C25.0719 148.361 24.1437 147.721 23.1875 147.062C8.32968 133.054 9.60387 109.231 8.73413 90.3208C8.32766 81.776 7.51814 73.4295 5.99999 65C5.82831 64.0338 5.65662 63.0675 5.47973 62.072C4.98196 59.3363 4.46395 56.6053 3.93749 53.875C3.76412 52.9572 3.59074 52.0394 3.4121 51.0938C2.75101 47.6388 2.11387 44.3416 0.999995 41C0.505898 36.899 0.0476353 32.7768 2.04687 29.0469C4.91881 25.5668 6.78357 24.117 11.25 23.6875C15.8364 24.0697 17.5999 24.9021 21 28C24.7763 34.3881 26.047 41.2626 27.1875 48.5C27.5111 50.4693 27.8377 52.4381 28.168 54.4062C28.3733 55.695 28.3733 55.695 28.5828 57.0098C28.8087 58.991 28.8087 58.991 30 60C30.3171 59.4947 30.6342 58.9894 30.9609 58.4688C33.1122 55.4736 34.7097 53.3284 38.3789 52.3945C44.352 52.203 48.1389 53.6183 53 57C53.0928 56.1338 53.0928 56.1338 53.1875 55.25C54.4089 51.8676 55.9015 50.8075 59 49C63.8651 48.104 66.9348 48.3122 71.1487 51.0332C72.0896 51.6822 73.0305 52.3313 74 53C73.9686 51.2986 73.9686 51.2986 73.9365 49.5627C73.8636 45.3192 73.818 41.0758 73.7803 36.8318C73.7603 35.0016 73.733 33.1715 73.6982 31.3415C73.6492 28.6976 73.6269 26.0545 73.6094 23.4102C73.5887 22.6035 73.5681 21.7969 73.5468 20.9658C73.5441 13.8444 75.5121 7.83341 80.25 2.4375C83.9645 0.495841 86.8954 0.209055 91 0.999996ZM3.99999 30C1.56925 34.8615 3.215 40.9393 4.24218 46.043C4.37061 46.6927 4.49905 47.3424 4.63137 48.0118C5.03968 50.0717 5.45687 52.1296 5.87499 54.1875C11.1768 80.6177 11.1768 80.6177 11.4375 93.375C11.7542 120.78 11.7542 120.78 23.5625 144.375C28.5565 149.002 33.5798 151.815 40 154C40.6922 154.244 41.3844 154.487 42.0977 154.738C55.6463 158.576 72.4909 156.79 84.8086 150.316C87.0103 148.994 89.0458 147.669 91 146C91 145.34 91 144.68 91 144C91.66 144 92.32 144 93 144C97.1202 138.98 99.3206 133.053 101.25 126.937C101.505 126.174 101.76 125.41 102.023 124.623C104.94 115.65 107.293 104.629 103.625 95.625C96.3369 88.3369 86.5231 83.6919 76.1988 83.6088C74.9905 83.6226 74.9905 83.6226 73.7578 83.6367C72.9082 83.6362 72.0586 83.6357 71.1833 83.6352C69.4034 83.6375 67.6235 83.6472 65.8437 83.6638C63.1117 83.6876 60.3806 83.6843 57.6484 83.6777C55.9141 83.6833 54.1797 83.6904 52.4453 83.6992C51.6277 83.6983 50.81 83.6974 49.9676 83.6964C45.5122 83.571 45.5122 83.571 42 86C41.517 90.1855 41.733 92.4858 43.6875 96.25C46.4096 99.4871 48.6807 101.674 53.0105 102.282C55.3425 102.411 57.6645 102.473 60 102.5C69.8847 102.612 69.8847 102.612 74 106C74.8125 108.687 74.8125 108.688 75 111C74.34 111 73.68 111 73 111C72.8969 110.216 72.7937 109.432 72.6875 108.625C72.224 105.67 72.224 105.67 69 104C65.2788 103.745 61.5953 103.634 57.8672 103.609C51.1596 103.409 46.859 101.691 41.875 97C41.2562 96.34 40.6375 95.68 40 95C39.175 94.4637 38.35 93.9275 37.5 93.375C30.9449 87.1477 30.3616 77.9789 29.4922 69.418C29.1557 66.1103 29.1557 66.1103 28.0352 63.625C26.5234 59.7915 26.1286 55.8785 25.5625 51.8125C23.9233 38.3 23.9233 38.3 17 27C11.7018 24.3509 7.9915 26.1225 3.99999 30Z'
|
||||
fill='#1F1F1F'
|
||||
/>
|
||||
<path
|
||||
d='M89.0976 2.53906C91 3 91 3 93.4375 5.3125C96.1586 9.99276 96.178 14.1126 96.2461 19.3828C96.2778 21.1137 96.3098 22.8446 96.342 24.5754C96.3574 25.4822 96.3728 26.3889 96.3887 27.3232C96.6322 41.3036 96.9728 55.2117 98.3396 69.1353C98.9824 75.7746 99.0977 82.3308 99 89C96.5041 88.0049 94.0126 87.0053 91.5351 85.9648C90.3112 85.4563 90.3112 85.4563 89.0625 84.9375C87.8424 84.4251 87.8424 84.4251 86.5976 83.9023C83.7463 82.9119 80.9774 82.4654 78 82C76.7702 65.9379 75.7895 49.8907 75.7004 33.7775C75.6919 32.3138 75.6783 30.8501 75.6594 29.3865C75.5553 20.4082 75.6056 12.1544 80.6875 4.4375C83.6031 2.62508 85.7 2.37456 89.0976 2.53906Z'
|
||||
fill='#FBFBFB'
|
||||
/>
|
||||
<path
|
||||
d='M97 13C97.99 13.495 97.99 13.495 99 14C99.0297 15.8781 99.0297 15.8781 99.0601 17.7942C99.4473 46.9184 99.4473 46.9184 100.937 76C101.012 77.0574 101.087 78.1149 101.164 79.2043C101.646 85.1082 102.203 90.3434 105.602 95.3672C107.492 98.9262 107.45 102.194 107.375 106.125C107.366 106.881 107.356 107.638 107.346 108.417C107.18 114.639 106.185 120.152 104 126C103.636 126.996 103.273 127.993 102.898 129.02C98.2182 141.022 92.6784 149.349 80.7891 155.062C67.479 160.366 49.4234 159.559 36 155C32.4272 153.286 29.2162 151.308 26 149C24.6078 148.041 24.6078 148.041 23.1875 147.062C13.5484 137.974 10.832 124.805 9.99999 112C9.91815 101.992 10.4358 91.9898 11 82C11.33 82 11.66 82 12 82C12.0146 82.6118 12.0292 83.2236 12.0442 83.854C11.5946 115.845 11.5946 115.845 24.0625 143.875C28.854 148.273 33.89 150.868 40 153C40.6935 153.245 41.387 153.49 42.1016 153.742C56.9033 157.914 73.8284 155.325 87 148C88.3301 147.327 89.6624 146.658 91 146C91 145.34 91 144.68 91 144C91.66 144 92.32 144 93 144C100.044 130.286 105.786 114.602 104 99C102.157 94.9722 100.121 93.0631 96.3125 90.875C95.5042 90.398 94.696 89.9211 93.8633 89.4297C85.199 85.1035 78.1558 84.4842 68.5 84.3125C67.2006 84.2783 65.9012 84.2442 64.5625 84.209C61.3751 84.127 58.1879 84.0577 55 84C55 83.67 55 83.34 55 83C58.9087 82.7294 62.8179 82.4974 66.7309 82.2981C68.7007 82.1902 70.6688 82.0535 72.6367 81.916C82.854 81.4233 90.4653 83.3102 99 89C98.8637 87.6094 98.8637 87.6094 98.7246 86.1907C96.96 67.8915 95.697 49.7051 95.75 31.3125C95.751 30.5016 95.7521 29.6908 95.7532 28.8554C95.7901 15.4198 95.7901 15.4198 97 13Z'
|
||||
fill='#262114'
|
||||
/>
|
||||
<path
|
||||
d='M68 51C72.86 54.06 74.644 56.5072 76 62C76.249 65.2763 76.2347 68.5285 76.1875 71.8125C76.1868 72.6833 76.1862 73.554 76.1855 74.4512C76.1406 80.8594 76.1406 80.8594 75 82C73.5113 82.0867 72.0185 82.107 70.5273 82.0976C69.6282 82.0944 68.7291 82.0912 67.8027 82.0879C66.8572 82.0795 65.9117 82.0711 64.9375 82.0625C63.9881 82.058 63.0387 82.0535 62.0605 82.0488C59.707 82.037 57.3535 82.0205 55 82C53.6352 77.2188 53.738 72.5029 53.6875 67.5625C53.6585 66.6208 53.6295 65.6792 53.5996 64.709C53.5591 60.2932 53.5488 57.7378 55.8945 53.9023C59.5767 50.5754 63.1766 50.211 68 51Z'
|
||||
fill='#F8F8F8'
|
||||
/>
|
||||
<path
|
||||
d='M46 55C48.7557 57.1816 50.4359 58.8718 52 62C52.0837 63.5215 52.1073 65.0466 52.0977 66.5703C52.0944 67.4662 52.0912 68.3621 52.0879 69.2852C52.0795 70.2223 52.0711 71.1595 52.0625 72.125C52.058 73.0699 52.0535 74.0148 52.0488 74.9883C52.037 77.3256 52.0206 79.6628 52 82C50.9346 82.1992 50.9346 82.1992 49.8477 82.4023C48.9286 82.5789 48.0094 82.7555 47.0625 82.9375C46.146 83.1115 45.2294 83.2855 44.2852 83.4648C42.0471 83.7771 42.0471 83.7771 41 85C40.7692 86.3475 40.5885 87.7038 40.4375 89.0625C40.2931 90.3619 40.1487 91.6613 40 93C37 92 37 92 35.8672 90.1094C35.5398 89.3308 35.2123 88.5522 34.875 87.75C34.5424 86.9817 34.2098 86.2134 33.8672 85.4219C31.9715 80.1277 31.7884 75.065 31.75 69.5C31.7294 68.7536 31.7087 68.0073 31.6875 67.2383C31.6551 62.6607 32.0474 59.7266 35 56C38.4726 54.2637 42.2119 54.3981 46 55Z'
|
||||
fill='#FAFAFA'
|
||||
/>
|
||||
<path
|
||||
d='M97 13C97.66 13.33 98.32 13.66 99 14C99.0297 15.8781 99.0297 15.8781 99.0601 17.7942C99.4473 46.9184 99.4473 46.9184 100.937 76C101.012 77.0574 101.087 78.1149 101.164 79.2043C101.566 84.1265 102.275 88.3364 104 93C103.625 95.375 103.625 95.375 103 97C102.361 96.2781 101.721 95.5563 101.062 94.8125C94.4402 88.1902 85.5236 84.8401 76.2891 84.5859C75.0451 84.5473 73.8012 84.5086 72.5195 84.4688C71.2343 84.4378 69.9491 84.4069 68.625 84.375C66.6624 84.317 66.6624 84.317 64.6601 84.2578C61.4402 84.1638 58.2203 84.0781 55 84C55 83.67 55 83.34 55 83C58.9087 82.7294 62.8179 82.4974 66.7309 82.2981C68.7007 82.1902 70.6688 82.0535 72.6367 81.916C82.854 81.4233 90.4653 83.3102 99 89C98.9091 88.0729 98.8182 87.1458 98.7246 86.1907C96.96 67.8915 95.697 49.7051 95.75 31.3125C95.751 30.5016 95.7521 29.6908 95.7532 28.8554C95.7901 15.4198 95.7901 15.4198 97 13Z'
|
||||
fill='#423B28'
|
||||
/>
|
||||
<path
|
||||
d='M91 0.999996C94.3999 3.06951 96.8587 5.11957 98 9C97.625 12.25 97.625 12.25 97 15C95.804 12.6081 94.6146 10.2139 93.4375 7.8125C92.265 5.16236 92.265 5.16236 91 4C88.074 3.7122 85.8483 3.51695 83 4C79.1128 7.37574 78.178 11.0991 77 16C76.8329 18.5621 76.7615 21.1317 76.7695 23.6992C76.77 24.4155 76.7704 25.1318 76.7709 25.8698C76.7739 27.3783 76.7817 28.8868 76.7942 30.3953C76.8123 32.664 76.8147 34.9324 76.8144 37.2012C76.8329 44.6001 77.0765 51.888 77.7795 59.259C78.1413 63.7564 78.1068 68.2413 78.0625 72.75C78.058 73.6498 78.0535 74.5495 78.0488 75.4766C78.0373 77.6511 78.0193 79.8255 78 82C78.99 82.495 78.99 82.495 80 83C68.78 83.33 57.56 83.66 46 84C46.495 83.01 46.495 83.01 47 82C52.9349 80.7196 58.8909 80.8838 64.9375 80.9375C65.9075 80.942 66.8775 80.9465 67.8769 80.9512C70.2514 80.9629 72.6256 80.9793 75 81C75.0544 77.9997 75.0939 75.0005 75.125 72C75.1418 71.1608 75.1585 70.3216 75.1758 69.457C75.2185 63.9475 74.555 59.2895 73 54C73.66 54 74.32 54 75 54C74.9314 53.2211 74.8629 52.4422 74.7922 51.6396C74.1158 43.5036 73.7568 35.4131 73.6875 27.25C73.644 25.5194 73.644 25.5194 73.5996 23.7539C73.5376 15.3866 74.6189 8.85069 80.25 2.4375C83.9433 0.506911 86.9162 0.173322 91 0.999996Z'
|
||||
fill='#131311'
|
||||
/>
|
||||
<path
|
||||
d='M15 24C20.2332 26.3601 22.1726 29.3732 24.1875 34.5195C26.8667 42.6988 27.2651 50.4282 27 59C26.67 59 26.34 59 26 59C25.8945 58.436 25.7891 57.8721 25.6804 57.291C25.1901 54.6926 24.6889 52.0963 24.1875 49.5C24.0218 48.6131 23.8562 47.7262 23.6855 46.8125C21.7568 35.5689 21.7568 35.5689 15 27C12.0431 26.2498 12.0431 26.2498 8.99999 27C5.97965 28.9369 5.97965 28.9369 3.99999 32C3.67226 36.9682 4.31774 41.4911 5.27733 46.3594C5.40814 47.0304 5.53894 47.7015 5.67371 48.3929C5.94892 49.7985 6.22723 51.2035 6.50854 52.6079C6.93887 54.7569 7.35989 56.9075 7.77929 59.0586C9.09359 66.104 9.09359 66.104 11 73C11.0836 75.2109 11.1073 77.4243 11.0976 79.6367C11.0944 80.9354 11.0912 82.2342 11.0879 83.5723C11.0795 84.944 11.0711 86.3158 11.0625 87.6875C11.0575 89.071 11.0529 90.4544 11.0488 91.8379C11.037 95.2253 11.0206 98.6126 11 102C8.54975 99.5498 8.73228 98.8194 8.65624 95.4492C8.62812 94.53 8.60001 93.6108 8.57104 92.6638C8.54759 91.6816 8.52415 90.6994 8.49999 89.6875C8.20265 81.3063 7.58164 73.2485 5.99999 65C5.67135 63.2175 5.34327 61.435 5.01562 59.6523C4.31985 55.9098 3.62013 52.1681 2.90233 48.4297C2.75272 47.6484 2.60311 46.867 2.44897 46.062C1.99909 43.8187 1.99909 43.8187 0.999995 41C0.505898 36.899 0.0476353 32.7768 2.04687 29.0469C6.06003 24.1839 8.81126 23.4843 15 24Z'
|
||||
fill='#2A2311'
|
||||
/>
|
||||
<path
|
||||
d='M11 82C11.33 82 11.66 82 12 82C12.0146 82.6118 12.0292 83.2236 12.0442 83.854C11.5946 115.845 11.5946 115.845 24.0625 143.875C30.0569 149.404 36.9894 152.617 45 154C42 156 42 156 39.4375 156C29.964 153.244 20.8381 146.677 16 138C8.26993 120.062 9.92611 101.014 11 82Z'
|
||||
fill='#272214'
|
||||
/>
|
||||
<path
|
||||
d='M68 49C70.3478 50.1116 71.9703 51.3346 74 53C73.34 53.66 72.68 54.32 72 55C71.505 54.505 71.01 54.01 70.5 53.5C67.6718 51.8031 65.3662 51.5622 62.0976 51.4062C58.4026 52.4521 57.1992 53.8264 55 57C54.3826 61.2861 54.5302 65.4938 54.6875 69.8125C54.7101 70.9823 54.7326 72.1521 54.7559 73.3574C54.8147 76.2396 54.8968 79.1191 55 82C54.01 82 53.02 82 52 82C51.9854 81.4203 51.9708 80.8407 51.9558 80.2434C51.881 77.5991 51.7845 74.9561 51.6875 72.3125C51.6649 71.4005 51.6424 70.4885 51.6191 69.5488C51.4223 64.6292 51.2621 60.9548 48 57C45.6603 55.8302 44.1661 55.8339 41.5625 55.8125C40.78 55.7983 39.9976 55.7841 39.1914 55.7695C36.7079 55.8591 36.7079 55.8591 34 58C32.7955 60.5518 32.7955 60.5518 32 63C31.34 63 30.68 63 30 63C30.2839 59.6879 31.0332 57.9518 32.9375 55.1875C36.7018 52.4987 38.9555 52.3484 43.4844 52.5586C47.3251 53.2325 49.8148 54.7842 53 57C53.0928 56.1338 53.0928 56.1338 53.1875 55.25C55.6091 48.544 61.7788 47.8649 68 49Z'
|
||||
fill='#1F1A0F'
|
||||
/>
|
||||
<path
|
||||
d='M99 60C99.33 60 99.66 60 100 60C100.05 60.7865 100.1 61.573 100.152 62.3833C100.385 65.9645 100.63 69.5447 100.875 73.125C100.954 74.3625 101.032 75.6 101.113 76.875C101.197 78.0738 101.281 79.2727 101.367 80.5078C101.44 81.6075 101.514 82.7073 101.589 83.8403C102.013 87.1 102.94 89.8988 104 93C103.625 95.375 103.625 95.375 103 97C102.361 96.2781 101.721 95.5563 101.062 94.8125C94.4402 88.1902 85.5236 84.8401 76.2891 84.5859C74.4231 84.5279 74.4231 84.5279 72.5195 84.4688C71.2343 84.4378 69.9491 84.4069 68.625 84.375C67.3166 84.3363 66.0082 84.2977 64.6601 84.2578C61.4402 84.1638 58.2203 84.0781 55 84C55 83.67 55 83.34 55 83C58.9087 82.7294 62.8179 82.4974 66.7309 82.2981C68.7007 82.1902 70.6688 82.0535 72.6367 81.916C82.854 81.4233 90.4653 83.3102 99 89C98.9162 87.912 98.8324 86.8241 98.7461 85.7031C98.1266 77.012 97.9127 68.6814 99 60Z'
|
||||
fill='#332E22'
|
||||
/>
|
||||
<path
|
||||
d='M15 24C20.2332 26.3601 22.1726 29.3732 24.1875 34.5195C26.8667 42.6988 27.2651 50.4282 27 59C26.67 59 26.34 59 26 59C25.8945 58.436 25.7891 57.8721 25.6804 57.291C25.1901 54.6926 24.6889 52.0963 24.1875 49.5C24.0218 48.6131 23.8562 47.7262 23.6855 46.8125C21.7568 35.5689 21.7568 35.5689 15 27C12.0431 26.2498 12.0431 26.2498 8.99999 27C5.2818 29.7267 4.15499 31.2727 3.18749 35.8125C3.12562 36.8644 3.06374 37.9163 2.99999 39C2.33999 39 1.67999 39 0.999992 39C0.330349 31.2321 0.330349 31.2321 3.37499 27.5625C7.31431 23.717 9.51597 23.543 15 24Z'
|
||||
fill='#1D180A'
|
||||
/>
|
||||
<path
|
||||
d='M91 0.999996C94.3999 3.06951 96.8587 5.11957 98 9C97.625 12.25 97.625 12.25 97 15C95.804 12.6081 94.6146 10.2139 93.4375 7.8125C92.265 5.16236 92.265 5.16236 91 4C85.4345 3.33492 85.4345 3.33491 80.6875 5.75C78.5543 9.85841 77.6475 13.9354 76.7109 18.4531C76.4763 19.2936 76.2417 20.1341 76 21C75.34 21.33 74.68 21.66 74 22C73.5207 15.4102 74.5846 10.6998 78 5C81.755 0.723465 85.5463 -0.103998 91 0.999996Z'
|
||||
fill='#16130D'
|
||||
/>
|
||||
<path
|
||||
d='M42 93C42.5569 93.7631 43.1137 94.5263 43.6875 95.3125C46.4238 98.4926 48.7165 100.679 53.0105 101.282C55.3425 101.411 57.6646 101.473 60 101.5C70.6207 101.621 70.6207 101.621 75 106C75.0406 107.666 75.0427 109.334 75 111C74.34 111 73.68 111 73 111C72.7112 110.196 72.4225 109.391 72.125 108.562C71.2674 105.867 71.2674 105.867 69 105C65.3044 104.833 61.615 104.703 57.916 104.658C52.1631 104.454 48.7484 103.292 44 100C41.5625 97.25 41.5625 97.25 40 95C40.66 95 41.32 95 42 95C42 94.34 42 93.68 42 93Z'
|
||||
fill='#2B2B2B'
|
||||
/>
|
||||
<path
|
||||
d='M11 82C11.33 82 11.66 82 12 82C12.1682 86.6079 12.3287 91.216 12.4822 95.8245C12.5354 97.3909 12.5907 98.9574 12.6482 100.524C12.7306 102.78 12.8055 105.036 12.8789 107.293C12.9059 107.989 12.933 108.685 12.9608 109.402C13.0731 113.092 12.9015 116.415 12 120C11.67 120 11.34 120 11 120C9.63778 112.17 10.1119 104.4 10.4375 96.5C10.4908 95.0912 10.5436 93.6823 10.5957 92.2734C10.7247 88.8487 10.8596 85.4243 11 82Z'
|
||||
fill='#4D483B'
|
||||
/>
|
||||
<path
|
||||
d='M43.4844 52.5586C47.3251 53.2325 49.8148 54.7842 53 57C52 59 52 59 50 60C49.5256 59.34 49.0512 58.68 48.5625 58C45.2656 55.4268 43.184 55.5955 39.1211 55.6641C36.7043 55.8955 36.7043 55.8955 34 58C32.7955 60.5518 32.7955 60.5518 32 63C31.34 63 30.68 63 30 63C30.2839 59.6879 31.0332 57.9518 32.9375 55.1875C36.7018 52.4987 38.9555 52.3484 43.4844 52.5586Z'
|
||||
fill='#221F16'
|
||||
/>
|
||||
<path
|
||||
d='M76 73C76.33 73 76.66 73 77 73C77 75.97 77 78.94 77 82C78.485 82.495 78.485 82.495 80 83C68.78 83.33 57.56 83.66 46 84C46.33 83.34 46.66 82.68 47 82C52.9349 80.7196 58.8909 80.8838 64.9375 80.9375C65.9075 80.942 66.8775 80.9465 67.8769 80.9512C70.2514 80.9629 72.6256 80.9793 75 81C75.33 78.36 75.66 75.72 76 73Z'
|
||||
fill='#040404'
|
||||
/>
|
||||
<path
|
||||
d='M27 54C27.33 54 27.66 54 28 54C28.33 56.97 28.66 59.94 29 63C29.99 63 30.98 63 32 63C32 66.96 32 70.92 32 75C31.01 74.67 30.02 74.34 29 74C28.8672 73.2523 28.7344 72.5047 28.5977 71.7344C28.421 70.7495 28.2444 69.7647 28.0625 68.75C27.8885 67.7755 27.7144 66.8009 27.5352 65.7969C27.0533 63.087 27.0533 63.087 26.4062 60.8125C25.8547 58.3515 26.3956 56.4176 27 54Z'
|
||||
fill='#434039'
|
||||
/>
|
||||
<path
|
||||
d='M78 5C78.99 5.33 79.98 5.66 81 6C80.3194 6.92812 80.3194 6.92812 79.625 7.875C77.7233 11.532 77.1555 14.8461 76.5273 18.8906C76.3533 19.5867 76.1793 20.2828 76 21C75.34 21.33 74.68 21.66 74 22C73.5126 15.2987 74.9229 10.9344 78 5Z'
|
||||
fill='#2A2313'
|
||||
/>
|
||||
<path
|
||||
d='M12 115C12.99 115.495 12.99 115.495 14 116C14.5334 118.483 14.9326 120.864 15.25 123.375C15.3531 124.061 15.4562 124.747 15.5625 125.453C16.0763 129.337 16.2441 130.634 14 134C12.6761 127.57 11.752 121.571 12 115Z'
|
||||
fill='#2F2C22'
|
||||
/>
|
||||
<path
|
||||
d='M104 95C107 98 107 98 107.363 101.031C107.347 102.176 107.33 103.321 107.312 104.5C107.309 105.645 107.305 106.789 107.301 107.969C107 111 107 111 105 114C104.67 107.73 104.34 101.46 104 95Z'
|
||||
fill='#120F05'
|
||||
/>
|
||||
<path
|
||||
d='M56 103C58.6048 102.919 61.2071 102.86 63.8125 102.812C64.5505 102.787 65.2885 102.762 66.0488 102.736C71.4975 102.662 71.4975 102.662 74 104.344C75.374 106.619 75.2112 108.396 75 111C74.34 111 73.68 111 73 111C72.7112 110.196 72.4225 109.391 72.125 108.562C71.2674 105.867 71.2674 105.867 69 105C66.7956 104.77 64.5861 104.589 62.375 104.438C61.1865 104.354 59.998 104.27 58.7734 104.184C57.4006 104.093 57.4006 104.093 56 104C56 103.67 56 103.34 56 103Z'
|
||||
fill='#101010'
|
||||
/>
|
||||
<path
|
||||
d='M23 40C23.66 40 24.32 40 25 40C27.3084 46.3482 27.1982 52.2948 27 59C26.67 59 26.34 59 26 59C25.01 52.73 24.02 46.46 23 40Z'
|
||||
fill='#191409'
|
||||
/>
|
||||
<path
|
||||
d='M47 83C46.3606 83.3094 45.7212 83.6187 45.0625 83.9375C41.9023 87.0977 42.181 90.6833 42 95C41.01 94.67 40.02 94.34 39 94C39.3463 85.7409 39.3463 85.7409 41.875 82.875C44 82 44 82 47 83Z'
|
||||
fill='#171717'
|
||||
/>
|
||||
<path
|
||||
d='M53 61C53.33 61 53.66 61 54 61C54.33 67.93 54.66 74.86 55 82C54.01 82 53.02 82 52 82C52.33 75.07 52.66 68.14 53 61Z'
|
||||
fill='#444444'
|
||||
/>
|
||||
<path
|
||||
d='M81 154C78.6696 156.33 77.8129 156.39 74.625 156.75C73.4687 156.897 73.4687 156.897 72.2891 157.047C69.6838 156.994 68.2195 156.317 66 155C67.7478 154.635 69.4984 154.284 71.25 153.938C72.7118 153.642 72.7118 153.642 74.2031 153.34C76.8681 153.016 78.4887 153.145 81 154Z'
|
||||
fill='#332F23'
|
||||
/>
|
||||
<path
|
||||
d='M19 28C19.66 28 20.32 28 21 28C21.6735 29.4343 22.3386 30.8726 23 32.3125C23.5569 33.5133 23.5569 33.5133 24.125 34.7383C25 37 25 37 25 40C22 39 22 39 21.0508 37.2578C20.8071 36.554 20.5635 35.8502 20.3125 35.125C20.0611 34.4263 19.8098 33.7277 19.5508 33.0078C19 31 19 31 19 28Z'
|
||||
fill='#282213'
|
||||
/>
|
||||
<path
|
||||
d='M102 87C104.429 93.2857 104.429 93.2857 103 97C100.437 94.75 100.437 94.75 98 92C98.0625 89.75 98.0625 89.75 99 88C101 87 101 87 102 87Z'
|
||||
fill='#37301F'
|
||||
/>
|
||||
<path
|
||||
d='M53 56C53.33 56 53.66 56 54 56C53.67 62.27 53.34 68.54 53 75C52.67 75 52.34 75 52 75C51.7788 72.2088 51.5726 69.4179 51.375 66.625C51.3105 65.8309 51.2461 65.0369 51.1797 64.2188C51.0394 62.1497 51.0124 60.0737 51 58C51.66 57.34 52.32 56.68 53 56Z'
|
||||
fill='#030303'
|
||||
/>
|
||||
<path
|
||||
d='M100 129C100.33 129 100.66 129 101 129C100.532 133.776 99.7567 137.045 97 141C96.34 140.67 95.68 140.34 95 140C96.65 136.37 98.3 132.74 100 129Z'
|
||||
fill='#1E1A12'
|
||||
/>
|
||||
<path
|
||||
d='M15 131C17.7061 132.353 17.9618 133.81 19.125 136.562C19.4782 137.389 19.8314 138.215 20.1953 139.066C20.4609 139.704 20.7264 140.343 21 141C20.01 141 19.02 141 18 141C15.9656 137.27 15 135.331 15 131Z'
|
||||
fill='#1C1912'
|
||||
/>
|
||||
<path
|
||||
d='M63 49C69.4 49.4923 69.4 49.4923 72.4375 52.0625C73.2109 53.0216 73.2109 53.0216 74 54C70.8039 54 69.5828 53.4533 66.8125 52C66.0971 51.6288 65.3816 51.2575 64.6445 50.875C64.1018 50.5863 63.5591 50.2975 63 50C63 49.67 63 49.34 63 49Z'
|
||||
fill='#13110C'
|
||||
/>
|
||||
<path
|
||||
d='M0.999992 39C1.98999 39 2.97999 39 3.99999 39C5.24999 46.625 5.24999 46.625 2.99999 50C2.33999 46.37 1.67999 42.74 0.999992 39Z'
|
||||
fill='#312C1E'
|
||||
/>
|
||||
<path
|
||||
d='M94 5C94.66 5 95.32 5 96 5C97.8041 7.75924 98.0127 8.88972 97.625 12.25C97.4187 13.1575 97.2125 14.065 97 15C95.1161 11.7345 94.5071 8.71888 94 5Z'
|
||||
fill='#292417'
|
||||
/>
|
||||
<path
|
||||
d='M20 141C23.3672 142.393 24.9859 143.979 27 147C24.625 146.812 24.625 146.812 22 146C20.6875 143.438 20.6875 143.438 20 141Z'
|
||||
fill='#373328'
|
||||
/>
|
||||
<path
|
||||
d='M86 83C86.33 83.99 86.66 84.98 87 86C83.37 85.34 79.74 84.68 76 84C80.3553 81.8223 81.4663 81.9696 86 83Z'
|
||||
fill='#2F2F2F'
|
||||
/>
|
||||
<path
|
||||
d='M42 93C46 97.625 46 97.625 46 101C44.02 99.35 42.04 97.7 40 96C40.66 95.67 41.32 95.34 42 95C42 94.34 42 93.68 42 93Z'
|
||||
fill='#232323'
|
||||
/>
|
||||
<path
|
||||
d='M34 55C34.66 55.33 35.32 55.66 36 56C35.5256 56.7838 35.0512 57.5675 34.5625 58.375C33.661 59.8895 32.7882 61.4236 32 63C31.34 63 30.68 63 30 63C30.4983 59.3125 31.1007 57.3951 34 55Z'
|
||||
fill='#110F0A'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[Stagehand](https://www.stagehand.dev/) is an autonomous web agent platform that enables AI systems to navigate and interact with websites just like a human would. It provides a powerful solution for automating complex web tasks without requiring custom code or browser automation scripts.
|
||||
|
||||
With Stagehand, you can:
|
||||
|
||||
- **Automate web navigation**: Enable AI to browse websites, click links, fill forms, and interact with web elements
|
||||
- **Extract structured data**: Collect specific information from websites in a structured, usable format
|
||||
- **Complete complex workflows**: Perform multi-step tasks across different websites and web applications
|
||||
- **Handle authentication**: Navigate login processes and maintain sessions across websites
|
||||
- **Process dynamic content**: Interact with JavaScript-heavy sites and single-page applications
|
||||
- **Maintain context awareness**: Keep track of the current state and history while navigating
|
||||
- **Generate detailed reports**: Receive comprehensive logs of actions taken and data collected
|
||||
|
||||
In Sim, the Stagehand integration enables your agents to seamlessly interact with web-based systems as part of their workflows. This allows for sophisticated automation scenarios that bridge the gap between your AI agents and the vast information and functionality available on the web. Your agents can search for information, interact with web applications, extract data from websites, and incorporate these capabilities into their decision-making processes. By connecting Sim with Stagehand, you can create agents that extend beyond API-based integrations to navigate the web just as a human would - filling forms, clicking buttons, reading content, and extracting valuable information to complete their tasks more effectively.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Usage Instructions
|
||||
|
||||
Integrate Stagehand Agent into the workflow. Can navigate the web and perform tasks.
|
||||
|
||||
## Tools
|
||||
|
||||
### `stagehand_agent`
|
||||
|
||||
Run an autonomous web agent to complete tasks and extract structured data
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `startUrl` | string | Yes | URL of the webpage to start the agent on |
|
||||
| `task` | string | Yes | The task to complete or goal to achieve on the website |
|
||||
| `variables` | json | No | Optional variables to substitute in the task \(format: \{key: value\}\). Reference in task using %key% |
|
||||
| `format` | string | No | No description |
|
||||
| `apiKey` | string | Yes | OpenAI API key for agent execution \(required by Stagehand\) |
|
||||
| `outputSchema` | json | No | Optional JSON schema defining the structure of data the agent should return |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `agentResult` | object | Result from the Stagehand agent execution |
|
||||
|
||||
## Notes
|
||||
|
||||
- Category: `tools`
|
||||
- Type: `stagehand_agent`
|
||||
@@ -109,10 +109,10 @@ Daten in eine Supabase-Tabelle einfügen
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `projectId` | string | Ja | Ihre Supabase-Projekt-ID (z.B. jdrkgepadsdopsntdlom) |
|
||||
| `projectId` | string | Ja | Ihre Supabase-Projekt-ID \(z.B. jdrkgepadsdopsntdlom\) |
|
||||
| `table` | string | Ja | Der Name der Supabase-Tabelle, in die Daten eingefügt werden sollen |
|
||||
| `data` | any | Ja | Die einzufügenden Daten |
|
||||
| `apiKey` | string | Ja | Ihr Supabase Service-Role-Secret-Key |
|
||||
| `data` | array | Ja | Die einzufügenden Daten \(Array von Objekten oder ein einzelnes Objekt\) |
|
||||
| `apiKey` | string | Ja | Ihr Supabase Service Role Secret Key |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
@@ -191,8 +191,8 @@ Daten in eine Supabase-Tabelle einfügen oder aktualisieren (Upsert-Operation)
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `projectId` | string | Ja | Ihre Supabase-Projekt-ID \(z.B. jdrkgepadsdopsntdlom\) |
|
||||
| `table` | string | Ja | Der Name der Supabase-Tabelle, in die Daten eingefügt werden sollen |
|
||||
| `data` | any | Ja | Die Daten, die eingefügt oder aktualisiert werden sollen \(Upsert\) |
|
||||
| `table` | string | Ja | Der Name der Supabase-Tabelle, in die Daten upsertet werden sollen |
|
||||
| `data` | array | Ja | Die zu upsertenden Daten \(einfügen oder aktualisieren\) - Array von Objekten oder ein einzelnes Objekt |
|
||||
| `apiKey` | string | Ja | Ihr Supabase Service Role Secret Key |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
@@ -87,12 +87,108 @@ Sendet Nachrichten an Telegram-Kanäle oder Benutzer über die Telegram Bot API.
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `success` | boolean | Erfolgsstatus der Telegram-Nachrichtensendung |
|
||||
| `messageId` | number | Eindeutige Telegram-Nachrichtenkennung |
|
||||
| `chatId` | string | Ziel-Chat-ID, wohin die Nachricht gesendet wurde |
|
||||
| `text` | string | Textinhalt der gesendeten Nachricht |
|
||||
| `timestamp` | number | Unix-Zeitstempel, wann die Nachricht gesendet wurde |
|
||||
| `from` | object | Informationen über den Bot, der die Nachricht gesendet hat |
|
||||
| `message` | string | Erfolgs- oder Fehlermeldung |
|
||||
| `data` | object | Telegram-Nachrichtendaten |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `telegram`
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Ja | Ihr Telegram Bot API-Token |
|
||||
| `chatId` | string | Ja | Ziel-Telegram-Chat-ID |
|
||||
| `messageId` | string | Ja | Nachrichten-ID zum Löschen |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Erfolgs- oder Fehlermeldung |
|
||||
| `data` | object | Ergebnis des Löschvorgangs |
|
||||
|
||||
### `telegram_send_photo`
|
||||
|
||||
Senden Sie Fotos an Telegram-Kanäle oder Benutzer über die Telegram Bot API.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Ja | Ihr Telegram Bot API-Token |
|
||||
| `chatId` | string | Ja | Ziel-Telegram-Chat-ID |
|
||||
| `photo` | string | Ja | Zu sendendes Foto. Übergeben Sie eine file_id oder HTTP-URL |
|
||||
| `caption` | string | Nein | Fotobeschreibung (optional) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Erfolgs- oder Fehlermeldung |
|
||||
| `data` | object | Telegram-Nachrichtendaten einschließlich optionaler Foto(s) |
|
||||
|
||||
### `telegram_send_video`
|
||||
|
||||
Senden Sie Videos an Telegram-Kanäle oder Benutzer über die Telegram Bot API.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Ja | Ihr Telegram Bot API-Token |
|
||||
| `chatId` | string | Ja | Ziel-Telegram-Chat-ID |
|
||||
| `video` | string | Ja | Zu sendendes Video. Übergeben Sie eine file_id oder HTTP-URL |
|
||||
| `caption` | string | Nein | Videobeschreibung (optional) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Erfolgs- oder Fehlermeldung |
|
||||
| `data` | object | Telegram-Nachrichtendaten einschließlich optionaler Medien |
|
||||
|
||||
### `telegram_send_audio`
|
||||
|
||||
Senden Sie Audiodateien an Telegram-Kanäle oder Benutzer über die Telegram Bot API.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Ja | Ihr Telegram Bot API-Token |
|
||||
| `chatId` | string | Ja | Ziel-Telegram-Chat-ID |
|
||||
| `audio` | string | Ja | Zu sendende Audiodatei. Übergeben Sie eine file_id oder HTTP-URL |
|
||||
| `caption` | string | Nein | Audio-Beschriftung \(optional\) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Erfolgs- oder Fehlermeldung |
|
||||
| `data` | object | Telegram-Nachrichtendaten einschließlich Sprach-/Audioinformationen |
|
||||
|
||||
### `telegram_send_animation`
|
||||
|
||||
Senden Sie Animationen (GIFs) an Telegram-Kanäle oder Benutzer über die Telegram Bot API.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Ja | Ihr Telegram Bot API-Token |
|
||||
| `chatId` | string | Ja | Ziel-Telegram-Chat-ID |
|
||||
| `animation` | string | Ja | Zu sendende Animation. Übergeben Sie eine file_id oder HTTP-URL |
|
||||
| `caption` | string | Nein | Animations-Beschriftung \(optional\) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Erfolgs- oder Fehlermeldung |
|
||||
| `data` | object | Telegram-Nachrichtendaten einschließlich optionaler Medien |
|
||||
|
||||
## Hinweise
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: YouTube
|
||||
description: Suche nach Videos auf YouTube
|
||||
description: Interagiere mit YouTube-Videos, Kanälen und Playlists
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
@@ -39,7 +39,7 @@ In Sim ermöglicht die YouTube-Integration Ihren Agenten, YouTube-Inhalte progra
|
||||
|
||||
## Gebrauchsanweisung
|
||||
|
||||
Integriert YouTube in den Workflow. Kann nach Videos suchen. Benötigt API-Schlüssel.
|
||||
Integriere YouTube in den Workflow. Kann nach Videos suchen, Videodetails abrufen, Kanalinformationen abrufen, Playlist-Elemente abrufen und Videokommentare abrufen.
|
||||
|
||||
## Tools
|
||||
|
||||
@@ -61,6 +61,99 @@ Suche nach Videos auf YouTube mit der YouTube Data API.
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | array | Array von YouTube-Videos, die der Suchanfrage entsprechen |
|
||||
|
||||
### `youtube_video_details`
|
||||
|
||||
Erhalte detaillierte Informationen über ein bestimmtes YouTube-Video.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `videoId` | string | Ja | YouTube-Video-ID |
|
||||
| `apiKey` | string | Ja | YouTube API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `videoId` | string | YouTube-Video-ID |
|
||||
| `title` | string | Videotitel |
|
||||
| `description` | string | Videobeschreibung |
|
||||
| `channelId` | string | Kanal-ID |
|
||||
| `channelTitle` | string | Kanalname |
|
||||
| `publishedAt` | string | Veröffentlichungsdatum und -uhrzeit |
|
||||
| `duration` | string | Videodauer im ISO 8601-Format |
|
||||
| `viewCount` | number | Anzahl der Aufrufe |
|
||||
| `likeCount` | number | Anzahl der Likes |
|
||||
| `commentCount` | number | Anzahl der Kommentare |
|
||||
| `thumbnail` | string | Video-Thumbnail-URL |
|
||||
| `tags` | array | Video-Tags |
|
||||
|
||||
### `youtube_channel_info`
|
||||
|
||||
Erhalte detaillierte Informationen über einen YouTube-Kanal.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `channelId` | string | Nein | YouTube-Kanal-ID \(verwende entweder channelId oder username\) |
|
||||
| `username` | string | Nein | YouTube-Kanalbenutzername \(verwende entweder channelId oder username\) |
|
||||
| `apiKey` | string | Ja | YouTube API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `channelId` | string | YouTube-Kanal-ID |
|
||||
| `title` | string | Kanalname |
|
||||
| `description` | string | Kanalbeschreibung |
|
||||
| `subscriberCount` | number | Anzahl der Abonnenten |
|
||||
| `videoCount` | number | Anzahl der Videos |
|
||||
| `viewCount` | number | Gesamtaufrufe des Kanals |
|
||||
| `publishedAt` | string | Erstellungsdatum des Kanals |
|
||||
| `thumbnail` | string | URL des Kanal-Thumbnails |
|
||||
| `customUrl` | string | Benutzerdefinierte Kanal-URL |
|
||||
|
||||
### `youtube_playlist_items`
|
||||
|
||||
Videos aus einer YouTube-Playlist abrufen.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `playlistId` | string | Ja | YouTube-Playlist-ID |
|
||||
| `maxResults` | number | Nein | Maximale Anzahl der zurückzugebenden Videos |
|
||||
| `pageToken` | string | Nein | Page-Token für Paginierung |
|
||||
| `apiKey` | string | Ja | YouTube API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | array | Array von Videos in der Playlist |
|
||||
|
||||
### `youtube_comments`
|
||||
|
||||
Kommentare von einem YouTube-Video abrufen.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `videoId` | string | Ja | YouTube-Video-ID |
|
||||
| `maxResults` | number | Nein | Maximale Anzahl der zurückzugebenden Kommentare |
|
||||
| `order` | string | Nein | Reihenfolge der Kommentare: time oder relevance |
|
||||
| `pageToken` | string | Nein | Page-Token für Paginierung |
|
||||
| `apiKey` | string | Ja | YouTube API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | array | Array von Kommentaren zum Video |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
|
||||
242
apps/docs/content/docs/de/tools/zep.mdx
Normal file
242
apps/docs/content/docs/de/tools/zep.mdx
Normal file
@@ -0,0 +1,242 @@
|
||||
---
|
||||
title: Zep
|
||||
description: Langzeitgedächtnis für KI-Agenten
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="zep"
|
||||
color="#E8E8E8"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
viewBox='0 0 233 196'
|
||||
|
||||
|
||||
>
|
||||
<path
|
||||
d='m231.34,108.7l-1.48-1.55h-10.26l3.59-75.86-14.8-.45-2.77,49.31c-59.6-3.24-119.33-3.24-178.92-.02l-1.73-64.96-14.8.45,2.5,91.53H2.16l-1.41,1.47c-1.55,16.23-.66,32.68,2.26,48.89h10.83l.18,1.27c.67,19.34,16.1,34.68,35.9,34.68s44.86-.92,66.12-.92,46.56.92,65.95.92,35.19-15.29,35.9-34.61l.16-1.34h11.02c2.91-16.19,3.81-32.61,2.26-48.81Zm-158.23,58.01c-17.27,0-30.25-13.78-30.25-29.78s12.99-29.78,30.25-29.78,29.62,13.94,29.62,29.94-12.35,29.62-29.62,29.62Zm86.51,0c-17.27,0-30.25-13.78-30.25-29.78s12.99-29.78,30.25-29.78,29.62,13.94,29.62,29.94-12.35,29.62-29.62,29.62Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<polygon
|
||||
points='111.77 22.4 93.39 49.97 93.52 50.48 185.88 38.51 190.95 27.68 114.32 36.55 117.7 31.48 117.7 31.47 138.38 .49 138.25 0 47.67 11.6 42.85 22.27 118.34 12.61 111.77 22.4'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<path
|
||||
d='m72.97,121.47c-8.67,0-15.73,6.93-15.73,15.46s7.06,15.46,15.73,15.46,15.37-6.75,15.37-15.37-6.75-15.55-15.37-15.55Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<path
|
||||
d='m159.48,121.47c-8.67,0-15.73,6.93-15.73,15.46s7.06,15.46,15.73,15.46,15.37-6.75,15.37-15.37-6.75-15.55-15.37-15.55Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
## Nutzungsanleitung
|
||||
|
||||
Integriere Zep für Langzeitgedächtnisverwaltung. Erstelle Threads, füge Nachrichten hinzu, rufe Kontext mit KI-gestützten Zusammenfassungen und Faktenextraktion ab.
|
||||
|
||||
## Tools
|
||||
|
||||
### `zep_create_thread`
|
||||
|
||||
Starte einen neuen Konversations-Thread in Zep
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Ja | Eindeutige Kennung für den Thread |
|
||||
| `userId` | string | Ja | Benutzer-ID, die mit dem Thread verknüpft ist |
|
||||
| `apiKey` | string | Ja | Dein Zep API-Schlüssel |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threadId` | string | Die Thread-ID |
|
||||
| `userId` | string | Die Benutzer-ID |
|
||||
| `uuid` | string | Interne UUID |
|
||||
| `createdAt` | string | Erstellungszeitstempel |
|
||||
| `projectUuid` | string | Projekt-UUID |
|
||||
|
||||
### `zep_get_threads`
|
||||
|
||||
Liste alle Konversations-Threads auf
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `pageSize` | number | Nein | Anzahl der Threads, die pro Seite abgerufen werden sollen |
|
||||
| `pageNumber` | number | Nein | Seitennummer für Paginierung |
|
||||
| `orderBy` | string | Nein | Feld, nach dem die Ergebnisse sortiert werden sollen \(created_at, updated_at, user_id, thread_id\) |
|
||||
| `asc` | boolean | Nein | Sortierrichtung: true für aufsteigend, false für absteigend |
|
||||
| `apiKey` | string | Ja | Dein Zep API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threads` | array | Array von Thread-Objekten |
|
||||
| `responseCount` | number | Anzahl der Threads in dieser Antwort |
|
||||
| `totalCount` | number | Gesamtanzahl der verfügbaren Threads |
|
||||
|
||||
### `zep_delete_thread`
|
||||
|
||||
Einen Konversations-Thread aus Zep löschen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Ja | Thread-ID zum Löschen |
|
||||
| `apiKey` | string | Ja | Ihr Zep API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `deleted` | boolean | Ob der Thread gelöscht wurde |
|
||||
|
||||
### `zep_get_context`
|
||||
|
||||
Benutzerkontext aus einem Thread mit Zusammenfassungs- oder Basismodus abrufen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Ja | Thread-ID, aus der der Kontext abgerufen werden soll |
|
||||
| `mode` | string | Nein | Kontextmodus: "summary" \(natürliche Sprache\) oder "basic" \(rohe Fakten\) |
|
||||
| `minRating` | number | Nein | Mindestbewertung, nach der relevante Fakten gefiltert werden |
|
||||
| `apiKey` | string | Ja | Ihr Zep API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `context` | string | Der Kontextstring \(Zusammenfassung oder Basis\) |
|
||||
| `facts` | array | Extrahierte Fakten |
|
||||
| `entities` | array | Extrahierte Entitäten |
|
||||
| `summary` | string | Konversationszusammenfassung |
|
||||
|
||||
### `zep_get_messages`
|
||||
|
||||
Nachrichten aus einem Thread abrufen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Ja | Thread-ID, aus der Nachrichten abgerufen werden sollen |
|
||||
| `limit` | number | Nein | Maximale Anzahl der zurückzugebenden Nachrichten |
|
||||
| `cursor` | string | Nein | Cursor für Paginierung |
|
||||
| `lastn` | number | Nein | Anzahl der neuesten Nachrichten, die zurückgegeben werden sollen \(überschreibt Limit und Cursor\) |
|
||||
| `apiKey` | string | Ja | Ihr Zep API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `messages` | array | Array von Nachrichtenobjekten |
|
||||
| `rowCount` | number | Anzahl der Nachrichten in dieser Antwort |
|
||||
| `totalCount` | number | Gesamtanzahl der Nachrichten im Thread |
|
||||
|
||||
### `zep_add_messages`
|
||||
|
||||
Nachrichten zu einem bestehenden Thread hinzufügen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Ja | Thread-ID, zu der Nachrichten hinzugefügt werden sollen |
|
||||
| `messages` | json | Ja | Array von Nachrichtenobjekten mit Rolle und Inhalt |
|
||||
| `apiKey` | string | Ja | Ihr Zep API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `context` | string | Aktualisierter Kontext nach dem Hinzufügen von Nachrichten |
|
||||
| `messageIds` | array | Array der hinzugefügten Nachrichten-UUIDs |
|
||||
| `threadId` | string | Die Thread-ID |
|
||||
|
||||
### `zep_add_user`
|
||||
|
||||
Einen neuen Benutzer in Zep erstellen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `userId` | string | Ja | Eindeutige Kennung für den Benutzer |
|
||||
| `email` | string | Nein | E-Mail-Adresse des Benutzers |
|
||||
| `firstName` | string | Nein | Vorname des Benutzers |
|
||||
| `lastName` | string | Nein | Nachname des Benutzers |
|
||||
| `metadata` | json | Nein | Zusätzliche Metadaten als JSON-Objekt |
|
||||
| `apiKey` | string | Ja | Ihr Zep API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `userId` | string | Die Benutzer-ID |
|
||||
| `email` | string | E-Mail des Benutzers |
|
||||
| `firstName` | string | Vorname des Benutzers |
|
||||
| `lastName` | string | Nachname des Benutzers |
|
||||
| `uuid` | string | Interne UUID |
|
||||
| `createdAt` | string | Erstellungszeitstempel |
|
||||
| `metadata` | object | Benutzermetadaten |
|
||||
|
||||
### `zep_get_user`
|
||||
|
||||
Benutzerinformationen von Zep abrufen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `userId` | string | Ja | Zu abzurufende Benutzer-ID |
|
||||
| `apiKey` | string | Ja | Ihr Zep API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `userId` | string | Die Benutzer-ID |
|
||||
| `email` | string | E-Mail des Benutzers |
|
||||
| `firstName` | string | Vorname des Benutzers |
|
||||
| `lastName` | string | Nachname des Benutzers |
|
||||
| `uuid` | string | Interne UUID |
|
||||
| `createdAt` | string | Erstellungszeitstempel |
|
||||
| `updatedAt` | string | Zeitstempel der letzten Aktualisierung |
|
||||
| `metadata` | object | Benutzermetadaten |
|
||||
|
||||
### `zep_get_user_threads`
|
||||
|
||||
Alle Konversations-Threads für einen bestimmten Benutzer auflisten
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `userId` | string | Ja | Benutzer-ID, für die Threads abgerufen werden sollen |
|
||||
| `limit` | number | Nein | Maximale Anzahl der zurückzugebenden Threads |
|
||||
| `apiKey` | string | Ja | Ihr Zep API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threads` | array | Array von Thread-Objekten für diesen Benutzer |
|
||||
| `userId` | string | Die Benutzer-ID |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `zep`
|
||||
@@ -128,3 +128,60 @@ Wenn kein Eingabeformat definiert ist, stellt der Executor das rohe JSON nur unt
|
||||
<Callout type="warning">
|
||||
Ein Workflow kann nur einen API-Trigger enthalten. Veröffentlichen Sie nach Änderungen eine neue Bereitstellung, damit der Endpunkt aktuell bleibt.
|
||||
</Callout>
|
||||
|
||||
### Datei-Upload-Format
|
||||
|
||||
Die API akzeptiert Dateien in zwei Formaten:
|
||||
|
||||
**1. Base64-kodierte Dateien** (empfohlen für SDKs):
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [{
|
||||
"type": "file",
|
||||
"data": "data:application/pdf;base64,JVBERi0xLjQK...",
|
||||
"name": "document.pdf",
|
||||
"mime": "application/pdf"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
- Maximale Dateigröße: 20MB pro Datei
|
||||
- Dateien werden in den Cloud-Speicher hochgeladen und in UserFile-Objekte mit allen Eigenschaften umgewandelt
|
||||
|
||||
**2. Direkte URL-Referenzen**:
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [{
|
||||
"type": "url",
|
||||
"data": "https://example.com/document.pdf",
|
||||
"name": "document.pdf",
|
||||
"mime": "application/pdf"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
- Die Datei wird nicht hochgeladen, die URL wird direkt weitergegeben
|
||||
- Nützlich für die Referenzierung bestehender Dateien
|
||||
|
||||
### Dateieigenschaften
|
||||
|
||||
Für Dateien können alle Eigenschaften abgerufen werden:
|
||||
|
||||
| Eigenschaft | Beschreibung | Typ |
|
||||
|----------|-------------|------|
|
||||
| `<api.fieldName[0].url>` | Signierte Download-URL | string |
|
||||
| `<api.fieldName[0].name>` | Ursprünglicher Dateiname | string |
|
||||
| `<api.fieldName[0].size>` | Dateigröße in Bytes | number |
|
||||
| `<api.fieldName[0].type>` | MIME-Typ | string |
|
||||
| `<api.fieldName[0].uploadedAt>` | Upload-Zeitstempel (ISO 8601) | string |
|
||||
| `<api.fieldName[0].expiresAt>` | URL-Ablaufzeitstempel (ISO 8601) | string |
|
||||
|
||||
Für URL-referenzierte Dateien sind dieselben Eigenschaften verfügbar, außer `uploadedAt` und `expiresAt`, da die Datei nicht in unseren Speicher hochgeladen wird.
|
||||
|
||||
Wenn kein Eingabeformat definiert ist, stellt der Executor das rohe JSON nur unter `<api.input>` zur Verfügung.
|
||||
|
||||
<Callout type="warning">
|
||||
Ein Workflow kann nur einen API-Trigger enthalten. Veröffentlichen Sie nach Änderungen eine neue Bereitstellung, damit der Endpunkt aktuell bleibt.
|
||||
</Callout>
|
||||
|
||||
@@ -41,3 +41,11 @@ Dateien enthalten `name`, `mimeType` und einen signierten Download `url`.
|
||||
<Callout type="info">
|
||||
Der Builder blockiert mehrere Chat-Auslöser-Blöcke im selben Workflow.
|
||||
</Callout>
|
||||
|
||||
1. Fügen Sie einen Chat-Trigger-Block pro Workflow hinzu.
|
||||
2. Stellen Sie den Workflow im Chat-Modus bereit.
|
||||
3. Teilen Sie den Bereitstellungslink – jede Antwort verwendet die Konversations-ID wieder, damit der Workflow den Kontext beibehalten kann.
|
||||
|
||||
<Callout type="info">
|
||||
Der Builder blockiert mehrere Chat-Trigger-Blöcke im selben Workflow.
|
||||
</Callout>
|
||||
|
||||
@@ -1,242 +0,0 @@
|
||||
---
|
||||
title: Block-Referenz-Syntax
|
||||
description: Wie man Daten zwischen Blöcken in YAML-Workflows referenziert
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
|
||||
Block-Referenzen sind die Grundlage des Datenflusses in Sim-Workflows. Das Verständnis, wie man Ausgaben von einem Block korrekt als Eingaben für einen anderen referenziert, ist essenziell für den Aufbau funktionaler Workflows.
|
||||
|
||||
## Grundlegende Referenzregeln
|
||||
|
||||
### 1. Verwende Blocknamen, nicht Block-IDs
|
||||
|
||||
<Tabs items={['Correct', 'Incorrect']}>
|
||||
<Tab>
|
||||
|
||||
```yaml
|
||||
# Block definition
|
||||
email-sender:
|
||||
type: agent
|
||||
name: "Email Generator"
|
||||
# ... configuration
|
||||
|
||||
# Reference the block
|
||||
next-block:
|
||||
inputs:
|
||||
userPrompt: "Process this: <emailgenerator.content>"
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```yaml
|
||||
# Block definition
|
||||
email-sender:
|
||||
type: agent
|
||||
name: "Email Generator"
|
||||
# ... configuration
|
||||
|
||||
# ❌ Don't reference by block ID
|
||||
next-block:
|
||||
inputs:
|
||||
userPrompt: "Process this: <email-sender.content>"
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### 2. Namen in Referenzformat umwandeln
|
||||
|
||||
Um eine Block-Referenz zu erstellen:
|
||||
|
||||
1. **Nimm den Blocknamen**: "Email Generator"
|
||||
2. **Konvertiere zu Kleinbuchstaben**: "email generator"
|
||||
3. **Entferne Leerzeichen und Sonderzeichen**: "emailgenerator"
|
||||
4. **Füge Eigenschaft hinzu**: `<emailgenerator.content>`
|
||||
|
||||
### 3. Verwende die richtigen Eigenschaften
|
||||
|
||||
Verschiedene Blocktypen stellen unterschiedliche Eigenschaften bereit:
|
||||
|
||||
- **Agent-Blöcke**: `.content` (die KI-Antwort)
|
||||
- **Funktionsblöcke**: `.output` (der Rückgabewert)
|
||||
- **API-Blöcke**: `.output` (die Antwortdaten)
|
||||
- **Tool-Blöcke**: `.output` (das Tool-Ergebnis)
|
||||
|
||||
## Referenzbeispiele
|
||||
|
||||
### Häufige Block-Referenzen
|
||||
|
||||
```yaml
|
||||
# Agent block outputs
|
||||
<agentname.content> # Primary AI response
|
||||
<agentname.tokens> # Token usage information
|
||||
<agentname.cost> # Estimated cost
|
||||
<agentname.tool_calls> # Tool execution details
|
||||
|
||||
# Function block outputs
|
||||
<functionname.output> # Function return value
|
||||
<functionname.error> # Error information (if any)
|
||||
|
||||
# API block outputs
|
||||
<apiname.output> # Response data
|
||||
<apiname.status> # HTTP status code
|
||||
<apiname.headers> # Response headers
|
||||
|
||||
# Tool block outputs
|
||||
<toolname.output> # Tool execution result
|
||||
```
|
||||
|
||||
### Blocknamen mit mehreren Wörtern
|
||||
|
||||
```yaml
|
||||
# Block name: "Data Processor 2"
|
||||
<dataprocessor2.output>
|
||||
|
||||
# Block name: "Email Validation Service"
|
||||
<emailvalidationservice.output>
|
||||
|
||||
# Block name: "Customer Info Agent"
|
||||
<customerinfoagent.content>
|
||||
```
|
||||
|
||||
## Spezielle Referenzfälle
|
||||
|
||||
### Starter-Block
|
||||
|
||||
<Callout type="warning">
|
||||
Der Starter-Block wird immer als `<start.input>` referenziert, unabhängig von seinem tatsächlichen Namen.
|
||||
</Callout>
|
||||
|
||||
```yaml
|
||||
# Starter block definition
|
||||
my-custom-start:
|
||||
type: starter
|
||||
name: "Custom Workflow Start"
|
||||
# ... configuration
|
||||
|
||||
# Always reference as 'start'
|
||||
agent-1:
|
||||
inputs:
|
||||
userPrompt: <start.input> # ✅ Correct
|
||||
# userPrompt: <customworkflowstart.input> # ❌ Wrong
|
||||
```
|
||||
|
||||
### Schleifenvariablen
|
||||
|
||||
Innerhalb von Schleifenblöcken sind spezielle Variablen verfügbar:
|
||||
|
||||
```yaml
|
||||
# Available in loop child blocks
|
||||
<loop.index> # Current iteration (0-based)
|
||||
<loop.currentItem> # Current item being processed (forEach loops)
|
||||
<loop.items> # Full collection (forEach loops)
|
||||
```
|
||||
|
||||
### Parallele Variablen
|
||||
|
||||
Innerhalb von parallelen Blöcken sind spezielle Variablen verfügbar:
|
||||
|
||||
```yaml
|
||||
# Available in parallel child blocks
|
||||
<parallel.index> # Instance number (0-based)
|
||||
<parallel.currentItem> # Item for this instance
|
||||
<parallel.items> # Full collection
|
||||
```
|
||||
|
||||
## Komplexe Referenzbeispiele
|
||||
|
||||
### Zugriff auf verschachtelte Daten
|
||||
|
||||
Bei der Referenzierung komplexer Objekte wird die Punktnotation verwendet:
|
||||
|
||||
```yaml
|
||||
# If an agent returns structured data
|
||||
data-analyzer:
|
||||
type: agent
|
||||
name: "Data Analyzer"
|
||||
inputs:
|
||||
responseFormat: |
|
||||
{
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"analysis": {"type": "object"},
|
||||
"summary": {"type": "string"},
|
||||
"metrics": {"type": "object"}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Reference nested properties
|
||||
next-step:
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Summary: <dataanalyzer.analysis.summary>
|
||||
Score: <dataanalyzer.metrics.score>
|
||||
Full data: <dataanalyzer.content>
|
||||
```
|
||||
|
||||
### Mehrere Referenzen im Text
|
||||
|
||||
```yaml
|
||||
email-composer:
|
||||
type: agent
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Create an email with the following information:
|
||||
|
||||
Customer: <customeragent.content>
|
||||
Order Details: <orderprocessor.output>
|
||||
Support Ticket: <ticketanalyzer.content>
|
||||
|
||||
Original request: <start.input>
|
||||
```
|
||||
|
||||
### Referenzen in Codeblöcken
|
||||
|
||||
Bei der Verwendung von Referenzen in Funktionsblöcken werden diese als JavaScript-Werte ersetzt:
|
||||
|
||||
```yaml
|
||||
data-processor:
|
||||
type: function
|
||||
inputs:
|
||||
code: |
|
||||
// References are replaced with actual values
|
||||
const customerData = <customeragent.content>;
|
||||
const orderInfo = <orderprocessor.output>;
|
||||
const originalInput = <start.input>;
|
||||
|
||||
// Process the data
|
||||
return {
|
||||
customer: customerData.name,
|
||||
orderId: orderInfo.id,
|
||||
processed: true
|
||||
};
|
||||
```
|
||||
|
||||
## Referenzvalidierung
|
||||
|
||||
Sim validiert alle Referenzen beim Importieren von YAML:
|
||||
|
||||
### Gültige Referenzen
|
||||
- Block existiert im Workflow
|
||||
- Eigenschaft ist für den Blocktyp geeignet
|
||||
- Keine zirkulären Abhängigkeiten
|
||||
- Korrekte Syntaxformatierung
|
||||
|
||||
### Häufige Fehler
|
||||
- **Block nicht gefunden**: Referenzierter Block existiert nicht
|
||||
- **Falsche Eigenschaft**: Verwendung von `.content` in einem Funktionsblock
|
||||
- **Tippfehler**: Falsch geschriebene Blocknamen oder Eigenschaften
|
||||
- **Zirkuläre Referenzen**: Block referenziert sich direkt oder indirekt selbst
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Verwende beschreibende Blocknamen**: Macht Referenzen lesbarer
|
||||
2. **Sei konsistent**: Verwende die gleiche Namenskonvention durchgängig
|
||||
3. **Überprüfe Referenzen**: Stelle sicher, dass alle referenzierten Blöcke existieren
|
||||
4. **Vermeide tiefe Verschachtelungen**: Halte Referenzketten überschaubar
|
||||
5. **Dokumentiere komplexe Abläufe**: Füge Kommentare hinzu, um Referenzbeziehungen zu erklären
|
||||
@@ -1,218 +0,0 @@
|
||||
---
|
||||
title: Agent Block YAML Schema
|
||||
description: YAML-Konfigurationsreferenz für Agent-Blöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [agent]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this agent block
|
||||
inputs:
|
||||
type: object
|
||||
properties:
|
||||
systemPrompt:
|
||||
type: string
|
||||
description: Instructions that define the agent's role and behavior
|
||||
userPrompt:
|
||||
type: string
|
||||
description: Input content to process (can reference other blocks)
|
||||
model:
|
||||
type: string
|
||||
description: AI model identifier (e.g., gpt-4o, gemini-2.5-pro, deepseek-chat)
|
||||
temperature:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 2
|
||||
description: Response creativity level (varies by model)
|
||||
apiKey:
|
||||
type: string
|
||||
description: API key for the model provider (use {{ENV_VAR}} format)
|
||||
azureEndpoint:
|
||||
type: string
|
||||
description: Azure OpenAI endpoint URL (required for Azure models)
|
||||
azureApiVersion:
|
||||
type: string
|
||||
description: Azure API version (required for Azure models)
|
||||
memories:
|
||||
type: string
|
||||
description: Memory context from memory blocks
|
||||
tools:
|
||||
type: array
|
||||
description: List of external tools the agent can use
|
||||
items:
|
||||
type: object
|
||||
required: [type, title, toolId, operation, usageControl]
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
description: Tool type identifier
|
||||
title:
|
||||
type: string
|
||||
description: Human-readable display name
|
||||
toolId:
|
||||
type: string
|
||||
description: Internal tool identifier
|
||||
operation:
|
||||
type: string
|
||||
description: Tool operation/method name
|
||||
usageControl:
|
||||
type: string
|
||||
enum: [auto, required, none]
|
||||
description: When AI can use the tool
|
||||
params:
|
||||
type: object
|
||||
description: Tool-specific configuration parameters
|
||||
isExpanded:
|
||||
type: boolean
|
||||
description: UI state
|
||||
default: false
|
||||
responseFormat:
|
||||
type: object
|
||||
description: JSON Schema to enforce structured output
|
||||
required:
|
||||
- model
|
||||
- apiKey
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful execution
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Tool-Konfiguration
|
||||
|
||||
Tools werden als Array definiert, wobei jedes Tool diese Struktur hat:
|
||||
|
||||
```yaml
|
||||
tools:
|
||||
- type: <string> # Tool type identifier (exa, gmail, slack, etc.)
|
||||
title: <string> # Human-readable display name
|
||||
toolId: <string> # Internal tool identifier
|
||||
operation: <string> # Tool operation/method name
|
||||
usageControl: <string> # When AI can use it (auto | required | none)
|
||||
params: <object> # Tool-specific configuration parameters
|
||||
isExpanded: <boolean> # UI state (optional, default: false)
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Verbindungen definieren, wohin der Workflow basierend auf Ausführungsergebnissen geht:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful execution
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Einfacher Agent
|
||||
|
||||
```yaml
|
||||
content-agent:
|
||||
type: agent
|
||||
name: "Content Analyzer 1"
|
||||
inputs:
|
||||
systemPrompt: "You are a helpful content analyzer. Be concise and clear."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
temperature: 0.3
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: summary-block
|
||||
|
||||
summary-block:
|
||||
type: agent
|
||||
name: "Summary Generator"
|
||||
inputs:
|
||||
systemPrompt: "Create a brief summary of the analysis."
|
||||
userPrompt: "Analyze this: <contentanalyzer1.content>"
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: final-step
|
||||
```
|
||||
|
||||
### Agent mit Tools
|
||||
|
||||
```yaml
|
||||
research-agent:
|
||||
type: agent
|
||||
name: "Research Assistant"
|
||||
inputs:
|
||||
systemPrompt: "Research the topic and provide detailed information."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
tools:
|
||||
- type: exa
|
||||
title: "Web Search"
|
||||
toolId: exa_search
|
||||
operation: exa_search
|
||||
usageControl: auto
|
||||
params:
|
||||
apiKey: '{{EXA_API_KEY}}'
|
||||
connections:
|
||||
success: summary-block
|
||||
```
|
||||
|
||||
### Strukturierte Ausgabe
|
||||
|
||||
```yaml
|
||||
data-extractor:
|
||||
type: agent
|
||||
name: "Extract Contact Info"
|
||||
inputs:
|
||||
systemPrompt: "Extract contact information from the text."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
responseFormat: |
|
||||
{
|
||||
"name": "contact_extraction",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"email": {"type": "string"},
|
||||
"phone": {"type": "string"}
|
||||
},
|
||||
"required": ["name"]
|
||||
},
|
||||
"strict": true
|
||||
}
|
||||
connections:
|
||||
success: save-contact
|
||||
```
|
||||
|
||||
### Azure OpenAI
|
||||
|
||||
```yaml
|
||||
azure-agent:
|
||||
type: agent
|
||||
name: "Azure AI Assistant"
|
||||
inputs:
|
||||
systemPrompt: "You are a helpful assistant."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{AZURE_OPENAI_API_KEY}}'
|
||||
azureEndpoint: '{{AZURE_OPENAI_ENDPOINT}}'
|
||||
azureApiVersion: "2024-07-01-preview"
|
||||
connections:
|
||||
success: response-block
|
||||
```
|
||||
@@ -1,429 +0,0 @@
|
||||
---
|
||||
title: API Block YAML Schema
|
||||
description: YAML-Konfigurationsreferenz für API-Blöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [api]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this API block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- url
|
||||
- method
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
description: The endpoint URL to send the request to
|
||||
method:
|
||||
type: string
|
||||
enum: [GET, POST, PUT, DELETE, PATCH]
|
||||
description: HTTP method for the request
|
||||
default: GET
|
||||
params:
|
||||
type: array
|
||||
description: Query parameters as table entries
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- cells
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the parameter entry
|
||||
cells:
|
||||
type: object
|
||||
required:
|
||||
- Key
|
||||
- Value
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Parameter name
|
||||
Value:
|
||||
type: string
|
||||
description: Parameter value
|
||||
headers:
|
||||
type: array
|
||||
description: HTTP headers as table entries
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- cells
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the header entry
|
||||
cells:
|
||||
type: object
|
||||
required:
|
||||
- Key
|
||||
- Value
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Header name
|
||||
Value:
|
||||
type: string
|
||||
description: Header value
|
||||
body:
|
||||
type: string
|
||||
description: Request body for POST/PUT/PATCH methods
|
||||
timeout:
|
||||
type: number
|
||||
description: Request timeout in milliseconds
|
||||
default: 30000
|
||||
minimum: 1000
|
||||
maximum: 300000
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful requests
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Verbindungen definieren, wohin der Workflow basierend auf Anfrageergebnissen geht:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful requests
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Einfache GET-Anfrage
|
||||
|
||||
```yaml
|
||||
user-api:
|
||||
type: api
|
||||
name: "Fetch User Data"
|
||||
inputs:
|
||||
url: "https://api.example.com/users/123"
|
||||
method: GET
|
||||
headers:
|
||||
- id: header-1-uuid-here
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{API_TOKEN}}"
|
||||
- id: header-2-uuid-here
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
connections:
|
||||
success: process-user-data
|
||||
error: handle-api-error
|
||||
```
|
||||
|
||||
### POST-Anfrage mit Body
|
||||
|
||||
```yaml
|
||||
create-ticket:
|
||||
type: api
|
||||
name: "Create Support Ticket"
|
||||
inputs:
|
||||
url: "https://api.support.com/tickets"
|
||||
method: POST
|
||||
headers:
|
||||
- id: auth-header-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{SUPPORT_API_KEY}}"
|
||||
- id: content-type-uuid
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
body: |
|
||||
{
|
||||
"title": "<agent.title>",
|
||||
"description": "<agent.description>",
|
||||
"priority": "high"
|
||||
}
|
||||
connections:
|
||||
success: ticket-created
|
||||
error: ticket-error
|
||||
```
|
||||
|
||||
### Dynamische URL mit Abfrageparametern
|
||||
|
||||
```yaml
|
||||
search-api:
|
||||
type: api
|
||||
name: "Search Products"
|
||||
inputs:
|
||||
url: "https://api.store.com/products"
|
||||
method: GET
|
||||
params:
|
||||
- id: search-param-uuid
|
||||
cells:
|
||||
Key: "q"
|
||||
Value: <start.searchTerm>
|
||||
- id: limit-param-uuid
|
||||
cells:
|
||||
Key: "limit"
|
||||
Value: "10"
|
||||
- id: category-param-uuid
|
||||
cells:
|
||||
Key: "category"
|
||||
Value: <filter.category>
|
||||
headers:
|
||||
- id: auth-header-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{STORE_API_KEY}}"
|
||||
connections:
|
||||
success: display-results
|
||||
```
|
||||
|
||||
## Parameterformat
|
||||
|
||||
Header und Parameter (Abfrageparameter) verwenden das Tabellenformat mit folgender Struktur:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: unique-identifier-here
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
- id: another-unique-identifier
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{API_TOKEN}}"
|
||||
|
||||
params:
|
||||
- id: param-identifier-here
|
||||
cells:
|
||||
Key: "limit"
|
||||
Value: "10"
|
||||
```
|
||||
|
||||
**Strukturdetails:**
|
||||
- `id`: Eindeutige Kennung zur Verfolgung der Tabellenzeile
|
||||
- `cells.Key`: Der Parameter-/Header-Name
|
||||
- `cells.Value`: Der Parameter-/Header-Wert
|
||||
- Dieses Format ermöglicht eine ordnungsgemäße Tabellenverwaltung und Beibehaltung des UI-Status
|
||||
|
||||
## Ausgabereferenzen
|
||||
|
||||
Nach der Ausführung eines API-Blocks können Sie auf seine Ausgaben in nachfolgenden Blöcken verweisen. Der API-Block bietet drei Hauptausgaben:
|
||||
|
||||
### Verfügbare Ausgaben
|
||||
|
||||
| Ausgabe | Typ | Beschreibung |
|
||||
|--------|------|-------------|
|
||||
| `data` | any | Der Antworttext/die Nutzlast von der API |
|
||||
| `status` | number | HTTP-Statuscode (200, 404, 500, usw.) |
|
||||
| `headers` | object | Vom Server zurückgegebene Antwort-Header |
|
||||
|
||||
### Verwendungsbeispiele
|
||||
|
||||
```yaml
|
||||
# Reference API response data
|
||||
process-data:
|
||||
type: function
|
||||
name: "Process API Data"
|
||||
inputs:
|
||||
code: |
|
||||
const responseData = <fetchuserdata.data>;
|
||||
const statusCode = <fetchuserdata.status>;
|
||||
const responseHeaders = <fetchuserdata.headers>;
|
||||
|
||||
if (statusCode === 200) {
|
||||
return {
|
||||
success: true,
|
||||
user: responseData,
|
||||
contentType: responseHeaders['content-type']
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
success: false,
|
||||
error: `API call failed with status ${statusCode}`
|
||||
};
|
||||
}
|
||||
|
||||
# Use API data in an agent block
|
||||
analyze-response:
|
||||
type: agent
|
||||
name: "Analyze Response"
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Analyze this API response:
|
||||
|
||||
Status: <fetchuserdata.status>
|
||||
Data: <fetchuserdata.data>
|
||||
|
||||
Provide insights about the response.
|
||||
|
||||
# Conditional logic based on status
|
||||
check-status:
|
||||
type: condition
|
||||
name: "Check API Status"
|
||||
inputs:
|
||||
condition: <fetchuserdata.status> === 200
|
||||
connections:
|
||||
true: success-handler
|
||||
false: error-handler
|
||||
```
|
||||
|
||||
### Praktisches Beispiel
|
||||
|
||||
```yaml
|
||||
user-api:
|
||||
type: api
|
||||
name: "Fetch User Data"
|
||||
inputs:
|
||||
url: "https://api.example.com/users/123"
|
||||
method: GET
|
||||
connections:
|
||||
success: process-response
|
||||
|
||||
process-response:
|
||||
type: function
|
||||
name: "Process Response"
|
||||
inputs:
|
||||
code: |
|
||||
const user = <fetchuserdata.data>;
|
||||
const status = <fetchuserdata.status>;
|
||||
|
||||
console.log(`API returned status: ${status}`);
|
||||
console.log(`User data:`, user);
|
||||
|
||||
return {
|
||||
userId: user.id,
|
||||
email: user.email,
|
||||
isActive: status === 200
|
||||
};
|
||||
```
|
||||
|
||||
### Fehlerbehandlung
|
||||
|
||||
```yaml
|
||||
api-with-error-handling:
|
||||
type: api
|
||||
name: "API Call"
|
||||
inputs:
|
||||
url: "https://api.example.com/data"
|
||||
method: GET
|
||||
connections:
|
||||
success: check-response
|
||||
error: handle-error
|
||||
|
||||
check-response:
|
||||
type: condition
|
||||
name: "Check Response Status"
|
||||
inputs:
|
||||
condition: <apicall.status> >= 200 && <apicall.status> < 300
|
||||
connections:
|
||||
true: process-success
|
||||
false: handle-api-error
|
||||
|
||||
process-success:
|
||||
type: function
|
||||
name: "Process Success"
|
||||
inputs:
|
||||
code: |
|
||||
return {
|
||||
success: true,
|
||||
data: <apicall.data>,
|
||||
message: "API call successful"
|
||||
};
|
||||
|
||||
handle-api-error:
|
||||
type: function
|
||||
name: "Handle API Error"
|
||||
inputs:
|
||||
code: |
|
||||
return {
|
||||
success: false,
|
||||
status: <apicall.status>,
|
||||
error: "API call failed",
|
||||
data: <apicall.data>
|
||||
};
|
||||
```
|
||||
|
||||
## YAML-String-Escaping
|
||||
|
||||
Beim Schreiben von YAML müssen bestimmte Strings in Anführungszeichen gesetzt werden, um korrekt geparst zu werden:
|
||||
|
||||
### Strings, die in Anführungszeichen gesetzt werden müssen
|
||||
|
||||
```yaml
|
||||
# URLs with hyphens, colons, special characters
|
||||
url: "https://api.example.com/users/123"
|
||||
url: "https://my-api.example.com/data"
|
||||
|
||||
# Header values with hyphens or special characters
|
||||
headers:
|
||||
- id: header-uuid
|
||||
cells:
|
||||
Key: "User-Agent"
|
||||
Value: "My-Application/1.0"
|
||||
- id: auth-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer my-token-123"
|
||||
|
||||
# Parameter values with hyphens
|
||||
params:
|
||||
- id: param-uuid
|
||||
cells:
|
||||
Key: "sort-by"
|
||||
Value: "created-at"
|
||||
```
|
||||
|
||||
### Wann Anführungszeichen verwendet werden sollten
|
||||
|
||||
- ✅ **Immer in Anführungszeichen setzen**: URLs, Tokens, Werte mit Bindestrichen, Doppelpunkten oder Sonderzeichen
|
||||
- ✅ **Immer in Anführungszeichen setzen**: Werte, die mit Zahlen beginnen, aber Strings sein sollen
|
||||
- ✅ **Immer in Anführungszeichen setzen**: Boolean-ähnliche Strings, die als Strings erhalten bleiben sollen
|
||||
- ❌ **Nicht in Anführungszeichen setzen**: Einfache alphanumerische Strings ohne Sonderzeichen
|
||||
|
||||
### Beispiele
|
||||
|
||||
```yaml
|
||||
# ✅ Correct
|
||||
url: "https://api.stripe.com/v1/charges"
|
||||
headers:
|
||||
- id: auth-header
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer sk-test-123456789"
|
||||
|
||||
# ❌ Incorrect (may cause parsing errors)
|
||||
url: https://api.stripe.com/v1/charges
|
||||
headers:
|
||||
- id: auth-header
|
||||
cells:
|
||||
Key: Authorization
|
||||
Value: Bearer sk-test-123456789
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
- Umgebungsvariablen für API-Schlüssel verwenden: `{{API_KEY_NAME}}`
|
||||
- Fehlerbehandlung mit Fehlerverbindungen einbeziehen
|
||||
- Angemessene Timeouts für deinen Anwendungsfall festlegen
|
||||
- Statuscode der Antwort in nachfolgenden Blöcken validieren
|
||||
- Aussagekräftige Blocknamen für einfachere Referenzierung verwenden
|
||||
- **Strings mit Sonderzeichen, URLs und Tokens immer in Anführungszeichen setzen**
|
||||
@@ -1,165 +0,0 @@
|
||||
---
|
||||
title: Bedingungsblock YAML-Schema
|
||||
description: YAML-Konfigurationsreferenz für Bedingungsblöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
- connections
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [condition]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this condition block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- conditions
|
||||
properties:
|
||||
conditions:
|
||||
type: object
|
||||
description: Conditional expressions and their logic
|
||||
properties:
|
||||
if:
|
||||
type: string
|
||||
description: Primary condition expression (boolean)
|
||||
else-if:
|
||||
type: string
|
||||
description: Secondary condition expression (optional)
|
||||
else-if-2:
|
||||
type: string
|
||||
description: Third condition expression (optional)
|
||||
else-if-3:
|
||||
type: string
|
||||
description: Fourth condition expression (optional)
|
||||
# Additional else-if-N conditions can be added as needed
|
||||
else:
|
||||
type: boolean
|
||||
description: Default fallback condition (optional)
|
||||
default: true
|
||||
connections:
|
||||
type: object
|
||||
required:
|
||||
- conditions
|
||||
properties:
|
||||
conditions:
|
||||
type: object
|
||||
description: Target blocks for each condition outcome
|
||||
properties:
|
||||
if:
|
||||
type: string
|
||||
description: Target block ID when 'if' condition is true
|
||||
else-if:
|
||||
type: string
|
||||
description: Target block ID when 'else-if' condition is true
|
||||
else-if-2:
|
||||
type: string
|
||||
description: Target block ID when 'else-if-2' condition is true
|
||||
else-if-3:
|
||||
type: string
|
||||
description: Target block ID when 'else-if-3' condition is true
|
||||
# Additional else-if-N connections can be added as needed
|
||||
else:
|
||||
type: string
|
||||
description: Target block ID when no conditions match
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Im Gegensatz zu anderen Blöcken verwenden Bedingungen verzweigte Verbindungen basierend auf Bedingungsergebnissen:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
conditions:
|
||||
if: <string> # Target block ID when primary condition is true
|
||||
else-if: <string> # Target block ID when secondary condition is true (optional)
|
||||
else-if-2: <string> # Target block ID when third condition is true (optional)
|
||||
else-if-3: <string> # Target block ID when fourth condition is true (optional)
|
||||
# Additional else-if-N connections can be added as needed
|
||||
else: <string> # Target block ID when no conditions match (optional)
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Einfaches If-Else
|
||||
|
||||
```yaml
|
||||
status-check:
|
||||
type: condition
|
||||
name: "Status Check"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <start.status> === "approved"
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: send-approval-email
|
||||
else: send-rejection-email
|
||||
```
|
||||
|
||||
### Mehrere Bedingungen
|
||||
|
||||
```yaml
|
||||
user-routing:
|
||||
type: condition
|
||||
name: "User Type Router"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <start.user_type> === "admin"
|
||||
else-if: <start.user_type> === "premium"
|
||||
else-if-2: <start.user_type> === "basic"
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: admin-dashboard
|
||||
else-if: premium-features
|
||||
else-if-2: basic-features
|
||||
else: registration-flow
|
||||
```
|
||||
|
||||
### Numerische Vergleiche
|
||||
|
||||
```yaml
|
||||
score-evaluation:
|
||||
type: condition
|
||||
name: "Score Evaluation"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <agent.score> >= 90
|
||||
else-if: <agent.score> >= 70
|
||||
else-if-2: <agent.score> >= 50
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: excellent-response
|
||||
else-if: good-response
|
||||
else-if-2: average-response
|
||||
else: poor-response
|
||||
```
|
||||
|
||||
### Komplexe Logik
|
||||
|
||||
```yaml
|
||||
eligibility-check:
|
||||
type: condition
|
||||
name: "Eligibility Check"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <start.age> >= 18 && <start.verified> === true
|
||||
else-if: <start.age> >= 16 && <start.parent_consent> === true
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: full-access
|
||||
else-if: limited-access
|
||||
else: access-denied
|
||||
```
|
||||
@@ -1,255 +0,0 @@
|
||||
---
|
||||
title: Evaluator Block YAML Schema
|
||||
description: YAML-Konfigurationsreferenz für Evaluator-Blöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [evaluator]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this evaluator block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- content
|
||||
- metrics
|
||||
- model
|
||||
- apiKey
|
||||
properties:
|
||||
content:
|
||||
type: string
|
||||
description: Content to evaluate (can reference other blocks)
|
||||
metrics:
|
||||
type: array
|
||||
description: Evaluation criteria and scoring ranges
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: Metric identifier
|
||||
description:
|
||||
type: string
|
||||
description: Detailed explanation of what the metric measures
|
||||
range:
|
||||
type: object
|
||||
properties:
|
||||
min:
|
||||
type: number
|
||||
description: Minimum score value
|
||||
max:
|
||||
type: number
|
||||
description: Maximum score value
|
||||
required: [min, max]
|
||||
description: Scoring range with numeric bounds
|
||||
model:
|
||||
type: string
|
||||
description: AI model identifier (e.g., gpt-4o, claude-3-5-sonnet-20241022)
|
||||
apiKey:
|
||||
type: string
|
||||
description: API key for the model provider (use {{ENV_VAR}} format)
|
||||
temperature:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 2
|
||||
description: Model temperature for evaluation
|
||||
default: 0.3
|
||||
azureEndpoint:
|
||||
type: string
|
||||
description: Azure OpenAI endpoint URL (required for Azure models)
|
||||
azureApiVersion:
|
||||
type: string
|
||||
description: Azure API version (required for Azure models)
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful evaluation
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Verbindungen definieren, wohin der Workflow basierend auf den Evaluierungsergebnissen geht:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful evaluation
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Bewertung der Inhaltsqualität
|
||||
|
||||
```yaml
|
||||
content-evaluator:
|
||||
type: evaluator
|
||||
name: "Content Quality Evaluator"
|
||||
inputs:
|
||||
content: <content-generator.content>
|
||||
metrics:
|
||||
- name: "accuracy"
|
||||
description: "How factually accurate is the content?"
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
- name: "clarity"
|
||||
description: "How clear and understandable is the content?"
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
- name: "relevance"
|
||||
description: "How relevant is the content to the original query?"
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
- name: "completeness"
|
||||
description: "How complete and comprehensive is the content?"
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
model: gpt-4o
|
||||
temperature: 0.2
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: quality-report
|
||||
error: evaluation-error
|
||||
```
|
||||
|
||||
### Bewertung der Kundenantwort
|
||||
|
||||
```yaml
|
||||
response-evaluator:
|
||||
type: evaluator
|
||||
name: "Customer Response Evaluator"
|
||||
inputs:
|
||||
content: <customer-agent.content>
|
||||
metrics:
|
||||
- name: "helpfulness"
|
||||
description: "How helpful is the response in addressing the customer's needs?"
|
||||
range:
|
||||
min: 1
|
||||
max: 10
|
||||
- name: "tone"
|
||||
description: "How appropriate and professional is the tone?"
|
||||
range:
|
||||
min: 1
|
||||
max: 10
|
||||
- name: "completeness"
|
||||
description: "Does the response fully address all aspects of the inquiry?"
|
||||
range:
|
||||
min: 1
|
||||
max: 10
|
||||
model: claude-3-5-sonnet-20241022
|
||||
apiKey: '{{ANTHROPIC_API_KEY}}'
|
||||
connections:
|
||||
success: response-processor
|
||||
```
|
||||
|
||||
### A/B-Test-Evaluierung
|
||||
|
||||
```yaml
|
||||
ab-test-evaluator:
|
||||
type: evaluator
|
||||
name: "A/B Test Evaluator"
|
||||
inputs:
|
||||
content: |
|
||||
Version A: <version-a.content>
|
||||
Version B: <version-b.content>
|
||||
|
||||
Compare these two versions for the following criteria.
|
||||
metrics:
|
||||
- name: "engagement"
|
||||
description: "Which version is more likely to engage users?"
|
||||
range: "A, B, or Tie"
|
||||
- name: "clarity"
|
||||
description: "Which version communicates more clearly?"
|
||||
range: "A, B, or Tie"
|
||||
- name: "persuasiveness"
|
||||
description: "Which version is more persuasive?"
|
||||
range: "A, B, or Tie"
|
||||
model: gpt-4o
|
||||
temperature: 0.1
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: test-results
|
||||
```
|
||||
|
||||
### Mehrdimensionale Inhaltsbewertung
|
||||
|
||||
```yaml
|
||||
comprehensive-evaluator:
|
||||
type: evaluator
|
||||
name: "Comprehensive Content Evaluator"
|
||||
inputs:
|
||||
content: <ai-writer.content>
|
||||
metrics:
|
||||
- name: "technical_accuracy"
|
||||
description: "How technically accurate and correct is the information?"
|
||||
range:
|
||||
min: 0
|
||||
max: 100
|
||||
- name: "readability"
|
||||
description: "How easy is the content to read and understand?"
|
||||
range:
|
||||
min: 0
|
||||
max: 100
|
||||
- name: "seo_optimization"
|
||||
description: "How well optimized is the content for search engines?"
|
||||
range:
|
||||
min: 0
|
||||
max: 100
|
||||
- name: "user_engagement"
|
||||
description: "How likely is this content to engage and retain readers?"
|
||||
range:
|
||||
min: 0
|
||||
max: 100
|
||||
- name: "brand_alignment"
|
||||
description: "How well does the content align with brand voice and values?"
|
||||
range:
|
||||
min: 0
|
||||
max: 100
|
||||
model: gpt-4o
|
||||
temperature: 0.3
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: content-optimization
|
||||
```
|
||||
|
||||
## Output-Referenzen
|
||||
|
||||
Nach der Ausführung eines Evaluator-Blocks können Sie auf seine Ausgaben verweisen:
|
||||
|
||||
```yaml
|
||||
# In subsequent blocks
|
||||
next-block:
|
||||
inputs:
|
||||
evaluation: <evaluator-name.content> # Evaluation summary
|
||||
scores: <evaluator-name.scores> # Individual metric scores
|
||||
overall: <evaluator-name.overall> # Overall assessment
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
- Definieren Sie klare, spezifische Bewertungskriterien
|
||||
- Verwenden Sie angemessene Bewertungsbereiche für Ihren Anwendungsfall
|
||||
- Wählen Sie Modelle mit starken Argumentationsfähigkeiten
|
||||
- Verwenden Sie niedrigere Temperaturwerte für konsistente Bewertungen
|
||||
- Fügen Sie detaillierte Metrikbeschreibungen hinzu
|
||||
- Testen Sie mit verschiedenen Inhaltstypen
|
||||
- Erwägen Sie mehrere Evaluatoren für komplexe Bewertungen
|
||||
@@ -1,162 +0,0 @@
|
||||
---
|
||||
title: Funktionsblock YAML-Schema
|
||||
description: YAML-Konfigurationsreferenz für Funktionsblöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [function]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this function block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- code
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
description: JavaScript/TypeScript code to execute (multiline string)
|
||||
timeout:
|
||||
type: number
|
||||
description: Maximum execution time in milliseconds
|
||||
default: 30000
|
||||
minimum: 1000
|
||||
maximum: 300000
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful execution
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Verbindungen definieren, wohin der Workflow basierend auf den Ausführungsergebnissen geht:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful execution
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Einfache Validierung
|
||||
|
||||
```yaml
|
||||
input-validator:
|
||||
type: function
|
||||
name: "Input Validator"
|
||||
inputs:
|
||||
code: |-
|
||||
// Check if input number is greater than 5
|
||||
const inputValue = parseInt(<start.input>, 10);
|
||||
|
||||
if (inputValue > 5) {
|
||||
return {
|
||||
valid: true,
|
||||
value: inputValue,
|
||||
message: "Input is valid"
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
valid: false,
|
||||
value: inputValue,
|
||||
message: "Input must be greater than 5"
|
||||
};
|
||||
}
|
||||
connections:
|
||||
success: next-step
|
||||
error: handle-error
|
||||
```
|
||||
|
||||
### Datenverarbeitung
|
||||
|
||||
```yaml
|
||||
data-processor:
|
||||
type: function
|
||||
name: "Data Transformer"
|
||||
inputs:
|
||||
code: |
|
||||
// Transform the input data
|
||||
const rawData = <start.input>;
|
||||
|
||||
// Process and clean the data
|
||||
const processed = rawData
|
||||
.filter(item => item.status === 'active')
|
||||
.map(item => ({
|
||||
id: item.id,
|
||||
name: item.name.trim(),
|
||||
date: new Date(item.created).toISOString()
|
||||
}));
|
||||
|
||||
return processed;
|
||||
connections:
|
||||
success: api-save
|
||||
error: error-handler
|
||||
```
|
||||
|
||||
### API-Integration
|
||||
|
||||
```yaml
|
||||
api-formatter:
|
||||
type: function
|
||||
name: "Format API Request"
|
||||
inputs:
|
||||
code: |
|
||||
// Prepare data for API submission
|
||||
const userData = <agent.response>;
|
||||
|
||||
const apiPayload = {
|
||||
timestamp: new Date().toISOString(),
|
||||
data: userData,
|
||||
source: "workflow-automation",
|
||||
version: "1.0"
|
||||
};
|
||||
|
||||
return apiPayload;
|
||||
connections:
|
||||
success: api-call
|
||||
```
|
||||
|
||||
### Berechnungen
|
||||
|
||||
```yaml
|
||||
calculator:
|
||||
type: function
|
||||
name: "Calculate Results"
|
||||
inputs:
|
||||
code: |
|
||||
// Perform calculations on input data
|
||||
const numbers = <start.input>;
|
||||
|
||||
const sum = numbers.reduce((a, b) => a + b, 0);
|
||||
const average = sum / numbers.length;
|
||||
const max = Math.max(...numbers);
|
||||
const min = Math.min(...numbers);
|
||||
|
||||
return {
|
||||
sum,
|
||||
average,
|
||||
max,
|
||||
min,
|
||||
count: numbers.length
|
||||
};
|
||||
connections:
|
||||
success: results-display
|
||||
```
|
||||
@@ -1,151 +0,0 @@
|
||||
---
|
||||
title: Block-Schemas
|
||||
description: Vollständige YAML-Schema-Referenz für alle Sim-Blöcke
|
||||
---
|
||||
|
||||
import { Card, Cards } from "fumadocs-ui/components/card";
|
||||
|
||||
Dieser Abschnitt enthält die vollständigen YAML-Schema-Definitionen für alle verfügbaren Blocktypen in Sim. Jeder Blocktyp hat spezifische Konfigurationsanforderungen und Ausgabeformate.
|
||||
|
||||
## Kernblöcke
|
||||
|
||||
Dies sind die wesentlichen Bausteine für die Erstellung von Workflows:
|
||||
|
||||
<Cards>
|
||||
<Card title="Starter-Block" href="/yaml/blocks/starter">
|
||||
Workflow-Einstiegspunkt mit Unterstützung für manuelle Auslöser, Webhooks und Zeitpläne
|
||||
</Card>
|
||||
<Card title="Agent-Block" href="/yaml/blocks/agent">
|
||||
KI-gestützte Verarbeitung mit LLM-Integration und Tool-Unterstützung
|
||||
</Card>
|
||||
<Card title="Funktions-Block" href="/yaml/blocks/function">
|
||||
Ausführungsumgebung für benutzerdefinierten JavaScript/TypeScript-Code
|
||||
</Card>
|
||||
<Card title="Antwort-Block" href="/yaml/blocks/response">
|
||||
Formatierung und Rückgabe der endgültigen Workflow-Ergebnisse
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Logik & Kontrollfluss
|
||||
|
||||
Blöcke zur Implementierung von bedingter Logik und Kontrollfluss:
|
||||
|
||||
<Cards>
|
||||
<Card title="Bedingungsblock" href="/yaml/blocks/condition">
|
||||
Bedingte Verzweigung basierend auf booleschen Ausdrücken
|
||||
</Card>
|
||||
<Card title="Router-Block" href="/yaml/blocks/router">
|
||||
KI-gestützte intelligente Weiterleitung zu mehreren Pfaden
|
||||
</Card>
|
||||
<Card title="Schleifenblock" href="/yaml/blocks/loop">
|
||||
Iterative Verarbeitung mit for- und forEach-Schleifen
|
||||
</Card>
|
||||
<Card title="Parallel-Block" href="/yaml/blocks/parallel">
|
||||
Gleichzeitige Ausführung über mehrere Instanzen
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Integrationsblöcke
|
||||
|
||||
Blöcke zur Verbindung mit externen Diensten und Systemen:
|
||||
|
||||
<Cards>
|
||||
<Card title="API-Block" href="/yaml/blocks/api">
|
||||
HTTP-Anfragen an externe REST-APIs
|
||||
</Card>
|
||||
<Card title="Webhook-Block" href="/yaml/blocks/webhook">
|
||||
Webhook-Auslöser für externe Integrationen
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Erweiterte Blöcke
|
||||
|
||||
Spezialisierte Blöcke für komplexe Workflow-Muster:
|
||||
|
||||
<Cards>
|
||||
<Card title="Evaluator-Block" href="/yaml/blocks/evaluator">
|
||||
Validierung von Ausgaben anhand definierter Kriterien und Metriken
|
||||
</Card>
|
||||
<Card title="Workflow-Block" href="/yaml/blocks/workflow">
|
||||
Ausführung anderer Workflows als wiederverwendbare Komponenten
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Gemeinsame Schema-Elemente
|
||||
|
||||
Alle Blöcke teilen diese gemeinsamen Elemente:
|
||||
|
||||
### Grundstruktur
|
||||
|
||||
```yaml
|
||||
block-id:
|
||||
type: <block-type>
|
||||
name: <display-name>
|
||||
inputs:
|
||||
# Block-specific configuration
|
||||
connections:
|
||||
# Connection definitions
|
||||
```
|
||||
|
||||
### Verbindungstypen
|
||||
|
||||
- **success**: Zielblock für erfolgreiche Ausführung
|
||||
- **error**: Zielblock für Fehlerbehandlung (optional)
|
||||
- **conditions**: Mehrere Pfade für bedingte Blöcke
|
||||
|
||||
### Umgebungsvariablen
|
||||
|
||||
Verwende doppelte geschweifte Klammern für Umgebungsvariablen:
|
||||
|
||||
```yaml
|
||||
inputs:
|
||||
apiKey: '{{API_KEY_NAME}}'
|
||||
endpoint: '{{SERVICE_ENDPOINT}}'
|
||||
```
|
||||
|
||||
### Blockreferenzen
|
||||
|
||||
Referenziere andere Blockausgaben mit dem Blocknamen in Kleinbuchstaben:
|
||||
|
||||
```yaml
|
||||
inputs:
|
||||
userPrompt: <blockname.content>
|
||||
data: <functionblock.output>
|
||||
originalInput: <start.input>
|
||||
```
|
||||
|
||||
## Validierungsregeln
|
||||
|
||||
Alle YAML-Blöcke werden anhand ihrer Schemas validiert:
|
||||
|
||||
1. **Pflichtfelder**: Müssen vorhanden sein
|
||||
2. **Typvalidierung**: Werte müssen den erwarteten Typen entsprechen
|
||||
3. **Enum-Validierung**: Zeichenkettenwerte müssen aus erlaubten Listen stammen
|
||||
4. **Bereichsvalidierung**: Zahlen müssen innerhalb festgelegter Bereiche liegen
|
||||
5. **Mustervalidierung**: Zeichenketten müssen Regex-Mustern entsprechen (wo anwendbar)
|
||||
|
||||
## Kurzreferenz
|
||||
|
||||
### Blocktypen und Eigenschaften
|
||||
|
||||
| Blocktyp | Primäre Ausgabe | Häufige Anwendungsfälle |
|
||||
|------------|----------------|------------------|
|
||||
| starter | `.input` | Workflow-Einstiegspunkt |
|
||||
| agent | `.content` | KI-Verarbeitung, Texterstellung |
|
||||
| function | `.output` | Datentransformation, Berechnungen |
|
||||
| api | `.output` | Integration externer Dienste |
|
||||
| condition | N/A (Verzweigung) | Bedingte Logik |
|
||||
| router | N/A (Verzweigung) | Intelligentes Routing |
|
||||
| response | N/A (Terminal) | Formatierung der Endausgabe |
|
||||
| loop | `.results` | Iterative Verarbeitung |
|
||||
| parallel | `.results` | Gleichzeitige Verarbeitung |
|
||||
| webhook | `.payload` | Externe Auslöser |
|
||||
| evaluator | `.score` | Ausgabevalidierung, Qualitätsbewertung |
|
||||
| workflow | `.output` | Ausführung von Unterworkflows, Modularität |
|
||||
|
||||
### Erforderlich vs. Optional
|
||||
|
||||
- **Immer erforderlich**: `type`, `name`
|
||||
- **Normalerweise erforderlich**: `inputs`, `connections`
|
||||
- **Kontextabhängig**: Spezifische Eingabefelder variieren je nach Blocktyp
|
||||
- **Immer optional**: `error`Verbindungen, UI-spezifische Felder
|
||||
@@ -1,312 +0,0 @@
|
||||
---
|
||||
title: Parallel Block YAML Schema
|
||||
description: YAML-Konfigurationsreferenz für Parallel-Blöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
- connections
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [parallel]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this parallel block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- parallelType
|
||||
properties:
|
||||
parallelType:
|
||||
type: string
|
||||
enum: [count, collection]
|
||||
description: Type of parallel execution
|
||||
count:
|
||||
type: number
|
||||
description: Number of parallel instances (for 'count' type)
|
||||
minimum: 1
|
||||
maximum: 100
|
||||
collection:
|
||||
type: string
|
||||
description: Collection to distribute across instances (for 'collection' type)
|
||||
maxConcurrency:
|
||||
type: number
|
||||
description: Maximum concurrent executions
|
||||
default: 10
|
||||
minimum: 1
|
||||
maximum: 50
|
||||
connections:
|
||||
type: object
|
||||
required:
|
||||
- parallel
|
||||
properties:
|
||||
parallel:
|
||||
type: object
|
||||
required:
|
||||
- start
|
||||
properties:
|
||||
start:
|
||||
type: string
|
||||
description: Target block ID to execute inside each parallel instance
|
||||
end:
|
||||
type: string
|
||||
description: Target block ID after all parallel instances complete (optional)
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Parallel-Blöcke verwenden ein spezielles Verbindungsformat mit einem `parallel` Abschnitt:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
parallel:
|
||||
start: <string> # Target block ID to execute inside each parallel instance
|
||||
end: <string> # Target block ID after all instances complete (optional)
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Konfiguration von untergeordneten Blöcken
|
||||
|
||||
Blöcke innerhalb eines Parallel-Blocks müssen ihre `parentId` auf die Parallel-Block-ID setzen:
|
||||
|
||||
```yaml
|
||||
parallel-1:
|
||||
type: parallel
|
||||
name: "Process Items"
|
||||
inputs:
|
||||
parallelType: collection
|
||||
collection: <start.items>
|
||||
connections:
|
||||
parallel:
|
||||
start: process-item
|
||||
end: aggregate-results
|
||||
|
||||
# Child block inside the parallel
|
||||
process-item:
|
||||
type: agent
|
||||
name: "Process Item"
|
||||
parentId: parallel-1 # References the parallel block
|
||||
inputs:
|
||||
systemPrompt: "Process this item"
|
||||
userPrompt: <parallel.currentItem>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Anzahlbasierte Parallelverarbeitung
|
||||
|
||||
```yaml
|
||||
worker-parallel:
|
||||
type: parallel
|
||||
name: "Worker Parallel"
|
||||
inputs:
|
||||
parallelType: count
|
||||
count: 5
|
||||
maxConcurrency: 3
|
||||
connections:
|
||||
parallel:
|
||||
start: worker-task
|
||||
end: collect-worker-results
|
||||
|
||||
worker-task:
|
||||
type: api
|
||||
name: "Worker Task"
|
||||
parentId: worker-parallel
|
||||
inputs:
|
||||
url: "https://api.worker.com/process"
|
||||
method: POST
|
||||
headers:
|
||||
- key: "Authorization"
|
||||
value: "Bearer {{WORKER_API_KEY}}"
|
||||
body: |
|
||||
{
|
||||
"instanceId": <parallel.index>,
|
||||
"timestamp": "{{new Date().toISOString()}}"
|
||||
}
|
||||
connections:
|
||||
success: worker-complete
|
||||
```
|
||||
|
||||
### Sammlungsbasierte Parallelverarbeitung
|
||||
|
||||
```yaml
|
||||
api-parallel:
|
||||
type: parallel
|
||||
name: "API Parallel"
|
||||
inputs:
|
||||
parallelType: collection
|
||||
collection: <start.apiEndpoints>
|
||||
maxConcurrency: 10
|
||||
connections:
|
||||
parallel:
|
||||
start: call-api
|
||||
end: merge-api-results
|
||||
|
||||
call-api:
|
||||
type: api
|
||||
name: "Call API"
|
||||
parentId: api-parallel
|
||||
inputs:
|
||||
url: <parallel.currentItem.endpoint>
|
||||
method: <parallel.currentItem.method>
|
||||
headers:
|
||||
- key: "Authorization"
|
||||
value: "Bearer {{API_TOKEN}}"
|
||||
connections:
|
||||
success: api-complete
|
||||
```
|
||||
|
||||
### Komplexe parallele Verarbeitungspipeline
|
||||
|
||||
```yaml
|
||||
data-processing-parallel:
|
||||
type: parallel
|
||||
name: "Data Processing Parallel"
|
||||
inputs:
|
||||
parallelType: collection
|
||||
collection: <data-loader.records>
|
||||
maxConcurrency: 8
|
||||
connections:
|
||||
parallel:
|
||||
start: validate-data
|
||||
end: final-aggregation
|
||||
error: parallel-error-handler
|
||||
|
||||
validate-data:
|
||||
type: function
|
||||
name: "Validate Data"
|
||||
parentId: data-processing-parallel
|
||||
inputs:
|
||||
code: |
|
||||
const record = <parallel.currentItem>;
|
||||
const index = <parallel.index>;
|
||||
|
||||
// Validate record structure
|
||||
if (!record.id || !record.content) {
|
||||
throw new Error(`Invalid record at index ${index}`);
|
||||
}
|
||||
|
||||
return {
|
||||
valid: true,
|
||||
recordId: record.id,
|
||||
validatedAt: new Date().toISOString()
|
||||
};
|
||||
connections:
|
||||
success: process-data
|
||||
error: validation-error
|
||||
|
||||
process-data:
|
||||
type: agent
|
||||
name: "Process Data"
|
||||
parentId: data-processing-parallel
|
||||
inputs:
|
||||
systemPrompt: "Process and analyze this data record"
|
||||
userPrompt: |
|
||||
Record ID: <validatedata.recordId>
|
||||
Content: <parallel.currentItem.content>
|
||||
Instance: <parallel.index>
|
||||
model: gpt-4o
|
||||
temperature: 0.3
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: store-result
|
||||
|
||||
store-result:
|
||||
type: function
|
||||
name: "Store Result"
|
||||
parentId: data-processing-parallel
|
||||
inputs:
|
||||
code: |
|
||||
const processed = <processdata.content>;
|
||||
const recordId = <validatedata.recordId>;
|
||||
|
||||
return {
|
||||
recordId,
|
||||
processed,
|
||||
completedAt: new Date().toISOString(),
|
||||
instanceIndex: <parallel.index>
|
||||
};
|
||||
```
|
||||
|
||||
### Gleichzeitige KI-Analyse
|
||||
|
||||
```yaml
|
||||
multi-model-parallel:
|
||||
type: parallel
|
||||
name: "Multi-Model Analysis"
|
||||
inputs:
|
||||
parallelType: collection
|
||||
collection: |
|
||||
[
|
||||
{"model": "gpt-4o", "focus": "technical accuracy"},
|
||||
{"model": "claude-3-5-sonnet-20241022", "focus": "creative quality"},
|
||||
{"model": "gemini-2.0-flash-exp", "focus": "factual verification"}
|
||||
]
|
||||
maxConcurrency: 3
|
||||
connections:
|
||||
parallel:
|
||||
start: analyze-content
|
||||
end: combine-analyses
|
||||
|
||||
analyze-content:
|
||||
type: agent
|
||||
name: "Analyze Content"
|
||||
parentId: multi-model-parallel
|
||||
inputs:
|
||||
systemPrompt: |
|
||||
You are analyzing content with a focus on <parallel.currentItem.focus>.
|
||||
Provide detailed analysis from this perspective.
|
||||
userPrompt: |
|
||||
Content to analyze: <start.content>
|
||||
Analysis focus: <parallel.currentItem.focus>
|
||||
model: <parallel.currentItem.model>
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: analysis-complete
|
||||
```
|
||||
|
||||
## Parallele Variablen
|
||||
|
||||
Innerhalb von untergeordneten Parallel-Blöcken sind diese speziellen Variablen verfügbar:
|
||||
|
||||
```yaml
|
||||
# Available in all child blocks of the parallel
|
||||
<parallel.index> # Instance number (0-based)
|
||||
<parallel.currentItem> # Item for this instance (collection type)
|
||||
<parallel.items> # Full collection (collection type)
|
||||
```
|
||||
|
||||
## Ausgabereferenzen
|
||||
|
||||
Nach Abschluss eines Parallel-Blocks können Sie auf seine aggregierten Ergebnisse verweisen:
|
||||
|
||||
```yaml
|
||||
# In blocks after the parallel
|
||||
final-processor:
|
||||
inputs:
|
||||
all-results: <parallel-name.results> # Array of all instance results
|
||||
total-count: <parallel-name.count> # Number of instances completed
|
||||
```
|
||||
|
||||
## Bewährte Praktiken
|
||||
|
||||
- Verwenden Sie angemessene maxConcurrency, um APIs nicht zu überlasten
|
||||
- Stellen Sie sicher, dass Operationen unabhängig sind und nicht voneinander abhängen
|
||||
- Implementieren Sie Fehlerbehandlung für robuste parallele Ausführung
|
||||
- Testen Sie zuerst mit kleinen Sammlungen
|
||||
- Überwachen Sie Ratenbegrenzungen für externe APIs
|
||||
- Verwenden Sie den Collection-Typ zur Verteilung von Arbeit, den Count-Typ für feste Instanzen
|
||||
- Berücksichtigen Sie den Speicherverbrauch bei großen Sammlungen
|
||||
@@ -1,239 +0,0 @@
|
||||
---
|
||||
title: Response Block YAML Schema
|
||||
description: YAML-Konfigurationsreferenz für Response-Blöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [response]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this response block
|
||||
inputs:
|
||||
type: object
|
||||
properties:
|
||||
dataMode:
|
||||
type: string
|
||||
enum: [structured, json]
|
||||
description: Mode for defining response data structure
|
||||
default: structured
|
||||
builderData:
|
||||
type: object
|
||||
description: Structured response data (when dataMode is 'structured')
|
||||
data:
|
||||
type: object
|
||||
description: JSON response data (when dataMode is 'json')
|
||||
status:
|
||||
type: number
|
||||
description: HTTP status code
|
||||
default: 200
|
||||
minimum: 100
|
||||
maximum: 599
|
||||
headers:
|
||||
type: array
|
||||
description: Response headers as table entries
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the header entry
|
||||
key:
|
||||
type: string
|
||||
description: Header name
|
||||
value:
|
||||
type: string
|
||||
description: Header value
|
||||
cells:
|
||||
type: object
|
||||
description: Cell display values for the table interface
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Display value for the key column
|
||||
Value:
|
||||
type: string
|
||||
description: Display value for the value column
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Response-Blöcke sind Endblöcke (keine ausgehenden Verbindungen) und definieren die endgültige Ausgabe:
|
||||
|
||||
```yaml
|
||||
# No connections object needed - Response blocks are always terminal
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Einfache Antwort
|
||||
|
||||
```yaml
|
||||
simple-response:
|
||||
type: response
|
||||
name: "Simple Response"
|
||||
inputs:
|
||||
data:
|
||||
message: "Hello World"
|
||||
timestamp: <function.timestamp>
|
||||
status: 200
|
||||
```
|
||||
|
||||
### Erfolgreiche Antwort
|
||||
|
||||
```yaml
|
||||
success-response:
|
||||
type: response
|
||||
name: "Success Response"
|
||||
inputs:
|
||||
data:
|
||||
success: true
|
||||
user:
|
||||
id: <agent.user_id>
|
||||
name: <agent.user_name>
|
||||
email: <agent.user_email>
|
||||
created_at: <function.timestamp>
|
||||
status: 201
|
||||
headers:
|
||||
- key: "Location"
|
||||
value: "/api/users/<agent.user_id>"
|
||||
- key: "X-Created-By"
|
||||
value: "workflow-engine"
|
||||
```
|
||||
|
||||
### Antwort mit vollständigem Tabellenkopfformat
|
||||
|
||||
Wenn Header über die UI-Tabellenschnittstelle erstellt werden, enthält das YAML zusätzliche Metadaten:
|
||||
|
||||
```yaml
|
||||
api-response:
|
||||
type: response
|
||||
name: "API Response"
|
||||
inputs:
|
||||
data:
|
||||
message: "Request processed successfully"
|
||||
id: <agent.request_id>
|
||||
status: 200
|
||||
headers:
|
||||
- id: header-1-uuid-here
|
||||
key: "Content-Type"
|
||||
value: "application/json"
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
- id: header-2-uuid-here
|
||||
key: "Cache-Control"
|
||||
value: "no-cache"
|
||||
cells:
|
||||
Key: "Cache-Control"
|
||||
Value: "no-cache"
|
||||
- id: header-3-uuid-here
|
||||
key: "X-API-Version"
|
||||
value: "2.1"
|
||||
cells:
|
||||
Key: "X-API-Version"
|
||||
Value: "2.1"
|
||||
```
|
||||
|
||||
### Fehlerantwort
|
||||
|
||||
```yaml
|
||||
error-response:
|
||||
type: response
|
||||
name: "Error Response"
|
||||
inputs:
|
||||
data:
|
||||
error: true
|
||||
message: <agent.error_message>
|
||||
code: "VALIDATION_FAILED"
|
||||
details: <function.validation_errors>
|
||||
status: 400
|
||||
headers:
|
||||
- key: "X-Error-Code"
|
||||
value: "VALIDATION_FAILED"
|
||||
```
|
||||
|
||||
### Paginierte Antwort
|
||||
|
||||
```yaml
|
||||
paginated-response:
|
||||
type: response
|
||||
name: "Paginated Response"
|
||||
inputs:
|
||||
data:
|
||||
data: <agent.results>
|
||||
pagination:
|
||||
page: <start.page>
|
||||
per_page: <start.per_page>
|
||||
total: <function.total_count>
|
||||
total_pages: <function.total_pages>
|
||||
status: 200
|
||||
headers:
|
||||
- key: "X-Total-Count"
|
||||
value: <function.total_count>
|
||||
- key: "Cache-Control"
|
||||
value: "public, max-age=300"
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
```
|
||||
|
||||
## Tabellenparameterformate
|
||||
|
||||
Der Response-Block unterstützt zwei Formate für Header:
|
||||
|
||||
### Vereinfachtes Format (manuelles YAML)
|
||||
|
||||
Beim manuellen Schreiben von YAML können Sie das vereinfachte Format verwenden:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
- key: "Cache-Control"
|
||||
value: "no-cache"
|
||||
```
|
||||
|
||||
### Vollständiges Tabellenformat (UI-generiert)
|
||||
|
||||
Wenn Header über die UI-Tabellenschnittstelle erstellt werden, enthält das YAML zusätzliche Metadaten:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: unique-identifier-here
|
||||
key: "Content-Type"
|
||||
value: "application/json"
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
```
|
||||
|
||||
**Wesentliche Unterschiede:**
|
||||
- `id`: Eindeutiger Identifikator zur Verfolgung der Tabellenzeile
|
||||
- `cells`: Anzeigewerte, die von der UI-Tabellenschnittstelle verwendet werden
|
||||
- Beide Formate sind für die Workflow-Ausführung funktional gleichwertig
|
||||
- Das vollständige Format bewahrt den UI-Status beim Importieren/Exportieren von Workflows
|
||||
|
||||
**Wichtig:** Setzen Sie Header-Namen und Werte, die Sonderzeichen enthalten, immer in Anführungszeichen:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: content-type-uuid
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
- id: cache-control-uuid
|
||||
cells:
|
||||
Key: "Cache-Control"
|
||||
Value: "no-cache"
|
||||
```
|
||||
|
||||
```
|
||||
@@ -1,200 +0,0 @@
|
||||
---
|
||||
title: Router Block YAML Schema
|
||||
description: YAML-Konfigurationsreferenz für Router-Blöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [router]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this router block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- prompt
|
||||
- model
|
||||
- apiKey
|
||||
properties:
|
||||
prompt:
|
||||
type: string
|
||||
description: Instructions for routing decisions and criteria
|
||||
model:
|
||||
type: string
|
||||
description: AI model identifier (e.g., gpt-4o, gemini-2.5-pro, deepseek-chat)
|
||||
apiKey:
|
||||
type: string
|
||||
description: API key for the model provider (use {{ENV_VAR}} format)
|
||||
temperature:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 2
|
||||
description: Model temperature for routing decisions
|
||||
default: 0.3
|
||||
azureEndpoint:
|
||||
type: string
|
||||
description: Azure OpenAI endpoint URL (required for Azure models)
|
||||
azureApiVersion:
|
||||
type: string
|
||||
description: Azure API version (required for Azure models)
|
||||
connections:
|
||||
type: object
|
||||
description: Multiple connection paths for different routing outcomes
|
||||
properties:
|
||||
success:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Array of target block IDs for routing destinations
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Router-Blöcke verwenden ein success-Array, das alle möglichen Routing-Ziele enthält:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success:
|
||||
- <string> # Target block ID option 1
|
||||
- <string> # Target block ID option 2
|
||||
- <string> # Target block ID option 3
|
||||
# Additional target block IDs as needed
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Content-Type-Router
|
||||
|
||||
```yaml
|
||||
content-router:
|
||||
type: router
|
||||
name: "Content Type Router"
|
||||
inputs:
|
||||
prompt: |
|
||||
Route this content based on its type:
|
||||
- If it's a question, route to question-handler
|
||||
- If it's a complaint, route to complaint-handler
|
||||
- If it's feedback, route to feedback-handler
|
||||
- If it's a request, route to request-handler
|
||||
|
||||
Content: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success:
|
||||
- question-handler
|
||||
- complaint-handler
|
||||
- feedback-handler
|
||||
- request-handler
|
||||
```
|
||||
|
||||
### Prioritäts-Router
|
||||
|
||||
```yaml
|
||||
priority-router:
|
||||
type: router
|
||||
name: "Priority Router"
|
||||
inputs:
|
||||
prompt: |
|
||||
Analyze the urgency and route accordingly:
|
||||
- urgent-queue: High priority, needs immediate attention
|
||||
- standard-queue: Normal priority, standard processing
|
||||
- low-queue: Low priority, can be delayed
|
||||
|
||||
Email content: <email-analyzer.content>
|
||||
|
||||
Route based on urgency indicators, deadlines, and tone.
|
||||
model: gpt-4o
|
||||
temperature: 0.2
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success:
|
||||
- urgent-queue
|
||||
- standard-queue
|
||||
- low-queue
|
||||
```
|
||||
|
||||
### Abteilungs-Router
|
||||
|
||||
```yaml
|
||||
department-router:
|
||||
type: router
|
||||
name: "Department Router"
|
||||
inputs:
|
||||
prompt: |
|
||||
Route this customer inquiry to the appropriate department:
|
||||
|
||||
- sales-team: Sales questions, pricing, demos
|
||||
- support-team: Technical issues, bug reports, how-to questions
|
||||
- billing-team: Payment issues, subscription changes, invoices
|
||||
- general-team: General inquiries, feedback, other topics
|
||||
|
||||
Customer message: <start.input>
|
||||
Customer type: <customer-analyzer.type>
|
||||
model: claude-3-5-sonnet-20241022
|
||||
apiKey: '{{ANTHROPIC_API_KEY}}'
|
||||
connections:
|
||||
success:
|
||||
- sales-team
|
||||
- support-team
|
||||
- billing-team
|
||||
- general-team
|
||||
```
|
||||
|
||||
## Erweiterte Konfiguration
|
||||
|
||||
### Multi-Modell-Router
|
||||
|
||||
```yaml
|
||||
model-selector-router:
|
||||
type: router
|
||||
name: "Model Selection Router"
|
||||
inputs:
|
||||
prompt: |
|
||||
Based on the task complexity, route to the appropriate model:
|
||||
- simple-gpt35: Simple questions, basic tasks
|
||||
- advanced-gpt4: Complex analysis, detailed reasoning
|
||||
- specialized-claude: Creative writing, nuanced analysis
|
||||
|
||||
Task: <start.task>
|
||||
Complexity indicators: <analyzer.complexity>
|
||||
model: gpt-4o-mini
|
||||
temperature: 0.1
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success:
|
||||
- simple-gpt35
|
||||
- advanced-gpt4
|
||||
- specialized-claude
|
||||
```
|
||||
|
||||
## Output-Referenzen
|
||||
|
||||
Router-Blöcke erzeugen keine direkten Outputs, sondern steuern den Workflow-Pfad:
|
||||
|
||||
```yaml
|
||||
# Router decisions affect which subsequent blocks execute
|
||||
# Access the routed block's outputs normally:
|
||||
final-step:
|
||||
inputs:
|
||||
routed-result: <routed-block-name.content>
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
- Klare Routing-Kriterien im Prompt angeben
|
||||
- Spezifische, beschreibende Namen für Zielblöcke verwenden
|
||||
- Beispiele für Inhalte für jeden Routing-Pfad einschließen
|
||||
- Niedrigere Temperaturwerte für konsistentes Routing verwenden
|
||||
- Mit verschiedenen Eingabetypen testen, um genaues Routing sicherzustellen
|
||||
- Fallback-Pfade für Sonderfälle berücksichtigen
|
||||
@@ -1,183 +0,0 @@
|
||||
---
|
||||
title: YAML-Schema für Starter-Block
|
||||
description: YAML-Konfigurationsreferenz für Starter-Blöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [starter]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this starter block
|
||||
inputs:
|
||||
type: object
|
||||
properties:
|
||||
startWorkflow:
|
||||
type: string
|
||||
enum: [manual, webhook, schedule]
|
||||
description: How the workflow should be triggered
|
||||
default: manual
|
||||
inputFormat:
|
||||
type: array
|
||||
description: Expected input structure for API calls (manual workflows)
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: Field name
|
||||
type:
|
||||
type: string
|
||||
enum: [string, number, boolean, object, array]
|
||||
description: Field type
|
||||
scheduleType:
|
||||
type: string
|
||||
enum: [hourly, daily, weekly, monthly]
|
||||
description: Schedule frequency (schedule workflows only)
|
||||
hourlyMinute:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 59
|
||||
description: Minute of the hour to run (hourly schedules)
|
||||
dailyTime:
|
||||
type: string
|
||||
pattern: "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
|
||||
description: Time of day to run in HH:MM format (daily schedules)
|
||||
weeklyDay:
|
||||
type: string
|
||||
enum: [MON, TUE, WED, THU, FRI, SAT, SUN]
|
||||
description: Day of week to run (weekly schedules)
|
||||
weeklyTime:
|
||||
type: string
|
||||
pattern: "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
|
||||
description: Time of day to run in HH:MM format (weekly schedules)
|
||||
monthlyDay:
|
||||
type: number
|
||||
minimum: 1
|
||||
maximum: 28
|
||||
description: Day of month to run (monthly schedules)
|
||||
monthlyTime:
|
||||
type: string
|
||||
pattern: "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
|
||||
description: Time of day to run in HH:MM format (monthly schedules)
|
||||
timezone:
|
||||
type: string
|
||||
description: Timezone for scheduled workflows
|
||||
default: UTC
|
||||
webhookProvider:
|
||||
type: string
|
||||
enum: [slack, gmail, airtable, telegram, generic, whatsapp, github, discord, stripe]
|
||||
description: Provider for webhook integration (webhook workflows only)
|
||||
webhookConfig:
|
||||
type: object
|
||||
description: Provider-specific webhook configuration
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID to execute when workflow starts
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Der Starter-Block hat nur eine Erfolgsverbindung, da er der Einstiegspunkt ist:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID to execute when workflow starts
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Manueller Start
|
||||
|
||||
```yaml
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: next-block
|
||||
```
|
||||
|
||||
### Manueller Start mit Eingabeformat
|
||||
|
||||
```yaml
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
inputFormat:
|
||||
- name: query
|
||||
type: string
|
||||
- name: email
|
||||
type: string
|
||||
- name: age
|
||||
type: number
|
||||
- name: isActive
|
||||
type: boolean
|
||||
- name: preferences
|
||||
type: object
|
||||
- name: tags
|
||||
type: array
|
||||
connections:
|
||||
success: agent-1
|
||||
```
|
||||
|
||||
### Täglicher Zeitplan
|
||||
|
||||
```yaml
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: schedule
|
||||
scheduleType: daily
|
||||
dailyTime: "09:00"
|
||||
timezone: "America/New_York"
|
||||
connections:
|
||||
success: daily-task
|
||||
```
|
||||
|
||||
### Wöchentlicher Zeitplan
|
||||
|
||||
```yaml
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: schedule
|
||||
scheduleType: weekly
|
||||
weeklyDay: MON
|
||||
weeklyTime: "08:30"
|
||||
timezone: UTC
|
||||
connections:
|
||||
success: weekly-report
|
||||
```
|
||||
|
||||
### Webhook-Auslöser
|
||||
|
||||
```yaml
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: webhook
|
||||
webhookProvider: slack
|
||||
webhookConfig:
|
||||
# Provider-specific configuration
|
||||
connections:
|
||||
success: process-webhook
|
||||
```
|
||||
@@ -1,403 +0,0 @@
|
||||
---
|
||||
title: Webhook-Block YAML-Schema
|
||||
description: YAML-Konfigurationsreferenz für Webhook-Blöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [webhook]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this webhook block
|
||||
inputs:
|
||||
type: object
|
||||
properties:
|
||||
webhookConfig:
|
||||
type: object
|
||||
description: Webhook configuration settings
|
||||
properties:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether the webhook is active
|
||||
default: true
|
||||
secret:
|
||||
type: string
|
||||
description: Secret key for webhook verification
|
||||
headers:
|
||||
type: array
|
||||
description: Expected headers for validation as table entries
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the header entry
|
||||
key:
|
||||
type: string
|
||||
description: Header name
|
||||
value:
|
||||
type: string
|
||||
description: Expected header value
|
||||
cells:
|
||||
type: object
|
||||
description: Cell display values for the table interface
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Display value for the key column
|
||||
Value:
|
||||
type: string
|
||||
description: Display value for the value column
|
||||
methods:
|
||||
type: array
|
||||
description: Allowed HTTP methods
|
||||
items:
|
||||
type: string
|
||||
enum: [GET, POST, PUT, DELETE, PATCH]
|
||||
default: [POST]
|
||||
responseConfig:
|
||||
type: object
|
||||
description: Response configuration for the webhook
|
||||
properties:
|
||||
status:
|
||||
type: number
|
||||
description: HTTP status code to return
|
||||
default: 200
|
||||
minimum: 100
|
||||
maximum: 599
|
||||
headers:
|
||||
type: array
|
||||
description: Response headers as table entries
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the header entry
|
||||
key:
|
||||
type: string
|
||||
description: Header name
|
||||
value:
|
||||
type: string
|
||||
description: Header value
|
||||
cells:
|
||||
type: object
|
||||
description: Cell display values for the table interface
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Display value for the key column
|
||||
Value:
|
||||
type: string
|
||||
description: Display value for the value column
|
||||
body:
|
||||
type: string
|
||||
description: Response body content
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful webhook processing
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Verbindungen definieren, wohin der Workflow basierend auf der Webhook-Verarbeitung geht:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful processing
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Einfacher Webhook-Auslöser
|
||||
|
||||
```yaml
|
||||
github-webhook:
|
||||
type: webhook
|
||||
name: "GitHub Webhook"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
secret: "{{GITHUB_WEBHOOK_SECRET}}"
|
||||
methods: [POST]
|
||||
headers:
|
||||
- key: "X-GitHub-Event"
|
||||
value: "push"
|
||||
responseConfig:
|
||||
status: 200
|
||||
body: |
|
||||
{
|
||||
"message": "Webhook received successfully",
|
||||
"timestamp": "{{new Date().toISOString()}}"
|
||||
}
|
||||
connections:
|
||||
success: process-github-event
|
||||
error: webhook-error-handler
|
||||
```
|
||||
|
||||
### Slack-Event-Webhook
|
||||
|
||||
```yaml
|
||||
slack-events:
|
||||
type: webhook
|
||||
name: "Slack Events"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
secret: "{{SLACK_SIGNING_SECRET}}"
|
||||
methods: [POST]
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
responseConfig:
|
||||
status: 200
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
body: |
|
||||
{
|
||||
"challenge": "<webhook.challenge>"
|
||||
}
|
||||
connections:
|
||||
success: handle-slack-event
|
||||
```
|
||||
|
||||
### Zahlungs-Webhook (Stripe)
|
||||
|
||||
```yaml
|
||||
stripe-webhook:
|
||||
type: webhook
|
||||
name: "Stripe Payment Webhook"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
secret: "{{STRIPE_WEBHOOK_SECRET}}"
|
||||
methods: [POST]
|
||||
headers:
|
||||
- key: "Stripe-Signature"
|
||||
value: "*"
|
||||
responseConfig:
|
||||
status: 200
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
body: |
|
||||
{
|
||||
"received": true
|
||||
}
|
||||
connections:
|
||||
success: process-payment-event
|
||||
error: payment-webhook-error
|
||||
```
|
||||
|
||||
### Webhook mit vollständigem Tabellenkopfformat
|
||||
|
||||
Wenn Header über die UI-Tabellenschnittstelle erstellt werden, enthält das YAML zusätzliche Metadaten:
|
||||
|
||||
```yaml
|
||||
api-webhook-complete:
|
||||
type: webhook
|
||||
name: "API Webhook with Table Headers"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
methods: [POST]
|
||||
headers:
|
||||
- id: header-1-uuid-here
|
||||
key: "Authorization"
|
||||
value: "Bearer {{WEBHOOK_API_KEY}}"
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{WEBHOOK_API_KEY}}"
|
||||
- id: header-2-uuid-here
|
||||
key: "Content-Type"
|
||||
value: "application/json"
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
responseConfig:
|
||||
status: 200
|
||||
headers:
|
||||
- id: response-header-1-uuid
|
||||
key: "Content-Type"
|
||||
value: "application/json"
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
- id: response-header-2-uuid
|
||||
key: "X-Webhook-Response"
|
||||
value: "processed"
|
||||
cells:
|
||||
Key: "X-Webhook-Response"
|
||||
Value: "processed"
|
||||
body: |
|
||||
{
|
||||
"status": "received",
|
||||
"timestamp": "{{new Date().toISOString()}}"
|
||||
}
|
||||
connections:
|
||||
success: process-webhook-complete
|
||||
```
|
||||
|
||||
### Generischer API-Webhook
|
||||
|
||||
```yaml
|
||||
api-webhook:
|
||||
type: webhook
|
||||
name: "API Webhook"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
methods: [POST, PUT]
|
||||
headers:
|
||||
- key: "Authorization"
|
||||
value: "Bearer {{WEBHOOK_API_KEY}}"
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
responseConfig:
|
||||
status: 202
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
- key: "X-Processed-By"
|
||||
value: "Sim"
|
||||
body: |
|
||||
{
|
||||
"status": "accepted",
|
||||
"id": "{{Math.random().toString(36).substr(2, 9)}}",
|
||||
"received_at": "{{new Date().toISOString()}}"
|
||||
}
|
||||
connections:
|
||||
success: process-webhook-data
|
||||
```
|
||||
|
||||
### Multi-Methoden-Webhook
|
||||
|
||||
```yaml
|
||||
crud-webhook:
|
||||
type: webhook
|
||||
name: "CRUD Webhook"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
methods: [GET, POST, PUT, DELETE]
|
||||
headers:
|
||||
- key: "X-API-Key"
|
||||
value: "{{CRUD_API_KEY}}"
|
||||
responseConfig:
|
||||
status: 200
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
body: |
|
||||
{
|
||||
"method": "<webhook.method>",
|
||||
"processed": true,
|
||||
"timestamp": "{{new Date().toISOString()}}"
|
||||
}
|
||||
connections:
|
||||
success: route-by-method
|
||||
```
|
||||
|
||||
## Tabellenparameterformate
|
||||
|
||||
Der Webhook-Block unterstützt zwei Formate für Header (sowohl Validierungs-Header als auch Antwort-Header):
|
||||
|
||||
### Vereinfachtes Format (manuelles YAML)
|
||||
|
||||
Beim manuellen Schreiben von YAML können Sie das vereinfachte Format verwenden:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- key: "Authorization"
|
||||
value: "Bearer {{API_TOKEN}}"
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
```
|
||||
|
||||
### Vollständiges Tabellenformat (UI-generiert)
|
||||
|
||||
Wenn Header über die UI-Tabellenschnittstelle erstellt werden, enthält das YAML zusätzliche Metadaten:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: unique-identifier-here
|
||||
key: "Authorization"
|
||||
value: "Bearer {{API_TOKEN}}"
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{API_TOKEN}}"
|
||||
```
|
||||
|
||||
**Wesentliche Unterschiede:**
|
||||
- `id`: Eindeutige Kennung zur Verfolgung der Tabellenzeile
|
||||
- `cells`: Anzeigewerte, die von der UI-Tabellenschnittstelle verwendet werden
|
||||
- Beide Formate sind für die Webhook-Verarbeitung funktional gleichwertig
|
||||
- Das vollständige Format bewahrt den UI-Status beim Importieren/Exportieren von Workflows
|
||||
|
||||
**Wichtig:** Setzen Sie Headernamen und Werte, die Sonderzeichen enthalten, immer in Anführungszeichen:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: auth-header-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{WEBHOOK_API_KEY}}"
|
||||
- id: content-type-uuid
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
```
|
||||
|
||||
## Webhook-Variablen
|
||||
|
||||
In Webhook-ausgelösten Workflows sind diese speziellen Variablen verfügbar:
|
||||
|
||||
```yaml
|
||||
# Available in blocks after the webhook
|
||||
<webhook.payload> # Full request payload/body
|
||||
<webhook.headers> # Request headers
|
||||
<webhook.method> # HTTP method used
|
||||
<webhook.query> # Query parameters
|
||||
<webhook.path> # Request path
|
||||
<webhook.challenge> # Challenge parameter (for verification)
|
||||
```
|
||||
|
||||
## Ausgabereferenzen
|
||||
|
||||
Nachdem ein Webhook eine Anfrage verarbeitet hat, können Sie auf seine Daten verweisen:
|
||||
|
||||
```yaml
|
||||
# In subsequent blocks
|
||||
process-webhook:
|
||||
inputs:
|
||||
payload: <webhook-name.payload> # Request payload
|
||||
headers: <webhook-name.headers> # Request headers
|
||||
method: <webhook-name.method> # HTTP method
|
||||
```
|
||||
|
||||
## Sicherheits-Best-Practices
|
||||
|
||||
- Verwenden Sie immer Webhook-Geheimnisse zur Verifizierung
|
||||
- Validieren Sie erwartete Header und Methoden
|
||||
- Implementieren Sie angemessene Fehlerbehandlung
|
||||
- Verwenden Sie HTTPS-Endpunkte in der Produktion
|
||||
- Überwachen Sie Webhook-Aktivitäten und -Fehler
|
||||
- Setzen Sie angemessene Antwort-Timeouts
|
||||
- Validieren Sie die Payload-Struktur vor der Verarbeitung
|
||||
@@ -1,299 +0,0 @@
|
||||
---
|
||||
title: YAML-Schema für Workflow-Blöcke
|
||||
description: YAML-Konfigurationsreferenz für Workflow-Blöcke
|
||||
---
|
||||
|
||||
## Schema-Definition
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [workflow]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this workflow block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- workflowId
|
||||
properties:
|
||||
workflowId:
|
||||
type: string
|
||||
description: ID of the workflow to execute
|
||||
inputMapping:
|
||||
type: object
|
||||
description: Map current workflow data to sub-workflow inputs
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Input value or reference to parent workflow data
|
||||
environmentVariables:
|
||||
type: object
|
||||
description: Environment variables to pass to sub-workflow
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Environment variable value
|
||||
timeout:
|
||||
type: number
|
||||
description: Maximum execution time in milliseconds
|
||||
default: 300000
|
||||
minimum: 1000
|
||||
maximum: 1800000
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful workflow completion
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Verbindungen definieren, wohin der Workflow basierend auf den Ergebnissen des Unter-Workflows geht:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful completion
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Einfache Workflow-Ausführung
|
||||
|
||||
```yaml
|
||||
data-processor:
|
||||
type: workflow
|
||||
name: "Data Processing Workflow"
|
||||
inputs:
|
||||
workflowId: "data-processing-v2"
|
||||
inputMapping:
|
||||
rawData: <start.input>
|
||||
userId: <user-validator.userId>
|
||||
environmentVariables:
|
||||
PROCESSING_MODE: "production"
|
||||
LOG_LEVEL: "info"
|
||||
connections:
|
||||
success: process-results
|
||||
error: workflow-error-handler
|
||||
```
|
||||
|
||||
### Content-Generierungs-Pipeline
|
||||
|
||||
```yaml
|
||||
content-generator:
|
||||
type: workflow
|
||||
name: "Content Generation Pipeline"
|
||||
inputs:
|
||||
workflowId: "content-generation-v3"
|
||||
inputMapping:
|
||||
topic: <start.topic>
|
||||
style: <style-analyzer.recommendedStyle>
|
||||
targetAudience: <audience-detector.audience>
|
||||
brandGuidelines: <brand-config.guidelines>
|
||||
environmentVariables:
|
||||
CONTENT_API_KEY: "{{CONTENT_API_KEY}}"
|
||||
QUALITY_THRESHOLD: "high"
|
||||
timeout: 120000
|
||||
connections:
|
||||
success: review-content
|
||||
error: content-generation-failed
|
||||
```
|
||||
|
||||
### Mehrstufiger Analyse-Workflow
|
||||
|
||||
```yaml
|
||||
analysis-workflow:
|
||||
type: workflow
|
||||
name: "Analysis Workflow"
|
||||
inputs:
|
||||
workflowId: "comprehensive-analysis"
|
||||
inputMapping:
|
||||
document: <document-processor.content>
|
||||
analysisType: "comprehensive"
|
||||
includeMetrics: true
|
||||
outputFormat: "structured"
|
||||
environmentVariables:
|
||||
ANALYSIS_MODEL: "gpt-4o"
|
||||
OPENAI_API_KEY: "{{OPENAI_API_KEY}}"
|
||||
CLAUDE_API_KEY: "{{CLAUDE_API_KEY}}"
|
||||
connections:
|
||||
success: compile-analysis-report
|
||||
error: analysis-workflow-error
|
||||
```
|
||||
|
||||
### Bedingte Workflow-Ausführung
|
||||
|
||||
```yaml
|
||||
customer-workflow-router:
|
||||
type: condition
|
||||
name: "Customer Workflow Router"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <customer-type.type> === "enterprise"
|
||||
else-if: <customer-type.type> === "premium"
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: enterprise-workflow
|
||||
else-if: premium-workflow
|
||||
else: standard-workflow
|
||||
|
||||
enterprise-workflow:
|
||||
type: workflow
|
||||
name: "Enterprise Customer Workflow"
|
||||
inputs:
|
||||
workflowId: "enterprise-customer-processing"
|
||||
inputMapping:
|
||||
customerData: <customer-data.profile>
|
||||
accountManager: <account-assignment.manager>
|
||||
tier: "enterprise"
|
||||
environmentVariables:
|
||||
PRIORITY_LEVEL: "high"
|
||||
SLA_REQUIREMENTS: "strict"
|
||||
connections:
|
||||
success: enterprise-complete
|
||||
|
||||
premium-workflow:
|
||||
type: workflow
|
||||
name: "Premium Customer Workflow"
|
||||
inputs:
|
||||
workflowId: "premium-customer-processing"
|
||||
inputMapping:
|
||||
customerData: <customer-data.profile>
|
||||
supportLevel: "premium"
|
||||
environmentVariables:
|
||||
PRIORITY_LEVEL: "medium"
|
||||
connections:
|
||||
success: premium-complete
|
||||
|
||||
standard-workflow:
|
||||
type: workflow
|
||||
name: "Standard Customer Workflow"
|
||||
inputs:
|
||||
workflowId: "standard-customer-processing"
|
||||
inputMapping:
|
||||
customerData: <customer-data.profile>
|
||||
environmentVariables:
|
||||
PRIORITY_LEVEL: "standard"
|
||||
connections:
|
||||
success: standard-complete
|
||||
```
|
||||
|
||||
### Parallele Workflow-Ausführung
|
||||
|
||||
```yaml
|
||||
parallel-workflows:
|
||||
type: parallel
|
||||
name: "Parallel Workflow Processing"
|
||||
inputs:
|
||||
parallelType: collection
|
||||
collection: |
|
||||
[
|
||||
{"workflowId": "sentiment-analysis", "focus": "sentiment"},
|
||||
{"workflowId": "topic-extraction", "focus": "topics"},
|
||||
{"workflowId": "entity-recognition", "focus": "entities"}
|
||||
]
|
||||
connections:
|
||||
success: merge-workflow-results
|
||||
|
||||
execute-analysis-workflow:
|
||||
type: workflow
|
||||
name: "Execute Analysis Workflow"
|
||||
parentId: parallel-workflows
|
||||
inputs:
|
||||
workflowId: <parallel.currentItem.workflowId>
|
||||
inputMapping:
|
||||
content: <start.content>
|
||||
analysisType: <parallel.currentItem.focus>
|
||||
environmentVariables:
|
||||
ANALYSIS_API_KEY: "{{ANALYSIS_API_KEY}}"
|
||||
connections:
|
||||
success: workflow-complete
|
||||
```
|
||||
|
||||
### Workflow zur Fehlerbehandlung
|
||||
|
||||
```yaml
|
||||
main-workflow:
|
||||
type: workflow
|
||||
name: "Main Processing Workflow"
|
||||
inputs:
|
||||
workflowId: "main-processing-v1"
|
||||
inputMapping:
|
||||
data: <start.input>
|
||||
timeout: 180000
|
||||
connections:
|
||||
success: main-complete
|
||||
error: error-recovery-workflow
|
||||
|
||||
error-recovery-workflow:
|
||||
type: workflow
|
||||
name: "Error Recovery Workflow"
|
||||
inputs:
|
||||
workflowId: "error-recovery-v1"
|
||||
inputMapping:
|
||||
originalInput: <start.input>
|
||||
errorDetails: <main-workflow.error>
|
||||
failureTimestamp: "{{new Date().toISOString()}}"
|
||||
environmentVariables:
|
||||
RECOVERY_MODE: "automatic"
|
||||
FALLBACK_ENABLED: "true"
|
||||
connections:
|
||||
success: recovery-complete
|
||||
error: manual-intervention-required
|
||||
```
|
||||
|
||||
## Input-Mapping
|
||||
|
||||
Daten vom übergeordneten Workflow zum Unter-Workflow zuordnen:
|
||||
|
||||
```yaml
|
||||
inputMapping:
|
||||
# Static values
|
||||
mode: "production"
|
||||
version: "1.0"
|
||||
|
||||
# References to parent workflow data
|
||||
userData: <user-processor.profile>
|
||||
settings: <config-loader.settings>
|
||||
|
||||
# Complex object mapping
|
||||
requestData:
|
||||
id: <start.requestId>
|
||||
timestamp: "{{new Date().toISOString()}}"
|
||||
source: "parent-workflow"
|
||||
```
|
||||
|
||||
## Output-Referenzen
|
||||
|
||||
Nach Abschluss eines Workflow-Blocks können Sie auf dessen Ausgaben verweisen:
|
||||
|
||||
```yaml
|
||||
# In subsequent blocks
|
||||
next-block:
|
||||
inputs:
|
||||
workflowResult: <workflow-name.output> # Sub-workflow output
|
||||
executionTime: <workflow-name.duration> # Execution duration
|
||||
status: <workflow-name.status> # Execution status
|
||||
```
|
||||
|
||||
## Bewährte Praktiken
|
||||
|
||||
- Verwenden Sie aussagekräftige Workflow-IDs für mehr Klarheit
|
||||
- Übertragen Sie nur notwendige Daten an Sub-Workflows
|
||||
- Setzen Sie angemessene Timeouts entsprechend der Workflow-Komplexität
|
||||
- Integrieren Sie Fehlerbehandlung für robuste Ausführung
|
||||
- Übergeben Sie Umgebungsvariablen sicher
|
||||
- Testen Sie Sub-Workflows zuerst unabhängig voneinander
|
||||
- Überwachen Sie die Leistung verschachtelter Workflows
|
||||
- Verwenden Sie versionierte Workflow-IDs für Stabilität
|
||||
@@ -1,273 +0,0 @@
|
||||
---
|
||||
title: YAML Workflow Beispiele
|
||||
description: Beispiele vollständiger YAML-Workflows
|
||||
---
|
||||
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
|
||||
## Multi-Agent-Ketten-Workflow
|
||||
|
||||
Ein Workflow, bei dem mehrere KI-Agenten Informationen sequentiell verarbeiten:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: agent-1-initiator
|
||||
|
||||
agent-1-initiator:
|
||||
type: agent
|
||||
name: Agent 1 Initiator
|
||||
inputs:
|
||||
systemPrompt: You are the first agent in a chain. Your role is to analyze the input and create an initial response that will be passed to the next agent.
|
||||
userPrompt: |-
|
||||
Welcome! I'm the first agent in our chain.
|
||||
|
||||
Input to process: <start.input>
|
||||
|
||||
Please create an initial analysis or greeting that the next agent can build upon. Be creative and set a positive tone for the chain!
|
||||
model: gpt-4o
|
||||
temperature: 0.7
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: agent-2-enhancer
|
||||
|
||||
agent-2-enhancer:
|
||||
type: agent
|
||||
name: Agent 2 Enhancer
|
||||
inputs:
|
||||
systemPrompt: You are the second agent in a chain. Take the output from Agent 1 and enhance it with additional insights or improvements.
|
||||
userPrompt: |-
|
||||
I'm the second agent! Here's what Agent 1 provided:
|
||||
|
||||
<agent1initiator.content>
|
||||
|
||||
Now I'll enhance this with additional details, insights, or improvements. Let me build upon their work!
|
||||
model: gpt-4o
|
||||
temperature: 0.7
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: agent-3-refiner
|
||||
|
||||
agent-3-refiner:
|
||||
type: agent
|
||||
name: Agent 3 Refiner
|
||||
inputs:
|
||||
systemPrompt: You are the third agent in a chain. Take the enhanced output from Agent 2 and refine it further, adding structure or organization.
|
||||
userPrompt: |-
|
||||
I'm the third agent in our chain! Here's the enhanced work from Agent 2:
|
||||
|
||||
<agent2enhancer.content>
|
||||
|
||||
My job is to refine and organize this content. I'll add structure, clarity, and polish to make it even better!
|
||||
model: gpt-4o
|
||||
temperature: 0.6
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: agent-4-finalizer
|
||||
|
||||
agent-4-finalizer:
|
||||
type: agent
|
||||
name: Agent 4 Finalizer
|
||||
inputs:
|
||||
systemPrompt: You are the final agent in a chain of 4. Create a comprehensive summary and conclusion based on all the previous agents' work.
|
||||
userPrompt: |-
|
||||
I'm the final agent! Here's the refined work from Agent 3:
|
||||
|
||||
<agent3refiner.content>
|
||||
|
||||
As the last agent in our chain, I'll create a final, polished summary that brings together all the work from our team of 4 agents. Let me conclude this beautifully!
|
||||
model: gpt-4o
|
||||
temperature: 0.5
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
## Router-basierter bedingter Workflow
|
||||
|
||||
Ein Workflow, der Routing-Logik verwendet, um Daten basierend auf Bedingungen an verschiedene Agenten zu senden:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: router-1
|
||||
|
||||
router-1:
|
||||
type: router
|
||||
name: Router 1
|
||||
inputs:
|
||||
prompt: go to agent 1 if <start.input> is greater than 5. else agent 2 if greater than 10. else agent 3
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success:
|
||||
- agent-1
|
||||
- agent-2
|
||||
- agent-3
|
||||
|
||||
agent-1:
|
||||
type: agent
|
||||
name: Agent 1
|
||||
inputs:
|
||||
systemPrompt: say 1
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
|
||||
agent-2:
|
||||
type: agent
|
||||
name: Agent 2
|
||||
inputs:
|
||||
systemPrompt: say 2
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
|
||||
agent-3:
|
||||
type: agent
|
||||
name: Agent 3
|
||||
inputs:
|
||||
systemPrompt: say 3
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
## Websuche mit strukturierter Ausgabe
|
||||
|
||||
Ein Workflow, der das Web mit Tools durchsucht und strukturierte Daten zurückgibt:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
59eb07c1-1411-4b28-a274-fa78f55daf72:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: d77c2c98-56c4-432d-9338-9bac54a2d42f
|
||||
d77c2c98-56c4-432d-9338-9bac54a2d42f:
|
||||
type: agent
|
||||
name: Agent 1
|
||||
inputs:
|
||||
systemPrompt: look up the user input. use structured output
|
||||
userPrompt: <start.input>
|
||||
model: claude-sonnet-4-0
|
||||
apiKey: '{{ANTHROPIC_API_KEY}}'
|
||||
tools:
|
||||
- type: exa
|
||||
title: Exa
|
||||
params:
|
||||
type: auto
|
||||
apiKey: '{{EXA_API_KEY}}'
|
||||
numResults: ''
|
||||
toolId: exa_search
|
||||
operation: exa_search
|
||||
isExpanded: true
|
||||
usageControl: auto
|
||||
responseFormat: |-
|
||||
{
|
||||
"name": "output_schema",
|
||||
"description": "Defines the structure for an output object.",
|
||||
"strict": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"output": {
|
||||
"type": "string",
|
||||
"description": "The output value"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["output"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Schleifenverarbeitung mit Sammlung
|
||||
|
||||
Ein Workflow, der jedes Element in einer Sammlung mithilfe einer Schleife verarbeitet:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: food-analysis-loop
|
||||
food-analysis-loop:
|
||||
type: loop
|
||||
name: Food Analysis Loop
|
||||
inputs:
|
||||
count: 5
|
||||
loopType: forEach
|
||||
collection: '["apple", "banana", "carrot"]'
|
||||
connections:
|
||||
loop:
|
||||
start: calorie-agent
|
||||
calorie-agent:
|
||||
type: agent
|
||||
name: Calorie Analyzer
|
||||
inputs:
|
||||
systemPrompt: Return the number of calories in the food
|
||||
userPrompt: <loop.currentItem>
|
||||
model: claude-sonnet-4-0
|
||||
apiKey: '{{ANTHROPIC_API_KEY}}'
|
||||
parentId: food-analysis-loop
|
||||
```
|
||||
|
||||
## E-Mail-Klassifizierung und -Antwort
|
||||
|
||||
Ein Workflow, der E-Mails klassifiziert und passende Antworten generiert:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: email-classifier
|
||||
|
||||
email-classifier:
|
||||
type: agent
|
||||
name: Email Classifier
|
||||
inputs:
|
||||
systemPrompt: Classify emails into categories and extract key information.
|
||||
userPrompt: |
|
||||
Classify this email: <start.input>
|
||||
|
||||
Categories: support, billing, sales, feedback
|
||||
Extract: urgency level, customer sentiment, main request
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: response-generator
|
||||
|
||||
response-generator:
|
||||
type: agent
|
||||
name: Response Generator
|
||||
inputs:
|
||||
systemPrompt: Generate appropriate responses based on email classification.
|
||||
userPrompt: |
|
||||
Email classification: <emailclassifier.content>
|
||||
Original email: <start.input>
|
||||
|
||||
Generate a professional, helpful response addressing the customer's needs.
|
||||
model: gpt-4o
|
||||
temperature: 0.7
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
@@ -1,159 +0,0 @@
|
||||
---
|
||||
title: YAML Workflow Referenz
|
||||
description: Vollständiger Leitfaden zum Schreiben von YAML-Workflows in Sim
|
||||
---
|
||||
|
||||
import { Card, Cards } from "fumadocs-ui/components/card";
|
||||
import { Step, Steps } from "fumadocs-ui/components/steps";
|
||||
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
||||
|
||||
YAML-Workflows bieten eine leistungsstarke Möglichkeit, Workflow-Konfigurationen in Sim zu definieren, zu versionieren und zu teilen. Dieser Referenzleitfaden behandelt die vollständige YAML-Syntax, Block-Schemas und Best Practices für die Erstellung robuster Workflows.
|
||||
|
||||
## Schnellstart
|
||||
|
||||
Jeder Sim-Workflow folgt dieser grundlegenden Struktur:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: agent-1
|
||||
|
||||
agent-1:
|
||||
type: agent
|
||||
name: "AI Assistant"
|
||||
inputs:
|
||||
systemPrompt: "You are a helpful assistant."
|
||||
userPrompt: 'Hi'
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
## Kernkonzepte
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Versionsdeklaration</strong>: Muss genau `version: '1.0'` (mit Anführungszeichen) sein
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Blockstruktur</strong>: Alle Workflow-Blöcke werden unter dem Schlüssel `blocks` definiert
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Block-Referenzen</strong>: Verwenden Sie Blocknamen in Kleinbuchstaben ohne Leerzeichen (z.B. `<aiassistant.content>`)
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Umgebungsvariablen</strong>: Referenzierung mit doppelten geschweiften Klammern `{{VARIABLE_NAME}}`
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Blocktypen
|
||||
|
||||
Sim unterstützt mehrere Kern-Blocktypen, jeder mit spezifischen YAML-Schemas:
|
||||
|
||||
<Cards>
|
||||
<Card title="Starter-Block" href="/yaml/blocks/starter">
|
||||
Workflow-Einstiegspunkt mit Unterstützung für manuelle, Webhook- und geplante Trigger
|
||||
</Card>
|
||||
<Card title="Agent-Block" href="/yaml/blocks/agent">
|
||||
KI-gestützte Verarbeitung mit Unterstützung für Tools und strukturierte Ausgabe
|
||||
</Card>
|
||||
<Card title="Function-Block" href="/yaml/blocks/function">
|
||||
Ausführung von benutzerdefiniertem JavaScript/TypeScript-Code
|
||||
</Card>
|
||||
<Card title="API-Block" href="/yaml/blocks/api">
|
||||
HTTP-Anfragen an externe Dienste
|
||||
</Card>
|
||||
<Card title="Condition-Block" href="/yaml/blocks/condition">
|
||||
Bedingte Verzweigung basierend auf booleschen Ausdrücken
|
||||
</Card>
|
||||
<Card title="Router-Block" href="/yaml/blocks/router">
|
||||
KI-gestützte intelligente Weiterleitung zu mehreren Pfaden
|
||||
</Card>
|
||||
<Card title="Loop-Block" href="/yaml/blocks/loop">
|
||||
Iterative Verarbeitung mit for- und forEach-Schleifen
|
||||
</Card>
|
||||
<Card title="Parallel-Block" href="/yaml/blocks/parallel">
|
||||
Gleichzeitige Ausführung über mehrere Instanzen
|
||||
</Card>
|
||||
<Card title="Webhook-Block" href="/yaml/blocks/webhook">
|
||||
Webhook-Trigger für externe Integrationen
|
||||
</Card>
|
||||
<Card title="Evaluator-Block" href="/yaml/blocks/evaluator">
|
||||
Validierung von Ausgaben anhand definierter Kriterien und Metriken
|
||||
</Card>
|
||||
<Card title="Workflow-Block" href="/yaml/blocks/workflow">
|
||||
Ausführung anderer Workflows als wiederverwendbare Komponenten
|
||||
</Card>
|
||||
<Card title="Response-Block" href="/yaml/blocks/response">
|
||||
Formatierung der endgültigen Workflow-Ausgabe
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Block-Referenz-Syntax
|
||||
|
||||
Der wichtigste Aspekt von YAML-Workflows ist das Verständnis, wie man Daten zwischen Blöcken referenziert:
|
||||
|
||||
### Grundregeln
|
||||
|
||||
1. **Verwende den Blocknamen** (nicht die Block-ID), umgewandelt in Kleinbuchstaben ohne Leerzeichen
|
||||
2. **Füge die entsprechende Eigenschaft hinzu** (.content für Agenten, .output für Tools)
|
||||
3. **Bei Verwendung von Chat, referenziere den Starter-Block** als `<start.input>`
|
||||
|
||||
### Beispiele
|
||||
|
||||
```yaml
|
||||
# Block definitions
|
||||
email-processor:
|
||||
type: agent
|
||||
name: "Email Agent"
|
||||
# ... configuration
|
||||
|
||||
data-formatter:
|
||||
type: function
|
||||
name: "Data Agent"
|
||||
# ... configuration
|
||||
|
||||
# Referencing their outputs
|
||||
next-block:
|
||||
type: agent
|
||||
name: "Next Step"
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Process this email: <emailagent.content>
|
||||
Use this formatted data: <dataagent.output>
|
||||
Original input: <start.input>
|
||||
```
|
||||
|
||||
### Sonderfälle
|
||||
|
||||
- **Schleifenvariablen**: `<loop.index>`, `<loop.currentItem>`, `<loop.items>`
|
||||
- **Parallele Variablen**: `<parallel.index>`, `<parallel.currentItem>`
|
||||
|
||||
## Umgebungsvariablen
|
||||
|
||||
Verwende Umgebungsvariablen für sensible Daten wie API-Schlüssel:
|
||||
|
||||
```yaml
|
||||
inputs:
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
database: '{{DATABASE_URL}}'
|
||||
token: '{{SLACK_BOT_TOKEN}}'
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Halte Blocknamen benutzerfreundlich**: "Email Processor" für die UI-Anzeige
|
||||
- **Referenziere Umgebungsvariablen**: Niemals API-Schlüssel fest codieren
|
||||
- **Strukturiere für Lesbarkeit**: Gruppiere zusammengehörige Blöcke logisch
|
||||
- **Teste schrittweise**: Baue Workflows Schritt für Schritt auf
|
||||
|
||||
## Nächste Schritte
|
||||
|
||||
- [Block-Referenz-Syntax](/yaml/block-reference) - Detaillierte Referenzregeln
|
||||
- [Vollständige Block-Schemas](/yaml/blocks) - Alle verfügbaren Blocktypen
|
||||
- [Workflow-Beispiele](/yaml/examples) - Praxisnahe Workflow-Muster
|
||||
@@ -679,10 +679,6 @@ Alternatively, you can manually provide files using the URL format:
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
// Attach to button click
|
||||
document.getElementById('executeBtn')?.addEventListener('click', executeClientSideWorkflow);
|
||||
```
|
||||
|
||||
<Callout type="warning">
|
||||
When using the SDK in the browser, be careful not to expose sensitive API keys. Consider using a backend proxy or public API keys with limited permissions.
|
||||
</Callout>
|
||||
@@ -1039,34 +1035,6 @@ function StreamingWorkflow() {
|
||||
- Node.js 16+
|
||||
- TypeScript 5.0+ (for TypeScript projects)
|
||||
|
||||
## TypeScript Support
|
||||
|
||||
The SDK is written in TypeScript and provides full type safety:
|
||||
|
||||
```typescript
|
||||
import {
|
||||
SimStudioClient,
|
||||
WorkflowExecutionResult,
|
||||
WorkflowStatus,
|
||||
SimStudioError
|
||||
} from 'simstudio-ts-sdk';
|
||||
|
||||
// Type-safe client initialization
|
||||
const client: SimStudioClient = new SimStudioClient({
|
||||
apiKey: process.env.SIM_API_KEY!
|
||||
});
|
||||
|
||||
// Type-safe workflow execution
|
||||
const result: WorkflowExecutionResult = await client.executeWorkflow('workflow-id', {
|
||||
input: {
|
||||
message: 'Hello, TypeScript!'
|
||||
}
|
||||
});
|
||||
|
||||
// Type-safe status checking
|
||||
const status: WorkflowStatus = await client.getWorkflowStatus('workflow-id');
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Apache-2.0
|
||||
|
||||
@@ -26,7 +26,208 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
|
||||
|
||||
## Overview
|
||||
|
||||
The Generic Webhook block allows you to receive webhooks from any external service. This is a flexible trigger that can handle any JSON payload, making it ideal for integrating with services that don't have a dedicated Sim block.
|
||||
|
||||
## Basic Usage
|
||||
|
||||
### Simple Passthrough Mode
|
||||
|
||||
Without defining an input format, the webhook passes through the entire request body as-is:
|
||||
|
||||
```bash
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"message": "Test webhook trigger",
|
||||
"data": {
|
||||
"key": "value"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
Access the data in downstream blocks using:
|
||||
- `<webhook1.message>` → "Test webhook trigger"
|
||||
- `<webhook1.data.key>` → "value"
|
||||
|
||||
### Structured Input Format (Optional)
|
||||
|
||||
Define an input schema to get typed fields and enable advanced features like file uploads:
|
||||
|
||||
**Input Format Configuration:**
|
||||
```json
|
||||
[
|
||||
{ "name": "message", "type": "string" },
|
||||
{ "name": "priority", "type": "number" },
|
||||
{ "name": "documents", "type": "files" }
|
||||
]
|
||||
```
|
||||
|
||||
**Webhook Request:**
|
||||
```bash
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"message": "Invoice submission",
|
||||
"priority": 1,
|
||||
"documents": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:application/pdf;base64,JVBERi0xLjQK...",
|
||||
"name": "invoice.pdf",
|
||||
"mime": "application/pdf"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
## File Uploads
|
||||
|
||||
### Supported File Formats
|
||||
|
||||
The webhook supports two file input formats:
|
||||
|
||||
#### 1. Base64 Encoded Files
|
||||
For uploading file content directly:
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA...",
|
||||
"name": "screenshot.png",
|
||||
"mime": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- **Max size**: 20MB per file
|
||||
- **Format**: Standard data URL with base64 encoding
|
||||
- **Storage**: Files are uploaded to secure execution storage
|
||||
|
||||
#### 2. URL References
|
||||
For passing existing file URLs:
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [
|
||||
{
|
||||
"type": "url",
|
||||
"data": "https://example.com/files/document.pdf",
|
||||
"name": "document.pdf",
|
||||
"mime": "application/pdf"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Accessing Files in Downstream Blocks
|
||||
|
||||
Files are processed into `UserFile` objects with the following properties:
|
||||
|
||||
```typescript
|
||||
{
|
||||
id: string, // Unique file identifier
|
||||
name: string, // Original filename
|
||||
url: string, // Presigned URL (valid for 5 minutes)
|
||||
size: number, // File size in bytes
|
||||
type: string, // MIME type
|
||||
key: string, // Storage key
|
||||
uploadedAt: string, // ISO timestamp
|
||||
expiresAt: string // ISO timestamp (5 minutes)
|
||||
}
|
||||
```
|
||||
|
||||
**Access in blocks:**
|
||||
- `<webhook1.documents[0].url>` → Download URL
|
||||
- `<webhook1.documents[0].name>` → "invoice.pdf"
|
||||
- `<webhook1.documents[0].size>` → 524288
|
||||
- `<webhook1.documents[0].type>` → "application/pdf"
|
||||
|
||||
### Complete File Upload Example
|
||||
|
||||
```bash
|
||||
# Create a base64-encoded file
|
||||
echo "Hello World" | base64
|
||||
# SGVsbG8gV29ybGQK
|
||||
|
||||
# Send webhook with file
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"subject": "Document for review",
|
||||
"attachments": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:text/plain;base64,SGVsbG8gV29ybGQK",
|
||||
"name": "sample.txt",
|
||||
"mime": "text/plain"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
### Configure Authentication (Optional)
|
||||
|
||||
In the webhook configuration:
|
||||
1. Enable "Require Authentication"
|
||||
2. Set a secret token
|
||||
3. Choose header type:
|
||||
- **Custom Header**: `X-Sim-Secret: your-token`
|
||||
- **Authorization Bearer**: `Authorization: Bearer your-token`
|
||||
|
||||
### Using Authentication
|
||||
|
||||
```bash
|
||||
# With custom header
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret-token" \
|
||||
-d '{"message": "Authenticated request"}'
|
||||
|
||||
# With bearer token
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer your-secret-token" \
|
||||
-d '{"message": "Authenticated request"}'
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Use Input Format for Structure**: Define an input format when you know the expected schema. This provides:
|
||||
- Type validation
|
||||
- Better autocomplete in the editor
|
||||
- File upload capabilities
|
||||
|
||||
2. **Authentication**: Always enable authentication for production webhooks to prevent unauthorized access.
|
||||
|
||||
3. **File Size Limits**: Keep files under 20MB. For larger files, use URL references instead.
|
||||
|
||||
4. **File Expiration**: Downloaded files have 5-minute expiration URLs. Process them promptly or store them elsewhere if needed longer.
|
||||
|
||||
5. **Error Handling**: Webhook processing is asynchronous. Check execution logs for errors.
|
||||
|
||||
6. **Testing**: Use the "Test Webhook" button in the editor to validate your configuration before deployment.
|
||||
|
||||
## Use Cases
|
||||
|
||||
- **Form Submissions**: Receive data from custom forms with file uploads
|
||||
- **Third-Party Integrations**: Connect with services that send webhooks (Stripe, GitHub, etc.)
|
||||
- **Document Processing**: Accept documents from external systems for processing
|
||||
- **Event Notifications**: Receive event data from various sources
|
||||
- **Custom APIs**: Build custom API endpoints for your applications
|
||||
|
||||
## Notes
|
||||
|
||||
- Category: `triggers`
|
||||
- Type: `generic_webhook`
|
||||
- **File Support**: Available via input format configuration
|
||||
- **Max File Size**: 20MB per file
|
||||
|
||||
@@ -66,7 +66,7 @@ Search for similar content in a knowledge base using vector similarity
|
||||
| `knowledgeBaseId` | string | Yes | ID of the knowledge base to search in |
|
||||
| `query` | string | No | Search query text \(optional when using tag filters\) |
|
||||
| `topK` | number | No | Number of most similar results to return \(1-100\) |
|
||||
| `tagFilters` | any | No | Array of tag filters with tagName and tagValue properties |
|
||||
| `tagFilters` | array | No | Array of tag filters with tagName and tagValue properties |
|
||||
|
||||
#### Output
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
"whatsapp",
|
||||
"wikipedia",
|
||||
"x",
|
||||
"youtube"
|
||||
"youtube",
|
||||
"zep"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -113,6 +113,7 @@ Read content from a Microsoft Teams chat
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `chatId` | string | Yes | The ID of the chat to read from |
|
||||
| `includeAttachments` | boolean | No | Download and include message attachments \(hosted contents\) into storage |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -125,6 +126,7 @@ Read content from a Microsoft Teams chat
|
||||
| `attachmentCount` | number | Total number of attachments found |
|
||||
| `attachmentTypes` | array | Types of attachments found |
|
||||
| `content` | string | Formatted content of chat messages |
|
||||
| `attachments` | file[] | Uploaded attachments for convenience \(flattened\) |
|
||||
|
||||
### `microsoft_teams_write_chat`
|
||||
|
||||
@@ -158,6 +160,7 @@ Read content from a Microsoft Teams channel
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `teamId` | string | Yes | The ID of the team to read from |
|
||||
| `channelId` | string | Yes | The ID of the channel to read from |
|
||||
| `includeAttachments` | boolean | No | Download and include message attachments \(hosted contents\) into storage |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -171,6 +174,7 @@ Read content from a Microsoft Teams channel
|
||||
| `attachmentCount` | number | Total number of attachments found |
|
||||
| `attachmentTypes` | array | Types of attachments found |
|
||||
| `content` | string | Formatted content of channel messages |
|
||||
| `attachments` | file[] | Uploaded attachments for convenience \(flattened\) |
|
||||
|
||||
### `microsoft_teams_write_channel`
|
||||
|
||||
|
||||
@@ -206,6 +206,7 @@ Read emails from Outlook
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `folder` | string | No | Folder ID to read emails from \(default: Inbox\) |
|
||||
| `maxResults` | number | No | Maximum number of emails to retrieve \(default: 1, max: 10\) |
|
||||
| `includeAttachments` | boolean | No | Download and include email attachments |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -213,6 +214,7 @@ Read emails from Outlook
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Success or status message |
|
||||
| `results` | array | Array of email message objects |
|
||||
| `attachments` | file[] | All email attachments flattened from all emails |
|
||||
|
||||
### `outlook_forward`
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ Insert data into a Supabase table
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `projectId` | string | Yes | Your Supabase project ID \(e.g., jdrkgepadsdopsntdlom\) |
|
||||
| `table` | string | Yes | The name of the Supabase table to insert data into |
|
||||
| `data` | any | Yes | The data to insert |
|
||||
| `data` | array | Yes | The data to insert \(array of objects or a single object\) |
|
||||
| `apiKey` | string | Yes | Your Supabase service role secret key |
|
||||
|
||||
#### Output
|
||||
@@ -195,7 +195,7 @@ Insert or update data in a Supabase table (upsert operation)
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `projectId` | string | Yes | Your Supabase project ID \(e.g., jdrkgepadsdopsntdlom\) |
|
||||
| `table` | string | Yes | The name of the Supabase table to upsert data into |
|
||||
| `data` | any | Yes | The data to upsert \(insert or update\) |
|
||||
| `data` | array | Yes | The data to upsert \(insert or update\) - array of objects or a single object |
|
||||
| `apiKey` | string | Yes | Your Supabase service role secret key |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Telegram
|
||||
description: Send messages through Telegram or trigger workflows from Telegram events
|
||||
description: Interact with Telegram
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
@@ -67,7 +67,7 @@ In Sim, the Telegram integration enables your agents to leverage these powerful
|
||||
|
||||
## Usage Instructions
|
||||
|
||||
Integrate Telegram into the workflow. Can send messages. Can be used in trigger mode to trigger a workflow when a message is sent to a chat.
|
||||
Integrate Telegram into the workflow. Can send and delete messages. Can be used in trigger mode to trigger a workflow when a message is sent to a chat.
|
||||
|
||||
|
||||
|
||||
@@ -89,12 +89,107 @@ Send messages to Telegram channels or users through the Telegram Bot API. Enable
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `success` | boolean | Telegram message send success status |
|
||||
| `messageId` | number | Unique Telegram message identifier |
|
||||
| `chatId` | string | Target chat ID where message was sent |
|
||||
| `text` | string | Text content of the sent message |
|
||||
| `timestamp` | number | Unix timestamp when message was sent |
|
||||
| `from` | object | Information about the bot that sent the message |
|
||||
| `message` | string | Success or error message |
|
||||
| `data` | object | Telegram message data |
|
||||
|
||||
### `telegram_delete_message`
|
||||
|
||||
Delete messages in Telegram channels or chats through the Telegram Bot API. Requires the message ID of the message to delete.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Yes | Your Telegram Bot API Token |
|
||||
| `chatId` | string | Yes | Target Telegram chat ID |
|
||||
| `messageId` | string | Yes | Message ID to delete |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Success or error message |
|
||||
| `data` | object | Delete operation result |
|
||||
|
||||
### `telegram_send_photo`
|
||||
|
||||
Send photos to Telegram channels or users through the Telegram Bot API.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Yes | Your Telegram Bot API Token |
|
||||
| `chatId` | string | Yes | Target Telegram chat ID |
|
||||
| `photo` | string | Yes | Photo to send. Pass a file_id or HTTP URL |
|
||||
| `caption` | string | No | Photo caption \(optional\) |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Success or error message |
|
||||
| `data` | object | Telegram message data including optional photo\(s\) |
|
||||
|
||||
### `telegram_send_video`
|
||||
|
||||
Send videos to Telegram channels or users through the Telegram Bot API.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Yes | Your Telegram Bot API Token |
|
||||
| `chatId` | string | Yes | Target Telegram chat ID |
|
||||
| `video` | string | Yes | Video to send. Pass a file_id or HTTP URL |
|
||||
| `caption` | string | No | Video caption \(optional\) |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Success or error message |
|
||||
| `data` | object | Telegram message data including optional media |
|
||||
|
||||
### `telegram_send_audio`
|
||||
|
||||
Send audio files to Telegram channels or users through the Telegram Bot API.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Yes | Your Telegram Bot API Token |
|
||||
| `chatId` | string | Yes | Target Telegram chat ID |
|
||||
| `audio` | string | Yes | Audio file to send. Pass a file_id or HTTP URL |
|
||||
| `caption` | string | No | Audio caption \(optional\) |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Success or error message |
|
||||
| `data` | object | Telegram message data including voice/audio information |
|
||||
|
||||
### `telegram_send_animation`
|
||||
|
||||
Send animations (GIFs) to Telegram channels or users through the Telegram Bot API.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Yes | Your Telegram Bot API Token |
|
||||
| `chatId` | string | Yes | Target Telegram chat ID |
|
||||
| `animation` | string | Yes | Animation to send. Pass a file_id or HTTP URL |
|
||||
| `caption` | string | No | Animation caption \(optional\) |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Success or error message |
|
||||
| `data` | object | Telegram message data including optional media |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: YouTube
|
||||
description: Search for videos on YouTube
|
||||
description: Interact with YouTube videos, channels, and playlists
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
@@ -40,7 +40,7 @@ In Sim, the YouTube integration enables your agents to programmatically search a
|
||||
|
||||
## Usage Instructions
|
||||
|
||||
Integrate YouTube into the workflow. Can search for videos.
|
||||
Integrate YouTube into the workflow. Can search for videos, get video details, get channel information, get playlist items, and get video comments.
|
||||
|
||||
|
||||
|
||||
@@ -64,6 +64,99 @@ Search for videos on YouTube using the YouTube Data API.
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | array | Array of YouTube videos matching the search query |
|
||||
|
||||
### `youtube_video_details`
|
||||
|
||||
Get detailed information about a specific YouTube video.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `videoId` | string | Yes | YouTube video ID |
|
||||
| `apiKey` | string | Yes | YouTube API Key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `videoId` | string | YouTube video ID |
|
||||
| `title` | string | Video title |
|
||||
| `description` | string | Video description |
|
||||
| `channelId` | string | Channel ID |
|
||||
| `channelTitle` | string | Channel name |
|
||||
| `publishedAt` | string | Published date and time |
|
||||
| `duration` | string | Video duration in ISO 8601 format |
|
||||
| `viewCount` | number | Number of views |
|
||||
| `likeCount` | number | Number of likes |
|
||||
| `commentCount` | number | Number of comments |
|
||||
| `thumbnail` | string | Video thumbnail URL |
|
||||
| `tags` | array | Video tags |
|
||||
|
||||
### `youtube_channel_info`
|
||||
|
||||
Get detailed information about a YouTube channel.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `channelId` | string | No | YouTube channel ID \(use either channelId or username\) |
|
||||
| `username` | string | No | YouTube channel username \(use either channelId or username\) |
|
||||
| `apiKey` | string | Yes | YouTube API Key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `channelId` | string | YouTube channel ID |
|
||||
| `title` | string | Channel name |
|
||||
| `description` | string | Channel description |
|
||||
| `subscriberCount` | number | Number of subscribers |
|
||||
| `videoCount` | number | Number of videos |
|
||||
| `viewCount` | number | Total channel views |
|
||||
| `publishedAt` | string | Channel creation date |
|
||||
| `thumbnail` | string | Channel thumbnail URL |
|
||||
| `customUrl` | string | Channel custom URL |
|
||||
|
||||
### `youtube_playlist_items`
|
||||
|
||||
Get videos from a YouTube playlist.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `playlistId` | string | Yes | YouTube playlist ID |
|
||||
| `maxResults` | number | No | Maximum number of videos to return |
|
||||
| `pageToken` | string | No | Page token for pagination |
|
||||
| `apiKey` | string | Yes | YouTube API Key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | array | Array of videos in the playlist |
|
||||
|
||||
### `youtube_comments`
|
||||
|
||||
Get comments from a YouTube video.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `videoId` | string | Yes | YouTube video ID |
|
||||
| `maxResults` | number | No | Maximum number of comments to return |
|
||||
| `order` | string | No | Order of comments: time or relevance |
|
||||
| `pageToken` | string | No | Page token for pagination |
|
||||
| `apiKey` | string | Yes | YouTube API Key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | array | Array of comments from the video |
|
||||
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
246
apps/docs/content/docs/en/tools/zep.mdx
Normal file
246
apps/docs/content/docs/en/tools/zep.mdx
Normal file
@@ -0,0 +1,246 @@
|
||||
---
|
||||
title: Zep
|
||||
description: Long-term memory for AI agents
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="zep"
|
||||
color="#E8E8E8"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
viewBox='0 0 233 196'
|
||||
|
||||
|
||||
>
|
||||
<path
|
||||
d='m231.34,108.7l-1.48-1.55h-10.26l3.59-75.86-14.8-.45-2.77,49.31c-59.6-3.24-119.33-3.24-178.92-.02l-1.73-64.96-14.8.45,2.5,91.53H2.16l-1.41,1.47c-1.55,16.23-.66,32.68,2.26,48.89h10.83l.18,1.27c.67,19.34,16.1,34.68,35.9,34.68s44.86-.92,66.12-.92,46.56.92,65.95.92,35.19-15.29,35.9-34.61l.16-1.34h11.02c2.91-16.19,3.81-32.61,2.26-48.81Zm-158.23,58.01c-17.27,0-30.25-13.78-30.25-29.78s12.99-29.78,30.25-29.78,29.62,13.94,29.62,29.94-12.35,29.62-29.62,29.62Zm86.51,0c-17.27,0-30.25-13.78-30.25-29.78s12.99-29.78,30.25-29.78,29.62,13.94,29.62,29.94-12.35,29.62-29.62,29.62Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<polygon
|
||||
points='111.77 22.4 93.39 49.97 93.52 50.48 185.88 38.51 190.95 27.68 114.32 36.55 117.7 31.48 117.7 31.47 138.38 .49 138.25 0 47.67 11.6 42.85 22.27 118.34 12.61 111.77 22.4'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<path
|
||||
d='m72.97,121.47c-8.67,0-15.73,6.93-15.73,15.46s7.06,15.46,15.73,15.46,15.37-6.75,15.37-15.37-6.75-15.55-15.37-15.55Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<path
|
||||
d='m159.48,121.47c-8.67,0-15.73,6.93-15.73,15.46s7.06,15.46,15.73,15.46,15.37-6.75,15.37-15.37-6.75-15.55-15.37-15.55Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
## Usage Instructions
|
||||
|
||||
Integrate Zep for long-term memory management. Create threads, add messages, retrieve context with AI-powered summaries and facts extraction.
|
||||
|
||||
|
||||
|
||||
## Tools
|
||||
|
||||
### `zep_create_thread`
|
||||
|
||||
Start a new conversation thread in Zep
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Yes | Unique identifier for the thread |
|
||||
| `userId` | string | Yes | User ID associated with the thread |
|
||||
| `apiKey` | string | Yes | Your Zep API key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threadId` | string | The thread ID |
|
||||
| `userId` | string | The user ID |
|
||||
| `uuid` | string | Internal UUID |
|
||||
| `createdAt` | string | Creation timestamp |
|
||||
| `projectUuid` | string | Project UUID |
|
||||
|
||||
### `zep_get_threads`
|
||||
|
||||
List all conversation threads
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `pageSize` | number | No | Number of threads to retrieve per page |
|
||||
| `pageNumber` | number | No | Page number for pagination |
|
||||
| `orderBy` | string | No | Field to order results by \(created_at, updated_at, user_id, thread_id\) |
|
||||
| `asc` | boolean | No | Order direction: true for ascending, false for descending |
|
||||
| `apiKey` | string | Yes | Your Zep API key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threads` | array | Array of thread objects |
|
||||
| `responseCount` | number | Number of threads in this response |
|
||||
| `totalCount` | number | Total number of threads available |
|
||||
|
||||
### `zep_delete_thread`
|
||||
|
||||
Delete a conversation thread from Zep
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Yes | Thread ID to delete |
|
||||
| `apiKey` | string | Yes | Your Zep API key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `deleted` | boolean | Whether the thread was deleted |
|
||||
|
||||
### `zep_get_context`
|
||||
|
||||
Retrieve user context from a thread with summary or basic mode
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Yes | Thread ID to get context from |
|
||||
| `mode` | string | No | Context mode: "summary" \(natural language\) or "basic" \(raw facts\) |
|
||||
| `minRating` | number | No | Minimum rating by which to filter relevant facts |
|
||||
| `apiKey` | string | Yes | Your Zep API key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `context` | string | The context string \(summary or basic\) |
|
||||
| `facts` | array | Extracted facts |
|
||||
| `entities` | array | Extracted entities |
|
||||
| `summary` | string | Conversation summary |
|
||||
|
||||
### `zep_get_messages`
|
||||
|
||||
Retrieve messages from a thread
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Yes | Thread ID to get messages from |
|
||||
| `limit` | number | No | Maximum number of messages to return |
|
||||
| `cursor` | string | No | Cursor for pagination |
|
||||
| `lastn` | number | No | Number of most recent messages to return \(overrides limit and cursor\) |
|
||||
| `apiKey` | string | Yes | Your Zep API key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `messages` | array | Array of message objects |
|
||||
| `rowCount` | number | Number of messages in this response |
|
||||
| `totalCount` | number | Total number of messages in the thread |
|
||||
|
||||
### `zep_add_messages`
|
||||
|
||||
Add messages to an existing thread
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Yes | Thread ID to add messages to |
|
||||
| `messages` | json | Yes | Array of message objects with role and content |
|
||||
| `apiKey` | string | Yes | Your Zep API key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `context` | string | Updated context after adding messages |
|
||||
| `messageIds` | array | Array of added message UUIDs |
|
||||
| `threadId` | string | The thread ID |
|
||||
|
||||
### `zep_add_user`
|
||||
|
||||
Create a new user in Zep
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `userId` | string | Yes | Unique identifier for the user |
|
||||
| `email` | string | No | User email address |
|
||||
| `firstName` | string | No | User first name |
|
||||
| `lastName` | string | No | User last name |
|
||||
| `metadata` | json | No | Additional metadata as JSON object |
|
||||
| `apiKey` | string | Yes | Your Zep API key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `userId` | string | The user ID |
|
||||
| `email` | string | User email |
|
||||
| `firstName` | string | User first name |
|
||||
| `lastName` | string | User last name |
|
||||
| `uuid` | string | Internal UUID |
|
||||
| `createdAt` | string | Creation timestamp |
|
||||
| `metadata` | object | User metadata |
|
||||
|
||||
### `zep_get_user`
|
||||
|
||||
Retrieve user information from Zep
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `userId` | string | Yes | User ID to retrieve |
|
||||
| `apiKey` | string | Yes | Your Zep API key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `userId` | string | The user ID |
|
||||
| `email` | string | User email |
|
||||
| `firstName` | string | User first name |
|
||||
| `lastName` | string | User last name |
|
||||
| `uuid` | string | Internal UUID |
|
||||
| `createdAt` | string | Creation timestamp |
|
||||
| `updatedAt` | string | Last update timestamp |
|
||||
| `metadata` | object | User metadata |
|
||||
|
||||
### `zep_get_user_threads`
|
||||
|
||||
List all conversation threads for a specific user
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `userId` | string | Yes | User ID to get threads for |
|
||||
| `limit` | number | No | Maximum number of threads to return |
|
||||
| `apiKey` | string | Yes | Your Zep API key |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threads` | array | Array of thread objects for this user |
|
||||
| `userId` | string | The user ID |
|
||||
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- Category: `tools`
|
||||
- Type: `zep`
|
||||
250
apps/docs/content/docs/es/blocks/guardrails.mdx
Normal file
250
apps/docs/content/docs/es/blocks/guardrails.mdx
Normal file
@@ -0,0 +1,250 @@
|
||||
---
|
||||
title: Guardrails
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
El bloque Guardrails valida y protege tus flujos de trabajo de IA comprobando el contenido contra múltiples tipos de validación. Asegura la calidad de los datos, previene alucinaciones, detecta información personal identificable (PII) y aplica requisitos de formato antes de que el contenido avance por tu flujo de trabajo.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/guardrails.png"
|
||||
alt="Bloque Guardrails"
|
||||
width={500}
|
||||
height={350}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Descripción general
|
||||
|
||||
El bloque Guardrails te permite:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Validar estructura JSON</strong>: Asegura que las salidas de LLM sean JSON válido antes de analizarlas
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Coincidir con patrones Regex</strong>: Verifica que el contenido coincida con formatos específicos (correos electrónicos, números de teléfono, URLs, etc.)
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Detectar alucinaciones</strong>: Utiliza puntuación RAG + LLM para validar las salidas de IA contra el contenido de la base de conocimientos
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Detectar PII</strong>: Identifica y opcionalmente enmascara información personal identificable en más de 40 tipos de entidades
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Tipos de validación
|
||||
|
||||
### Validación JSON
|
||||
|
||||
Valida que el contenido tenga un formato JSON adecuado. Perfecto para garantizar que las salidas estructuradas de LLM puedan analizarse de forma segura.
|
||||
|
||||
**Casos de uso:**
|
||||
- Validar respuestas JSON de bloques Agent antes de analizarlas
|
||||
- Asegurar que las cargas útiles de API estén correctamente formateadas
|
||||
- Comprobar la integridad de datos estructurados
|
||||
|
||||
**Output:**
|
||||
- `passed`: `true` si es JSON válido, `false` en caso contrario
|
||||
- `error`: Mensaje de error si la validación falla (p. ej., "JSON inválido: Token inesperado...")
|
||||
|
||||
### Validación Regex
|
||||
|
||||
Comprueba si el contenido coincide con un patrón de expresión regular especificado.
|
||||
|
||||
**Casos de uso:**
|
||||
- Validar direcciones de correo electrónico
|
||||
- Comprobar formatos de números de teléfono
|
||||
- Verificar URLs o identificadores personalizados
|
||||
- Aplicar patrones de texto específicos
|
||||
|
||||
**Configuración:**
|
||||
- **Patrón Regex**: La expresión regular para comparar (p. ej., `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$` para correos electrónicos)
|
||||
|
||||
**Output:**
|
||||
- `passed`: `true` si el contenido coincide con el patrón, `false` en caso contrario
|
||||
- `error`: Mensaje de error si la validación falla
|
||||
|
||||
### Detección de alucinaciones
|
||||
|
||||
Utiliza generación aumentada por recuperación (RAG) con puntuación de LLM para detectar cuando el contenido generado por IA contradice o no está fundamentado en tu base de conocimientos.
|
||||
|
||||
**Cómo funciona:**
|
||||
1. Consulta tu base de conocimientos para obtener contexto relevante
|
||||
2. Envía tanto la salida de la IA como el contexto recuperado a un LLM
|
||||
3. El LLM asigna una puntuación de confianza (escala de 0-10)
|
||||
- **0** = Alucinación completa (totalmente infundada)
|
||||
- **10** = Completamente fundamentado (totalmente respaldado por la base de conocimientos)
|
||||
4. La validación se aprueba si la puntuación ≥ umbral (predeterminado: 3)
|
||||
|
||||
**Configuración:**
|
||||
- **Base de conocimientos**: Selecciona entre tus bases de conocimientos existentes
|
||||
- **Modelo**: Elige LLM para puntuación (requiere razonamiento sólido - se recomienda GPT-4o, Claude 3.7 Sonnet)
|
||||
- **Clave API**: Autenticación para el proveedor LLM seleccionado (oculta automáticamente para modelos alojados/Ollama)
|
||||
- **Umbral de confianza**: Puntuación mínima para aprobar (0-10, predeterminado: 3)
|
||||
- **Top K** (Avanzado): Número de fragmentos de la base de conocimientos a recuperar (predeterminado: 10)
|
||||
|
||||
**Output:**
|
||||
- `passed`: `true` si la puntuación de confianza ≥ umbral
|
||||
- `score`: Puntuación de confianza (0-10)
|
||||
- `reasoning`: Explicación del LLM para la puntuación
|
||||
- `error`: Mensaje de error si la validación falla
|
||||
|
||||
**Casos de uso:**
|
||||
- Validar respuestas de agentes contra documentación
|
||||
- Asegurar que las respuestas de atención al cliente sean precisas
|
||||
- Verificar que el contenido generado coincida con el material de origen
|
||||
- Control de calidad para aplicaciones RAG
|
||||
|
||||
### Detección de PII
|
||||
|
||||
Detecta información de identificación personal utilizando Microsoft Presidio. Compatible con más de 40 tipos de entidades en múltiples países e idiomas.
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="guardrails.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Cómo funciona:**
|
||||
1. Escanea el contenido en busca de entidades PII mediante coincidencia de patrones y PNL
|
||||
2. Devuelve las entidades detectadas con ubicaciones y puntuaciones de confianza
|
||||
3. Opcionalmente enmascara la PII detectada en la salida
|
||||
|
||||
**Configuración:**
|
||||
- **Tipos de PII a detectar**: Seleccione de categorías agrupadas mediante selector modal
|
||||
- **Común**: Nombre de persona, Email, Teléfono, Tarjeta de crédito, Dirección IP, etc.
|
||||
- **EE.UU.**: SSN, Licencia de conducir, Pasaporte, etc.
|
||||
- **Reino Unido**: Número NHS, Número de seguro nacional
|
||||
- **España**: NIF, NIE, CIF
|
||||
- **Italia**: Código fiscal, Licencia de conducir, Código de IVA
|
||||
- **Polonia**: PESEL, NIP, REGON
|
||||
- **Singapur**: NRIC/FIN, UEN
|
||||
- **Australia**: ABN, ACN, TFN, Medicare
|
||||
- **India**: Aadhaar, PAN, Pasaporte, Número de votante
|
||||
- **Modo**:
|
||||
- **Detectar**: Solo identificar PII (predeterminado)
|
||||
- **Enmascarar**: Reemplazar PII detectada con valores enmascarados
|
||||
- **Idioma**: Idioma de detección (predeterminado: inglés)
|
||||
|
||||
**Salida:**
|
||||
- `passed`: `false` si se detectan los tipos de PII seleccionados
|
||||
- `detectedEntities`: Array de PII detectada con tipo, ubicación y confianza
|
||||
- `maskedText`: Contenido con PII enmascarada (solo si modo = "Mask")
|
||||
- `error`: Mensaje de error si la validación falla
|
||||
|
||||
**Casos de uso:**
|
||||
- Bloquear contenido que contiene información personal sensible
|
||||
- Enmascarar PII antes de registrar o almacenar datos
|
||||
- Cumplimiento con GDPR, HIPAA y otras regulaciones de privacidad
|
||||
- Sanear entradas de usuario antes del procesamiento
|
||||
|
||||
## Configuración
|
||||
|
||||
### Contenido a validar
|
||||
|
||||
El contenido de entrada para validar. Esto típicamente proviene de:
|
||||
- Salidas de bloques de agente: `<agent.content>`
|
||||
- Resultados de bloques de función: `<function.output>`
|
||||
- Respuestas de API: `<api.output>`
|
||||
- Cualquier otra salida de bloque
|
||||
|
||||
### Tipo de validación
|
||||
|
||||
Elija entre cuatro tipos de validación:
|
||||
- **JSON válido**: Comprobar si el contenido es JSON correctamente formateado
|
||||
- **Coincidencia Regex**: Verificar si el contenido coincide con un patrón regex
|
||||
- **Comprobación de alucinaciones**: Validar contra base de conocimiento con puntuación LLM
|
||||
- **Detección de PII**: Detectar y opcionalmente enmascarar información de identificación personal
|
||||
|
||||
## Salidas
|
||||
|
||||
Todos los tipos de validación devuelven:
|
||||
|
||||
- **`<guardrails.passed>`**: Booleano que indica si la validación fue exitosa
|
||||
- **`<guardrails.validationType>`**: El tipo de validación realizada
|
||||
- **`<guardrails.input>`**: La entrada original que fue validada
|
||||
- **`<guardrails.error>`**: Mensaje de error si la validación falló (opcional)
|
||||
|
||||
Salidas adicionales por tipo:
|
||||
|
||||
**Verificación de alucinaciones:**
|
||||
- **`<guardrails.score>`**: Puntuación de confianza (0-10)
|
||||
- **`<guardrails.reasoning>`**: Explicación del LLM
|
||||
|
||||
**Detección de PII:**
|
||||
- **`<guardrails.detectedEntities>`**: Array de entidades PII detectadas
|
||||
- **`<guardrails.maskedText>`**: Contenido con PII enmascarado (si el modo = "Mask")
|
||||
|
||||
## Ejemplos de casos de uso
|
||||
|
||||
### Validar JSON antes de analizarlo
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Escenario: Asegurar que la salida del agente sea JSON válido</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>El agente genera una respuesta JSON estructurada</li>
|
||||
<li>Guardrails valida el formato JSON</li>
|
||||
<li>El bloque de condición verifica `<guardrails.passed>`</li>
|
||||
<li>Si pasa → Analizar y usar datos, Si falla → Reintentar o manejar el error</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Prevenir alucinaciones
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Escenario: Validar respuestas de atención al cliente</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>El agente genera una respuesta a la pregunta del cliente</li>
|
||||
<li>Guardrails verifica contra la base de conocimientos de documentación de soporte</li>
|
||||
<li>Si la puntuación de confianza ≥ 3 → Enviar respuesta</li>
|
||||
<li>Si la puntuación de confianza \< 3 → Marcar para revisión humana</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Bloquear PII en entradas de usuario
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Escenario: Sanear contenido enviado por usuarios</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>El usuario envía un formulario con contenido de texto</li>
|
||||
<li>Guardrails detecta PII (correos electrónicos, números de teléfono, SSN, etc.)</li>
|
||||
<li>Si se detecta PII → Rechazar el envío o enmascarar datos sensibles</li>
|
||||
<li>Si no hay PII → Procesar normalmente</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="guardrails-example.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
### Validar formato de correo electrónico
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Escenario: Comprobar el formato de dirección de correo electrónico</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>El agente extrae el correo electrónico del texto</li>
|
||||
<li>Guardrails valida con un patrón regex</li>
|
||||
<li>Si es válido → Usar el correo electrónico para notificación</li>
|
||||
<li>Si no es válido → Solicitar corrección</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
- **Encadena con bloques de Condición**: Usa `<guardrails.passed>` para ramificar la lógica del flujo de trabajo según los resultados de validación
|
||||
- **Usa validación JSON antes de analizar**: Siempre valida la estructura JSON antes de intentar analizar las salidas de LLM
|
||||
- **Elige los tipos de PII apropiados**: Selecciona solo los tipos de entidades PII relevantes para tu caso de uso para un mejor rendimiento
|
||||
- **Establece umbrales de confianza razonables**: Para la detección de alucinaciones, ajusta el umbral según tus requisitos de precisión (más alto = más estricto)
|
||||
- **Usa modelos potentes para la detección de alucinaciones**: GPT-4o o Claude 3.7 Sonnet proporcionan una puntuación de confianza más precisa
|
||||
- **Enmascara PII para el registro**: Usa el modo "Mask" cuando necesites registrar o almacenar contenido que pueda contener PII
|
||||
- **Prueba patrones regex**: Valida tus patrones de expresiones regulares minuciosamente antes de implementarlos en producción
|
||||
- **Monitorea fallos de validación**: Rastrea los mensajes `<guardrails.error>` para identificar problemas comunes de validación
|
||||
|
||||
<Callout type="info">
|
||||
La validación de Guardrails ocurre de forma sincrónica en tu flujo de trabajo. Para la detección de alucinaciones, elige modelos más rápidos (como GPT-4o-mini) si la latencia es crítica.
|
||||
</Callout>
|
||||
@@ -535,7 +535,7 @@ app.post('/sim-webhook', (req, res) => {
|
||||
// Handle error...
|
||||
} else {
|
||||
console.log(`Workflow ${workflowId} completed: ${executionId}`);
|
||||
console.log(`Cost: ${cost.total}`);
|
||||
console.log(`Cost: $${cost.total}`);
|
||||
// Process successful execution...
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -180,6 +180,41 @@ Los diferentes planes de suscripción tienen diferentes límites de uso:
|
||||
|
||||
## Próximos pasos
|
||||
|
||||
- Revisa tu uso actual en [Configuración → Suscripción](https://sim.ai/settings/subscription)
|
||||
- Aprende sobre [Registro](/execution/logging) para seguir los detalles de ejecución
|
||||
- Explora la [API externa](/execution/api) para monitoreo programático de costos
|
||||
- Consulta las [técnicas de optimización de flujo de trabajo](/blocks) para reducir costos
|
||||
|
||||
**Plan de equipo (40$/asiento/mes):**
|
||||
- Uso compartido entre todos los miembros del equipo
|
||||
- Exceso calculado del uso total del equipo
|
||||
- El propietario de la organización recibe una sola factura
|
||||
|
||||
**Planes empresariales:**
|
||||
- Precio mensual fijo, sin excesos
|
||||
- Límites de uso personalizados según acuerdo
|
||||
|
||||
### Facturación por umbral
|
||||
|
||||
Cuando el exceso no facturado alcanza los 50$, Sim factura automáticamente el monto total no facturado.
|
||||
|
||||
**Ejemplo:**
|
||||
- Día 10: 70$ de exceso → Facturar 70$ inmediatamente
|
||||
- Día 15: 35$ adicionales de uso (105$ en total) → Ya facturado, sin acción
|
||||
- Día 20: Otros 50$ de uso (155$ en total, 85$ sin facturar) → Facturar 85$ inmediatamente
|
||||
|
||||
Esto distribuye los cargos grandes por exceso a lo largo del mes en lugar de una factura grande al final del período.
|
||||
|
||||
## Mejores prácticas de gestión de costos
|
||||
|
||||
1. **Monitorear regularmente**: Revisa tu panel de uso con frecuencia para evitar sorpresas
|
||||
2. **Establecer presupuestos**: Usa los límites del plan como guía para tus gastos
|
||||
3. **Optimizar flujos de trabajo**: Revisa las ejecuciones de alto costo y optimiza los prompts o la selección de modelos
|
||||
4. **Usar modelos apropiados**: Ajusta la complejidad del modelo a los requisitos de la tarea
|
||||
5. **Agrupar tareas similares**: Combina múltiples solicitudes cuando sea posible para reducir la sobrecarga
|
||||
|
||||
## Próximos pasos
|
||||
|
||||
- Revisa tu uso actual en [Configuración → Suscripción](https://sim.ai/settings/subscription)
|
||||
- Aprende sobre [Registro](/execution/logging) para seguir los detalles de ejecución
|
||||
- Explora la [API externa](/execution/api) para monitoreo programático de costos
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: TypeScript/JavaScript SDK
|
||||
title: SDK de TypeScript/JavaScript
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
@@ -7,10 +7,10 @@ import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
|
||||
El SDK oficial de TypeScript/JavaScript para Sim proporciona seguridad de tipos completa y es compatible tanto con entornos Node.js como de navegador, lo que te permite ejecutar flujos de trabajo programáticamente desde tus aplicaciones Node.js, aplicaciones web y otros entornos JavaScript.
|
||||
El SDK oficial de TypeScript/JavaScript para Sim proporciona seguridad de tipos completa y es compatible tanto con entornos Node.js como con navegadores, lo que te permite ejecutar flujos de trabajo programáticamente desde tus aplicaciones Node.js, aplicaciones web y otros entornos JavaScript.
|
||||
|
||||
<Callout type="info">
|
||||
El SDK de TypeScript proporciona seguridad de tipos completa, soporte para ejecución asíncrona, limitación automática de velocidad con retroceso exponencial y seguimiento de uso.
|
||||
El SDK de TypeScript proporciona seguridad de tipos completa, soporte para ejecución asíncrona, limitación automática de tasa con retroceso exponencial y seguimiento de uso.
|
||||
</Callout>
|
||||
|
||||
## Instalación
|
||||
@@ -96,12 +96,12 @@ const result = await client.executeWorkflow('workflow-id', {
|
||||
- `input` (any): Datos de entrada para pasar al flujo de trabajo
|
||||
- `timeout` (number): Tiempo de espera en milisegundos (predeterminado: 30000)
|
||||
- `stream` (boolean): Habilitar respuestas en streaming (predeterminado: false)
|
||||
- `selectedOutputs` (string[]): Bloquear salidas para transmitir en formato `blockName.attribute` (por ejemplo, `["agent1.content"]`)
|
||||
- `selectedOutputs` (string[]): Salidas de bloques para transmitir en formato `blockName.attribute` (p. ej., `["agent1.content"]`)
|
||||
- `async` (boolean): Ejecutar de forma asíncrona (predeterminado: false)
|
||||
|
||||
**Devuelve:** `Promise<WorkflowExecutionResult | AsyncExecutionResult>`
|
||||
|
||||
Cuando `async: true`, devuelve inmediatamente un ID de tarea para sondeo. De lo contrario, espera a que se complete.
|
||||
Cuando `async: true`, devuelve inmediatamente un ID de tarea para consultar. De lo contrario, espera hasta completarse.
|
||||
|
||||
##### getWorkflowStatus()
|
||||
|
||||
@@ -146,7 +146,7 @@ if (status.status === 'completed') {
|
||||
```
|
||||
|
||||
**Parámetros:**
|
||||
- `taskId` (string): El ID de tarea devuelto de la ejecución asíncrona
|
||||
- `taskId` (string): El ID de tarea devuelto por la ejecución asíncrona
|
||||
|
||||
**Devuelve:** `Promise<JobStatus>`
|
||||
|
||||
@@ -161,7 +161,7 @@ if (status.status === 'completed') {
|
||||
|
||||
##### executeWithRetry()
|
||||
|
||||
Ejecuta un flujo de trabajo con reintento automático en errores de límite de tasa utilizando retroceso exponencial.
|
||||
Ejecutar un flujo de trabajo con reintento automático en errores de límite de tasa usando retroceso exponencial.
|
||||
|
||||
```typescript
|
||||
const result = await client.executeWithRetry('workflow-id', {
|
||||
@@ -247,7 +247,7 @@ console.log('Plan:', limits.usage.plan);
|
||||
|
||||
##### setApiKey()
|
||||
|
||||
Actualiza la clave API.
|
||||
Actualiza la clave de API.
|
||||
|
||||
```typescript
|
||||
client.setApiKey('new-api-key');
|
||||
@@ -501,9 +501,9 @@ Configura el cliente usando variables de entorno:
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Integración con Express de Node.js
|
||||
### Integración con Node.js Express
|
||||
|
||||
Integra con un servidor Express.js:
|
||||
Integración con un servidor Express.js:
|
||||
|
||||
```typescript
|
||||
import express from 'express';
|
||||
@@ -582,7 +582,7 @@ export default async function handler(
|
||||
}
|
||||
```
|
||||
|
||||
### Uso del navegador
|
||||
### Uso en el navegador
|
||||
|
||||
Uso en el navegador (con configuración CORS adecuada):
|
||||
|
||||
@@ -604,19 +604,98 @@ async function executeClientSideWorkflow() {
|
||||
});
|
||||
|
||||
console.log('Workflow result:', result);
|
||||
|
||||
|
||||
// Update UI with result
|
||||
document.getElementById('result')!.textContent =
|
||||
document.getElementById('result')!.textContent =
|
||||
JSON.stringify(result.output, null, 2);
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Attach to button click
|
||||
document.getElementById('executeBtn')?.addEventListener('click', executeClientSideWorkflow);
|
||||
```
|
||||
|
||||
### Carga de archivos
|
||||
|
||||
Los objetos File son detectados automáticamente y convertidos a formato base64. Inclúyelos en tu entrada bajo el nombre de campo que coincida con el formato de entrada del disparador API de tu flujo de trabajo.
|
||||
|
||||
El SDK convierte los objetos File a este formato:
|
||||
|
||||
```typescript
|
||||
{
|
||||
type: 'file',
|
||||
data: 'data:mime/type;base64,base64data',
|
||||
name: 'filename',
|
||||
mime: 'mime/type'
|
||||
}
|
||||
```
|
||||
|
||||
Alternativamente, puedes proporcionar archivos manualmente usando el formato URL:
|
||||
|
||||
```typescript
|
||||
{
|
||||
type: 'url',
|
||||
data: 'https://example.com/file.pdf',
|
||||
name: 'file.pdf',
|
||||
mime: 'application/pdf'
|
||||
}
|
||||
```
|
||||
|
||||
<Tabs items={['Browser', 'Node.js']}>
|
||||
<Tab value="Browser">
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
|
||||
const client = new SimStudioClient({
|
||||
apiKey: process.env.NEXT_PUBLIC_SIM_API_KEY!
|
||||
});
|
||||
|
||||
// From file input
|
||||
async function handleFileUpload(event: Event) {
|
||||
const input = event.target as HTMLInputElement;
|
||||
const files = Array.from(input.files || []);
|
||||
|
||||
// Include files under the field name from your API trigger's input format
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
input: {
|
||||
documents: files, // Must match your workflow's "files" field name
|
||||
instructions: 'Analyze these documents'
|
||||
}
|
||||
});
|
||||
|
||||
console.log('Result:', result);
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="Node.js">
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
import fs from 'fs';
|
||||
|
||||
const client = new SimStudioClient({
|
||||
apiKey: process.env.SIM_API_KEY!
|
||||
});
|
||||
|
||||
// Read file and create File object
|
||||
const fileBuffer = fs.readFileSync('./document.pdf');
|
||||
const file = new File([fileBuffer], 'document.pdf', {
|
||||
type: 'application/pdf'
|
||||
});
|
||||
|
||||
// Include files under the field name from your API trigger's input format
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
input: {
|
||||
documents: [file], // Must match your workflow's "files" field name
|
||||
query: 'Summarize this document'
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Callout type="warning">
|
||||
Cuando uses el SDK en el navegador, ten cuidado de no exponer claves API sensibles. Considera usar un proxy de backend o claves API públicas con permisos limitados.
|
||||
</Callout>
|
||||
@@ -748,9 +827,9 @@ async function executeAsync() {
|
||||
executeAsync();
|
||||
```
|
||||
|
||||
### Límite de tasa y reintentos
|
||||
### Limitación de tasa y reintentos
|
||||
|
||||
Maneja límites de tasa automáticamente con retroceso exponencial:
|
||||
Maneja los límites de tasa automáticamente con retroceso exponencial:
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient, SimStudioError } from 'simstudio-ts-sdk';
|
||||
@@ -788,7 +867,7 @@ async function executeWithRetryHandling() {
|
||||
|
||||
### Monitoreo de uso
|
||||
|
||||
Monitorea el uso de tu cuenta y sus límites:
|
||||
Monitorea el uso y los límites de tu cuenta:
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
@@ -815,11 +894,27 @@ async function checkUsage() {
|
||||
console.log(' Is limited:', limits.rateLimit.async.isLimited);
|
||||
|
||||
console.log('\n=== Usage ===');
|
||||
console.log('Current period cost:
|
||||
console.log('Current period cost: $' + limits.usage.currentPeriodCost.toFixed(2));
|
||||
console.log('Limit: $' + limits.usage.limit.toFixed(2));
|
||||
console.log('Plan:', limits.usage.plan);
|
||||
|
||||
### Streaming Workflow Execution
|
||||
const percentUsed = (limits.usage.currentPeriodCost / limits.usage.limit) * 100;
|
||||
console.log('Usage: ' + percentUsed.toFixed(1) + '%');
|
||||
|
||||
Execute workflows with real-time streaming responses:
|
||||
if (percentUsed > 80) {
|
||||
console.warn('⚠️ Warning: You are approaching your usage limit!');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error checking usage:', error);
|
||||
}
|
||||
}
|
||||
|
||||
checkUsage();
|
||||
```
|
||||
|
||||
### Ejecución de flujo de trabajo con streaming
|
||||
|
||||
Ejecuta flujos de trabajo con respuestas en streaming en tiempo real:
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
@@ -830,33 +925,33 @@ const client = new SimStudioClient({
|
||||
|
||||
async function executeWithStreaming() {
|
||||
try {
|
||||
// Habilita streaming para salidas de bloques específicos
|
||||
// Enable streaming for specific block outputs
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
input: { message: 'Count to five' },
|
||||
stream: true,
|
||||
selectedOutputs: ['agent1.content'] // Usa el formato blockName.attribute
|
||||
selectedOutputs: ['agent1.content'] // Use blockName.attribute format
|
||||
});
|
||||
|
||||
console.log('Resultado del flujo de trabajo:', result);
|
||||
console.log('Workflow result:', result);
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The streaming response follows the Server-Sent Events (SSE) format:
|
||||
La respuesta en streaming sigue el formato de eventos enviados por el servidor (SSE):
|
||||
|
||||
```
|
||||
data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":"One"}
|
||||
|
||||
data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":", dos"}
|
||||
data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":", two"}
|
||||
|
||||
data: {"event":"done","success":true,"output":{},"metadata":{"duration":610}}
|
||||
|
||||
data: [DONE]
|
||||
```
|
||||
|
||||
**React Streaming Example:**
|
||||
**Ejemplo de streaming en React:**
|
||||
|
||||
```typescript
|
||||
import { useState, useEffect } from 'react';
|
||||
@@ -920,7 +1015,7 @@ function StreamingWorkflow() {
|
||||
return (
|
||||
<div>
|
||||
<button onClick={executeStreaming} disabled={loading}>
|
||||
{loading ? 'Generando...' : 'Iniciar streaming'}
|
||||
{loading ? 'Generating...' : 'Start Streaming'}
|
||||
</button>
|
||||
<div style={{ whiteSpace: 'pre-wrap' }}>{output}</div>
|
||||
</div>
|
||||
@@ -928,64 +1023,35 @@ function StreamingWorkflow() {
|
||||
}
|
||||
```
|
||||
|
||||
## Getting Your API Key
|
||||
## Obtener tu clave API
|
||||
|
||||
<Steps>
|
||||
<Step title="Log in to Sim">
|
||||
Navigate to [Sim](https://sim.ai) and log in to your account.
|
||||
<Step title="Inicia sesión en Sim">
|
||||
Navega a [Sim](https://sim.ai) e inicia sesión en tu cuenta.
|
||||
</Step>
|
||||
<Step title="Open your workflow">
|
||||
Navigate to the workflow you want to execute programmatically.
|
||||
<Step title="Abre tu flujo de trabajo">
|
||||
Navega al flujo de trabajo que quieres ejecutar programáticamente.
|
||||
</Step>
|
||||
<Step title="Deploy your workflow">
|
||||
Click on "Deploy" to deploy your workflow if it hasn't been deployed yet.
|
||||
<Step title="Despliega tu flujo de trabajo">
|
||||
Haz clic en "Desplegar" para desplegar tu flujo de trabajo si aún no ha sido desplegado.
|
||||
</Step>
|
||||
<Step title="Create or select an API key">
|
||||
During the deployment process, select or create an API key.
|
||||
<Step title="Crea o selecciona una clave API">
|
||||
Durante el proceso de despliegue, selecciona o crea una clave API.
|
||||
</Step>
|
||||
<Step title="Copy the API key">
|
||||
Copy the API key to use in your TypeScript/JavaScript application.
|
||||
<Step title="Copia la clave API">
|
||||
Copia la clave API para usarla en tu aplicación TypeScript/JavaScript.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Callout type="warning">
|
||||
Keep your API key secure and never commit it to version control. Use environment variables or secure configuration management.
|
||||
Mantén tu clave API segura y nunca la incluyas en el control de versiones. Utiliza variables de entorno o gestión segura de configuración.
|
||||
</Callout>
|
||||
|
||||
## Requirements
|
||||
## Requisitos
|
||||
|
||||
- Node.js 16+
|
||||
- TypeScript 5.0+ (for TypeScript projects)
|
||||
- TypeScript 5.0+ (para proyectos TypeScript)
|
||||
|
||||
## TypeScript Support
|
||||
## Licencia
|
||||
|
||||
The SDK is written in TypeScript and provides full type safety:
|
||||
|
||||
```typescript
|
||||
import {
|
||||
SimStudioClient,
|
||||
WorkflowExecutionResult,
|
||||
WorkflowStatus,
|
||||
SimStudioError
|
||||
} from 'simstudio-ts-sdk';
|
||||
|
||||
// Type-safe client initialization
|
||||
const client: SimStudioClient = new SimStudioClient({
|
||||
apiKey: process.env.SIM_API_KEY!
|
||||
});
|
||||
|
||||
// Type-safe workflow execution
|
||||
const result: WorkflowExecutionResult = await client.executeWorkflow('workflow-id', {
|
||||
input: {
|
||||
message: '¡Hola, TypeScript!'
|
||||
}
|
||||
});
|
||||
|
||||
// Type-safe status checking
|
||||
const status: WorkflowStatus = await client.getWorkflowStatus('workflow-id');
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Apache-2.0
|
||||
Apache-2.0
|
||||
@@ -22,7 +22,210 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
## Descripción general
|
||||
|
||||
El bloque de Webhook Genérico te permite recibir webhooks desde cualquier servicio externo. Este es un disparador flexible que puede manejar cualquier carga útil JSON, lo que lo hace ideal para integrarse con servicios que no tienen un bloque Sim dedicado.
|
||||
|
||||
## Uso básico
|
||||
|
||||
### Modo de paso simple
|
||||
|
||||
Sin definir un formato de entrada, el webhook transmite todo el cuerpo de la solicitud tal como está:
|
||||
|
||||
```bash
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"message": "Test webhook trigger",
|
||||
"data": {
|
||||
"key": "value"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
Accede a los datos en bloques posteriores usando:
|
||||
- `<webhook1.message>` → "Test webhook trigger"
|
||||
- `<webhook1.data.key>` → "value"
|
||||
|
||||
### Formato de entrada estructurado (opcional)
|
||||
|
||||
Define un esquema de entrada para obtener campos tipados y habilitar funciones avanzadas como cargas de archivos:
|
||||
|
||||
**Configuración del formato de entrada:**
|
||||
|
||||
```json
|
||||
[
|
||||
{ "name": "message", "type": "string" },
|
||||
{ "name": "priority", "type": "number" },
|
||||
{ "name": "documents", "type": "files" }
|
||||
]
|
||||
```
|
||||
|
||||
**Solicitud de webhook:**
|
||||
|
||||
```bash
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"message": "Invoice submission",
|
||||
"priority": 1,
|
||||
"documents": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:application/pdf;base64,JVBERi0xLjQK...",
|
||||
"name": "invoice.pdf",
|
||||
"mime": "application/pdf"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
## Cargas de archivos
|
||||
|
||||
### Formatos de archivo compatibles
|
||||
|
||||
El webhook admite dos formatos de entrada de archivos:
|
||||
|
||||
#### 1. Archivos codificados en Base64
|
||||
Para cargar contenido de archivos directamente:
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA...",
|
||||
"name": "screenshot.png",
|
||||
"mime": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- **Tamaño máximo**: 20MB por archivo
|
||||
- **Formato**: URL de datos estándar con codificación base64
|
||||
- **Almacenamiento**: Los archivos se cargan en un almacenamiento de ejecución seguro
|
||||
|
||||
#### 2. Referencias URL
|
||||
Para pasar URLs de archivos existentes:
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [
|
||||
{
|
||||
"type": "url",
|
||||
"data": "https://example.com/files/document.pdf",
|
||||
"name": "document.pdf",
|
||||
"mime": "application/pdf"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Acceso a archivos en bloques posteriores
|
||||
|
||||
Los archivos se procesan en objetos `UserFile` con las siguientes propiedades:
|
||||
|
||||
```typescript
|
||||
{
|
||||
id: string, // Unique file identifier
|
||||
name: string, // Original filename
|
||||
url: string, // Presigned URL (valid for 5 minutes)
|
||||
size: number, // File size in bytes
|
||||
type: string, // MIME type
|
||||
key: string, // Storage key
|
||||
uploadedAt: string, // ISO timestamp
|
||||
expiresAt: string // ISO timestamp (5 minutes)
|
||||
}
|
||||
```
|
||||
|
||||
**Acceso en bloques:**
|
||||
- `<webhook1.documents[0].url>` → URL de descarga
|
||||
- `<webhook1.documents[0].name>` → "invoice.pdf"
|
||||
- `<webhook1.documents[0].size>` → 524288
|
||||
- `<webhook1.documents[0].type>` → "application/pdf"
|
||||
|
||||
### Ejemplo completo de carga de archivos
|
||||
|
||||
```bash
|
||||
# Create a base64-encoded file
|
||||
echo "Hello World" | base64
|
||||
# SGVsbG8gV29ybGQK
|
||||
|
||||
# Send webhook with file
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"subject": "Document for review",
|
||||
"attachments": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:text/plain;base64,SGVsbG8gV29ybGQK",
|
||||
"name": "sample.txt",
|
||||
"mime": "text/plain"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
## Autenticación
|
||||
|
||||
### Configurar autenticación (opcional)
|
||||
|
||||
En la configuración del webhook:
|
||||
1. Habilita "Requerir autenticación"
|
||||
2. Establece un token secreto
|
||||
3. Elige el tipo de encabezado:
|
||||
- **Encabezado personalizado**: `X-Sim-Secret: your-token`
|
||||
- **Autorización Bearer**: `Authorization: Bearer your-token`
|
||||
|
||||
### Uso de la autenticación
|
||||
|
||||
```bash
|
||||
# With custom header
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret-token" \
|
||||
-d '{"message": "Authenticated request"}'
|
||||
|
||||
# With bearer token
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer your-secret-token" \
|
||||
-d '{"message": "Authenticated request"}'
|
||||
```
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
1. **Usa formato de entrada para la estructura**: define un formato de entrada cuando conozcas el esquema esperado. Esto proporciona:
|
||||
- Validación de tipo
|
||||
- Mejor autocompletado en el editor
|
||||
- Capacidades de carga de archivos
|
||||
|
||||
2. **Autenticación**: habilita siempre la autenticación para webhooks en producción para prevenir accesos no autorizados.
|
||||
|
||||
3. **Límites de tamaño de archivo**: mantén los archivos por debajo de 20MB. Para archivos más grandes, usa referencias URL en su lugar.
|
||||
|
||||
4. **Caducidad de archivos**: los archivos descargados tienen URLs con caducidad de 5 minutos. Procésalos rápidamente o almacénalos en otro lugar si los necesitas por más tiempo.
|
||||
|
||||
5. **Manejo de errores**: el procesamiento de webhooks es asíncrono. Revisa los registros de ejecución para ver errores.
|
||||
|
||||
6. **Pruebas**: usa el botón "Probar webhook" en el editor para validar tu configuración antes de implementarla.
|
||||
|
||||
## Casos de uso
|
||||
|
||||
- **Envíos de formularios**: recibe datos de formularios personalizados con cargas de archivos
|
||||
- **Integraciones con terceros**: conéctate con servicios que envían webhooks (Stripe, GitHub, etc.)
|
||||
- **Procesamiento de documentos**: acepta documentos de sistemas externos para procesamiento
|
||||
- **Notificaciones de eventos**: recibe datos de eventos de varias fuentes
|
||||
- **APIs personalizadas**: construye endpoints de API personalizados para tus aplicaciones
|
||||
|
||||
## Notas
|
||||
|
||||
- Categoría: `triggers`
|
||||
- Tipo: `generic_webhook`
|
||||
- **Soporte de archivos**: disponible a través de la configuración del formato de entrada
|
||||
- **Tamaño máximo de archivo**: 20MB por archivo
|
||||
|
||||
@@ -59,11 +59,11 @@ Busca contenido similar en una base de conocimiento utilizando similitud vectori
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `knowledgeBaseId` | string | Sí | ID de la base de conocimiento en la que buscar |
|
||||
| `query` | string | No | Texto de consulta de búsqueda \(opcional cuando se usan filtros de etiquetas\) |
|
||||
| `query` | string | No | Texto de consulta de búsqueda \(opcional cuando se utilizan filtros de etiquetas\) |
|
||||
| `topK` | number | No | Número de resultados más similares a devolver \(1-100\) |
|
||||
| `tagFilters` | any | No | Array de filtros de etiquetas con propiedades tagName y tagValue |
|
||||
| `tagFilters` | array | No | Array de filtros de etiquetas con propiedades tagName y tagValue |
|
||||
|
||||
#### Salida
|
||||
|
||||
|
||||
@@ -108,8 +108,9 @@ Leer contenido de un chat de Microsoft Teams
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `chatId` | string | Sí | El ID del chat del que leer |
|
||||
| `includeAttachments` | boolean | No | Descargar e incluir archivos adjuntos de mensajes \(contenidos alojados\) en el almacenamiento |
|
||||
|
||||
#### Salida
|
||||
|
||||
@@ -122,6 +123,7 @@ Leer contenido de un chat de Microsoft Teams
|
||||
| `attachmentCount` | number | Número total de archivos adjuntos encontrados |
|
||||
| `attachmentTypes` | array | Tipos de archivos adjuntos encontrados |
|
||||
| `content` | string | Contenido formateado de los mensajes de chat |
|
||||
| `attachments` | file[] | Archivos adjuntos subidos para mayor comodidad \(aplanados\) |
|
||||
|
||||
### `microsoft_teams_write_chat`
|
||||
|
||||
@@ -155,6 +157,7 @@ Leer contenido de un canal de Microsoft Teams
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `teamId` | string | Sí | El ID del equipo del que leer |
|
||||
| `channelId` | string | Sí | El ID del canal del que leer |
|
||||
| `includeAttachments` | boolean | No | Descargar e incluir archivos adjuntos de mensajes \(contenidos alojados\) en el almacenamiento |
|
||||
|
||||
#### Salida
|
||||
|
||||
@@ -168,6 +171,7 @@ Leer contenido de un canal de Microsoft Teams
|
||||
| `attachmentCount` | number | Número total de archivos adjuntos encontrados |
|
||||
| `attachmentTypes` | array | Tipos de archivos adjuntos encontrados |
|
||||
| `content` | string | Contenido formateado de los mensajes del canal |
|
||||
| `attachments` | file[] | Archivos adjuntos subidos para mayor comodidad \(aplanados\) |
|
||||
|
||||
### `microsoft_teams_write_channel`
|
||||
|
||||
|
||||
@@ -201,8 +201,9 @@ Leer correos electrónicos desde Outlook
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `folder` | string | No | ID de la carpeta desde donde leer los correos electrónicos \(predeterminado: Bandeja de entrada\) |
|
||||
| `folder` | string | No | ID de la carpeta para leer correos electrónicos \(predeterminado: Bandeja de entrada\) |
|
||||
| `maxResults` | number | No | Número máximo de correos electrónicos a recuperar \(predeterminado: 1, máximo: 10\) |
|
||||
| `includeAttachments` | boolean | No | Descargar e incluir archivos adjuntos de correo electrónico |
|
||||
|
||||
#### Salida
|
||||
|
||||
@@ -210,6 +211,7 @@ Leer correos electrónicos desde Outlook
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Mensaje de éxito o estado |
|
||||
| `results` | array | Array de objetos de mensajes de correo electrónico |
|
||||
| `attachments` | file[] | Todos los archivos adjuntos de correo electrónico aplanados de todos los correos |
|
||||
|
||||
### `outlook_forward`
|
||||
|
||||
|
||||
@@ -109,9 +109,9 @@ Insertar datos en una tabla de Supabase
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `projectId` | string | Sí | ID de tu proyecto de Supabase \(p. ej., jdrkgepadsdopsntdlom\) |
|
||||
| `table` | string | Sí | Nombre de la tabla de Supabase donde insertar los datos |
|
||||
| `data` | any | Sí | Los datos a insertar |
|
||||
| `projectId` | string | Sí | ID de tu proyecto Supabase \(p. ej., jdrkgepadsdopsntdlom\) |
|
||||
| `table` | string | Sí | Nombre de la tabla Supabase donde insertar datos |
|
||||
| `data` | array | Sí | Los datos a insertar \(array de objetos o un solo objeto\) |
|
||||
| `apiKey` | string | Sí | Tu clave secreta de rol de servicio de Supabase |
|
||||
|
||||
#### Salida
|
||||
@@ -189,10 +189,10 @@ Insertar o actualizar datos en una tabla de Supabase (operación upsert)
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `projectId` | string | Sí | El ID de tu proyecto Supabase \(p. ej., jdrkgepadsdopsntdlom\) |
|
||||
| `table` | string | Sí | El nombre de la tabla de Supabase donde insertar o actualizar datos |
|
||||
| `data` | any | Sí | Los datos a insertar o actualizar \(upsert\) |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `projectId` | string | Sí | ID de tu proyecto Supabase \(p. ej., jdrkgepadsdopsntdlom\) |
|
||||
| `table` | string | Sí | Nombre de la tabla Supabase donde hacer upsert de datos |
|
||||
| `data` | array | Sí | Los datos para upsert \(insertar o actualizar\) - array de objetos o un solo objeto |
|
||||
| `apiKey` | string | Sí | Tu clave secreta de rol de servicio de Supabase |
|
||||
|
||||
#### Salida
|
||||
|
||||
@@ -87,12 +87,108 @@ Envía mensajes a canales o usuarios de Telegram a través de la API de Bot de T
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `success` | boolean | Estado de éxito del envío del mensaje de Telegram |
|
||||
| `messageId` | number | Identificador único del mensaje de Telegram |
|
||||
| `chatId` | string | ID del chat de destino donde se envió el mensaje |
|
||||
| `text` | string | Contenido de texto del mensaje enviado |
|
||||
| `timestamp` | number | Marca de tiempo Unix cuando se envió el mensaje |
|
||||
| `from` | object | Información sobre el bot que envió el mensaje |
|
||||
| `message` | string | Mensaje de éxito o error |
|
||||
| `data` | object | Datos del mensaje de Telegram |
|
||||
|
||||
## Notas
|
||||
|
||||
- Categoría: `tools`
|
||||
- Tipo: `telegram`
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `botToken` | string | Sí | Tu token de API de Bot de Telegram |
|
||||
| `chatId` | string | Sí | ID del chat de Telegram objetivo |
|
||||
| `messageId` | string | Sí | ID del mensaje a eliminar |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Mensaje de éxito o error |
|
||||
| `data` | object | Resultado de la operación de eliminación |
|
||||
|
||||
### `telegram_send_photo`
|
||||
|
||||
Envía fotos a canales o usuarios de Telegram a través de la API de Bot de Telegram.
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `botToken` | string | Sí | Tu token de API de Bot de Telegram |
|
||||
| `chatId` | string | Sí | ID del chat de Telegram objetivo |
|
||||
| `photo` | string | Sí | Foto a enviar. Proporciona un file_id o URL HTTP |
|
||||
| `caption` | string | No | Pie de foto (opcional) |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Mensaje de éxito o error |
|
||||
| `data` | object | Datos del mensaje de Telegram incluyendo foto(s) opcional(es) |
|
||||
|
||||
### `telegram_send_video`
|
||||
|
||||
Envía videos a canales o usuarios de Telegram a través de la API de Bot de Telegram.
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `botToken` | string | Sí | Tu token de API de Bot de Telegram |
|
||||
| `chatId` | string | Sí | ID del chat de Telegram objetivo |
|
||||
| `video` | string | Sí | Video a enviar. Proporciona un file_id o URL HTTP |
|
||||
| `caption` | string | No | Pie de video (opcional) |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Mensaje de éxito o error |
|
||||
| `data` | object | Datos del mensaje de Telegram incluyendo medios opcionales |
|
||||
|
||||
### `telegram_send_audio`
|
||||
|
||||
Envía archivos de audio a canales o usuarios de Telegram a través de la API de Bot de Telegram.
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `botToken` | string | Sí | Tu token de API de Bot de Telegram |
|
||||
| `chatId` | string | Sí | ID del chat de Telegram objetivo |
|
||||
| `audio` | string | Sí | Archivo de audio para enviar. Proporciona un file_id o URL HTTP |
|
||||
| `caption` | string | No | Leyenda del audio \(opcional\) |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Mensaje de éxito o error |
|
||||
| `data` | object | Datos del mensaje de Telegram incluyendo información de voz/audio |
|
||||
|
||||
### `telegram_send_animation`
|
||||
|
||||
Envía animaciones (GIFs) a canales o usuarios de Telegram a través de la API de Bot de Telegram.
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `botToken` | string | Sí | Tu token de API de Bot de Telegram |
|
||||
| `chatId` | string | Sí | ID del chat de Telegram objetivo |
|
||||
| `animation` | string | Sí | Animación para enviar. Proporciona un file_id o URL HTTP |
|
||||
| `caption` | string | No | Leyenda de la animación \(opcional\) |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Mensaje de éxito o error |
|
||||
| `data` | object | Datos del mensaje de Telegram incluyendo medios opcionales |
|
||||
|
||||
## Notas
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: YouTube
|
||||
description: Buscar videos en YouTube
|
||||
description: Interactúa con videos, canales y listas de reproducción de YouTube
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
@@ -39,7 +39,7 @@ En Sim, la integración con YouTube permite a tus agentes buscar y analizar prog
|
||||
|
||||
## Instrucciones de uso
|
||||
|
||||
Integra YouTube en el flujo de trabajo. Puede buscar videos. Requiere clave API.
|
||||
Integra YouTube en el flujo de trabajo. Puede buscar videos, obtener detalles de videos, obtener información de canales, obtener elementos de listas de reproducción y obtener comentarios de videos.
|
||||
|
||||
## Herramientas
|
||||
|
||||
@@ -61,6 +61,99 @@ Busca videos en YouTube utilizando la API de datos de YouTube.
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | array | Array de videos de YouTube que coinciden con la consulta de búsqueda |
|
||||
|
||||
### `youtube_video_details`
|
||||
|
||||
Obtén información detallada sobre un video específico de YouTube.
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `videoId` | string | Sí | ID del video de YouTube |
|
||||
| `apiKey` | string | Sí | Clave API de YouTube |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `videoId` | string | ID del video de YouTube |
|
||||
| `title` | string | Título del video |
|
||||
| `description` | string | Descripción del video |
|
||||
| `channelId` | string | ID del canal |
|
||||
| `channelTitle` | string | Nombre del canal |
|
||||
| `publishedAt` | string | Fecha y hora de publicación |
|
||||
| `duration` | string | Duración del video en formato ISO 8601 |
|
||||
| `viewCount` | number | Número de visualizaciones |
|
||||
| `likeCount` | number | Número de me gusta |
|
||||
| `commentCount` | number | Número de comentarios |
|
||||
| `thumbnail` | string | URL de la miniatura del video |
|
||||
| `tags` | array | Etiquetas del video |
|
||||
|
||||
### `youtube_channel_info`
|
||||
|
||||
Obtén información detallada sobre un canal de YouTube.
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `channelId` | string | No | ID del canal de YouTube \(usa channelId o username\) |
|
||||
| `username` | string | No | Nombre de usuario del canal de YouTube \(usa channelId o username\) |
|
||||
| `apiKey` | string | Sí | Clave API de YouTube |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `channelId` | string | ID del canal de YouTube |
|
||||
| `title` | string | Nombre del canal |
|
||||
| `description` | string | Descripción del canal |
|
||||
| `subscriberCount` | number | Número de suscriptores |
|
||||
| `videoCount` | number | Número de videos |
|
||||
| `viewCount` | number | Vistas totales del canal |
|
||||
| `publishedAt` | string | Fecha de creación del canal |
|
||||
| `thumbnail` | string | URL de la miniatura del canal |
|
||||
| `customUrl` | string | URL personalizada del canal |
|
||||
|
||||
### `youtube_playlist_items`
|
||||
|
||||
Obtener videos de una lista de reproducción de YouTube.
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `playlistId` | string | Sí | ID de la lista de reproducción de YouTube |
|
||||
| `maxResults` | number | No | Número máximo de videos a devolver |
|
||||
| `pageToken` | string | No | Token de página para paginación |
|
||||
| `apiKey` | string | Sí | Clave API de YouTube |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | array | Array de videos en la lista de reproducción |
|
||||
|
||||
### `youtube_comments`
|
||||
|
||||
Obtener comentarios de un video de YouTube.
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `videoId` | string | Sí | ID del video de YouTube |
|
||||
| `maxResults` | number | No | Número máximo de comentarios a devolver |
|
||||
| `order` | string | No | Orden de los comentarios: time (tiempo) o relevance (relevancia) |
|
||||
| `pageToken` | string | No | Token de página para paginación |
|
||||
| `apiKey` | string | Sí | Clave API de YouTube |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | array | Array de comentarios del video |
|
||||
|
||||
## Notas
|
||||
|
||||
- Categoría: `tools`
|
||||
|
||||
242
apps/docs/content/docs/es/tools/zep.mdx
Normal file
242
apps/docs/content/docs/es/tools/zep.mdx
Normal file
@@ -0,0 +1,242 @@
|
||||
---
|
||||
title: Zep
|
||||
description: Memoria a largo plazo para agentes de IA
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="zep"
|
||||
color="#E8E8E8"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
viewBox='0 0 233 196'
|
||||
|
||||
|
||||
>
|
||||
<path
|
||||
d='m231.34,108.7l-1.48-1.55h-10.26l3.59-75.86-14.8-.45-2.77,49.31c-59.6-3.24-119.33-3.24-178.92-.02l-1.73-64.96-14.8.45,2.5,91.53H2.16l-1.41,1.47c-1.55,16.23-.66,32.68,2.26,48.89h10.83l.18,1.27c.67,19.34,16.1,34.68,35.9,34.68s44.86-.92,66.12-.92,46.56.92,65.95.92,35.19-15.29,35.9-34.61l.16-1.34h11.02c2.91-16.19,3.81-32.61,2.26-48.81Zm-158.23,58.01c-17.27,0-30.25-13.78-30.25-29.78s12.99-29.78,30.25-29.78,29.62,13.94,29.62,29.94-12.35,29.62-29.62,29.62Zm86.51,0c-17.27,0-30.25-13.78-30.25-29.78s12.99-29.78,30.25-29.78,29.62,13.94,29.62,29.94-12.35,29.62-29.62,29.62Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<polygon
|
||||
points='111.77 22.4 93.39 49.97 93.52 50.48 185.88 38.51 190.95 27.68 114.32 36.55 117.7 31.48 117.7 31.47 138.38 .49 138.25 0 47.67 11.6 42.85 22.27 118.34 12.61 111.77 22.4'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<path
|
||||
d='m72.97,121.47c-8.67,0-15.73,6.93-15.73,15.46s7.06,15.46,15.73,15.46,15.37-6.75,15.37-15.37-6.75-15.55-15.37-15.55Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<path
|
||||
d='m159.48,121.47c-8.67,0-15.73,6.93-15.73,15.46s7.06,15.46,15.73,15.46,15.37-6.75,15.37-15.37-6.75-15.55-15.37-15.55Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
## Instrucciones de uso
|
||||
|
||||
Integra Zep para la gestión de memoria a largo plazo. Crea hilos, añade mensajes, recupera contexto con resúmenes potenciados por IA y extracción de datos relevantes.
|
||||
|
||||
## Herramientas
|
||||
|
||||
### `zep_create_thread`
|
||||
|
||||
Iniciar un nuevo hilo de conversación en Zep
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Sí | Identificador único para el hilo |
|
||||
| `userId` | string | Sí | ID de usuario asociado con el hilo |
|
||||
| `apiKey` | string | Sí | Tu clave API de Zep |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threadId` | string | El ID del hilo |
|
||||
| `userId` | string | El ID del usuario |
|
||||
| `uuid` | string | UUID interno |
|
||||
| `createdAt` | string | Marca de tiempo de creación |
|
||||
| `projectUuid` | string | UUID del proyecto |
|
||||
|
||||
### `zep_get_threads`
|
||||
|
||||
Listar todos los hilos de conversación
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `pageSize` | number | No | Número de hilos a recuperar por página |
|
||||
| `pageNumber` | number | No | Número de página para paginación |
|
||||
| `orderBy` | string | No | Campo para ordenar resultados \(created_at, updated_at, user_id, thread_id\) |
|
||||
| `asc` | boolean | No | Dirección de ordenamiento: true para ascendente, false para descendente |
|
||||
| `apiKey` | string | Sí | Tu clave API de Zep |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threads` | array | Array de objetos de hilo |
|
||||
| `responseCount` | number | Número de hilos en esta respuesta |
|
||||
| `totalCount` | number | Número total de hilos disponibles |
|
||||
|
||||
### `zep_delete_thread`
|
||||
|
||||
Eliminar un hilo de conversación de Zep
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Sí | ID del hilo a eliminar |
|
||||
| `apiKey` | string | Sí | Tu clave API de Zep |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `deleted` | boolean | Indica si el hilo fue eliminado |
|
||||
|
||||
### `zep_get_context`
|
||||
|
||||
Recuperar el contexto del usuario de un hilo con modo resumen o básico
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Sí | ID del hilo del que obtener el contexto |
|
||||
| `mode` | string | No | Modo de contexto: "summary" \(lenguaje natural\) o "basic" \(hechos sin procesar\) |
|
||||
| `minRating` | number | No | Calificación mínima para filtrar hechos relevantes |
|
||||
| `apiKey` | string | Sí | Tu clave API de Zep |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `context` | string | La cadena de contexto \(resumen o básico\) |
|
||||
| `facts` | array | Hechos extraídos |
|
||||
| `entities` | array | Entidades extraídas |
|
||||
| `summary` | string | Resumen de la conversación |
|
||||
|
||||
### `zep_get_messages`
|
||||
|
||||
Recuperar mensajes de un hilo
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Sí | ID del hilo del que obtener mensajes |
|
||||
| `limit` | number | No | Número máximo de mensajes a devolver |
|
||||
| `cursor` | string | No | Cursor para paginación |
|
||||
| `lastn` | number | No | Número de mensajes más recientes a devolver \(anula el límite y el cursor\) |
|
||||
| `apiKey` | string | Sí | Tu clave API de Zep |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `messages` | array | Array de objetos de mensaje |
|
||||
| `rowCount` | number | Número de mensajes en esta respuesta |
|
||||
| `totalCount` | number | Número total de mensajes en el hilo |
|
||||
|
||||
### `zep_add_messages`
|
||||
|
||||
Añadir mensajes a un hilo existente
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Sí | ID del hilo al que añadir mensajes |
|
||||
| `messages` | json | Sí | Array de objetos de mensaje con rol y contenido |
|
||||
| `apiKey` | string | Sí | Tu clave API de Zep |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `context` | string | Contexto actualizado después de añadir mensajes |
|
||||
| `messageIds` | array | Array de UUIDs de mensajes añadidos |
|
||||
| `threadId` | string | El ID del hilo |
|
||||
|
||||
### `zep_add_user`
|
||||
|
||||
Crear un nuevo usuario en Zep
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `userId` | string | Sí | Identificador único para el usuario |
|
||||
| `email` | string | No | Dirección de correo electrónico del usuario |
|
||||
| `firstName` | string | No | Nombre del usuario |
|
||||
| `lastName` | string | No | Apellido del usuario |
|
||||
| `metadata` | json | No | Metadatos adicionales como objeto JSON |
|
||||
| `apiKey` | string | Sí | Tu clave API de Zep |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `userId` | string | El ID del usuario |
|
||||
| `email` | string | Correo electrónico del usuario |
|
||||
| `firstName` | string | Nombre del usuario |
|
||||
| `lastName` | string | Apellido del usuario |
|
||||
| `uuid` | string | UUID interno |
|
||||
| `createdAt` | string | Marca de tiempo de creación |
|
||||
| `metadata` | object | Metadatos del usuario |
|
||||
|
||||
### `zep_get_user`
|
||||
|
||||
Recuperar información del usuario de Zep
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `userId` | string | Sí | ID del usuario a recuperar |
|
||||
| `apiKey` | string | Sí | Tu clave API de Zep |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `userId` | string | El ID del usuario |
|
||||
| `email` | string | Correo electrónico del usuario |
|
||||
| `firstName` | string | Nombre del usuario |
|
||||
| `lastName` | string | Apellido del usuario |
|
||||
| `uuid` | string | UUID interno |
|
||||
| `createdAt` | string | Marca de tiempo de creación |
|
||||
| `updatedAt` | string | Marca de tiempo de última actualización |
|
||||
| `metadata` | object | Metadatos del usuario |
|
||||
|
||||
### `zep_get_user_threads`
|
||||
|
||||
Listar todos los hilos de conversación para un usuario específico
|
||||
|
||||
#### Entrada
|
||||
|
||||
| Parámetro | Tipo | Obligatorio | Descripción |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `userId` | string | Sí | ID del usuario para obtener los hilos |
|
||||
| `limit` | number | No | Número máximo de hilos a devolver |
|
||||
| `apiKey` | string | Sí | Tu clave API de Zep |
|
||||
|
||||
#### Salida
|
||||
|
||||
| Parámetro | Tipo | Descripción |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threads` | array | Array de objetos de hilo para este usuario |
|
||||
| `userId` | string | El ID del usuario |
|
||||
|
||||
## Notas
|
||||
|
||||
- Categoría: `tools`
|
||||
- Tipo: `zep`
|
||||
@@ -128,3 +128,60 @@ Si no se define un formato de entrada, el ejecutor expone el JSON sin procesar s
|
||||
<Callout type="warning">
|
||||
Un flujo de trabajo puede contener solo un disparador de API. Publica una nueva implementación después de los cambios para que el endpoint se mantenga actualizado.
|
||||
</Callout>
|
||||
|
||||
### Formato de carga de archivos
|
||||
|
||||
La API acepta archivos en dos formatos:
|
||||
|
||||
**1. Archivos codificados en Base64** (recomendado para SDKs):
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [{
|
||||
"type": "file",
|
||||
"data": "data:application/pdf;base64,JVBERi0xLjQK...",
|
||||
"name": "document.pdf",
|
||||
"mime": "application/pdf"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
- Tamaño máximo de archivo: 20MB por archivo
|
||||
- Los archivos se suben al almacenamiento en la nube y se convierten en objetos UserFile con todas las propiedades
|
||||
|
||||
**2. Referencias directas de URL**:
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [{
|
||||
"type": "url",
|
||||
"data": "https://example.com/document.pdf",
|
||||
"name": "document.pdf",
|
||||
"mime": "application/pdf"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
- El archivo no se sube, la URL se pasa directamente
|
||||
- Útil para referenciar archivos existentes
|
||||
|
||||
### Propiedades de archivos
|
||||
|
||||
Para archivos, accede a todas las propiedades:
|
||||
|
||||
| Propiedad | Descripción | Tipo |
|
||||
|----------|-------------|------|
|
||||
| `<api.fieldName[0].url>` | URL de descarga firmada | string |
|
||||
| `<api.fieldName[0].name>` | Nombre original del archivo | string |
|
||||
| `<api.fieldName[0].size>` | Tamaño del archivo en bytes | number |
|
||||
| `<api.fieldName[0].type>` | Tipo MIME | string |
|
||||
| `<api.fieldName[0].uploadedAt>` | Marca de tiempo de subida (ISO 8601) | string |
|
||||
| `<api.fieldName[0].expiresAt>` | Marca de tiempo de caducidad de URL (ISO 8601) | string |
|
||||
|
||||
Para archivos referenciados por URL, las mismas propiedades están disponibles excepto `uploadedAt` y `expiresAt` ya que el archivo no se sube a nuestro almacenamiento.
|
||||
|
||||
Si no se define un formato de entrada, el ejecutor expone solo el JSON sin procesar en `<api.input>`.
|
||||
|
||||
<Callout type="warning">
|
||||
Un flujo de trabajo puede contener solo un disparador de API. Publica una nueva implementación después de los cambios para que el punto de conexión se mantenga actualizado.
|
||||
</Callout>
|
||||
|
||||
@@ -41,3 +41,11 @@ Los archivos incluyen `name`, `mimeType`, y una descarga firmada `url`.
|
||||
<Callout type="info">
|
||||
El constructor bloquea múltiples bloques de Disparador de Chat en el mismo flujo de trabajo.
|
||||
</Callout>
|
||||
|
||||
1. Añade un bloque de Disparador de Chat por flujo de trabajo.
|
||||
2. Despliega el flujo de trabajo en modo chat.
|
||||
3. Comparte el enlace de despliegue—cada respuesta reutiliza el ID de conversación para que el flujo de trabajo pueda mantener el contexto.
|
||||
|
||||
<Callout type="info">
|
||||
El constructor bloquea múltiples bloques de Disparador de Chat en el mismo flujo de trabajo.
|
||||
</Callout>
|
||||
|
||||
@@ -1,242 +0,0 @@
|
||||
---
|
||||
title: Sintaxis de referencia de bloques
|
||||
description: Cómo referenciar datos entre bloques en flujos de trabajo YAML
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
|
||||
Las referencias de bloques son la base del flujo de datos en los flujos de trabajo de Sim. Entender cómo referenciar correctamente las salidas de un bloque como entradas para otro es esencial para construir flujos de trabajo funcionales.
|
||||
|
||||
## Reglas básicas de referencia
|
||||
|
||||
### 1. Usa nombres de bloques, no IDs de bloques
|
||||
|
||||
<Tabs items={['Correct', 'Incorrect']}>
|
||||
<Tab>
|
||||
|
||||
```yaml
|
||||
# Block definition
|
||||
email-sender:
|
||||
type: agent
|
||||
name: "Email Generator"
|
||||
# ... configuration
|
||||
|
||||
# Reference the block
|
||||
next-block:
|
||||
inputs:
|
||||
userPrompt: "Process this: <emailgenerator.content>"
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```yaml
|
||||
# Block definition
|
||||
email-sender:
|
||||
type: agent
|
||||
name: "Email Generator"
|
||||
# ... configuration
|
||||
|
||||
# ❌ Don't reference by block ID
|
||||
next-block:
|
||||
inputs:
|
||||
userPrompt: "Process this: <email-sender.content>"
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### 2. Convierte nombres al formato de referencia
|
||||
|
||||
Para crear una referencia de bloque:
|
||||
|
||||
1. **Toma el nombre del bloque**: "Email Generator"
|
||||
2. **Conviértelo a minúsculas**: "email generator"
|
||||
3. **Elimina espacios y caracteres especiales**: "emailgenerator"
|
||||
4. **Añade la propiedad**: `<emailgenerator.content>`
|
||||
|
||||
### 3. Usa las propiedades correctas
|
||||
|
||||
Diferentes tipos de bloques exponen diferentes propiedades:
|
||||
|
||||
- **Bloques de agente**: `.content` (la respuesta de la IA)
|
||||
- **Bloques de función**: `.output` (el valor de retorno)
|
||||
- **Bloques de API**: `.output` (los datos de respuesta)
|
||||
- **Bloques de herramientas**: `.output` (el resultado de la herramienta)
|
||||
|
||||
## Ejemplos de referencias
|
||||
|
||||
### Referencias de bloques comunes
|
||||
|
||||
```yaml
|
||||
# Agent block outputs
|
||||
<agentname.content> # Primary AI response
|
||||
<agentname.tokens> # Token usage information
|
||||
<agentname.cost> # Estimated cost
|
||||
<agentname.tool_calls> # Tool execution details
|
||||
|
||||
# Function block outputs
|
||||
<functionname.output> # Function return value
|
||||
<functionname.error> # Error information (if any)
|
||||
|
||||
# API block outputs
|
||||
<apiname.output> # Response data
|
||||
<apiname.status> # HTTP status code
|
||||
<apiname.headers> # Response headers
|
||||
|
||||
# Tool block outputs
|
||||
<toolname.output> # Tool execution result
|
||||
```
|
||||
|
||||
### Nombres de bloques con múltiples palabras
|
||||
|
||||
```yaml
|
||||
# Block name: "Data Processor 2"
|
||||
<dataprocessor2.output>
|
||||
|
||||
# Block name: "Email Validation Service"
|
||||
<emailvalidationservice.output>
|
||||
|
||||
# Block name: "Customer Info Agent"
|
||||
<customerinfoagent.content>
|
||||
```
|
||||
|
||||
## Casos especiales de referencia
|
||||
|
||||
### Bloque inicial
|
||||
|
||||
<Callout type="warning">
|
||||
El bloque inicial siempre se referencia como `<start.input>` independientemente de su nombre real.
|
||||
</Callout>
|
||||
|
||||
```yaml
|
||||
# Starter block definition
|
||||
my-custom-start:
|
||||
type: starter
|
||||
name: "Custom Workflow Start"
|
||||
# ... configuration
|
||||
|
||||
# Always reference as 'start'
|
||||
agent-1:
|
||||
inputs:
|
||||
userPrompt: <start.input> # ✅ Correct
|
||||
# userPrompt: <customworkflowstart.input> # ❌ Wrong
|
||||
```
|
||||
|
||||
### Variables de bucle
|
||||
|
||||
Dentro de los bloques de bucle, hay variables especiales disponibles:
|
||||
|
||||
```yaml
|
||||
# Available in loop child blocks
|
||||
<loop.index> # Current iteration (0-based)
|
||||
<loop.currentItem> # Current item being processed (forEach loops)
|
||||
<loop.items> # Full collection (forEach loops)
|
||||
```
|
||||
|
||||
### Variables paralelas
|
||||
|
||||
Dentro de los bloques paralelos, hay variables especiales disponibles:
|
||||
|
||||
```yaml
|
||||
# Available in parallel child blocks
|
||||
<parallel.index> # Instance number (0-based)
|
||||
<parallel.currentItem> # Item for this instance
|
||||
<parallel.items> # Full collection
|
||||
```
|
||||
|
||||
## Ejemplos de referencias complejas
|
||||
|
||||
### Acceso a datos anidados
|
||||
|
||||
Cuando se hace referencia a objetos complejos, utiliza la notación de punto:
|
||||
|
||||
```yaml
|
||||
# If an agent returns structured data
|
||||
data-analyzer:
|
||||
type: agent
|
||||
name: "Data Analyzer"
|
||||
inputs:
|
||||
responseFormat: |
|
||||
{
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"analysis": {"type": "object"},
|
||||
"summary": {"type": "string"},
|
||||
"metrics": {"type": "object"}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Reference nested properties
|
||||
next-step:
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Summary: <dataanalyzer.analysis.summary>
|
||||
Score: <dataanalyzer.metrics.score>
|
||||
Full data: <dataanalyzer.content>
|
||||
```
|
||||
|
||||
### Múltiples referencias en texto
|
||||
|
||||
```yaml
|
||||
email-composer:
|
||||
type: agent
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Create an email with the following information:
|
||||
|
||||
Customer: <customeragent.content>
|
||||
Order Details: <orderprocessor.output>
|
||||
Support Ticket: <ticketanalyzer.content>
|
||||
|
||||
Original request: <start.input>
|
||||
```
|
||||
|
||||
### Referencias en bloques de código
|
||||
|
||||
Cuando se utilizan referencias en bloques de función, se reemplazan como valores de JavaScript:
|
||||
|
||||
```yaml
|
||||
data-processor:
|
||||
type: function
|
||||
inputs:
|
||||
code: |
|
||||
// References are replaced with actual values
|
||||
const customerData = <customeragent.content>;
|
||||
const orderInfo = <orderprocessor.output>;
|
||||
const originalInput = <start.input>;
|
||||
|
||||
// Process the data
|
||||
return {
|
||||
customer: customerData.name,
|
||||
orderId: orderInfo.id,
|
||||
processed: true
|
||||
};
|
||||
```
|
||||
|
||||
## Validación de referencias
|
||||
|
||||
Sim valida todas las referencias al importar YAML:
|
||||
|
||||
### Referencias válidas
|
||||
- El bloque existe en el flujo de trabajo
|
||||
- La propiedad es apropiada para el tipo de bloque
|
||||
- No hay dependencias circulares
|
||||
- Formato de sintaxis adecuado
|
||||
|
||||
### Errores comunes
|
||||
- **Bloque no encontrado**: El bloque referenciado no existe
|
||||
- **Propiedad incorrecta**: Usar `.content` en un bloque de función
|
||||
- **Errores tipográficos**: Nombres de bloques o propiedades mal escritos
|
||||
- **Referencias circulares**: El bloque se referencia a sí mismo directa o indirectamente
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
1. **Usar nombres descriptivos para los bloques**: Hace que las referencias sean más legibles
|
||||
2. **Ser consistente**: Utilizar la misma convención de nomenclatura en todo el documento
|
||||
3. **Verificar referencias**: Asegurarse de que todos los bloques referenciados existan
|
||||
4. **Evitar anidamiento profundo**: Mantener las cadenas de referencia manejables
|
||||
5. **Documentar flujos complejos**: Añadir comentarios para explicar las relaciones de referencia
|
||||
@@ -1,218 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML de bloques de agente
|
||||
description: Referencia de configuración YAML para bloques de agente
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [agent]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this agent block
|
||||
inputs:
|
||||
type: object
|
||||
properties:
|
||||
systemPrompt:
|
||||
type: string
|
||||
description: Instructions that define the agent's role and behavior
|
||||
userPrompt:
|
||||
type: string
|
||||
description: Input content to process (can reference other blocks)
|
||||
model:
|
||||
type: string
|
||||
description: AI model identifier (e.g., gpt-4o, gemini-2.5-pro, deepseek-chat)
|
||||
temperature:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 2
|
||||
description: Response creativity level (varies by model)
|
||||
apiKey:
|
||||
type: string
|
||||
description: API key for the model provider (use {{ENV_VAR}} format)
|
||||
azureEndpoint:
|
||||
type: string
|
||||
description: Azure OpenAI endpoint URL (required for Azure models)
|
||||
azureApiVersion:
|
||||
type: string
|
||||
description: Azure API version (required for Azure models)
|
||||
memories:
|
||||
type: string
|
||||
description: Memory context from memory blocks
|
||||
tools:
|
||||
type: array
|
||||
description: List of external tools the agent can use
|
||||
items:
|
||||
type: object
|
||||
required: [type, title, toolId, operation, usageControl]
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
description: Tool type identifier
|
||||
title:
|
||||
type: string
|
||||
description: Human-readable display name
|
||||
toolId:
|
||||
type: string
|
||||
description: Internal tool identifier
|
||||
operation:
|
||||
type: string
|
||||
description: Tool operation/method name
|
||||
usageControl:
|
||||
type: string
|
||||
enum: [auto, required, none]
|
||||
description: When AI can use the tool
|
||||
params:
|
||||
type: object
|
||||
description: Tool-specific configuration parameters
|
||||
isExpanded:
|
||||
type: boolean
|
||||
description: UI state
|
||||
default: false
|
||||
responseFormat:
|
||||
type: object
|
||||
description: JSON Schema to enforce structured output
|
||||
required:
|
||||
- model
|
||||
- apiKey
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful execution
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Configuración de herramientas
|
||||
|
||||
Las herramientas se definen como un array donde cada herramienta tiene esta estructura:
|
||||
|
||||
```yaml
|
||||
tools:
|
||||
- type: <string> # Tool type identifier (exa, gmail, slack, etc.)
|
||||
title: <string> # Human-readable display name
|
||||
toolId: <string> # Internal tool identifier
|
||||
operation: <string> # Tool operation/method name
|
||||
usageControl: <string> # When AI can use it (auto | required | none)
|
||||
params: <object> # Tool-specific configuration parameters
|
||||
isExpanded: <boolean> # UI state (optional, default: false)
|
||||
```
|
||||
|
||||
## Configuración de conexiones
|
||||
|
||||
Las conexiones definen hacia dónde va el flujo de trabajo según los resultados de la ejecución:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful execution
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### Agente básico
|
||||
|
||||
```yaml
|
||||
content-agent:
|
||||
type: agent
|
||||
name: "Content Analyzer 1"
|
||||
inputs:
|
||||
systemPrompt: "You are a helpful content analyzer. Be concise and clear."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
temperature: 0.3
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: summary-block
|
||||
|
||||
summary-block:
|
||||
type: agent
|
||||
name: "Summary Generator"
|
||||
inputs:
|
||||
systemPrompt: "Create a brief summary of the analysis."
|
||||
userPrompt: "Analyze this: <contentanalyzer1.content>"
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: final-step
|
||||
```
|
||||
|
||||
### Agente con herramientas
|
||||
|
||||
```yaml
|
||||
research-agent:
|
||||
type: agent
|
||||
name: "Research Assistant"
|
||||
inputs:
|
||||
systemPrompt: "Research the topic and provide detailed information."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
tools:
|
||||
- type: exa
|
||||
title: "Web Search"
|
||||
toolId: exa_search
|
||||
operation: exa_search
|
||||
usageControl: auto
|
||||
params:
|
||||
apiKey: '{{EXA_API_KEY}}'
|
||||
connections:
|
||||
success: summary-block
|
||||
```
|
||||
|
||||
### Salida estructurada
|
||||
|
||||
```yaml
|
||||
data-extractor:
|
||||
type: agent
|
||||
name: "Extract Contact Info"
|
||||
inputs:
|
||||
systemPrompt: "Extract contact information from the text."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
responseFormat: |
|
||||
{
|
||||
"name": "contact_extraction",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"email": {"type": "string"},
|
||||
"phone": {"type": "string"}
|
||||
},
|
||||
"required": ["name"]
|
||||
},
|
||||
"strict": true
|
||||
}
|
||||
connections:
|
||||
success: save-contact
|
||||
```
|
||||
|
||||
### Azure OpenAI
|
||||
|
||||
```yaml
|
||||
azure-agent:
|
||||
type: agent
|
||||
name: "Azure AI Assistant"
|
||||
inputs:
|
||||
systemPrompt: "You are a helpful assistant."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{AZURE_OPENAI_API_KEY}}'
|
||||
azureEndpoint: '{{AZURE_OPENAI_ENDPOINT}}'
|
||||
azureApiVersion: "2024-07-01-preview"
|
||||
connections:
|
||||
success: response-block
|
||||
```
|
||||
@@ -1,429 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML del bloque API
|
||||
description: Referencia de configuración YAML para bloques API
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [api]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this API block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- url
|
||||
- method
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
description: The endpoint URL to send the request to
|
||||
method:
|
||||
type: string
|
||||
enum: [GET, POST, PUT, DELETE, PATCH]
|
||||
description: HTTP method for the request
|
||||
default: GET
|
||||
params:
|
||||
type: array
|
||||
description: Query parameters as table entries
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- cells
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the parameter entry
|
||||
cells:
|
||||
type: object
|
||||
required:
|
||||
- Key
|
||||
- Value
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Parameter name
|
||||
Value:
|
||||
type: string
|
||||
description: Parameter value
|
||||
headers:
|
||||
type: array
|
||||
description: HTTP headers as table entries
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- cells
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the header entry
|
||||
cells:
|
||||
type: object
|
||||
required:
|
||||
- Key
|
||||
- Value
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Header name
|
||||
Value:
|
||||
type: string
|
||||
description: Header value
|
||||
body:
|
||||
type: string
|
||||
description: Request body for POST/PUT/PATCH methods
|
||||
timeout:
|
||||
type: number
|
||||
description: Request timeout in milliseconds
|
||||
default: 30000
|
||||
minimum: 1000
|
||||
maximum: 300000
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful requests
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Configuración de conexión
|
||||
|
||||
Las conexiones definen hacia dónde va el flujo de trabajo según los resultados de la solicitud:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful requests
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### Solicitud GET simple
|
||||
|
||||
```yaml
|
||||
user-api:
|
||||
type: api
|
||||
name: "Fetch User Data"
|
||||
inputs:
|
||||
url: "https://api.example.com/users/123"
|
||||
method: GET
|
||||
headers:
|
||||
- id: header-1-uuid-here
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{API_TOKEN}}"
|
||||
- id: header-2-uuid-here
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
connections:
|
||||
success: process-user-data
|
||||
error: handle-api-error
|
||||
```
|
||||
|
||||
### Solicitud POST con cuerpo
|
||||
|
||||
```yaml
|
||||
create-ticket:
|
||||
type: api
|
||||
name: "Create Support Ticket"
|
||||
inputs:
|
||||
url: "https://api.support.com/tickets"
|
||||
method: POST
|
||||
headers:
|
||||
- id: auth-header-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{SUPPORT_API_KEY}}"
|
||||
- id: content-type-uuid
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
body: |
|
||||
{
|
||||
"title": "<agent.title>",
|
||||
"description": "<agent.description>",
|
||||
"priority": "high"
|
||||
}
|
||||
connections:
|
||||
success: ticket-created
|
||||
error: ticket-error
|
||||
```
|
||||
|
||||
### URL dinámica con parámetros de consulta
|
||||
|
||||
```yaml
|
||||
search-api:
|
||||
type: api
|
||||
name: "Search Products"
|
||||
inputs:
|
||||
url: "https://api.store.com/products"
|
||||
method: GET
|
||||
params:
|
||||
- id: search-param-uuid
|
||||
cells:
|
||||
Key: "q"
|
||||
Value: <start.searchTerm>
|
||||
- id: limit-param-uuid
|
||||
cells:
|
||||
Key: "limit"
|
||||
Value: "10"
|
||||
- id: category-param-uuid
|
||||
cells:
|
||||
Key: "category"
|
||||
Value: <filter.category>
|
||||
headers:
|
||||
- id: auth-header-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{STORE_API_KEY}}"
|
||||
connections:
|
||||
success: display-results
|
||||
```
|
||||
|
||||
## Formato de parámetros
|
||||
|
||||
Los encabezados y parámetros (parámetros de consulta) utilizan el formato de tabla con la siguiente estructura:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: unique-identifier-here
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
- id: another-unique-identifier
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{API_TOKEN}}"
|
||||
|
||||
params:
|
||||
- id: param-identifier-here
|
||||
cells:
|
||||
Key: "limit"
|
||||
Value: "10"
|
||||
```
|
||||
|
||||
**Detalles de la estructura:**
|
||||
- `id`: Identificador único para rastrear la fila de la tabla
|
||||
- `cells.Key`: El nombre del parámetro/encabezado
|
||||
- `cells.Value`: El valor del parámetro/encabezado
|
||||
- Este formato permite una gestión adecuada de la tabla y la preservación del estado de la interfaz de usuario
|
||||
|
||||
## Referencias de salida
|
||||
|
||||
Después de que un bloque API se ejecuta, puedes hacer referencia a sus salidas en bloques posteriores. El bloque API proporciona tres salidas principales:
|
||||
|
||||
### Salidas disponibles
|
||||
|
||||
| Salida | Tipo | Descripción |
|
||||
|--------|------|-------------|
|
||||
| `data` | cualquiera | El cuerpo/carga de respuesta de la API |
|
||||
| `status` | número | Código de estado HTTP (200, 404, 500, etc.) |
|
||||
| `headers` | objeto | Encabezados de respuesta devueltos por el servidor |
|
||||
|
||||
### Ejemplos de uso
|
||||
|
||||
```yaml
|
||||
# Reference API response data
|
||||
process-data:
|
||||
type: function
|
||||
name: "Process API Data"
|
||||
inputs:
|
||||
code: |
|
||||
const responseData = <fetchuserdata.data>;
|
||||
const statusCode = <fetchuserdata.status>;
|
||||
const responseHeaders = <fetchuserdata.headers>;
|
||||
|
||||
if (statusCode === 200) {
|
||||
return {
|
||||
success: true,
|
||||
user: responseData,
|
||||
contentType: responseHeaders['content-type']
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
success: false,
|
||||
error: `API call failed with status ${statusCode}`
|
||||
};
|
||||
}
|
||||
|
||||
# Use API data in an agent block
|
||||
analyze-response:
|
||||
type: agent
|
||||
name: "Analyze Response"
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Analyze this API response:
|
||||
|
||||
Status: <fetchuserdata.status>
|
||||
Data: <fetchuserdata.data>
|
||||
|
||||
Provide insights about the response.
|
||||
|
||||
# Conditional logic based on status
|
||||
check-status:
|
||||
type: condition
|
||||
name: "Check API Status"
|
||||
inputs:
|
||||
condition: <fetchuserdata.status> === 200
|
||||
connections:
|
||||
true: success-handler
|
||||
false: error-handler
|
||||
```
|
||||
|
||||
### Ejemplo práctico
|
||||
|
||||
```yaml
|
||||
user-api:
|
||||
type: api
|
||||
name: "Fetch User Data"
|
||||
inputs:
|
||||
url: "https://api.example.com/users/123"
|
||||
method: GET
|
||||
connections:
|
||||
success: process-response
|
||||
|
||||
process-response:
|
||||
type: function
|
||||
name: "Process Response"
|
||||
inputs:
|
||||
code: |
|
||||
const user = <fetchuserdata.data>;
|
||||
const status = <fetchuserdata.status>;
|
||||
|
||||
console.log(`API returned status: ${status}`);
|
||||
console.log(`User data:`, user);
|
||||
|
||||
return {
|
||||
userId: user.id,
|
||||
email: user.email,
|
||||
isActive: status === 200
|
||||
};
|
||||
```
|
||||
|
||||
### Manejo de errores
|
||||
|
||||
```yaml
|
||||
api-with-error-handling:
|
||||
type: api
|
||||
name: "API Call"
|
||||
inputs:
|
||||
url: "https://api.example.com/data"
|
||||
method: GET
|
||||
connections:
|
||||
success: check-response
|
||||
error: handle-error
|
||||
|
||||
check-response:
|
||||
type: condition
|
||||
name: "Check Response Status"
|
||||
inputs:
|
||||
condition: <apicall.status> >= 200 && <apicall.status> < 300
|
||||
connections:
|
||||
true: process-success
|
||||
false: handle-api-error
|
||||
|
||||
process-success:
|
||||
type: function
|
||||
name: "Process Success"
|
||||
inputs:
|
||||
code: |
|
||||
return {
|
||||
success: true,
|
||||
data: <apicall.data>,
|
||||
message: "API call successful"
|
||||
};
|
||||
|
||||
handle-api-error:
|
||||
type: function
|
||||
name: "Handle API Error"
|
||||
inputs:
|
||||
code: |
|
||||
return {
|
||||
success: false,
|
||||
status: <apicall.status>,
|
||||
error: "API call failed",
|
||||
data: <apicall.data>
|
||||
};
|
||||
```
|
||||
|
||||
## Escape de cadenas en YAML
|
||||
|
||||
Al escribir YAML, ciertas cadenas deben estar entre comillas para ser analizadas correctamente:
|
||||
|
||||
### Cadenas que deben estar entre comillas
|
||||
|
||||
```yaml
|
||||
# URLs with hyphens, colons, special characters
|
||||
url: "https://api.example.com/users/123"
|
||||
url: "https://my-api.example.com/data"
|
||||
|
||||
# Header values with hyphens or special characters
|
||||
headers:
|
||||
- id: header-uuid
|
||||
cells:
|
||||
Key: "User-Agent"
|
||||
Value: "My-Application/1.0"
|
||||
- id: auth-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer my-token-123"
|
||||
|
||||
# Parameter values with hyphens
|
||||
params:
|
||||
- id: param-uuid
|
||||
cells:
|
||||
Key: "sort-by"
|
||||
Value: "created-at"
|
||||
```
|
||||
|
||||
### Cuándo usar comillas
|
||||
|
||||
- ✅ **Siempre usar comillas para**: URLs, tokens, valores con guiones, dos puntos o caracteres especiales
|
||||
- ✅ **Siempre usar comillas para**: Valores que comienzan con números pero deben ser cadenas
|
||||
- ✅ **Siempre usar comillas para**: Cadenas que parecen booleanos pero deben permanecer como cadenas
|
||||
- ❌ **No usar comillas para**: Cadenas alfanuméricas simples sin caracteres especiales
|
||||
|
||||
### Ejemplos
|
||||
|
||||
```yaml
|
||||
# ✅ Correct
|
||||
url: "https://api.stripe.com/v1/charges"
|
||||
headers:
|
||||
- id: auth-header
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer sk-test-123456789"
|
||||
|
||||
# ❌ Incorrect (may cause parsing errors)
|
||||
url: https://api.stripe.com/v1/charges
|
||||
headers:
|
||||
- id: auth-header
|
||||
cells:
|
||||
Key: Authorization
|
||||
Value: Bearer sk-test-123456789
|
||||
```
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
- Usar variables de entorno para claves API: `{{API_KEY_NAME}}`
|
||||
- Incluir manejo de errores con conexiones de error
|
||||
- Establecer tiempos de espera apropiados para tu caso de uso
|
||||
- Validar códigos de estado de respuesta en bloques subsiguientes
|
||||
- Usar nombres de bloque significativos para facilitar la referencia
|
||||
- **Siempre poner entre comillas las cadenas con caracteres especiales, URLs y tokens**
|
||||
@@ -1,165 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML del bloque de condición
|
||||
description: Referencia de configuración YAML para bloques de condición
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
- connections
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [condition]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this condition block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- conditions
|
||||
properties:
|
||||
conditions:
|
||||
type: object
|
||||
description: Conditional expressions and their logic
|
||||
properties:
|
||||
if:
|
||||
type: string
|
||||
description: Primary condition expression (boolean)
|
||||
else-if:
|
||||
type: string
|
||||
description: Secondary condition expression (optional)
|
||||
else-if-2:
|
||||
type: string
|
||||
description: Third condition expression (optional)
|
||||
else-if-3:
|
||||
type: string
|
||||
description: Fourth condition expression (optional)
|
||||
# Additional else-if-N conditions can be added as needed
|
||||
else:
|
||||
type: boolean
|
||||
description: Default fallback condition (optional)
|
||||
default: true
|
||||
connections:
|
||||
type: object
|
||||
required:
|
||||
- conditions
|
||||
properties:
|
||||
conditions:
|
||||
type: object
|
||||
description: Target blocks for each condition outcome
|
||||
properties:
|
||||
if:
|
||||
type: string
|
||||
description: Target block ID when 'if' condition is true
|
||||
else-if:
|
||||
type: string
|
||||
description: Target block ID when 'else-if' condition is true
|
||||
else-if-2:
|
||||
type: string
|
||||
description: Target block ID when 'else-if-2' condition is true
|
||||
else-if-3:
|
||||
type: string
|
||||
description: Target block ID when 'else-if-3' condition is true
|
||||
# Additional else-if-N connections can be added as needed
|
||||
else:
|
||||
type: string
|
||||
description: Target block ID when no conditions match
|
||||
```
|
||||
|
||||
## Configuración de conexión
|
||||
|
||||
A diferencia de otros bloques, las condiciones utilizan conexiones ramificadas basadas en los resultados de la condición:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
conditions:
|
||||
if: <string> # Target block ID when primary condition is true
|
||||
else-if: <string> # Target block ID when secondary condition is true (optional)
|
||||
else-if-2: <string> # Target block ID when third condition is true (optional)
|
||||
else-if-3: <string> # Target block ID when fourth condition is true (optional)
|
||||
# Additional else-if-N connections can be added as needed
|
||||
else: <string> # Target block ID when no conditions match (optional)
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### If-Else simple
|
||||
|
||||
```yaml
|
||||
status-check:
|
||||
type: condition
|
||||
name: "Status Check"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <start.status> === "approved"
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: send-approval-email
|
||||
else: send-rejection-email
|
||||
```
|
||||
|
||||
### Múltiples condiciones
|
||||
|
||||
```yaml
|
||||
user-routing:
|
||||
type: condition
|
||||
name: "User Type Router"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <start.user_type> === "admin"
|
||||
else-if: <start.user_type> === "premium"
|
||||
else-if-2: <start.user_type> === "basic"
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: admin-dashboard
|
||||
else-if: premium-features
|
||||
else-if-2: basic-features
|
||||
else: registration-flow
|
||||
```
|
||||
|
||||
### Comparaciones numéricas
|
||||
|
||||
```yaml
|
||||
score-evaluation:
|
||||
type: condition
|
||||
name: "Score Evaluation"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <agent.score> >= 90
|
||||
else-if: <agent.score> >= 70
|
||||
else-if-2: <agent.score> >= 50
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: excellent-response
|
||||
else-if: good-response
|
||||
else-if-2: average-response
|
||||
else: poor-response
|
||||
```
|
||||
|
||||
### Lógica compleja
|
||||
|
||||
```yaml
|
||||
eligibility-check:
|
||||
type: condition
|
||||
name: "Eligibility Check"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <start.age> >= 18 && <start.verified> === true
|
||||
else-if: <start.age> >= 16 && <start.parent_consent> === true
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: full-access
|
||||
else-if: limited-access
|
||||
else: access-denied
|
||||
```
|
||||
@@ -1,255 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML del bloque evaluador
|
||||
description: Referencia de configuración YAML para bloques evaluadores
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [evaluator]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this evaluator block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- content
|
||||
- metrics
|
||||
- model
|
||||
- apiKey
|
||||
properties:
|
||||
content:
|
||||
type: string
|
||||
description: Content to evaluate (can reference other blocks)
|
||||
metrics:
|
||||
type: array
|
||||
description: Evaluation criteria and scoring ranges
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: Metric identifier
|
||||
description:
|
||||
type: string
|
||||
description: Detailed explanation of what the metric measures
|
||||
range:
|
||||
type: object
|
||||
properties:
|
||||
min:
|
||||
type: number
|
||||
description: Minimum score value
|
||||
max:
|
||||
type: number
|
||||
description: Maximum score value
|
||||
required: [min, max]
|
||||
description: Scoring range with numeric bounds
|
||||
model:
|
||||
type: string
|
||||
description: AI model identifier (e.g., gpt-4o, claude-3-5-sonnet-20241022)
|
||||
apiKey:
|
||||
type: string
|
||||
description: API key for the model provider (use {{ENV_VAR}} format)
|
||||
temperature:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 2
|
||||
description: Model temperature for evaluation
|
||||
default: 0.3
|
||||
azureEndpoint:
|
||||
type: string
|
||||
description: Azure OpenAI endpoint URL (required for Azure models)
|
||||
azureApiVersion:
|
||||
type: string
|
||||
description: Azure API version (required for Azure models)
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful evaluation
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Configuración de conexiones
|
||||
|
||||
Las conexiones definen hacia dónde va el flujo de trabajo según los resultados de la evaluación:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful evaluation
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### Evaluación de calidad de contenido
|
||||
|
||||
```yaml
|
||||
content-evaluator:
|
||||
type: evaluator
|
||||
name: "Content Quality Evaluator"
|
||||
inputs:
|
||||
content: <content-generator.content>
|
||||
metrics:
|
||||
- name: "accuracy"
|
||||
description: "How factually accurate is the content?"
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
- name: "clarity"
|
||||
description: "How clear and understandable is the content?"
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
- name: "relevance"
|
||||
description: "How relevant is the content to the original query?"
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
- name: "completeness"
|
||||
description: "How complete and comprehensive is the content?"
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
model: gpt-4o
|
||||
temperature: 0.2
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: quality-report
|
||||
error: evaluation-error
|
||||
```
|
||||
|
||||
### Evaluación de respuesta al cliente
|
||||
|
||||
```yaml
|
||||
response-evaluator:
|
||||
type: evaluator
|
||||
name: "Customer Response Evaluator"
|
||||
inputs:
|
||||
content: <customer-agent.content>
|
||||
metrics:
|
||||
- name: "helpfulness"
|
||||
description: "How helpful is the response in addressing the customer's needs?"
|
||||
range:
|
||||
min: 1
|
||||
max: 10
|
||||
- name: "tone"
|
||||
description: "How appropriate and professional is the tone?"
|
||||
range:
|
||||
min: 1
|
||||
max: 10
|
||||
- name: "completeness"
|
||||
description: "Does the response fully address all aspects of the inquiry?"
|
||||
range:
|
||||
min: 1
|
||||
max: 10
|
||||
model: claude-3-5-sonnet-20241022
|
||||
apiKey: '{{ANTHROPIC_API_KEY}}'
|
||||
connections:
|
||||
success: response-processor
|
||||
```
|
||||
|
||||
### Evaluación de pruebas A/B
|
||||
|
||||
```yaml
|
||||
ab-test-evaluator:
|
||||
type: evaluator
|
||||
name: "A/B Test Evaluator"
|
||||
inputs:
|
||||
content: |
|
||||
Version A: <version-a.content>
|
||||
Version B: <version-b.content>
|
||||
|
||||
Compare these two versions for the following criteria.
|
||||
metrics:
|
||||
- name: "engagement"
|
||||
description: "Which version is more likely to engage users?"
|
||||
range: "A, B, or Tie"
|
||||
- name: "clarity"
|
||||
description: "Which version communicates more clearly?"
|
||||
range: "A, B, or Tie"
|
||||
- name: "persuasiveness"
|
||||
description: "Which version is more persuasive?"
|
||||
range: "A, B, or Tie"
|
||||
model: gpt-4o
|
||||
temperature: 0.1
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: test-results
|
||||
```
|
||||
|
||||
### Puntuación multidimensional de contenido
|
||||
|
||||
```yaml
|
||||
comprehensive-evaluator:
|
||||
type: evaluator
|
||||
name: "Comprehensive Content Evaluator"
|
||||
inputs:
|
||||
content: <ai-writer.content>
|
||||
metrics:
|
||||
- name: "technical_accuracy"
|
||||
description: "How technically accurate and correct is the information?"
|
||||
range:
|
||||
min: 0
|
||||
max: 100
|
||||
- name: "readability"
|
||||
description: "How easy is the content to read and understand?"
|
||||
range:
|
||||
min: 0
|
||||
max: 100
|
||||
- name: "seo_optimization"
|
||||
description: "How well optimized is the content for search engines?"
|
||||
range:
|
||||
min: 0
|
||||
max: 100
|
||||
- name: "user_engagement"
|
||||
description: "How likely is this content to engage and retain readers?"
|
||||
range:
|
||||
min: 0
|
||||
max: 100
|
||||
- name: "brand_alignment"
|
||||
description: "How well does the content align with brand voice and values?"
|
||||
range:
|
||||
min: 0
|
||||
max: 100
|
||||
model: gpt-4o
|
||||
temperature: 0.3
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: content-optimization
|
||||
```
|
||||
|
||||
## Referencias de salida
|
||||
|
||||
Después de que un bloque evaluador se ejecuta, puedes hacer referencia a sus salidas:
|
||||
|
||||
```yaml
|
||||
# In subsequent blocks
|
||||
next-block:
|
||||
inputs:
|
||||
evaluation: <evaluator-name.content> # Evaluation summary
|
||||
scores: <evaluator-name.scores> # Individual metric scores
|
||||
overall: <evaluator-name.overall> # Overall assessment
|
||||
```
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
- Define criterios de evaluación claros y específicos
|
||||
- Utiliza rangos de puntuación apropiados para tu caso de uso
|
||||
- Elige modelos con fuertes capacidades de razonamiento
|
||||
- Usa temperatura más baja para puntuaciones consistentes
|
||||
- Incluye descripciones detalladas de métricas
|
||||
- Prueba con diversos tipos de contenido
|
||||
- Considera múltiples evaluadores para evaluaciones complejas
|
||||
@@ -1,162 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML de bloque de función
|
||||
description: Referencia de configuración YAML para bloques de función
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [function]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this function block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- code
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
description: JavaScript/TypeScript code to execute (multiline string)
|
||||
timeout:
|
||||
type: number
|
||||
description: Maximum execution time in milliseconds
|
||||
default: 30000
|
||||
minimum: 1000
|
||||
maximum: 300000
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful execution
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Configuración de conexión
|
||||
|
||||
Las conexiones definen hacia dónde va el flujo de trabajo según los resultados de la ejecución:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful execution
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### Validación simple
|
||||
|
||||
```yaml
|
||||
input-validator:
|
||||
type: function
|
||||
name: "Input Validator"
|
||||
inputs:
|
||||
code: |-
|
||||
// Check if input number is greater than 5
|
||||
const inputValue = parseInt(<start.input>, 10);
|
||||
|
||||
if (inputValue > 5) {
|
||||
return {
|
||||
valid: true,
|
||||
value: inputValue,
|
||||
message: "Input is valid"
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
valid: false,
|
||||
value: inputValue,
|
||||
message: "Input must be greater than 5"
|
||||
};
|
||||
}
|
||||
connections:
|
||||
success: next-step
|
||||
error: handle-error
|
||||
```
|
||||
|
||||
### Procesamiento de datos
|
||||
|
||||
```yaml
|
||||
data-processor:
|
||||
type: function
|
||||
name: "Data Transformer"
|
||||
inputs:
|
||||
code: |
|
||||
// Transform the input data
|
||||
const rawData = <start.input>;
|
||||
|
||||
// Process and clean the data
|
||||
const processed = rawData
|
||||
.filter(item => item.status === 'active')
|
||||
.map(item => ({
|
||||
id: item.id,
|
||||
name: item.name.trim(),
|
||||
date: new Date(item.created).toISOString()
|
||||
}));
|
||||
|
||||
return processed;
|
||||
connections:
|
||||
success: api-save
|
||||
error: error-handler
|
||||
```
|
||||
|
||||
### Integración de API
|
||||
|
||||
```yaml
|
||||
api-formatter:
|
||||
type: function
|
||||
name: "Format API Request"
|
||||
inputs:
|
||||
code: |
|
||||
// Prepare data for API submission
|
||||
const userData = <agent.response>;
|
||||
|
||||
const apiPayload = {
|
||||
timestamp: new Date().toISOString(),
|
||||
data: userData,
|
||||
source: "workflow-automation",
|
||||
version: "1.0"
|
||||
};
|
||||
|
||||
return apiPayload;
|
||||
connections:
|
||||
success: api-call
|
||||
```
|
||||
|
||||
### Cálculos
|
||||
|
||||
```yaml
|
||||
calculator:
|
||||
type: function
|
||||
name: "Calculate Results"
|
||||
inputs:
|
||||
code: |
|
||||
// Perform calculations on input data
|
||||
const numbers = <start.input>;
|
||||
|
||||
const sum = numbers.reduce((a, b) => a + b, 0);
|
||||
const average = sum / numbers.length;
|
||||
const max = Math.max(...numbers);
|
||||
const min = Math.min(...numbers);
|
||||
|
||||
return {
|
||||
sum,
|
||||
average,
|
||||
max,
|
||||
min,
|
||||
count: numbers.length
|
||||
};
|
||||
connections:
|
||||
success: results-display
|
||||
```
|
||||
@@ -1,151 +0,0 @@
|
||||
---
|
||||
title: Esquemas de bloques
|
||||
description: Referencia completa del esquema YAML para todos los bloques de Sim
|
||||
---
|
||||
|
||||
import { Card, Cards } from "fumadocs-ui/components/card";
|
||||
|
||||
Esta sección contiene las definiciones completas del esquema YAML para todos los tipos de bloques disponibles en Sim. Cada tipo de bloque tiene requisitos de configuración específicos y formatos de salida.
|
||||
|
||||
## Bloques principales
|
||||
|
||||
Estos son los bloques esenciales para crear flujos de trabajo:
|
||||
|
||||
<Cards>
|
||||
<Card title="Bloque de inicio" href="/yaml/blocks/starter">
|
||||
Punto de entrada del flujo de trabajo que admite activadores manuales, webhooks y programaciones
|
||||
</Card>
|
||||
<Card title="Bloque de agente" href="/yaml/blocks/agent">
|
||||
Procesamiento impulsado por IA con integración de LLM y soporte de herramientas
|
||||
</Card>
|
||||
<Card title="Bloque de función" href="/yaml/blocks/function">
|
||||
Entorno de ejecución de código JavaScript/TypeScript personalizado
|
||||
</Card>
|
||||
<Card title="Bloque de respuesta" href="/yaml/blocks/response">
|
||||
Formatear y devolver los resultados finales del flujo de trabajo
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Lógica y flujo de control
|
||||
|
||||
Bloques para implementar lógica condicional y flujo de control:
|
||||
|
||||
<Cards>
|
||||
<Card title="Bloque de condición" href="/yaml/blocks/condition">
|
||||
Ramificación condicional basada en expresiones booleanas
|
||||
</Card>
|
||||
<Card title="Bloque de enrutador" href="/yaml/blocks/router">
|
||||
Enrutamiento inteligente impulsado por IA a múltiples rutas
|
||||
</Card>
|
||||
<Card title="Bloque de bucle" href="/yaml/blocks/loop">
|
||||
Procesamiento iterativo con bucles for y forEach
|
||||
</Card>
|
||||
<Card title="Bloque paralelo" href="/yaml/blocks/parallel">
|
||||
Ejecución concurrente en múltiples instancias
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Bloques de integración
|
||||
|
||||
Bloques para conectar con servicios y sistemas externos:
|
||||
|
||||
<Cards>
|
||||
<Card title="Bloque de API" href="/yaml/blocks/api">
|
||||
Solicitudes HTTP a APIs REST externas
|
||||
</Card>
|
||||
<Card title="Bloque de webhook" href="/yaml/blocks/webhook">
|
||||
Activadores de webhook para integraciones externas
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Bloques avanzados
|
||||
|
||||
Bloques especializados para patrones de flujo de trabajo complejos:
|
||||
|
||||
<Cards>
|
||||
<Card title="Bloque evaluador" href="/yaml/blocks/evaluator">
|
||||
Validar salidas según criterios y métricas definidos
|
||||
</Card>
|
||||
<Card title="Bloque de flujo de trabajo" href="/yaml/blocks/workflow">
|
||||
Ejecutar otros flujos de trabajo como componentes reutilizables
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Elementos comunes del esquema
|
||||
|
||||
Todos los bloques comparten estos elementos comunes:
|
||||
|
||||
### Estructura básica
|
||||
|
||||
```yaml
|
||||
block-id:
|
||||
type: <block-type>
|
||||
name: <display-name>
|
||||
inputs:
|
||||
# Block-specific configuration
|
||||
connections:
|
||||
# Connection definitions
|
||||
```
|
||||
|
||||
### Tipos de conexión
|
||||
|
||||
- **success**: Bloque objetivo para ejecución exitosa
|
||||
- **error**: Bloque objetivo para manejo de errores (opcional)
|
||||
- **conditions**: Múltiples rutas para bloques condicionales
|
||||
|
||||
### Variables de entorno
|
||||
|
||||
Usa dobles llaves para las variables de entorno:
|
||||
|
||||
```yaml
|
||||
inputs:
|
||||
apiKey: '{{API_KEY_NAME}}'
|
||||
endpoint: '{{SERVICE_ENDPOINT}}'
|
||||
```
|
||||
|
||||
### Referencias de bloque
|
||||
|
||||
Referencia las salidas de otros bloques usando el nombre del bloque en minúsculas:
|
||||
|
||||
```yaml
|
||||
inputs:
|
||||
userPrompt: <blockname.content>
|
||||
data: <functionblock.output>
|
||||
originalInput: <start.input>
|
||||
```
|
||||
|
||||
## Reglas de validación
|
||||
|
||||
Todos los bloques YAML se validan contra sus esquemas:
|
||||
|
||||
1. **Campos obligatorios**: Deben estar presentes
|
||||
2. **Validación de tipo**: Los valores deben coincidir con los tipos esperados
|
||||
3. **Validación de enumeración**: Los valores de cadena deben ser de las listas permitidas
|
||||
4. **Validación de rango**: Los números deben estar dentro de los rangos especificados
|
||||
5. **Validación de patrón**: Las cadenas deben coincidir con patrones regex (cuando corresponda)
|
||||
|
||||
## Referencia rápida
|
||||
|
||||
### Tipos de bloques y propiedades
|
||||
|
||||
| Tipo de bloque | Salida principal | Casos de uso comunes |
|
||||
|------------|----------------|------------------|
|
||||
| starter | `.input` | Punto de entrada del flujo de trabajo |
|
||||
| agent | `.content` | Procesamiento de IA, generación de texto |
|
||||
| function | `.output` | Transformación de datos, cálculos |
|
||||
| api | `.output` | Integración con servicios externos |
|
||||
| condition | N/A (ramificación) | Lógica condicional |
|
||||
| router | N/A (ramificación) | Enrutamiento inteligente |
|
||||
| response | N/A (terminal) | Formateo de salida final |
|
||||
| loop | `.results` | Procesamiento iterativo |
|
||||
| parallel | `.results` | Procesamiento concurrente |
|
||||
| webhook | `.payload` | Disparadores externos |
|
||||
| evaluator | `.score` | Validación de salida, evaluación de calidad |
|
||||
| workflow | `.output` | Ejecución de subflujos de trabajo, modularidad |
|
||||
|
||||
### Obligatorio vs opcional
|
||||
|
||||
- **Siempre obligatorio**: `type`, `name`
|
||||
- **Generalmente obligatorio**: `inputs`, `connections`
|
||||
- **Dependiente del contexto**: Los campos de entrada específicos varían según el tipo de bloque
|
||||
- **Siempre opcional**: Conexiones `error`, campos específicos de la interfaz de usuario
|
||||
@@ -1,312 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML de bloque paralelo
|
||||
description: Referencia de configuración YAML para bloques paralelos
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
- connections
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [parallel]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this parallel block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- parallelType
|
||||
properties:
|
||||
parallelType:
|
||||
type: string
|
||||
enum: [count, collection]
|
||||
description: Type of parallel execution
|
||||
count:
|
||||
type: number
|
||||
description: Number of parallel instances (for 'count' type)
|
||||
minimum: 1
|
||||
maximum: 100
|
||||
collection:
|
||||
type: string
|
||||
description: Collection to distribute across instances (for 'collection' type)
|
||||
maxConcurrency:
|
||||
type: number
|
||||
description: Maximum concurrent executions
|
||||
default: 10
|
||||
minimum: 1
|
||||
maximum: 50
|
||||
connections:
|
||||
type: object
|
||||
required:
|
||||
- parallel
|
||||
properties:
|
||||
parallel:
|
||||
type: object
|
||||
required:
|
||||
- start
|
||||
properties:
|
||||
start:
|
||||
type: string
|
||||
description: Target block ID to execute inside each parallel instance
|
||||
end:
|
||||
type: string
|
||||
description: Target block ID after all parallel instances complete (optional)
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Configuración de conexión
|
||||
|
||||
Los bloques paralelos utilizan un formato de conexión especial con una sección `parallel`:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
parallel:
|
||||
start: <string> # Target block ID to execute inside each parallel instance
|
||||
end: <string> # Target block ID after all instances complete (optional)
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Configuración de bloques secundarios
|
||||
|
||||
Los bloques dentro de un bloque paralelo deben tener su `parentId` configurado con el ID del bloque paralelo:
|
||||
|
||||
```yaml
|
||||
parallel-1:
|
||||
type: parallel
|
||||
name: "Process Items"
|
||||
inputs:
|
||||
parallelType: collection
|
||||
collection: <start.items>
|
||||
connections:
|
||||
parallel:
|
||||
start: process-item
|
||||
end: aggregate-results
|
||||
|
||||
# Child block inside the parallel
|
||||
process-item:
|
||||
type: agent
|
||||
name: "Process Item"
|
||||
parentId: parallel-1 # References the parallel block
|
||||
inputs:
|
||||
systemPrompt: "Process this item"
|
||||
userPrompt: <parallel.currentItem>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### Procesamiento paralelo basado en conteo
|
||||
|
||||
```yaml
|
||||
worker-parallel:
|
||||
type: parallel
|
||||
name: "Worker Parallel"
|
||||
inputs:
|
||||
parallelType: count
|
||||
count: 5
|
||||
maxConcurrency: 3
|
||||
connections:
|
||||
parallel:
|
||||
start: worker-task
|
||||
end: collect-worker-results
|
||||
|
||||
worker-task:
|
||||
type: api
|
||||
name: "Worker Task"
|
||||
parentId: worker-parallel
|
||||
inputs:
|
||||
url: "https://api.worker.com/process"
|
||||
method: POST
|
||||
headers:
|
||||
- key: "Authorization"
|
||||
value: "Bearer {{WORKER_API_KEY}}"
|
||||
body: |
|
||||
{
|
||||
"instanceId": <parallel.index>,
|
||||
"timestamp": "{{new Date().toISOString()}}"
|
||||
}
|
||||
connections:
|
||||
success: worker-complete
|
||||
```
|
||||
|
||||
### Procesamiento paralelo basado en colecciones
|
||||
|
||||
```yaml
|
||||
api-parallel:
|
||||
type: parallel
|
||||
name: "API Parallel"
|
||||
inputs:
|
||||
parallelType: collection
|
||||
collection: <start.apiEndpoints>
|
||||
maxConcurrency: 10
|
||||
connections:
|
||||
parallel:
|
||||
start: call-api
|
||||
end: merge-api-results
|
||||
|
||||
call-api:
|
||||
type: api
|
||||
name: "Call API"
|
||||
parentId: api-parallel
|
||||
inputs:
|
||||
url: <parallel.currentItem.endpoint>
|
||||
method: <parallel.currentItem.method>
|
||||
headers:
|
||||
- key: "Authorization"
|
||||
value: "Bearer {{API_TOKEN}}"
|
||||
connections:
|
||||
success: api-complete
|
||||
```
|
||||
|
||||
### Pipeline de procesamiento paralelo complejo
|
||||
|
||||
```yaml
|
||||
data-processing-parallel:
|
||||
type: parallel
|
||||
name: "Data Processing Parallel"
|
||||
inputs:
|
||||
parallelType: collection
|
||||
collection: <data-loader.records>
|
||||
maxConcurrency: 8
|
||||
connections:
|
||||
parallel:
|
||||
start: validate-data
|
||||
end: final-aggregation
|
||||
error: parallel-error-handler
|
||||
|
||||
validate-data:
|
||||
type: function
|
||||
name: "Validate Data"
|
||||
parentId: data-processing-parallel
|
||||
inputs:
|
||||
code: |
|
||||
const record = <parallel.currentItem>;
|
||||
const index = <parallel.index>;
|
||||
|
||||
// Validate record structure
|
||||
if (!record.id || !record.content) {
|
||||
throw new Error(`Invalid record at index ${index}`);
|
||||
}
|
||||
|
||||
return {
|
||||
valid: true,
|
||||
recordId: record.id,
|
||||
validatedAt: new Date().toISOString()
|
||||
};
|
||||
connections:
|
||||
success: process-data
|
||||
error: validation-error
|
||||
|
||||
process-data:
|
||||
type: agent
|
||||
name: "Process Data"
|
||||
parentId: data-processing-parallel
|
||||
inputs:
|
||||
systemPrompt: "Process and analyze this data record"
|
||||
userPrompt: |
|
||||
Record ID: <validatedata.recordId>
|
||||
Content: <parallel.currentItem.content>
|
||||
Instance: <parallel.index>
|
||||
model: gpt-4o
|
||||
temperature: 0.3
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: store-result
|
||||
|
||||
store-result:
|
||||
type: function
|
||||
name: "Store Result"
|
||||
parentId: data-processing-parallel
|
||||
inputs:
|
||||
code: |
|
||||
const processed = <processdata.content>;
|
||||
const recordId = <validatedata.recordId>;
|
||||
|
||||
return {
|
||||
recordId,
|
||||
processed,
|
||||
completedAt: new Date().toISOString(),
|
||||
instanceIndex: <parallel.index>
|
||||
};
|
||||
```
|
||||
|
||||
### Análisis de IA concurrente
|
||||
|
||||
```yaml
|
||||
multi-model-parallel:
|
||||
type: parallel
|
||||
name: "Multi-Model Analysis"
|
||||
inputs:
|
||||
parallelType: collection
|
||||
collection: |
|
||||
[
|
||||
{"model": "gpt-4o", "focus": "technical accuracy"},
|
||||
{"model": "claude-3-5-sonnet-20241022", "focus": "creative quality"},
|
||||
{"model": "gemini-2.0-flash-exp", "focus": "factual verification"}
|
||||
]
|
||||
maxConcurrency: 3
|
||||
connections:
|
||||
parallel:
|
||||
start: analyze-content
|
||||
end: combine-analyses
|
||||
|
||||
analyze-content:
|
||||
type: agent
|
||||
name: "Analyze Content"
|
||||
parentId: multi-model-parallel
|
||||
inputs:
|
||||
systemPrompt: |
|
||||
You are analyzing content with a focus on <parallel.currentItem.focus>.
|
||||
Provide detailed analysis from this perspective.
|
||||
userPrompt: |
|
||||
Content to analyze: <start.content>
|
||||
Analysis focus: <parallel.currentItem.focus>
|
||||
model: <parallel.currentItem.model>
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: analysis-complete
|
||||
```
|
||||
|
||||
## Variables paralelas
|
||||
|
||||
Dentro de los bloques secundarios paralelos, estas variables especiales están disponibles:
|
||||
|
||||
```yaml
|
||||
# Available in all child blocks of the parallel
|
||||
<parallel.index> # Instance number (0-based)
|
||||
<parallel.currentItem> # Item for this instance (collection type)
|
||||
<parallel.items> # Full collection (collection type)
|
||||
```
|
||||
|
||||
## Referencias de salida
|
||||
|
||||
Después de que un bloque paralelo se completa, puedes hacer referencia a sus resultados agregados:
|
||||
|
||||
```yaml
|
||||
# In blocks after the parallel
|
||||
final-processor:
|
||||
inputs:
|
||||
all-results: <parallel-name.results> # Array of all instance results
|
||||
total-count: <parallel-name.count> # Number of instances completed
|
||||
```
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
- Utiliza un maxConcurrency apropiado para evitar sobrecargar las APIs
|
||||
- Asegúrate de que las operaciones sean independientes y no dependan entre sí
|
||||
- Incluye manejo de errores para una ejecución paralela robusta
|
||||
- Prueba primero con colecciones pequeñas
|
||||
- Monitorea los límites de frecuencia para APIs externas
|
||||
- Usa el tipo collection para distribuir trabajo, tipo count para instancias fijas
|
||||
- Considera el uso de memoria con colecciones grandes
|
||||
@@ -1,239 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML del bloque de respuesta
|
||||
description: Referencia de configuración YAML para bloques de respuesta
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [response]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this response block
|
||||
inputs:
|
||||
type: object
|
||||
properties:
|
||||
dataMode:
|
||||
type: string
|
||||
enum: [structured, json]
|
||||
description: Mode for defining response data structure
|
||||
default: structured
|
||||
builderData:
|
||||
type: object
|
||||
description: Structured response data (when dataMode is 'structured')
|
||||
data:
|
||||
type: object
|
||||
description: JSON response data (when dataMode is 'json')
|
||||
status:
|
||||
type: number
|
||||
description: HTTP status code
|
||||
default: 200
|
||||
minimum: 100
|
||||
maximum: 599
|
||||
headers:
|
||||
type: array
|
||||
description: Response headers as table entries
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the header entry
|
||||
key:
|
||||
type: string
|
||||
description: Header name
|
||||
value:
|
||||
type: string
|
||||
description: Header value
|
||||
cells:
|
||||
type: object
|
||||
description: Cell display values for the table interface
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Display value for the key column
|
||||
Value:
|
||||
type: string
|
||||
description: Display value for the value column
|
||||
```
|
||||
|
||||
## Configuración de conexión
|
||||
|
||||
Los bloques de respuesta son bloques terminales (sin conexiones salientes) y definen la salida final:
|
||||
|
||||
```yaml
|
||||
# No connections object needed - Response blocks are always terminal
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### Respuesta simple
|
||||
|
||||
```yaml
|
||||
simple-response:
|
||||
type: response
|
||||
name: "Simple Response"
|
||||
inputs:
|
||||
data:
|
||||
message: "Hello World"
|
||||
timestamp: <function.timestamp>
|
||||
status: 200
|
||||
```
|
||||
|
||||
### Respuesta exitosa
|
||||
|
||||
```yaml
|
||||
success-response:
|
||||
type: response
|
||||
name: "Success Response"
|
||||
inputs:
|
||||
data:
|
||||
success: true
|
||||
user:
|
||||
id: <agent.user_id>
|
||||
name: <agent.user_name>
|
||||
email: <agent.user_email>
|
||||
created_at: <function.timestamp>
|
||||
status: 201
|
||||
headers:
|
||||
- key: "Location"
|
||||
value: "/api/users/<agent.user_id>"
|
||||
- key: "X-Created-By"
|
||||
value: "workflow-engine"
|
||||
```
|
||||
|
||||
### Respuesta con formato completo de encabezado de tabla
|
||||
|
||||
Cuando los encabezados se crean a través de la interfaz de tabla de la UI, el YAML incluye metadatos adicionales:
|
||||
|
||||
```yaml
|
||||
api-response:
|
||||
type: response
|
||||
name: "API Response"
|
||||
inputs:
|
||||
data:
|
||||
message: "Request processed successfully"
|
||||
id: <agent.request_id>
|
||||
status: 200
|
||||
headers:
|
||||
- id: header-1-uuid-here
|
||||
key: "Content-Type"
|
||||
value: "application/json"
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
- id: header-2-uuid-here
|
||||
key: "Cache-Control"
|
||||
value: "no-cache"
|
||||
cells:
|
||||
Key: "Cache-Control"
|
||||
Value: "no-cache"
|
||||
- id: header-3-uuid-here
|
||||
key: "X-API-Version"
|
||||
value: "2.1"
|
||||
cells:
|
||||
Key: "X-API-Version"
|
||||
Value: "2.1"
|
||||
```
|
||||
|
||||
### Respuesta de error
|
||||
|
||||
```yaml
|
||||
error-response:
|
||||
type: response
|
||||
name: "Error Response"
|
||||
inputs:
|
||||
data:
|
||||
error: true
|
||||
message: <agent.error_message>
|
||||
code: "VALIDATION_FAILED"
|
||||
details: <function.validation_errors>
|
||||
status: 400
|
||||
headers:
|
||||
- key: "X-Error-Code"
|
||||
value: "VALIDATION_FAILED"
|
||||
```
|
||||
|
||||
### Respuesta paginada
|
||||
|
||||
```yaml
|
||||
paginated-response:
|
||||
type: response
|
||||
name: "Paginated Response"
|
||||
inputs:
|
||||
data:
|
||||
data: <agent.results>
|
||||
pagination:
|
||||
page: <start.page>
|
||||
per_page: <start.per_page>
|
||||
total: <function.total_count>
|
||||
total_pages: <function.total_pages>
|
||||
status: 200
|
||||
headers:
|
||||
- key: "X-Total-Count"
|
||||
value: <function.total_count>
|
||||
- key: "Cache-Control"
|
||||
value: "public, max-age=300"
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
```
|
||||
|
||||
## Formatos de parámetros de tabla
|
||||
|
||||
El bloque de respuesta admite dos formatos para encabezados:
|
||||
|
||||
### Formato simplificado (YAML manual)
|
||||
|
||||
Al escribir YAML manualmente, puedes usar el formato simplificado:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
- key: "Cache-Control"
|
||||
value: "no-cache"
|
||||
```
|
||||
|
||||
### Formato de tabla completo (generado por la UI)
|
||||
|
||||
Cuando los encabezados se crean a través de la interfaz de tabla de la UI, el YAML incluye metadatos adicionales:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: unique-identifier-here
|
||||
key: "Content-Type"
|
||||
value: "application/json"
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
```
|
||||
|
||||
**Diferencias clave:**
|
||||
- `id`: Identificador único para rastrear la fila de la tabla
|
||||
- `cells`: Valores de visualización utilizados por la interfaz de tabla de la UI
|
||||
- Ambos formatos son funcionalmente equivalentes para la ejecución del flujo de trabajo
|
||||
- El formato completo preserva el estado de la UI al importar/exportar flujos de trabajo
|
||||
|
||||
**Importante:** Siempre coloca entre comillas los nombres de encabezados y valores que contengan caracteres especiales:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: content-type-uuid
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
- id: cache-control-uuid
|
||||
cells:
|
||||
Key: "Cache-Control"
|
||||
Value: "no-cache"
|
||||
```
|
||||
|
||||
```
|
||||
@@ -1,200 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML del bloque Router
|
||||
description: Referencia de configuración YAML para bloques Router
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [router]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this router block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- prompt
|
||||
- model
|
||||
- apiKey
|
||||
properties:
|
||||
prompt:
|
||||
type: string
|
||||
description: Instructions for routing decisions and criteria
|
||||
model:
|
||||
type: string
|
||||
description: AI model identifier (e.g., gpt-4o, gemini-2.5-pro, deepseek-chat)
|
||||
apiKey:
|
||||
type: string
|
||||
description: API key for the model provider (use {{ENV_VAR}} format)
|
||||
temperature:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 2
|
||||
description: Model temperature for routing decisions
|
||||
default: 0.3
|
||||
azureEndpoint:
|
||||
type: string
|
||||
description: Azure OpenAI endpoint URL (required for Azure models)
|
||||
azureApiVersion:
|
||||
type: string
|
||||
description: Azure API version (required for Azure models)
|
||||
connections:
|
||||
type: object
|
||||
description: Multiple connection paths for different routing outcomes
|
||||
properties:
|
||||
success:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Array of target block IDs for routing destinations
|
||||
```
|
||||
|
||||
## Configuración de conexión
|
||||
|
||||
Los bloques Router utilizan un array de éxito que contiene todos los posibles destinos de enrutamiento:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success:
|
||||
- <string> # Target block ID option 1
|
||||
- <string> # Target block ID option 2
|
||||
- <string> # Target block ID option 3
|
||||
# Additional target block IDs as needed
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### Router de tipo de contenido
|
||||
|
||||
```yaml
|
||||
content-router:
|
||||
type: router
|
||||
name: "Content Type Router"
|
||||
inputs:
|
||||
prompt: |
|
||||
Route this content based on its type:
|
||||
- If it's a question, route to question-handler
|
||||
- If it's a complaint, route to complaint-handler
|
||||
- If it's feedback, route to feedback-handler
|
||||
- If it's a request, route to request-handler
|
||||
|
||||
Content: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success:
|
||||
- question-handler
|
||||
- complaint-handler
|
||||
- feedback-handler
|
||||
- request-handler
|
||||
```
|
||||
|
||||
### Router de prioridad
|
||||
|
||||
```yaml
|
||||
priority-router:
|
||||
type: router
|
||||
name: "Priority Router"
|
||||
inputs:
|
||||
prompt: |
|
||||
Analyze the urgency and route accordingly:
|
||||
- urgent-queue: High priority, needs immediate attention
|
||||
- standard-queue: Normal priority, standard processing
|
||||
- low-queue: Low priority, can be delayed
|
||||
|
||||
Email content: <email-analyzer.content>
|
||||
|
||||
Route based on urgency indicators, deadlines, and tone.
|
||||
model: gpt-4o
|
||||
temperature: 0.2
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success:
|
||||
- urgent-queue
|
||||
- standard-queue
|
||||
- low-queue
|
||||
```
|
||||
|
||||
### Router de departamento
|
||||
|
||||
```yaml
|
||||
department-router:
|
||||
type: router
|
||||
name: "Department Router"
|
||||
inputs:
|
||||
prompt: |
|
||||
Route this customer inquiry to the appropriate department:
|
||||
|
||||
- sales-team: Sales questions, pricing, demos
|
||||
- support-team: Technical issues, bug reports, how-to questions
|
||||
- billing-team: Payment issues, subscription changes, invoices
|
||||
- general-team: General inquiries, feedback, other topics
|
||||
|
||||
Customer message: <start.input>
|
||||
Customer type: <customer-analyzer.type>
|
||||
model: claude-3-5-sonnet-20241022
|
||||
apiKey: '{{ANTHROPIC_API_KEY}}'
|
||||
connections:
|
||||
success:
|
||||
- sales-team
|
||||
- support-team
|
||||
- billing-team
|
||||
- general-team
|
||||
```
|
||||
|
||||
## Configuración avanzada
|
||||
|
||||
### Router de múltiples modelos
|
||||
|
||||
```yaml
|
||||
model-selector-router:
|
||||
type: router
|
||||
name: "Model Selection Router"
|
||||
inputs:
|
||||
prompt: |
|
||||
Based on the task complexity, route to the appropriate model:
|
||||
- simple-gpt35: Simple questions, basic tasks
|
||||
- advanced-gpt4: Complex analysis, detailed reasoning
|
||||
- specialized-claude: Creative writing, nuanced analysis
|
||||
|
||||
Task: <start.task>
|
||||
Complexity indicators: <analyzer.complexity>
|
||||
model: gpt-4o-mini
|
||||
temperature: 0.1
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success:
|
||||
- simple-gpt35
|
||||
- advanced-gpt4
|
||||
- specialized-claude
|
||||
```
|
||||
|
||||
## Referencias de salida
|
||||
|
||||
Los bloques Router no producen salidas directas, sino que controlan la ruta del flujo de trabajo:
|
||||
|
||||
```yaml
|
||||
# Router decisions affect which subsequent blocks execute
|
||||
# Access the routed block's outputs normally:
|
||||
final-step:
|
||||
inputs:
|
||||
routed-result: <routed-block-name.content>
|
||||
```
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
- Proporcionar criterios de enrutamiento claros en el prompt
|
||||
- Usar nombres de bloques de destino específicos y descriptivos
|
||||
- Incluir ejemplos de contenido para cada ruta de enrutamiento
|
||||
- Utilizar valores de temperatura más bajos para un enrutamiento consistente
|
||||
- Probar con diversos tipos de entrada para garantizar un enrutamiento preciso
|
||||
- Considerar rutas alternativas para casos excepcionales
|
||||
@@ -1,183 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML del bloque de inicio
|
||||
description: Referencia de configuración YAML para bloques de inicio
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [starter]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this starter block
|
||||
inputs:
|
||||
type: object
|
||||
properties:
|
||||
startWorkflow:
|
||||
type: string
|
||||
enum: [manual, webhook, schedule]
|
||||
description: How the workflow should be triggered
|
||||
default: manual
|
||||
inputFormat:
|
||||
type: array
|
||||
description: Expected input structure for API calls (manual workflows)
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: Field name
|
||||
type:
|
||||
type: string
|
||||
enum: [string, number, boolean, object, array]
|
||||
description: Field type
|
||||
scheduleType:
|
||||
type: string
|
||||
enum: [hourly, daily, weekly, monthly]
|
||||
description: Schedule frequency (schedule workflows only)
|
||||
hourlyMinute:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 59
|
||||
description: Minute of the hour to run (hourly schedules)
|
||||
dailyTime:
|
||||
type: string
|
||||
pattern: "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
|
||||
description: Time of day to run in HH:MM format (daily schedules)
|
||||
weeklyDay:
|
||||
type: string
|
||||
enum: [MON, TUE, WED, THU, FRI, SAT, SUN]
|
||||
description: Day of week to run (weekly schedules)
|
||||
weeklyTime:
|
||||
type: string
|
||||
pattern: "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
|
||||
description: Time of day to run in HH:MM format (weekly schedules)
|
||||
monthlyDay:
|
||||
type: number
|
||||
minimum: 1
|
||||
maximum: 28
|
||||
description: Day of month to run (monthly schedules)
|
||||
monthlyTime:
|
||||
type: string
|
||||
pattern: "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
|
||||
description: Time of day to run in HH:MM format (monthly schedules)
|
||||
timezone:
|
||||
type: string
|
||||
description: Timezone for scheduled workflows
|
||||
default: UTC
|
||||
webhookProvider:
|
||||
type: string
|
||||
enum: [slack, gmail, airtable, telegram, generic, whatsapp, github, discord, stripe]
|
||||
description: Provider for webhook integration (webhook workflows only)
|
||||
webhookConfig:
|
||||
type: object
|
||||
description: Provider-specific webhook configuration
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID to execute when workflow starts
|
||||
```
|
||||
|
||||
## Configuración de conexión
|
||||
|
||||
El bloque de inicio solo tiene una conexión de éxito ya que es el punto de entrada:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID to execute when workflow starts
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### Inicio manual
|
||||
|
||||
```yaml
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: next-block
|
||||
```
|
||||
|
||||
### Inicio manual con formato de entrada
|
||||
|
||||
```yaml
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
inputFormat:
|
||||
- name: query
|
||||
type: string
|
||||
- name: email
|
||||
type: string
|
||||
- name: age
|
||||
type: number
|
||||
- name: isActive
|
||||
type: boolean
|
||||
- name: preferences
|
||||
type: object
|
||||
- name: tags
|
||||
type: array
|
||||
connections:
|
||||
success: agent-1
|
||||
```
|
||||
|
||||
### Programación diaria
|
||||
|
||||
```yaml
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: schedule
|
||||
scheduleType: daily
|
||||
dailyTime: "09:00"
|
||||
timezone: "America/New_York"
|
||||
connections:
|
||||
success: daily-task
|
||||
```
|
||||
|
||||
### Programación semanal
|
||||
|
||||
```yaml
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: schedule
|
||||
scheduleType: weekly
|
||||
weeklyDay: MON
|
||||
weeklyTime: "08:30"
|
||||
timezone: UTC
|
||||
connections:
|
||||
success: weekly-report
|
||||
```
|
||||
|
||||
### Disparador de webhook
|
||||
|
||||
```yaml
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: webhook
|
||||
webhookProvider: slack
|
||||
webhookConfig:
|
||||
# Provider-specific configuration
|
||||
connections:
|
||||
success: process-webhook
|
||||
```
|
||||
@@ -1,403 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML del bloque Webhook
|
||||
description: Referencia de configuración YAML para bloques Webhook
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [webhook]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this webhook block
|
||||
inputs:
|
||||
type: object
|
||||
properties:
|
||||
webhookConfig:
|
||||
type: object
|
||||
description: Webhook configuration settings
|
||||
properties:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether the webhook is active
|
||||
default: true
|
||||
secret:
|
||||
type: string
|
||||
description: Secret key for webhook verification
|
||||
headers:
|
||||
type: array
|
||||
description: Expected headers for validation as table entries
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the header entry
|
||||
key:
|
||||
type: string
|
||||
description: Header name
|
||||
value:
|
||||
type: string
|
||||
description: Expected header value
|
||||
cells:
|
||||
type: object
|
||||
description: Cell display values for the table interface
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Display value for the key column
|
||||
Value:
|
||||
type: string
|
||||
description: Display value for the value column
|
||||
methods:
|
||||
type: array
|
||||
description: Allowed HTTP methods
|
||||
items:
|
||||
type: string
|
||||
enum: [GET, POST, PUT, DELETE, PATCH]
|
||||
default: [POST]
|
||||
responseConfig:
|
||||
type: object
|
||||
description: Response configuration for the webhook
|
||||
properties:
|
||||
status:
|
||||
type: number
|
||||
description: HTTP status code to return
|
||||
default: 200
|
||||
minimum: 100
|
||||
maximum: 599
|
||||
headers:
|
||||
type: array
|
||||
description: Response headers as table entries
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the header entry
|
||||
key:
|
||||
type: string
|
||||
description: Header name
|
||||
value:
|
||||
type: string
|
||||
description: Header value
|
||||
cells:
|
||||
type: object
|
||||
description: Cell display values for the table interface
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Display value for the key column
|
||||
Value:
|
||||
type: string
|
||||
description: Display value for the value column
|
||||
body:
|
||||
type: string
|
||||
description: Response body content
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful webhook processing
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Configuración de conexión
|
||||
|
||||
Las conexiones definen hacia dónde va el flujo de trabajo basado en el procesamiento del webhook:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful processing
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### Disparador básico de Webhook
|
||||
|
||||
```yaml
|
||||
github-webhook:
|
||||
type: webhook
|
||||
name: "GitHub Webhook"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
secret: "{{GITHUB_WEBHOOK_SECRET}}"
|
||||
methods: [POST]
|
||||
headers:
|
||||
- key: "X-GitHub-Event"
|
||||
value: "push"
|
||||
responseConfig:
|
||||
status: 200
|
||||
body: |
|
||||
{
|
||||
"message": "Webhook received successfully",
|
||||
"timestamp": "{{new Date().toISOString()}}"
|
||||
}
|
||||
connections:
|
||||
success: process-github-event
|
||||
error: webhook-error-handler
|
||||
```
|
||||
|
||||
### Webhook de eventos de Slack
|
||||
|
||||
```yaml
|
||||
slack-events:
|
||||
type: webhook
|
||||
name: "Slack Events"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
secret: "{{SLACK_SIGNING_SECRET}}"
|
||||
methods: [POST]
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
responseConfig:
|
||||
status: 200
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
body: |
|
||||
{
|
||||
"challenge": "<webhook.challenge>"
|
||||
}
|
||||
connections:
|
||||
success: handle-slack-event
|
||||
```
|
||||
|
||||
### Webhook de pago (Stripe)
|
||||
|
||||
```yaml
|
||||
stripe-webhook:
|
||||
type: webhook
|
||||
name: "Stripe Payment Webhook"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
secret: "{{STRIPE_WEBHOOK_SECRET}}"
|
||||
methods: [POST]
|
||||
headers:
|
||||
- key: "Stripe-Signature"
|
||||
value: "*"
|
||||
responseConfig:
|
||||
status: 200
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
body: |
|
||||
{
|
||||
"received": true
|
||||
}
|
||||
connections:
|
||||
success: process-payment-event
|
||||
error: payment-webhook-error
|
||||
```
|
||||
|
||||
### Webhook con formato completo de encabezado de tabla
|
||||
|
||||
Cuando los encabezados se crean a través de la interfaz de tabla UI, el YAML incluye metadatos adicionales:
|
||||
|
||||
```yaml
|
||||
api-webhook-complete:
|
||||
type: webhook
|
||||
name: "API Webhook with Table Headers"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
methods: [POST]
|
||||
headers:
|
||||
- id: header-1-uuid-here
|
||||
key: "Authorization"
|
||||
value: "Bearer {{WEBHOOK_API_KEY}}"
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{WEBHOOK_API_KEY}}"
|
||||
- id: header-2-uuid-here
|
||||
key: "Content-Type"
|
||||
value: "application/json"
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
responseConfig:
|
||||
status: 200
|
||||
headers:
|
||||
- id: response-header-1-uuid
|
||||
key: "Content-Type"
|
||||
value: "application/json"
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
- id: response-header-2-uuid
|
||||
key: "X-Webhook-Response"
|
||||
value: "processed"
|
||||
cells:
|
||||
Key: "X-Webhook-Response"
|
||||
Value: "processed"
|
||||
body: |
|
||||
{
|
||||
"status": "received",
|
||||
"timestamp": "{{new Date().toISOString()}}"
|
||||
}
|
||||
connections:
|
||||
success: process-webhook-complete
|
||||
```
|
||||
|
||||
### Webhook de API genérica
|
||||
|
||||
```yaml
|
||||
api-webhook:
|
||||
type: webhook
|
||||
name: "API Webhook"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
methods: [POST, PUT]
|
||||
headers:
|
||||
- key: "Authorization"
|
||||
value: "Bearer {{WEBHOOK_API_KEY}}"
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
responseConfig:
|
||||
status: 202
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
- key: "X-Processed-By"
|
||||
value: "Sim"
|
||||
body: |
|
||||
{
|
||||
"status": "accepted",
|
||||
"id": "{{Math.random().toString(36).substr(2, 9)}}",
|
||||
"received_at": "{{new Date().toISOString()}}"
|
||||
}
|
||||
connections:
|
||||
success: process-webhook-data
|
||||
```
|
||||
|
||||
### Webhook multi-método
|
||||
|
||||
```yaml
|
||||
crud-webhook:
|
||||
type: webhook
|
||||
name: "CRUD Webhook"
|
||||
inputs:
|
||||
webhookConfig:
|
||||
enabled: true
|
||||
methods: [GET, POST, PUT, DELETE]
|
||||
headers:
|
||||
- key: "X-API-Key"
|
||||
value: "{{CRUD_API_KEY}}"
|
||||
responseConfig:
|
||||
status: 200
|
||||
headers:
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
body: |
|
||||
{
|
||||
"method": "<webhook.method>",
|
||||
"processed": true,
|
||||
"timestamp": "{{new Date().toISOString()}}"
|
||||
}
|
||||
connections:
|
||||
success: route-by-method
|
||||
```
|
||||
|
||||
## Formatos de parámetros de tabla
|
||||
|
||||
El bloque Webhook admite dos formatos para encabezados (tanto encabezados de validación como encabezados de respuesta):
|
||||
|
||||
### Formato simplificado (YAML manual)
|
||||
|
||||
Cuando escribes YAML manualmente, puedes usar el formato simplificado:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- key: "Authorization"
|
||||
value: "Bearer {{API_TOKEN}}"
|
||||
- key: "Content-Type"
|
||||
value: "application/json"
|
||||
```
|
||||
|
||||
### Formato completo de tabla (generado por la interfaz de usuario)
|
||||
|
||||
Cuando los encabezados se crean a través de la interfaz de tabla de la UI, el YAML incluye metadatos adicionales:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: unique-identifier-here
|
||||
key: "Authorization"
|
||||
value: "Bearer {{API_TOKEN}}"
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{API_TOKEN}}"
|
||||
```
|
||||
|
||||
**Diferencias clave:**
|
||||
- `id`: Identificador único para rastrear la fila de la tabla
|
||||
- `cells`: Valores de visualización utilizados por la interfaz de tabla de la UI
|
||||
- Ambos formatos son funcionalmente equivalentes para el procesamiento de webhooks
|
||||
- El formato completo preserva el estado de la UI al importar/exportar flujos de trabajo
|
||||
|
||||
**Importante:** Siempre coloca entre comillas los nombres de encabezados y valores que contengan caracteres especiales:
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: auth-header-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{WEBHOOK_API_KEY}}"
|
||||
- id: content-type-uuid
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
```
|
||||
|
||||
## Variables de webhook
|
||||
|
||||
Dentro de los flujos de trabajo activados por webhook, estas variables especiales están disponibles:
|
||||
|
||||
```yaml
|
||||
# Available in blocks after the webhook
|
||||
<webhook.payload> # Full request payload/body
|
||||
<webhook.headers> # Request headers
|
||||
<webhook.method> # HTTP method used
|
||||
<webhook.query> # Query parameters
|
||||
<webhook.path> # Request path
|
||||
<webhook.challenge> # Challenge parameter (for verification)
|
||||
```
|
||||
|
||||
## Referencias de salida
|
||||
|
||||
Después de que un webhook procesa una solicitud, puedes hacer referencia a sus datos:
|
||||
|
||||
```yaml
|
||||
# In subsequent blocks
|
||||
process-webhook:
|
||||
inputs:
|
||||
payload: <webhook-name.payload> # Request payload
|
||||
headers: <webhook-name.headers> # Request headers
|
||||
method: <webhook-name.method> # HTTP method
|
||||
```
|
||||
|
||||
## Mejores prácticas de seguridad
|
||||
|
||||
- Utiliza siempre secretos de webhook para verificación
|
||||
- Valida los encabezados y métodos esperados
|
||||
- Implementa un manejo adecuado de errores
|
||||
- Usa endpoints HTTPS en producción
|
||||
- Monitorea la actividad y fallos de los webhooks
|
||||
- Establece tiempos de espera de respuesta apropiados
|
||||
- Valida la estructura de la carga útil antes de procesarla
|
||||
@@ -1,299 +0,0 @@
|
||||
---
|
||||
title: Esquema YAML del bloque de flujo de trabajo
|
||||
description: Referencia de configuración YAML para bloques de flujo de trabajo
|
||||
---
|
||||
|
||||
## Definición del esquema
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [workflow]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this workflow block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- workflowId
|
||||
properties:
|
||||
workflowId:
|
||||
type: string
|
||||
description: ID of the workflow to execute
|
||||
inputMapping:
|
||||
type: object
|
||||
description: Map current workflow data to sub-workflow inputs
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Input value or reference to parent workflow data
|
||||
environmentVariables:
|
||||
type: object
|
||||
description: Environment variables to pass to sub-workflow
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Environment variable value
|
||||
timeout:
|
||||
type: number
|
||||
description: Maximum execution time in milliseconds
|
||||
default: 300000
|
||||
minimum: 1000
|
||||
maximum: 1800000
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful workflow completion
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Configuración de conexión
|
||||
|
||||
Las conexiones definen hacia dónde va el flujo de trabajo según los resultados del subflujo de trabajo:
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful completion
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Ejemplos
|
||||
|
||||
### Ejecución simple de flujo de trabajo
|
||||
|
||||
```yaml
|
||||
data-processor:
|
||||
type: workflow
|
||||
name: "Data Processing Workflow"
|
||||
inputs:
|
||||
workflowId: "data-processing-v2"
|
||||
inputMapping:
|
||||
rawData: <start.input>
|
||||
userId: <user-validator.userId>
|
||||
environmentVariables:
|
||||
PROCESSING_MODE: "production"
|
||||
LOG_LEVEL: "info"
|
||||
connections:
|
||||
success: process-results
|
||||
error: workflow-error-handler
|
||||
```
|
||||
|
||||
### Pipeline de generación de contenido
|
||||
|
||||
```yaml
|
||||
content-generator:
|
||||
type: workflow
|
||||
name: "Content Generation Pipeline"
|
||||
inputs:
|
||||
workflowId: "content-generation-v3"
|
||||
inputMapping:
|
||||
topic: <start.topic>
|
||||
style: <style-analyzer.recommendedStyle>
|
||||
targetAudience: <audience-detector.audience>
|
||||
brandGuidelines: <brand-config.guidelines>
|
||||
environmentVariables:
|
||||
CONTENT_API_KEY: "{{CONTENT_API_KEY}}"
|
||||
QUALITY_THRESHOLD: "high"
|
||||
timeout: 120000
|
||||
connections:
|
||||
success: review-content
|
||||
error: content-generation-failed
|
||||
```
|
||||
|
||||
### Flujo de trabajo de análisis de múltiples pasos
|
||||
|
||||
```yaml
|
||||
analysis-workflow:
|
||||
type: workflow
|
||||
name: "Analysis Workflow"
|
||||
inputs:
|
||||
workflowId: "comprehensive-analysis"
|
||||
inputMapping:
|
||||
document: <document-processor.content>
|
||||
analysisType: "comprehensive"
|
||||
includeMetrics: true
|
||||
outputFormat: "structured"
|
||||
environmentVariables:
|
||||
ANALYSIS_MODEL: "gpt-4o"
|
||||
OPENAI_API_KEY: "{{OPENAI_API_KEY}}"
|
||||
CLAUDE_API_KEY: "{{CLAUDE_API_KEY}}"
|
||||
connections:
|
||||
success: compile-analysis-report
|
||||
error: analysis-workflow-error
|
||||
```
|
||||
|
||||
### Ejecución condicional de flujo de trabajo
|
||||
|
||||
```yaml
|
||||
customer-workflow-router:
|
||||
type: condition
|
||||
name: "Customer Workflow Router"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <customer-type.type> === "enterprise"
|
||||
else-if: <customer-type.type> === "premium"
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: enterprise-workflow
|
||||
else-if: premium-workflow
|
||||
else: standard-workflow
|
||||
|
||||
enterprise-workflow:
|
||||
type: workflow
|
||||
name: "Enterprise Customer Workflow"
|
||||
inputs:
|
||||
workflowId: "enterprise-customer-processing"
|
||||
inputMapping:
|
||||
customerData: <customer-data.profile>
|
||||
accountManager: <account-assignment.manager>
|
||||
tier: "enterprise"
|
||||
environmentVariables:
|
||||
PRIORITY_LEVEL: "high"
|
||||
SLA_REQUIREMENTS: "strict"
|
||||
connections:
|
||||
success: enterprise-complete
|
||||
|
||||
premium-workflow:
|
||||
type: workflow
|
||||
name: "Premium Customer Workflow"
|
||||
inputs:
|
||||
workflowId: "premium-customer-processing"
|
||||
inputMapping:
|
||||
customerData: <customer-data.profile>
|
||||
supportLevel: "premium"
|
||||
environmentVariables:
|
||||
PRIORITY_LEVEL: "medium"
|
||||
connections:
|
||||
success: premium-complete
|
||||
|
||||
standard-workflow:
|
||||
type: workflow
|
||||
name: "Standard Customer Workflow"
|
||||
inputs:
|
||||
workflowId: "standard-customer-processing"
|
||||
inputMapping:
|
||||
customerData: <customer-data.profile>
|
||||
environmentVariables:
|
||||
PRIORITY_LEVEL: "standard"
|
||||
connections:
|
||||
success: standard-complete
|
||||
```
|
||||
|
||||
### Ejecución paralela de flujo de trabajo
|
||||
|
||||
```yaml
|
||||
parallel-workflows:
|
||||
type: parallel
|
||||
name: "Parallel Workflow Processing"
|
||||
inputs:
|
||||
parallelType: collection
|
||||
collection: |
|
||||
[
|
||||
{"workflowId": "sentiment-analysis", "focus": "sentiment"},
|
||||
{"workflowId": "topic-extraction", "focus": "topics"},
|
||||
{"workflowId": "entity-recognition", "focus": "entities"}
|
||||
]
|
||||
connections:
|
||||
success: merge-workflow-results
|
||||
|
||||
execute-analysis-workflow:
|
||||
type: workflow
|
||||
name: "Execute Analysis Workflow"
|
||||
parentId: parallel-workflows
|
||||
inputs:
|
||||
workflowId: <parallel.currentItem.workflowId>
|
||||
inputMapping:
|
||||
content: <start.content>
|
||||
analysisType: <parallel.currentItem.focus>
|
||||
environmentVariables:
|
||||
ANALYSIS_API_KEY: "{{ANALYSIS_API_KEY}}"
|
||||
connections:
|
||||
success: workflow-complete
|
||||
```
|
||||
|
||||
### Flujo de trabajo de manejo de errores
|
||||
|
||||
```yaml
|
||||
main-workflow:
|
||||
type: workflow
|
||||
name: "Main Processing Workflow"
|
||||
inputs:
|
||||
workflowId: "main-processing-v1"
|
||||
inputMapping:
|
||||
data: <start.input>
|
||||
timeout: 180000
|
||||
connections:
|
||||
success: main-complete
|
||||
error: error-recovery-workflow
|
||||
|
||||
error-recovery-workflow:
|
||||
type: workflow
|
||||
name: "Error Recovery Workflow"
|
||||
inputs:
|
||||
workflowId: "error-recovery-v1"
|
||||
inputMapping:
|
||||
originalInput: <start.input>
|
||||
errorDetails: <main-workflow.error>
|
||||
failureTimestamp: "{{new Date().toISOString()}}"
|
||||
environmentVariables:
|
||||
RECOVERY_MODE: "automatic"
|
||||
FALLBACK_ENABLED: "true"
|
||||
connections:
|
||||
success: recovery-complete
|
||||
error: manual-intervention-required
|
||||
```
|
||||
|
||||
## Mapeo de entrada
|
||||
|
||||
Mapea datos desde el flujo de trabajo principal al subflujo de trabajo:
|
||||
|
||||
```yaml
|
||||
inputMapping:
|
||||
# Static values
|
||||
mode: "production"
|
||||
version: "1.0"
|
||||
|
||||
# References to parent workflow data
|
||||
userData: <user-processor.profile>
|
||||
settings: <config-loader.settings>
|
||||
|
||||
# Complex object mapping
|
||||
requestData:
|
||||
id: <start.requestId>
|
||||
timestamp: "{{new Date().toISOString()}}"
|
||||
source: "parent-workflow"
|
||||
```
|
||||
|
||||
## Referencias de salida
|
||||
|
||||
Después de que un bloque de flujo de trabajo se completa, puedes hacer referencia a sus salidas:
|
||||
|
||||
```yaml
|
||||
# In subsequent blocks
|
||||
next-block:
|
||||
inputs:
|
||||
workflowResult: <workflow-name.output> # Sub-workflow output
|
||||
executionTime: <workflow-name.duration> # Execution duration
|
||||
status: <workflow-name.status> # Execution status
|
||||
```
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
- Utiliza identificadores descriptivos para los flujos de trabajo para mayor claridad
|
||||
- Mapea solo los datos necesarios a los subflujos de trabajo
|
||||
- Establece tiempos de espera apropiados según la complejidad del flujo de trabajo
|
||||
- Incluye manejo de errores para una ejecución robusta
|
||||
- Pasa las variables de entorno de forma segura
|
||||
- Prueba los subflujos de trabajo de forma independiente primero
|
||||
- Monitorea el rendimiento de los flujos de trabajo anidados
|
||||
- Utiliza identificadores de flujos de trabajo versionados para mayor estabilidad
|
||||
@@ -1,273 +0,0 @@
|
||||
---
|
||||
title: Ejemplos de flujos de trabajo YAML
|
||||
description: Ejemplos de flujos de trabajo YAML completos
|
||||
---
|
||||
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
|
||||
## Flujo de trabajo de cadena multi-agente
|
||||
|
||||
Un flujo de trabajo donde múltiples agentes de IA procesan información secuencialmente:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: agent-1-initiator
|
||||
|
||||
agent-1-initiator:
|
||||
type: agent
|
||||
name: Agent 1 Initiator
|
||||
inputs:
|
||||
systemPrompt: You are the first agent in a chain. Your role is to analyze the input and create an initial response that will be passed to the next agent.
|
||||
userPrompt: |-
|
||||
Welcome! I'm the first agent in our chain.
|
||||
|
||||
Input to process: <start.input>
|
||||
|
||||
Please create an initial analysis or greeting that the next agent can build upon. Be creative and set a positive tone for the chain!
|
||||
model: gpt-4o
|
||||
temperature: 0.7
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: agent-2-enhancer
|
||||
|
||||
agent-2-enhancer:
|
||||
type: agent
|
||||
name: Agent 2 Enhancer
|
||||
inputs:
|
||||
systemPrompt: You are the second agent in a chain. Take the output from Agent 1 and enhance it with additional insights or improvements.
|
||||
userPrompt: |-
|
||||
I'm the second agent! Here's what Agent 1 provided:
|
||||
|
||||
<agent1initiator.content>
|
||||
|
||||
Now I'll enhance this with additional details, insights, or improvements. Let me build upon their work!
|
||||
model: gpt-4o
|
||||
temperature: 0.7
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: agent-3-refiner
|
||||
|
||||
agent-3-refiner:
|
||||
type: agent
|
||||
name: Agent 3 Refiner
|
||||
inputs:
|
||||
systemPrompt: You are the third agent in a chain. Take the enhanced output from Agent 2 and refine it further, adding structure or organization.
|
||||
userPrompt: |-
|
||||
I'm the third agent in our chain! Here's the enhanced work from Agent 2:
|
||||
|
||||
<agent2enhancer.content>
|
||||
|
||||
My job is to refine and organize this content. I'll add structure, clarity, and polish to make it even better!
|
||||
model: gpt-4o
|
||||
temperature: 0.6
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: agent-4-finalizer
|
||||
|
||||
agent-4-finalizer:
|
||||
type: agent
|
||||
name: Agent 4 Finalizer
|
||||
inputs:
|
||||
systemPrompt: You are the final agent in a chain of 4. Create a comprehensive summary and conclusion based on all the previous agents' work.
|
||||
userPrompt: |-
|
||||
I'm the final agent! Here's the refined work from Agent 3:
|
||||
|
||||
<agent3refiner.content>
|
||||
|
||||
As the last agent in our chain, I'll create a final, polished summary that brings together all the work from our team of 4 agents. Let me conclude this beautifully!
|
||||
model: gpt-4o
|
||||
temperature: 0.5
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
## Flujo de trabajo condicional basado en enrutador
|
||||
|
||||
Un flujo de trabajo que utiliza lógica de enrutamiento para enviar datos a diferentes agentes según las condiciones:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: router-1
|
||||
|
||||
router-1:
|
||||
type: router
|
||||
name: Router 1
|
||||
inputs:
|
||||
prompt: go to agent 1 if <start.input> is greater than 5. else agent 2 if greater than 10. else agent 3
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success:
|
||||
- agent-1
|
||||
- agent-2
|
||||
- agent-3
|
||||
|
||||
agent-1:
|
||||
type: agent
|
||||
name: Agent 1
|
||||
inputs:
|
||||
systemPrompt: say 1
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
|
||||
agent-2:
|
||||
type: agent
|
||||
name: Agent 2
|
||||
inputs:
|
||||
systemPrompt: say 2
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
|
||||
agent-3:
|
||||
type: agent
|
||||
name: Agent 3
|
||||
inputs:
|
||||
systemPrompt: say 3
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
## Búsqueda web con salida estructurada
|
||||
|
||||
Un flujo de trabajo que busca en la web utilizando herramientas y devuelve datos estructurados:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
59eb07c1-1411-4b28-a274-fa78f55daf72:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: d77c2c98-56c4-432d-9338-9bac54a2d42f
|
||||
d77c2c98-56c4-432d-9338-9bac54a2d42f:
|
||||
type: agent
|
||||
name: Agent 1
|
||||
inputs:
|
||||
systemPrompt: look up the user input. use structured output
|
||||
userPrompt: <start.input>
|
||||
model: claude-sonnet-4-0
|
||||
apiKey: '{{ANTHROPIC_API_KEY}}'
|
||||
tools:
|
||||
- type: exa
|
||||
title: Exa
|
||||
params:
|
||||
type: auto
|
||||
apiKey: '{{EXA_API_KEY}}'
|
||||
numResults: ''
|
||||
toolId: exa_search
|
||||
operation: exa_search
|
||||
isExpanded: true
|
||||
usageControl: auto
|
||||
responseFormat: |-
|
||||
{
|
||||
"name": "output_schema",
|
||||
"description": "Defines the structure for an output object.",
|
||||
"strict": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"output": {
|
||||
"type": "string",
|
||||
"description": "The output value"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["output"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Procesamiento en bucle con colección
|
||||
|
||||
Un flujo de trabajo que procesa cada elemento en una colección utilizando un bucle:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: food-analysis-loop
|
||||
food-analysis-loop:
|
||||
type: loop
|
||||
name: Food Analysis Loop
|
||||
inputs:
|
||||
count: 5
|
||||
loopType: forEach
|
||||
collection: '["apple", "banana", "carrot"]'
|
||||
connections:
|
||||
loop:
|
||||
start: calorie-agent
|
||||
calorie-agent:
|
||||
type: agent
|
||||
name: Calorie Analyzer
|
||||
inputs:
|
||||
systemPrompt: Return the number of calories in the food
|
||||
userPrompt: <loop.currentItem>
|
||||
model: claude-sonnet-4-0
|
||||
apiKey: '{{ANTHROPIC_API_KEY}}'
|
||||
parentId: food-analysis-loop
|
||||
```
|
||||
|
||||
## Clasificación y respuesta de correos electrónicos
|
||||
|
||||
Un flujo de trabajo que clasifica correos electrónicos y genera respuestas apropiadas:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: email-classifier
|
||||
|
||||
email-classifier:
|
||||
type: agent
|
||||
name: Email Classifier
|
||||
inputs:
|
||||
systemPrompt: Classify emails into categories and extract key information.
|
||||
userPrompt: |
|
||||
Classify this email: <start.input>
|
||||
|
||||
Categories: support, billing, sales, feedback
|
||||
Extract: urgency level, customer sentiment, main request
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: response-generator
|
||||
|
||||
response-generator:
|
||||
type: agent
|
||||
name: Response Generator
|
||||
inputs:
|
||||
systemPrompt: Generate appropriate responses based on email classification.
|
||||
userPrompt: |
|
||||
Email classification: <emailclassifier.content>
|
||||
Original email: <start.input>
|
||||
|
||||
Generate a professional, helpful response addressing the customer's needs.
|
||||
model: gpt-4o
|
||||
temperature: 0.7
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
@@ -1,159 +0,0 @@
|
||||
---
|
||||
title: Referencia de flujos de trabajo YAML
|
||||
description: Guía completa para escribir flujos de trabajo YAML en Sim
|
||||
---
|
||||
|
||||
import { Card, Cards } from "fumadocs-ui/components/card";
|
||||
import { Step, Steps } from "fumadocs-ui/components/steps";
|
||||
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
||||
|
||||
Los flujos de trabajo YAML proporcionan una forma potente de definir, versionar y compartir configuraciones de flujos de trabajo en Sim. Esta guía de referencia cubre la sintaxis completa de YAML, esquemas de bloques y mejores prácticas para crear flujos de trabajo robustos.
|
||||
|
||||
## Inicio rápido
|
||||
|
||||
Cada flujo de trabajo de Sim sigue esta estructura básica:
|
||||
|
||||
```yaml
|
||||
version: '1.0'
|
||||
blocks:
|
||||
start:
|
||||
type: starter
|
||||
name: Start
|
||||
inputs:
|
||||
startWorkflow: manual
|
||||
connections:
|
||||
success: agent-1
|
||||
|
||||
agent-1:
|
||||
type: agent
|
||||
name: "AI Assistant"
|
||||
inputs:
|
||||
systemPrompt: "You are a helpful assistant."
|
||||
userPrompt: 'Hi'
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
## Conceptos fundamentales
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Declaración de versión</strong>: Debe ser exactamente `version: '1.0'` (con comillas)
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Estructura de bloques</strong>: Todos los bloques del flujo de trabajo se definen bajo la clave `blocks`
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Referencias de bloques</strong>: Usa nombres de bloques en minúsculas sin espacios (por ejemplo, `<aiassistant.content>`)
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Variables de entorno</strong>: Referencia con dobles llaves `{{VARIABLE_NAME}}`
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Tipos de bloques
|
||||
|
||||
Sim admite varios tipos de bloques principales, cada uno con esquemas YAML específicos:
|
||||
|
||||
<Cards>
|
||||
<Card title="Bloque de inicio" href="/yaml/blocks/starter">
|
||||
Punto de entrada del flujo de trabajo con soporte para activadores manuales, webhooks y programados
|
||||
</Card>
|
||||
<Card title="Bloque de agente" href="/yaml/blocks/agent">
|
||||
Procesamiento impulsado por IA con soporte para herramientas y salida estructurada
|
||||
</Card>
|
||||
<Card title="Bloque de función" href="/yaml/blocks/function">
|
||||
Ejecución de código JavaScript/TypeScript personalizado
|
||||
</Card>
|
||||
<Card title="Bloque de API" href="/yaml/blocks/api">
|
||||
Solicitudes HTTP a servicios externos
|
||||
</Card>
|
||||
<Card title="Bloque de condición" href="/yaml/blocks/condition">
|
||||
Ramificación condicional basada en expresiones booleanas
|
||||
</Card>
|
||||
<Card title="Bloque de enrutador" href="/yaml/blocks/router">
|
||||
Enrutamiento inteligente impulsado por IA a múltiples rutas
|
||||
</Card>
|
||||
<Card title="Bloque de bucle" href="/yaml/blocks/loop">
|
||||
Procesamiento iterativo con bucles for y forEach
|
||||
</Card>
|
||||
<Card title="Bloque paralelo" href="/yaml/blocks/parallel">
|
||||
Ejecución concurrente en múltiples instancias
|
||||
</Card>
|
||||
<Card title="Bloque de webhook" href="/yaml/blocks/webhook">
|
||||
Activadores de webhook para integraciones externas
|
||||
</Card>
|
||||
<Card title="Bloque evaluador" href="/yaml/blocks/evaluator">
|
||||
Validación de salidas según criterios y métricas definidos
|
||||
</Card>
|
||||
<Card title="Bloque de flujo de trabajo" href="/yaml/blocks/workflow">
|
||||
Ejecuta otros flujos de trabajo como componentes reutilizables
|
||||
</Card>
|
||||
<Card title="Bloque de respuesta" href="/yaml/blocks/response">
|
||||
Formateo de salida final del flujo de trabajo
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Sintaxis de referencia de bloques
|
||||
|
||||
El aspecto más crítico de los flujos de trabajo YAML es entender cómo referenciar datos entre bloques:
|
||||
|
||||
### Reglas básicas
|
||||
|
||||
1. **Usa el nombre del bloque** (no el ID del bloque) convertido a minúsculas con espacios eliminados
|
||||
2. **Añade la propiedad apropiada** (.content para agentes, .output para herramientas)
|
||||
3. **Cuando uses chat, referencia el bloque inicial** como `<start.input>`
|
||||
|
||||
### Ejemplos
|
||||
|
||||
```yaml
|
||||
# Block definitions
|
||||
email-processor:
|
||||
type: agent
|
||||
name: "Email Agent"
|
||||
# ... configuration
|
||||
|
||||
data-formatter:
|
||||
type: function
|
||||
name: "Data Agent"
|
||||
# ... configuration
|
||||
|
||||
# Referencing their outputs
|
||||
next-block:
|
||||
type: agent
|
||||
name: "Next Step"
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Process this email: <emailagent.content>
|
||||
Use this formatted data: <dataagent.output>
|
||||
Original input: <start.input>
|
||||
```
|
||||
|
||||
### Casos especiales
|
||||
|
||||
- **Variables de bucle**: `<loop.index>`, `<loop.currentItem>`, `<loop.items>`
|
||||
- **Variables paralelas**: `<parallel.index>`, `<parallel.currentItem>`
|
||||
|
||||
## Variables de entorno
|
||||
|
||||
Usa variables de entorno para datos sensibles como claves API:
|
||||
|
||||
```yaml
|
||||
inputs:
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
database: '{{DATABASE_URL}}'
|
||||
token: '{{SLACK_BOT_TOKEN}}'
|
||||
```
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
- **Mantén los nombres de bloques legibles**: "Procesador de correo" para mostrar en la interfaz
|
||||
- **Referencia variables de entorno**: Nunca codifiques claves API directamente
|
||||
- **Estructura para legibilidad**: Agrupa bloques relacionados de manera lógica
|
||||
- **Prueba incrementalmente**: Construye flujos de trabajo paso a paso
|
||||
|
||||
## Próximos pasos
|
||||
|
||||
- [Sintaxis de referencia de bloques](/yaml/block-reference) - Reglas de referencia detalladas
|
||||
- [Esquemas completos de bloques](/yaml/blocks) - Todos los tipos de bloques disponibles
|
||||
- [Ejemplos de flujos de trabajo](/yaml/examples) - Patrones de flujos de trabajo del mundo real
|
||||
250
apps/docs/content/docs/fr/blocks/guardrails.mdx
Normal file
250
apps/docs/content/docs/fr/blocks/guardrails.mdx
Normal file
@@ -0,0 +1,250 @@
|
||||
---
|
||||
title: Guardrails
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Le bloc Guardrails valide et protège vos flux de travail IA en vérifiant le contenu selon plusieurs types de validation. Assurez la qualité des données, prévenez les hallucinations, détectez les PII et imposez des exigences de format avant que le contenu ne circule dans votre flux de travail.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/guardrails.png"
|
||||
alt="Bloc Guardrails"
|
||||
width={500}
|
||||
height={350}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Aperçu
|
||||
|
||||
Le bloc Guardrails vous permet de :
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Valider la structure JSON</strong> : garantir que les sorties LLM sont en JSON valide avant l'analyse
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Correspondre aux modèles Regex</strong> : vérifier que le contenu correspond à des formats spécifiques (emails, numéros de téléphone, URLs, etc.)
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Détecter les hallucinations</strong> : utiliser le scoring RAG + LLM pour valider les sorties IA par rapport au contenu de la base de connaissances
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Détecter les PII</strong> : identifier et éventuellement masquer les informations personnellement identifiables à travers plus de 40 types d'entités
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Types de validation
|
||||
|
||||
### Validation JSON
|
||||
|
||||
Vérifie que le contenu est correctement formaté en JSON. Parfait pour s'assurer que les sorties LLM structurées peuvent être analysées en toute sécurité.
|
||||
|
||||
**Cas d'utilisation :**
|
||||
- Valider les réponses JSON des blocs Agent avant l'analyse
|
||||
- S'assurer que les charges utiles API sont correctement formatées
|
||||
- Vérifier l'intégrité des données structurées
|
||||
|
||||
**Output:**
|
||||
- `passed`: `true` si le JSON est valide, `false` sinon
|
||||
- `error`: Message d'erreur si la validation échoue (par ex., "JSON invalide : Token inattendu...")
|
||||
|
||||
### Validation Regex
|
||||
|
||||
Vérifie si le contenu correspond à un modèle d'expression régulière spécifié.
|
||||
|
||||
**Cas d'utilisation :**
|
||||
- Valider les adresses email
|
||||
- Vérifier les formats de numéros de téléphone
|
||||
- Vérifier les URLs ou identifiants personnalisés
|
||||
- Imposer des modèles de texte spécifiques
|
||||
|
||||
**Configuration :**
|
||||
- **Modèle Regex** : L'expression régulière à faire correspondre (par ex., `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$` pour les emails)
|
||||
|
||||
**Output:**
|
||||
- `passed`: `true` si le contenu correspond au modèle, `false` sinon
|
||||
- `error`: Message d'erreur si la validation échoue
|
||||
|
||||
### Détection d'hallucination
|
||||
|
||||
Utilise la génération augmentée par récupération (RAG) avec notation par LLM pour détecter quand le contenu généré par l'IA contredit ou n'est pas fondé sur votre base de connaissances.
|
||||
|
||||
**Comment ça fonctionne :**
|
||||
1. Interroge votre base de connaissances pour obtenir un contexte pertinent
|
||||
2. Envoie à la fois la sortie de l'IA et le contexte récupéré à un LLM
|
||||
3. Le LLM attribue un score de confiance (échelle de 0 à 10)
|
||||
- **0** = Hallucination complète (totalement non fondée)
|
||||
- **10** = Entièrement fondé (complètement soutenu par la base de connaissances)
|
||||
4. La validation réussit si le score ≥ seuil (par défaut : 3)
|
||||
|
||||
**Configuration :**
|
||||
- **Base de connaissances** : Sélectionnez parmi vos bases de connaissances existantes
|
||||
- **Modèle** : Choisissez un LLM pour la notation (nécessite un raisonnement solide - GPT-4o, Claude 3.7 Sonnet recommandés)
|
||||
- **Clé API** : Authentification pour le fournisseur LLM sélectionné (masquée automatiquement pour les modèles hébergés/Ollama)
|
||||
- **Seuil de confiance** : Score minimum pour réussir (0-10, par défaut : 3)
|
||||
- **Top K** (Avancé) : Nombre de fragments de base de connaissances à récupérer (par défaut : 10)
|
||||
|
||||
**Output:**
|
||||
- `passed`: `true` si le score de confiance ≥ seuil
|
||||
- `score`: Score de confiance (0-10)
|
||||
- `reasoning`: Explication du LLM pour le score
|
||||
- `error`: Message d'erreur si la validation échoue
|
||||
|
||||
**Cas d'utilisation :**
|
||||
- Valider les réponses des agents par rapport à la documentation
|
||||
- Assurer que les réponses du support client sont factuellement exactes
|
||||
- Vérifier que le contenu généré correspond au matériel source
|
||||
- Contrôle qualité pour les applications RAG
|
||||
|
||||
### Détection de PII
|
||||
|
||||
Détecte les informations personnellement identifiables à l'aide de Microsoft Presidio. Prend en charge plus de 40 types d'entités dans plusieurs pays et langues.
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="guardrails.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Comment ça fonctionne :**
|
||||
1. Analyse le contenu pour détecter les entités PII en utilisant la correspondance de modèles et le NLP
|
||||
2. Renvoie les entités détectées avec leurs emplacements et scores de confiance
|
||||
3. Masque optionnellement les PII détectées dans la sortie
|
||||
|
||||
**Configuration :**
|
||||
- **Types de PII à détecter** : Sélectionnez parmi les catégories groupées via le sélecteur modal
|
||||
- **Commun** : Nom de personne, Email, Téléphone, Carte de crédit, Adresse IP, etc.
|
||||
- **USA** : SSN, Permis de conduire, Passeport, etc.
|
||||
- **Royaume-Uni** : Numéro NHS, Numéro d'assurance nationale
|
||||
- **Espagne** : NIF, NIE, CIF
|
||||
- **Italie** : Code fiscal, Permis de conduire, Code TVA
|
||||
- **Pologne** : PESEL, NIP, REGON
|
||||
- **Singapour** : NRIC/FIN, UEN
|
||||
- **Australie** : ABN, ACN, TFN, Medicare
|
||||
- **Inde** : Aadhaar, PAN, Passeport, Numéro d'électeur
|
||||
- **Mode** :
|
||||
- **Détecter** : Identifier uniquement les PII (par défaut)
|
||||
- **Masquer** : Remplacer les PII détectées par des valeurs masquées
|
||||
- **Langue** : Langue de détection (par défaut : anglais)
|
||||
|
||||
**Sortie :**
|
||||
- `passed` : `false` si des types de PII sélectionnés sont détectés
|
||||
- `detectedEntities` : Tableau des PII détectées avec type, emplacement et niveau de confiance
|
||||
- `maskedText` : Contenu avec PII masquées (uniquement si mode = "Mask")
|
||||
- `error` : Message d'erreur si la validation échoue
|
||||
|
||||
**Cas d'utilisation :**
|
||||
- Bloquer le contenu contenant des informations personnelles sensibles
|
||||
- Masquer les PII avant la journalisation ou le stockage des données
|
||||
- Conformité avec le RGPD, HIPAA et autres réglementations sur la confidentialité
|
||||
- Assainir les entrées utilisateur avant traitement
|
||||
|
||||
## Configuration
|
||||
|
||||
### Contenu à valider
|
||||
|
||||
Le contenu d'entrée à valider. Cela provient généralement de :
|
||||
- Sorties de blocs d'agent : `<agent.content>`
|
||||
- Résultats de blocs de fonction : `<function.output>`
|
||||
- Réponses API : `<api.output>`
|
||||
- Toute autre sortie de bloc
|
||||
|
||||
### Type de validation
|
||||
|
||||
Choisissez parmi quatre types de validation :
|
||||
- **JSON valide** : Vérifier si le contenu est au format JSON correctement formaté
|
||||
- **Correspondance Regex** : Vérifier si le contenu correspond à un modèle regex
|
||||
- **Vérification d'hallucination** : Valider par rapport à une base de connaissances avec notation LLM
|
||||
- **Détection de PII** : Détecter et éventuellement masquer les informations personnellement identifiables
|
||||
|
||||
## Sorties
|
||||
|
||||
Tous les types de validation renvoient :
|
||||
|
||||
- **`<guardrails.passed>`** : Booléen indiquant si la validation a réussi
|
||||
- **`<guardrails.validationType>`** : Le type de validation effectuée
|
||||
- **`<guardrails.input>`** : L'entrée originale qui a été validée
|
||||
- **`<guardrails.error>`** : Message d'erreur si la validation a échoué (facultatif)
|
||||
|
||||
Sorties supplémentaires par type :
|
||||
|
||||
**Vérification d'hallucination :**
|
||||
- **`<guardrails.score>`** : Score de confiance (0-10)
|
||||
- **`<guardrails.reasoning>`** : Explication du LLM
|
||||
|
||||
**Détection de PII :**
|
||||
- **`<guardrails.detectedEntities>`** : Tableau des entités PII détectées
|
||||
- **`<guardrails.maskedText>`** : Contenu avec PII masquées (si mode = "Mask")
|
||||
|
||||
## Exemples de cas d'utilisation
|
||||
|
||||
### Valider le JSON avant l'analyse
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scénario : s'assurer que la sortie de l'agent est un JSON valide</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>L'agent génère une réponse JSON structurée</li>
|
||||
<li>Guardrails valide le format JSON</li>
|
||||
<li>Le bloc de condition vérifie `<guardrails.passed>`</li>
|
||||
<li>Si réussi → Analyser et utiliser les données, Si échoué → Réessayer ou gérer l'erreur</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Prévenir les hallucinations
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scénario : valider les réponses du support client</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>L'agent génère une réponse à la question du client</li>
|
||||
<li>Guardrails vérifie par rapport à la base de connaissances de la documentation d'assistance</li>
|
||||
<li>Si le score de confiance ≥ 3 → Envoyer la réponse</li>
|
||||
<li>Si le score de confiance \< 3 → Signaler pour révision humaine</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Bloquer les PII dans les entrées utilisateur
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scénario : assainir le contenu soumis par l'utilisateur</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>L'utilisateur soumet un formulaire avec du contenu textuel</li>
|
||||
<li>Guardrails détecte les PII (emails, numéros de téléphone, numéros de sécurité sociale, etc.)</li>
|
||||
<li>Si PII détectées → Rejeter la soumission ou masquer les données sensibles</li>
|
||||
<li>Si aucune PII → Traiter normalement</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="guardrails-example.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
### Valider le format d'email
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scénario : vérifier le format d'adresse email</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>L'agent extrait l'email du texte</li>
|
||||
<li>Guardrails valide avec un modèle d'expression régulière</li>
|
||||
<li>Si valide → Utiliser l'email pour la notification</li>
|
||||
<li>Si invalide → Demander une correction</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Bonnes pratiques
|
||||
|
||||
- **Chaîner avec des blocs Condition** : Utilisez `<guardrails.passed>` pour créer des branches dans la logique du workflow selon les résultats de validation
|
||||
- **Valider le JSON avant l'analyse** : Toujours valider la structure JSON avant de tenter d'analyser les sorties du LLM
|
||||
- **Choisir les types de PII appropriés** : Sélectionnez uniquement les types d'entités PII pertinents pour votre cas d'utilisation afin d'améliorer les performances
|
||||
- **Définir des seuils de confiance raisonnables** : Pour la détection d'hallucinations, ajustez le seuil selon vos exigences de précision (plus élevé = plus strict)
|
||||
- **Utiliser des modèles performants pour la détection d'hallucinations** : GPT-4o ou Claude 3.7 Sonnet fournissent un score de confiance plus précis
|
||||
- **Masquer les PII pour la journalisation** : Utilisez le mode « Mask » lorsque vous devez journaliser ou stocker du contenu susceptible de contenir des PII
|
||||
- **Tester les modèles regex** : Validez soigneusement vos modèles d'expressions régulières avant de les déployer en production
|
||||
- **Surveiller les échecs de validation** : Suivez les messages `<guardrails.error>` pour identifier les problèmes de validation courants
|
||||
|
||||
<Callout type="info">
|
||||
La validation des guardrails s'effectue de manière synchrone dans votre workflow. Pour la détection d'hallucinations, choisissez des modèles plus rapides (comme GPT-4o-mini) si la latence est critique.
|
||||
</Callout>
|
||||
@@ -535,7 +535,7 @@ app.post('/sim-webhook', (req, res) => {
|
||||
// Handle error...
|
||||
} else {
|
||||
console.log(`Workflow ${workflowId} completed: ${executionId}`);
|
||||
console.log(`Cost: ${cost.total}`);
|
||||
console.log(`Cost: $${cost.total}`);
|
||||
// Process successful execution...
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -183,4 +183,39 @@ Les différents forfaits d'abonnement ont des limites d'utilisation différentes
|
||||
- Examinez votre utilisation actuelle dans [Paramètres → Abonnement](https://sim.ai/settings/subscription)
|
||||
- Apprenez-en plus sur la [Journalisation](/execution/logging) pour suivre les détails d'exécution
|
||||
- Explorez l'[API externe](/execution/api) pour la surveillance programmatique des coûts
|
||||
- Découvrez les [techniques d'optimisation de flux de travail](/blocks) pour réduire les coûts
|
||||
- Découvrez les [techniques d'optimisation de flux de travail](/blocks) pour réduire les coûts
|
||||
|
||||
**Forfait Équipe (40 $/siège/mois) :**
|
||||
- Utilisation mutualisée entre tous les membres de l'équipe
|
||||
- Dépassement calculé sur l'utilisation totale de l'équipe
|
||||
- Le propriétaire de l'organisation reçoit une seule facture
|
||||
|
||||
**Forfaits Entreprise :**
|
||||
- Prix mensuel fixe, sans dépassements
|
||||
- Limites d'utilisation personnalisées selon l'accord
|
||||
|
||||
### Facturation par seuil
|
||||
|
||||
Lorsque le dépassement non facturé atteint 50 $, Sim facture automatiquement le montant total non facturé.
|
||||
|
||||
**Exemple :**
|
||||
- Jour 10 : 70 $ de dépassement → Facturation immédiate de 70 $
|
||||
- Jour 15 : 35 $ d'utilisation supplémentaire (105 $ au total) → Déjà facturé, aucune action
|
||||
- Jour 20 : 50 $ d'utilisation supplémentaire (155 $ au total, 85 $ non facturés) → Facturation immédiate de 85 $
|
||||
|
||||
Cela répartit les frais de dépassement importants tout au long du mois au lieu d'une seule grosse facture en fin de période.
|
||||
|
||||
## Bonnes pratiques de gestion des coûts
|
||||
|
||||
1. **Surveillance régulière** : vérifiez fréquemment votre tableau de bord d'utilisation pour éviter les surprises
|
||||
2. **Définir des budgets** : utilisez les limites du forfait comme garde-fous pour vos dépenses
|
||||
3. **Optimiser les flux de travail** : examinez les exécutions à coût élevé et optimisez les prompts ou la sélection de modèles
|
||||
4. **Utiliser des modèles appropriés** : adaptez la complexité du modèle aux exigences de la tâche
|
||||
5. **Regrouper les tâches similaires** : combinez plusieurs requêtes lorsque c'est possible pour réduire les frais généraux
|
||||
|
||||
## Prochaines étapes
|
||||
|
||||
- Consultez votre utilisation actuelle dans [Paramètres → Abonnement](https://sim.ai/settings/subscription)
|
||||
- Découvrez la [Journalisation](/execution/logging) pour suivre les détails d'exécution
|
||||
- Explorez l'[API externe](/execution/api) pour la surveillance programmatique des coûts
|
||||
- Consultez les [techniques d'optimisation des flux de travail](/blocks) pour réduire les coûts
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: TypeScript/JavaScript SDK
|
||||
title: SDK TypeScript/JavaScript
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
@@ -7,10 +7,10 @@ import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
|
||||
Le SDK officiel TypeScript/JavaScript pour Sim offre une sécurité de type complète et prend en charge les environnements Node.js et navigateur, vous permettant d'exécuter des workflows par programmation depuis vos applications Node.js, applications web et autres environnements JavaScript.
|
||||
Le SDK officiel TypeScript/JavaScript pour Sim offre une sécurité de type complète et prend en charge les environnements Node.js et navigateur, vous permettant d'exécuter des flux de travail par programmation depuis vos applications Node.js, applications web et autres environnements JavaScript.
|
||||
|
||||
<Callout type="info">
|
||||
Le SDK TypeScript offre une sécurité de type complète, la prise en charge de l'exécution asynchrone, une limitation automatique du débit avec backoff exponentiel et le suivi d'utilisation.
|
||||
Le SDK TypeScript fournit une sécurité de type complète, une prise en charge de l'exécution asynchrone, une limitation automatique du débit avec backoff exponentiel et un suivi d'utilisation.
|
||||
</Callout>
|
||||
|
||||
## Installation
|
||||
@@ -43,7 +43,7 @@ Installez le SDK en utilisant votre gestionnaire de paquets préféré :
|
||||
|
||||
## Démarrage rapide
|
||||
|
||||
Voici un exemple simple pour commencer :
|
||||
Voici un exemple simple pour vous aider à démarrer :
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
@@ -74,14 +74,14 @@ new SimStudioClient(config: SimStudioConfig)
|
||||
```
|
||||
|
||||
**Configuration :**
|
||||
- `config.apiKey` (string) : votre clé API Sim
|
||||
- `config.apiKey` (string) : Votre clé API Sim
|
||||
- `config.baseUrl` (string, optionnel) : URL de base pour l'API Sim (par défaut `https://sim.ai`)
|
||||
|
||||
#### Méthodes
|
||||
|
||||
##### executeWorkflow()
|
||||
|
||||
Exécuter un workflow avec des données d'entrée optionnelles.
|
||||
Exécuter un flux de travail avec des données d'entrée optionnelles.
|
||||
|
||||
```typescript
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
@@ -91,17 +91,17 @@ const result = await client.executeWorkflow('workflow-id', {
|
||||
```
|
||||
|
||||
**Paramètres :**
|
||||
- `workflowId` (string) : L'ID du workflow à exécuter
|
||||
- `options` (ExecutionOptions, optionnel) :
|
||||
- `workflowId` (string) : L'identifiant du workflow à exécuter
|
||||
- `options` (ExecutionOptions, facultatif) :
|
||||
- `input` (any) : Données d'entrée à transmettre au workflow
|
||||
- `timeout` (number) : Délai d'expiration en millisecondes (par défaut : 30000)
|
||||
- `stream` (boolean) : Activer les réponses en streaming (par défaut : false)
|
||||
- `selectedOutputs` (string[]) : Bloquer les sorties à diffuser au format `blockName.attribute` (par exemple, `["agent1.content"]`)
|
||||
- `selectedOutputs` (string[]) : Sorties de blocs à diffuser au format `blockName.attribute` (par exemple, `["agent1.content"]`)
|
||||
- `async` (boolean) : Exécuter de manière asynchrone (par défaut : false)
|
||||
|
||||
**Retourne :** `Promise<WorkflowExecutionResult | AsyncExecutionResult>`
|
||||
|
||||
Lorsque `async: true`, retourne immédiatement avec un ID de tâche pour l'interrogation. Sinon, attend la fin de l'exécution.
|
||||
Lorsque `async: true`, retourne immédiatement un identifiant de tâche pour l'interrogation. Sinon, attend la fin de l'exécution.
|
||||
|
||||
##### getWorkflowStatus()
|
||||
|
||||
@@ -113,7 +113,7 @@ console.log('Is deployed:', status.isDeployed);
|
||||
```
|
||||
|
||||
**Paramètres :**
|
||||
- `workflowId` (string) : L'ID du workflow
|
||||
- `workflowId` (string) : L'identifiant du workflow
|
||||
|
||||
**Retourne :** `Promise<WorkflowStatus>`
|
||||
|
||||
@@ -129,7 +129,7 @@ if (isReady) {
|
||||
```
|
||||
|
||||
**Paramètres :**
|
||||
- `workflowId` (string) : L'ID du workflow
|
||||
- `workflowId` (string) : L'identifiant du workflow
|
||||
|
||||
**Retourne :** `Promise<boolean>`
|
||||
|
||||
@@ -146,22 +146,22 @@ if (status.status === 'completed') {
|
||||
```
|
||||
|
||||
**Paramètres :**
|
||||
- `taskId` (string) : L'ID de tâche retourné par l'exécution asynchrone
|
||||
- `taskId` (string) : L'identifiant de tâche retourné par l'exécution asynchrone
|
||||
|
||||
**Retourne :** `Promise<JobStatus>`
|
||||
|
||||
**Champs de réponse :**
|
||||
- `success` (boolean) : Indique si la requête a réussi
|
||||
- `taskId` (string) : L'ID de la tâche
|
||||
- `status` (string) : L'un des statuts suivants : `'queued'`, `'processing'`, `'completed'`, `'failed'`, `'cancelled'`
|
||||
- `metadata` (object) : Contient `startedAt`, `completedAt`, et `duration`
|
||||
- `output` (any, optionnel) : La sortie du workflow (une fois terminé)
|
||||
- `error` (any, optionnel) : Détails de l'erreur (en cas d'échec)
|
||||
- `estimatedDuration` (number, optionnel) : Durée estimée en millisecondes (lorsqu'en traitement/en file d'attente)
|
||||
- `taskId` (string) : L'identifiant de la tâche
|
||||
- `status` (string) : L'un des états suivants : `'queued'`, `'processing'`, `'completed'`, `'failed'`, `'cancelled'`
|
||||
- `metadata` (object) : Contient `startedAt`, `completedAt` et `duration`
|
||||
- `output` (any, facultatif) : La sortie du workflow (une fois terminé)
|
||||
- `error` (any, facultatif) : Détails de l'erreur (en cas d'échec)
|
||||
- `estimatedDuration` (number, facultatif) : Durée estimée en millisecondes (lorsqu'en traitement/en file d'attente)
|
||||
|
||||
##### executeWithRetry()
|
||||
|
||||
Exécute un workflow avec une nouvelle tentative automatique en cas d'erreurs de limite de débit en utilisant un backoff exponentiel.
|
||||
Exécuter un workflow avec une nouvelle tentative automatique en cas d'erreurs de limitation de débit, en utilisant un backoff exponentiel.
|
||||
|
||||
```typescript
|
||||
const result = await client.executeWithRetry('workflow-id', {
|
||||
@@ -186,11 +186,11 @@ const result = await client.executeWithRetry('workflow-id', {
|
||||
|
||||
**Retourne :** `Promise<WorkflowExecutionResult | AsyncExecutionResult>`
|
||||
|
||||
La logique de nouvelle tentative utilise un backoff exponentiel (1s → 2s → 4s → 8s...) avec une variation aléatoire de ±25 % pour éviter l'effet de rafale. Si l'API fournit un en-tête `retry-after`, celui-ci sera utilisé à la place.
|
||||
La logique de nouvelle tentative utilise un backoff exponentiel (1s → 2s → 4s → 8s...) avec une variation aléatoire de ±25 % pour éviter l'effet de horde. Si l'API fournit un en-tête `retry-after`, celui-ci sera utilisé à la place.
|
||||
|
||||
##### getRateLimitInfo()
|
||||
|
||||
Obtient les informations actuelles sur les limites de débit à partir de la dernière réponse de l'API.
|
||||
Obtenir les informations actuelles de limitation de débit à partir de la dernière réponse de l'API.
|
||||
|
||||
```typescript
|
||||
const rateLimitInfo = client.getRateLimitInfo();
|
||||
@@ -205,7 +205,7 @@ if (rateLimitInfo) {
|
||||
|
||||
##### getUsageLimits()
|
||||
|
||||
Obtient les limites d'utilisation actuelles et les informations de quota pour votre compte.
|
||||
Obtenir les limites d'utilisation actuelles et les informations de quota pour votre compte.
|
||||
|
||||
```typescript
|
||||
const limits = await client.getUsageLimits();
|
||||
@@ -247,7 +247,7 @@ console.log('Plan:', limits.usage.plan);
|
||||
|
||||
##### setApiKey()
|
||||
|
||||
Met à jour la clé API.
|
||||
Mettre à jour la clé API.
|
||||
|
||||
```typescript
|
||||
client.setApiKey('new-api-key');
|
||||
@@ -255,7 +255,7 @@ client.setApiKey('new-api-key');
|
||||
|
||||
##### setBaseUrl()
|
||||
|
||||
Met à jour l'URL de base.
|
||||
Mettre à jour l'URL de base.
|
||||
|
||||
```typescript
|
||||
client.setBaseUrl('https://my-custom-domain.com');
|
||||
@@ -356,7 +356,7 @@ class SimStudioError extends Error {
|
||||
|
||||
**Codes d'erreur courants :**
|
||||
- `UNAUTHORIZED` : Clé API invalide
|
||||
- `TIMEOUT` : Délai d'attente de la requête dépassé
|
||||
- `TIMEOUT` : Délai d'attente dépassé
|
||||
- `RATE_LIMIT_EXCEEDED` : Limite de débit dépassée
|
||||
- `USAGE_LIMIT_EXCEEDED` : Limite d'utilisation dépassée
|
||||
- `EXECUTION_ERROR` : Échec de l'exécution du workflow
|
||||
@@ -501,7 +501,7 @@ Configurez le client en utilisant des variables d'environnement :
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Intégration avec Express de Node.js
|
||||
### Intégration avec Node.js Express
|
||||
|
||||
Intégration avec un serveur Express.js :
|
||||
|
||||
@@ -604,26 +604,105 @@ async function executeClientSideWorkflow() {
|
||||
});
|
||||
|
||||
console.log('Workflow result:', result);
|
||||
|
||||
|
||||
// Update UI with result
|
||||
document.getElementById('result')!.textContent =
|
||||
document.getElementById('result')!.textContent =
|
||||
JSON.stringify(result.output, null, 2);
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Attach to button click
|
||||
document.getElementById('executeBtn')?.addEventListener('click', executeClientSideWorkflow);
|
||||
```
|
||||
|
||||
### Téléchargement de fichiers
|
||||
|
||||
Les objets File sont automatiquement détectés et convertis au format base64. Incluez-les dans votre entrée sous le nom de champ correspondant au format d'entrée du déclencheur API de votre workflow.
|
||||
|
||||
Le SDK convertit les objets File dans ce format :
|
||||
|
||||
```typescript
|
||||
{
|
||||
type: 'file',
|
||||
data: 'data:mime/type;base64,base64data',
|
||||
name: 'filename',
|
||||
mime: 'mime/type'
|
||||
}
|
||||
```
|
||||
|
||||
Alternativement, vous pouvez fournir manuellement des fichiers en utilisant le format URL :
|
||||
|
||||
```typescript
|
||||
{
|
||||
type: 'url',
|
||||
data: 'https://example.com/file.pdf',
|
||||
name: 'file.pdf',
|
||||
mime: 'application/pdf'
|
||||
}
|
||||
```
|
||||
|
||||
<Tabs items={['Browser', 'Node.js']}>
|
||||
<Tab value="Browser">
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
|
||||
const client = new SimStudioClient({
|
||||
apiKey: process.env.NEXT_PUBLIC_SIM_API_KEY!
|
||||
});
|
||||
|
||||
// From file input
|
||||
async function handleFileUpload(event: Event) {
|
||||
const input = event.target as HTMLInputElement;
|
||||
const files = Array.from(input.files || []);
|
||||
|
||||
// Include files under the field name from your API trigger's input format
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
input: {
|
||||
documents: files, // Must match your workflow's "files" field name
|
||||
instructions: 'Analyze these documents'
|
||||
}
|
||||
});
|
||||
|
||||
console.log('Result:', result);
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="Node.js">
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
import fs from 'fs';
|
||||
|
||||
const client = new SimStudioClient({
|
||||
apiKey: process.env.SIM_API_KEY!
|
||||
});
|
||||
|
||||
// Read file and create File object
|
||||
const fileBuffer = fs.readFileSync('./document.pdf');
|
||||
const file = new File([fileBuffer], 'document.pdf', {
|
||||
type: 'application/pdf'
|
||||
});
|
||||
|
||||
// Include files under the field name from your API trigger's input format
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
input: {
|
||||
documents: [file], // Must match your workflow's "files" field name
|
||||
query: 'Summarize this document'
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Callout type="warning">
|
||||
Lors de l'utilisation du SDK dans le navigateur, veillez à ne pas exposer de clés API sensibles. Envisagez d'utiliser un proxy backend ou des clés API publiques avec des permissions limitées.
|
||||
Lorsque vous utilisez le SDK dans le navigateur, faites attention à ne pas exposer des clés API sensibles. Envisagez d'utiliser un proxy backend ou des clés API publiques avec des permissions limitées.
|
||||
</Callout>
|
||||
|
||||
### Exemple de hook React
|
||||
|
||||
Créer un hook React personnalisé pour l'exécution de workflow :
|
||||
Créez un hook React personnalisé pour l'exécution du workflow :
|
||||
|
||||
```typescript
|
||||
import { useState, useCallback } from 'react';
|
||||
@@ -699,9 +778,9 @@ function WorkflowComponent() {
|
||||
}
|
||||
```
|
||||
|
||||
### Exécution asynchrone de workflow
|
||||
### Exécution asynchrone du workflow
|
||||
|
||||
Exécuter des workflows de manière asynchrone pour les tâches de longue durée :
|
||||
Exécutez des workflows de manière asynchrone pour les tâches de longue durée :
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient, AsyncExecutionResult } from 'simstudio-ts-sdk';
|
||||
@@ -750,7 +829,7 @@ executeAsync();
|
||||
|
||||
### Limitation de débit et nouvelle tentative
|
||||
|
||||
Gérer automatiquement les limites de débit avec backoff exponentiel :
|
||||
Gérez automatiquement les limites de débit avec un backoff exponentiel :
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient, SimStudioError } from 'simstudio-ts-sdk';
|
||||
@@ -786,9 +865,9 @@ async function executeWithRetryHandling() {
|
||||
}
|
||||
```
|
||||
|
||||
### Surveillance d'utilisation
|
||||
### Surveillance de l'utilisation
|
||||
|
||||
Surveiller l'utilisation et les limites de votre compte :
|
||||
Surveillez l'utilisation et les limites de votre compte :
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
@@ -815,11 +894,27 @@ async function checkUsage() {
|
||||
console.log(' Is limited:', limits.rateLimit.async.isLimited);
|
||||
|
||||
console.log('\n=== Usage ===');
|
||||
console.log('Current period cost:
|
||||
console.log('Current period cost: $' + limits.usage.currentPeriodCost.toFixed(2));
|
||||
console.log('Limit: $' + limits.usage.limit.toFixed(2));
|
||||
console.log('Plan:', limits.usage.plan);
|
||||
|
||||
### Streaming Workflow Execution
|
||||
const percentUsed = (limits.usage.currentPeriodCost / limits.usage.limit) * 100;
|
||||
console.log('Usage: ' + percentUsed.toFixed(1) + '%');
|
||||
|
||||
Execute workflows with real-time streaming responses:
|
||||
if (percentUsed > 80) {
|
||||
console.warn('⚠️ Warning: You are approaching your usage limit!');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error checking usage:', error);
|
||||
}
|
||||
}
|
||||
|
||||
checkUsage();
|
||||
```
|
||||
|
||||
### Exécution de workflow en streaming
|
||||
|
||||
Exécutez des workflows avec des réponses en streaming en temps réel :
|
||||
|
||||
```typescript
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
@@ -830,33 +925,33 @@ const client = new SimStudioClient({
|
||||
|
||||
async function executeWithStreaming() {
|
||||
try {
|
||||
// Activer le streaming pour des sorties de blocs spécifiques
|
||||
// Enable streaming for specific block outputs
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
input: { message: 'Compter jusqu'à cinq' },
|
||||
input: { message: 'Count to five' },
|
||||
stream: true,
|
||||
selectedOutputs: ['agent1.content'] // Utiliser le format blockName.attribute
|
||||
selectedOutputs: ['agent1.content'] // Use blockName.attribute format
|
||||
});
|
||||
|
||||
console.log('Résultat du workflow :', result);
|
||||
console.log('Workflow result:', result);
|
||||
} catch (error) {
|
||||
console.error('Erreur :', error);
|
||||
console.error('Error:', error);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The streaming response follows the Server-Sent Events (SSE) format:
|
||||
La réponse en streaming suit le format Server-Sent Events (SSE) :
|
||||
|
||||
```
|
||||
data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":"One"}
|
||||
|
||||
data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":", deux"}
|
||||
data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":", two"}
|
||||
|
||||
data: {"event":"done","success":true,"output":{},"metadata":{"duration":610}}
|
||||
|
||||
data: [DONE]
|
||||
```
|
||||
|
||||
**React Streaming Example:**
|
||||
**Exemple de streaming avec React :**
|
||||
|
||||
```typescript
|
||||
import { useState, useEffect } from 'react';
|
||||
@@ -920,7 +1015,7 @@ function StreamingWorkflow() {
|
||||
return (
|
||||
<div>
|
||||
<button onClick={executeStreaming} disabled={loading}>
|
||||
{loading ? 'Génération en cours...' : 'Démarrer le streaming'}
|
||||
{loading ? 'Generating...' : 'Start Streaming'}
|
||||
</button>
|
||||
<div style={{ whiteSpace: 'pre-wrap' }}>{output}</div>
|
||||
</div>
|
||||
@@ -928,64 +1023,35 @@ function StreamingWorkflow() {
|
||||
}
|
||||
```
|
||||
|
||||
## Getting Your API Key
|
||||
## Obtenir votre clé API
|
||||
|
||||
<Steps>
|
||||
<Step title="Log in to Sim">
|
||||
Navigate to [Sim](https://sim.ai) and log in to your account.
|
||||
<Step title="Connectez-vous à Sim">
|
||||
Accédez à [Sim](https://sim.ai) et connectez-vous à votre compte.
|
||||
</Step>
|
||||
<Step title="Open your workflow">
|
||||
Navigate to the workflow you want to execute programmatically.
|
||||
<Step title="Ouvrez votre workflow">
|
||||
Accédez au workflow que vous souhaitez exécuter par programmation.
|
||||
</Step>
|
||||
<Step title="Deploy your workflow">
|
||||
Click on "Deploy" to deploy your workflow if it hasn't been deployed yet.
|
||||
<Step title="Déployez votre workflow">
|
||||
Cliquez sur "Déployer" pour déployer votre workflow s'il n'a pas encore été déployé.
|
||||
</Step>
|
||||
<Step title="Create or select an API key">
|
||||
During the deployment process, select or create an API key.
|
||||
<Step title="Créez ou sélectionnez une clé API">
|
||||
Pendant le processus de déploiement, sélectionnez ou créez une clé API.
|
||||
</Step>
|
||||
<Step title="Copy the API key">
|
||||
Copy the API key to use in your TypeScript/JavaScript application.
|
||||
<Step title="Copiez la clé API">
|
||||
Copiez la clé API pour l'utiliser dans votre application TypeScript/JavaScript.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Callout type="warning">
|
||||
Keep your API key secure and never commit it to version control. Use environment variables or secure configuration management.
|
||||
Gardez votre clé API en sécurité et ne la publiez jamais dans un système de contrôle de version. Utilisez des variables d'environnement ou une gestion sécurisée de configuration.
|
||||
</Callout>
|
||||
|
||||
## Requirements
|
||||
## Prérequis
|
||||
|
||||
- Node.js 16+
|
||||
- TypeScript 5.0+ (for TypeScript projects)
|
||||
|
||||
## TypeScript Support
|
||||
|
||||
The SDK is written in TypeScript and provides full type safety:
|
||||
|
||||
```typescript
|
||||
import {
|
||||
SimStudioClient,
|
||||
WorkflowExecutionResult,
|
||||
WorkflowStatus,
|
||||
SimStudioError
|
||||
} from 'simstudio-ts-sdk';
|
||||
|
||||
// Type-safe client initialization
|
||||
const client: SimStudioClient = new SimStudioClient({
|
||||
apiKey: process.env.SIM_API_KEY!
|
||||
});
|
||||
|
||||
// Type-safe workflow execution
|
||||
const result: WorkflowExecutionResult = await client.executeWorkflow('workflow-id', {
|
||||
input: {
|
||||
message: 'Bonjour, TypeScript !'
|
||||
}
|
||||
});
|
||||
|
||||
// Type-safe status checking
|
||||
const status: WorkflowStatus = await client.getWorkflowStatus('workflow-id');
|
||||
```
|
||||
|
||||
## License
|
||||
- TypeScript 5.0+ (pour les projets TypeScript)
|
||||
|
||||
## Licence
|
||||
|
||||
Apache-2.0
|
||||
|
||||
@@ -23,7 +23,210 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
## Notes
|
||||
## Aperçu
|
||||
|
||||
Le bloc Webhook générique vous permet de recevoir des webhooks depuis n'importe quel service externe. C'est un déclencheur flexible qui peut traiter n'importe quelle charge utile JSON, ce qui le rend idéal pour l'intégration avec des services qui n'ont pas de bloc Sim dédié.
|
||||
|
||||
## Utilisation de base
|
||||
|
||||
### Mode de transmission simple
|
||||
|
||||
Sans définir un format d'entrée, le webhook transmet l'intégralité du corps de la requête tel quel :
|
||||
|
||||
```bash
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"message": "Test webhook trigger",
|
||||
"data": {
|
||||
"key": "value"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
Accédez aux données dans les blocs en aval en utilisant :
|
||||
- `<webhook1.message>` → "Test webhook trigger"
|
||||
- `<webhook1.data.key>` → "value"
|
||||
|
||||
### Format d'entrée structuré (optionnel)
|
||||
|
||||
Définissez un schéma d'entrée pour obtenir des champs typés et activer des fonctionnalités avancées comme les téléchargements de fichiers :
|
||||
|
||||
**Configuration du format d'entrée :**
|
||||
|
||||
```json
|
||||
[
|
||||
{ "name": "message", "type": "string" },
|
||||
{ "name": "priority", "type": "number" },
|
||||
{ "name": "documents", "type": "files" }
|
||||
]
|
||||
```
|
||||
|
||||
**Requête webhook :**
|
||||
|
||||
```bash
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"message": "Invoice submission",
|
||||
"priority": 1,
|
||||
"documents": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:application/pdf;base64,JVBERi0xLjQK...",
|
||||
"name": "invoice.pdf",
|
||||
"mime": "application/pdf"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
## Téléchargements de fichiers
|
||||
|
||||
### Formats de fichiers pris en charge
|
||||
|
||||
Le webhook prend en charge deux formats d'entrée de fichiers :
|
||||
|
||||
#### 1. Fichiers encodés en Base64
|
||||
Pour télécharger directement le contenu du fichier :
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA...",
|
||||
"name": "screenshot.png",
|
||||
"mime": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- **Taille maximale** : 20 Mo par fichier
|
||||
- **Format** : URL de données standard avec encodage base64
|
||||
- **Stockage** : Les fichiers sont téléchargés dans un stockage d'exécution sécurisé
|
||||
|
||||
#### 2. Références URL
|
||||
Pour transmettre des URL de fichiers existants :
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [
|
||||
{
|
||||
"type": "url",
|
||||
"data": "https://example.com/files/document.pdf",
|
||||
"name": "document.pdf",
|
||||
"mime": "application/pdf"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Accès aux fichiers dans les blocs en aval
|
||||
|
||||
Les fichiers sont traités en objets `UserFile` avec les propriétés suivantes :
|
||||
|
||||
```typescript
|
||||
{
|
||||
id: string, // Unique file identifier
|
||||
name: string, // Original filename
|
||||
url: string, // Presigned URL (valid for 5 minutes)
|
||||
size: number, // File size in bytes
|
||||
type: string, // MIME type
|
||||
key: string, // Storage key
|
||||
uploadedAt: string, // ISO timestamp
|
||||
expiresAt: string // ISO timestamp (5 minutes)
|
||||
}
|
||||
```
|
||||
|
||||
**Accès dans les blocs :**
|
||||
- `<webhook1.documents[0].url>` → URL de téléchargement
|
||||
- `<webhook1.documents[0].name>` → "invoice.pdf"
|
||||
- `<webhook1.documents[0].size>` → 524288
|
||||
- `<webhook1.documents[0].type>` → "application/pdf"
|
||||
|
||||
### Exemple complet de téléchargement de fichier
|
||||
|
||||
```bash
|
||||
# Create a base64-encoded file
|
||||
echo "Hello World" | base64
|
||||
# SGVsbG8gV29ybGQK
|
||||
|
||||
# Send webhook with file
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret" \
|
||||
-d '{
|
||||
"subject": "Document for review",
|
||||
"attachments": [
|
||||
{
|
||||
"type": "file",
|
||||
"data": "data:text/plain;base64,SGVsbG8gV29ybGQK",
|
||||
"name": "sample.txt",
|
||||
"mime": "text/plain"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
## Authentification
|
||||
|
||||
### Configurer l'authentification (facultatif)
|
||||
|
||||
Dans la configuration du webhook :
|
||||
1. Activez "Exiger l'authentification"
|
||||
2. Définissez un jeton secret
|
||||
3. Choisissez le type d'en-tête :
|
||||
- **En-tête personnalisé** : `X-Sim-Secret: your-token`
|
||||
- **Autorisation Bearer** : `Authorization: Bearer your-token`
|
||||
|
||||
### Utilisation de l'authentification
|
||||
|
||||
```bash
|
||||
# With custom header
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Sim-Secret: your-secret-token" \
|
||||
-d '{"message": "Authenticated request"}'
|
||||
|
||||
# With bearer token
|
||||
curl -X POST https://sim.ai/api/webhooks/trigger/{webhook-path} \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer your-secret-token" \
|
||||
-d '{"message": "Authenticated request"}'
|
||||
```
|
||||
|
||||
## Bonnes pratiques
|
||||
|
||||
1. **Utilisez le format d'entrée pour la structure** : définissez un format d'entrée lorsque vous connaissez le schéma attendu. Cela fournit :
|
||||
- Validation de type
|
||||
- Meilleure autocomplétion dans l'éditeur
|
||||
- Capacités de téléchargement de fichiers
|
||||
|
||||
2. **Authentification** : activez toujours l'authentification pour les webhooks de production afin d'empêcher les accès non autorisés.
|
||||
|
||||
3. **Limites de taille de fichier** : gardez les fichiers sous 20 Mo. Pour les fichiers plus volumineux, utilisez plutôt des références URL.
|
||||
|
||||
4. **Expiration des fichiers** : les fichiers téléchargés ont des URL d'expiration de 5 minutes. Traitez-les rapidement ou stockez-les ailleurs si vous en avez besoin plus longtemps.
|
||||
|
||||
5. **Gestion des erreurs** : le traitement des webhooks est asynchrone. Vérifiez les journaux d'exécution pour les erreurs.
|
||||
|
||||
6. **Tests** : utilisez le bouton "Tester le webhook" dans l'éditeur pour valider votre configuration avant le déploiement.
|
||||
|
||||
## Cas d'utilisation
|
||||
|
||||
- **Soumissions de formulaires** : recevez des données de formulaires personnalisés avec téléchargements de fichiers
|
||||
- **Intégrations tierces** : connectez-vous à des services qui envoient des webhooks (Stripe, GitHub, etc.)
|
||||
- **Traitement de documents** : acceptez des documents de systèmes externes pour traitement
|
||||
- **Notifications d'événements** : recevez des données d'événements de diverses sources
|
||||
- **API personnalisées** : créez des points de terminaison API personnalisés pour vos applications
|
||||
|
||||
## Remarques
|
||||
|
||||
- Catégorie : `triggers`
|
||||
- Type : `generic_webhook`
|
||||
- **Support de fichiers** : disponible via la configuration du format d'entrée
|
||||
- **Taille maximale de fichier** : 20 Mo par fichier
|
||||
|
||||
@@ -61,9 +61,9 @@ Rechercher du contenu similaire dans une base de connaissances en utilisant la s
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ---------- | ----------- |
|
||||
| `knowledgeBaseId` | chaîne | Oui | ID de la base de connaissances dans laquelle effectuer la recherche |
|
||||
| `query` | chaîne | Non | Texte de la requête de recherche \(facultatif lors de l'utilisation de filtres par tags\) |
|
||||
| `query` | chaîne | Non | Texte de la requête de recherche \(facultatif lors de l'utilisation de filtres de tags\) |
|
||||
| `topK` | nombre | Non | Nombre de résultats les plus similaires à retourner \(1-100\) |
|
||||
| `tagFilters` | quelconque | Non | Tableau de filtres de tags avec les propriétés tagName et tagValue |
|
||||
| `tagFilters` | tableau | Non | Tableau de filtres de tags avec les propriétés tagName et tagValue |
|
||||
|
||||
#### Sortie
|
||||
|
||||
|
||||
@@ -108,20 +108,22 @@ Lire le contenu d'un chat Microsoft Teams
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ---------- | ----------- |
|
||||
| `chatId` | chaîne | Oui | L'ID du chat à lire |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `chatId` | chaîne | Oui | L'ID de la conversation à partir de laquelle lire |
|
||||
| `includeAttachments` | booléen | Non | Télécharger et inclure les pièces jointes des messages \(contenus hébergés\) dans le stockage |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `success` | booléen | Statut de réussite de l'opération de lecture du chat Teams |
|
||||
| `messageCount` | nombre | Nombre de messages récupérés du chat |
|
||||
| `chatId` | chaîne | ID du chat qui a été lu |
|
||||
| `messages` | tableau | Tableau d'objets de messages de chat |
|
||||
| `success` | booléen | Statut de réussite de l'opération de lecture de la conversation Teams |
|
||||
| `messageCount` | nombre | Nombre de messages récupérés de la conversation |
|
||||
| `chatId` | chaîne | ID de la conversation qui a été lue |
|
||||
| `messages` | tableau | Tableau d'objets de messages de conversation |
|
||||
| `attachmentCount` | nombre | Nombre total de pièces jointes trouvées |
|
||||
| `attachmentTypes` | tableau | Types de pièces jointes trouvées |
|
||||
| `content` | chaîne | Contenu formaté des messages de chat |
|
||||
| `content` | chaîne | Contenu formaté des messages de conversation |
|
||||
| `attachments` | fichier[] | Pièces jointes téléchargées pour plus de commodité \(aplaties\) |
|
||||
|
||||
### `microsoft_teams_write_chat`
|
||||
|
||||
@@ -155,6 +157,7 @@ Lire le contenu d'un canal Microsoft Teams
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `teamId` | chaîne | Oui | L'ID de l'équipe à partir de laquelle lire |
|
||||
| `channelId` | chaîne | Oui | L'ID du canal à partir duquel lire |
|
||||
| `includeAttachments` | booléen | Non | Télécharger et inclure les pièces jointes des messages \(contenus hébergés\) dans le stockage |
|
||||
|
||||
#### Sortie
|
||||
|
||||
@@ -162,12 +165,13 @@ Lire le contenu d'un canal Microsoft Teams
|
||||
| --------- | ---- | ----------- |
|
||||
| `success` | booléen | Statut de réussite de l'opération de lecture du canal Teams |
|
||||
| `messageCount` | nombre | Nombre de messages récupérés du canal |
|
||||
| `teamId` | chaîne | ID de l'équipe à partir de laquelle la lecture a été effectuée |
|
||||
| `channelId` | chaîne | ID du canal à partir duquel la lecture a été effectuée |
|
||||
| `teamId` | chaîne | ID de l'équipe qui a été lue |
|
||||
| `channelId` | chaîne | ID du canal qui a été lu |
|
||||
| `messages` | tableau | Tableau d'objets de messages du canal |
|
||||
| `attachmentCount` | nombre | Nombre total de pièces jointes trouvées |
|
||||
| `attachmentTypes` | tableau | Types de pièces jointes trouvées |
|
||||
| `content` | chaîne | Contenu formaté des messages du canal |
|
||||
| `attachments` | fichier[] | Pièces jointes téléchargées pour plus de commodité \(aplaties\) |
|
||||
|
||||
### `microsoft_teams_write_channel`
|
||||
|
||||
|
||||
@@ -200,16 +200,18 @@ Lire des e-mails depuis Outlook
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| --------- | ---- | ---------- | ----------- |
|
||||
| `folder` | string | Non | ID du dossier pour lire les e-mails \(par défaut : Boîte de réception\) |
|
||||
| `maxResults` | number | Non | Nombre maximum d'e-mails à récupérer \(par défaut : 1, max : 10\) |
|
||||
| `includeAttachments` | boolean | Non | Télécharger et inclure les pièces jointes des e-mails |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Message de succès ou d'état |
|
||||
| `results` | array | Tableau d'objets de messages électroniques |
|
||||
| `message` | string | Message de succès ou de statut |
|
||||
| `results` | array | Tableau d'objets de messages e-mail |
|
||||
| `attachments` | file[] | Toutes les pièces jointes des e-mails regroupées de tous les e-mails |
|
||||
|
||||
### `outlook_forward`
|
||||
|
||||
|
||||
@@ -109,10 +109,10 @@ Insérer des données dans une table Supabase
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `projectId` | string | Oui | L'ID de votre projet Supabase (ex. : jdrkgepadsdopsntdlom) |
|
||||
| `table` | string | Oui | Le nom de la table Supabase dans laquelle insérer les données |
|
||||
| `data` | any | Oui | Les données à insérer |
|
||||
| `apiKey` | string | Oui | Votre clé secrète de rôle de service Supabase |
|
||||
| `projectId` | chaîne | Oui | L'ID de votre projet Supabase (ex. : jdrkgepadsdopsntdlom) |
|
||||
| `table` | chaîne | Oui | Le nom de la table Supabase dans laquelle insérer des données |
|
||||
| `data` | tableau | Oui | Les données à insérer (tableau d'objets ou un seul objet) |
|
||||
| `apiKey` | chaîne | Oui | Votre clé secrète de rôle de service Supabase |
|
||||
|
||||
#### Sortie
|
||||
|
||||
@@ -190,10 +190,10 @@ Insérer ou mettre à jour des données dans une table Supabase (opération upse
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `projectId` | string | Oui | L'ID de votre projet Supabase \(ex. : jdrkgepadsdopsntdlom\) |
|
||||
| `table` | string | Oui | Le nom de la table Supabase dans laquelle insérer ou mettre à jour des données |
|
||||
| `data` | any | Oui | Les données à insérer ou mettre à jour \(upsert\) |
|
||||
| `apiKey` | string | Oui | Votre clé secrète de rôle de service Supabase |
|
||||
| `projectId` | chaîne | Oui | L'ID de votre projet Supabase (ex. : jdrkgepadsdopsntdlom) |
|
||||
| `table` | chaîne | Oui | Le nom de la table Supabase dans laquelle upserter des données |
|
||||
| `data` | tableau | Oui | Les données à upserter (insérer ou mettre à jour) - tableau d'objets ou un seul objet |
|
||||
| `apiKey` | chaîne | Oui | Votre clé secrète de rôle de service Supabase |
|
||||
|
||||
#### Sortie
|
||||
|
||||
|
||||
@@ -87,12 +87,108 @@ Envoyez des messages aux canaux ou utilisateurs Telegram via l'API Bot Telegram.
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `success` | boolean | Statut de succès d'envoi du message Telegram |
|
||||
| `messageId` | number | Identifiant unique du message Telegram |
|
||||
| `chatId` | string | ID du chat cible où le message a été envoyé |
|
||||
| `text` | string | Contenu textuel du message envoyé |
|
||||
| `timestamp` | number | Horodatage Unix lorsque le message a été envoyé |
|
||||
| `from` | object | Informations sur le bot qui a envoyé le message |
|
||||
| `message` | chaîne | Message de succès ou d'erreur |
|
||||
| `data` | objet | Données du message Telegram |
|
||||
|
||||
## Notes
|
||||
|
||||
- Catégorie : `tools`
|
||||
- Type : `telegram`
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `botToken` | chaîne | Oui | Votre jeton d'API Bot Telegram |
|
||||
| `chatId` | chaîne | Oui | ID du chat Telegram cible |
|
||||
| `messageId` | chaîne | Oui | ID du message à supprimer |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | chaîne | Message de succès ou d'erreur |
|
||||
| `data` | objet | Résultat de l'opération de suppression |
|
||||
|
||||
### `telegram_send_photo`
|
||||
|
||||
Envoyez des photos aux canaux ou utilisateurs Telegram via l'API Bot Telegram.
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `botToken` | chaîne | Oui | Votre jeton d'API Bot Telegram |
|
||||
| `chatId` | chaîne | Oui | ID du chat Telegram cible |
|
||||
| `photo` | chaîne | Oui | Photo à envoyer. Passez un file_id ou une URL HTTP |
|
||||
| `caption` | chaîne | Non | Légende de la photo \(facultatif\) |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | chaîne | Message de succès ou d'erreur |
|
||||
| `data` | objet | Données du message Telegram incluant la/les photo(s) facultative(s) |
|
||||
|
||||
### `telegram_send_video`
|
||||
|
||||
Envoyez des vidéos aux canaux ou utilisateurs Telegram via l'API Bot Telegram.
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `botToken` | chaîne | Oui | Votre jeton d'API Bot Telegram |
|
||||
| `chatId` | chaîne | Oui | ID du chat Telegram cible |
|
||||
| `video` | chaîne | Oui | Vidéo à envoyer. Passez un file_id ou une URL HTTP |
|
||||
| `caption` | chaîne | Non | Légende de la vidéo \(facultatif\) |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Message de succès ou d'erreur |
|
||||
| `data` | object | Données du message Telegram incluant les médias optionnels |
|
||||
|
||||
### `telegram_send_audio`
|
||||
|
||||
Envoyez des fichiers audio aux canaux ou utilisateurs Telegram via l'API Bot Telegram.
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `botToken` | chaîne | Oui | Votre jeton d'API Bot Telegram |
|
||||
| `chatId` | chaîne | Oui | ID du chat Telegram cible |
|
||||
| `audio` | chaîne | Oui | Fichier audio à envoyer. Passez un file_id ou une URL HTTP |
|
||||
| `caption` | chaîne | Non | Légende audio \(facultatif\) |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Message de succès ou d'erreur |
|
||||
| `data` | object | Données du message Telegram incluant les informations vocales/audio |
|
||||
|
||||
### `telegram_send_animation`
|
||||
|
||||
Envoyez des animations (GIF) aux canaux ou utilisateurs Telegram via l'API Bot Telegram.
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `botToken` | chaîne | Oui | Votre jeton d'API Bot Telegram |
|
||||
| `chatId` | chaîne | Oui | ID du chat Telegram cible |
|
||||
| `animation` | chaîne | Oui | Animation à envoyer. Passez un file_id ou une URL HTTP |
|
||||
| `caption` | chaîne | Non | Légende de l'animation \(facultatif\) |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | chaîne | Message de succès ou d'erreur |
|
||||
| `data` | objet | Données du message Telegram incluant les médias optionnels |
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: YouTube
|
||||
description: Rechercher des vidéos sur YouTube
|
||||
description: Interagir avec les vidéos, chaînes et playlists YouTube
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
@@ -39,7 +39,7 @@ Dans Sim, l'intégration YouTube permet à vos agents de rechercher et d'analyse
|
||||
|
||||
## Instructions d'utilisation
|
||||
|
||||
Intégrer YouTube dans le flux de travail. Peut rechercher des vidéos. Nécessite une clé API.
|
||||
Intégrez YouTube dans le flux de travail. Permet de rechercher des vidéos, obtenir les détails d'une vidéo, obtenir des informations sur une chaîne, obtenir les éléments d'une playlist et obtenir les commentaires d'une vidéo.
|
||||
|
||||
## Outils
|
||||
|
||||
@@ -61,6 +61,99 @@ Recherchez des vidéos sur YouTube en utilisant l'API YouTube Data.
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | tableau | Tableau de vidéos YouTube correspondant à la requête de recherche |
|
||||
|
||||
### `youtube_video_details`
|
||||
|
||||
Obtenir des informations détaillées sur une vidéo YouTube spécifique.
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `videoId` | chaîne | Oui | ID de la vidéo YouTube |
|
||||
| `apiKey` | chaîne | Oui | Clé API YouTube |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `videoId` | chaîne | ID de la vidéo YouTube |
|
||||
| `title` | chaîne | Titre de la vidéo |
|
||||
| `description` | chaîne | Description de la vidéo |
|
||||
| `channelId` | chaîne | ID de la chaîne |
|
||||
| `channelTitle` | chaîne | Nom de la chaîne |
|
||||
| `publishedAt` | chaîne | Date et heure de publication |
|
||||
| `duration` | chaîne | Durée de la vidéo au format ISO 8601 |
|
||||
| `viewCount` | nombre | Nombre de vues |
|
||||
| `likeCount` | nombre | Nombre de j'aime |
|
||||
| `commentCount` | nombre | Nombre de commentaires |
|
||||
| `thumbnail` | chaîne | URL de la miniature de la vidéo |
|
||||
| `tags` | tableau | Tags de la vidéo |
|
||||
|
||||
### `youtube_channel_info`
|
||||
|
||||
Obtenir des informations détaillées sur une chaîne YouTube.
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `channelId` | chaîne | Non | ID de la chaîne YouTube \(utilisez soit channelId soit username\) |
|
||||
| `username` | chaîne | Non | Nom d'utilisateur de la chaîne YouTube \(utilisez soit channelId soit username\) |
|
||||
| `apiKey` | chaîne | Oui | Clé API YouTube |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `channelId` | chaîne | ID de la chaîne YouTube |
|
||||
| `title` | chaîne | Nom de la chaîne |
|
||||
| `description` | chaîne | Description de la chaîne |
|
||||
| `subscriberCount` | nombre | Nombre d'abonnés |
|
||||
| `videoCount` | nombre | Nombre de vidéos |
|
||||
| `viewCount` | nombre | Nombre total de vues de la chaîne |
|
||||
| `publishedAt` | chaîne | Date de création de la chaîne |
|
||||
| `thumbnail` | chaîne | URL de la miniature de la chaîne |
|
||||
| `customUrl` | chaîne | URL personnalisée de la chaîne |
|
||||
|
||||
### `youtube_playlist_items`
|
||||
|
||||
Obtenir des vidéos d'une playlist YouTube.
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `playlistId` | chaîne | Oui | ID de la playlist YouTube |
|
||||
| `maxResults` | nombre | Non | Nombre maximum de vidéos à retourner |
|
||||
| `pageToken` | chaîne | Non | Jeton de page pour la pagination |
|
||||
| `apiKey` | chaîne | Oui | Clé API YouTube |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | tableau | Tableau de vidéos dans la playlist |
|
||||
|
||||
### `youtube_comments`
|
||||
|
||||
Obtenir les commentaires d'une vidéo YouTube.
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `videoId` | chaîne | Oui | ID de la vidéo YouTube |
|
||||
| `maxResults` | nombre | Non | Nombre maximum de commentaires à retourner |
|
||||
| `order` | chaîne | Non | Ordre des commentaires : time (chronologique) ou relevance (pertinence) |
|
||||
| `pageToken` | chaîne | Non | Jeton de page pour la pagination |
|
||||
| `apiKey` | chaîne | Oui | Clé API YouTube |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `items` | tableau | Tableau de commentaires de la vidéo |
|
||||
|
||||
## Notes
|
||||
|
||||
- Catégorie : `tools`
|
||||
|
||||
242
apps/docs/content/docs/fr/tools/zep.mdx
Normal file
242
apps/docs/content/docs/fr/tools/zep.mdx
Normal file
@@ -0,0 +1,242 @@
|
||||
---
|
||||
title: Zep
|
||||
description: Mémoire à long terme pour les agents IA
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="zep"
|
||||
color="#E8E8E8"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
viewBox='0 0 233 196'
|
||||
|
||||
|
||||
>
|
||||
<path
|
||||
d='m231.34,108.7l-1.48-1.55h-10.26l3.59-75.86-14.8-.45-2.77,49.31c-59.6-3.24-119.33-3.24-178.92-.02l-1.73-64.96-14.8.45,2.5,91.53H2.16l-1.41,1.47c-1.55,16.23-.66,32.68,2.26,48.89h10.83l.18,1.27c.67,19.34,16.1,34.68,35.9,34.68s44.86-.92,66.12-.92,46.56.92,65.95.92,35.19-15.29,35.9-34.61l.16-1.34h11.02c2.91-16.19,3.81-32.61,2.26-48.81Zm-158.23,58.01c-17.27,0-30.25-13.78-30.25-29.78s12.99-29.78,30.25-29.78,29.62,13.94,29.62,29.94-12.35,29.62-29.62,29.62Zm86.51,0c-17.27,0-30.25-13.78-30.25-29.78s12.99-29.78,30.25-29.78,29.62,13.94,29.62,29.94-12.35,29.62-29.62,29.62Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<polygon
|
||||
points='111.77 22.4 93.39 49.97 93.52 50.48 185.88 38.51 190.95 27.68 114.32 36.55 117.7 31.48 117.7 31.47 138.38 .49 138.25 0 47.67 11.6 42.85 22.27 118.34 12.61 111.77 22.4'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<path
|
||||
d='m72.97,121.47c-8.67,0-15.73,6.93-15.73,15.46s7.06,15.46,15.73,15.46,15.37-6.75,15.37-15.37-6.75-15.55-15.37-15.55Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
<path
|
||||
d='m159.48,121.47c-8.67,0-15.73,6.93-15.73,15.46s7.06,15.46,15.73,15.46,15.37-6.75,15.37-15.37-6.75-15.55-15.37-15.55Z'
|
||||
fill='#FF1493'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
## Instructions d'utilisation
|
||||
|
||||
Intégrez Zep pour la gestion de la mémoire à long terme. Créez des fils de discussion, ajoutez des messages, récupérez du contexte avec des résumés générés par IA et extraction de faits.
|
||||
|
||||
## Outils
|
||||
|
||||
### `zep_create_thread`
|
||||
|
||||
Démarrer un nouveau fil de conversation dans Zep
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Oui | Identifiant unique pour le fil de discussion |
|
||||
| `userId` | string | Oui | ID utilisateur associé au fil de discussion |
|
||||
| `apiKey` | string | Oui | Votre clé API Zep |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threadId` | string | L'ID du fil de discussion |
|
||||
| `userId` | string | L'ID utilisateur |
|
||||
| `uuid` | string | UUID interne |
|
||||
| `createdAt` | string | Horodatage de création |
|
||||
| `projectUuid` | string | UUID du projet |
|
||||
|
||||
### `zep_get_threads`
|
||||
|
||||
Lister tous les fils de conversation
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `pageSize` | number | Non | Nombre de fils à récupérer par page |
|
||||
| `pageNumber` | number | Non | Numéro de page pour la pagination |
|
||||
| `orderBy` | string | Non | Champ pour ordonner les résultats \(created_at, updated_at, user_id, thread_id\) |
|
||||
| `asc` | boolean | Non | Direction de tri : true pour ascendant, false pour descendant |
|
||||
| `apiKey` | string | Oui | Votre clé API Zep |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threads` | array | Tableau d'objets de fil de discussion |
|
||||
| `responseCount` | number | Nombre de fils de discussion dans cette réponse |
|
||||
| `totalCount` | number | Nombre total de fils de discussion disponibles |
|
||||
|
||||
### `zep_delete_thread`
|
||||
|
||||
Supprimer un fil de conversation de Zep
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Oui | ID du fil de discussion à supprimer |
|
||||
| `apiKey` | string | Oui | Votre clé API Zep |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `deleted` | boolean | Indique si le fil de discussion a été supprimé |
|
||||
|
||||
### `zep_get_context`
|
||||
|
||||
Récupérer le contexte utilisateur d'un fil de discussion en mode résumé ou basique
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `threadId` | string | Oui | ID du fil de discussion pour obtenir le contexte |
|
||||
| `mode` | string | Non | Mode de contexte : "summary" \(langage naturel\) ou "basic" \(faits bruts\) |
|
||||
| `minRating` | number | Non | Note minimale pour filtrer les faits pertinents |
|
||||
| `apiKey` | string | Oui | Votre clé API Zep |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `context` | string | La chaîne de contexte \(résumé ou basique\) |
|
||||
| `facts` | array | Faits extraits |
|
||||
| `entities` | array | Entités extraites |
|
||||
| `summary` | string | Résumé de la conversation |
|
||||
|
||||
### `zep_get_messages`
|
||||
|
||||
Récupérer les messages d'un fil de discussion
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `threadId` | chaîne | Oui | ID du fil de discussion pour récupérer les messages |
|
||||
| `limit` | nombre | Non | Nombre maximum de messages à renvoyer |
|
||||
| `cursor` | chaîne | Non | Curseur pour la pagination |
|
||||
| `lastn` | nombre | Non | Nombre de messages les plus récents à renvoyer \(remplace la limite et le curseur\) |
|
||||
| `apiKey` | chaîne | Oui | Votre clé API Zep |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `messages` | tableau | Tableau d'objets message |
|
||||
| `rowCount` | nombre | Nombre de messages dans cette réponse |
|
||||
| `totalCount` | nombre | Nombre total de messages dans le fil de discussion |
|
||||
|
||||
### `zep_add_messages`
|
||||
|
||||
Ajouter des messages à un fil de discussion existant
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `threadId` | chaîne | Oui | ID du fil de discussion auquel ajouter des messages |
|
||||
| `messages` | json | Oui | Tableau d'objets message avec rôle et contenu |
|
||||
| `apiKey` | chaîne | Oui | Votre clé API Zep |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `context` | chaîne | Contexte mis à jour après l'ajout des messages |
|
||||
| `messageIds` | tableau | Tableau des UUID des messages ajoutés |
|
||||
| `threadId` | chaîne | L'ID du fil de discussion |
|
||||
|
||||
### `zep_add_user`
|
||||
|
||||
Créer un nouvel utilisateur dans Zep
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `userId` | string | Oui | Identifiant unique pour l'utilisateur |
|
||||
| `email` | string | Non | Adresse e-mail de l'utilisateur |
|
||||
| `firstName` | string | Non | Prénom de l'utilisateur |
|
||||
| `lastName` | string | Non | Nom de famille de l'utilisateur |
|
||||
| `metadata` | json | Non | Métadonnées supplémentaires sous forme d'objet JSON |
|
||||
| `apiKey` | string | Oui | Votre clé API Zep |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `userId` | string | L'identifiant de l'utilisateur |
|
||||
| `email` | string | E-mail de l'utilisateur |
|
||||
| `firstName` | string | Prénom de l'utilisateur |
|
||||
| `lastName` | string | Nom de famille de l'utilisateur |
|
||||
| `uuid` | string | UUID interne |
|
||||
| `createdAt` | string | Horodatage de création |
|
||||
| `metadata` | object | Métadonnées de l'utilisateur |
|
||||
|
||||
### `zep_get_user`
|
||||
|
||||
Récupérer les informations d'un utilisateur depuis Zep
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `userId` | string | Oui | ID de l'utilisateur à récupérer |
|
||||
| `apiKey` | string | Oui | Votre clé API Zep |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `userId` | string | L'identifiant de l'utilisateur |
|
||||
| `email` | string | E-mail de l'utilisateur |
|
||||
| `firstName` | string | Prénom de l'utilisateur |
|
||||
| `lastName` | string | Nom de famille de l'utilisateur |
|
||||
| `uuid` | string | UUID interne |
|
||||
| `createdAt` | string | Horodatage de création |
|
||||
| `updatedAt` | string | Horodatage de dernière mise à jour |
|
||||
| `metadata` | object | Métadonnées de l'utilisateur |
|
||||
|
||||
### `zep_get_user_threads`
|
||||
|
||||
Lister tous les fils de conversation pour un utilisateur spécifique
|
||||
|
||||
#### Entrée
|
||||
|
||||
| Paramètre | Type | Obligatoire | Description |
|
||||
| --------- | ---- | ----------- | ----------- |
|
||||
| `userId` | chaîne | Oui | ID de l'utilisateur pour lequel obtenir les fils |
|
||||
| `limit` | nombre | Non | Nombre maximum de fils à retourner |
|
||||
| `apiKey` | chaîne | Oui | Votre clé API Zep |
|
||||
|
||||
#### Sortie
|
||||
|
||||
| Paramètre | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `threads` | tableau | Tableau d'objets de fils pour cet utilisateur |
|
||||
| `userId` | chaîne | L'ID de l'utilisateur |
|
||||
|
||||
## Notes
|
||||
|
||||
- Catégorie : `tools`
|
||||
- Type : `zep`
|
||||
@@ -128,3 +128,60 @@ Si aucun format d'entrée n'est défini, l'exécuteur expose uniquement le JSON
|
||||
<Callout type="warning">
|
||||
Un workflow ne peut contenir qu'un seul déclencheur API. Publiez un nouveau déploiement après les modifications pour que le point de terminaison reste à jour.
|
||||
</Callout>
|
||||
|
||||
### Format de téléchargement de fichiers
|
||||
|
||||
L'API accepte les fichiers dans deux formats :
|
||||
|
||||
**1. Fichiers encodés en Base64** (recommandé pour les SDK) :
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [{
|
||||
"type": "file",
|
||||
"data": "data:application/pdf;base64,JVBERi0xLjQK...",
|
||||
"name": "document.pdf",
|
||||
"mime": "application/pdf"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
- Taille maximale de fichier : 20 Mo par fichier
|
||||
- Les fichiers sont téléchargés vers le stockage cloud et convertis en objets UserFile avec toutes les propriétés
|
||||
|
||||
**2. Références URL directes** :
|
||||
|
||||
```json
|
||||
{
|
||||
"documents": [{
|
||||
"type": "url",
|
||||
"data": "https://example.com/document.pdf",
|
||||
"name": "document.pdf",
|
||||
"mime": "application/pdf"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
- Le fichier n'est pas téléchargé, l'URL est transmise directement
|
||||
- Utile pour référencer des fichiers existants
|
||||
|
||||
### Propriétés des fichiers
|
||||
|
||||
Pour les fichiers, accédez à toutes les propriétés :
|
||||
|
||||
| Propriété | Description | Type |
|
||||
|----------|-------------|------|
|
||||
| `<api.fieldName[0].url>` | URL de téléchargement signée | chaîne |
|
||||
| `<api.fieldName[0].name>` | Nom de fichier original | chaîne |
|
||||
| `<api.fieldName[0].size>` | Taille du fichier en octets | nombre |
|
||||
| `<api.fieldName[0].type>` | Type MIME | chaîne |
|
||||
| `<api.fieldName[0].uploadedAt>` | Horodatage du téléchargement (ISO 8601) | chaîne |
|
||||
| `<api.fieldName[0].expiresAt>` | Horodatage d'expiration de l'URL (ISO 8601) | chaîne |
|
||||
|
||||
Pour les fichiers référencés par URL, les mêmes propriétés sont disponibles à l'exception de `uploadedAt` et `expiresAt` puisque le fichier n'est pas téléchargé vers notre stockage.
|
||||
|
||||
Si aucun format d'entrée n'est défini, l'exécuteur expose uniquement le JSON brut à `<api.input>`.
|
||||
|
||||
<Callout type="warning">
|
||||
Un flux de travail ne peut contenir qu'un seul déclencheur API. Publiez un nouveau déploiement après les modifications pour que le point de terminaison reste à jour.
|
||||
</Callout>
|
||||
|
||||
@@ -41,3 +41,11 @@ Les fichiers incluent `name`, `mimeType`, et un `url` signé.
|
||||
<Callout type="info">
|
||||
Le constructeur bloque plusieurs blocs Déclencheur de chat dans le même flux de travail.
|
||||
</Callout>
|
||||
|
||||
1. Ajoutez un bloc Déclencheur de Chat par workflow.
|
||||
2. Déployez le workflow en mode chat.
|
||||
3. Partagez le lien de déploiement—chaque réponse réutilise l'ID de conversation pour que le workflow puisse conserver le contexte.
|
||||
|
||||
<Callout type="info">
|
||||
Le constructeur bloque plusieurs blocs Déclencheur de Chat dans le même workflow.
|
||||
</Callout>
|
||||
|
||||
@@ -1,242 +0,0 @@
|
||||
---
|
||||
title: Syntaxe de référence de bloc
|
||||
description: Comment référencer des données entre les blocs dans les workflows YAML
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
|
||||
Les références de bloc sont le fondement du flux de données dans les workflows Sim. Comprendre comment référencer correctement les sorties d'un bloc comme entrées d'un autre est essentiel pour créer des workflows fonctionnels.
|
||||
|
||||
## Règles de référence de base
|
||||
|
||||
### 1. Utilisez les noms de bloc, pas les identifiants de bloc
|
||||
|
||||
<Tabs items={['Correct', 'Incorrect']}>
|
||||
<Tab>
|
||||
|
||||
```yaml
|
||||
# Block definition
|
||||
email-sender:
|
||||
type: agent
|
||||
name: "Email Generator"
|
||||
# ... configuration
|
||||
|
||||
# Reference the block
|
||||
next-block:
|
||||
inputs:
|
||||
userPrompt: "Process this: <emailgenerator.content>"
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```yaml
|
||||
# Block definition
|
||||
email-sender:
|
||||
type: agent
|
||||
name: "Email Generator"
|
||||
# ... configuration
|
||||
|
||||
# ❌ Don't reference by block ID
|
||||
next-block:
|
||||
inputs:
|
||||
userPrompt: "Process this: <email-sender.content>"
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### 2. Convertir les noms au format de référence
|
||||
|
||||
Pour créer une référence de bloc :
|
||||
|
||||
1. **Prenez le nom du bloc** : « Email Generator »
|
||||
2. **Convertissez en minuscules** : « email generator »
|
||||
3. **Supprimez les espaces et les caractères spéciaux** : « emailgenerator »
|
||||
4. **Ajoutez la propriété** : `<emailgenerator.content>`
|
||||
|
||||
### 3. Utilisez les propriétés correctes
|
||||
|
||||
Différents types de blocs exposent différentes propriétés :
|
||||
|
||||
- **Blocs d'agent** : `.content` (la réponse de l'IA)
|
||||
- **Blocs de fonction** : `.output` (la valeur de retour)
|
||||
- **Blocs d'API** : `.output` (les données de réponse)
|
||||
- **Blocs d'outil** : `.output` (le résultat de l'outil)
|
||||
|
||||
## Exemples de référence
|
||||
|
||||
### Références de bloc courantes
|
||||
|
||||
```yaml
|
||||
# Agent block outputs
|
||||
<agentname.content> # Primary AI response
|
||||
<agentname.tokens> # Token usage information
|
||||
<agentname.cost> # Estimated cost
|
||||
<agentname.tool_calls> # Tool execution details
|
||||
|
||||
# Function block outputs
|
||||
<functionname.output> # Function return value
|
||||
<functionname.error> # Error information (if any)
|
||||
|
||||
# API block outputs
|
||||
<apiname.output> # Response data
|
||||
<apiname.status> # HTTP status code
|
||||
<apiname.headers> # Response headers
|
||||
|
||||
# Tool block outputs
|
||||
<toolname.output> # Tool execution result
|
||||
```
|
||||
|
||||
### Noms de bloc à plusieurs mots
|
||||
|
||||
```yaml
|
||||
# Block name: "Data Processor 2"
|
||||
<dataprocessor2.output>
|
||||
|
||||
# Block name: "Email Validation Service"
|
||||
<emailvalidationservice.output>
|
||||
|
||||
# Block name: "Customer Info Agent"
|
||||
<customerinfoagent.content>
|
||||
```
|
||||
|
||||
## Cas de référence spéciaux
|
||||
|
||||
### Bloc de démarrage
|
||||
|
||||
<Callout type="warning">
|
||||
Le bloc de démarrage est toujours référencé comme `<start.input>` quel que soit son nom réel.
|
||||
</Callout>
|
||||
|
||||
```yaml
|
||||
# Starter block definition
|
||||
my-custom-start:
|
||||
type: starter
|
||||
name: "Custom Workflow Start"
|
||||
# ... configuration
|
||||
|
||||
# Always reference as 'start'
|
||||
agent-1:
|
||||
inputs:
|
||||
userPrompt: <start.input> # ✅ Correct
|
||||
# userPrompt: <customworkflowstart.input> # ❌ Wrong
|
||||
```
|
||||
|
||||
### Variables de boucle
|
||||
|
||||
À l'intérieur des blocs de boucle, des variables spéciales sont disponibles :
|
||||
|
||||
```yaml
|
||||
# Available in loop child blocks
|
||||
<loop.index> # Current iteration (0-based)
|
||||
<loop.currentItem> # Current item being processed (forEach loops)
|
||||
<loop.items> # Full collection (forEach loops)
|
||||
```
|
||||
|
||||
### Variables parallèles
|
||||
|
||||
À l'intérieur des blocs parallèles, des variables spéciales sont disponibles :
|
||||
|
||||
```yaml
|
||||
# Available in parallel child blocks
|
||||
<parallel.index> # Instance number (0-based)
|
||||
<parallel.currentItem> # Item for this instance
|
||||
<parallel.items> # Full collection
|
||||
```
|
||||
|
||||
## Exemples de références complexes
|
||||
|
||||
### Accès aux données imbriquées
|
||||
|
||||
Lors de la référence à des objets complexes, utilisez la notation par points :
|
||||
|
||||
```yaml
|
||||
# If an agent returns structured data
|
||||
data-analyzer:
|
||||
type: agent
|
||||
name: "Data Analyzer"
|
||||
inputs:
|
||||
responseFormat: |
|
||||
{
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"analysis": {"type": "object"},
|
||||
"summary": {"type": "string"},
|
||||
"metrics": {"type": "object"}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Reference nested properties
|
||||
next-step:
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Summary: <dataanalyzer.analysis.summary>
|
||||
Score: <dataanalyzer.metrics.score>
|
||||
Full data: <dataanalyzer.content>
|
||||
```
|
||||
|
||||
### Références multiples dans le texte
|
||||
|
||||
```yaml
|
||||
email-composer:
|
||||
type: agent
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Create an email with the following information:
|
||||
|
||||
Customer: <customeragent.content>
|
||||
Order Details: <orderprocessor.output>
|
||||
Support Ticket: <ticketanalyzer.content>
|
||||
|
||||
Original request: <start.input>
|
||||
```
|
||||
|
||||
### Références dans les blocs de code
|
||||
|
||||
Lorsque vous utilisez des références dans des blocs de fonction, elles sont remplacées par des valeurs JavaScript :
|
||||
|
||||
```yaml
|
||||
data-processor:
|
||||
type: function
|
||||
inputs:
|
||||
code: |
|
||||
// References are replaced with actual values
|
||||
const customerData = <customeragent.content>;
|
||||
const orderInfo = <orderprocessor.output>;
|
||||
const originalInput = <start.input>;
|
||||
|
||||
// Process the data
|
||||
return {
|
||||
customer: customerData.name,
|
||||
orderId: orderInfo.id,
|
||||
processed: true
|
||||
};
|
||||
```
|
||||
|
||||
## Validation des références
|
||||
|
||||
Sim valide toutes les références lors de l'importation de YAML :
|
||||
|
||||
### Références valides
|
||||
- Le bloc existe dans le flux de travail
|
||||
- La propriété est appropriée pour le type de bloc
|
||||
- Pas de dépendances circulaires
|
||||
- Formatage syntaxique correct
|
||||
|
||||
### Erreurs courantes
|
||||
- **Bloc introuvable** : le bloc référencé n'existe pas
|
||||
- **Propriété incorrecte** : utilisation de `.content` sur un bloc de fonction
|
||||
- **Fautes de frappe** : noms de blocs ou propriétés mal orthographiés
|
||||
- **Références circulaires** : un bloc se référence lui-même directement ou indirectement
|
||||
|
||||
## Bonnes pratiques
|
||||
|
||||
1. **Utilisez des noms de blocs descriptifs** : rend les références plus lisibles
|
||||
2. **Soyez cohérent** : utilisez la même convention de nommage partout
|
||||
3. **Vérifiez les références** : assurez-vous que tous les blocs référencés existent
|
||||
4. **Évitez l'imbrication profonde** : gardez les chaînes de référence gérables
|
||||
5. **Documentez les flux complexes** : ajoutez des commentaires pour expliquer les relations entre références
|
||||
@@ -1,218 +0,0 @@
|
||||
---
|
||||
title: Schéma YAML des blocs Agent
|
||||
description: Référence de configuration YAML pour les blocs Agent
|
||||
---
|
||||
|
||||
## Définition du schéma
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [agent]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this agent block
|
||||
inputs:
|
||||
type: object
|
||||
properties:
|
||||
systemPrompt:
|
||||
type: string
|
||||
description: Instructions that define the agent's role and behavior
|
||||
userPrompt:
|
||||
type: string
|
||||
description: Input content to process (can reference other blocks)
|
||||
model:
|
||||
type: string
|
||||
description: AI model identifier (e.g., gpt-4o, gemini-2.5-pro, deepseek-chat)
|
||||
temperature:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 2
|
||||
description: Response creativity level (varies by model)
|
||||
apiKey:
|
||||
type: string
|
||||
description: API key for the model provider (use {{ENV_VAR}} format)
|
||||
azureEndpoint:
|
||||
type: string
|
||||
description: Azure OpenAI endpoint URL (required for Azure models)
|
||||
azureApiVersion:
|
||||
type: string
|
||||
description: Azure API version (required for Azure models)
|
||||
memories:
|
||||
type: string
|
||||
description: Memory context from memory blocks
|
||||
tools:
|
||||
type: array
|
||||
description: List of external tools the agent can use
|
||||
items:
|
||||
type: object
|
||||
required: [type, title, toolId, operation, usageControl]
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
description: Tool type identifier
|
||||
title:
|
||||
type: string
|
||||
description: Human-readable display name
|
||||
toolId:
|
||||
type: string
|
||||
description: Internal tool identifier
|
||||
operation:
|
||||
type: string
|
||||
description: Tool operation/method name
|
||||
usageControl:
|
||||
type: string
|
||||
enum: [auto, required, none]
|
||||
description: When AI can use the tool
|
||||
params:
|
||||
type: object
|
||||
description: Tool-specific configuration parameters
|
||||
isExpanded:
|
||||
type: boolean
|
||||
description: UI state
|
||||
default: false
|
||||
responseFormat:
|
||||
type: object
|
||||
description: JSON Schema to enforce structured output
|
||||
required:
|
||||
- model
|
||||
- apiKey
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful execution
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Configuration des outils
|
||||
|
||||
Les outils sont définis comme un tableau où chaque outil a cette structure :
|
||||
|
||||
```yaml
|
||||
tools:
|
||||
- type: <string> # Tool type identifier (exa, gmail, slack, etc.)
|
||||
title: <string> # Human-readable display name
|
||||
toolId: <string> # Internal tool identifier
|
||||
operation: <string> # Tool operation/method name
|
||||
usageControl: <string> # When AI can use it (auto | required | none)
|
||||
params: <object> # Tool-specific configuration parameters
|
||||
isExpanded: <boolean> # UI state (optional, default: false)
|
||||
```
|
||||
|
||||
## Configuration des connexions
|
||||
|
||||
Les connexions définissent où le flux de travail se dirige en fonction des résultats d'exécution :
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful execution
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Exemples
|
||||
|
||||
### Agent basique
|
||||
|
||||
```yaml
|
||||
content-agent:
|
||||
type: agent
|
||||
name: "Content Analyzer 1"
|
||||
inputs:
|
||||
systemPrompt: "You are a helpful content analyzer. Be concise and clear."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
temperature: 0.3
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: summary-block
|
||||
|
||||
summary-block:
|
||||
type: agent
|
||||
name: "Summary Generator"
|
||||
inputs:
|
||||
systemPrompt: "Create a brief summary of the analysis."
|
||||
userPrompt: "Analyze this: <contentanalyzer1.content>"
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
connections:
|
||||
success: final-step
|
||||
```
|
||||
|
||||
### Agent avec outils
|
||||
|
||||
```yaml
|
||||
research-agent:
|
||||
type: agent
|
||||
name: "Research Assistant"
|
||||
inputs:
|
||||
systemPrompt: "Research the topic and provide detailed information."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
tools:
|
||||
- type: exa
|
||||
title: "Web Search"
|
||||
toolId: exa_search
|
||||
operation: exa_search
|
||||
usageControl: auto
|
||||
params:
|
||||
apiKey: '{{EXA_API_KEY}}'
|
||||
connections:
|
||||
success: summary-block
|
||||
```
|
||||
|
||||
### Sortie structurée
|
||||
|
||||
```yaml
|
||||
data-extractor:
|
||||
type: agent
|
||||
name: "Extract Contact Info"
|
||||
inputs:
|
||||
systemPrompt: "Extract contact information from the text."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
responseFormat: |
|
||||
{
|
||||
"name": "contact_extraction",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"email": {"type": "string"},
|
||||
"phone": {"type": "string"}
|
||||
},
|
||||
"required": ["name"]
|
||||
},
|
||||
"strict": true
|
||||
}
|
||||
connections:
|
||||
success: save-contact
|
||||
```
|
||||
|
||||
### Azure OpenAI
|
||||
|
||||
```yaml
|
||||
azure-agent:
|
||||
type: agent
|
||||
name: "Azure AI Assistant"
|
||||
inputs:
|
||||
systemPrompt: "You are a helpful assistant."
|
||||
userPrompt: <start.input>
|
||||
model: gpt-4o
|
||||
apiKey: '{{AZURE_OPENAI_API_KEY}}'
|
||||
azureEndpoint: '{{AZURE_OPENAI_ENDPOINT}}'
|
||||
azureApiVersion: "2024-07-01-preview"
|
||||
connections:
|
||||
success: response-block
|
||||
```
|
||||
@@ -1,429 +0,0 @@
|
||||
---
|
||||
title: Schéma YAML du bloc API
|
||||
description: Référence de configuration YAML pour les blocs API
|
||||
---
|
||||
|
||||
## Définition du schéma
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [api]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this API block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- url
|
||||
- method
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
description: The endpoint URL to send the request to
|
||||
method:
|
||||
type: string
|
||||
enum: [GET, POST, PUT, DELETE, PATCH]
|
||||
description: HTTP method for the request
|
||||
default: GET
|
||||
params:
|
||||
type: array
|
||||
description: Query parameters as table entries
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- cells
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the parameter entry
|
||||
cells:
|
||||
type: object
|
||||
required:
|
||||
- Key
|
||||
- Value
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Parameter name
|
||||
Value:
|
||||
type: string
|
||||
description: Parameter value
|
||||
headers:
|
||||
type: array
|
||||
description: HTTP headers as table entries
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- cells
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier for the header entry
|
||||
cells:
|
||||
type: object
|
||||
required:
|
||||
- Key
|
||||
- Value
|
||||
properties:
|
||||
Key:
|
||||
type: string
|
||||
description: Header name
|
||||
Value:
|
||||
type: string
|
||||
description: Header value
|
||||
body:
|
||||
type: string
|
||||
description: Request body for POST/PUT/PATCH methods
|
||||
timeout:
|
||||
type: number
|
||||
description: Request timeout in milliseconds
|
||||
default: 30000
|
||||
minimum: 1000
|
||||
maximum: 300000
|
||||
connections:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: string
|
||||
description: Target block ID for successful requests
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
```
|
||||
|
||||
## Configuration de connexion
|
||||
|
||||
Les connexions définissent où le flux de travail se dirige en fonction des résultats de la requête :
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
success: <string> # Target block ID for successful requests
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## Exemples
|
||||
|
||||
### Requête GET simple
|
||||
|
||||
```yaml
|
||||
user-api:
|
||||
type: api
|
||||
name: "Fetch User Data"
|
||||
inputs:
|
||||
url: "https://api.example.com/users/123"
|
||||
method: GET
|
||||
headers:
|
||||
- id: header-1-uuid-here
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{API_TOKEN}}"
|
||||
- id: header-2-uuid-here
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
connections:
|
||||
success: process-user-data
|
||||
error: handle-api-error
|
||||
```
|
||||
|
||||
### Requête POST avec corps
|
||||
|
||||
```yaml
|
||||
create-ticket:
|
||||
type: api
|
||||
name: "Create Support Ticket"
|
||||
inputs:
|
||||
url: "https://api.support.com/tickets"
|
||||
method: POST
|
||||
headers:
|
||||
- id: auth-header-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{SUPPORT_API_KEY}}"
|
||||
- id: content-type-uuid
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
body: |
|
||||
{
|
||||
"title": "<agent.title>",
|
||||
"description": "<agent.description>",
|
||||
"priority": "high"
|
||||
}
|
||||
connections:
|
||||
success: ticket-created
|
||||
error: ticket-error
|
||||
```
|
||||
|
||||
### URL dynamique avec paramètres de requête
|
||||
|
||||
```yaml
|
||||
search-api:
|
||||
type: api
|
||||
name: "Search Products"
|
||||
inputs:
|
||||
url: "https://api.store.com/products"
|
||||
method: GET
|
||||
params:
|
||||
- id: search-param-uuid
|
||||
cells:
|
||||
Key: "q"
|
||||
Value: <start.searchTerm>
|
||||
- id: limit-param-uuid
|
||||
cells:
|
||||
Key: "limit"
|
||||
Value: "10"
|
||||
- id: category-param-uuid
|
||||
cells:
|
||||
Key: "category"
|
||||
Value: <filter.category>
|
||||
headers:
|
||||
- id: auth-header-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{STORE_API_KEY}}"
|
||||
connections:
|
||||
success: display-results
|
||||
```
|
||||
|
||||
## Format des paramètres
|
||||
|
||||
Les en-têtes et les paramètres (paramètres de requête) utilisent le format de tableau avec la structure suivante :
|
||||
|
||||
```yaml
|
||||
headers:
|
||||
- id: unique-identifier-here
|
||||
cells:
|
||||
Key: "Content-Type"
|
||||
Value: "application/json"
|
||||
- id: another-unique-identifier
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer {{API_TOKEN}}"
|
||||
|
||||
params:
|
||||
- id: param-identifier-here
|
||||
cells:
|
||||
Key: "limit"
|
||||
Value: "10"
|
||||
```
|
||||
|
||||
**Détails de la structure :**
|
||||
- `id` : identifiant unique pour suivre la ligne du tableau
|
||||
- `cells.Key` : le nom du paramètre/en-tête
|
||||
- `cells.Value` : la valeur du paramètre/en-tête
|
||||
- Ce format permet une gestion appropriée des tableaux et la préservation de l'état de l'interface utilisateur
|
||||
|
||||
## Références de sortie
|
||||
|
||||
Après l'exécution d'un bloc API, vous pouvez référencer ses sorties dans les blocs suivants. Le bloc API fournit trois sorties principales :
|
||||
|
||||
### Sorties disponibles
|
||||
|
||||
| Sortie | Type | Description |
|
||||
|--------|------|-------------|
|
||||
| `data` | any | Le corps/charge utile de la réponse de l'API |
|
||||
| `status` | number | Code de statut HTTP (200, 404, 500, etc.) |
|
||||
| `headers` | object | En-têtes de réponse renvoyés par le serveur |
|
||||
|
||||
### Exemples d'utilisation
|
||||
|
||||
```yaml
|
||||
# Reference API response data
|
||||
process-data:
|
||||
type: function
|
||||
name: "Process API Data"
|
||||
inputs:
|
||||
code: |
|
||||
const responseData = <fetchuserdata.data>;
|
||||
const statusCode = <fetchuserdata.status>;
|
||||
const responseHeaders = <fetchuserdata.headers>;
|
||||
|
||||
if (statusCode === 200) {
|
||||
return {
|
||||
success: true,
|
||||
user: responseData,
|
||||
contentType: responseHeaders['content-type']
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
success: false,
|
||||
error: `API call failed with status ${statusCode}`
|
||||
};
|
||||
}
|
||||
|
||||
# Use API data in an agent block
|
||||
analyze-response:
|
||||
type: agent
|
||||
name: "Analyze Response"
|
||||
inputs:
|
||||
userPrompt: |
|
||||
Analyze this API response:
|
||||
|
||||
Status: <fetchuserdata.status>
|
||||
Data: <fetchuserdata.data>
|
||||
|
||||
Provide insights about the response.
|
||||
|
||||
# Conditional logic based on status
|
||||
check-status:
|
||||
type: condition
|
||||
name: "Check API Status"
|
||||
inputs:
|
||||
condition: <fetchuserdata.status> === 200
|
||||
connections:
|
||||
true: success-handler
|
||||
false: error-handler
|
||||
```
|
||||
|
||||
### Exemple pratique
|
||||
|
||||
```yaml
|
||||
user-api:
|
||||
type: api
|
||||
name: "Fetch User Data"
|
||||
inputs:
|
||||
url: "https://api.example.com/users/123"
|
||||
method: GET
|
||||
connections:
|
||||
success: process-response
|
||||
|
||||
process-response:
|
||||
type: function
|
||||
name: "Process Response"
|
||||
inputs:
|
||||
code: |
|
||||
const user = <fetchuserdata.data>;
|
||||
const status = <fetchuserdata.status>;
|
||||
|
||||
console.log(`API returned status: ${status}`);
|
||||
console.log(`User data:`, user);
|
||||
|
||||
return {
|
||||
userId: user.id,
|
||||
email: user.email,
|
||||
isActive: status === 200
|
||||
};
|
||||
```
|
||||
|
||||
### Gestion des erreurs
|
||||
|
||||
```yaml
|
||||
api-with-error-handling:
|
||||
type: api
|
||||
name: "API Call"
|
||||
inputs:
|
||||
url: "https://api.example.com/data"
|
||||
method: GET
|
||||
connections:
|
||||
success: check-response
|
||||
error: handle-error
|
||||
|
||||
check-response:
|
||||
type: condition
|
||||
name: "Check Response Status"
|
||||
inputs:
|
||||
condition: <apicall.status> >= 200 && <apicall.status> < 300
|
||||
connections:
|
||||
true: process-success
|
||||
false: handle-api-error
|
||||
|
||||
process-success:
|
||||
type: function
|
||||
name: "Process Success"
|
||||
inputs:
|
||||
code: |
|
||||
return {
|
||||
success: true,
|
||||
data: <apicall.data>,
|
||||
message: "API call successful"
|
||||
};
|
||||
|
||||
handle-api-error:
|
||||
type: function
|
||||
name: "Handle API Error"
|
||||
inputs:
|
||||
code: |
|
||||
return {
|
||||
success: false,
|
||||
status: <apicall.status>,
|
||||
error: "API call failed",
|
||||
data: <apicall.data>
|
||||
};
|
||||
```
|
||||
|
||||
## Échappement des chaînes YAML
|
||||
|
||||
Lors de l'écriture en YAML, certaines chaînes doivent être entre guillemets pour être correctement analysées :
|
||||
|
||||
### Chaînes qui doivent être entre guillemets
|
||||
|
||||
```yaml
|
||||
# URLs with hyphens, colons, special characters
|
||||
url: "https://api.example.com/users/123"
|
||||
url: "https://my-api.example.com/data"
|
||||
|
||||
# Header values with hyphens or special characters
|
||||
headers:
|
||||
- id: header-uuid
|
||||
cells:
|
||||
Key: "User-Agent"
|
||||
Value: "My-Application/1.0"
|
||||
- id: auth-uuid
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer my-token-123"
|
||||
|
||||
# Parameter values with hyphens
|
||||
params:
|
||||
- id: param-uuid
|
||||
cells:
|
||||
Key: "sort-by"
|
||||
Value: "created-at"
|
||||
```
|
||||
|
||||
### Quand utiliser les guillemets
|
||||
|
||||
- ✅ **Toujours mettre entre guillemets** : URLs, tokens, valeurs avec des traits d'union, des deux-points ou des caractères spéciaux
|
||||
- ✅ **Toujours mettre entre guillemets** : Valeurs qui commencent par des chiffres mais qui doivent rester des chaînes
|
||||
- ✅ **Toujours mettre entre guillemets** : Chaînes ressemblant à des booléens mais qui doivent rester des chaînes
|
||||
- ❌ **Ne pas mettre entre guillemets** : Chaînes alphanumériques simples sans caractères spéciaux
|
||||
|
||||
### Exemples
|
||||
|
||||
```yaml
|
||||
# ✅ Correct
|
||||
url: "https://api.stripe.com/v1/charges"
|
||||
headers:
|
||||
- id: auth-header
|
||||
cells:
|
||||
Key: "Authorization"
|
||||
Value: "Bearer sk-test-123456789"
|
||||
|
||||
# ❌ Incorrect (may cause parsing errors)
|
||||
url: https://api.stripe.com/v1/charges
|
||||
headers:
|
||||
- id: auth-header
|
||||
cells:
|
||||
Key: Authorization
|
||||
Value: Bearer sk-test-123456789
|
||||
```
|
||||
|
||||
## Bonnes pratiques
|
||||
|
||||
- Utilisez des variables d'environnement pour les clés API : `{{API_KEY_NAME}}`
|
||||
- Incluez la gestion des erreurs avec les connexions d'erreur
|
||||
- Définissez des délais d'attente appropriés pour votre cas d'utilisation
|
||||
- Validez les codes d'état de réponse dans les blocs suivants
|
||||
- Utilisez des noms de blocs significatifs pour faciliter les références
|
||||
- **Mettez toujours entre guillemets les chaînes avec des caractères spéciaux, les URLs et les tokens**
|
||||
@@ -1,165 +0,0 @@
|
||||
---
|
||||
title: Schéma YAML du bloc de condition
|
||||
description: Référence de configuration YAML pour les blocs de condition
|
||||
---
|
||||
|
||||
## Définition du schéma
|
||||
|
||||
```yaml
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
- connections
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: [condition]
|
||||
description: Block type identifier
|
||||
name:
|
||||
type: string
|
||||
description: Display name for this condition block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- conditions
|
||||
properties:
|
||||
conditions:
|
||||
type: object
|
||||
description: Conditional expressions and their logic
|
||||
properties:
|
||||
if:
|
||||
type: string
|
||||
description: Primary condition expression (boolean)
|
||||
else-if:
|
||||
type: string
|
||||
description: Secondary condition expression (optional)
|
||||
else-if-2:
|
||||
type: string
|
||||
description: Third condition expression (optional)
|
||||
else-if-3:
|
||||
type: string
|
||||
description: Fourth condition expression (optional)
|
||||
# Additional else-if-N conditions can be added as needed
|
||||
else:
|
||||
type: boolean
|
||||
description: Default fallback condition (optional)
|
||||
default: true
|
||||
connections:
|
||||
type: object
|
||||
required:
|
||||
- conditions
|
||||
properties:
|
||||
conditions:
|
||||
type: object
|
||||
description: Target blocks for each condition outcome
|
||||
properties:
|
||||
if:
|
||||
type: string
|
||||
description: Target block ID when 'if' condition is true
|
||||
else-if:
|
||||
type: string
|
||||
description: Target block ID when 'else-if' condition is true
|
||||
else-if-2:
|
||||
type: string
|
||||
description: Target block ID when 'else-if-2' condition is true
|
||||
else-if-3:
|
||||
type: string
|
||||
description: Target block ID when 'else-if-3' condition is true
|
||||
# Additional else-if-N connections can be added as needed
|
||||
else:
|
||||
type: string
|
||||
description: Target block ID when no conditions match
|
||||
```
|
||||
|
||||
## Configuration des connexions
|
||||
|
||||
Contrairement aux autres blocs, les conditions utilisent des connexions ramifiées basées sur les résultats des conditions :
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
conditions:
|
||||
if: <string> # Target block ID when primary condition is true
|
||||
else-if: <string> # Target block ID when secondary condition is true (optional)
|
||||
else-if-2: <string> # Target block ID when third condition is true (optional)
|
||||
else-if-3: <string> # Target block ID when fourth condition is true (optional)
|
||||
# Additional else-if-N connections can be added as needed
|
||||
else: <string> # Target block ID when no conditions match (optional)
|
||||
```
|
||||
|
||||
## Exemples
|
||||
|
||||
### Simple Si-Sinon
|
||||
|
||||
```yaml
|
||||
status-check:
|
||||
type: condition
|
||||
name: "Status Check"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <start.status> === "approved"
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: send-approval-email
|
||||
else: send-rejection-email
|
||||
```
|
||||
|
||||
### Conditions multiples
|
||||
|
||||
```yaml
|
||||
user-routing:
|
||||
type: condition
|
||||
name: "User Type Router"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <start.user_type> === "admin"
|
||||
else-if: <start.user_type> === "premium"
|
||||
else-if-2: <start.user_type> === "basic"
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: admin-dashboard
|
||||
else-if: premium-features
|
||||
else-if-2: basic-features
|
||||
else: registration-flow
|
||||
```
|
||||
|
||||
### Comparaisons numériques
|
||||
|
||||
```yaml
|
||||
score-evaluation:
|
||||
type: condition
|
||||
name: "Score Evaluation"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <agent.score> >= 90
|
||||
else-if: <agent.score> >= 70
|
||||
else-if-2: <agent.score> >= 50
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: excellent-response
|
||||
else-if: good-response
|
||||
else-if-2: average-response
|
||||
else: poor-response
|
||||
```
|
||||
|
||||
### Logique complexe
|
||||
|
||||
```yaml
|
||||
eligibility-check:
|
||||
type: condition
|
||||
name: "Eligibility Check"
|
||||
inputs:
|
||||
conditions:
|
||||
if: <start.age> >= 18 && <start.verified> === true
|
||||
else-if: <start.age> >= 16 && <start.parent_consent> === true
|
||||
else: true
|
||||
connections:
|
||||
conditions:
|
||||
if: full-access
|
||||
else-if: limited-access
|
||||
else: access-denied
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user