mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 23:17:59 -05:00
Compare commits
362 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b2490c4b1 | ||
|
|
dba7514350 | ||
|
|
e94de1dd26 | ||
|
|
a4e874b266 | ||
|
|
ec034f3fc7 | ||
|
|
e425d064c0 | ||
|
|
bcd1a2faf6 | ||
|
|
989a77261c | ||
|
|
71ae27b6cd | ||
|
|
5ab482127d | ||
|
|
b8bc632baa | ||
|
|
1b7437af14 | ||
|
|
4d7ebd8bcb | ||
|
|
ca1156a6c2 | ||
|
|
89eb1849d0 | ||
|
|
1d4833f485 | ||
|
|
d5902e91da | ||
|
|
9751c9f5c4 | ||
|
|
e6ba323de4 | ||
|
|
859711991f | ||
|
|
c178a90f02 | ||
|
|
eb8995ee7c | ||
|
|
b269447539 | ||
|
|
641e353d03 | ||
|
|
ce660e2df9 | ||
|
|
e4ddeb09d6 | ||
|
|
063bd610b1 | ||
|
|
9132cd224d | ||
|
|
c70c32a3bd | ||
|
|
cc0ace7de6 | ||
|
|
de1ac9a704 | ||
|
|
728a4c82c6 | ||
|
|
37f293a761 | ||
|
|
d1c08daaf4 | ||
|
|
90c34b2c46 | ||
|
|
3a0019bd13 | ||
|
|
a6122f2bbc | ||
|
|
9bf5f6e1fc | ||
|
|
22b3dde155 | ||
|
|
c1725c1c4b | ||
|
|
64eee587cd | ||
|
|
35c551984f | ||
|
|
d92d9a02cd | ||
|
|
64ede7f038 | ||
|
|
0fbbbe02c7 | ||
|
|
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 | ||
|
|
219a065a7c | ||
|
|
8f06aec68b | ||
|
|
1de6f09069 | ||
|
|
b10b2461a5 | ||
|
|
34fc8f84f5 | ||
|
|
ee77dea2d6 | ||
|
|
bba407b507 | ||
|
|
ab63978ce8 | ||
|
|
e697e50d4e | ||
|
|
41ec229431 | ||
|
|
c0f5ba75f1 | ||
|
|
5a943bca32 | ||
|
|
923595f57e | ||
|
|
241d9fd12d | ||
|
|
97a8778449 | ||
|
|
833e700b58 | ||
|
|
2d49892aaa | ||
|
|
8ce5a1b7c0 | ||
|
|
88d2e7b97b | ||
|
|
c04eb01aed | ||
|
|
5d887fdca7 | ||
|
|
1a0fdb32fe | ||
|
|
9d45b8df1e | ||
|
|
ae3a7f0865 | ||
|
|
25f5e31378 | ||
|
|
7bdf0e94d7 | ||
|
|
8e43774b5e | ||
|
|
715f42c1a6 | ||
|
|
8200e9a88f | ||
|
|
c6f6c9e2a5 | ||
|
|
2d7ba91c0e | ||
|
|
872e034312 | ||
|
|
a63a7b0262 | ||
|
|
991a020917 | ||
|
|
f03f395225 | ||
|
|
174f6a48a6 | ||
|
|
c2f0a95802 | ||
|
|
4dc4073452 | ||
|
|
d9b70087c4 | ||
|
|
07fd9c3a4a | ||
|
|
377b84e18c | ||
|
|
223ecda80e | ||
|
|
7dde01e74b | ||
|
|
b768ca845e | ||
|
|
86ed32ea10 | ||
|
|
0e838940f1 | ||
|
|
7cc9a23f99 | ||
|
|
c42d2a32f3 | ||
|
|
4da355d269 | ||
|
|
2175fd1106 | ||
|
|
10692b5e5a | ||
|
|
62298bf094 | ||
|
|
5f1518ffd9 | ||
|
|
cae0e85826 | ||
|
|
fa9c97816b | ||
|
|
4bc37db547 | ||
|
|
15138629cb | ||
|
|
ace83ebcae | ||
|
|
b33ae5bff9 | ||
|
|
dc6052578d | ||
|
|
4adbae03e7 | ||
|
|
3509ce8ce4 | ||
|
|
7aae108b87 | ||
|
|
980a6d8347 | ||
|
|
745eaff622 | ||
|
|
35d857ef2e | ||
|
|
6e63eafb79 | ||
|
|
896f7bb0a0 | ||
|
|
97f69a24e1 | ||
|
|
1a2c4040aa | ||
|
|
4ad9be0836 | ||
|
|
0bf2bce368 | ||
|
|
0d881ecc00 | ||
|
|
7e6a5dc7e2 | ||
|
|
c1a3500bde | ||
|
|
561b6f2778 | ||
|
|
cdfee16b8a | ||
|
|
9f6cb1becf | ||
|
|
dca8745c44 | ||
|
|
c35c8d1f31 | ||
|
|
87c00cec6d | ||
|
|
17edf0405b | ||
|
|
79461840c3 | ||
|
|
e76fc8c2da | ||
|
|
e9150a53e3 | ||
|
|
f9f84111cb | ||
|
|
01ffee8e7c | ||
|
|
367189fe15 | ||
|
|
7de9e5fb19 | ||
|
|
10652eb9b8 | ||
|
|
010753d170 | ||
|
|
bf1c178282 | ||
|
|
6a664663cf | ||
|
|
333442909b | ||
|
|
67c993d743 | ||
|
|
38dd2d0f23 | ||
|
|
5ee6345120 | ||
|
|
dd1985c99c | ||
|
|
39356f3d74 | ||
|
|
1ec5b1bdad | ||
|
|
bcc75376e5 | ||
|
|
448e9ea835 | ||
|
|
a63f3a3d8d | ||
|
|
3ff6509028 | ||
|
|
2ae30f1399 | ||
|
|
0e65a8a31d | ||
|
|
d1f5c69e6b | ||
|
|
c468ecbc72 | ||
|
|
97257ca49f | ||
|
|
6daeb77740 | ||
|
|
f79e87e4c2 | ||
|
|
18599ac3c3 | ||
|
|
e49cde7766 | ||
|
|
7146ce512d | ||
|
|
1b7e883b10 | ||
|
|
e03c036a10 | ||
|
|
7e8ac5c27f | ||
|
|
c12b3d2550 | ||
|
|
d381a69c9f | ||
|
|
928581f387 | ||
|
|
2c7c8d582e | ||
|
|
426873245f | ||
|
|
ca6ff7edb6 | ||
|
|
094dae3d3f | ||
|
|
2ee27f972e | ||
|
|
0b2ef5e3a6 | ||
|
|
67ac3ff84b | ||
|
|
8ed2c5ec53 | ||
|
|
2ace06f239 | ||
|
|
20a272c8c3 | ||
|
|
0d86eaa3a1 | ||
|
|
aa0a33e60f | ||
|
|
603b5471a3 | ||
|
|
ab8d822edf | ||
|
|
5bb9b46554 | ||
|
|
994eb8db2a | ||
|
|
fbb164db98 | ||
|
|
dd8f633f9f | ||
|
|
6d1b172a3e | ||
|
|
b7876ca466 | ||
|
|
68df95906f | ||
|
|
760219dcce | ||
|
|
f1b83c1988 | ||
|
|
2f97782df0 | ||
|
|
7cb303e713 | ||
|
|
8eaa83fe21 | ||
|
|
5c92d5d456 | ||
|
|
aa01e7e58a | ||
|
|
a3c76da636 | ||
|
|
cf19c895bb | ||
|
|
c017027000 | ||
|
|
73d779ad79 | ||
|
|
25781279e2 | ||
|
|
6fada45cd8 | ||
|
|
e640102797 | ||
|
|
16f5819941 | ||
|
|
d83865c635 | ||
|
|
6b4ebbac6e | ||
|
|
708321d0bf | ||
|
|
e4d35afe1f | ||
|
|
1d74ccfeda | ||
|
|
545e590ce5 | ||
|
|
93f9293f2c | ||
|
|
b5570c1c0e | ||
|
|
225571c49a | ||
|
|
a1c518e4e1 | ||
|
|
04922fe5c9 | ||
|
|
8e70a61ba9 | ||
|
|
abae6b96b5 | ||
|
|
bff1852a85 | ||
|
|
7327b448e5 | ||
|
|
eb1e90bb7f | ||
|
|
3905d1cb81 | ||
|
|
cd084e8236 | ||
|
|
5d96484501 | ||
|
|
6747a497fc | ||
|
|
2df65527d3 | ||
|
|
d0b69455e2 | ||
|
|
6028b1f5c0 | ||
|
|
658cf11299 | ||
|
|
6312df3a07 | ||
|
|
9de7a00373 | ||
|
|
325a666a8b | ||
|
|
2149f5e36d | ||
|
|
009e1da5f1 | ||
|
|
6101493f12 | ||
|
|
4b5c2b43e9 | ||
|
|
bd402cdda5 | ||
|
|
0c30646a2d | ||
|
|
53792b9a1d | ||
|
|
48f86e66f4 | ||
|
|
fd422b5d0d | ||
|
|
17cf72834d | ||
|
|
3122b506fd | ||
|
|
a31305b7ee | ||
|
|
4f26a7aa73 | ||
|
|
a06ae0d2e7 | ||
|
|
ab97ac5a77 | ||
|
|
ac8bf96eee | ||
|
|
d4165f5be6 | ||
|
|
994c35f62c | ||
|
|
4ce6bc94c3 | ||
|
|
ba21d274ec | ||
|
|
d73a97ffa2 | ||
|
|
f2ec43e4f9 | ||
|
|
3e5d3735dc | ||
|
|
172d51e061 | ||
|
|
1ad31c92ac | ||
|
|
065fc5b87b | ||
|
|
3798c56e8c | ||
|
|
c591433248 | ||
|
|
f0186593a1 | ||
|
|
6cf02b9b5a | ||
|
|
2dc75b1ac1 | ||
|
|
d3f7ef4ac4 | ||
|
|
9a6cc78332 | ||
|
|
ea8762e99b | ||
|
|
cff0a8718e | ||
|
|
abca73106d | ||
|
|
afb99fbaf1 | ||
|
|
4d973ffb01 | ||
|
|
8841e9bd6b | ||
|
|
3d4b9f0665 | ||
|
|
c48039f97f | ||
|
|
8f7b11f089 | ||
|
|
ae670a7819 | ||
|
|
a5c224e4b0 | ||
|
|
0785f6e920 | ||
|
|
cf4a935575 | ||
|
|
521316bb8c | ||
|
|
d357280003 | ||
|
|
adf8c2244c | ||
|
|
ebfdb9ce3b | ||
|
|
784992f347 | ||
|
|
5218dd41b9 | ||
|
|
07e70409c7 | ||
|
|
07ba17422b | ||
|
|
d45324bb83 | ||
|
|
ced64129da | ||
|
|
1e14743391 | ||
|
|
a0bb754c8c | ||
|
|
851031239d | ||
|
|
3811b509ef | ||
|
|
abb835d22d | ||
|
|
f2a046ff24 | ||
|
|
bd6d4a91a3 | ||
|
|
21beca8fd5 | ||
|
|
0a86eda853 | ||
|
|
60a061e38a | ||
|
|
ab71fcfc49 | ||
|
|
864622c1dc | ||
|
|
8668622d66 | ||
|
|
53dd277cfe | ||
|
|
0e8e8c7a47 | ||
|
|
47da5eb6e8 | ||
|
|
37dcde2afc | ||
|
|
e31627c7c2 | ||
|
|
57c98d86ba | ||
|
|
0f7dfe084a | ||
|
|
afc1632830 | ||
|
|
56eee2c2d2 | ||
|
|
fc558a8eef | ||
|
|
c68cadfb84 | ||
|
|
95d93a2532 | ||
|
|
59b2023124 | ||
|
|
a672f17136 | ||
|
|
1de59668e4 | ||
|
|
26243b99e8 | ||
|
|
fce1423d05 | ||
|
|
3656d3d7ad | ||
|
|
581929bc01 | ||
|
|
11d8188415 | ||
|
|
36c98d18e9 |
@@ -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,53 +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
|
||||
- POSTGRES_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
|
||||
151
.github/workflows/build.yml
vendored
151
.github/workflows/build.yml
vendored
@@ -1,151 +0,0 @@
|
||||
name: Build and Publish Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, staging]
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# AMD64 builds on x86 runners
|
||||
- dockerfile: ./docker/app.Dockerfile
|
||||
image: ghcr.io/simstudioai/simstudio
|
||||
platform: linux/amd64
|
||||
arch: amd64
|
||||
runner: linux-x64-8-core
|
||||
- dockerfile: ./docker/db.Dockerfile
|
||||
image: ghcr.io/simstudioai/migrations
|
||||
platform: linux/amd64
|
||||
arch: amd64
|
||||
runner: linux-x64-8-core
|
||||
- dockerfile: ./docker/realtime.Dockerfile
|
||||
image: ghcr.io/simstudioai/realtime
|
||||
platform: linux/amd64
|
||||
arch: amd64
|
||||
runner: linux-x64-8-core
|
||||
# ARM64 builds on native ARM64 runners
|
||||
- dockerfile: ./docker/app.Dockerfile
|
||||
image: ghcr.io/simstudioai/simstudio
|
||||
platform: linux/arm64
|
||||
arch: arm64
|
||||
runner: linux-arm64-8-core
|
||||
- dockerfile: ./docker/db.Dockerfile
|
||||
image: ghcr.io/simstudioai/migrations
|
||||
platform: linux/arm64
|
||||
arch: arm64
|
||||
runner: linux-arm64-8-core
|
||||
- dockerfile: ./docker/realtime.Dockerfile
|
||||
image: ghcr.io/simstudioai/realtime
|
||||
platform: linux/arm64
|
||||
arch: arm64
|
||||
runner: linux-arm64-8-core
|
||||
runs-on: ${{ matrix.runner }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to the Container registry
|
||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ matrix.image }}
|
||||
tags: |
|
||||
type=raw,value=latest-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/main' }}
|
||||
type=raw,value=staging-${{ github.sha }}-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/staging' }}
|
||||
type=sha,format=long,suffix=-${{ matrix.arch }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ${{ matrix.dockerfile }}
|
||||
platforms: ${{ matrix.platform }}
|
||||
push: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha,scope=build-v3
|
||||
cache-to: type=gha,mode=max,scope=build-v3
|
||||
provenance: false
|
||||
sbom: false
|
||||
|
||||
create-manifests:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-and-push
|
||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- image: ghcr.io/simstudioai/simstudio
|
||||
- image: ghcr.io/simstudioai/migrations
|
||||
- image: ghcr.io/simstudioai/realtime
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata for manifest
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ matrix.image }}
|
||||
tags: |
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||
type=sha,format=long
|
||||
|
||||
- name: Create and push manifest
|
||||
run: |
|
||||
# Extract the tags from metadata (these are the final manifest tags we want)
|
||||
MANIFEST_TAGS="${{ steps.meta.outputs.tags }}"
|
||||
|
||||
# Create manifest for each tag
|
||||
for manifest_tag in $MANIFEST_TAGS; do
|
||||
echo "Creating manifest for $manifest_tag"
|
||||
|
||||
# The architecture-specific images have -amd64 and -arm64 suffixes
|
||||
amd64_image="${manifest_tag}-amd64"
|
||||
arm64_image="${manifest_tag}-arm64"
|
||||
|
||||
echo "Looking for images: $amd64_image and $arm64_image"
|
||||
|
||||
# Check if both architecture images exist
|
||||
if docker manifest inspect "$amd64_image" >/dev/null 2>&1 && docker manifest inspect "$arm64_image" >/dev/null 2>&1; then
|
||||
echo "Both images found, creating manifest..."
|
||||
docker manifest create "$manifest_tag" \
|
||||
"$amd64_image" \
|
||||
"$arm64_image"
|
||||
docker manifest push "$manifest_tag"
|
||||
echo "Successfully created and pushed manifest for $manifest_tag"
|
||||
else
|
||||
echo "Error: One or both architecture images not found"
|
||||
echo "Checking AMD64 image: $amd64_image"
|
||||
docker manifest inspect "$amd64_image" || echo "AMD64 image not found"
|
||||
echo "Checking ARM64 image: $arm64_image"
|
||||
docker manifest inspect "$arm64_image" || echo "ARM64 image not found"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
254
.github/workflows/ci.yml
vendored
254
.github/workflows/ci.yml
vendored
@@ -6,72 +6,210 @@ on:
|
||||
pull_request:
|
||||
branches: [main, staging]
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
test:
|
||||
test-build:
|
||||
name: Test and Build
|
||||
runs-on: ubuntu-latest
|
||||
uses: ./.github/workflows/test-build.yml
|
||||
secrets: inherit
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Run tests with coverage
|
||||
env:
|
||||
NODE_OPTIONS: '--no-warnings'
|
||||
NEXT_PUBLIC_APP_URL: 'https://www.sim.ai'
|
||||
ENCRYPTION_KEY: '7cf672e460e430c1fba707575c2b0e2ad5a99dddf9b7b7e3b5646e630861db1c' # dummy key for CI only
|
||||
run: bun run test
|
||||
|
||||
- name: Build application
|
||||
env:
|
||||
NODE_OPTIONS: '--no-warnings'
|
||||
NEXT_PUBLIC_APP_URL: 'https://www.sim.ai'
|
||||
STRIPE_SECRET_KEY: 'dummy_key_for_ci_only'
|
||||
STRIPE_WEBHOOK_SECRET: 'dummy_secret_for_ci_only'
|
||||
RESEND_API_KEY: 'dummy_key_for_ci_only'
|
||||
AWS_REGION: 'us-west-2'
|
||||
ENCRYPTION_KEY: '7cf672e460e430c1fba707575c2b0e2ad5a99dddf9b7b7e3b5646e630861db1c' # dummy key for CI only
|
||||
run: bun run build
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
directory: ./apps/sim/coverage
|
||||
fail_ci_if_error: false
|
||||
verbose: true
|
||||
|
||||
migrations:
|
||||
name: Apply Database Migrations
|
||||
runs-on: ubuntu-latest
|
||||
# Build AMD64 images and push to ECR immediately (+ GHCR for main)
|
||||
build-amd64:
|
||||
name: Build AMD64
|
||||
needs: test-build
|
||||
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
|
||||
needs: test
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
id-token: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- dockerfile: ./docker/app.Dockerfile
|
||||
ghcr_image: ghcr.io/simstudioai/simstudio
|
||||
ecr_repo_secret: ECR_APP
|
||||
- dockerfile: ./docker/db.Dockerfile
|
||||
ghcr_image: ghcr.io/simstudioai/migrations
|
||||
ecr_repo_secret: ECR_MIGRATIONS
|
||||
- dockerfile: ./docker/realtime.Dockerfile
|
||||
ghcr_image: ghcr.io/simstudioai/realtime
|
||||
ecr_repo_secret: ECR_REALTIME
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
bun-version: latest
|
||||
role-to-assume: ${{ github.ref == 'refs/heads/main' && secrets.AWS_ROLE_TO_ASSUME || secrets.STAGING_AWS_ROLE_TO_ASSUME }}
|
||||
aws-region: ${{ github.ref == 'refs/heads/main' && secrets.AWS_REGION || secrets.STAGING_AWS_REGION }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
- name: Login to Amazon ECR
|
||||
id: login-ecr
|
||||
uses: aws-actions/amazon-ecr-login@v2
|
||||
|
||||
- name: Apply migrations
|
||||
working-directory: ./apps/sim
|
||||
env:
|
||||
DATABASE_URL: ${{ github.ref == 'refs/heads/main' && secrets.DATABASE_URL || secrets.STAGING_DATABASE_URL }}
|
||||
run: bunx drizzle-kit migrate
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GHCR
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: useblacksmith/setup-docker-builder@v1
|
||||
|
||||
- name: Generate tags
|
||||
id: meta
|
||||
run: |
|
||||
ECR_REGISTRY="${{ steps.login-ecr.outputs.registry }}"
|
||||
ECR_REPO="${{ secrets[matrix.ecr_repo_secret] }}"
|
||||
GHCR_IMAGE="${{ matrix.ghcr_image }}"
|
||||
|
||||
# ECR tags (always build for ECR)
|
||||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||
ECR_TAG="latest"
|
||||
else
|
||||
ECR_TAG="staging"
|
||||
fi
|
||||
ECR_IMAGE="${ECR_REGISTRY}/${ECR_REPO}:${ECR_TAG}"
|
||||
|
||||
# Build tags list
|
||||
TAGS="${ECR_IMAGE}"
|
||||
|
||||
# Add GHCR tags only for main branch
|
||||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||
GHCR_AMD64="${GHCR_IMAGE}:latest-amd64"
|
||||
GHCR_SHA="${GHCR_IMAGE}:${{ github.sha }}-amd64"
|
||||
TAGS="${TAGS},$GHCR_AMD64,$GHCR_SHA"
|
||||
fi
|
||||
|
||||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push images
|
||||
uses: useblacksmith/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ${{ matrix.dockerfile }}
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
provenance: false
|
||||
sbom: false
|
||||
|
||||
# Build ARM64 images for GHCR (main branch only, runs in parallel)
|
||||
build-ghcr-arm64:
|
||||
name: Build ARM64 (GHCR Only)
|
||||
needs: test-build
|
||||
runs-on: linux-arm64-8-core
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- dockerfile: ./docker/app.Dockerfile
|
||||
image: ghcr.io/simstudioai/simstudio
|
||||
- dockerfile: ./docker/db.Dockerfile
|
||||
image: ghcr.io/simstudioai/migrations
|
||||
- dockerfile: ./docker/realtime.Dockerfile
|
||||
image: ghcr.io/simstudioai/realtime
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: useblacksmith/setup-docker-builder@v1
|
||||
|
||||
- name: Generate ARM64 tags
|
||||
id: meta
|
||||
run: |
|
||||
IMAGE="${{ matrix.image }}"
|
||||
echo "tags=${IMAGE}:latest-arm64,${IMAGE}:${{ github.sha }}-arm64" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push ARM64 to GHCR
|
||||
uses: useblacksmith/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ${{ matrix.dockerfile }}
|
||||
platforms: linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
provenance: false
|
||||
sbom: false
|
||||
|
||||
# Create GHCR multi-arch manifests (only for main, after both builds)
|
||||
create-ghcr-manifests:
|
||||
name: Create GHCR Manifests
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
needs: [build-amd64, build-ghcr-arm64]
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
permissions:
|
||||
packages: write
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- image: ghcr.io/simstudioai/simstudio
|
||||
- image: ghcr.io/simstudioai/migrations
|
||||
- image: ghcr.io/simstudioai/realtime
|
||||
|
||||
steps:
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create and push manifests
|
||||
run: |
|
||||
IMAGE_BASE="${{ matrix.image }}"
|
||||
|
||||
# Create latest manifest
|
||||
docker manifest create "${IMAGE_BASE}:latest" \
|
||||
"${IMAGE_BASE}:latest-amd64" \
|
||||
"${IMAGE_BASE}:latest-arm64"
|
||||
docker manifest push "${IMAGE_BASE}:latest"
|
||||
|
||||
# Create SHA manifest
|
||||
docker manifest create "${IMAGE_BASE}:${{ github.sha }}" \
|
||||
"${IMAGE_BASE}:${{ github.sha }}-amd64" \
|
||||
"${IMAGE_BASE}:${{ github.sha }}-arm64"
|
||||
docker manifest push "${IMAGE_BASE}:${{ github.sha }}"
|
||||
|
||||
# Deploy Trigger.dev (after ECR images are pushed, runs in parallel with process-docs)
|
||||
trigger-deploy:
|
||||
name: Deploy Trigger.dev
|
||||
needs: build-amd64
|
||||
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
|
||||
uses: ./.github/workflows/trigger-deploy.yml
|
||||
secrets: inherit
|
||||
|
||||
# Process docs embeddings (after ECR images are pushed, runs in parallel with trigger-deploy)
|
||||
process-docs:
|
||||
name: Process Docs
|
||||
needs: build-amd64
|
||||
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
|
||||
uses: ./.github/workflows/docs-embeddings.yml
|
||||
secrets: inherit
|
||||
|
||||
11
.github/workflows/docs-embeddings.yml
vendored
11
.github/workflows/docs-embeddings.yml
vendored
@@ -1,16 +1,13 @@
|
||||
name: Process Docs Embeddings
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, staging]
|
||||
paths:
|
||||
- 'apps/docs/**'
|
||||
workflow_call:
|
||||
workflow_dispatch: # Allow manual triggering
|
||||
|
||||
jobs:
|
||||
process-docs-embeddings:
|
||||
name: Process Documentation Embeddings
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging'
|
||||
|
||||
steps:
|
||||
@@ -20,7 +17,7 @@ jobs:
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
bun-version: 1.2.22
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
@@ -35,4 +32,4 @@ jobs:
|
||||
env:
|
||||
DATABASE_URL: ${{ github.ref == 'refs/heads/main' && secrets.DATABASE_URL || secrets.STAGING_DATABASE_URL }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
run: bun run scripts/process-docs-embeddings.ts --clear
|
||||
run: bun run scripts/process-docs.ts --clear
|
||||
|
||||
158
.github/workflows/i18n.yml
vendored
Normal file
158
.github/workflows/i18n.yml
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
name: 'Auto-translate Documentation'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ staging ]
|
||||
paths:
|
||||
- 'apps/docs/content/docs/en/**'
|
||||
- 'apps/docs/i18n.json'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
translate:
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
if: github.actor != 'github-actions[bot]' # Prevent infinite loops
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: 1.2.22
|
||||
|
||||
- name: Run Lingo.dev translations
|
||||
env:
|
||||
LINGODOTDEV_API_KEY: ${{ secrets.LINGODOTDEV_API_KEY }}
|
||||
run: |
|
||||
cd apps/docs
|
||||
bunx lingo.dev@latest i18n
|
||||
|
||||
- name: Check for translation changes
|
||||
id: changes
|
||||
run: |
|
||||
cd apps/docs
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
|
||||
if [ -n "$(git status --porcelain content/docs)" ]; then
|
||||
echo "changes=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "changes=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create Pull Request with translations
|
||||
if: steps.changes.outputs.changes == 'true'
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
with:
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
commit-message: "feat(i18n): update translations"
|
||||
title: "feat(i18n): update translations"
|
||||
body: |
|
||||
## Summary
|
||||
Automated translation updates triggered by changes to documentation.
|
||||
|
||||
This PR was automatically created after content changes were made, updating translations for all supported languages using Lingo.dev AI translation engine.
|
||||
|
||||
**Original trigger**: ${{ github.event.head_commit.message }}
|
||||
**Commit**: ${{ github.sha }}
|
||||
**Workflow**: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
|
||||
## Type of Change
|
||||
- [ ] Bug fix
|
||||
- [ ] New feature
|
||||
- [ ] Breaking change
|
||||
- [x] Documentation
|
||||
- [ ] Other: ___________
|
||||
|
||||
## Testing
|
||||
This PR includes automated translations for modified English documentation content:
|
||||
- 🇪🇸 Spanish (es) translations
|
||||
- 🇫🇷 French (fr) translations
|
||||
- 🇨🇳 Chinese (zh) translations
|
||||
- 🇯🇵 Japanese (ja) translations
|
||||
- 🇩🇪 German (de) translations
|
||||
|
||||
**What reviewers should focus on:**
|
||||
- Verify translated content accuracy and context
|
||||
- Check that all links and references work correctly in translated versions
|
||||
- Ensure formatting, code blocks, and structure are preserved
|
||||
- Validate that technical terms are appropriately translated
|
||||
|
||||
## Checklist
|
||||
- [x] Code follows project style guidelines (automated translation)
|
||||
- [x] Self-reviewed my changes (automated process)
|
||||
- [ ] Tests added/updated and passing
|
||||
- [x] No new warnings introduced
|
||||
- [x] I confirm that I have read and agree to the terms outlined in the [Contributor License Agreement (CLA)](./CONTRIBUTING.md#contributor-license-agreement-cla)
|
||||
|
||||
## Screenshots/Videos
|
||||
<!-- Translation changes are text-based - no visual changes expected -->
|
||||
<!-- Reviewers should check the documentation site renders correctly for all languages -->
|
||||
branch: auto-translate/staging-merge-${{ github.run_id }}
|
||||
base: staging
|
||||
labels: |
|
||||
i18n
|
||||
|
||||
verify-translations:
|
||||
needs: translate
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
if: always() # Run even if translation fails
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: staging
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: 1.2.22
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd apps/docs
|
||||
bun install
|
||||
|
||||
- name: Build documentation to verify translations
|
||||
run: |
|
||||
cd apps/docs
|
||||
bun run build
|
||||
|
||||
- name: Report translation status
|
||||
run: |
|
||||
cd apps/docs
|
||||
echo "## Translation Status Report" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Triggered by merge to staging branch**" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
en_count=$(find content/docs/en -name "*.mdx" | wc -l)
|
||||
es_count=$(find content/docs/es -name "*.mdx" 2>/dev/null | wc -l || echo 0)
|
||||
fr_count=$(find content/docs/fr -name "*.mdx" 2>/dev/null | wc -l || echo 0)
|
||||
zh_count=$(find content/docs/zh -name "*.mdx" 2>/dev/null | wc -l || echo 0)
|
||||
ja_count=$(find content/docs/ja -name "*.mdx" 2>/dev/null | wc -l || echo 0)
|
||||
de_count=$(find content/docs/de -name "*.mdx" 2>/dev/null | wc -l || echo 0)
|
||||
|
||||
es_percentage=$((es_count * 100 / en_count))
|
||||
fr_percentage=$((fr_count * 100 / en_count))
|
||||
zh_percentage=$((zh_count * 100 / en_count))
|
||||
ja_percentage=$((ja_count * 100 / en_count))
|
||||
de_percentage=$((de_count * 100 / en_count))
|
||||
|
||||
echo "### Coverage Statistics" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **🇬🇧 English**: $en_count files (source)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **🇪🇸 Spanish**: $es_count/$en_count files ($es_percentage%)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **🇫🇷 French**: $fr_count/$en_count files ($fr_percentage%)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **🇨🇳 Chinese**: $zh_count/$en_count files ($zh_percentage%)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **🇯🇵 Japanese**: $ja_count/$en_count files ($ja_percentage%)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **🇩🇪 German**: $de_count/$en_count files ($de_percentage%)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "🔄 **Auto-translation PR**: Check for new pull request with updated translations" >> $GITHUB_STEP_SUMMARY
|
||||
181
.github/workflows/images.yml
vendored
Normal file
181
.github/workflows/images.yml
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
name: Build and Push Images
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
build-amd64:
|
||||
name: Build AMD64
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- dockerfile: ./docker/app.Dockerfile
|
||||
ghcr_image: ghcr.io/simstudioai/simstudio
|
||||
ecr_repo_secret: ECR_APP
|
||||
- dockerfile: ./docker/db.Dockerfile
|
||||
ghcr_image: ghcr.io/simstudioai/migrations
|
||||
ecr_repo_secret: ECR_MIGRATIONS
|
||||
- dockerfile: ./docker/realtime.Dockerfile
|
||||
ghcr_image: ghcr.io/simstudioai/realtime
|
||||
ecr_repo_secret: ECR_REALTIME
|
||||
outputs:
|
||||
registry: ${{ steps.login-ecr.outputs.registry }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
role-to-assume: ${{ github.ref == 'refs/heads/main' && secrets.AWS_ROLE_TO_ASSUME || secrets.STAGING_AWS_ROLE_TO_ASSUME }}
|
||||
aws-region: ${{ github.ref == 'refs/heads/main' && secrets.AWS_REGION || secrets.STAGING_AWS_REGION }}
|
||||
|
||||
- name: Login to Amazon ECR
|
||||
id: login-ecr
|
||||
uses: aws-actions/amazon-ecr-login@v2
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GHCR
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: useblacksmith/setup-docker-builder@v1
|
||||
|
||||
- name: Generate tags
|
||||
id: meta
|
||||
run: |
|
||||
ECR_REGISTRY="${{ steps.login-ecr.outputs.registry }}"
|
||||
ECR_REPO="${{ secrets[matrix.ecr_repo_secret] }}"
|
||||
GHCR_IMAGE="${{ matrix.ghcr_image }}"
|
||||
|
||||
# ECR tags (always build for ECR)
|
||||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||
ECR_TAG="latest"
|
||||
else
|
||||
ECR_TAG="staging"
|
||||
fi
|
||||
ECR_IMAGE="${ECR_REGISTRY}/${ECR_REPO}:${ECR_TAG}"
|
||||
|
||||
# Build tags list
|
||||
TAGS="${ECR_IMAGE}"
|
||||
|
||||
# Add GHCR tags only for main branch
|
||||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||
GHCR_AMD64="${GHCR_IMAGE}:latest-amd64"
|
||||
GHCR_SHA="${GHCR_IMAGE}:${{ github.sha }}-amd64"
|
||||
TAGS="${TAGS},$GHCR_AMD64,$GHCR_SHA"
|
||||
fi
|
||||
|
||||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push images
|
||||
uses: useblacksmith/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ${{ matrix.dockerfile }}
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
provenance: false
|
||||
sbom: false
|
||||
|
||||
build-ghcr-arm64:
|
||||
name: Build ARM64 (GHCR Only)
|
||||
runs-on: linux-arm64-8-core
|
||||
if: github.ref == 'refs/heads/main'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- dockerfile: ./docker/app.Dockerfile
|
||||
image: ghcr.io/simstudioai/simstudio
|
||||
- dockerfile: ./docker/db.Dockerfile
|
||||
image: ghcr.io/simstudioai/migrations
|
||||
- dockerfile: ./docker/realtime.Dockerfile
|
||||
image: ghcr.io/simstudioai/realtime
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: useblacksmith/setup-docker-builder@v1
|
||||
|
||||
- name: Generate ARM64 tags
|
||||
id: meta
|
||||
run: |
|
||||
IMAGE="${{ matrix.image }}"
|
||||
echo "tags=${IMAGE}:latest-arm64,${IMAGE}:${{ github.sha }}-arm64" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push ARM64 to GHCR
|
||||
uses: useblacksmith/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ${{ matrix.dockerfile }}
|
||||
platforms: linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
provenance: false
|
||||
sbom: false
|
||||
|
||||
create-ghcr-manifests:
|
||||
name: Create GHCR Manifests
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
needs: [build-amd64, build-ghcr-arm64]
|
||||
if: github.ref == 'refs/heads/main'
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- image: ghcr.io/simstudioai/simstudio
|
||||
- image: ghcr.io/simstudioai/migrations
|
||||
- image: ghcr.io/simstudioai/realtime
|
||||
|
||||
steps:
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create and push manifests
|
||||
run: |
|
||||
IMAGE_BASE="${{ matrix.image }}"
|
||||
|
||||
# Create latest manifest
|
||||
docker manifest create "${IMAGE_BASE}:latest" \
|
||||
"${IMAGE_BASE}:latest-amd64" \
|
||||
"${IMAGE_BASE}:latest-arm64"
|
||||
docker manifest push "${IMAGE_BASE}:latest"
|
||||
|
||||
# Create SHA manifest
|
||||
docker manifest create "${IMAGE_BASE}:${{ github.sha }}" \
|
||||
"${IMAGE_BASE}:${{ github.sha }}-amd64" \
|
||||
"${IMAGE_BASE}:${{ github.sha }}-arm64"
|
||||
docker manifest push "${IMAGE_BASE}:${{ github.sha }}"
|
||||
28
.github/workflows/migrations.yml
vendored
Normal file
28
.github/workflows/migrations.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Database Migrations
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
migrate:
|
||||
name: Apply Database Migrations
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: 1.2.22
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Apply migrations
|
||||
working-directory: ./packages/db
|
||||
env:
|
||||
DATABASE_URL: ${{ github.ref == 'refs/heads/main' && secrets.DATABASE_URL || secrets.STAGING_DATABASE_URL }}
|
||||
run: bunx drizzle-kit migrate --config=./drizzle.config.ts
|
||||
4
.github/workflows/publish-cli.yml
vendored
4
.github/workflows/publish-cli.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
publish-npm:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
bun-version: 1.2.22
|
||||
|
||||
- name: Setup Node.js for npm publishing
|
||||
uses: actions/setup-node@v4
|
||||
|
||||
4
.github/workflows/publish-python-sdk.yml
vendored
4
.github/workflows/publish-python-sdk.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
publish-pypi:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -84,6 +84,6 @@ jobs:
|
||||
```
|
||||
|
||||
### Documentation
|
||||
See the [README](https://github.com/simstudio/sim/tree/main/packages/python-sdk) for usage instructions.
|
||||
See the [README](https://github.com/simstudioai/sim/tree/main/packages/python-sdk) or the [docs](https://docs.sim.ai/sdks/python) for more information.
|
||||
draft: false
|
||||
prerelease: false
|
||||
9
.github/workflows/publish-ts-sdk.yml
vendored
9
.github/workflows/publish-ts-sdk.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
publish-npm:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -16,16 +16,15 @@ jobs:
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
bun-version: 1.2.22
|
||||
|
||||
- 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
|
||||
working-directory: packages/ts-sdk
|
||||
run: bun install
|
||||
|
||||
- name: Run tests
|
||||
@@ -80,6 +79,6 @@ jobs:
|
||||
```
|
||||
|
||||
### Documentation
|
||||
See the [README](https://github.com/simstudio/sim/tree/main/packages/ts-sdk) for usage instructions.
|
||||
See the [README](https://github.com/simstudioai/sim/tree/main/packages/ts-sdk) or the [docs](https://docs.sim.ai/sdks/typescript) for more information.
|
||||
draft: false
|
||||
prerelease: false
|
||||
57
.github/workflows/test-build.yml
vendored
Normal file
57
.github/workflows/test-build.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Test and Build
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test-build:
|
||||
name: Test and Build
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: 1.2.22
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Lint code
|
||||
run: bun run lint:check
|
||||
|
||||
- name: Run tests with coverage
|
||||
env:
|
||||
NODE_OPTIONS: '--no-warnings'
|
||||
NEXT_PUBLIC_APP_URL: 'https://www.sim.ai'
|
||||
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/simstudio'
|
||||
ENCRYPTION_KEY: '7cf672e460e430c1fba707575c2b0e2ad5a99dddf9b7b7e3b5646e630861db1c' # dummy key for CI only
|
||||
run: bun run test
|
||||
|
||||
- name: Build application
|
||||
env:
|
||||
NODE_OPTIONS: '--no-warnings'
|
||||
NEXT_PUBLIC_APP_URL: 'https://www.sim.ai'
|
||||
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/simstudio'
|
||||
STRIPE_SECRET_KEY: 'dummy_key_for_ci_only'
|
||||
STRIPE_WEBHOOK_SECRET: 'dummy_secret_for_ci_only'
|
||||
RESEND_API_KEY: 'dummy_key_for_ci_only'
|
||||
AWS_REGION: 'us-west-2'
|
||||
ENCRYPTION_KEY: '7cf672e460e430c1fba707575c2b0e2ad5a99dddf9b7b7e3b5646e630861db1c' # dummy key for CI only
|
||||
run: bun run build
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
directory: ./apps/sim/coverage
|
||||
fail_ci_if_error: false
|
||||
verbose: true
|
||||
28
.github/workflows/trigger-deploy.yml
vendored
28
.github/workflows/trigger-deploy.yml
vendored
@@ -1,44 +1,44 @@
|
||||
name: Trigger.dev Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- staging
|
||||
workflow_call:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Trigger.dev Deploy
|
||||
runs-on: ubuntu-latest
|
||||
name: Deploy to Trigger.dev
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
concurrency:
|
||||
group: trigger-deploy-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
env:
|
||||
TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
|
||||
TRIGGER_PROJECT_ID: ${{ secrets.TRIGGER_PROJECT_ID }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
node-version: latest
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
bun-version: 1.2.22
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Deploy to Staging
|
||||
- name: Deploy to Trigger.dev (Staging)
|
||||
if: github.ref == 'refs/heads/staging'
|
||||
working-directory: ./apps/sim
|
||||
run: npx --yes trigger.dev@4.0.1 deploy -e staging
|
||||
run: npx --yes trigger.dev@4.0.4 deploy -e staging
|
||||
|
||||
- name: Deploy to Production
|
||||
- name: Deploy to Trigger.dev (Production)
|
||||
if: github.ref == 'refs/heads/main'
|
||||
working-directory: ./apps/sim
|
||||
run: npx --yes trigger.dev@4.0.1 deploy
|
||||
run: npx --yes trigger.dev@4.0.4 deploy
|
||||
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -68,4 +68,5 @@ start-collector.sh
|
||||
.vscode
|
||||
|
||||
## Helm Chart Tests
|
||||
helm/sim/test
|
||||
helm/sim/test
|
||||
i18n.cache
|
||||
|
||||
17
README.md
17
README.md
@@ -127,8 +127,20 @@ DATABASE_URL="postgresql://postgres:your_password@localhost:5432/simstudio"
|
||||
|
||||
4. Set up the database:
|
||||
|
||||
First, configure the database package environment:
|
||||
```bash
|
||||
bunx drizzle-kit migrate
|
||||
cd packages/db
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Update your `packages/db/.env` file with the database URL:
|
||||
```bash
|
||||
DATABASE_URL="postgresql://postgres:your_password@localhost:5432/simstudio"
|
||||
```
|
||||
|
||||
Then run the migrations:
|
||||
```bash
|
||||
bunx drizzle-kit migrate --config=./drizzle.config.ts
|
||||
```
|
||||
|
||||
5. Start the development servers:
|
||||
@@ -159,7 +171,7 @@ bun run dev:sockets
|
||||
Copilot is a Sim-managed service. To use Copilot on a self-hosted instance:
|
||||
|
||||
- Go to https://sim.ai → Settings → Copilot and generate a Copilot API key
|
||||
- Set `COPILOT_API_KEY` in your self-hosted environment to that value
|
||||
- Set `COPILOT_API_KEY` environment variable in your self-hosted apps/sim/.env file to that value
|
||||
|
||||
## Tech Stack
|
||||
|
||||
@@ -174,6 +186,7 @@ Copilot is a Sim-managed service. To use Copilot on a self-hosted instance:
|
||||
- **Monorepo**: [Turborepo](https://turborepo.org/)
|
||||
- **Realtime**: [Socket.io](https://socket.io/)
|
||||
- **Background Jobs**: [Trigger.dev](https://trigger.dev/)
|
||||
- **Remote Code Execution**: [E2B](https://www.e2b.dev/)
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
export default function SlugLayout({ children }: { children: ReactNode }) {
|
||||
return children
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/page'
|
||||
import { notFound } from 'next/navigation'
|
||||
import mdxComponents from '@/components/mdx-components'
|
||||
import { source } from '@/lib/source'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
export default async function Page(props: { params: Promise<{ slug?: string[] }> }) {
|
||||
const params = await props.params
|
||||
const page = source.getPage(params.slug)
|
||||
if (!page) notFound()
|
||||
|
||||
const MDX = page.data.body
|
||||
|
||||
return (
|
||||
<DocsPage
|
||||
toc={page.data.toc}
|
||||
full={page.data.full}
|
||||
tableOfContent={{
|
||||
style: 'clerk',
|
||||
enabled: true,
|
||||
header: <div className='mb-2 font-medium text-sm'>On this page</div>,
|
||||
single: false,
|
||||
}}
|
||||
article={{
|
||||
className: 'scroll-smooth max-sm:pb-16',
|
||||
}}
|
||||
tableOfContentPopover={{
|
||||
style: 'clerk',
|
||||
enabled: true,
|
||||
}}
|
||||
footer={{
|
||||
enabled: false,
|
||||
}}
|
||||
>
|
||||
<DocsTitle>{page.data.title}</DocsTitle>
|
||||
<DocsDescription>{page.data.description}</DocsDescription>
|
||||
<DocsBody>
|
||||
<MDX components={mdxComponents} />
|
||||
</DocsBody>
|
||||
</DocsPage>
|
||||
)
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return source.generateParams()
|
||||
}
|
||||
|
||||
export async function generateMetadata(props: { params: Promise<{ slug?: string[] }> }) {
|
||||
const params = await props.params
|
||||
const page = source.getPage(params.slug)
|
||||
if (!page) notFound()
|
||||
|
||||
return {
|
||||
title: page.data.title,
|
||||
description: page.data.description,
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import { DocsLayout } from 'fumadocs-ui/layouts/docs'
|
||||
import { ExternalLink, GithubIcon } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import { source } from '@/lib/source'
|
||||
|
||||
const GitHubLink = () => (
|
||||
<div className='fixed right-4 bottom-4 z-50'>
|
||||
<Link
|
||||
href='https://github.com/simstudioai/sim'
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
className='flex h-8 w-8 items-center justify-center rounded-full border border-border bg-background transition-colors hover:bg-muted'
|
||||
>
|
||||
<GithubIcon className='h-4 w-4' />
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
|
||||
export default function Layout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<DocsLayout
|
||||
tree={source.pageTree}
|
||||
nav={{
|
||||
title: <div className='flex items-center font-medium'>Sim</div>,
|
||||
}}
|
||||
links={[
|
||||
{
|
||||
text: 'Visit Sim',
|
||||
url: 'https://sim.ai',
|
||||
icon: <ExternalLink className='h-4 w-4' />,
|
||||
},
|
||||
]}
|
||||
sidebar={{
|
||||
defaultOpenLevel: 1,
|
||||
collapsible: true,
|
||||
footer: null,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</DocsLayout>
|
||||
<GitHubLink />
|
||||
</>
|
||||
)
|
||||
}
|
||||
286
apps/docs/app/[lang]/[[...slug]]/page.tsx
Normal file
286
apps/docs/app/[lang]/[[...slug]]/page.tsx
Normal file
@@ -0,0 +1,286 @@
|
||||
import { findNeighbour } from 'fumadocs-core/server'
|
||||
import defaultMdxComponents from 'fumadocs-ui/mdx'
|
||||
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/page'
|
||||
import { ChevronLeft, ChevronRight } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import { notFound } from 'next/navigation'
|
||||
import { StructuredData } from '@/components/structured-data'
|
||||
import { CodeBlock } from '@/components/ui/code-block'
|
||||
import { source } from '@/lib/source'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
export default async function Page(props: { params: Promise<{ slug?: string[]; lang: string }> }) {
|
||||
const params = await props.params
|
||||
const page = source.getPage(params.slug, params.lang)
|
||||
if (!page) notFound()
|
||||
|
||||
const MDX = page.data.body
|
||||
const baseUrl = 'https://docs.sim.ai'
|
||||
|
||||
const pageTreeRecord = source.pageTree as Record<string, any>
|
||||
const pageTree =
|
||||
pageTreeRecord[params.lang] ?? pageTreeRecord.en ?? Object.values(pageTreeRecord)[0]
|
||||
const neighbours = pageTree ? findNeighbour(pageTree, page.url) : null
|
||||
|
||||
const generateBreadcrumbs = () => {
|
||||
const breadcrumbs: Array<{ name: string; url: string }> = [
|
||||
{
|
||||
name: 'Home',
|
||||
url: baseUrl,
|
||||
},
|
||||
]
|
||||
|
||||
const urlParts = page.url.split('/').filter(Boolean)
|
||||
let currentPath = ''
|
||||
|
||||
urlParts.forEach((part, index) => {
|
||||
if (index === 0 && ['en', 'es', 'fr', 'de', 'ja', 'zh'].includes(part)) {
|
||||
currentPath = `/${part}`
|
||||
return
|
||||
}
|
||||
|
||||
currentPath += `/${part}`
|
||||
|
||||
const name = part
|
||||
.split('-')
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
||||
.join(' ')
|
||||
|
||||
if (index === urlParts.length - 1) {
|
||||
breadcrumbs.push({
|
||||
name: page.data.title,
|
||||
url: `${baseUrl}${page.url}`,
|
||||
})
|
||||
} else {
|
||||
breadcrumbs.push({
|
||||
name: name,
|
||||
url: `${baseUrl}${currentPath}`,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
return breadcrumbs
|
||||
}
|
||||
|
||||
const breadcrumbs = generateBreadcrumbs()
|
||||
|
||||
const CustomFooter = () => (
|
||||
<div className='mt-12'>
|
||||
{/* Navigation links */}
|
||||
<div className='flex items-center justify-between py-8'>
|
||||
{neighbours?.previous ? (
|
||||
<Link
|
||||
href={neighbours.previous.url}
|
||||
className='group flex items-center gap-2 text-muted-foreground transition-colors hover:text-foreground'
|
||||
>
|
||||
<ChevronLeft className='group-hover:-translate-x-1 h-4 w-4 transition-transform' />
|
||||
<span className='font-medium'>{neighbours.previous.name}</span>
|
||||
</Link>
|
||||
) : (
|
||||
<div />
|
||||
)}
|
||||
|
||||
{neighbours?.next ? (
|
||||
<Link
|
||||
href={neighbours.next.url}
|
||||
className='group flex items-center gap-2 text-muted-foreground transition-colors hover:text-foreground'
|
||||
>
|
||||
<span className='font-medium'>{neighbours.next.name}</span>
|
||||
<ChevronRight className='h-4 w-4 transition-transform group-hover:translate-x-1' />
|
||||
</Link>
|
||||
) : (
|
||||
<div />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Divider line */}
|
||||
<div className='border-border border-t' />
|
||||
|
||||
{/* Social icons */}
|
||||
<div className='flex items-center gap-4 py-6'>
|
||||
<Link
|
||||
href='https://x.com/simdotai'
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
aria-label='X (Twitter)'
|
||||
>
|
||||
<div
|
||||
className='h-5 w-5 bg-gray-400 transition-colors hover:bg-gray-500 dark:bg-gray-500 dark:hover:bg-gray-400'
|
||||
style={{
|
||||
maskImage:
|
||||
"url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z%22/%3E%3C/svg%3E')",
|
||||
maskRepeat: 'no-repeat',
|
||||
maskPosition: 'center center',
|
||||
WebkitMaskImage:
|
||||
"url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z%22/%3E%3C/svg%3E')",
|
||||
WebkitMaskRepeat: 'no-repeat',
|
||||
WebkitMaskPosition: 'center center',
|
||||
}}
|
||||
/>
|
||||
</Link>
|
||||
<Link
|
||||
href='https://github.com/simstudioai/sim'
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
aria-label='GitHub'
|
||||
>
|
||||
<div
|
||||
className='h-5 w-5 bg-gray-400 transition-colors hover:bg-gray-500 dark:bg-gray-500 dark:hover:bg-gray-400'
|
||||
style={{
|
||||
maskImage:
|
||||
"url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z%22/%3E%3C/svg%3E')",
|
||||
maskRepeat: 'no-repeat',
|
||||
maskPosition: 'center center',
|
||||
WebkitMaskImage:
|
||||
"url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z%22/%3E%3C/svg%3E')",
|
||||
WebkitMaskRepeat: 'no-repeat',
|
||||
WebkitMaskPosition: 'center center',
|
||||
}}
|
||||
/>
|
||||
</Link>
|
||||
<Link
|
||||
href='https://discord.gg/Hr4UWYEcTT'
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
aria-label='Discord'
|
||||
>
|
||||
<div
|
||||
className='h-5 w-5 bg-gray-400 transition-colors hover:bg-gray-500 dark:bg-gray-500 dark:hover:bg-gray-400'
|
||||
style={{
|
||||
maskImage:
|
||||
"url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515a.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0a12.64 12.64 0 0 0-.617-1.25a.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057a19.9 19.9 0 0 0 5.993 3.03a.078.078 0 0 0 .084-.028a14.09 14.09 0 0 0 1.226-1.994a.076.076 0 0 0-.041-.106a13.107 13.107 0 0 1-1.872-.892a.077.077 0 0 1-.008-.128a10.2 10.2 0 0 0 .372-.292a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127a12.299 12.299 0 0 1-1.873.892a.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028a19.839 19.839 0 0 0 6.002-3.03a.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.956-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.955-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.946 2.418-2.157 2.418z%22/%3E%3C/svg%3E')",
|
||||
maskRepeat: 'no-repeat',
|
||||
maskPosition: 'center center',
|
||||
WebkitMaskImage:
|
||||
"url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515a.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0a12.64 12.64 0 0 0-.617-1.25a.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057a19.9 19.9 0 0 0 5.993 3.03a.078.078 0 0 0 .084-.028a14.09 14.09 0 0 0 1.226-1.994a.076.076 0 0 0-.041-.106a13.107 13.107 0 0 1-1.872-.892a.077.077 0 0 1-.008-.128a10.2 10.2 0 0 0 .372-.292a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127a12.299 12.299 0 0 1-1.873.892a.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028a19.839 19.839 0 0 0 6.002-3.03a.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.956-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.955-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.946 2.418-2.157 2.418z%22/%3E%3C/svg%3E')",
|
||||
WebkitMaskRepeat: 'no-repeat',
|
||||
WebkitMaskPosition: 'center center',
|
||||
}}
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
return (
|
||||
<>
|
||||
<StructuredData
|
||||
title={page.data.title}
|
||||
description={page.data.description || ''}
|
||||
url={`${baseUrl}${page.url}`}
|
||||
lang={params.lang}
|
||||
breadcrumb={breadcrumbs}
|
||||
/>
|
||||
<DocsPage
|
||||
toc={page.data.toc}
|
||||
full={page.data.full}
|
||||
tableOfContent={{
|
||||
style: 'clerk',
|
||||
enabled: true,
|
||||
header: <div className='mb-2 font-medium text-sm'>On this page</div>,
|
||||
single: false,
|
||||
}}
|
||||
article={{
|
||||
className: 'scroll-smooth max-sm:pb-16',
|
||||
}}
|
||||
tableOfContentPopover={{
|
||||
style: 'clerk',
|
||||
enabled: true,
|
||||
}}
|
||||
footer={{
|
||||
enabled: true,
|
||||
component: <CustomFooter />,
|
||||
}}
|
||||
>
|
||||
<DocsTitle>{page.data.title}</DocsTitle>
|
||||
<DocsDescription>{page.data.description}</DocsDescription>
|
||||
<DocsBody>
|
||||
<MDX
|
||||
components={{
|
||||
...defaultMdxComponents,
|
||||
CodeBlock,
|
||||
}}
|
||||
/>
|
||||
</DocsBody>
|
||||
</DocsPage>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return source.generateParams()
|
||||
}
|
||||
|
||||
export async function generateMetadata(props: {
|
||||
params: Promise<{ slug?: string[]; lang: string }>
|
||||
}) {
|
||||
const params = await props.params
|
||||
const page = source.getPage(params.slug, params.lang)
|
||||
if (!page) notFound()
|
||||
|
||||
const baseUrl = 'https://docs.sim.ai'
|
||||
const fullUrl = `${baseUrl}${page.url}`
|
||||
|
||||
return {
|
||||
title: page.data.title,
|
||||
description:
|
||||
page.data.description || 'Sim visual workflow builder for AI applications documentation',
|
||||
keywords: [
|
||||
'AI workflow builder',
|
||||
'visual workflow editor',
|
||||
'AI automation',
|
||||
'workflow automation',
|
||||
'AI agents',
|
||||
'no-code AI',
|
||||
'drag and drop workflows',
|
||||
page.data.title?.toLowerCase().split(' '),
|
||||
]
|
||||
.flat()
|
||||
.filter(Boolean),
|
||||
authors: [{ name: 'Sim Team' }],
|
||||
category: 'Developer Tools',
|
||||
openGraph: {
|
||||
title: page.data.title,
|
||||
description:
|
||||
page.data.description || 'Sim visual workflow builder for AI applications documentation',
|
||||
url: fullUrl,
|
||||
siteName: 'Sim Documentation',
|
||||
type: 'article',
|
||||
locale: params.lang === 'en' ? 'en_US' : `${params.lang}_${params.lang.toUpperCase()}`,
|
||||
alternateLocale: ['en', 'es', 'fr', 'de', 'ja', 'zh']
|
||||
.filter((lang) => lang !== params.lang)
|
||||
.map((lang) => (lang === 'en' ? 'en_US' : `${lang}_${lang.toUpperCase()}`)),
|
||||
},
|
||||
twitter: {
|
||||
card: 'summary',
|
||||
title: page.data.title,
|
||||
description:
|
||||
page.data.description || 'Sim visual workflow builder for AI applications documentation',
|
||||
},
|
||||
robots: {
|
||||
index: true,
|
||||
follow: true,
|
||||
googleBot: {
|
||||
index: true,
|
||||
follow: true,
|
||||
'max-video-preview': -1,
|
||||
'max-image-preview': 'large',
|
||||
'max-snippet': -1,
|
||||
},
|
||||
},
|
||||
canonical: fullUrl,
|
||||
alternates: {
|
||||
canonical: fullUrl,
|
||||
languages: {
|
||||
'x-default': `${baseUrl}${page.url.replace(`/${params.lang}`, '')}`,
|
||||
en: `${baseUrl}${page.url.replace(`/${params.lang}`, '')}`,
|
||||
es: `${baseUrl}/es${page.url.replace(`/${params.lang}`, '')}`,
|
||||
fr: `${baseUrl}/fr${page.url.replace(`/${params.lang}`, '')}`,
|
||||
de: `${baseUrl}/de${page.url.replace(`/${params.lang}`, '')}`,
|
||||
ja: `${baseUrl}/ja${page.url.replace(`/${params.lang}`, '')}`,
|
||||
zh: `${baseUrl}/zh${page.url.replace(`/${params.lang}`, '')}`,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
140
apps/docs/app/[lang]/layout.tsx
Normal file
140
apps/docs/app/[lang]/layout.tsx
Normal file
@@ -0,0 +1,140 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import { defineI18nUI } from 'fumadocs-ui/i18n'
|
||||
import { DocsLayout } from 'fumadocs-ui/layouts/docs'
|
||||
import { RootProvider } from 'fumadocs-ui/provider/next'
|
||||
import { Geist_Mono, Inter } from 'next/font/google'
|
||||
import Image from 'next/image'
|
||||
import {
|
||||
SidebarFolder,
|
||||
SidebarItem,
|
||||
SidebarSeparator,
|
||||
} from '@/components/docs-layout/sidebar-components'
|
||||
import { Navbar } from '@/components/navbar/navbar'
|
||||
import { i18n } from '@/lib/i18n'
|
||||
import { source } from '@/lib/source'
|
||||
import '../global.css'
|
||||
import { Analytics } from '@vercel/analytics/next'
|
||||
|
||||
const inter = Inter({
|
||||
subsets: ['latin'],
|
||||
variable: '--font-geist-sans',
|
||||
})
|
||||
|
||||
const geistMono = Geist_Mono({
|
||||
subsets: ['latin'],
|
||||
variable: '--font-geist-mono',
|
||||
})
|
||||
|
||||
const { provider } = defineI18nUI(i18n, {
|
||||
translations: {
|
||||
en: {
|
||||
displayName: 'English',
|
||||
},
|
||||
es: {
|
||||
displayName: 'Español',
|
||||
},
|
||||
fr: {
|
||||
displayName: 'Français',
|
||||
},
|
||||
de: {
|
||||
displayName: 'Deutsch',
|
||||
},
|
||||
ja: {
|
||||
displayName: '日本語',
|
||||
},
|
||||
zh: {
|
||||
displayName: '简体中文',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
type LayoutProps = {
|
||||
children: ReactNode
|
||||
params: Promise<{ lang: string }>
|
||||
}
|
||||
|
||||
export default async function Layout({ children, params }: LayoutProps) {
|
||||
const { lang } = await params
|
||||
|
||||
const structuredData = {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebSite',
|
||||
name: 'Sim Documentation',
|
||||
description:
|
||||
'Comprehensive documentation for Sim - the visual workflow builder for AI Agent Workflows.',
|
||||
url: 'https://docs.sim.ai',
|
||||
publisher: {
|
||||
'@type': 'Organization',
|
||||
name: 'Sim',
|
||||
url: 'https://sim.ai',
|
||||
logo: {
|
||||
'@type': 'ImageObject',
|
||||
url: 'https://docs.sim.ai/static/logo.png',
|
||||
},
|
||||
},
|
||||
inLanguage: lang,
|
||||
potentialAction: {
|
||||
'@type': 'SearchAction',
|
||||
target: {
|
||||
'@type': 'EntryPoint',
|
||||
urlTemplate: 'https://docs.sim.ai/api/search?q={search_term_string}',
|
||||
},
|
||||
'query-input': 'required name=search_term_string',
|
||||
},
|
||||
}
|
||||
|
||||
return (
|
||||
<html
|
||||
lang={lang}
|
||||
className={`${inter.variable} ${geistMono.variable}`}
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<head>
|
||||
<script
|
||||
type='application/ld+json'
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(structuredData) }}
|
||||
/>
|
||||
</head>
|
||||
<body className='flex min-h-screen flex-col font-sans'>
|
||||
<RootProvider i18n={provider(lang)}>
|
||||
<Navbar />
|
||||
<DocsLayout
|
||||
tree={source.pageTree[lang]}
|
||||
themeSwitch={{
|
||||
enabled: false,
|
||||
}}
|
||||
nav={{
|
||||
title: (
|
||||
<Image
|
||||
src='/static/logo.png'
|
||||
alt='Sim'
|
||||
width={72}
|
||||
height={28}
|
||||
className='h-7 w-auto'
|
||||
priority
|
||||
/>
|
||||
),
|
||||
}}
|
||||
sidebar={{
|
||||
defaultOpenLevel: 0,
|
||||
collapsible: false,
|
||||
footer: null,
|
||||
banner: null,
|
||||
components: {
|
||||
Item: SidebarItem,
|
||||
Folder: SidebarFolder,
|
||||
Separator: SidebarSeparator,
|
||||
},
|
||||
}}
|
||||
containerProps={{
|
||||
className: '!pt-10',
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</DocsLayout>
|
||||
<Analytics />
|
||||
</RootProvider>
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
}
|
||||
@@ -4,6 +4,450 @@
|
||||
|
||||
@theme {
|
||||
--color-fd-primary: #802fff; /* Purple from control-bar component */
|
||||
--font-geist-sans: var(--font-geist-sans);
|
||||
--font-geist-mono: var(--font-geist-mono);
|
||||
}
|
||||
|
||||
/* Font family utilities */
|
||||
.font-sans {
|
||||
font-family: var(--font-geist-sans), ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
|
||||
"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
}
|
||||
|
||||
.font-mono {
|
||||
font-family: var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
||||
"Liberation Mono", "Courier New", monospace;
|
||||
}
|
||||
|
||||
/* Target any potential border classes */
|
||||
* {
|
||||
--fd-border-sidebar: transparent !important;
|
||||
}
|
||||
|
||||
/* Override any CSS custom properties for borders */
|
||||
:root {
|
||||
--fd-border: transparent !important;
|
||||
--fd-border-sidebar: transparent !important;
|
||||
--fd-nav-height: 64px; /* Custom navbar height (h-16 = 4rem = 64px) */
|
||||
/* Content container width used to center main content */
|
||||
--spacing-fd-container: 1400px;
|
||||
/* Edge gutter = leftover space on each side of centered container */
|
||||
--edge-gutter: max(1rem, calc((100vw - var(--spacing-fd-container)) / 2));
|
||||
/* Shift the sidebar slightly left from the content edge for extra breathing room */
|
||||
--sidebar-shift: 90px;
|
||||
--sidebar-offset: max(0px, calc(var(--edge-gutter) - var(--sidebar-shift)));
|
||||
--toc-offset: var(--edge-gutter);
|
||||
/* Sidebar and TOC have 20px internal padding - navbar accounts for this directly */
|
||||
/* Extra gap between sidebar/TOC and the main text content */
|
||||
--content-gap: 1.75rem;
|
||||
}
|
||||
|
||||
/* Remove custom layout variable overrides to fallback to fumadocs defaults */
|
||||
|
||||
/* ============================================
|
||||
Navbar Light Mode Styling
|
||||
============================================ */
|
||||
|
||||
/* Light mode navbar and search styling */
|
||||
:root:not(.dark) nav {
|
||||
background-color: hsla(0, 0%, 96%, 0.92) !important;
|
||||
backdrop-filter: blur(25px) saturate(180%) brightness(1.05) !important;
|
||||
-webkit-backdrop-filter: blur(25px) saturate(180%) brightness(1.05) !important;
|
||||
}
|
||||
|
||||
:root:not(.dark) nav button[type="button"] {
|
||||
background-color: hsla(0, 0%, 93%, 0.85) !important;
|
||||
backdrop-filter: blur(33px) saturate(180%) !important;
|
||||
-webkit-backdrop-filter: blur(33px) saturate(180%) !important;
|
||||
color: rgba(0, 0, 0, 0.6) !important;
|
||||
}
|
||||
|
||||
:root:not(.dark) nav button[type="button"] kbd {
|
||||
color: rgba(0, 0, 0, 0.6) !important;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
Custom Sidebar Styling (Turborepo-inspired)
|
||||
============================================ */
|
||||
|
||||
/* Floating sidebar appearance - remove background */
|
||||
[data-sidebar-container],
|
||||
#nd-sidebar {
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
border: none !important;
|
||||
--color-fd-muted: transparent !important;
|
||||
--color-fd-card: transparent !important;
|
||||
--color-fd-secondary: transparent !important;
|
||||
}
|
||||
|
||||
aside[data-sidebar],
|
||||
aside#nd-sidebar {
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
border: none !important;
|
||||
border-right: none !important;
|
||||
}
|
||||
|
||||
/* Responsive sidebar positioning */
|
||||
/* Mobile: Fumadocs handles drawer */
|
||||
@media (min-width: 768px) and (max-width: 1024px) {
|
||||
aside[data-sidebar],
|
||||
aside#nd-sidebar {
|
||||
left: var(--sidebar-offset) !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Desktop layout alignment */
|
||||
@media (min-width: 1025px) {
|
||||
[data-sidebar-container] {
|
||||
margin-left: var(--sidebar-offset) !important;
|
||||
}
|
||||
aside[data-sidebar],
|
||||
aside#nd-sidebar {
|
||||
left: var(--sidebar-offset) !important;
|
||||
}
|
||||
[data-toc] {
|
||||
margin-right: var(--toc-offset) !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Sidebar spacing - compact like turborepo */
|
||||
[data-sidebar-viewport] {
|
||||
padding: 0.5rem 20px 12px;
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
/* Override sidebar item styling to match Raindrop */
|
||||
/* Target Link and button elements in sidebar - override Fumadocs itemVariants */
|
||||
/* Exclude the small chevron-only toggle buttons */
|
||||
#nd-sidebar a,
|
||||
#nd-sidebar button:not([aria-label*="ollapse"]):not([aria-label*="xpand"]) {
|
||||
font-size: 0.9375rem !important; /* 15px to match Raindrop */
|
||||
line-height: 1.4 !important;
|
||||
padding: 0.5rem 0.75rem !important; /* More compact like Raindrop */
|
||||
font-weight: 400 !important;
|
||||
border-radius: 0.75rem !important; /* More rounded like Raindrop */
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
|
||||
sans-serif !important;
|
||||
}
|
||||
|
||||
/* Dark mode sidebar text */
|
||||
.dark #nd-sidebar a,
|
||||
.dark #nd-sidebar button:not([aria-label*="ollapse"]):not([aria-label*="xpand"]) {
|
||||
color: rgba(255, 255, 255, 0.6) !important;
|
||||
}
|
||||
|
||||
/* Light mode sidebar text */
|
||||
:root:not(.dark) #nd-sidebar a,
|
||||
:root:not(.dark) #nd-sidebar button:not([aria-label*="ollapse"]):not([aria-label*="xpand"]) {
|
||||
color: rgba(0, 0, 0, 0.6) !important;
|
||||
}
|
||||
|
||||
/* Make sure chevron icons are visible and properly styled */
|
||||
#nd-sidebar svg {
|
||||
display: inline-block !important;
|
||||
opacity: 0.6 !important;
|
||||
flex-shrink: 0 !important;
|
||||
width: 0.75rem !important;
|
||||
height: 0.75rem !important;
|
||||
}
|
||||
|
||||
/* Ensure the small chevron toggle buttons are visible */
|
||||
#nd-sidebar button[aria-label*="ollapse"],
|
||||
#nd-sidebar button[aria-label*="xpand"] {
|
||||
display: flex !important;
|
||||
opacity: 1 !important;
|
||||
padding: 0.25rem !important;
|
||||
}
|
||||
|
||||
/* Root-level spacing now handled by [data-sidebar-viewport] > * rule below */
|
||||
|
||||
/* Add tiny gap between nested items */
|
||||
#nd-sidebar ul li {
|
||||
margin-bottom: 0.0625rem !important;
|
||||
}
|
||||
|
||||
#nd-sidebar ul li:last-child {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
/* Section headers should be slightly larger */
|
||||
[data-sidebar-viewport] [data-separator] {
|
||||
font-size: 0.75rem !important;
|
||||
font-weight: 600 !important;
|
||||
text-transform: uppercase !important;
|
||||
letter-spacing: 0.05em !important;
|
||||
}
|
||||
|
||||
/* Override active state (NO PURPLE) */
|
||||
#nd-sidebar a[data-active="true"],
|
||||
#nd-sidebar button[data-active="true"],
|
||||
#nd-sidebar a.bg-fd-primary\/10,
|
||||
#nd-sidebar a.text-fd-primary,
|
||||
#nd-sidebar a[class*="bg-fd-primary"],
|
||||
#nd-sidebar a[class*="text-fd-primary"],
|
||||
/* Override custom sidebar purple classes */
|
||||
#nd-sidebar
|
||||
a.bg-purple-50\/80,
|
||||
#nd-sidebar a.text-purple-600,
|
||||
#nd-sidebar a[class*="bg-purple"],
|
||||
#nd-sidebar a[class*="text-purple"] {
|
||||
background-image: none !important;
|
||||
}
|
||||
|
||||
/* Dark mode active state */
|
||||
.dark #nd-sidebar a[data-active="true"],
|
||||
.dark #nd-sidebar button[data-active="true"],
|
||||
.dark #nd-sidebar a.bg-fd-primary\/10,
|
||||
.dark #nd-sidebar a.text-fd-primary,
|
||||
.dark #nd-sidebar a[class*="bg-fd-primary"],
|
||||
.dark #nd-sidebar a[class*="text-fd-primary"],
|
||||
.dark #nd-sidebar a.bg-purple-50\/80,
|
||||
.dark #nd-sidebar a.text-purple-600,
|
||||
.dark #nd-sidebar a[class*="bg-purple"],
|
||||
.dark #nd-sidebar a[class*="text-purple"] {
|
||||
background-color: rgba(255, 255, 255, 0.15) !important;
|
||||
color: rgba(255, 255, 255, 1) !important;
|
||||
}
|
||||
|
||||
/* Light mode active state */
|
||||
:root:not(.dark) #nd-sidebar a[data-active="true"],
|
||||
:root:not(.dark) #nd-sidebar button[data-active="true"],
|
||||
:root:not(.dark) #nd-sidebar a.bg-fd-primary\/10,
|
||||
:root:not(.dark) #nd-sidebar a.text-fd-primary,
|
||||
:root:not(.dark) #nd-sidebar a[class*="bg-fd-primary"],
|
||||
:root:not(.dark) #nd-sidebar a[class*="text-fd-primary"],
|
||||
:root:not(.dark) #nd-sidebar a.bg-purple-50\/80,
|
||||
:root:not(.dark) #nd-sidebar a.text-purple-600,
|
||||
:root:not(.dark) #nd-sidebar a[class*="bg-purple"],
|
||||
:root:not(.dark) #nd-sidebar a[class*="text-purple"] {
|
||||
background-color: rgba(0, 0, 0, 0.1) !important;
|
||||
color: rgba(0, 0, 0, 1) !important;
|
||||
}
|
||||
|
||||
/* Dark mode hover state */
|
||||
.dark #nd-sidebar a:hover:not([data-active="true"]),
|
||||
.dark #nd-sidebar button:hover:not([data-active="true"]) {
|
||||
background-color: rgba(255, 255, 255, 0.08) !important;
|
||||
}
|
||||
|
||||
/* Light mode hover state */
|
||||
:root:not(.dark) #nd-sidebar a:hover:not([data-active="true"]),
|
||||
:root:not(.dark) #nd-sidebar button:hover:not([data-active="true"]) {
|
||||
background-color: rgba(0, 0, 0, 0.06) !important;
|
||||
}
|
||||
|
||||
/* Dark mode - ensure active/selected items don't change on hover */
|
||||
.dark #nd-sidebar a.bg-purple-50\/80:hover,
|
||||
.dark #nd-sidebar a[class*="bg-purple"]:hover,
|
||||
.dark #nd-sidebar a[data-active="true"]:hover,
|
||||
.dark #nd-sidebar button[data-active="true"]:hover {
|
||||
background-color: rgba(255, 255, 255, 0.15) !important;
|
||||
color: rgba(255, 255, 255, 1) !important;
|
||||
}
|
||||
|
||||
/* Light mode - ensure active/selected items don't change on hover */
|
||||
:root:not(.dark) #nd-sidebar a.bg-purple-50\/80:hover,
|
||||
:root:not(.dark) #nd-sidebar a[class*="bg-purple"]:hover,
|
||||
:root:not(.dark) #nd-sidebar a[data-active="true"]:hover,
|
||||
:root:not(.dark) #nd-sidebar button[data-active="true"]:hover {
|
||||
background-color: rgba(0, 0, 0, 0.1) !important;
|
||||
color: rgba(0, 0, 0, 1) !important;
|
||||
}
|
||||
|
||||
/* Hide search, platform, and collapse button from sidebar completely */
|
||||
[data-sidebar] [data-search],
|
||||
[data-sidebar] .search-toggle,
|
||||
#nd-sidebar [data-search],
|
||||
#nd-sidebar .search-toggle,
|
||||
[data-sidebar-viewport] [data-search],
|
||||
[data-sidebar-viewport] button[data-search],
|
||||
aside[data-sidebar] [role="button"]:has([data-search]),
|
||||
aside[data-sidebar] > div > button:first-child,
|
||||
#nd-sidebar > div > button:first-child,
|
||||
[data-sidebar] a[href*="sim.ai"],
|
||||
#nd-sidebar a[href*="sim.ai"],
|
||||
[data-sidebar-viewport] a[href*="sim.ai"],
|
||||
/* Hide search buttons (but NOT folder chevron buttons) */
|
||||
aside[data-sidebar] > div:first-child
|
||||
> button:not([aria-label="Collapse"]):not([aria-label="Expand"]),
|
||||
#nd-sidebar > div:first-child > button:not([aria-label="Collapse"]):not([aria-label="Expand"]),
|
||||
/* Hide sidebar collapse button (panel icon) - direct children only */
|
||||
aside[data-sidebar] > button:first-of-type:not([aria-label="Collapse"]):not([aria-label="Expand"]),
|
||||
[data-sidebar]
|
||||
> button[type="button"]:first-of-type:not([aria-label="Collapse"]):not([aria-label="Expand"]),
|
||||
button[data-collapse]:not([aria-label="Collapse"]):not([aria-label="Expand"]),
|
||||
[data-sidebar-header] button,
|
||||
/* Hide theme toggle from sidebar footer */
|
||||
aside[data-sidebar] [data-theme-toggle],
|
||||
[data-sidebar-footer],
|
||||
[data-sidebar] footer,
|
||||
footer button[aria-label*="heme"],
|
||||
aside[data-sidebar] > div:last-child:has(button[aria-label*="heme"]),
|
||||
aside[data-sidebar] button[aria-label*="heme"],
|
||||
[data-sidebar] button[aria-label*="Theme"],
|
||||
/* Additional theme toggle selectors */
|
||||
aside[data-sidebar] > *:last-child
|
||||
button,
|
||||
[data-sidebar-viewport] ~ *,
|
||||
aside[data-sidebar] > div:not([data-sidebar-viewport]),
|
||||
/* Aggressive theme toggle hiding */
|
||||
aside[data-sidebar] svg[class*="sun"],
|
||||
aside[data-sidebar] svg[class*="moon"],
|
||||
aside[data-sidebar] button[type="button"]:last-child,
|
||||
aside button:has(svg:only-child),
|
||||
[data-sidebar] div:has(> button[type="button"]:only-child:last-child),
|
||||
/* Hide theme toggle and other non-content elements */
|
||||
aside[data-sidebar] > *:not([data-sidebar-viewport]) {
|
||||
display: none !important;
|
||||
visibility: hidden !important;
|
||||
opacity: 0 !important;
|
||||
height: 0 !important;
|
||||
max-height: 0 !important;
|
||||
overflow: hidden !important;
|
||||
pointer-events: none !important;
|
||||
position: absolute !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
/* Desktop only: Hide sidebar toggle buttons and nav title/logo (keep visible on mobile) */
|
||||
@media (min-width: 1025px) {
|
||||
[data-sidebar-container] > button,
|
||||
[data-sidebar-container] [data-toggle],
|
||||
aside[data-sidebar] [data-sidebar-toggle],
|
||||
button[data-sidebar-toggle],
|
||||
nav button[data-sidebar-toggle],
|
||||
button[aria-label="Toggle Sidebar"],
|
||||
button[aria-label="Collapse Sidebar"],
|
||||
/* Hide nav title/logo in sidebar on desktop - target all possible locations */
|
||||
aside[data-sidebar] a[href="/"],
|
||||
aside[data-sidebar] a[href="/"] img,
|
||||
aside[data-sidebar] > a:first-child,
|
||||
aside[data-sidebar] > div > a:first-child,
|
||||
aside[data-sidebar] img[alt="Sim"],
|
||||
[data-sidebar-header],
|
||||
[data-sidebar] [data-title],
|
||||
#nd-sidebar > a:first-child,
|
||||
#nd-sidebar > div:first-child > a:first-child,
|
||||
#nd-sidebar img[alt="Sim"] {
|
||||
display: none !important;
|
||||
visibility: hidden !important;
|
||||
height: 0 !important;
|
||||
max-height: 0 !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Extra aggressive - hide everything after the viewport */
|
||||
aside[data-sidebar] [data-sidebar-viewport] ~ * {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Tighter spacing for sidebar content */
|
||||
[data-sidebar-viewport] > * {
|
||||
margin-bottom: 0.0625rem;
|
||||
}
|
||||
|
||||
[data-sidebar-viewport] > *:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
[data-sidebar-viewport] ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Ensure sidebar starts with content immediately */
|
||||
aside[data-sidebar] > div:first-child {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
/* Remove all sidebar borders and backgrounds */
|
||||
[data-sidebar-container],
|
||||
aside[data-sidebar],
|
||||
[data-sidebar],
|
||||
[data-sidebar] *,
|
||||
#nd-sidebar,
|
||||
#nd-sidebar * {
|
||||
border: none !important;
|
||||
border-right: none !important;
|
||||
border-left: none !important;
|
||||
border-top: none !important;
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
/* Override fumadocs background colors for sidebar */
|
||||
.dark #nd-sidebar,
|
||||
.dark [data-sidebar-container],
|
||||
.dark aside[data-sidebar] {
|
||||
--color-fd-muted: transparent !important;
|
||||
--color-fd-secondary: transparent !important;
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
/* Force normal text flow in sidebar */
|
||||
[data-sidebar],
|
||||
[data-sidebar] *,
|
||||
[data-sidebar-viewport],
|
||||
[data-sidebar-viewport] * {
|
||||
writing-mode: horizontal-tb !important;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
Code Block Styling (Improved)
|
||||
============================================ */
|
||||
|
||||
/* Apply Geist Mono to code elements */
|
||||
code,
|
||||
pre,
|
||||
pre code {
|
||||
font-family: var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
||||
"Liberation Mono", "Courier New", monospace;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre) > code {
|
||||
padding: 0.2em 0.4em;
|
||||
border-radius: 0.25rem;
|
||||
font-size: 0.875em;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* Light mode inline code */
|
||||
:root:not(.dark) :not(pre) > code {
|
||||
background-color: rgb(243 244 246);
|
||||
color: rgb(220 38 38);
|
||||
border: 1px solid rgb(229 231 235);
|
||||
}
|
||||
|
||||
/* Dark mode inline code */
|
||||
.dark :not(pre) > code {
|
||||
background-color: rgb(31 41 55);
|
||||
color: rgb(248 113 113);
|
||||
border: 1px solid rgb(55 65 81);
|
||||
}
|
||||
|
||||
/* Code block container improvements */
|
||||
pre {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.7;
|
||||
tab-size: 2;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
pre code {
|
||||
display: block;
|
||||
width: fit-content;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
/* Syntax highlighting adjustments for better readability */
|
||||
pre code .line {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
/* Custom text highlighting styles */
|
||||
@@ -16,6 +460,62 @@
|
||||
color: var(--color-fd-primary);
|
||||
}
|
||||
|
||||
/* Add bottom spacing to prevent abrupt page endings */
|
||||
[data-content] {
|
||||
padding-top: 1.5rem !important;
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
|
||||
/* Alternative fallback for different Fumadocs versions */
|
||||
main article,
|
||||
.docs-page main {
|
||||
padding-top: 1.5rem !important;
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
Center and Constrain Main Content Width
|
||||
============================================ */
|
||||
|
||||
/* Main content area - center and constrain like turborepo/raindrop */
|
||||
main[data-main] {
|
||||
max-width: var(--spacing-fd-container, 1400px);
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-top: 1rem;
|
||||
padding-left: calc(var(--sidebar-offset) + var(--content-gap));
|
||||
padding-right: calc(var(--toc-offset) + var(--content-gap));
|
||||
order: 1 !important;
|
||||
}
|
||||
|
||||
/* Adjust for smaller screens */
|
||||
@media (max-width: 768px) {
|
||||
main[data-main] {
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Ensure docs page content is properly constrained */
|
||||
[data-docs-page] {
|
||||
max-width: 1400px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-top: 1.5rem !important;
|
||||
}
|
||||
|
||||
/* Override Fumadocs default content padding */
|
||||
article[data-content],
|
||||
div[data-content] {
|
||||
padding-top: 1.5rem !important;
|
||||
}
|
||||
|
||||
/* Remove any unwanted borders/outlines from video elements */
|
||||
video {
|
||||
outline: none !important;
|
||||
border-style: solid !important;
|
||||
}
|
||||
|
||||
/* Tailwind v4 content sources */
|
||||
@source '../app/**/*.{js,ts,jsx,tsx,mdx}';
|
||||
@source '../components/**/*.{js,ts,jsx,tsx,mdx}';
|
||||
|
||||
@@ -1,30 +1,38 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import { RootProvider } from 'fumadocs-ui/provider'
|
||||
import { Inter } from 'next/font/google'
|
||||
import './global.css'
|
||||
import { Analytics } from '@vercel/analytics/next'
|
||||
|
||||
const inter = Inter({
|
||||
subsets: ['latin'],
|
||||
})
|
||||
|
||||
export default function Layout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<html lang='en' className={inter.className} suppressHydrationWarning>
|
||||
<body className='flex min-h-screen flex-col'>
|
||||
<RootProvider>
|
||||
{children}
|
||||
<Analytics />
|
||||
</RootProvider>
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
return children
|
||||
}
|
||||
|
||||
export const metadata = {
|
||||
title: 'Sim',
|
||||
metadataBase: new URL('https://docs.sim.ai'),
|
||||
title: {
|
||||
default: 'Sim Documentation - Visual Workflow Builder for AI Applications',
|
||||
template: '%s',
|
||||
},
|
||||
description:
|
||||
'Build agents in seconds with a drag and drop workflow builder. Access comprehensive documentation to help you create efficient workflows and maximize your automation capabilities.',
|
||||
'Comprehensive documentation for Sim - the visual workflow builder for AI applications. Create powerful AI agents, automation workflows, and data processing pipelines by connecting blocks on a canvas—no coding required.',
|
||||
keywords: [
|
||||
'AI workflow builder',
|
||||
'visual workflow editor',
|
||||
'AI automation',
|
||||
'workflow automation',
|
||||
'AI agents',
|
||||
'no-code AI',
|
||||
'drag and drop workflows',
|
||||
'AI integrations',
|
||||
'workflow canvas',
|
||||
'AI Agent Workflow Builder',
|
||||
'workflow orchestration',
|
||||
'agent builder',
|
||||
'AI workflow automation',
|
||||
'visual programming',
|
||||
],
|
||||
authors: [{ name: 'Sim Team', url: 'https://sim.ai' }],
|
||||
creator: 'Sim',
|
||||
publisher: 'Sim',
|
||||
category: 'Developer Tools',
|
||||
classification: 'Developer Documentation',
|
||||
manifest: '/favicon/site.webmanifest',
|
||||
icons: {
|
||||
icon: [
|
||||
@@ -39,4 +47,46 @@ export const metadata = {
|
||||
statusBarStyle: 'default',
|
||||
title: 'Sim Docs',
|
||||
},
|
||||
openGraph: {
|
||||
type: 'website',
|
||||
locale: 'en_US',
|
||||
alternateLocale: ['es_ES', 'fr_FR', 'de_DE', 'ja_JP', 'zh_CN'],
|
||||
url: 'https://docs.sim.ai',
|
||||
siteName: 'Sim Documentation',
|
||||
title: 'Sim Documentation - Visual Workflow Builder for AI Applications',
|
||||
description:
|
||||
'Comprehensive documentation for Sim - the visual workflow builder for AI applications. Create powerful AI agents, automation workflows, and data processing pipelines.',
|
||||
},
|
||||
twitter: {
|
||||
card: 'summary_large_image',
|
||||
title: 'Sim Documentation - Visual Workflow Builder for AI Applications',
|
||||
description:
|
||||
'Comprehensive documentation for Sim - the visual workflow builder for AI applications.',
|
||||
creator: '@simdotai',
|
||||
site: '@simdotai',
|
||||
images: ['/og-image.png'],
|
||||
},
|
||||
robots: {
|
||||
index: true,
|
||||
follow: true,
|
||||
googleBot: {
|
||||
index: true,
|
||||
follow: true,
|
||||
'max-video-preview': -1,
|
||||
'max-image-preview': 'large',
|
||||
'max-snippet': -1,
|
||||
},
|
||||
},
|
||||
alternates: {
|
||||
canonical: 'https://docs.sim.ai',
|
||||
languages: {
|
||||
'x-default': 'https://docs.sim.ai',
|
||||
en: 'https://docs.sim.ai',
|
||||
es: 'https://docs.sim.ai/es',
|
||||
fr: 'https://docs.sim.ai/fr',
|
||||
de: 'https://docs.sim.ai/de',
|
||||
ja: 'https://docs.sim.ai/ja',
|
||||
zh: 'https://docs.sim.ai/zh',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
31
apps/docs/app/llms-full.txt/route.ts
Normal file
31
apps/docs/app/llms-full.txt/route.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { getLLMText } from '@/lib/llms'
|
||||
import { source } from '@/lib/source'
|
||||
|
||||
export const revalidate = false
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const pages = source.getPages().filter((page) => {
|
||||
if (!page || !page.data || !page.url) return false
|
||||
|
||||
const pathParts = page.url.split('/').filter(Boolean)
|
||||
const hasLangPrefix = pathParts[0] && ['es', 'fr', 'de', 'ja', 'zh'].includes(pathParts[0])
|
||||
|
||||
return !hasLangPrefix
|
||||
})
|
||||
|
||||
const scan = pages.map((page) => getLLMText(page))
|
||||
const scanned = await Promise.all(scan)
|
||||
|
||||
const filtered = scanned.filter((text) => text && text.length > 0)
|
||||
|
||||
return new Response(filtered.join('\n\n---\n\n'), {
|
||||
headers: {
|
||||
'Content-Type': 'text/plain; charset=utf-8',
|
||||
},
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('Error generating LLM full text:', error)
|
||||
return new Response('Error generating full documentation text', { status: 500 })
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,87 @@
|
||||
import { getLLMText } from '@/lib/llms'
|
||||
import { source } from '@/lib/source'
|
||||
|
||||
// cached forever
|
||||
export const revalidate = false
|
||||
|
||||
export async function GET() {
|
||||
const scan = source.getPages().map(getLLMText)
|
||||
const scanned = await Promise.all(scan)
|
||||
const baseUrl = 'https://docs.sim.ai'
|
||||
|
||||
return new Response(scanned.join('\n\n'))
|
||||
try {
|
||||
const pages = source.getPages().filter((page) => {
|
||||
if (!page || !page.data || !page.url) return false
|
||||
|
||||
const pathParts = page.url.split('/').filter(Boolean)
|
||||
const hasLangPrefix = pathParts[0] && ['es', 'fr', 'de', 'ja', 'zh'].includes(pathParts[0])
|
||||
|
||||
return !hasLangPrefix
|
||||
})
|
||||
|
||||
const sections: Record<string, Array<{ title: string; url: string; description?: string }>> = {}
|
||||
|
||||
pages.forEach((page) => {
|
||||
const pathParts = page.url.split('/').filter(Boolean)
|
||||
const section =
|
||||
pathParts[0] && ['en', 'es', 'fr', 'de', 'ja', 'zh'].includes(pathParts[0])
|
||||
? pathParts[1] || 'root'
|
||||
: pathParts[0] || 'root'
|
||||
|
||||
if (!sections[section]) {
|
||||
sections[section] = []
|
||||
}
|
||||
|
||||
sections[section].push({
|
||||
title: page.data.title || 'Untitled',
|
||||
url: `${baseUrl}${page.url}`,
|
||||
description: page.data.description,
|
||||
})
|
||||
})
|
||||
|
||||
const manifest = `# Sim Documentation
|
||||
|
||||
> Visual Workflow Builder for AI Applications
|
||||
|
||||
Sim is a visual workflow builder for AI applications that lets you build AI agent workflows visually. Create powerful AI agents, automation workflows, and data processing pipelines by connecting blocks on a canvas—no coding required.
|
||||
|
||||
## Documentation Overview
|
||||
|
||||
This file provides an overview of our documentation. For full content of all pages, see ${baseUrl}/llms-full.txt
|
||||
|
||||
## Main Sections
|
||||
|
||||
${Object.entries(sections)
|
||||
.map(([section, items]) => {
|
||||
const sectionTitle = section
|
||||
.split('-')
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
||||
.join(' ')
|
||||
return `### ${sectionTitle}\n\n${items.map((item) => `- ${item.title}: ${item.url}${item.description ? `\n ${item.description}` : ''}`).join('\n')}`
|
||||
})
|
||||
.join('\n\n')}
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- Full documentation content: ${baseUrl}/llms-full.txt
|
||||
- Individual page content: ${baseUrl}/llms.mdx/[page-path]
|
||||
- API documentation: ${baseUrl}/sdks/
|
||||
- Tool integrations: ${baseUrl}/tools/
|
||||
|
||||
## Statistics
|
||||
|
||||
- Total pages: ${pages.length} (English only)
|
||||
- Other languages available at: ${baseUrl}/[lang]/ (es, fr, de, ja, zh)
|
||||
|
||||
---
|
||||
|
||||
Generated: ${new Date().toISOString()}
|
||||
Format: llms.txt v0.1.0
|
||||
See: https://llmstxt.org for specification`
|
||||
|
||||
return new Response(manifest, {
|
||||
headers: {
|
||||
'Content-Type': 'text/plain; charset=utf-8',
|
||||
},
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('Error generating LLM manifest:', error)
|
||||
return new Response('Error generating documentation manifest', { status: 500 })
|
||||
}
|
||||
}
|
||||
|
||||
100
apps/docs/app/robots.txt/route.ts
Normal file
100
apps/docs/app/robots.txt/route.ts
Normal file
@@ -0,0 +1,100 @@
|
||||
export const revalidate = false
|
||||
|
||||
export async function GET() {
|
||||
const baseUrl = 'https://docs.sim.ai'
|
||||
|
||||
const robotsTxt = `# Robots.txt for Sim Documentation
|
||||
# Generated on ${new Date().toISOString()}
|
||||
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
# Search engine crawlers
|
||||
User-agent: Googlebot
|
||||
Allow: /
|
||||
|
||||
User-agent: Bingbot
|
||||
Allow: /
|
||||
|
||||
User-agent: Slurp
|
||||
Allow: /
|
||||
|
||||
User-agent: DuckDuckBot
|
||||
Allow: /
|
||||
|
||||
User-agent: Baiduspider
|
||||
Allow: /
|
||||
|
||||
User-agent: YandexBot
|
||||
Allow: /
|
||||
|
||||
# AI and LLM crawlers - explicitly allowed for documentation indexing
|
||||
User-agent: GPTBot
|
||||
Allow: /
|
||||
|
||||
User-agent: ChatGPT-User
|
||||
Allow: /
|
||||
|
||||
User-agent: CCBot
|
||||
Allow: /
|
||||
|
||||
User-agent: anthropic-ai
|
||||
Allow: /
|
||||
|
||||
User-agent: Claude-Web
|
||||
Allow: /
|
||||
|
||||
User-agent: Applebot
|
||||
Allow: /
|
||||
|
||||
User-agent: PerplexityBot
|
||||
Allow: /
|
||||
|
||||
User-agent: Diffbot
|
||||
Allow: /
|
||||
|
||||
User-agent: FacebookBot
|
||||
Allow: /
|
||||
|
||||
User-agent: cohere-ai
|
||||
Allow: /
|
||||
|
||||
# Disallow admin and internal paths (if any exist)
|
||||
Disallow: /.next/
|
||||
Disallow: /api/internal/
|
||||
Disallow: /_next/static/
|
||||
Disallow: /admin/
|
||||
|
||||
# Allow but don't prioritize these
|
||||
Allow: /api/search
|
||||
Allow: /llms.txt
|
||||
Allow: /llms-full.txt
|
||||
Allow: /llms.mdx/
|
||||
|
||||
# Sitemaps
|
||||
Sitemap: ${baseUrl}/sitemap.xml
|
||||
|
||||
# Crawl delay for aggressive bots (optional)
|
||||
# Crawl-delay: 1
|
||||
|
||||
# Additional resources for AI indexing
|
||||
# See https://github.com/AnswerDotAI/llms-txt for more info
|
||||
# LLM-friendly content:
|
||||
# Manifest: ${baseUrl}/llms.txt
|
||||
# Full content: ${baseUrl}/llms-full.txt
|
||||
# Individual pages: ${baseUrl}/llms.mdx/[page-path]
|
||||
|
||||
# Multi-language documentation available at:
|
||||
# ${baseUrl}/en - English
|
||||
# ${baseUrl}/es - Español
|
||||
# ${baseUrl}/fr - Français
|
||||
# ${baseUrl}/de - Deutsch
|
||||
# ${baseUrl}/ja - 日本語
|
||||
# ${baseUrl}/zh - 简体中文`
|
||||
|
||||
return new Response(robotsTxt, {
|
||||
headers: {
|
||||
'Content-Type': 'text/plain',
|
||||
},
|
||||
})
|
||||
}
|
||||
63
apps/docs/app/sitemap.xml/route.ts
Normal file
63
apps/docs/app/sitemap.xml/route.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import { i18n } from '@/lib/i18n'
|
||||
import { source } from '@/lib/source'
|
||||
|
||||
export const revalidate = false
|
||||
|
||||
export async function GET() {
|
||||
const baseUrl = 'https://docs.sim.ai'
|
||||
|
||||
const allPages = source.getPages()
|
||||
|
||||
const getPriority = (url: string): string => {
|
||||
if (url === '/introduction' || url === '/') return '1.0'
|
||||
if (url === '/getting-started') return '0.9'
|
||||
if (url.match(/^\/[^/]+$/)) return '0.8'
|
||||
if (url.includes('/sdks/') || url.includes('/tools/')) return '0.7'
|
||||
return '0.6'
|
||||
}
|
||||
|
||||
const urls = allPages
|
||||
.flatMap((page) => {
|
||||
const urlWithoutLang = page.url.replace(/^\/[a-z]{2}\//, '/')
|
||||
|
||||
return i18n.languages.map((lang) => {
|
||||
const url =
|
||||
lang === i18n.defaultLanguage
|
||||
? `${baseUrl}${urlWithoutLang}`
|
||||
: `${baseUrl}/${lang}${urlWithoutLang}`
|
||||
|
||||
return ` <url>
|
||||
<loc>${url}</loc>
|
||||
<lastmod>${new Date().toISOString().split('T')[0]}</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>${getPriority(urlWithoutLang)}</priority>
|
||||
${i18n.languages.length > 1 ? generateAlternateLinks(baseUrl, urlWithoutLang) : ''}
|
||||
</url>`
|
||||
})
|
||||
})
|
||||
.join('\n')
|
||||
|
||||
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
${urls}
|
||||
</urlset>`
|
||||
|
||||
return new Response(sitemap, {
|
||||
headers: {
|
||||
'Content-Type': 'application/xml',
|
||||
'Cache-Control': 'public, max-age=3600, s-maxage=3600',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
function generateAlternateLinks(baseUrl: string, urlWithoutLang: string): string {
|
||||
return i18n.languages
|
||||
.map((lang) => {
|
||||
const url =
|
||||
lang === i18n.defaultLanguage
|
||||
? `${baseUrl}${urlWithoutLang}`
|
||||
: `${baseUrl}/${lang}${urlWithoutLang}`
|
||||
return ` <xhtml:link rel="alternate" hreflang="${lang}" href="${url}" />`
|
||||
})
|
||||
.join('\n')
|
||||
}
|
||||
134
apps/docs/components/docs-layout/sidebar-components.tsx
Normal file
134
apps/docs/components/docs-layout/sidebar-components.tsx
Normal file
@@ -0,0 +1,134 @@
|
||||
'use client'
|
||||
|
||||
import { type ReactNode, useState } from 'react'
|
||||
import type { PageTree } from 'fumadocs-core/server'
|
||||
import { ChevronRight } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import { usePathname } from 'next/navigation'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function isActive(url: string, pathname: string, nested = true): boolean {
|
||||
return url === pathname || (nested && pathname.startsWith(`${url}/`))
|
||||
}
|
||||
|
||||
export function SidebarItem({ item }: { item: PageTree.Item }) {
|
||||
const pathname = usePathname()
|
||||
const active = isActive(item.url, pathname, false)
|
||||
|
||||
return (
|
||||
<li className='mb-[0.0625rem] list-none'>
|
||||
<Link
|
||||
href={item.url}
|
||||
className={cn(
|
||||
'block rounded-md px-2.5 py-1.5 font-normal text-[13px] leading-tight transition-colors',
|
||||
'text-gray-600 dark:text-gray-400',
|
||||
!active && 'hover:bg-gray-100/60 dark:hover:bg-gray-800/40',
|
||||
active &&
|
||||
'bg-purple-50/80 font-medium text-purple-600 dark:bg-purple-900/15 dark:text-purple-400'
|
||||
)}
|
||||
>
|
||||
{item.name}
|
||||
</Link>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
||||
export function SidebarFolder({
|
||||
item,
|
||||
level,
|
||||
children,
|
||||
}: {
|
||||
item: PageTree.Folder
|
||||
level: number
|
||||
children: ReactNode
|
||||
}) {
|
||||
const pathname = usePathname()
|
||||
const hasActiveChild = checkHasActiveChild(item, pathname)
|
||||
const [open, setOpen] = useState(hasActiveChild)
|
||||
|
||||
return (
|
||||
<li className='mb-[0.0625rem] list-none'>
|
||||
{item.index ? (
|
||||
<div className='flex items-center gap-0.5'>
|
||||
<Link
|
||||
href={item.index.url}
|
||||
className={cn(
|
||||
'block flex-1 rounded-md px-2.5 py-1.5 font-medium text-[13px] leading-tight transition-colors',
|
||||
'text-gray-800 dark:text-gray-200',
|
||||
!isActive(item.index.url, pathname, false) &&
|
||||
'hover:bg-gray-100/60 dark:hover:bg-gray-800/40',
|
||||
isActive(item.index.url, pathname, false) &&
|
||||
'bg-purple-50/80 text-purple-600 dark:bg-purple-900/15 dark:text-purple-400'
|
||||
)}
|
||||
>
|
||||
{item.name}
|
||||
</Link>
|
||||
<button
|
||||
onClick={() => setOpen(!open)}
|
||||
className='rounded p-1 transition-colors hover:bg-gray-100/60 dark:hover:bg-gray-800/40'
|
||||
aria-label={open ? 'Collapse' : 'Expand'}
|
||||
>
|
||||
<ChevronRight
|
||||
className={cn(
|
||||
'h-3 w-3 text-gray-400 transition-transform duration-200 ease-in-out dark:text-gray-500',
|
||||
open && 'rotate-90'
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<button
|
||||
onClick={() => setOpen(!open)}
|
||||
className={cn(
|
||||
'flex w-full items-center justify-between rounded-md px-2.5 py-1.5 text-left font-medium text-[13px] leading-tight transition-colors',
|
||||
'hover:bg-gray-100/60 dark:hover:bg-gray-800/40',
|
||||
'text-gray-800 dark:text-gray-200'
|
||||
)}
|
||||
>
|
||||
<span>{item.name}</span>
|
||||
<ChevronRight
|
||||
className={cn(
|
||||
'ml-auto h-3 w-3 flex-shrink-0 text-gray-400 transition-transform duration-200 ease-in-out dark:text-gray-500',
|
||||
open && 'rotate-90'
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
)}
|
||||
<div
|
||||
className={cn(
|
||||
'overflow-hidden transition-all duration-200 ease-in-out',
|
||||
open ? 'max-h-[10000px] opacity-100' : 'max-h-0 opacity-0'
|
||||
)}
|
||||
>
|
||||
<ul className='mt-0.5 ml-2 space-y-[0.0625rem] border-gray-200/60 border-l pl-2.5 dark:border-gray-700/60'>
|
||||
{children}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
||||
export function SidebarSeparator({ item }: { item: PageTree.Separator }) {
|
||||
return (
|
||||
<p className='mt-4 mb-1.5 px-2.5 font-semibold text-[10px] text-gray-500/80 uppercase tracking-wide dark:text-gray-500'>
|
||||
{item.name}
|
||||
</p>
|
||||
)
|
||||
}
|
||||
|
||||
function checkHasActiveChild(node: PageTree.Folder, pathname: string): boolean {
|
||||
if (node.index && isActive(node.index.url, pathname)) {
|
||||
return true
|
||||
}
|
||||
|
||||
for (const child of node.children) {
|
||||
if (child.type === 'page' && isActive(child.url, pathname)) {
|
||||
return true
|
||||
}
|
||||
if (child.type === 'folder' && checkHasActiveChild(child, pathname)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import defaultMdxComponents from 'fumadocs-ui/mdx'
|
||||
import { ThemeImage } from './ui/theme-image'
|
||||
|
||||
// Extend the default MDX components with our custom components
|
||||
const mdxComponents = {
|
||||
...defaultMdxComponents,
|
||||
ThemeImage,
|
||||
}
|
||||
|
||||
export default mdxComponents
|
||||
67
apps/docs/components/navbar/navbar.tsx
Normal file
67
apps/docs/components/navbar/navbar.tsx
Normal file
@@ -0,0 +1,67 @@
|
||||
'use client'
|
||||
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import { LanguageDropdown } from '@/components/ui/language-dropdown'
|
||||
import { SearchTrigger } from '@/components/ui/search-trigger'
|
||||
import { ThemeToggle } from '@/components/ui/theme-toggle'
|
||||
|
||||
export function Navbar() {
|
||||
return (
|
||||
<nav
|
||||
className='sticky top-0 z-50 border-border/50 border-b'
|
||||
style={{
|
||||
backgroundColor: 'hsla(0, 0%, 7.04%, 0.92)',
|
||||
backdropFilter: 'blur(25px) saturate(180%) brightness(0.6)',
|
||||
WebkitBackdropFilter: 'blur(25px) saturate(180%) brightness(0.6)',
|
||||
}}
|
||||
>
|
||||
{/* Desktop: Single row layout */}
|
||||
<div className='hidden h-16 w-full items-center lg:flex'>
|
||||
<div
|
||||
className='grid w-full grid-cols-[auto_1fr_auto] items-center'
|
||||
style={{
|
||||
paddingLeft: 'calc(var(--sidebar-offset) + 20px)',
|
||||
paddingRight: 'calc(var(--toc-offset) + 20px)',
|
||||
}}
|
||||
>
|
||||
{/* Left cluster: translate by sidebar delta to align with sidebar edge */}
|
||||
<div className='flex items-center'>
|
||||
<Link href='/' className='flex min-w-[100px] items-center'>
|
||||
<Image
|
||||
src='/static/logo.png'
|
||||
alt='Sim'
|
||||
width={72}
|
||||
height={28}
|
||||
className='h-7 w-auto'
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* Center cluster: search */}
|
||||
<div className='flex flex-1 items-center justify-center pl-32'>
|
||||
<SearchTrigger />
|
||||
</div>
|
||||
|
||||
{/* Right cluster aligns with TOC edge using the same right gutter */}
|
||||
<div className='flex items-center gap-4'>
|
||||
<Link
|
||||
href='https://sim.ai'
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
className='rounded-xl px-3 py-2 font-normal text-[0.9375rem] text-foreground/60 leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground'
|
||||
style={{
|
||||
fontFamily:
|
||||
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
||||
}}
|
||||
>
|
||||
Platform
|
||||
</Link>
|
||||
<LanguageDropdown />
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
)
|
||||
}
|
||||
174
apps/docs/components/structured-data.tsx
Normal file
174
apps/docs/components/structured-data.tsx
Normal file
@@ -0,0 +1,174 @@
|
||||
import Script from 'next/script'
|
||||
|
||||
interface StructuredDataProps {
|
||||
title: string
|
||||
description: string
|
||||
url: string
|
||||
lang: string
|
||||
dateModified?: string
|
||||
breadcrumb?: Array<{ name: string; url: string }>
|
||||
}
|
||||
|
||||
export function StructuredData({
|
||||
title,
|
||||
description,
|
||||
url,
|
||||
lang,
|
||||
dateModified,
|
||||
breadcrumb,
|
||||
}: StructuredDataProps) {
|
||||
const baseUrl = 'https://docs.sim.ai'
|
||||
|
||||
const articleStructuredData = {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'TechArticle',
|
||||
headline: title,
|
||||
description: description,
|
||||
url: url,
|
||||
datePublished: dateModified || new Date().toISOString(),
|
||||
dateModified: dateModified || new Date().toISOString(),
|
||||
author: {
|
||||
'@type': 'Organization',
|
||||
name: 'Sim Team',
|
||||
url: baseUrl,
|
||||
},
|
||||
publisher: {
|
||||
'@type': 'Organization',
|
||||
name: 'Sim',
|
||||
url: baseUrl,
|
||||
logo: {
|
||||
'@type': 'ImageObject',
|
||||
url: `${baseUrl}/static/logo.png`,
|
||||
},
|
||||
},
|
||||
mainEntityOfPage: {
|
||||
'@type': 'WebPage',
|
||||
'@id': url,
|
||||
},
|
||||
inLanguage: lang,
|
||||
isPartOf: {
|
||||
'@type': 'WebSite',
|
||||
name: 'Sim Documentation',
|
||||
url: baseUrl,
|
||||
},
|
||||
potentialAction: {
|
||||
'@type': 'ReadAction',
|
||||
target: url,
|
||||
},
|
||||
}
|
||||
|
||||
const breadcrumbStructuredData = breadcrumb && {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'BreadcrumbList',
|
||||
itemListElement: breadcrumb.map((item, index) => ({
|
||||
'@type': 'ListItem',
|
||||
position: index + 1,
|
||||
name: item.name,
|
||||
item: item.url,
|
||||
})),
|
||||
}
|
||||
|
||||
const websiteStructuredData = url === baseUrl && {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebSite',
|
||||
name: 'Sim Documentation',
|
||||
url: baseUrl,
|
||||
description:
|
||||
'Comprehensive documentation for Sim visual workflow builder for AI applications. Create powerful AI agents, automation workflows, and data processing pipelines.',
|
||||
publisher: {
|
||||
'@type': 'Organization',
|
||||
name: 'Sim',
|
||||
url: baseUrl,
|
||||
},
|
||||
potentialAction: {
|
||||
'@type': 'SearchAction',
|
||||
target: {
|
||||
'@type': 'EntryPoint',
|
||||
urlTemplate: `${baseUrl}/search?q={search_term_string}`,
|
||||
},
|
||||
'query-input': 'required name=search_term_string',
|
||||
},
|
||||
inLanguage: ['en', 'es', 'fr', 'de', 'ja', 'zh'],
|
||||
}
|
||||
|
||||
const faqStructuredData = title.toLowerCase().includes('faq') && {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'FAQPage',
|
||||
mainEntity: [],
|
||||
}
|
||||
|
||||
const softwareStructuredData = {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'SoftwareApplication',
|
||||
name: 'Sim',
|
||||
applicationCategory: 'DeveloperApplication',
|
||||
operatingSystem: 'Any',
|
||||
description:
|
||||
'Visual workflow builder for AI applications. Create powerful AI agents, automation workflows, and data processing pipelines by connecting blocks on a canvas—no coding required.',
|
||||
url: baseUrl,
|
||||
author: {
|
||||
'@type': 'Organization',
|
||||
name: 'Sim Team',
|
||||
},
|
||||
offers: {
|
||||
'@type': 'Offer',
|
||||
category: 'Developer Tools',
|
||||
},
|
||||
featureList: [
|
||||
'Visual workflow builder with drag-and-drop interface',
|
||||
'AI agent creation and automation',
|
||||
'80+ built-in integrations',
|
||||
'Real-time team collaboration',
|
||||
'Multiple deployment options',
|
||||
'Custom integrations via MCP protocol',
|
||||
],
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Script
|
||||
id='article-structured-data'
|
||||
type='application/ld+json'
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(articleStructuredData),
|
||||
}}
|
||||
/>
|
||||
{breadcrumbStructuredData && (
|
||||
<Script
|
||||
id='breadcrumb-structured-data'
|
||||
type='application/ld+json'
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(breadcrumbStructuredData),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{websiteStructuredData && (
|
||||
<Script
|
||||
id='website-structured-data'
|
||||
type='application/ld+json'
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(websiteStructuredData),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{faqStructuredData && (
|
||||
<Script
|
||||
id='faq-structured-data'
|
||||
type='application/ld+json'
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(faqStructuredData),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{url === baseUrl && (
|
||||
<Script
|
||||
id='software-structured-data'
|
||||
type='application/ld+json'
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(softwareStructuredData),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
import {
|
||||
AgentIcon,
|
||||
ApiIcon,
|
||||
ChartBarIcon,
|
||||
CodeIcon,
|
||||
ConditionalIcon,
|
||||
ConnectIcon,
|
||||
ResponseIcon,
|
||||
} from '@/components/icons'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
// Custom Feature component specifically for BlockTypes to handle the 6-item layout
|
||||
const BlockFeature = ({
|
||||
title,
|
||||
description,
|
||||
icon,
|
||||
href,
|
||||
index,
|
||||
totalItems,
|
||||
itemsPerRow,
|
||||
}: {
|
||||
title: string
|
||||
description: string
|
||||
icon: React.ReactNode
|
||||
href?: string
|
||||
index: number
|
||||
totalItems: number
|
||||
itemsPerRow: number
|
||||
}) => {
|
||||
const blockColor = {
|
||||
'--block-color':
|
||||
title === 'Agent'
|
||||
? '#8b5cf6'
|
||||
: title === 'API'
|
||||
? '#3b82f6'
|
||||
: title === 'Condition'
|
||||
? '#f59e0b'
|
||||
: title === 'Function'
|
||||
? '#10b981'
|
||||
: title === 'Router'
|
||||
? '#6366f1'
|
||||
: title === 'Evaluator'
|
||||
? '#ef4444'
|
||||
: '#8b5cf6',
|
||||
} as React.CSSProperties
|
||||
|
||||
const content = (
|
||||
<>
|
||||
{index < itemsPerRow && (
|
||||
<div className='pointer-events-none absolute inset-0 h-full w-full bg-gradient-to-t from-neutral-100 to-transparent opacity-0 transition duration-200 group-hover/feature:opacity-100 dark:from-neutral-800' />
|
||||
)}
|
||||
{index >= itemsPerRow && (
|
||||
<div className='pointer-events-none absolute inset-0 h-full w-full bg-gradient-to-b from-neutral-100 to-transparent opacity-0 transition duration-200 group-hover/feature:opacity-100 dark:from-neutral-800' />
|
||||
)}
|
||||
<div
|
||||
className='relative z-10 mb-4 px-10 text-neutral-500 transition-colors duration-200 group-hover/feature:text-[color:var(--block-color,#8b5cf6)] dark:text-neutral-400 dark:group-hover/feature:text-[color:var(--block-color,#a78bfa)]'
|
||||
style={blockColor}
|
||||
>
|
||||
{icon}
|
||||
</div>
|
||||
<div className='relative z-10 mb-2 px-10 font-bold text-lg'>
|
||||
<div
|
||||
className='absolute inset-y-0 left-0 h-6 w-1 origin-center rounded-tr-full rounded-br-full bg-neutral-300 transition-all duration-200 group-hover/feature:h-8 group-hover/feature:bg-[color:var(--block-color,#8b5cf6)] dark:bg-neutral-700'
|
||||
style={blockColor}
|
||||
/>
|
||||
<span className='inline-block text-neutral-800 transition duration-200 group-hover/feature:translate-x-2 dark:text-neutral-100'>
|
||||
{title}
|
||||
</span>
|
||||
</div>
|
||||
<p className='relative z-10 max-w-xs px-10 text-neutral-600 text-sm dark:text-neutral-300'>
|
||||
{description}
|
||||
</p>
|
||||
</>
|
||||
)
|
||||
|
||||
const containerClasses = cn(
|
||||
'flex flex-col lg:border-r py-5 relative group/feature dark:border-neutral-800',
|
||||
(index === 0 || index === itemsPerRow) && 'lg:border-l dark:border-neutral-800',
|
||||
index < itemsPerRow && 'lg:border-b dark:border-neutral-800',
|
||||
href && 'cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-900/50 transition-colors'
|
||||
)
|
||||
|
||||
if (href) {
|
||||
return (
|
||||
<a href={href} className={containerClasses} style={{ textDecoration: 'none' }}>
|
||||
{content}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
||||
return <div className={containerClasses}>{content}</div>
|
||||
}
|
||||
|
||||
export function BlockTypes() {
|
||||
const features = [
|
||||
{
|
||||
title: 'Agent',
|
||||
description:
|
||||
'Create powerful AI agents using any LLM provider with customizable system prompts and tool integrations.',
|
||||
icon: <AgentIcon className='h-6 w-6' />,
|
||||
href: '/blocks/agent',
|
||||
},
|
||||
{
|
||||
title: 'API',
|
||||
description:
|
||||
'Connect to any external API with support for all standard HTTP methods and customizable request parameters.',
|
||||
icon: <ApiIcon className='h-6 w-6' />,
|
||||
href: '/blocks/api',
|
||||
},
|
||||
{
|
||||
title: 'Condition',
|
||||
description:
|
||||
'Add a condition to the workflow to branch the execution path based on a boolean expression.',
|
||||
icon: <ConditionalIcon className='h-6 w-6' />,
|
||||
href: '/blocks/condition',
|
||||
},
|
||||
{
|
||||
title: 'Function',
|
||||
description:
|
||||
'Execute custom JavaScript or TypeScript code within your workflow to transform data or implement complex logic.',
|
||||
icon: <CodeIcon className='h-6 w-6' />,
|
||||
href: '/blocks/function',
|
||||
},
|
||||
{
|
||||
title: 'Router',
|
||||
description:
|
||||
'Intelligently direct workflow execution to different paths based on input analysis.',
|
||||
icon: <ConnectIcon className='h-6 w-6' />,
|
||||
href: '/blocks/router',
|
||||
},
|
||||
{
|
||||
title: 'Evaluator',
|
||||
description:
|
||||
'Assess content using customizable evaluation metrics and scoring criteria across multiple dimensions.',
|
||||
icon: <ChartBarIcon className='h-6 w-6' />,
|
||||
href: '/blocks/evaluator',
|
||||
},
|
||||
{
|
||||
title: 'Response',
|
||||
description:
|
||||
'Send a response back to the caller with customizable data, status, and headers.',
|
||||
icon: <ResponseIcon className='h-6 w-6' />,
|
||||
href: '/blocks/response',
|
||||
},
|
||||
]
|
||||
|
||||
const totalItems = features.length
|
||||
const itemsPerRow = 3 // For large screens
|
||||
|
||||
return (
|
||||
<div className='relative z-10 mx-auto grid max-w-7xl grid-cols-1 py-10 md:grid-cols-2 lg:grid-cols-3'>
|
||||
{features.map((feature, index) => (
|
||||
<BlockFeature
|
||||
key={feature.title}
|
||||
{...feature}
|
||||
index={index}
|
||||
totalItems={totalItems}
|
||||
itemsPerRow={itemsPerRow}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
50
apps/docs/components/ui/code-block.tsx
Normal file
50
apps/docs/components/ui/code-block.tsx
Normal file
@@ -0,0 +1,50 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import { CodeBlock as FumadocsCodeBlock } from 'fumadocs-ui/components/codeblock'
|
||||
import { Check, Copy } from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
export function CodeBlock(props: React.ComponentProps<typeof FumadocsCodeBlock>) {
|
||||
const [copied, setCopied] = useState(false)
|
||||
|
||||
const handleCopy = async (text: string) => {
|
||||
await navigator.clipboard.writeText(text)
|
||||
setCopied(true)
|
||||
setTimeout(() => setCopied(false), 2000)
|
||||
}
|
||||
|
||||
return (
|
||||
<FumadocsCodeBlock
|
||||
{...props}
|
||||
Actions={({ children, className }) => (
|
||||
<div className={cn('empty:hidden', className)}>
|
||||
{/* Custom copy button */}
|
||||
<button
|
||||
type='button'
|
||||
aria-label={copied ? 'Copied Text' : 'Copy Text'}
|
||||
onClick={(e) => {
|
||||
const pre = (e.currentTarget as HTMLElement)
|
||||
.closest('.nd-codeblock')
|
||||
?.querySelector('pre')
|
||||
if (pre) handleCopy(pre.textContent || '')
|
||||
}}
|
||||
className={cn(
|
||||
'rounded-md p-2 transition-all',
|
||||
'border border-border bg-background/80 hover:bg-muted',
|
||||
'backdrop-blur-sm'
|
||||
)}
|
||||
>
|
||||
<span className='flex items-center justify-center'>
|
||||
{copied ? (
|
||||
<Check size={16} className='text-green-600 dark:text-green-400' />
|
||||
) : (
|
||||
<Copy size={16} className='text-muted-foreground' />
|
||||
)}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
import {
|
||||
IconAdjustmentsBolt,
|
||||
IconCloud,
|
||||
IconEaseInOut,
|
||||
IconHeart,
|
||||
IconHelp,
|
||||
IconHistory,
|
||||
IconRouteAltLeft,
|
||||
IconTerminal2,
|
||||
} from '@tabler/icons-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
export function Features() {
|
||||
const features = [
|
||||
{
|
||||
title: 'Multi-LLM Support',
|
||||
description: 'Connect to any LLM provider including OpenAI, Anthropic, and more',
|
||||
icon: <IconCloud />,
|
||||
},
|
||||
{
|
||||
title: 'API Deployment',
|
||||
description: 'Deploy your workflows as secure, scalable APIs',
|
||||
icon: <IconTerminal2 />,
|
||||
},
|
||||
{
|
||||
title: 'Webhook Integration',
|
||||
description: 'Trigger workflows via webhooks from external services',
|
||||
icon: <IconRouteAltLeft />,
|
||||
},
|
||||
{
|
||||
title: 'Scheduled Execution',
|
||||
description: 'Schedule workflows to run at specific times or intervals',
|
||||
icon: <IconEaseInOut />,
|
||||
},
|
||||
{
|
||||
title: '40+ Integrations',
|
||||
description: 'Connect to hundreds of external services and data sources',
|
||||
icon: <IconAdjustmentsBolt />,
|
||||
},
|
||||
{
|
||||
title: 'Visual Debugging',
|
||||
description: 'Debug workflows visually with detailed execution logs',
|
||||
icon: <IconHelp />,
|
||||
},
|
||||
{
|
||||
title: 'Version Control',
|
||||
description: 'Track changes and roll back to previous versions',
|
||||
icon: <IconHistory />,
|
||||
},
|
||||
{
|
||||
title: 'Team Collaboration',
|
||||
description: 'Collaborate with team members on workflow development',
|
||||
icon: <IconHeart />,
|
||||
},
|
||||
]
|
||||
return (
|
||||
<div className='relative z-20 mx-auto grid max-w-7xl grid-cols-1 py-10 md:grid-cols-2 lg:grid-cols-4'>
|
||||
{features.map((feature, index) => (
|
||||
<Feature key={feature.title} {...feature} index={index} />
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export const Feature = ({
|
||||
title,
|
||||
description,
|
||||
icon,
|
||||
index,
|
||||
}: {
|
||||
title: string
|
||||
description: string
|
||||
icon: React.ReactNode
|
||||
index: number
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'group/feature relative flex flex-col py-5 lg:border-r dark:border-neutral-800',
|
||||
(index === 0 || index === 4) && 'lg:border-l dark:border-neutral-800',
|
||||
index < 4 && 'lg:border-b dark:border-neutral-800'
|
||||
)}
|
||||
>
|
||||
{index < 4 && (
|
||||
<div className='pointer-events-none absolute inset-0 h-full w-full bg-gradient-to-t from-neutral-100 to-transparent opacity-0 transition duration-200 group-hover/feature:opacity-100 dark:from-neutral-800' />
|
||||
)}
|
||||
{index >= 4 && (
|
||||
<div className='pointer-events-none absolute inset-0 h-full w-full bg-gradient-to-b from-neutral-100 to-transparent opacity-0 transition duration-200 group-hover/feature:opacity-100 dark:from-neutral-800' />
|
||||
)}
|
||||
<div className='relative z-10 mb-4 px-10 text-neutral-600 dark:text-neutral-400'>{icon}</div>
|
||||
<div className='relative z-10 mb-2 px-10 font-bold text-lg'>
|
||||
<div className='absolute inset-y-0 left-0 h-6 w-1 origin-center rounded-tr-full rounded-br-full bg-neutral-300 transition-all duration-200 group-hover/feature:h-8 group-hover/feature:bg-purple-500 dark:bg-neutral-700' />
|
||||
<span className='inline-block text-neutral-800 transition duration-200 group-hover/feature:translate-x-2 dark:text-neutral-100'>
|
||||
{title}
|
||||
</span>
|
||||
</div>
|
||||
<p className='relative z-10 max-w-xs px-10 text-neutral-600 text-sm dark:text-neutral-300'>
|
||||
{description}
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
53
apps/docs/components/ui/image.tsx
Normal file
53
apps/docs/components/ui/image.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import NextImage, { type ImageProps as NextImageProps } from 'next/image'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { Lightbox } from './lightbox'
|
||||
|
||||
interface ImageProps extends Omit<NextImageProps, 'className'> {
|
||||
className?: string
|
||||
enableLightbox?: boolean
|
||||
}
|
||||
|
||||
export function Image({
|
||||
className = 'w-full',
|
||||
enableLightbox = true,
|
||||
alt = '',
|
||||
src,
|
||||
...props
|
||||
}: ImageProps) {
|
||||
const [isLightboxOpen, setIsLightboxOpen] = useState(false)
|
||||
|
||||
const handleImageClick = () => {
|
||||
if (enableLightbox) {
|
||||
setIsLightboxOpen(true)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<NextImage
|
||||
className={cn(
|
||||
'overflow-hidden rounded-xl border border-border object-cover shadow-sm',
|
||||
enableLightbox && 'cursor-pointer transition-opacity hover:opacity-90',
|
||||
className
|
||||
)}
|
||||
alt={alt}
|
||||
src={src}
|
||||
onClick={handleImageClick}
|
||||
{...props}
|
||||
/>
|
||||
|
||||
{enableLightbox && (
|
||||
<Lightbox
|
||||
isOpen={isLightboxOpen}
|
||||
onClose={() => setIsLightboxOpen(false)}
|
||||
src={typeof src === 'string' ? src : String(src)}
|
||||
alt={alt}
|
||||
type='image'
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
129
apps/docs/components/ui/language-dropdown.tsx
Normal file
129
apps/docs/components/ui/language-dropdown.tsx
Normal file
@@ -0,0 +1,129 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Check, ChevronRight } from 'lucide-react'
|
||||
import { useParams, usePathname, useRouter } from 'next/navigation'
|
||||
|
||||
const languages = {
|
||||
en: { name: 'English', flag: '🇺🇸' },
|
||||
es: { name: 'Español', flag: '🇪🇸' },
|
||||
fr: { name: 'Français', flag: '🇫🇷' },
|
||||
de: { name: 'Deutsch', flag: '🇩🇪' },
|
||||
ja: { name: '日本語', flag: '🇯🇵' },
|
||||
zh: { name: '简体中文', flag: '🇨🇳' },
|
||||
}
|
||||
|
||||
export function LanguageDropdown() {
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
const pathname = usePathname()
|
||||
const params = useParams()
|
||||
const router = useRouter()
|
||||
|
||||
const [currentLang, setCurrentLang] = useState(() => {
|
||||
const langFromParams = params?.lang as string
|
||||
return langFromParams && Object.keys(languages).includes(langFromParams) ? langFromParams : 'en'
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
const langFromParams = params?.lang as string
|
||||
|
||||
if (langFromParams && Object.keys(languages).includes(langFromParams)) {
|
||||
if (langFromParams !== currentLang) {
|
||||
setCurrentLang(langFromParams)
|
||||
}
|
||||
} else {
|
||||
if (currentLang !== 'en') {
|
||||
setCurrentLang('en')
|
||||
}
|
||||
}
|
||||
}, [params, currentLang])
|
||||
|
||||
const handleLanguageChange = (locale: string) => {
|
||||
if (locale === currentLang) {
|
||||
setIsOpen(false)
|
||||
return
|
||||
}
|
||||
|
||||
setIsOpen(false)
|
||||
|
||||
const segments = pathname.split('/').filter(Boolean)
|
||||
|
||||
if (segments[0] && Object.keys(languages).includes(segments[0])) {
|
||||
segments.shift()
|
||||
}
|
||||
|
||||
let newPath = ''
|
||||
if (locale === 'en') {
|
||||
newPath = segments.length > 0 ? `/${segments.join('/')}` : '/introduction'
|
||||
} else {
|
||||
newPath = `/${locale}${segments.length > 0 ? `/${segments.join('/')}` : '/introduction'}`
|
||||
}
|
||||
|
||||
router.push(newPath)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) return
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') setIsOpen(false)
|
||||
}
|
||||
window.addEventListener('keydown', onKey)
|
||||
return () => window.removeEventListener('keydown', onKey)
|
||||
}, [isOpen])
|
||||
|
||||
return (
|
||||
<div className='relative'>
|
||||
<button
|
||||
onClick={(e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
setIsOpen(!isOpen)
|
||||
}}
|
||||
aria-haspopup='listbox'
|
||||
aria-expanded={isOpen}
|
||||
aria-controls='language-menu'
|
||||
className='flex items-center gap-1.5 rounded-xl px-3 py-2 font-normal text-[0.9375rem] text-foreground/60 leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring'
|
||||
style={{
|
||||
fontFamily:
|
||||
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
||||
}}
|
||||
>
|
||||
<span>{languages[currentLang as keyof typeof languages]?.name}</span>
|
||||
<ChevronRight className='h-3.5 w-3.5' />
|
||||
</button>
|
||||
|
||||
{isOpen && (
|
||||
<>
|
||||
<div className='fixed inset-0 z-[1000]' aria-hidden onClick={() => setIsOpen(false)} />
|
||||
<div
|
||||
id='language-menu'
|
||||
role='listbox'
|
||||
className='absolute top-full right-0 z-[1001] mt-1 max-h-[75vh] w-56 overflow-auto rounded-xl border border-border/50 bg-white shadow-2xl md:w-44 md:bg-background/95 md:backdrop-blur-md dark:bg-neutral-950 md:dark:bg-background/95'
|
||||
>
|
||||
{Object.entries(languages).map(([code, lang]) => (
|
||||
<button
|
||||
key={code}
|
||||
onClick={(e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
handleLanguageChange(code)
|
||||
}}
|
||||
role='option'
|
||||
aria-selected={currentLang === code}
|
||||
className={`flex w-full items-center gap-3 px-3 py-3 text-base transition-colors first:rounded-t-xl last:rounded-b-xl hover:bg-muted/80 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring md:gap-2 md:px-2.5 md:py-2 md:text-sm ${
|
||||
currentLang === code ? 'bg-muted/60 font-medium text-primary' : 'text-foreground'
|
||||
}`}
|
||||
>
|
||||
<span className='text-base md:text-sm'>{lang.flag}</span>
|
||||
<span className='leading-none'>{lang.name}</span>
|
||||
{currentLang === code && (
|
||||
<Check className='ml-auto h-4 w-4 text-primary md:h-3.5 md:w-3.5' />
|
||||
)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
74
apps/docs/components/ui/lightbox.tsx
Normal file
74
apps/docs/components/ui/lightbox.tsx
Normal file
@@ -0,0 +1,74 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useRef } from 'react'
|
||||
import { getAssetUrl } from '@/lib/utils'
|
||||
|
||||
interface LightboxProps {
|
||||
isOpen: boolean
|
||||
onClose: () => void
|
||||
src: string
|
||||
alt: string
|
||||
type: 'image' | 'video'
|
||||
}
|
||||
|
||||
export function Lightbox({ isOpen, onClose, src, alt, type }: LightboxProps) {
|
||||
const overlayRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.key === 'Escape') {
|
||||
onClose()
|
||||
}
|
||||
}
|
||||
|
||||
const handleClickOutside = (event: MouseEvent) => {
|
||||
if (overlayRef.current && event.target === overlayRef.current) {
|
||||
onClose()
|
||||
}
|
||||
}
|
||||
|
||||
if (isOpen) {
|
||||
document.addEventListener('keydown', handleKeyDown)
|
||||
document.addEventListener('click', handleClickOutside)
|
||||
document.body.style.overflow = 'hidden'
|
||||
}
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('keydown', handleKeyDown)
|
||||
document.removeEventListener('click', handleClickOutside)
|
||||
document.body.style.overflow = 'unset'
|
||||
}
|
||||
}, [isOpen, onClose])
|
||||
|
||||
if (!isOpen) return null
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={overlayRef}
|
||||
className='fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-12 backdrop-blur-sm'
|
||||
role='dialog'
|
||||
aria-modal='true'
|
||||
aria-label='Media viewer'
|
||||
>
|
||||
<div className='relative max-h-full max-w-full overflow-hidden rounded-xl shadow-2xl'>
|
||||
{type === 'image' ? (
|
||||
<img
|
||||
src={src}
|
||||
alt={alt}
|
||||
className='max-h-[calc(100vh-6rem)] max-w-[calc(100vw-6rem)] rounded-xl object-contain'
|
||||
loading='lazy'
|
||||
/>
|
||||
) : (
|
||||
<video
|
||||
src={getAssetUrl(src)}
|
||||
autoPlay
|
||||
loop
|
||||
muted
|
||||
playsInline
|
||||
className='max-h-[calc(100vh-6rem)] max-w-[calc(100vw-6rem)] rounded-xl outline-none focus:outline-none'
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
38
apps/docs/components/ui/search-trigger.tsx
Normal file
38
apps/docs/components/ui/search-trigger.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
'use client'
|
||||
|
||||
import { Search } from 'lucide-react'
|
||||
|
||||
export function SearchTrigger() {
|
||||
const handleClick = () => {
|
||||
const event = new KeyboardEvent('keydown', {
|
||||
key: 'k',
|
||||
metaKey: true,
|
||||
bubbles: true,
|
||||
})
|
||||
document.dispatchEvent(event)
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
type='button'
|
||||
className='flex h-10 w-[460px] items-center gap-2 rounded-xl border border-border/50 px-3 py-2 text-sm backdrop-blur-xl transition-colors hover:border-border'
|
||||
style={{
|
||||
backgroundColor: 'hsla(0, 0%, 5%, 0.85)',
|
||||
backdropFilter: 'blur(33px) saturate(180%)',
|
||||
WebkitBackdropFilter: 'blur(33px) saturate(180%)',
|
||||
color: 'rgba(255, 255, 255, 0.6)',
|
||||
}}
|
||||
onClick={handleClick}
|
||||
>
|
||||
<Search className='h-4 w-4' />
|
||||
<span>Search...</span>
|
||||
<kbd
|
||||
className='ml-auto flex items-center gap-0.5 font-medium'
|
||||
style={{ color: 'rgba(255, 255, 255, 0.6)' }}
|
||||
>
|
||||
<span style={{ fontSize: '15px', lineHeight: '1' }}>⌘</span>
|
||||
<span style={{ fontSize: '13px', lineHeight: '1' }}>K</span>
|
||||
</kbd>
|
||||
</button>
|
||||
)
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import Image from 'next/image'
|
||||
import { useTheme } from 'next-themes'
|
||||
|
||||
interface ThemeImageProps {
|
||||
lightSrc: string
|
||||
darkSrc: string
|
||||
alt: string
|
||||
width?: number
|
||||
height?: number
|
||||
className?: string
|
||||
}
|
||||
|
||||
export function ThemeImage({
|
||||
lightSrc,
|
||||
darkSrc,
|
||||
alt,
|
||||
width = 600,
|
||||
height = 400,
|
||||
className = 'rounded-lg border border-border my-6',
|
||||
}: ThemeImageProps) {
|
||||
const { resolvedTheme } = useTheme()
|
||||
const [imageSrc, setImageSrc] = useState(lightSrc)
|
||||
const [mounted, setMounted] = useState(false)
|
||||
|
||||
// Wait until component is mounted to avoid hydration mismatch
|
||||
useEffect(() => {
|
||||
setMounted(true)
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (mounted) {
|
||||
setImageSrc(resolvedTheme === 'dark' ? darkSrc : lightSrc)
|
||||
}
|
||||
}, [resolvedTheme, lightSrc, darkSrc, mounted])
|
||||
|
||||
if (!mounted) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='flex justify-center'>
|
||||
<Image src={imageSrc} alt={alt} width={width} height={height} className={className} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
32
apps/docs/components/ui/theme-toggle.tsx
Normal file
32
apps/docs/components/ui/theme-toggle.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Moon, Sun } from 'lucide-react'
|
||||
import { useTheme } from 'next-themes'
|
||||
|
||||
export function ThemeToggle() {
|
||||
const { theme, setTheme } = useTheme()
|
||||
const [mounted, setMounted] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true)
|
||||
}, [])
|
||||
|
||||
if (!mounted) {
|
||||
return (
|
||||
<button className='flex items-center justify-center rounded-md p-1 text-muted-foreground'>
|
||||
<Moon className='h-4 w-4' />
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
|
||||
className='flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:text-foreground'
|
||||
aria-label='Toggle theme'
|
||||
>
|
||||
{theme === 'dark' ? <Moon className='h-4 w-4' /> : <Sun className='h-4 w-4' />}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
import { getVideoUrl } from '@/lib/utils'
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import { getAssetUrl } from '@/lib/utils'
|
||||
import { Lightbox } from './lightbox'
|
||||
|
||||
interface VideoProps {
|
||||
src: string
|
||||
@@ -7,24 +11,47 @@ interface VideoProps {
|
||||
loop?: boolean
|
||||
muted?: boolean
|
||||
playsInline?: boolean
|
||||
enableLightbox?: boolean
|
||||
}
|
||||
|
||||
export function Video({
|
||||
src,
|
||||
className = 'w-full -mb-2 rounded-lg',
|
||||
className = 'w-full rounded-xl border border-border shadow-sm overflow-hidden outline-none focus:outline-none',
|
||||
autoPlay = true,
|
||||
loop = true,
|
||||
muted = true,
|
||||
playsInline = true,
|
||||
enableLightbox = true,
|
||||
}: VideoProps) {
|
||||
const [isLightboxOpen, setIsLightboxOpen] = useState(false)
|
||||
|
||||
const handleVideoClick = () => {
|
||||
if (enableLightbox) {
|
||||
setIsLightboxOpen(true)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<video
|
||||
autoPlay={autoPlay}
|
||||
loop={loop}
|
||||
muted={muted}
|
||||
playsInline={playsInline}
|
||||
className={className}
|
||||
src={getVideoUrl(src)}
|
||||
/>
|
||||
<>
|
||||
<video
|
||||
autoPlay={autoPlay}
|
||||
loop={loop}
|
||||
muted={muted}
|
||||
playsInline={playsInline}
|
||||
className={`${className} ${enableLightbox ? 'cursor-pointer transition-opacity hover:opacity-90' : ''}`}
|
||||
src={getAssetUrl(src)}
|
||||
onClick={handleVideoClick}
|
||||
/>
|
||||
|
||||
{enableLightbox && (
|
||||
<Lightbox
|
||||
isOpen={isLightboxOpen}
|
||||
onClose={() => setIsLightboxOpen(false)}
|
||||
src={src}
|
||||
alt={`Video: ${src}`}
|
||||
type='video'
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
---
|
||||
title: Evaluator
|
||||
description: Assess content quality using customizable evaluation metrics
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { ThemeImage } from '@/components/ui/theme-image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
The Evaluator block uses AI to score and assess content quality based on metrics you define. Perfect for quality control, A/B testing, and ensuring your AI outputs meet specific standards.
|
||||
|
||||
<ThemeImage
|
||||
lightSrc="/static/light/evaluator-light.png"
|
||||
darkSrc="/static/dark/evaluator-dark.png"
|
||||
alt="Evaluator Block Configuration"
|
||||
width={350}
|
||||
height={175}
|
||||
/>
|
||||
|
||||
## What You Can Evaluate
|
||||
|
||||
**AI-Generated Content**: Score chatbot responses, generated articles, or marketing copy
|
||||
**User Input**: Evaluate customer feedback, survey responses, or form submissions
|
||||
**Content Quality**: Assess clarity, accuracy, relevance, and tone
|
||||
**Performance Metrics**: Track improvements over time with consistent scoring
|
||||
**A/B Testing**: Compare different approaches with objective metrics
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Evaluation Metrics
|
||||
|
||||
Define custom metrics to evaluate content against. Each metric includes:
|
||||
|
||||
- **Name**: A short identifier for the metric
|
||||
- **Description**: A detailed explanation of what the metric measures
|
||||
- **Range**: The numeric range for scoring (e.g., 1-5, 0-10)
|
||||
|
||||
Example metrics:
|
||||
|
||||
```
|
||||
Accuracy (1-5): How factually accurate is the content?
|
||||
Clarity (1-5): How clear and understandable is the content?
|
||||
Relevance (1-5): How relevant is the content to the original query?
|
||||
```
|
||||
|
||||
### Content
|
||||
|
||||
The content to be evaluated. This can be:
|
||||
|
||||
- Directly provided in the block configuration
|
||||
- Connected from another block's output (typically an Agent block)
|
||||
- Dynamically generated during workflow execution
|
||||
|
||||
### Model Selection
|
||||
|
||||
Choose an AI model to perform the evaluation:
|
||||
|
||||
**OpenAI**: GPT-4o, o1, o3, o4-mini, gpt-4.1
|
||||
**Anthropic**: Claude 3.7 Sonnet
|
||||
**Google**: Gemini 2.5 Pro, Gemini 2.0 Flash
|
||||
**Other Providers**: Groq, Cerebras, xAI, DeepSeek
|
||||
**Local Models**: Any model running on Ollama
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="models.mp4" />
|
||||
</div>
|
||||
|
||||
**Recommendation**: Use models with strong reasoning capabilities like GPT-4o or Claude 3.7 Sonnet for more accurate evaluations.
|
||||
|
||||
### API Key
|
||||
|
||||
Your API key for the selected LLM provider. This is securely stored and used for authentication.
|
||||
|
||||
## How It Works
|
||||
|
||||
1. The Evaluator block takes the provided content and your custom metrics
|
||||
2. It generates a specialized prompt that instructs the LLM to evaluate the content
|
||||
3. The prompt includes clear guidelines on how to score each metric
|
||||
4. The LLM evaluates the content and returns numeric scores for each metric
|
||||
5. The Evaluator block formats these scores as structured output for use in your workflow
|
||||
|
||||
## Inputs and Outputs
|
||||
|
||||
### Inputs
|
||||
|
||||
- **Content**: The text or structured data to evaluate
|
||||
- **Metrics**: Custom evaluation criteria with scoring ranges
|
||||
- **Model Settings**: LLM provider and parameters
|
||||
|
||||
### Outputs
|
||||
|
||||
- **Content**: A summary of the evaluation
|
||||
- **Model**: The model used for evaluation
|
||||
- **Tokens**: Usage statistics
|
||||
- **Metric Scores**: Numeric scores for each defined metric
|
||||
|
||||
## Example Usage
|
||||
|
||||
Here's an example of how an Evaluator block might be configured for assessing customer service responses:
|
||||
|
||||
```yaml
|
||||
# Example Evaluator Configuration
|
||||
metrics:
|
||||
- name: Empathy
|
||||
description: How well does the response acknowledge and address the customer's emotional state?
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
- name: Solution
|
||||
description: How effectively does the response solve the customer's problem?
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
- name: Clarity
|
||||
description: How clear and easy to understand is the response?
|
||||
range:
|
||||
min: 1
|
||||
max: 5
|
||||
|
||||
model: Anthropic/claude-3-opus
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Use specific metric descriptions**: Clearly define what each metric measures to get more accurate evaluations
|
||||
- **Choose appropriate ranges**: Select scoring ranges that provide enough granularity without being overly complex
|
||||
- **Connect with Agent blocks**: Use Evaluator blocks to assess Agent block outputs and create feedback loops
|
||||
- **Use consistent metrics**: For comparative analysis, maintain consistent metrics across similar evaluations
|
||||
- **Combine multiple metrics**: Use several metrics to get a comprehensive evaluation
|
||||
@@ -1,313 +0,0 @@
|
||||
---
|
||||
title: Function
|
||||
description: Execute custom JavaScript or TypeScript code in your workflows
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { ThemeImage } from '@/components/ui/theme-image'
|
||||
|
||||
The Function block lets you run custom JavaScript or TypeScript code in your workflow. Use it to transform data, perform calculations, or implement custom logic that isn't available in other blocks.
|
||||
|
||||
<ThemeImage
|
||||
lightSrc="/static/light/function-light.png"
|
||||
darkSrc="/static/dark/function-dark.png"
|
||||
alt="Function Block with Code Editor"
|
||||
width={350}
|
||||
height={175}
|
||||
/>
|
||||
|
||||
## Overview
|
||||
|
||||
The Function block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Transform data</strong>: Convert formats, parse text, manipulate arrays and objects
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Perform calculations</strong>: Math operations, statistics, financial calculations
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Implement custom logic</strong>: Complex conditionals, loops, and algorithms
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Process external data</strong>: Parse responses, format requests, handle authentication
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How It Works
|
||||
|
||||
The Function block runs your code in a secure, isolated environment:
|
||||
|
||||
1. **Receive Input**: Access data from previous blocks via the `input` object
|
||||
2. **Execute Code**: Run your JavaScript/TypeScript code
|
||||
3. **Return Results**: Use `return` to pass data to the next block
|
||||
4. **Handle Errors**: Built-in error handling and logging
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Code Editor
|
||||
|
||||
Write your JavaScript/TypeScript code in a full-featured editor with:
|
||||
- Syntax highlighting and error checking
|
||||
- Line numbers and bracket matching
|
||||
- Support for modern JavaScript features
|
||||
- Native support for `fetch`
|
||||
|
||||
### Accessing Input Data
|
||||
|
||||
Use the `input` object to access data from previous blocks:
|
||||
|
||||
```javascript
|
||||
// Access data from connected blocks
|
||||
const userData = <agent.userData>;
|
||||
const orderData = <agent.orderData>;
|
||||
|
||||
// Access specific fields
|
||||
const customerName = <agent.customer.name>;
|
||||
const total = <agent.order.total>;
|
||||
```
|
||||
|
||||
### Common Examples
|
||||
|
||||
**Data Transformation**:
|
||||
```javascript
|
||||
// Convert and format data
|
||||
const formatted = {
|
||||
name: <agent.user.firstName> + ' ' + <agent.user.lastName>,
|
||||
email: <agent.user.email>.toLowerCase(),
|
||||
joinDate: new Date(<agent.user.created>).toLocaleDateString()
|
||||
};
|
||||
return formatted;
|
||||
```
|
||||
|
||||
**Calculations**:
|
||||
```javascript
|
||||
// Calculate discounts and totals
|
||||
const subtotal = <agent.items>.reduce((sum, item) => sum + item.price, 0);
|
||||
const discount = subtotal > 100 ? 0.1 : 0;
|
||||
const total = subtotal * (1 - discount);
|
||||
|
||||
return { subtotal, discount, total };
|
||||
```
|
||||
|
||||
**Data Validation**:
|
||||
```javascript
|
||||
// Validate email format
|
||||
const email = <agent.email>;
|
||||
const isValid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
||||
|
||||
if (!isValid) {
|
||||
throw new Error('Invalid email format');
|
||||
}
|
||||
return { email, isValid };
|
||||
```
|
||||
|
||||
### Accessing Results
|
||||
|
||||
After a function executes, you can access its outputs:
|
||||
|
||||
- **`<function.result>`**: The value returned from your function
|
||||
- **`<function.stdout>`**: Any console.log() output from your code
|
||||
|
||||
## Advanced Features
|
||||
|
||||
### Async/Await Support
|
||||
|
||||
Use async functions for complex operations:
|
||||
|
||||
```javascript
|
||||
// Async function example
|
||||
const processData = async () => {
|
||||
const data = <api.response>;
|
||||
|
||||
// Process data with async operations
|
||||
const processed = await Promise.all(
|
||||
data.map(async (item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
processed: true,
|
||||
timestamp: new Date().toISOString()
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
return processed;
|
||||
};
|
||||
|
||||
return await processData();
|
||||
```
|
||||
|
||||
### Error Handling
|
||||
|
||||
Implement robust error handling:
|
||||
|
||||
```javascript
|
||||
try {
|
||||
const result = <api.data>;
|
||||
|
||||
if (!result || !result.length) {
|
||||
throw new Error('No data received');
|
||||
}
|
||||
|
||||
return result.map(item => ({
|
||||
id: item.id,
|
||||
name: item.name.trim(),
|
||||
valid: true
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error('Processing failed:', error.message);
|
||||
return { error: error.message, valid: false };
|
||||
}
|
||||
```
|
||||
|
||||
### Performance Optimization
|
||||
|
||||
Optimize for large datasets:
|
||||
|
||||
```javascript
|
||||
// Efficient data processing
|
||||
const data = <api.large_dataset>;
|
||||
|
||||
// Use efficient array methods
|
||||
const processed = data
|
||||
.filter(item => item.status === 'active')
|
||||
.map(item => ({
|
||||
id: item.id,
|
||||
summary: item.description.substring(0, 100)
|
||||
}))
|
||||
.slice(0, 1000); // Limit results
|
||||
|
||||
return processed;
|
||||
```
|
||||
|
||||
## Security and Limitations
|
||||
|
||||
<Callout type="warning">
|
||||
Functions run in a secure environment with these restrictions:
|
||||
- **Execution timeout**: 30 seconds maximum to prevent infinite loops
|
||||
- **Memory limits**: Limited memory to prevent resource exhaustion
|
||||
- **No network access**: Cannot make HTTP requests (use API blocks instead)
|
||||
- **Limited APIs**: Only safe JavaScript APIs are available
|
||||
</Callout>
|
||||
|
||||
## Inputs and Outputs
|
||||
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Code</strong>: Your JavaScript/TypeScript code to execute
|
||||
</li>
|
||||
<li>
|
||||
<strong>Timeout</strong>: Maximum execution time (defaults to 30 seconds)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Input Data</strong>: All connected block outputs available via variables
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>function.result</strong>: The value returned from your function
|
||||
</li>
|
||||
<li>
|
||||
<strong>function.stdout</strong>: Console.log() output from your code
|
||||
</li>
|
||||
<li>
|
||||
<strong>function.error</strong>: Error details if function failed
|
||||
</li>
|
||||
<li>
|
||||
<strong>function.execution_time</strong>: Time taken to execute
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Function Result</strong>: Primary output from your code
|
||||
</li>
|
||||
<li>
|
||||
<strong>Debug Information</strong>: Logs and execution details
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Available in blocks after the function
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Data Processing Pipeline
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Transform API response into structured data</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>API block fetches raw customer data</li>
|
||||
<li>Function block processes and validates data</li>
|
||||
<li>Function block calculates derived metrics</li>
|
||||
<li>Response block returns formatted results</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Business Logic Implementation
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Calculate loyalty scores and tiers</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent retrieves customer purchase history</li>
|
||||
<li>Function block calculates loyalty metrics</li>
|
||||
<li>Function block determines customer tier</li>
|
||||
<li>Condition block routes based on tier level</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Data Validation and Sanitization
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Validate and clean user input</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>User input received from form submission</li>
|
||||
<li>Function block validates email format and phone numbers</li>
|
||||
<li>Function block sanitizes and normalizes data</li>
|
||||
<li>API block saves validated data to database</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Example: Loyalty Score Calculator
|
||||
|
||||
```javascript title="loyalty-calculator.js"
|
||||
// Process customer data and calculate loyalty score
|
||||
const { purchaseHistory, accountAge, supportTickets } = <agent>;
|
||||
|
||||
// Calculate metrics
|
||||
const totalSpent = purchaseHistory.reduce((sum, purchase) => sum + purchase.amount, 0);
|
||||
const purchaseFrequency = purchaseHistory.length / (accountAge / 365);
|
||||
const ticketRatio = supportTickets.resolved / supportTickets.total;
|
||||
|
||||
// Calculate loyalty score (0-100)
|
||||
const spendScore = Math.min(totalSpent / 1000 * 30, 30);
|
||||
const frequencyScore = Math.min(purchaseFrequency * 20, 40);
|
||||
const supportScore = ticketRatio * 30;
|
||||
|
||||
const loyaltyScore = Math.round(spendScore + frequencyScore + supportScore);
|
||||
|
||||
return {
|
||||
customer: <agent.name>,
|
||||
loyaltyScore,
|
||||
loyaltyTier: loyaltyScore >= 80 ? "Platinum" : loyaltyScore >= 60 ? "Gold" : "Silver",
|
||||
metrics: { spendScore, frequencyScore, supportScore }
|
||||
};
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Keep functions focused**: Write functions that do one thing well to improve maintainability and debugging
|
||||
- **Handle errors gracefully**: Use try/catch blocks to handle potential errors and provide meaningful error messages
|
||||
- **Test edge cases**: Ensure your code handles unusual inputs, null values, and boundary conditions correctly
|
||||
- **Optimize for performance**: Be mindful of computational complexity and memory usage for large datasets
|
||||
- **Use console.log() for debugging**: Leverage stdout output to debug and monitor function execution
|
||||
@@ -1,186 +0,0 @@
|
||||
---
|
||||
title: Response
|
||||
description: Send a structured response back to API calls
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { ThemeImage } from '@/components/ui/theme-image'
|
||||
|
||||
The Response block is the final step in your workflow that formats and returns data to whoever called your workflow. It's like the "return" statement for your entire workflow—it packages up results and sends them back.
|
||||
|
||||
<ThemeImage
|
||||
lightSrc="/static/light/response-light.png"
|
||||
darkSrc="/static/dark/response-dark.png"
|
||||
alt="Response Block Configuration"
|
||||
width={350}
|
||||
height={175}
|
||||
/>
|
||||
|
||||
<Callout type="info">
|
||||
Response blocks are terminal blocks - they end the workflow execution and cannot connect to other blocks.
|
||||
</Callout>
|
||||
|
||||
## When You Need Response Blocks
|
||||
|
||||
**API Endpoints**: When your workflow is called via API, Response blocks format the return data
|
||||
**Webhooks**: Return confirmation or data back to the calling system
|
||||
**Testing**: See formatted results when testing your workflow
|
||||
**Data Export**: Structure data for external systems or reports
|
||||
|
||||
## Two Ways to Build Responses
|
||||
|
||||
### Builder Mode (Recommended)
|
||||
Visual interface for building response structure:
|
||||
- Drag and drop fields
|
||||
- Reference workflow variables easily
|
||||
- Visual preview of response structure
|
||||
|
||||
### Editor Mode (Advanced)
|
||||
Write JSON directly:
|
||||
- Full control over response format
|
||||
- Support for complex nested structures
|
||||
- Use `<variable.name>` syntax for dynamic values
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Response Data
|
||||
|
||||
The response data is the main content that will be sent back to the API caller. This should be formatted as JSON and can include:
|
||||
|
||||
- Static values
|
||||
- Dynamic references to workflow variables using the `<variable.name>` syntax
|
||||
- Nested objects and arrays
|
||||
- Any valid JSON structure
|
||||
|
||||
### Status Code
|
||||
|
||||
Set the HTTP status code for the response. Common status codes include:
|
||||
|
||||
<Tabs items={['Success (2xx)', 'Client Error (4xx)', 'Server Error (5xx)']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li><strong>200</strong>: OK - Standard success response</li>
|
||||
<li><strong>201</strong>: Created - Resource successfully created</li>
|
||||
<li><strong>204</strong>: No Content - Success with no response body</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li><strong>400</strong>: Bad Request - Invalid request parameters</li>
|
||||
<li><strong>401</strong>: Unauthorized - Authentication required</li>
|
||||
<li><strong>404</strong>: Not Found - Resource doesn't exist</li>
|
||||
<li><strong>422</strong>: Unprocessable Entity - Validation errors</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li><strong>500</strong>: Internal Server Error - Server-side error</li>
|
||||
<li><strong>502</strong>: Bad Gateway - External service error</li>
|
||||
<li><strong>503</strong>: Service Unavailable - Service temporarily down</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<p className="mt-4 text-sm text-gray-600 dark:text-gray-400">
|
||||
Default status code is 200 if not specified.
|
||||
</p>
|
||||
|
||||
### Response Headers
|
||||
|
||||
Configure additional HTTP headers to include in the response.
|
||||
|
||||
Headers are configured as key-value pairs:
|
||||
|
||||
| Key | Value |
|
||||
|-----|-------|
|
||||
| Content-Type | application/json |
|
||||
| Cache-Control | no-cache |
|
||||
| X-API-Version | 1.0 |
|
||||
|
||||
## Inputs and Outputs
|
||||
|
||||
<Tabs items={['Inputs', 'Outputs']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>data</strong> (JSON, optional): The JSON data to send in the response body
|
||||
</li>
|
||||
<li>
|
||||
<strong>status</strong> (number, optional): HTTP status code (default: 200)
|
||||
</li>
|
||||
<li>
|
||||
<strong>headers</strong> (JSON, optional): Additional response headers
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li><strong>data</strong>: The response body data</li>
|
||||
<li><strong>status</strong>: HTTP status code</li>
|
||||
<li><strong>headers</strong>: Response headers</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Variable References
|
||||
|
||||
Use the `<variable.name>` syntax to dynamically insert workflow variables into your response:
|
||||
|
||||
```json
|
||||
{
|
||||
"user": {
|
||||
"id": "<variable.userId>",
|
||||
"name": "<variable.userName>",
|
||||
"email": "<variable.userEmail>"
|
||||
},
|
||||
"query": "<variable.searchQuery>",
|
||||
"results": "<variable.searchResults>",
|
||||
"totalFound": "<variable.resultCount>",
|
||||
"processingTime": "<variable.executionTime>ms"
|
||||
}
|
||||
```
|
||||
|
||||
<Callout type="warning">
|
||||
Variable names are case-sensitive and must match exactly with the variables available in your workflow.
|
||||
</Callout>
|
||||
|
||||
## Example Usage
|
||||
|
||||
Here's an example of how a Response block might be configured for a user search API:
|
||||
|
||||
```yaml
|
||||
data: |
|
||||
{
|
||||
"success": true,
|
||||
"data": {
|
||||
"users": "<variable.searchResults>",
|
||||
"pagination": {
|
||||
"page": "<variable.currentPage>",
|
||||
"limit": "<variable.pageSize>",
|
||||
"total": "<variable.totalUsers>"
|
||||
}
|
||||
},
|
||||
"query": {
|
||||
"searchTerm": "<variable.searchTerm>",
|
||||
"filters": "<variable.appliedFilters>"
|
||||
},
|
||||
"timestamp": "<variable.timestamp>"
|
||||
}
|
||||
status: 200
|
||||
headers:
|
||||
- key: X-Total-Count
|
||||
value: <variable.totalUsers>
|
||||
- key: Cache-Control
|
||||
value: public, max-age=300
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Use meaningful status codes**: Choose appropriate HTTP status codes that accurately reflect the outcome of the workflow
|
||||
- **Structure your responses consistently**: Maintain a consistent JSON structure across all your API endpoints for better developer experience
|
||||
- **Include relevant metadata**: Add timestamps and version information to help with debugging and monitoring
|
||||
- **Handle errors gracefully**: Use conditional logic in your workflow to set appropriate error responses with descriptive messages
|
||||
- **Validate variable references**: Ensure all referenced variables exist and contain the expected data types before the Response block executes
|
||||
|
||||
@@ -1,259 +0,0 @@
|
||||
---
|
||||
title: Workflow
|
||||
description: Execute other workflows as reusable components within your current workflow
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { ThemeImage } from '@/components/ui/theme-image'
|
||||
|
||||
The Workflow block allows you to execute other workflows as reusable components within your current workflow. This powerful feature enables modular design, code reuse, and the creation of complex nested workflows that can be composed from smaller, focused workflows.
|
||||
|
||||
<ThemeImage
|
||||
lightSrc="/static/light/workflow-light.png"
|
||||
darkSrc="/static/dark/workflow-dark.png"
|
||||
alt="Workflow Block"
|
||||
width={300}
|
||||
height={175}
|
||||
/>
|
||||
|
||||
<Callout type="info">
|
||||
Workflow blocks enable modular design by allowing you to compose complex workflows from smaller, reusable components.
|
||||
</Callout>
|
||||
|
||||
## Overview
|
||||
|
||||
The Workflow block serves as a bridge between workflows, enabling you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Reuse existing workflows</strong>: Execute previously created workflows as components within new workflows
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Create modular designs</strong>: Break down complex processes into smaller, manageable workflows
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Maintain separation of concerns</strong>: Keep different business logic isolated in separate workflows
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Enable team collaboration</strong>: Share and reuse workflows across different projects and team members
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How It Works
|
||||
|
||||
The Workflow block:
|
||||
|
||||
1. Takes a reference to another workflow in your workspace
|
||||
2. Passes input data from the current workflow to the child workflow
|
||||
3. Executes the child workflow in an isolated context
|
||||
4. Returns the results back to the parent workflow for further processing
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Workflow Selection
|
||||
|
||||
Choose which workflow to execute from a dropdown list of available workflows in your workspace. The list includes:
|
||||
|
||||
- All workflows you have access to in the current workspace
|
||||
- Workflows shared with you by other team members
|
||||
- Both enabled and disabled workflows (though only enabled workflows can be executed)
|
||||
|
||||
### Input Data
|
||||
|
||||
Define the data to pass to the child workflow:
|
||||
|
||||
- **Single Variable Input**: Select a variable or block output to pass to the child workflow
|
||||
- **Variable References**: Use `<variable.name>` to reference workflow variables
|
||||
- **Block References**: Use `<blockName.field>` to reference outputs from previous blocks
|
||||
- **Automatic Mapping**: The selected data is automatically available as `start.input` in the child workflow
|
||||
- **Optional**: The input field is optional - child workflows can run without input data
|
||||
- **Type Preservation**: Variable types (strings, numbers, objects, etc.) are preserved when passed to the child workflow
|
||||
|
||||
### Accessing Results
|
||||
|
||||
After a workflow executes, you can access its outputs:
|
||||
|
||||
- **`<workflow.response>`**: The complete output from the child workflow
|
||||
- **`<workflow.name>`**: The name of the executed child workflow
|
||||
- **`<workflow.success>`**: Boolean indicating successful completion
|
||||
- **`<workflow.error>`**: Error details if the workflow failed
|
||||
- **`<workflow.execution_time>`**: Time taken to execute the workflow
|
||||
|
||||
### Execution Context
|
||||
|
||||
The child workflow executes with:
|
||||
|
||||
- Its own isolated execution context
|
||||
- Access to the same workspace resources (API keys, environment variables)
|
||||
- Proper workspace membership and permission checks
|
||||
- Independent logging and monitoring
|
||||
|
||||
## Safety and Limitations
|
||||
|
||||
To prevent infinite recursion and ensure system stability, the Workflow block includes several safety mechanisms:
|
||||
|
||||
<Callout type="warning">
|
||||
**Cycle Detection**: The system automatically detects and prevents circular dependencies between workflows to avoid infinite loops.
|
||||
</Callout>
|
||||
|
||||
- **Maximum Depth Limit**: Nested workflows are limited to a maximum depth of 10 levels
|
||||
- **Cycle Detection**: Automatic detection and prevention of circular workflow dependencies
|
||||
- **Timeout Protection**: Child workflows inherit timeout settings to prevent indefinite execution
|
||||
- **Resource Limits**: Memory and execution time limits apply to prevent resource exhaustion
|
||||
|
||||
## Advanced Features
|
||||
|
||||
### Dynamic Workflow Selection
|
||||
|
||||
Select workflows dynamically based on runtime conditions:
|
||||
|
||||
```javascript
|
||||
// In a Function block before the Workflow block
|
||||
const workflowId = <condition.result> ? 'premium-workflow' : 'standard-workflow';
|
||||
return { selectedWorkflow: workflowId };
|
||||
```
|
||||
|
||||
### Error Handling and Fallbacks
|
||||
|
||||
Implement robust error handling for child workflows:
|
||||
|
||||
```javascript
|
||||
// In a Function block after the Workflow block
|
||||
if (!<workflow.success>) {
|
||||
console.error('Child workflow failed:', <workflow.error>);
|
||||
// Implement fallback logic
|
||||
return { fallback: true, error: <workflow.error> };
|
||||
}
|
||||
return <workflow.response>;
|
||||
```
|
||||
|
||||
### Workflow Chaining
|
||||
|
||||
Chain multiple workflows together:
|
||||
|
||||
```javascript
|
||||
// Pass output from one workflow to another
|
||||
Workflow 1 Input: <start.input>
|
||||
Workflow 2 Input: <workflow1.response>
|
||||
Workflow 3 Input: <workflow2.response>
|
||||
```
|
||||
|
||||
## Inputs and Outputs
|
||||
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Workflow Selection</strong>: Choose which workflow to execute
|
||||
</li>
|
||||
<li>
|
||||
<strong>Input Data</strong>: Variable or block reference to pass to child workflow
|
||||
</li>
|
||||
<li>
|
||||
<strong>Execution Context</strong>: Isolated environment with workspace resources
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>workflow.response</strong>: Complete output from child workflow
|
||||
</li>
|
||||
<li>
|
||||
<strong>workflow.name</strong>: Name of executed child workflow
|
||||
</li>
|
||||
<li>
|
||||
<strong>workflow.success</strong>: Boolean indicating completion status
|
||||
</li>
|
||||
<li>
|
||||
<strong>workflow.error</strong>: Error details if workflow failed
|
||||
</li>
|
||||
<li>
|
||||
<strong>workflow.execution_time</strong>: Time taken to execute
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Workflow Response</strong>: Primary output from child workflow
|
||||
</li>
|
||||
<li>
|
||||
<strong>Execution Status</strong>: Success status and error information
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Available in blocks after the workflow
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Modular Customer Onboarding
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Break down complex onboarding into reusable components</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Main workflow receives customer data</li>
|
||||
<li>Workflow block executes validation workflow</li>
|
||||
<li>Workflow block executes account setup workflow</li>
|
||||
<li>Workflow block executes welcome email workflow</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Microservice Architecture
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Create independent service workflows</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Payment processing workflow handles transactions</li>
|
||||
<li>Inventory management workflow updates stock</li>
|
||||
<li>Notification workflow sends confirmations</li>
|
||||
<li>Main workflow orchestrates all services</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Conditional Processing
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Execute different workflows based on conditions</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Condition block evaluates user type</li>
|
||||
<li>Enterprise users → Complex approval workflow</li>
|
||||
<li>Standard users → Simple approval workflow</li>
|
||||
<li>Free users → Basic processing workflow</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Example: Customer Validation Workflow
|
||||
|
||||
```javascript title="validation-workflow.js"
|
||||
// Main workflow passes customer data to validation workflow
|
||||
const customerData = <start.input>;
|
||||
|
||||
// Validation workflow processes the data
|
||||
const emailValid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(customerData.email);
|
||||
const phoneValid = /^\+?[1-9]\d{1,14}$/.test(customerData.phone);
|
||||
|
||||
return {
|
||||
customer: customerData,
|
||||
validation: {
|
||||
email: emailValid,
|
||||
phone: phoneValid,
|
||||
overall: emailValid && phoneValid
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Keep workflows focused**: Design child workflows to handle specific, well-defined tasks with clear inputs and outputs
|
||||
- **Minimize nesting depth**: Avoid deeply nested workflow hierarchies for better maintainability and performance
|
||||
- **Handle errors gracefully**: Implement proper error handling for child workflow failures and provide fallback mechanisms
|
||||
- **Document dependencies**: Clearly document which workflows depend on others and maintain dependency maps
|
||||
- **Test independently**: Ensure child workflows can be tested and validated independently from parent workflows
|
||||
- **Monitor performance**: Be aware that nested workflows can impact overall execution time and resource usage
|
||||
- **Use semantic naming**: Give workflows descriptive names that clearly indicate their purpose and functionality
|
||||
@@ -1,190 +0,0 @@
|
||||
---
|
||||
title: Accessing Connected Data
|
||||
description: Techniques for accessing and manipulating data from connected blocks
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { File, Files, Folder } from 'fumadocs-ui/components/files'
|
||||
|
||||
Once blocks are connected, you can access data from source blocks in destination blocks using connection tags and various data access techniques.
|
||||
|
||||
## Basic Data Access
|
||||
|
||||
The simplest way to access data is through direct references using connection tags:
|
||||
|
||||
<Files>
|
||||
<File name="Simple Property" annotation="<block.content>" />
|
||||
<File name="Nested Property" annotation="<block.tokens.total>" />
|
||||
<File name="Array Element" annotation="<block.items[0].name>" />
|
||||
<File name="Complex Path" annotation="<block.data.users[2].profile.email>" />
|
||||
</Files>
|
||||
|
||||
## Advanced Data Access Techniques
|
||||
|
||||
### Array Access
|
||||
|
||||
You can access array elements using square bracket notation:
|
||||
|
||||
```javascript
|
||||
// Access the first item in an array
|
||||
<block.items[0]>
|
||||
|
||||
// Access a specific property of an array item
|
||||
<block.items[2].name>
|
||||
|
||||
// Access the last item in an array (in Function blocks)
|
||||
const items = input.block.items;
|
||||
const lastItem = items[items.length - 1];
|
||||
```
|
||||
|
||||
### Object Property Access
|
||||
|
||||
Access object properties using dot notation:
|
||||
|
||||
```javascript
|
||||
// Access a simple property
|
||||
<block.content>
|
||||
|
||||
// Access a nested property
|
||||
<block.data.user.profile.name>
|
||||
|
||||
// Access a property with special characters (in Function blocks)
|
||||
const data = input.block.data;
|
||||
const specialProp = data['property-with-dashes'];
|
||||
```
|
||||
|
||||
### Dynamic References
|
||||
|
||||
Connection references are evaluated at runtime, allowing for dynamic data flow through your workflow:
|
||||
|
||||
```javascript
|
||||
// In a Function block, you can access connected data
|
||||
const userName = input.userBlock.name;
|
||||
const orderTotal = input.apiBlock.body.order.total;
|
||||
|
||||
// Process the data
|
||||
const discount = orderTotal > 100 ? 0.1 : 0;
|
||||
const finalPrice = orderTotal * (1 - discount);
|
||||
|
||||
// Return the result
|
||||
return {
|
||||
userName,
|
||||
originalTotal: orderTotal,
|
||||
discount: discount * 100 + '%',
|
||||
finalPrice
|
||||
};
|
||||
```
|
||||
|
||||
## Data Transformation
|
||||
|
||||
### Using Function Blocks
|
||||
|
||||
Function blocks are the most powerful way to transform data between connections:
|
||||
|
||||
```javascript
|
||||
// Example: Transform API response data
|
||||
const apiResponse = input.apiBlock.data;
|
||||
const transformedData = {
|
||||
users: apiResponse.results.map(user => ({
|
||||
id: user.id,
|
||||
fullName: `${user.firstName} ${user.lastName}`,
|
||||
email: user.email.toLowerCase(),
|
||||
isActive: user.status === 'active'
|
||||
})),
|
||||
totalCount: apiResponse.count,
|
||||
timestamp: new Date().toISOString()
|
||||
};
|
||||
|
||||
return transformedData;
|
||||
```
|
||||
|
||||
### String Interpolation
|
||||
|
||||
You can combine connection tags with static text:
|
||||
|
||||
```
|
||||
Hello, <userBlock.name>! Your order #<orderBlock.id> has been processed.
|
||||
```
|
||||
|
||||
### Conditional Content
|
||||
|
||||
In Function blocks, you can create conditional content based on connected data:
|
||||
|
||||
```javascript
|
||||
const user = input.userBlock;
|
||||
const orderTotal = input.orderBlock.total;
|
||||
|
||||
let message = `Thank you for your order, ${user.name}!`;
|
||||
|
||||
if (orderTotal > 100) {
|
||||
message += " You've qualified for free shipping!";
|
||||
} else {
|
||||
message += ` Add $${(100 - orderTotal).toFixed(2)} more to qualify for free shipping.`;
|
||||
}
|
||||
|
||||
return { message };
|
||||
```
|
||||
|
||||
## Handling Missing Data
|
||||
|
||||
It's important to handle cases where connected data might be missing or null:
|
||||
|
||||
<Callout type="warning">
|
||||
Always validate connected data before using it, especially when accessing nested properties or
|
||||
array elements.
|
||||
</Callout>
|
||||
|
||||
### Default Values
|
||||
|
||||
In Function blocks, you can provide default values for missing data:
|
||||
|
||||
```javascript
|
||||
const userName = input.userBlock?.name || 'Guest'
|
||||
const items = input.orderBlock?.items || []
|
||||
const total = input.orderBlock?.total ?? 0
|
||||
```
|
||||
|
||||
### Conditional Checks
|
||||
|
||||
Check if data exists before accessing nested properties:
|
||||
|
||||
```javascript
|
||||
let userEmail = 'No email provided'
|
||||
if (input.userBlock && input.userBlock.contact && input.userBlock.contact.email) {
|
||||
userEmail = input.userBlock.contact.email
|
||||
}
|
||||
```
|
||||
|
||||
### Optional Chaining
|
||||
|
||||
In Function blocks, use optional chaining to safely access nested properties:
|
||||
|
||||
```javascript
|
||||
const userCity = input.userBlock?.address?.city
|
||||
const firstItemName = input.orderBlock?.items?.[0]?.name
|
||||
```
|
||||
|
||||
## Debugging Connection Data
|
||||
|
||||
When troubleshooting connection issues, these techniques can help:
|
||||
|
||||
1. **Log Data**: In Function blocks, use `console.log()` to inspect connected data
|
||||
2. **Return Full Objects**: Return the full input object to see all available data
|
||||
3. **Check Types**: Verify the data types of connected values
|
||||
4. **Validate Paths**: Ensure you're using the correct path to access nested data
|
||||
|
||||
```javascript
|
||||
// Example debugging function
|
||||
function debugConnections() {
|
||||
console.log('All inputs:', input)
|
||||
console.log('User data type:', typeof input.userBlock)
|
||||
console.log('Order items:', input.orderBlock?.items)
|
||||
|
||||
return {
|
||||
debug: true,
|
||||
allInputs: input,
|
||||
userExists: !!input.userBlock,
|
||||
orderItemCount: input.orderBlock?.items?.length || 0,
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1,76 +0,0 @@
|
||||
---
|
||||
title: Connection Basics
|
||||
description: Learn how connections work in Sim
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
|
||||
## How Connections Work
|
||||
|
||||
Connections are the pathways that allow data to flow between blocks in your workflow. When you connect two blocks in Sim, you're establishing a data flow relationship that defines how information passes from one block to another.
|
||||
|
||||
<Callout type="info">
|
||||
Each connection represents a directed relationship where data flows from a source block's output
|
||||
to a destination block's input.
|
||||
</Callout>
|
||||
|
||||
### Creating Connections
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Select Source Block</strong>: Click on the output port of the block you want to connect
|
||||
from
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Draw Connection</strong>: Drag to the input port of the destination block
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Confirm Connection</strong>: Release to create the connection
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Configure (Optional)</strong>: Some connections may require additional configuration
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Connection Flow
|
||||
|
||||
The flow of data through connections follows these principles:
|
||||
|
||||
1. **Directional Flow**: Data always flows from outputs to inputs
|
||||
2. **Execution Order**: Blocks execute in order based on their connections
|
||||
3. **Data Transformation**: Data may be transformed as it passes between blocks
|
||||
4. **Conditional Paths**: Some blocks (like Router and Condition) can direct flow to different paths
|
||||
|
||||
### Connection Visualization
|
||||
|
||||
Connections are visually represented in the workflow editor:
|
||||
|
||||
- **Solid Lines**: Active connections that will pass data
|
||||
- **Animated Flow**: During execution, data flow is visualized along connections
|
||||
- **Color Coding**: Different connection types may have different colors
|
||||
- **Connection Tags**: Visual indicators showing what data is available
|
||||
|
||||
### Managing Connections
|
||||
|
||||
You can manage your connections in several ways:
|
||||
|
||||
- **Delete**: Click on a connection and press Delete or use the context menu
|
||||
- **Reroute**: Drag a connection to change its path
|
||||
- **Inspect**: Click on a connection to see details about the data being passed
|
||||
- **Disable**: Temporarily disable a connection without deleting it
|
||||
|
||||
<Callout type="warning">
|
||||
Deleting a connection will immediately stop data flow between the blocks. Make sure this is
|
||||
intended before removing connections.
|
||||
</Callout>
|
||||
|
||||
## Connection Compatibility
|
||||
|
||||
Not all blocks can be connected to each other. Compatibility depends on:
|
||||
|
||||
1. **Data Type Compatibility**: The output type must be compatible with the input type
|
||||
2. **Block Restrictions**: Some blocks may have restrictions on what they can connect to
|
||||
3. **Workflow Logic**: Connections must make logical sense in the context of your workflow
|
||||
|
||||
The editor will indicate when connections are invalid or incompatible.
|
||||
@@ -1,208 +0,0 @@
|
||||
---
|
||||
title: Connection Best Practices
|
||||
description: Recommended patterns for effective connection management
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
|
||||
## Workflow Organization
|
||||
|
||||
### Organize Your Connections
|
||||
|
||||
Keep your workflow clean and understandable by organizing connections logically:
|
||||
|
||||
- **Minimize crossing connections** when possible to reduce visual complexity
|
||||
- **Group related blocks together** to make data flow more intuitive
|
||||
- **Use consistent flow direction** (typically left-to-right or top-to-bottom)
|
||||
- **Label complex connections** with descriptive names
|
||||
|
||||
<Callout type="info">
|
||||
A well-organized workflow is easier to understand, debug, and maintain. Take time to arrange your
|
||||
blocks and connections in a logical manner.
|
||||
</Callout>
|
||||
|
||||
### Connection Naming Conventions
|
||||
|
||||
When working with multiple connections, consistent naming helps maintain clarity:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Use descriptive block names</strong>: Name blocks based on their function (e.g.,
|
||||
"UserDataFetcher", "ResponseGenerator")
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Be specific with connection references</strong>: Use clear variable names when
|
||||
referencing connections in code
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Document complex connections</strong>: Add comments explaining non-obvious data
|
||||
transformations
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Data Validation
|
||||
|
||||
### Validate Data Flow
|
||||
|
||||
Ensure that the data being passed between blocks is compatible:
|
||||
|
||||
- **Check that required fields are available** in the source block
|
||||
- **Verify data types match expectations** before using them
|
||||
- **Use Function blocks to transform data** when necessary
|
||||
- **Handle missing or null values** with default values or conditional logic
|
||||
|
||||
```javascript
|
||||
// Example: Validating and transforming data in a Function block
|
||||
function processUserData() {
|
||||
// Validate required fields
|
||||
if (!input.userBlock || !input.userBlock.id) {
|
||||
return { error: 'Missing user data', valid: false }
|
||||
}
|
||||
|
||||
// Transform and validate data types
|
||||
const userId = String(input.userBlock.id)
|
||||
const userName = input.userBlock.name || 'Unknown User'
|
||||
const userScore = Number(input.userBlock.score) || 0
|
||||
|
||||
return {
|
||||
valid: true,
|
||||
user: {
|
||||
id: userId,
|
||||
name: userName,
|
||||
score: userScore,
|
||||
isHighScore: userScore > 100,
|
||||
},
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
### Document Connection Purpose
|
||||
|
||||
Add comments or descriptions to clarify the purpose of connections, especially in complex workflows:
|
||||
|
||||
- **What data is being passed**: Document the key fields and their purpose
|
||||
- **Why this connection exists**: Explain the relationship between blocks
|
||||
- **Any transformations or conditions applied**: Note any data processing that occurs
|
||||
|
||||
```javascript
|
||||
// Example: Documenting connection purpose in a Function block
|
||||
/*
|
||||
* This function processes user data from the UserFetcher block
|
||||
* and order history from the OrderHistory block to generate
|
||||
* personalized product recommendations.
|
||||
*
|
||||
* Input:
|
||||
* - userBlock: User profile data (id, preferences, history)
|
||||
* - orderBlock: Recent order history (items, dates, amounts)
|
||||
*
|
||||
* Output:
|
||||
* - recommendations: Array of recommended product IDs
|
||||
* - userSegment: Calculated user segment for marketing
|
||||
* - conversionProbability: Estimated likelihood of purchase
|
||||
*/
|
||||
function generateRecommendations() {
|
||||
// Implementation...
|
||||
}
|
||||
```
|
||||
|
||||
## Testing and Debugging
|
||||
|
||||
### Test Connection References
|
||||
|
||||
Verify that connection references work as expected:
|
||||
|
||||
- **Test with different input values** to ensure robustness
|
||||
- **Check edge cases** (empty values, large datasets, special characters)
|
||||
- **Ensure error handling for missing or invalid data**
|
||||
- **Use console logging in Function blocks** to debug connection issues
|
||||
|
||||
```javascript
|
||||
// Example: Testing connection references with edge cases
|
||||
function testConnections() {
|
||||
console.log('Testing connections...')
|
||||
|
||||
// Log all inputs for debugging
|
||||
console.log('All inputs:', JSON.stringify(input, null, 2))
|
||||
|
||||
// Test for missing data
|
||||
const hasUserData = !!input.userBlock
|
||||
console.log('Has user data:', hasUserData)
|
||||
|
||||
// Test edge cases
|
||||
const items = input.orderBlock?.items || []
|
||||
console.log('Item count:', items.length)
|
||||
console.log('Empty items test:', items.length === 0 ? 'Passed' : 'Failed')
|
||||
|
||||
// Return test results
|
||||
return {
|
||||
tests: {
|
||||
hasUserData,
|
||||
hasItems: items.length > 0,
|
||||
hasLargeOrder: items.length > 10,
|
||||
},
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Performance Considerations
|
||||
|
||||
### Optimize Data Flow
|
||||
|
||||
Keep your workflows efficient by optimizing how data flows through connections:
|
||||
|
||||
- **Pass only necessary data** between blocks to reduce memory usage
|
||||
- **Use Function blocks to filter large datasets** before passing them on
|
||||
- **Consider caching results** for expensive operations
|
||||
- **Break complex workflows into smaller, reusable components**
|
||||
|
||||
```javascript
|
||||
// Example: Optimizing data flow by filtering
|
||||
function optimizeUserData() {
|
||||
const userData = input.userBlock
|
||||
|
||||
// Only pass necessary fields to downstream blocks
|
||||
return {
|
||||
id: userData.id,
|
||||
name: userData.name,
|
||||
email: userData.email,
|
||||
// Filter out unnecessary profile data, history, etc.
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Security Best Practices
|
||||
|
||||
### Secure Sensitive Data
|
||||
|
||||
Protect sensitive information when using connections:
|
||||
|
||||
- **Never expose API keys or credentials** in connection data
|
||||
- **Sanitize user input** before processing it
|
||||
- **Redact sensitive information** when logging connection data
|
||||
- **Use secure connections** for external API calls
|
||||
|
||||
<Callout type="warning">
|
||||
Be careful when logging connection data that might contain sensitive information. Always redact or
|
||||
mask sensitive fields like passwords, API keys, or personal information.
|
||||
</Callout>
|
||||
|
||||
## Advanced Patterns
|
||||
|
||||
### Conditional Connections
|
||||
|
||||
Use Condition blocks to create dynamic workflows:
|
||||
|
||||
- **Route data based on content** to different processing paths
|
||||
- **Implement fallback paths** for error handling
|
||||
- **Create decision trees** for complex business logic
|
||||
|
||||
### Feedback Loops
|
||||
|
||||
Create more sophisticated workflows with feedback connections:
|
||||
|
||||
- **Implement iterative processing** by connecting later blocks back to earlier ones
|
||||
- **Use Memory blocks** to store state between iterations
|
||||
- **Set termination conditions** to prevent infinite loops
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"title": "Connections",
|
||||
"pages": ["basics", "tags", "data-structure", "accessing-data", "best-practices"]
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"title": "Copilot",
|
||||
"pages": ["index"]
|
||||
}
|
||||
280
apps/docs/content/docs/de/blocks/agent.mdx
Normal file
280
apps/docs/content/docs/de/blocks/agent.mdx
Normal file
@@ -0,0 +1,280 @@
|
||||
---
|
||||
title: Agent
|
||||
---
|
||||
|
||||
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 Agent-Block dient als Schnittstelle zwischen Ihrem Workflow und Large Language Models (LLMs). Er führt Inferenzanfragen an verschiedene KI-Anbieter aus, verarbeitet natürlichsprachliche Eingaben gemäß definierten Anweisungen und erzeugt strukturierte oder unstrukturierte Ausgaben für die nachgelagerte Verarbeitung.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/agent.png"
|
||||
alt="Agent-Block-Konfiguration"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der Agent-Block ermöglicht Ihnen:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Natürliche Sprache verarbeiten</strong>: Benutzereingaben analysieren und kontextbezogene Antworten generieren
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>KI-gestützte Aufgaben ausführen</strong>: Inhaltsanalyse, -erstellung und Entscheidungsfindung durchführen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Externe Tools aufrufen</strong>: Während der Verarbeitung auf APIs, Datenbanken und Dienste zugreifen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Strukturierte Ausgabe erzeugen</strong>: JSON-Daten zurückgeben, die Ihren Schema-Anforderungen entsprechen
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### System-Prompt
|
||||
|
||||
Der System-Prompt legt die Betriebsparameter und Verhaltenseinschränkungen des Agenten fest. Diese Konfiguration definiert die Rolle des Agenten, die Antwortmethodik und die Verarbeitungsgrenzen für alle eingehenden Anfragen.
|
||||
|
||||
```markdown
|
||||
You are a helpful assistant that specializes in financial analysis.
|
||||
Always provide clear explanations and cite sources when possible.
|
||||
When responding to questions about investments, include risk disclaimers.
|
||||
```
|
||||
|
||||
### Benutzer-Prompt
|
||||
|
||||
Der Benutzer-Prompt stellt die primären Eingabedaten für die Inferenzverarbeitung dar. Dieser Parameter akzeptiert natürlichsprachlichen Text oder strukturierte Daten, die der Agent analysieren und auf die er reagieren wird. Zu den Eingabequellen gehören:
|
||||
|
||||
- **Statische Konfiguration**: Direkte Texteingabe, die in der Block-Konfiguration angegeben ist
|
||||
- **Dynamische Eingabe**: Daten, die von vorgelagerten Blöcken über Verbindungsschnittstellen übergeben werden
|
||||
- **Laufzeitgenerierung**: Programmatisch erzeugte Inhalte während der Workflow-Ausführung
|
||||
|
||||
### Modellauswahl
|
||||
|
||||
Der Agent-Block unterstützt mehrere LLM-Anbieter über eine einheitliche Inferenzschnittstelle. Verfügbare Modelle umfassen:
|
||||
|
||||
**OpenAI-Modelle**: GPT-5, GPT-4o, o1, o3, o4-mini, gpt-4.1 (API-basierte Inferenz)
|
||||
**Anthropic-Modelle**: Claude 3.7 Sonnet (API-basierte Inferenz)
|
||||
**Google-Modelle**: Gemini 2.5 Pro, Gemini 2.0 Flash (API-basierte Inferenz)
|
||||
**Alternative Anbieter**: Groq, Cerebras, xAI, DeepSeek (API-basierte Inferenz)
|
||||
**Lokale Bereitstellung**: Ollama-kompatible Modelle (selbst gehostete Inferenz)
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="models.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
### Temperatur
|
||||
|
||||
Steuern Sie die Kreativität und Zufälligkeit der Antworten:
|
||||
|
||||
<Tabs items={['Niedrig (0-0,3)', 'Mittel (0,3-0,7)', 'Hoch (0,7-2,0)']}>
|
||||
<Tab>
|
||||
Deterministische, fokussierte Antworten. Am besten für faktische Aufgaben, Kundensupport und
|
||||
Situationen, in denen Genauigkeit entscheidend ist.
|
||||
</Tab>
|
||||
<Tab>
|
||||
Ausgewogene Kreativität und Fokus. Geeignet für allgemeine Anwendungen, die sowohl
|
||||
Genauigkeit als auch etwas Kreativität erfordern.
|
||||
</Tab>
|
||||
<Tab>
|
||||
Kreativere, abwechslungsreichere Antworten. Ideal für kreatives Schreiben, Brainstorming und das Generieren
|
||||
vielfältiger Ideen.
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<div className="mt-4 text-sm text-gray-600 dark:text-gray-400">
|
||||
Der Temperaturbereich (0-1 oder 0-2) variiert je nach ausgewähltem Modell.
|
||||
</div>
|
||||
|
||||
### API-Schlüssel
|
||||
|
||||
Ihr API-Schlüssel für den ausgewählten LLM-Anbieter. Dieser wird sicher gespeichert und für die Authentifizierung verwendet.
|
||||
|
||||
### Tools
|
||||
|
||||
Tools erweitern die Fähigkeiten des Agenten durch externe API-Integrationen und Service-Verbindungen. Das Tool-System ermöglicht Funktionsaufrufe, sodass der Agent Operationen über die Texterstellung hinaus ausführen kann.
|
||||
|
||||
**Tool-Integrationsprozess**:
|
||||
1. Zugriff auf den Tools-Konfigurationsbereich innerhalb des Agent-Blocks
|
||||
2. Auswahl aus über 60 vorgefertigten Integrationen oder Definition benutzerdefinierter Funktionen
|
||||
3. Konfiguration von Authentifizierungsparametern und Betriebseinschränkungen
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="tools.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Verfügbare Tool-Kategorien**:
|
||||
- **Kommunikation**: Gmail, Slack, Telegram, WhatsApp, Microsoft Teams
|
||||
- **Datenquellen**: Notion, Google Sheets, Airtable, Supabase, Pinecone
|
||||
- **Webdienste**: Firecrawl, Google Search, Exa AI, Browser-Automatisierung
|
||||
- **Entwicklung**: GitHub, Jira, Linear Repository- und Issue-Management
|
||||
- **KI-Dienste**: OpenAI, Perplexity, Hugging Face, ElevenLabs
|
||||
|
||||
**Steuerung der Tool-Ausführung**:
|
||||
- **Auto**: Modell bestimmt Tool-Aufruf basierend auf Kontext und Notwendigkeit
|
||||
- **Required**: Tool muss bei jeder Inferenzanfrage aufgerufen werden
|
||||
- **None**: Tool-Definition verfügbar, aber vom Modellkontext ausgeschlossen
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="granular-tool-control.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
### Antwortformat
|
||||
|
||||
Der Parameter für das Antwortformat erzwingt eine strukturierte Ausgabegenerierung durch JSON-Schema-Validierung. Dies gewährleistet konsistente, maschinenlesbare Antworten, die vordefinierten Datenstrukturen entsprechen:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "user_analysis",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sentiment": {
|
||||
"type": "string",
|
||||
"enum": ["positive", "negative", "neutral"]
|
||||
},
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1
|
||||
}
|
||||
},
|
||||
"required": ["sentiment", "confidence"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Diese Konfiguration beschränkt die Ausgabe des Modells auf die Einhaltung des angegebenen Schemas, verhindert Freitext-Antworten und stellt eine strukturierte Datengenerierung sicher.
|
||||
|
||||
### Zugriff auf Ergebnisse
|
||||
|
||||
Nach Abschluss eines Agenten können Sie auf seine Ausgaben zugreifen:
|
||||
|
||||
- **`<agent.content>`**: Der Antworttext oder die strukturierten Daten des Agenten
|
||||
- **`<agent.tokens>`**: Token-Nutzungsstatistiken (Prompt, Completion, Gesamt)
|
||||
- **`<agent.tool_calls>`**: Details zu allen Tools, die der Agent während der Ausführung verwendet hat
|
||||
- **`<agent.cost>`**: Geschätzte Kosten des API-Aufrufs (falls verfügbar)
|
||||
|
||||
## Erweiterte Funktionen
|
||||
|
||||
### Memory + Agent: Gesprächsverlauf
|
||||
|
||||
Verwenden Sie einen `Memory`Block mit einer konsistenten `id` (zum Beispiel `chat`), um Nachrichten zwischen Durchläufen zu speichern und diesen Verlauf in den Prompt des Agenten einzubeziehen.
|
||||
|
||||
- Fügen Sie die Nachricht des Benutzers vor dem Agenten hinzu
|
||||
- Lesen Sie den Gesprächsverlauf für den Kontext
|
||||
- Hängen Sie die Antwort des Agenten nach dessen Ausführung an
|
||||
|
||||
Siehe die [`Memory`](/tools/memory) Blockreferenz für Details.
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Konfiguration', 'Variablen', 'Ergebnisse']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>System-Prompt</strong>: Anweisungen, die das Verhalten und die Rolle des Agenten definieren
|
||||
</li>
|
||||
<li>
|
||||
<strong>Benutzer-Prompt</strong>: Eingabetext oder zu verarbeitende Daten
|
||||
</li>
|
||||
<li>
|
||||
<strong>Modell</strong>: KI-Modellauswahl (OpenAI, Anthropic, Google, usw.)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Temperatur</strong>: Steuerung der Zufälligkeit der Antwort (0-2)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Tools</strong>: Array verfügbarer Tools für Funktionsaufrufe
|
||||
</li>
|
||||
<li>
|
||||
<strong>Antwortformat</strong>: JSON-Schema für strukturierte Ausgabe
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>agent.content</strong>: Antworttext oder strukturierte Daten des Agenten
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.tokens</strong>: Token-Nutzungsstatistik-Objekt
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.tool_calls</strong>: Array mit Details zur Tool-Ausführung
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.cost</strong>: Geschätzte API-Aufrufkosten (falls verfügbar)
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Content</strong>: Primäre Antwortausgabe vom Agenten
|
||||
</li>
|
||||
<li>
|
||||
<strong>Metadata</strong>: Nutzungsstatistiken und Ausführungsdetails
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Verfügbar in Blöcken nach dem Agenten
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### Automatisierung des Kundenservice
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Bearbeitung von Kundenanfragen mit Datenbankzugriff</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Benutzer reicht ein Support-Ticket über den API-Block ein</li>
|
||||
<li>Agent prüft Bestellungen/Abonnements in Postgres und durchsucht die Wissensdatenbank nach Anleitungen</li>
|
||||
<li>Falls eine Eskalation erforderlich ist, erstellt der Agent ein Linear-Ticket mit relevantem Kontext</li>
|
||||
<li>Agent erstellt eine klare E-Mail-Antwort</li>
|
||||
<li>Gmail sendet die Antwort an den Kunden</li>
|
||||
<li>Konversation wird im Memory gespeichert, um den Verlauf für zukünftige Nachrichten beizubehalten</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Multi-Modell-Inhaltsanalyse
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Analyse von Inhalten mit verschiedenen KI-Modellen</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Funktionsblock verarbeitet hochgeladenes Dokument</li>
|
||||
<li>Agent mit GPT-4o führt technische Analyse durch</li>
|
||||
<li>Agent mit Claude analysiert Stimmung und Tonfall</li>
|
||||
<li>Funktionsblock kombiniert Ergebnisse für den Abschlussbericht</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Werkzeuggestützter Forschungsassistent
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Forschungsassistent mit Websuche und Dokumentenzugriff</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Benutzeranfrage über Eingabe erhalten</li>
|
||||
<li>Agent durchsucht das Web mit dem Google-Suchwerkzeug</li>
|
||||
<li>Agent greift auf Notion-Datenbank für interne Dokumente zu</li>
|
||||
<li>Agent erstellt umfassenden Forschungsbericht</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Bewährte Praktiken
|
||||
|
||||
- **Sei spezifisch in System-Prompts**: Definiere die Rolle, den Ton und die Einschränkungen des Agenten klar. Je spezifischer deine Anweisungen sind, desto besser kann der Agent seinen vorgesehenen Zweck erfüllen.
|
||||
- **Wähle die richtige Temperatureinstellung**: Verwende niedrigere Temperatureinstellungen (0-0,3), wenn Genauigkeit wichtig ist, oder erhöhe die Temperatur (0,7-2,0) für kreativere oder abwechslungsreichere Antworten
|
||||
- **Nutze Werkzeuge effektiv**: Integriere Werkzeuge, die den Zweck des Agenten ergänzen und seine Fähigkeiten verbessern. Sei selektiv bei der Auswahl der Werkzeuge, um den Agenten nicht zu überfordern. Für Aufgaben mit wenig Überschneidung verwende einen anderen Agent-Block für die besten Ergebnisse.
|
||||
232
apps/docs/content/docs/de/blocks/api.mdx
Normal file
232
apps/docs/content/docs/de/blocks/api.mdx
Normal file
@@ -0,0 +1,232 @@
|
||||
---
|
||||
title: API
|
||||
---
|
||||
|
||||
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'
|
||||
|
||||
Der API-Block ermöglicht es Ihnen, Ihren Workflow über API-Endpunkte mit externen Diensten zu verbinden, indem HTTP-Anfragen verwendet werden. Er unterstützt verschiedene Methoden wie GET, POST, PUT, DELETE und PATCH, wodurch Sie mit praktisch jedem API-Endpunkt interagieren können.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/api.png"
|
||||
alt="API-Block"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der API-Block ermöglicht Ihnen:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Verbindung zu externen Diensten</strong>: HTTP-Anfragen an REST-APIs und Webdienste stellen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Daten senden und empfangen</strong>: Antworten verarbeiten und Daten aus externen Quellen transformieren
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Integration von Drittanbieter-Plattformen</strong>: Verbindung mit Diensten wie Stripe, Slack oder benutzerdefinierten APIs
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Authentifizierung verwalten</strong>: Unterstützung verschiedener Authentifizierungsmethoden einschließlich Bearer-Tokens und API-Schlüssel
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Funktionsweise
|
||||
|
||||
Der API-Block verarbeitet HTTP-Anfragen durch einen strukturierten Ansatz:
|
||||
|
||||
1. **Anfrage konfigurieren** - URL, Methode, Header und Body-Parameter festlegen
|
||||
2. **Anfrage ausführen** - HTTP-Anfrage an den angegebenen Endpunkt senden
|
||||
3. **Antwort verarbeiten** - Antwortdaten, Statuscodes und Header verarbeiten
|
||||
4. **Fehlerbehandlung** - Timeouts, Wiederholungsversuche und Fehlerbedingungen verwalten
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### URL
|
||||
|
||||
Die Endpunkt-URL für die API-Anfrage. Dies kann sein:
|
||||
|
||||
- Eine statische URL, die direkt im Block eingegeben wird
|
||||
- Eine dynamische URL, die mit der Ausgabe eines anderen Blocks verbunden ist
|
||||
- Eine URL mit Pfadparametern
|
||||
|
||||
### Methode
|
||||
|
||||
Wählen Sie die HTTP-Methode für Ihre Anfrage:
|
||||
|
||||
- **GET**: Daten vom Server abrufen
|
||||
- **POST**: Daten an den Server senden, um eine Ressource zu erstellen
|
||||
- **PUT**: Eine bestehende Ressource auf dem Server aktualisieren
|
||||
- **DELETE**: Eine Ressource vom Server entfernen
|
||||
- **PATCH**: Eine bestehende Ressource teilweise aktualisieren
|
||||
|
||||
### Abfrageparameter
|
||||
|
||||
Definieren Sie Schlüssel-Wert-Paare, die als Abfrageparameter an die URL angehängt werden. Zum Beispiel:
|
||||
|
||||
```
|
||||
Key: apiKey
|
||||
Value: your_api_key_here
|
||||
|
||||
Key: limit
|
||||
Value: 10
|
||||
```
|
||||
|
||||
Diese würden der URL als `?apiKey=your_api_key_here&limit=10` hinzugefügt werden.
|
||||
|
||||
### Header
|
||||
|
||||
Konfigurieren Sie HTTP-Header für Ihre Anfrage. Häufige Header sind:
|
||||
|
||||
```
|
||||
Key: Content-Type
|
||||
Value: application/json
|
||||
|
||||
Key: Authorization
|
||||
Value: Bearer your_token_here
|
||||
```
|
||||
|
||||
### Anfrage-Body
|
||||
|
||||
Für Methoden, die einen Anfrage-Body unterstützen (POST, PUT, PATCH), können Sie die zu sendenden Daten definieren. Der Body kann sein:
|
||||
|
||||
- JSON-Daten, die direkt im Block eingegeben werden
|
||||
- Daten, die mit der Ausgabe eines anderen Blocks verbunden sind
|
||||
- Dynamisch während der Workflow-Ausführung generierte Daten
|
||||
|
||||
### Zugriff auf Ergebnisse
|
||||
|
||||
Nach Abschluss einer API-Anfrage können Sie auf folgende Ausgaben zugreifen:
|
||||
|
||||
- **`<api.data>`**: Die Antwortdaten vom API
|
||||
- **`<api.status>`**: HTTP-Statuscode (200, 404, 500, usw.)
|
||||
- **`<api.headers>`**: Antwort-Header vom Server
|
||||
- **`<api.error>`**: Fehlerdetails, falls die Anfrage fehlgeschlagen ist
|
||||
|
||||
## Erweiterte Funktionen
|
||||
|
||||
### Dynamische URL-Konstruktion
|
||||
|
||||
Bauen Sie URLs dynamisch mit Variablen aus vorherigen Blöcken:
|
||||
|
||||
```javascript
|
||||
// In a Function block before the API
|
||||
const userId = <start.userId>;
|
||||
const apiUrl = `https://api.example.com/users/${userId}/profile`;
|
||||
```
|
||||
|
||||
### Anfrage-Wiederholungen
|
||||
|
||||
Der API-Block behandelt automatisch:
|
||||
- Netzwerk-Timeouts mit exponentiellem Backoff
|
||||
- Rate-Limit-Antworten (429-Statuscodes)
|
||||
- Serverfehler (5xx-Statuscodes) mit Wiederholungslogik
|
||||
- Verbindungsfehler mit Wiederverbindungsversuchen
|
||||
|
||||
### Antwortvalidierung
|
||||
|
||||
Validieren Sie API-Antworten vor der Verarbeitung:
|
||||
|
||||
```javascript
|
||||
// In a Function block after the API
|
||||
if (<api.status> === 200) {
|
||||
const data = <api.data>;
|
||||
// Process successful response
|
||||
} else {
|
||||
// Handle error response
|
||||
console.error(`API Error: ${<api.status>}`);
|
||||
}
|
||||
```
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>URL</strong>: Der Endpunkt, an den die Anfrage gesendet werden soll
|
||||
</li>
|
||||
<li>
|
||||
<strong>Method</strong>: HTTP-Methode (GET, POST, PUT, DELETE, PATCH)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Query Parameters</strong>: Schlüssel-Wert-Paare für URL-Parameter
|
||||
</li>
|
||||
<li>
|
||||
<strong>Headers</strong>: HTTP-Header für Authentifizierung und Inhaltstyp
|
||||
</li>
|
||||
<li>
|
||||
<strong>Body</strong>: Anfrage-Payload für POST/PUT/PATCH-Methoden
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>api.data</strong>: Antwortdaten vom API-Aufruf
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.status</strong>: Vom Server zurückgegebener HTTP-Statuscode
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.headers</strong>: Antwort-Header vom Server
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.error</strong>: Fehlerdetails, falls die Anfrage fehlgeschlagen ist
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Response Data</strong>: Primärer API-Antwortinhalt
|
||||
</li>
|
||||
<li>
|
||||
<strong>Status Information</strong>: HTTP-Status und Fehlerdetails
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Verfügbar in Blöcken nach dem API-Aufruf
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### Benutzerprofildaten abrufen
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Benutzerinformationen von externem Dienst abrufen</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Funktionsblock erstellt Benutzer-ID aus Eingabe</li>
|
||||
<li>API-Block ruft GET /users/{id} Endpunkt auf</li>
|
||||
<li>Funktionsblock verarbeitet und formatiert Benutzerdaten</li>
|
||||
<li>Antwortblock gibt formatiertes Profil zurück</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Zahlungsabwicklung
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Zahlung über Stripe API verarbeiten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Funktionsblock validiert Zahlungsdaten</li>
|
||||
<li>API-Block erstellt Zahlungsabsicht über Stripe</li>
|
||||
<li>Bedingungsblock behandelt Zahlungserfolg/-fehler</li>
|
||||
<li>Supabase-Block aktualisiert Bestellstatus in der Datenbank</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Umgebungsvariablen für sensible Daten verwenden**: Keine API-Schlüssel oder Anmeldedaten im Code hinterlegen
|
||||
- **Fehler elegant behandeln**: Fehlerbehandlungslogik für fehlgeschlagene Anfragen einbinden
|
||||
- **Antworten validieren**: Statuscodes und Antwortformate vor der Datenverarbeitung prüfen
|
||||
- **Ratenbegrenzungen beachten**: Auf API-Ratenbegrenzungen achten und angemessene Drosselung implementieren
|
||||
242
apps/docs/content/docs/de/blocks/condition.mdx
Normal file
242
apps/docs/content/docs/de/blocks/condition.mdx
Normal file
@@ -0,0 +1,242 @@
|
||||
---
|
||||
title: Bedingung
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
Der Bedingungsblock ermöglicht es Ihnen, den Ausführungspfad Ihres Workflows basierend auf booleschen Ausdrücken zu verzweigen und so dynamische, reaktionsfähige Workflows mit unterschiedlichen Ausführungspfaden zu erstellen. Er wertet Bedingungen aus und leitet den Workflow entsprechend weiter, sodass Sie den Ausführungsfluss basierend auf Daten oder Logik steuern können, ohne ein LLM zu benötigen.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/condition.png"
|
||||
alt="Bedingungsblock"
|
||||
width={500}
|
||||
height={350}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Callout>
|
||||
Bedingungsblöcke ermöglichen deterministische Entscheidungsfindung ohne ein LLM zu benötigen, was sie ideal
|
||||
für unkomplizierte Verzweigungslogik macht.
|
||||
</Callout>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der Bedingungsblock ermöglicht Ihnen:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Verzweigungslogik erstellen</strong>: Workflows basierend auf booleschen Ausdrücken leiten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Datengesteuerte Entscheidungen treffen</strong>: Bedingungen anhand von Ausgaben vorheriger Blöcke auswerten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Mehrere Szenarien behandeln</strong>: Mehrere Bedingungen mit unterschiedlichen Pfaden definieren
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Deterministische Weiterleitung bieten</strong>: Entscheidungen ohne ein LLM treffen
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Funktionsweise
|
||||
|
||||
Der Bedingungsblock arbeitet durch einen sequentiellen Auswertungsprozess:
|
||||
|
||||
1. **Ausdruck auswerten** - Verarbeitet den JavaScript/TypeScript-booleschen Ausdruck mit aktuellen Workflow-Daten
|
||||
2. **Ergebnis bestimmen** - Gibt basierend auf der Ausdrucksauswertung true oder false zurück
|
||||
3. **Workflow weiterleiten** - Leitet die Ausführung basierend auf dem Ergebnis an den entsprechenden Zielblock weiter
|
||||
4. **Kontext bereitstellen** - Generiert Metadaten über die Entscheidung für Debugging und Überwachung
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### Bedingungen
|
||||
|
||||
Definieren Sie eine oder mehrere Bedingungen, die ausgewertet werden. Jede Bedingung umfasst:
|
||||
|
||||
- **Ausdruck**: Ein JavaScript/TypeScript-Ausdruck, der zu true oder false ausgewertet wird
|
||||
- **Pfad**: Der Zielblock, zu dem weitergeleitet werden soll, wenn die Bedingung true ist
|
||||
- **Beschreibung**: Optionale Erklärung, was die Bedingung prüft
|
||||
|
||||
Sie können mehrere Bedingungen erstellen, die der Reihe nach ausgewertet werden, wobei die erste übereinstimmende Bedingung den Ausführungspfad bestimmt.
|
||||
|
||||
### Format für Bedingungsausdrücke
|
||||
|
||||
Bedingungen verwenden JavaScript-Syntax und können auf Eingabewerte aus vorherigen Blöcken verweisen.
|
||||
|
||||
<Tabs items={['Schwellenwert', 'Textanalyse', 'Mehrere Bedingungen']}>
|
||||
<Tab>
|
||||
|
||||
```javascript
|
||||
// Check if a score is above a threshold
|
||||
<agent.score> > 75
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```javascript
|
||||
// Check if a text contains specific keywords
|
||||
<agent.text>.includes('urgent') || <agent.text>.includes('emergency')
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```javascript
|
||||
// Check multiple conditions
|
||||
<agent.age> >= 18 && <agent.country> === 'US'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Zugriff auf Ergebnisse
|
||||
|
||||
Nach der Auswertung einer Bedingung können Sie auf folgende Ausgaben zugreifen:
|
||||
|
||||
- **`<condition.result>`**: Boolesches Ergebnis der Bedingungsauswertung
|
||||
- **`<condition.matched_condition>`**: ID der übereinstimmenden Bedingung
|
||||
- **`<condition.content>`**: Beschreibung des Auswertungsergebnisses
|
||||
- **`<condition.path>`**: Details zum gewählten Routing-Ziel
|
||||
|
||||
## Erweiterte Funktionen
|
||||
|
||||
### Komplexe Ausdrücke
|
||||
|
||||
Verwenden Sie JavaScript-Operatoren und -Funktionen in Bedingungen:
|
||||
|
||||
```javascript
|
||||
// String operations
|
||||
<user.email>.endsWith('@company.com')
|
||||
|
||||
// Array operations
|
||||
<api.tags>.includes('urgent')
|
||||
|
||||
// Mathematical operations
|
||||
<agent.confidence> * 100 > 85
|
||||
|
||||
// Date comparisons
|
||||
new Date(<api.created_at>) > new Date('2024-01-01')
|
||||
```
|
||||
|
||||
### Auswertung mehrerer Bedingungen
|
||||
|
||||
Bedingungen werden der Reihe nach ausgewertet, bis eine übereinstimmt:
|
||||
|
||||
```javascript
|
||||
// Condition 1: Check for high priority
|
||||
<ticket.priority> === 'high'
|
||||
|
||||
// Condition 2: Check for urgent keywords
|
||||
<ticket.subject>.toLowerCase().includes('urgent')
|
||||
|
||||
// Condition 3: Default fallback
|
||||
true
|
||||
```
|
||||
|
||||
### Fehlerbehandlung
|
||||
|
||||
Bedingungen behandeln automatisch:
|
||||
- Undefinierte oder Null-Werte mit sicherer Auswertung
|
||||
- Typabweichungen mit geeigneten Fallbacks
|
||||
- Ungültige Ausdrücke mit Fehlerprotokollierung
|
||||
- Fehlende Variablen mit Standardwerten
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Konfiguration', 'Variablen', 'Ergebnisse']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Bedingungen</strong>: Array von booleschen Ausdrücken zur Auswertung
|
||||
</li>
|
||||
<li>
|
||||
<strong>Ausdrücke</strong>: JavaScript/TypeScript-Bedingungen mit Block-Ausgaben
|
||||
</li>
|
||||
<li>
|
||||
<strong>Routing-Pfade</strong>: Zielblöcke für jedes Bedingungsergebnis
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>condition.result</strong>: Boolesches Ergebnis der Bedingungsauswertung
|
||||
</li>
|
||||
<li>
|
||||
<strong>condition.matched_condition</strong>: ID der übereinstimmenden Bedingung
|
||||
</li>
|
||||
<li>
|
||||
<strong>condition.content</strong>: Beschreibung des Auswertungsergebnisses
|
||||
</li>
|
||||
<li>
|
||||
<strong>condition.path</strong>: Details zum gewählten Routing-Ziel
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Boolesches Ergebnis</strong>: Primäres Ergebnis der Bedingungsauswertung
|
||||
</li>
|
||||
<li>
|
||||
<strong>Routing-Informationen</strong>: Pfadauswahl und Bedingungsdetails
|
||||
</li>
|
||||
<li>
|
||||
<strong>Zugriff</strong>: Verfügbar in Blöcken nach der Bedingung
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### Routing im Kundenservice
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Support-Tickets nach Priorität weiterleiten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>API-Block ruft Support-Ticket-Daten ab</li>
|
||||
<li>Bedingung prüft, ob `<api.priority>` gleich 'high' ist</li>
|
||||
<li>Tickets mit hoher Priorität → Mitarbeiter mit Eskalationswerkzeugen</li>
|
||||
<li>Tickets mit normaler Priorität → Standard-Support-Mitarbeiter</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Inhaltsmoderation
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Inhalte basierend auf Analyseergebnissen filtern</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent analysiert nutzergenerierte Inhalte</li>
|
||||
<li>Bedingung prüft, ob `<agent.toxicity_score>` > 0.7</li>
|
||||
<li>Toxische Inhalte → Moderationsworkflow</li>
|
||||
<li>Unbedenkliche Inhalte → Veröffentlichungsworkflow</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Benutzer-Onboarding-Prozess
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Onboarding basierend auf Benutzertyp personalisieren</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Funktionsblock verarbeitet Benutzerregistrierungsdaten</li>
|
||||
<li>Bedingung prüft, ob `<user.account_type>` === 'enterprise'</li>
|
||||
<li>Unternehmensbenutzer → Erweiterter Einrichtungsworkflow</li>
|
||||
<li>Einzelbenutzer → Einfacher Onboarding-Workflow</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Bedingungen richtig anordnen**: Platzieren Sie spezifischere Bedingungen vor allgemeinen, damit spezifische Logik Vorrang vor Fallbacks hat
|
||||
- **Standardbedingung einfügen**: Fügen Sie eine Auffangbedingung (`true`) als letzte Bedingung hinzu, um nicht übereinstimmende Fälle zu behandeln und zu verhindern, dass die Workflow-Ausführung stecken bleibt
|
||||
- **Ausdrücke einfach halten**: Verwenden Sie klare, unkomplizierte boolesche Ausdrücke für bessere Lesbarkeit und einfachere Fehlersuche
|
||||
- **Dokumentieren Sie Ihre Bedingungen**: Fügen Sie Beschreibungen hinzu, um den Zweck jeder Bedingung für bessere Teamzusammenarbeit und Wartung zu erklären
|
||||
- **Testen Sie Grenzfälle**: Überprüfen Sie, ob Bedingungen Grenzwerte korrekt behandeln, indem Sie mit Werten an den Grenzen Ihrer Bedingungsbereiche testen
|
||||
199
apps/docs/content/docs/de/blocks/evaluator.mdx
Normal file
199
apps/docs/content/docs/de/blocks/evaluator.mdx
Normal file
@@ -0,0 +1,199 @@
|
||||
---
|
||||
title: Evaluator
|
||||
---
|
||||
|
||||
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 Evaluator-Block nutzt KI, um die Inhaltsqualität anhand anpassbarer Bewertungsmetriken zu bewerten, die du selbst definierst. Perfekt für Qualitätskontrolle, A/B-Tests und um sicherzustellen, dass deine KI-Ausgaben bestimmte Standards erfüllen.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/evaluator.png"
|
||||
alt="Evaluator-Block-Konfiguration"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Überblick
|
||||
|
||||
Mit dem Evaluator-Block kannst du:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Inhaltsqualität bewerten</strong>: Nutze KI, um Inhalte anhand benutzerdefinierter Metriken mit numerischen Werten zu bewerten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Benutzerdefinierte Metriken erstellen</strong>: Erstelle spezifische Bewertungskriterien, die auf deinen Anwendungsfall zugeschnitten sind
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Qualitätskontrolle automatisieren</strong>: Erstelle Workflows, die Inhalte automatisch bewerten und filtern
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Leistung verfolgen</strong>: Überwache Verbesserungen und Konsistenz im Laufe der Zeit mit objektiver Bewertung
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Funktionsweise
|
||||
|
||||
Der Evaluator-Block verarbeitet Inhalte durch KI-gestützte Bewertung:
|
||||
|
||||
1. **Inhalte empfangen** - Nimmt Eingabeinhalte von vorherigen Blöcken in deinem Workflow entgegen
|
||||
2. **Metriken anwenden** - Bewertet Inhalte anhand deiner definierten benutzerdefinierten Metriken
|
||||
3. **Bewertungen generieren** - KI-Modell weist numerische Werte für jede Metrik zu
|
||||
4. **Zusammenfassung bereitstellen** - Liefert detaillierte Auswertung mit Bewertungen und Erklärungen
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### Bewertungsmetriken
|
||||
|
||||
Definiere benutzerdefinierte Metriken, anhand derer Inhalte bewertet werden. Jede Metrik umfasst:
|
||||
|
||||
- **Name**: Eine kurze Bezeichnung für die Metrik
|
||||
- **Beschreibung**: Eine detaillierte Erklärung dessen, was die Metrik misst
|
||||
- **Bereich**: Der numerische Bereich für die Bewertung (z.B. 1-5, 0-10)
|
||||
|
||||
Beispielmetriken:
|
||||
|
||||
```
|
||||
Accuracy (1-5): How factually accurate is the content?
|
||||
Clarity (1-5): How clear and understandable is the content?
|
||||
Relevance (1-5): How relevant is the content to the original query?
|
||||
```
|
||||
|
||||
### Inhalt
|
||||
|
||||
Der zu bewertende Inhalt. Dies kann sein:
|
||||
|
||||
- Direkt in der Blockkonfiguration bereitgestellt
|
||||
- Verbunden mit der Ausgabe eines anderen Blocks (typischerweise ein Agent-Block)
|
||||
- Dynamisch während der Workflow-Ausführung generiert
|
||||
|
||||
### Modellauswahl
|
||||
|
||||
Wählen Sie ein KI-Modell für die Durchführung der Bewertung:
|
||||
|
||||
**OpenAI**: GPT-4o, o1, o3, o4-mini, gpt-4.1
|
||||
**Anthropic**: Claude 3.7 Sonnet
|
||||
**Google**: Gemini 2.5 Pro, Gemini 2.0 Flash
|
||||
**Andere Anbieter**: Groq, Cerebras, xAI, DeepSeek
|
||||
**Lokale Modelle**: Jedes Modell, das auf Ollama läuft
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="models.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Empfehlung**: Verwenden Sie Modelle mit starken Argumentationsfähigkeiten wie GPT-4o oder Claude 3.7 Sonnet für genauere Bewertungen.
|
||||
|
||||
### API-Schlüssel
|
||||
|
||||
Ihr API-Schlüssel für den ausgewählten LLM-Anbieter. Dieser wird sicher gespeichert und für die Authentifizierung verwendet.
|
||||
|
||||
## Funktionsweise
|
||||
|
||||
1. Der Evaluator-Block nimmt den bereitgestellten Inhalt und Ihre benutzerdefinierten Metriken
|
||||
2. Er generiert einen spezialisierten Prompt, der das LLM anweist, den Inhalt zu bewerten
|
||||
3. Der Prompt enthält klare Richtlinien zur Bewertung jeder Metrik
|
||||
4. Das LLM bewertet den Inhalt und gibt numerische Werte für jede Metrik zurück
|
||||
5. Der Evaluator-Block formatiert diese Werte als strukturierte Ausgabe zur Verwendung in Ihrem Workflow
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### Bewertung der Inhaltsqualität
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Bewertung der Blogpost-Qualität vor der Veröffentlichung</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent-Block generiert Blogpost-Inhalte</li>
|
||||
<li>Evaluator bewertet Genauigkeit, Lesbarkeit und Engagement</li>
|
||||
<li>Bedingungsblock prüft, ob die Werte Mindestschwellen erreichen</li>
|
||||
<li>Hohe Werte → Veröffentlichen, Niedrige Werte → Überarbeiten und erneut versuchen</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### A/B-Testing von Inhalten
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Vergleich mehrerer KI-generierter Antworten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Parallelblock generiert mehrere Antwortvarianten</li>
|
||||
<li>Evaluator bewertet jede Variante nach Klarheit und Relevanz</li>
|
||||
<li>Funktionsblock wählt die Antwort mit der höchsten Bewertung aus</li>
|
||||
<li>Antwortblock gibt das beste Ergebnis zurück</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Qualitätskontrolle im Kundensupport
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Sicherstellen, dass Support-Antworten den Qualitätsstandards entsprechen</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Support-Mitarbeiter generiert Antwort auf Kundenanfrage</li>
|
||||
<li>Evaluator bewertet Hilfsbereitschaft, Einfühlungsvermögen und Genauigkeit</li>
|
||||
<li>Bewertungen werden für Training und Leistungsüberwachung protokolliert</li>
|
||||
<li>Niedrige Bewertungen lösen einen manuellen Überprüfungsprozess aus</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Konfiguration', 'Variablen', 'Ergebnisse']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Inhalt</strong>: Der zu bewertende Text oder strukturierte Daten
|
||||
</li>
|
||||
<li>
|
||||
<strong>Bewertungsmetriken</strong>: Benutzerdefinierte Kriterien mit Bewertungsbereichen
|
||||
</li>
|
||||
<li>
|
||||
<strong>Modell</strong>: KI-Modell für die Bewertungsanalyse
|
||||
</li>
|
||||
<li>
|
||||
<strong>API-Schlüssel</strong>: Authentifizierung für den ausgewählten LLM-Anbieter
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>evaluator.content</strong>: Zusammenfassung der Bewertung
|
||||
</li>
|
||||
<li>
|
||||
<strong>evaluator.model</strong>: Für die Bewertung verwendetes Modell
|
||||
</li>
|
||||
<li>
|
||||
<strong>evaluator.tokens</strong>: Token-Nutzungsstatistiken
|
||||
</li>
|
||||
<li>
|
||||
<strong>evaluator.cost</strong>: Kostenübersicht für den Bewertungsaufruf
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Metrik-Bewertungen</strong>: Numerische Bewertungen für jede definierte Metrik
|
||||
</li>
|
||||
<li>
|
||||
<strong>Bewertungszusammenfassung</strong>: Detaillierte Beurteilung mit Erläuterungen
|
||||
</li>
|
||||
<li>
|
||||
<strong>Zugriff</strong>: Verfügbar in Blöcken nach dem Evaluator
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Verwenden Sie spezifische Metrikbeschreibungen**: Definieren Sie klar, was jede Metrik misst, um genauere Bewertungen zu erhalten
|
||||
- **Wählen Sie geeignete Bereiche**: Wählen Sie Bewertungsbereiche, die ausreichend Granularität bieten, ohne übermäßig komplex zu sein
|
||||
- **Verbinden Sie mit Agent-Blöcken**: Verwenden Sie Evaluator-Blöcke, um die Ausgaben von Agent-Blöcken zu bewerten und Feedback-Schleifen zu erstellen
|
||||
- **Verwenden Sie konsistente Metriken**: Für vergleichende Analysen sollten Sie konsistente Metriken über ähnliche Bewertungen hinweg beibehalten
|
||||
- **Kombinieren Sie mehrere Metriken**: Verwenden Sie mehrere Metriken, um eine umfassende Bewertung zu erhalten
|
||||
156
apps/docs/content/docs/de/blocks/function.mdx
Normal file
156
apps/docs/content/docs/de/blocks/function.mdx
Normal file
@@ -0,0 +1,156 @@
|
||||
---
|
||||
title: Funktion
|
||||
---
|
||||
|
||||
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'
|
||||
|
||||
Der Funktionsblock ermöglicht die Ausführung von benutzerdefiniertem JavaScript- oder TypeScript-Code in Ihren Workflows. Verwenden Sie ihn, um Daten zu transformieren, Berechnungen durchzuführen oder benutzerdefinierte Logik zu implementieren, die in anderen Blöcken nicht verfügbar ist.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/function.png"
|
||||
alt="Funktionsblock mit Code-Editor"
|
||||
width={500}
|
||||
height={350}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der Funktionsblock ermöglicht Ihnen:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Daten transformieren</strong>: Formate konvertieren, Text analysieren, Arrays und Objekte manipulieren
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Berechnungen durchführen</strong>: Mathematische Operationen, Statistiken, Finanzberechnungen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Benutzerdefinierte Logik implementieren</strong>: Komplexe Bedingungen, Schleifen und Algorithmen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Externe Daten verarbeiten</strong>: Antworten parsen, Anfragen formatieren, Authentifizierung verwalten
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Funktionsweise
|
||||
|
||||
Der Funktionsblock führt Ihren Code in einer sicheren, isolierten Umgebung aus:
|
||||
|
||||
1. **Eingabe empfangen**: Zugriff auf Daten aus vorherigen Blöcken über das `input` Objekt
|
||||
2. **Code ausführen**: Führen Sie Ihren JavaScript/Python-Code aus
|
||||
3. **Ergebnisse zurückgeben**: Verwenden Sie `return`, um Daten an den nächsten Block zu übergeben
|
||||
4. **Fehler behandeln**: Integrierte Fehlerbehandlung und Protokollierung
|
||||
|
||||
## Remote-Ausführung (E2B)
|
||||
|
||||
- **Sprachen**: JavaScript und Python in einer isolierten E2B-Sandbox ausführen.
|
||||
- **Aktivierung**: Schalten Sie “Remote Code Execution” im Funktionsblock ein.
|
||||
- **Einsatzbereich**: Schwerere Logik, externe Bibliotheken oder Python-spezifischer Code.
|
||||
- **Leistung**: Langsamer als lokales JS aufgrund von Sandbox-Start und Netzwerk-Overhead.
|
||||
- **Hinweise**: Erfordert `E2B_API_KEY` bei lokaler Ausführung. Für niedrigste Latenz verwenden Sie nativ lokales JS (Fast Mode).
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Configuration', 'Variables']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Code</strong>: Ihr JavaScript/Python-Code zur Ausführung
|
||||
</li>
|
||||
<li>
|
||||
<strong>Timeout</strong>: Maximale Ausführungszeit (standardmäßig 30 Sekunden)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Eingabedaten</strong>: Alle verbundenen Block-Ausgaben sind über Variablen verfügbar
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>function.result</strong>: Der von Ihrer Funktion zurückgegebene Wert
|
||||
</li>
|
||||
<li>
|
||||
<strong>function.stdout</strong>: Console.log()-Ausgabe aus Ihrem Code
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### Datenverarbeitungspipeline
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: API-Antwort in strukturierte Daten umwandeln</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>API-Block ruft Rohdaten der Kunden ab</li>
|
||||
<li>Funktionsblock verarbeitet und validiert Daten</li>
|
||||
<li>Funktionsblock berechnet abgeleitete Metriken</li>
|
||||
<li>Antwortblock gibt formatierte Ergebnisse zurück</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Implementierung von Geschäftslogik
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Berechnung von Treuepunkten und Stufen</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent ruft Kaufhistorie des Kunden ab</li>
|
||||
<li>Funktionsblock berechnet Treuemetriken</li>
|
||||
<li>Funktionsblock bestimmt Kundenstufe</li>
|
||||
<li>Bedingungsblock leitet basierend auf der Stufenhöhe weiter</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Datenvalidierung und -bereinigung
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Benutzereingaben validieren und bereinigen</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Benutzereingabe aus Formularübermittlung erhalten</li>
|
||||
<li>Funktionsblock validiert E-Mail-Format und Telefonnummern</li>
|
||||
<li>Funktionsblock bereinigt und normalisiert Daten</li>
|
||||
<li>API-Block speichert validierte Daten in der Datenbank</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Beispiel: Treuepunkte-Rechner
|
||||
|
||||
```javascript title="loyalty-calculator.js"
|
||||
// Process customer data and calculate loyalty score
|
||||
const { purchaseHistory, accountAge, supportTickets } = <agent>;
|
||||
|
||||
// Calculate metrics
|
||||
const totalSpent = purchaseHistory.reduce((sum, purchase) => sum + purchase.amount, 0);
|
||||
const purchaseFrequency = purchaseHistory.length / (accountAge / 365);
|
||||
const ticketRatio = supportTickets.resolved / supportTickets.total;
|
||||
|
||||
// Calculate loyalty score (0-100)
|
||||
const spendScore = Math.min(totalSpent / 1000 * 30, 30);
|
||||
const frequencyScore = Math.min(purchaseFrequency * 20, 40);
|
||||
const supportScore = ticketRatio * 30;
|
||||
|
||||
const loyaltyScore = Math.round(spendScore + frequencyScore + supportScore);
|
||||
|
||||
return {
|
||||
customer: <agent.name>,
|
||||
loyaltyScore,
|
||||
loyaltyTier: loyaltyScore >= 80 ? "Platinum" : loyaltyScore >= 60 ? "Gold" : "Silver",
|
||||
metrics: { spendScore, frequencyScore, supportScore }
|
||||
};
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Funktionen fokussiert halten**: Schreiben Sie Funktionen, die eine Sache gut erledigen, um die Wartbarkeit und Fehlersuche zu verbessern
|
||||
- **Fehler elegant behandeln**: Verwenden Sie try/catch-Blöcke, um potenzielle Fehler zu behandeln und aussagekräftige Fehlermeldungen bereitzustellen
|
||||
- **Grenzfälle testen**: Stellen Sie sicher, dass Ihr Code ungewöhnliche Eingaben, Null-Werte und Grenzbedingungen korrekt behandelt
|
||||
- **Auf Leistung optimieren**: Achten Sie bei großen Datensätzen auf die Berechnungskomplexität und den Speicherverbrauch
|
||||
- **console.log() zum Debuggen verwenden**: Nutzen Sie die Stdout-Ausgabe zum Debuggen und Überwachen der Funktionsausführung
|
||||
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>
|
||||
129
apps/docs/content/docs/de/blocks/index.mdx
Normal file
129
apps/docs/content/docs/de/blocks/index.mdx
Normal file
@@ -0,0 +1,129 @@
|
||||
---
|
||||
title: Übersicht
|
||||
description: Die Bausteine deiner KI-Workflows
|
||||
---
|
||||
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Blöcke sind die Bausteine, die du miteinander verbindest, um KI-Workflows zu erstellen. Betrachte sie als spezialisierte Module, die jeweils eine bestimmte Aufgabe übernehmen – vom Chatten mit KI-Modellen über API-Aufrufe bis hin zur Datenverarbeitung.
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="connections.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
## Grundlegende Blocktypen
|
||||
|
||||
Sim bietet sieben grundlegende Blocktypen, die die wesentlichen Funktionen von KI-Workflows abdecken:
|
||||
|
||||
### Verarbeitungsblöcke
|
||||
- **[Agent](/blocks/agent)** - Chatte mit KI-Modellen (OpenAI, Anthropic, Google, lokale Modelle)
|
||||
- **[Function](/blocks/function)** - Führe benutzerdefinierten JavaScript/TypeScript-Code aus
|
||||
- **[API](/blocks/api)** - Verbinde dich mit externen Diensten über HTTP-Anfragen
|
||||
|
||||
### Logikblöcke
|
||||
- **[Condition](/blocks/condition)** - Verzweige Workflow-Pfade basierend auf booleschen Ausdrücken
|
||||
- **[Router](/blocks/router)** - Nutze KI, um Anfragen intelligent auf verschiedene Pfade zu leiten
|
||||
- **[Evaluator](/blocks/evaluator)** - Bewerte und beurteile die Inhaltsqualität mit KI
|
||||
|
||||
### Ausgabeblöcke
|
||||
- **[Response](/blocks/response)** - Formatiere und gib endgültige Ergebnisse aus deinem Workflow zurück
|
||||
|
||||
## Wie Blöcke funktionieren
|
||||
|
||||
Jeder Block hat drei Hauptkomponenten:
|
||||
|
||||
**Eingaben**: Daten, die in den Block von anderen Blöcken oder Benutzereingaben kommen
|
||||
**Konfiguration**: Einstellungen, die das Verhalten des Blocks steuern
|
||||
**Ausgaben**: Daten, die der Block für andere Blöcke produziert
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Eingabe empfangen</strong>: Block erhält Daten von verbundenen Blöcken oder Benutzereingaben
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Verarbeiten</strong>: Block verarbeitet die Eingabe gemäß seiner Konfiguration
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Ergebnisse ausgeben</strong>: Block erzeugt Ausgabedaten für die nächsten Blöcke im Workflow
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Blöcke verbinden
|
||||
|
||||
Sie erstellen Workflows, indem Sie Blöcke miteinander verbinden. Die Ausgabe eines Blocks wird zur Eingabe eines anderen:
|
||||
|
||||
- **Ziehen zum Verbinden**: Ziehen Sie von einem Ausgabeport zu einem Eingabeport
|
||||
- **Mehrfachverbindungen**: Eine Ausgabe kann mit mehreren Eingängen verbunden werden
|
||||
- **Verzweigende Pfade**: Einige Blöcke können basierend auf Bedingungen zu verschiedenen Pfaden weiterleiten
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="connections.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
## Häufige Muster
|
||||
|
||||
### Sequentielle Verarbeitung
|
||||
Verbinden Sie Blöcke in einer Kette, wobei jeder Block die Ausgabe des vorherigen verarbeitet:
|
||||
|
||||
```
|
||||
User Input → Agent → Function → Response
|
||||
```
|
||||
|
||||
### Bedingte Verzweigung
|
||||
Verwenden Sie Bedingungsblöcke oder Router-Blöcke, um verschiedene Pfade zu erstellen:
|
||||
|
||||
```
|
||||
User Input → Router → Agent A (for questions)
|
||||
→ Agent B (for commands)
|
||||
```
|
||||
|
||||
### Qualitätskontrolle
|
||||
Verwenden Sie Evaluator-Blöcke, um Ausgaben zu bewerten und zu filtern:
|
||||
|
||||
```
|
||||
Agent → Evaluator → Condition → Response (if good)
|
||||
→ Agent (retry if bad)
|
||||
```
|
||||
|
||||
## Block-Konfiguration
|
||||
|
||||
Jeder Blocktyp hat spezifische Konfigurationsoptionen:
|
||||
|
||||
**Alle Blöcke**:
|
||||
- Ein-/Ausgabeverbindungen
|
||||
- Fehlerbehandlungsverhalten
|
||||
- Zeitüberschreitungseinstellungen für die Ausführung
|
||||
|
||||
**KI-Blöcke** (Agent, Router, Evaluator):
|
||||
- Modellauswahl (OpenAI, Anthropic, Google, lokal)
|
||||
- API-Schlüssel und Authentifizierung
|
||||
- Temperature und andere Modellparameter
|
||||
- Systemaufforderungen und Anweisungen
|
||||
|
||||
**Logikblöcke** (Bedingung, Funktion):
|
||||
- Benutzerdefinierte Ausdrücke oder Code
|
||||
- Variablenreferenzen
|
||||
- Einstellungen für die Ausführungsumgebung
|
||||
|
||||
**Integrationsblöcke** (API, Antwort):
|
||||
- Endpunktkonfiguration
|
||||
- Header und Authentifizierung
|
||||
- Anfrage-/Antwortformatierung
|
||||
|
||||
<Cards>
|
||||
<Card title="Agent Block" href="/blocks/agent">
|
||||
Verbindung zu KI-Modellen herstellen und intelligente Antworten erzeugen
|
||||
</Card>
|
||||
<Card title="Function Block" href="/blocks/function">
|
||||
Benutzerdefinierten Code ausführen, um Daten zu verarbeiten und zu transformieren
|
||||
</Card>
|
||||
<Card title="API Block" href="/blocks/api">
|
||||
Integration mit externen Diensten und APIs
|
||||
</Card>
|
||||
<Card title="Condition Block" href="/blocks/condition">
|
||||
Verzweigende Logik basierend auf Datenbewertung erstellen
|
||||
</Card>
|
||||
</Cards>
|
||||
211
apps/docs/content/docs/de/blocks/loop.mdx
Normal file
211
apps/docs/content/docs/de/blocks/loop.mdx
Normal file
@@ -0,0 +1,211 @@
|
||||
---
|
||||
title: Loop
|
||||
---
|
||||
|
||||
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'
|
||||
|
||||
Der Loop-Block ist ein Container-Block in Sim, der es ermöglicht, iterative Workflows zu erstellen, indem eine Gruppe von Blöcken wiederholt ausgeführt wird. Loops ermöglichen iterative Verarbeitung in deinen Workflows.
|
||||
|
||||
Der Loop-Block unterstützt zwei Arten der Iteration:
|
||||
|
||||
<Callout type="info">
|
||||
Loop-Blöcke sind Container-Knoten, die andere Blöcke enthalten können. Die Blöcke innerhalb einer Schleife werden basierend auf deiner Konfiguration mehrfach ausgeführt.
|
||||
</Callout>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der Loop-Block ermöglicht dir:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Über Sammlungen iterieren</strong>: Arrays oder Objekte Element für Element verarbeiten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Operationen wiederholen</strong>: Blöcke eine festgelegte Anzahl von Malen ausführen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Sequentielle Verarbeitung</strong>: Datentransformation in geordneten Iterationen durchführen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Ergebnisse aggregieren</strong>: Ausgaben aus allen Schleifeniterationen sammeln
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Funktionsweise
|
||||
|
||||
Der Loop-Block führt enthaltene Blöcke durch sequentielle Iteration aus:
|
||||
|
||||
1. **Schleife initialisieren** - Iterationsparameter festlegen (Anzahl oder Sammlung)
|
||||
2. **Iteration ausführen** - Enthaltene Blöcke für aktuelle Iteration ausführen
|
||||
3. **Ergebnisse sammeln** - Ausgabe jeder Iteration speichern
|
||||
4. **Fortfahren oder abschließen** - Zur nächsten Iteration übergehen oder Schleife beenden
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### Schleifentyp
|
||||
|
||||
Wähle zwischen zwei Arten von Schleifen:
|
||||
|
||||
<Tabs items={['For Loop', 'ForEach Loop']}>
|
||||
<Tab>
|
||||
**For Loop (Iterationen)** - Eine numerische Schleife, die eine feste Anzahl von Malen ausgeführt wird:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/loop-1.png"
|
||||
alt="For Loop mit Iterationen"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Verwende diese Option, wenn du eine Operation eine bestimmte Anzahl von Malen wiederholen musst.
|
||||
|
||||
|
||||
```
|
||||
Example: Run 5 times
|
||||
- Iteration 1
|
||||
- Iteration 2
|
||||
- Iteration 3
|
||||
- Iteration 4
|
||||
- Iteration 5
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
**ForEach-Schleife (Sammlung)** - Eine sammlungsbasierte Schleife, die über jedes Element in einem Array oder Objekt iteriert:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/loop-2.png"
|
||||
alt="ForEach-Schleife mit Sammlung"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Verwende diese, wenn du eine Sammlung von Elementen verarbeiten musst.
|
||||
|
||||
|
||||
```
|
||||
Example: Process ["apple", "banana", "orange"]
|
||||
- Iteration 1: Process "apple"
|
||||
- Iteration 2: Process "banana"
|
||||
- Iteration 3: Process "orange"
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Wie man Schleifen verwendet
|
||||
|
||||
### Eine Schleife erstellen
|
||||
|
||||
1. Ziehe einen Schleifenblock aus der Werkzeugleiste auf deine Leinwand
|
||||
2. Konfiguriere den Schleifentyp und die Parameter
|
||||
3. Ziehe andere Blöcke in den Schleifencontainer
|
||||
4. Verbinde die Blöcke nach Bedarf
|
||||
|
||||
### Auf Ergebnisse zugreifen
|
||||
|
||||
Nach Abschluss einer Schleife kannst du auf aggregierte Ergebnisse zugreifen:
|
||||
|
||||
- **`<loop.results>`**: Array von Ergebnissen aus allen Schleifendurchläufen
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### Verarbeitung von API-Ergebnissen
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Mehrere Kundendatensätze verarbeiten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>API-Block ruft Kundenliste ab</li>
|
||||
<li>ForEach-Schleife iteriert über jeden Kunden</li>
|
||||
<li>Innerhalb der Schleife: Agent analysiert Kundendaten</li>
|
||||
<li>Innerhalb der Schleife: Funktion speichert Analyseergebnisse</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Iterative Inhaltserstellung
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Mehrere Variationen generieren</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>For-Schleife auf 5 Iterationen einstellen</li>
|
||||
<li>Innerhalb der Schleife: Agent generiert Inhaltsvariante</li>
|
||||
<li>Innerhalb der Schleife: Evaluator bewertet den Inhalt</li>
|
||||
<li>Nach der Schleife: Funktion wählt die beste Variante aus</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Erweiterte Funktionen
|
||||
|
||||
### Einschränkungen
|
||||
|
||||
<Callout type="warning">
|
||||
Container-Blöcke (Schleifen und Parallele) können nicht ineinander verschachtelt werden. Das bedeutet:
|
||||
- Du kannst keinen Schleifenblock in einen anderen Schleifenblock platzieren
|
||||
- Du kannst keinen Parallelblock in einen Schleifenblock platzieren
|
||||
- Du kannst keinen Container-Block in einen anderen Container-Block platzieren
|
||||
|
||||
Wenn du mehrdimensionale Iterationen benötigst, erwäge eine Umstrukturierung deines Workflows, um sequentielle Schleifen zu verwenden oder Daten in Stufen zu verarbeiten.
|
||||
</Callout>
|
||||
|
||||
<Callout type="info">
|
||||
Schleifen werden sequentiell ausgeführt, nicht parallel. Wenn Sie eine gleichzeitige Ausführung benötigen, verwenden Sie stattdessen den Parallel-Block.
|
||||
</Callout>
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Konfiguration', 'Variablen', 'Ergebnisse']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Schleifentyp</strong>: Wählen Sie zwischen 'for' oder 'forEach'
|
||||
</li>
|
||||
<li>
|
||||
<strong>Iterationen</strong>: Anzahl der Ausführungen (für for-Schleifen)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Sammlung</strong>: Array oder Objekt zum Durchlaufen (für forEach-Schleifen)
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>loop.currentItem</strong>: Aktuell verarbeitetes Element
|
||||
</li>
|
||||
<li>
|
||||
<strong>loop.index</strong>: Aktuelle Iterationsnummer (0-basiert)
|
||||
</li>
|
||||
<li>
|
||||
<strong>loop.items</strong>: Vollständige Sammlung (forEach-Schleifen)
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>loop.results</strong>: Array aller Iterationsergebnisse
|
||||
</li>
|
||||
<li>
|
||||
<strong>Struktur</strong>: Ergebnisse behalten die Iterationsreihenfolge bei
|
||||
</li>
|
||||
<li>
|
||||
<strong>Zugriff</strong>: Verfügbar in Blöcken nach der Schleife
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Setzen Sie vernünftige Grenzen**: Halten Sie die Anzahl der Iterationen in einem vernünftigen Rahmen, um lange Ausführungszeiten zu vermeiden
|
||||
- **Verwenden Sie ForEach für Sammlungen**: Verwenden Sie ForEach statt For-Schleifen, wenn Sie Arrays oder Objekte verarbeiten
|
||||
- **Behandeln Sie Fehler angemessen**: Erwägen Sie, Fehlerbehandlung innerhalb von Schleifen einzubauen, um robuste Workflows zu gewährleisten
|
||||
231
apps/docs/content/docs/de/blocks/parallel.mdx
Normal file
231
apps/docs/content/docs/de/blocks/parallel.mdx
Normal file
@@ -0,0 +1,231 @@
|
||||
---
|
||||
title: Parallel
|
||||
---
|
||||
|
||||
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'
|
||||
|
||||
Der Parallel-Block ist ein Container-Block in Sim, der es ermöglicht, mehrere Instanzen von Blöcken gleichzeitig auszuführen, um Workflows schneller zu verarbeiten.
|
||||
|
||||
Der Parallel-Block unterstützt zwei Arten der gleichzeitigen Ausführung:
|
||||
|
||||
<Callout type="info">
|
||||
Parallel-Blöcke sind Container-Knoten, die ihre Inhalte mehrfach gleichzeitig ausführen, im Gegensatz zu Schleifen, die sequentiell ausgeführt werden.
|
||||
</Callout>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der Parallel-Block ermöglicht es dir:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Arbeit zu verteilen</strong>: Mehrere Elemente gleichzeitig zu verarbeiten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Ausführung zu beschleunigen</strong>: Unabhängige Operationen gleichzeitig auszuführen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Massenoperationen zu bewältigen</strong>: Große Datensätze effizient zu verarbeiten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Ergebnisse zu aggregieren</strong>: Ausgaben aus allen parallelen Ausführungen zu sammeln
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### Parallel-Typ
|
||||
|
||||
Wähle zwischen zwei Arten der parallelen Ausführung:
|
||||
|
||||
<Tabs items={['Count-based', 'Collection-based']}>
|
||||
<Tab>
|
||||
**Anzahlbasierte Parallelität** - Führe eine feste Anzahl paralleler Instanzen aus:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/parallel-1.png"
|
||||
alt="Anzahlbasierte parallele Ausführung"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Verwende dies, wenn du dieselbe Operation mehrmals gleichzeitig ausführen musst.
|
||||
|
||||
|
||||
```
|
||||
Example: Run 5 parallel instances
|
||||
- Instance 1 ┐
|
||||
- Instance 2 ├─ All execute simultaneously
|
||||
- Instance 3 │
|
||||
- Instance 4 │
|
||||
- Instance 5 ┘
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
**Sammlungsbasierte Parallelität** - Verteile eine Sammlung auf parallele Instanzen:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/parallel-2.png"
|
||||
alt="Sammlungsbasierte parallele Ausführung"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Jede Instanz verarbeitet gleichzeitig ein Element aus der Sammlung.
|
||||
|
||||
|
||||
```
|
||||
Example: Process ["task1", "task2", "task3"] in parallel
|
||||
- Instance 1: Process "task1" ┐
|
||||
- Instance 2: Process "task2" ├─ All execute simultaneously
|
||||
- Instance 3: Process "task3" ┘
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Wie man Parallel-Blöcke verwendet
|
||||
|
||||
### Einen Parallel-Block erstellen
|
||||
|
||||
1. Ziehe einen Parallel-Block aus der Werkzeugleiste auf deine Leinwand
|
||||
2. Konfiguriere den Parallel-Typ und die Parameter
|
||||
3. Ziehe einen einzelnen Block in den Parallel-Container
|
||||
4. Verbinde den Block nach Bedarf
|
||||
|
||||
### Auf Ergebnisse zugreifen
|
||||
|
||||
Nach Abschluss eines parallelen Blocks können Sie auf aggregierte Ergebnisse zugreifen:
|
||||
|
||||
- **`<parallel.results>`**: Array mit Ergebnissen aus allen parallelen Instanzen
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### Batch-API-Verarbeitung
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Mehrere API-Aufrufe gleichzeitig verarbeiten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Paralleler Block mit einer Sammlung von API-Endpunkten</li>
|
||||
<li>Innerhalb des parallelen Blocks: API-Block ruft jeden Endpunkt auf</li>
|
||||
<li>Nach dem parallelen Block: Alle Antworten gemeinsam verarbeiten</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Multi-Modell-KI-Verarbeitung
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Antworten von mehreren KI-Modellen erhalten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Sammlungsbasierte Parallelverarbeitung über eine Liste von Modell-IDs (z.B. ["gpt-4o", "claude-3.7-sonnet", "gemini-2.5-pro"])</li>
|
||||
<li>Innerhalb des parallelen Blocks: Das Modell des Agenten wird auf das aktuelle Element aus der Sammlung gesetzt</li>
|
||||
<li>Nach dem parallelen Block: Vergleichen und Auswählen der besten Antwort</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Erweiterte Funktionen
|
||||
|
||||
### Ergebnisaggregation
|
||||
|
||||
Ergebnisse aus allen parallelen Instanzen werden automatisch gesammelt:
|
||||
|
||||
```javascript
|
||||
// In a Function block after the parallel
|
||||
const allResults = input.parallel.results;
|
||||
// Returns: [result1, result2, result3, ...]
|
||||
```
|
||||
|
||||
### Instanzisolierung
|
||||
|
||||
Jede parallele Instanz läuft unabhängig:
|
||||
- Separate Variablenbereiche
|
||||
- Kein gemeinsamer Zustand zwischen Instanzen
|
||||
- Fehler in einer Instanz beeinflussen andere nicht
|
||||
|
||||
### Einschränkungen
|
||||
|
||||
<Callout type="warning">
|
||||
Container-Blöcke (Schleifen und Parallele) können nicht ineinander verschachtelt werden. Das bedeutet:
|
||||
- Sie können keinen Schleifenblock in einen parallelen Block platzieren
|
||||
- Sie können keinen weiteren parallelen Block in einen parallelen Block platzieren
|
||||
- Sie können keinen Container-Block in einen anderen Container-Block platzieren
|
||||
</Callout>
|
||||
|
||||
<Callout type="warning">
|
||||
Parallele Blöcke können nur einen einzigen Block enthalten. Sie können nicht mehrere Blöcke haben, die innerhalb eines parallelen Blocks miteinander verbunden sind - in diesem Fall würde nur der erste Block ausgeführt werden.
|
||||
</Callout>
|
||||
|
||||
<Callout type="info">
|
||||
Obwohl die parallele Ausführung schneller ist, sollten Sie Folgendes beachten:
|
||||
- API-Ratenbegrenzungen bei gleichzeitigen Anfragen
|
||||
- Speichernutzung bei großen Datensätzen
|
||||
- Maximum von 20 gleichzeitigen Instanzen, um Ressourcenerschöpfung zu vermeiden
|
||||
</Callout>
|
||||
|
||||
## Parallel vs. Loop
|
||||
|
||||
Verstehen, wann was zu verwenden ist:
|
||||
|
||||
| Funktion | Parallel | Loop |
|
||||
|---------|----------|------|
|
||||
| Ausführung | Gleichzeitig | Sequentiell |
|
||||
| Geschwindigkeit | Schneller für unabhängige Operationen | Langsamer, aber geordnet |
|
||||
| Reihenfolge | Keine garantierte Reihenfolge | Behält Reihenfolge bei |
|
||||
| Anwendungsfall | Unabhängige Operationen | Abhängige Operationen |
|
||||
| Ressourcennutzung | Höher | Niedriger |
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Konfiguration', 'Variablen', 'Ergebnisse']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Parallel-Typ</strong>: Wählen Sie zwischen 'count' oder 'collection'
|
||||
</li>
|
||||
<li>
|
||||
<strong>Count</strong>: Anzahl der auszuführenden Instanzen (anzahlbasiert)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Collection</strong>: Array oder Objekt zur Verteilung (sammlungsbasiert)
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>parallel.currentItem</strong>: Element für diese Instanz
|
||||
</li>
|
||||
<li>
|
||||
<strong>parallel.index</strong>: Instanznummer (0-basiert)
|
||||
</li>
|
||||
<li>
|
||||
<strong>parallel.items</strong>: Vollständige Sammlung (sammlungsbasiert)
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>parallel.results</strong>: Array aller Instanzergebnisse
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Verfügbar in Blöcken nach dem Parallel
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Nur unabhängige Operationen**: Stellen Sie sicher, dass Operationen nicht voneinander abhängen
|
||||
- **Rate-Limits berücksichtigen**: Fügen Sie Verzögerungen oder Drosselungen für API-intensive Workflows hinzu
|
||||
- **Fehlerbehandlung**: Jede Instanz sollte ihre eigenen Fehler angemessen behandeln
|
||||
246
apps/docs/content/docs/de/blocks/response.mdx
Normal file
246
apps/docs/content/docs/de/blocks/response.mdx
Normal file
@@ -0,0 +1,246 @@
|
||||
---
|
||||
title: Antwort
|
||||
---
|
||||
|
||||
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'
|
||||
|
||||
Der Antwort-Block ist der letzte Schritt in deinem Workflow, der eine strukturierte Antwort formatiert und an API-Aufrufe zurücksendet. Er funktioniert wie eine "return"-Anweisung für deinen gesamten Workflow – er verpackt Ergebnisse und sendet sie zurück.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/response.png"
|
||||
alt="Konfiguration des Antwort-Blocks"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Callout type="info">
|
||||
Antwort-Blöcke sind terminale Blöcke - sie beenden die Workflow-Ausführung und können nicht mit anderen Blöcken verbunden werden.
|
||||
</Callout>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der Antwort-Block ermöglicht dir:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>API-Antworten formatieren</strong>: Strukturierung von Workflow-Ergebnissen in korrekte HTTP-Antworten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Statuscodes festlegen</strong>: Konfiguration passender HTTP-Statuscodes basierend auf Workflow-Ergebnissen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Header kontrollieren</strong>: Hinzufügen benutzerdefinierter Header für API-Antworten und Webhooks
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Daten transformieren</strong>: Umwandlung von Workflow-Variablen in client-freundliche Antwortformate
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Wie es funktioniert
|
||||
|
||||
Der Antwort-Block schließt die Workflow-Ausführung ab:
|
||||
|
||||
1. **Daten sammeln** - Sammelt Variablen und Ausgaben von vorherigen Blöcken
|
||||
2. **Antwort formatieren** - Strukturiert Daten gemäß deiner Konfiguration
|
||||
3. **HTTP-Details festlegen** - Wendet Statuscodes und Header an
|
||||
4. **Antwort senden** - Gibt die formatierte Antwort an den API-Aufrufer zurück
|
||||
|
||||
## Wann du Antwort-Blöcke benötigst
|
||||
|
||||
- **API-Endpunkte**: Wenn dein Workflow über eine API aufgerufen wird, formatieren Antwort-Blöcke die Rückgabedaten
|
||||
- **Webhooks**: Rückgabe von Bestätigungen oder Daten an das aufrufende System
|
||||
- **Testen**: Anzeige formatierter Ergebnisse beim Testen deines Workflows
|
||||
|
||||
## Zwei Möglichkeiten zum Erstellen von Antworten
|
||||
|
||||
### Builder-Modus (Empfohlen)
|
||||
Visuelle Oberfläche zum Erstellen der Antwortstruktur:
|
||||
- Felder per Drag-and-Drop einfügen
|
||||
- Einfache Referenzierung von Workflow-Variablen
|
||||
- Visuelle Vorschau der Antwortstruktur
|
||||
|
||||
### Editor-Modus (Fortgeschritten)
|
||||
JSON direkt schreiben:
|
||||
- Volle Kontrolle über das Antwortformat
|
||||
- Unterstützung für komplexe verschachtelte Strukturen
|
||||
- Verwendung der `<variable.name>`Syntax für dynamische Werte
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### Antwortdaten
|
||||
|
||||
Die Antwortdaten sind der Hauptinhalt, der an den API-Aufrufer zurückgesendet wird. Diese sollten als JSON formatiert sein und können Folgendes enthalten:
|
||||
|
||||
- Statische Werte
|
||||
- Dynamische Verweise auf Workflow-Variablen mit der `<variable.name>`Syntax
|
||||
- Verschachtelte Objekte und Arrays
|
||||
- Jede gültige JSON-Struktur
|
||||
|
||||
### Statuscode
|
||||
|
||||
Legen Sie den HTTP-Statuscode für die Antwort fest. Häufige Statuscodes sind:
|
||||
|
||||
<Tabs items={['Erfolg (2xx)', 'Client-Fehler (4xx)', 'Server-Fehler (5xx)']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li><strong>200</strong>: OK - Standard-Erfolgsantwort</li>
|
||||
<li><strong>201</strong>: Erstellt - Ressource erfolgreich erstellt</li>
|
||||
<li><strong>204</strong>: Kein Inhalt - Erfolg ohne Antworttext</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li><strong>400</strong>: Ungültige Anfrage - Ungültige Anfrageparameter</li>
|
||||
<li><strong>401</strong>: Nicht autorisiert - Authentifizierung erforderlich</li>
|
||||
<li><strong>404</strong>: Nicht gefunden - Ressource existiert nicht</li>
|
||||
<li><strong>422</strong>: Nicht verarbeitbare Entität - Validierungsfehler</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li><strong>500</strong>: Interner Serverfehler - Serverseitiger Fehler</li>
|
||||
<li><strong>502</strong>: Bad Gateway - Fehler eines externen Dienstes</li>
|
||||
<li><strong>503</strong>: Dienst nicht verfügbar - Dienst vorübergehend nicht erreichbar</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<div className="mt-4 text-sm text-gray-600 dark:text-gray-400">
|
||||
Der Standard-Statuscode ist 200, wenn nicht anders angegeben.
|
||||
</div>
|
||||
|
||||
### Antwort-Header
|
||||
|
||||
Konfigurieren Sie zusätzliche HTTP-Header, die in die Antwort aufgenommen werden sollen.
|
||||
|
||||
Header werden als Schlüssel-Wert-Paare konfiguriert:
|
||||
|
||||
| Schlüssel | Wert |
|
||||
|-----|-------|
|
||||
| Content-Type | application/json |
|
||||
| Cache-Control | no-cache |
|
||||
| X-API-Version | 1.0 |
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### API-Endpunkt-Antwort
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Strukturierte Daten von einer Such-API zurückgeben</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Workflow verarbeitet Suchanfrage und ruft Ergebnisse ab</li>
|
||||
<li>Funktionsblock formatiert und paginiert Ergebnisse</li>
|
||||
<li>Antwortblock gibt JSON mit Daten, Paginierung und Metadaten zurück</li>
|
||||
<li>Client erhält strukturierte Antwort mit Status 200</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Webhook-Bestätigung
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Bestätigung des Webhook-Empfangs und der Verarbeitung</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Webhook-Trigger empfängt Daten vom externen System</li>
|
||||
<li>Workflow verarbeitet die eingehenden Daten</li>
|
||||
<li>Antwortblock gibt Bestätigung mit Verarbeitungsstatus zurück</li>
|
||||
<li>Externes System erhält Bestätigung</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Fehlerantwort-Behandlung
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Angemessene Fehlerantworten zurückgeben</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Bedingungsblock erkennt Validierungsfehler oder Systemfehler</li>
|
||||
<li>Router leitet zum Fehlerbehandlungspfad weiter</li>
|
||||
<li>Antwortblock gibt Status 400/500 mit Fehlerdetails zurück</li>
|
||||
<li>Client erhält strukturierte Fehlerinformationen</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Konfiguration', 'Variablen', 'Ergebnisse']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Antwortdaten</strong>: JSON-Struktur für den Antworttext
|
||||
</li>
|
||||
<li>
|
||||
<strong>Statuscode</strong>: HTTP-Statuscode (Standard: 200)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Header</strong>: Benutzerdefinierte HTTP-Header als Schlüssel-Wert-Paare
|
||||
</li>
|
||||
<li>
|
||||
<strong>Modus</strong>: Builder- oder Editor-Modus für die Antworterstellung
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>response.data</strong>: Der strukturierte Antworttext
|
||||
</li>
|
||||
<li>
|
||||
<strong>response.status</strong>: Gesendeter HTTP-Statuscode
|
||||
</li>
|
||||
<li>
|
||||
<strong>response.headers</strong>: In der Antwort enthaltene Header
|
||||
</li>
|
||||
<li>
|
||||
<strong>response.success</strong>: Boolescher Wert, der erfolgreichen Abschluss anzeigt
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>HTTP-Antwort</strong>: Vollständige Antwort an den API-Aufrufer
|
||||
</li>
|
||||
<li>
|
||||
<strong>Workflow-Beendigung</strong>: Beendet die Workflow-Ausführung
|
||||
</li>
|
||||
<li>
|
||||
<strong>Zugriff</strong>: Antwortblöcke sind terminal - keine nachfolgenden Blöcke
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Variablenreferenzen
|
||||
|
||||
Verwenden Sie die `<variable.name>` Syntax, um Workflow-Variablen dynamisch in Ihre Antwort einzufügen:
|
||||
|
||||
```json
|
||||
{
|
||||
"user": {
|
||||
"id": "<variable.userId>",
|
||||
"name": "<variable.userName>",
|
||||
"email": "<variable.userEmail>"
|
||||
},
|
||||
"query": "<variable.searchQuery>",
|
||||
"results": "<variable.searchResults>",
|
||||
"totalFound": "<variable.resultCount>",
|
||||
"processingTime": "<variable.executionTime>ms"
|
||||
}
|
||||
```
|
||||
|
||||
<Callout type="warning">
|
||||
Variablennamen sind Groß- und Kleinschreibung sensitiv und müssen exakt mit den in Ihrem Workflow verfügbaren Variablen übereinstimmen.
|
||||
</Callout>
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Verwenden Sie aussagekräftige Statuscodes**: Wählen Sie passende HTTP-Statuscodes, die das Ergebnis des Workflows genau widerspiegeln
|
||||
- **Strukturieren Sie Ihre Antworten einheitlich**: Behalten Sie eine konsistente JSON-Struktur über alle API-Endpunkte hinweg für eine bessere Entwicklererfahrung bei
|
||||
- **Fügen Sie relevante Metadaten hinzu**: Ergänzen Sie Zeitstempel und Versionsinformationen, um bei der Fehlersuche und Überwachung zu helfen
|
||||
- **Behandeln Sie Fehler elegant**: Verwenden Sie bedingte Logik in Ihrem Workflow, um angemessene Fehlerantworten mit aussagekräftigen Meldungen zu setzen
|
||||
- **Validieren Sie Variablenreferenzen**: Stellen Sie sicher, dass alle referenzierten Variablen existieren und die erwarteten Datentypen enthalten, bevor der Response-Block ausgeführt wird
|
||||
225
apps/docs/content/docs/de/blocks/router.mdx
Normal file
225
apps/docs/content/docs/de/blocks/router.mdx
Normal file
@@ -0,0 +1,225 @@
|
||||
---
|
||||
title: Router
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Der Router-Block nutzt KI, um intelligent zu entscheiden, welchen Pfad Ihr Workflow als nächstes nehmen sollte, indem er die Workflow-Ausführung basierend auf spezifischen Bedingungen oder Logik leitet. Im Gegensatz zu Bedingungsblöcken, die einfache Regeln verwenden, können Router-Blöcke den Kontext verstehen und intelligente Routing-Entscheidungen auf Basis von Inhaltsanalysen treffen.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/router.png"
|
||||
alt="Router-Block mit mehreren Pfaden"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der Router-Block ermöglicht Ihnen:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Intelligentes Content-Routing</strong>: Nutzung von KI zum Verständnis von Absicht und Kontext
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Dynamische Pfadauswahl</strong>: Routing von Workflows basierend auf unstrukturierter Inhaltsanalyse
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Kontextbewusste Entscheidungen</strong>: Treffen intelligenter Routing-Entscheidungen über einfache Regeln hinaus
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Multi-Pfad-Management</strong>: Verwaltung komplexer Workflows mit mehreren potenziellen Zielen
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Router vs. Bedingungsblöcke
|
||||
|
||||
<Accordions>
|
||||
<Accordion title="Wann Router verwenden">
|
||||
- KI-gestützte Inhaltsanalyse erforderlich
|
||||
- Unstrukturierte oder variierende Inhaltstypen
|
||||
- Absichtsbasiertes Routing (z.B. "Support-Tickets an Abteilungen weiterleiten")
|
||||
- Kontextbewusste Entscheidungsfindung erforderlich
|
||||
</Accordion>
|
||||
<Accordion title="Wann Bedingung verwenden">
|
||||
- Einfache, regelbasierte Entscheidungen
|
||||
- Strukturierte Daten oder numerische Vergleiche
|
||||
- Schnelles, deterministisches Routing erforderlich
|
||||
- Boolesche Logik ausreichend
|
||||
</Accordion>
|
||||
</Accordions>
|
||||
|
||||
## Funktionsweise
|
||||
|
||||
Der Router-Block:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Analysiert Inhalte</strong>: Verwendet ein LLM, um Eingabeinhalte und Kontext zu verstehen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Bewertet Ziele</strong>: Vergleicht Inhalte mit verfügbaren Zielblöcken
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Wählt Ziel aus</strong>: Identifiziert den am besten geeigneten Pfad basierend auf der Absicht
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Leitet Ausführung</strong>: Dirigiert den Workflow zum ausgewählten Block
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### Inhalt/Prompt
|
||||
|
||||
Der Inhalt oder Prompt, den der Router analysiert, um Routing-Entscheidungen zu treffen. Dies kann sein:
|
||||
|
||||
- Eine direkte Benutzeranfrage oder -eingabe
|
||||
- Ausgabe aus einem vorherigen Block
|
||||
- Eine vom System generierte Nachricht
|
||||
|
||||
### Zielblöcke
|
||||
|
||||
Die möglichen Zielblöcke, aus denen der Router auswählen kann. Der Router erkennt automatisch verbundene Blöcke, aber Sie können auch:
|
||||
|
||||
- Die Beschreibungen der Zielblöcke anpassen, um die Routing-Genauigkeit zu verbessern
|
||||
- Routing-Kriterien für jeden Zielblock festlegen
|
||||
- Bestimmte Blöcke von der Berücksichtigung als Routing-Ziele ausschließen
|
||||
|
||||
### Modellauswahl
|
||||
|
||||
Wählen Sie ein KI-Modell für die Routing-Entscheidung:
|
||||
|
||||
**OpenAI**: GPT-4o, o1, o3, o4-mini, gpt-4.1 \
|
||||
**Anthropic**: Claude 3.7 Sonnet \
|
||||
**Google**: Gemini 2.5 Pro, Gemini 2.0 Flash \
|
||||
**Andere Anbieter**: Groq, Cerebras, xAI, DeepSeek \
|
||||
**Lokale Modelle**: Jedes Modell, das auf Ollama läuft
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="router-model-dropdown.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Empfehlung**: Verwenden Sie Modelle mit starken Reasoning-Fähigkeiten wie GPT-4o oder Claude 3.7 Sonnet für genauere Routing-Entscheidungen.
|
||||
|
||||
### API-Schlüssel
|
||||
|
||||
Ihr API-Schlüssel für den ausgewählten LLM-Anbieter. Dieser wird sicher gespeichert und für die Authentifizierung verwendet.
|
||||
|
||||
### Zugriff auf Ergebnisse
|
||||
|
||||
Nachdem ein Router eine Entscheidung getroffen hat, können Sie auf seine Ausgaben zugreifen:
|
||||
|
||||
- **`<router.prompt>`**: Zusammenfassung des verwendeten Routing-Prompts
|
||||
- **`<router.selected_path>`**: Details zum ausgewählten Zielblock
|
||||
- **`<router.tokens>`**: Token-Nutzungsstatistiken vom LLM
|
||||
- **`<router.cost>`**: Kostenübersicht für den Routing-Aufruf (Eingabe, Ausgabe, Gesamt)
|
||||
- **`<router.model>`**: Das für die Entscheidungsfindung verwendete Modell
|
||||
|
||||
## Erweiterte Funktionen
|
||||
|
||||
### Benutzerdefinierte Routing-Kriterien
|
||||
|
||||
Definieren Sie spezifische Kriterien für jeden Zielblock:
|
||||
|
||||
```javascript
|
||||
// Example routing descriptions
|
||||
Target Block 1: "Technical support issues, API problems, integration questions"
|
||||
Target Block 2: "Billing inquiries, subscription changes, payment issues"
|
||||
Target Block 3: "General questions, feedback, feature requests"
|
||||
```
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Konfiguration', 'Variablen']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Inhalt/Prompt</strong>: Zu analysierender Text für Routing-Entscheidungen
|
||||
</li>
|
||||
<li>
|
||||
<strong>Zielblöcke</strong>: Verbundene Blöcke als potenzielle Ziele
|
||||
</li>
|
||||
<li>
|
||||
<strong>Modell</strong>: KI-Modell für Routing-Analyse
|
||||
</li>
|
||||
<li>
|
||||
<strong>API-Schlüssel</strong>: Authentifizierung für ausgewählten LLM-Anbieter
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>router.prompt</strong>: Zusammenfassung des verwendeten Routing-Prompts
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.selected_path</strong>: Details zum gewählten Ziel
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.tokens</strong>: Token-Nutzungsstatistiken
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.cost</strong>: Kostenübersicht für den Routing-Aufruf (Eingabe, Ausgabe, Gesamt)
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.model</strong>: Für die Entscheidungsfindung verwendetes Modell
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### Kundensupport-Triage
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Support-Tickets an spezialisierte Abteilungen weiterleiten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Benutzer reicht Supportanfrage über Formular ein</li>
|
||||
<li>Router analysiert Ticket-Inhalt und Kontext</li>
|
||||
<li>Technische Probleme → Engineering-Support-Mitarbeiter</li>
|
||||
<li>Abrechnungsfragen → Finanz-Support-Mitarbeiter</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Inhaltsklassifizierung
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Benutzergenerierte Inhalte klassifizieren und weiterleiten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Benutzer reicht Inhalt oder Feedback ein</li>
|
||||
<li>Router analysiert Inhaltstyp und Stimmung</li>
|
||||
<li>Feature-Anfragen → Produkt-Team-Workflow</li>
|
||||
<li>Fehlerberichte → Technischer Support-Workflow</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Lead-Qualifizierung
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Leads basierend auf Qualifizierungskriterien weiterleiten</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Lead-Informationen aus Formular erfasst</li>
|
||||
<li>Router analysiert Unternehmensgröße, Branche und Bedürfnisse</li>
|
||||
<li>Enterprise-Leads → Vertriebsteam mit individueller Preisgestaltung</li>
|
||||
<li>KMU-Leads → Self-Service-Onboarding-Prozess</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Klare Zielbeschreibungen bereitstellen**: Helfen Sie dem Router zu verstehen, wann jedes Ziel mit spezifischen, detaillierten Beschreibungen ausgewählt werden soll
|
||||
- **Spezifische Routing-Kriterien verwenden**: Definieren Sie klare Bedingungen und Beispiele für jeden Pfad, um die Genauigkeit zu verbessern
|
||||
- **Fallback-Pfade implementieren**: Verbinden Sie ein Standardziel für Fälle, in denen kein spezifischer Pfad geeignet ist
|
||||
- **Mit verschiedenen Eingaben testen**: Stellen Sie sicher, dass der Router verschiedene Eingabetypen, Grenzfälle und unerwartete Inhalte verarbeiten kann
|
||||
- **Routing-Leistung überwachen**: Überprüfen Sie Routing-Entscheidungen regelmäßig und verfeinern Sie Kriterien basierend auf tatsächlichen Nutzungsmustern
|
||||
- **Geeignete Modelle auswählen**: Verwenden Sie Modelle mit starken Argumentationsfähigkeiten für komplexe Routing-Entscheidungen
|
||||
40
apps/docs/content/docs/de/blocks/workflow.mdx
Normal file
40
apps/docs/content/docs/de/blocks/workflow.mdx
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
title: Workflow-Block
|
||||
description: Führe einen anderen Workflow innerhalb des aktuellen Ablaufs aus
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
## Was er macht
|
||||
|
||||
<div className='flex justify-center my-6'>
|
||||
<Image
|
||||
src='/static/blocks/workflow.png'
|
||||
alt='Workflow-Block-Konfiguration'
|
||||
width={400}
|
||||
height={280}
|
||||
className='rounded-xl border border-border shadow-sm'
|
||||
/>
|
||||
</div>
|
||||
|
||||
Füge einen Workflow-Block hinzu, wenn du einen untergeordneten Workflow als Teil eines größeren Ablaufs aufrufen möchtest. Der Block führt die neueste bereitgestellte Version dieses Workflows aus, wartet auf dessen Abschluss und setzt dann mit dem übergeordneten Workflow fort.
|
||||
|
||||
## Konfiguration
|
||||
|
||||
1. **Wähle einen Workflow** aus dem Dropdown-Menü (Selbstreferenzen sind blockiert, um Schleifen zu verhindern).
|
||||
2. **Eingaben zuordnen**: Wenn der untergeordnete Workflow einen Eingabeformular-Trigger hat, siehst du jedes Feld und kannst übergeordnete Variablen verbinden. Die zugeordneten Werte sind das, was der untergeordnete Workflow erhält.
|
||||
3. **Ausgaben**: Nach Abschluss des untergeordneten Workflows stellt der Block folgendes bereit:
|
||||
- `result` – die endgültige Antwort des untergeordneten Workflows
|
||||
- `success` – ob er ohne Fehler ausgeführt wurde
|
||||
- `error` – Nachricht, wenn die Ausführung fehlschlägt
|
||||
|
||||
## Ausführungshinweise
|
||||
|
||||
- Untergeordnete Workflows laufen im gleichen Workspace-Kontext, sodass Umgebungsvariablen und Tools übernommen werden.
|
||||
- Der Block verwendet Deployment-Versionierung: Jede API-, Zeitplan-, Webhook-, manuelle oder Chat-Ausführung ruft den bereitgestellten Snapshot auf. Stelle den untergeordneten Workflow neu bereit, wenn du ihn änderst.
|
||||
- Wenn der untergeordnete Workflow fehlschlägt, löst der Block einen Fehler aus, es sei denn, du behandelst ihn nachgelagert.
|
||||
|
||||
<Callout>
|
||||
Halte untergeordnete Workflows fokussiert. Kleine, wiederverwendbare Abläufe machen es einfacher, sie zu kombinieren, ohne tiefe Verschachtelungen zu erzeugen.
|
||||
</Callout>
|
||||
42
apps/docs/content/docs/de/connections/basics.mdx
Normal file
42
apps/docs/content/docs/de/connections/basics.mdx
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
title: Grundlagen
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
|
||||
## Wie Verbindungen funktionieren
|
||||
|
||||
Verbindungen sind die Pfade, die den Datenfluss zwischen Blöcken in Ihrem Workflow ermöglichen. In Sim definieren Verbindungen, wie Informationen von einem Block zum anderen übertragen werden und ermöglichen so den Datenfluss durch Ihren gesamten Workflow.
|
||||
|
||||
<Callout type="info">
|
||||
Jede Verbindung stellt eine gerichtete Beziehung dar, bei der Daten vom Ausgang eines Quellblocks
|
||||
zum Eingang eines Zielblocks fließen.
|
||||
</Callout>
|
||||
|
||||
### Verbindungen erstellen
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Quellblock auswählen</strong>: Klicken Sie auf den Ausgangsport des Blocks, von dem aus Sie verbinden möchten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Verbindung ziehen</strong>: Ziehen Sie zum Eingangsport des Zielblocks
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Verbindung bestätigen</strong>: Loslassen, um die Verbindung zu erstellen
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Verbindungsfluss
|
||||
|
||||
Der Datenfluss durch Verbindungen folgt diesen Prinzipien:
|
||||
|
||||
1. **Gerichteter Fluss**: Daten fließen immer von Ausgängen zu Eingängen
|
||||
2. **Ausführungsreihenfolge**: Blöcke werden basierend auf ihren Verbindungen der Reihe nach ausgeführt
|
||||
3. **Datentransformation**: Daten können beim Übergang zwischen Blöcken transformiert werden
|
||||
4. **Bedingte Pfade**: Einige Blöcke (wie Router und Bedingung) können den Fluss auf verschiedene Pfade leiten
|
||||
|
||||
<Callout type="warning">
|
||||
Das Löschen einer Verbindung stoppt sofort den Datenfluss zwischen den Blöcken. Stellen Sie sicher, dass dies beabsichtigt ist, bevor Sie Verbindungen entfernen.
|
||||
</Callout>
|
||||
194
apps/docs/content/docs/de/connections/data-structure.mdx
Normal file
194
apps/docs/content/docs/de/connections/data-structure.mdx
Normal file
@@ -0,0 +1,194 @@
|
||||
---
|
||||
title: Datenstruktur
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
|
||||
Wenn Sie Blöcke verbinden, ist das Verständnis der Datenstruktur verschiedener Block-Ausgaben wichtig, da die Ausgabedatenstruktur des Quellblocks bestimmt, welche Werte im Zielblock verfügbar sind. Jeder Blocktyp erzeugt eine spezifische Ausgabestruktur, auf die Sie in nachgelagerten Blöcken verweisen können.
|
||||
|
||||
<Callout type="info">
|
||||
Das Verständnis dieser Datenstrukturen ist wesentlich für die effektive Nutzung von Verbindungs-Tags und
|
||||
den Zugriff auf die richtigen Daten in Ihren Workflows.
|
||||
</Callout>
|
||||
|
||||
## Block-Ausgabestrukturen
|
||||
|
||||
Verschiedene Blocktypen erzeugen unterschiedliche Ausgabestrukturen. Hier ist, was Sie von jedem Blocktyp erwarten können:
|
||||
|
||||
<Tabs items={['Agent Output', 'API Output', 'Function Output', 'Evaluator Output', 'Condition Output', 'Router Output']}>
|
||||
<Tab>
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "The generated text response",
|
||||
"model": "gpt-4o",
|
||||
"tokens": {
|
||||
"prompt": 120,
|
||||
"completion": 85,
|
||||
"total": 205
|
||||
},
|
||||
"toolCalls": [...],
|
||||
"cost": [...],
|
||||
"usage": [...]
|
||||
}
|
||||
```
|
||||
|
||||
### Ausgabefelder des Agent-Blocks
|
||||
|
||||
- **content**: Die vom Agenten generierte Haupttextantwort
|
||||
- **model**: Das verwendete KI-Modell (z.B. "gpt-4o", "claude-3-opus")
|
||||
- **tokens**: Token-Nutzungsstatistiken
|
||||
- **prompt**: Anzahl der Token in der Eingabeaufforderung
|
||||
- **completion**: Anzahl der Token in der Vervollständigung
|
||||
- **total**: Insgesamt verwendete Token
|
||||
- **toolCalls**: Array von Werkzeugaufrufen des Agenten (falls vorhanden)
|
||||
- **cost**: Array von Kostenobjekten für jeden Werkzeugaufruf (falls vorhanden)
|
||||
- **usage**: Token-Nutzungsstatistiken für die gesamte Antwort
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```json
|
||||
{
|
||||
"data": "Response data",
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"content-type": "application/json",
|
||||
"cache-control": "no-cache"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Ausgabefelder des API-Blocks
|
||||
|
||||
- **data**: Die Antwortdaten von der API (kann jeden Typ haben)
|
||||
- **status**: HTTP-Statuscode der Antwort
|
||||
- **headers**: Von der API zurückgegebene HTTP-Header
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```json
|
||||
{
|
||||
"result": "Function return value",
|
||||
"stdout": "Console output",
|
||||
}
|
||||
```
|
||||
|
||||
### Ausgabefelder des Funktionsblocks
|
||||
|
||||
- **result**: Der Rückgabewert der Funktion (kann jeden Typ haben)
|
||||
- **stdout**: Während der Funktionsausführung erfasste Konsolenausgabe
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "Evaluation summary",
|
||||
"model": "gpt-5",
|
||||
"tokens": {
|
||||
"prompt": 120,
|
||||
"completion": 85,
|
||||
"total": 205
|
||||
},
|
||||
"metric1": 8.5,
|
||||
"metric2": 7.2,
|
||||
"metric3": 9.0
|
||||
}
|
||||
```
|
||||
|
||||
### Ausgabefelder des Evaluator-Blocks
|
||||
|
||||
- **content**: Zusammenfassung der Auswertung
|
||||
- **model**: Das für die Auswertung verwendete KI-Modell
|
||||
- **tokens**: Statistiken zur Token-Nutzung
|
||||
- **[metricName]**: Bewertung für jede im Evaluator definierte Metrik (dynamische Felder)
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "Original content passed through",
|
||||
"conditionResult": true,
|
||||
"selectedPath": {
|
||||
"blockId": "2acd9007-27e8-4510-a487-73d3b825e7c1",
|
||||
"blockType": "agent",
|
||||
"blockTitle": "Follow-up Agent"
|
||||
},
|
||||
"selectedConditionId": "condition-1"
|
||||
}
|
||||
```
|
||||
|
||||
### Ausgabefelder des Condition-Blocks
|
||||
|
||||
- **content**: Der ursprüngliche, durchgeleitete Inhalt
|
||||
- **conditionResult**: Boolesches Ergebnis der Bedingungsauswertung
|
||||
- **selectedPath**: Informationen über den ausgewählten Pfad
|
||||
- **blockId**: ID des nächsten Blocks im ausgewählten Pfad
|
||||
- **blockType**: Typ des nächsten Blocks
|
||||
- **blockTitle**: Titel des nächsten Blocks
|
||||
- **selectedConditionId**: ID der ausgewählten Bedingung
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "Routing decision",
|
||||
"model": "gpt-4o",
|
||||
"tokens": {
|
||||
"prompt": 120,
|
||||
"completion": 85,
|
||||
"total": 205
|
||||
},
|
||||
"selectedPath": {
|
||||
"blockId": "2acd9007-27e8-4510-a487-73d3b825e7c1",
|
||||
"blockType": "agent",
|
||||
"blockTitle": "Customer Service Agent"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Ausgabefelder des Router-Blocks
|
||||
|
||||
- **content**: Der Routing-Entscheidungstext
|
||||
- **model**: Das für das Routing verwendete KI-Modell
|
||||
- **tokens**: Statistiken zur Token-Nutzung
|
||||
- **selectedPath**: Informationen über den ausgewählten Pfad
|
||||
- **blockId**: ID des ausgewählten Zielblocks
|
||||
- **blockType**: Typ des ausgewählten Blocks
|
||||
- **blockTitle**: Titel des ausgewählten Blocks
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Benutzerdefinierte Ausgabestrukturen
|
||||
|
||||
Einige Blöcke können basierend auf ihrer Konfiguration benutzerdefinierte Ausgabestrukturen erzeugen:
|
||||
|
||||
1. **Agent-Blöcke mit Antwortformat**: Bei Verwendung eines Antwortformats in einem Agent-Block entspricht die Ausgabestruktur dem definierten Schema anstelle der Standardstruktur.
|
||||
|
||||
2. **Function-Blöcke**: Das Feld `result` kann jede Datenstruktur enthalten, die von Ihrem Funktionscode zurückgegeben wird.
|
||||
|
||||
3. **API-Blöcke**: Das Feld `data` enthält die Rückgabe der API, die jede gültige JSON-Struktur sein kann.
|
||||
|
||||
<Callout type="warning">
|
||||
Überprüfen Sie während der Entwicklung immer die tatsächliche Ausgabestruktur Ihrer Blöcke, um sicherzustellen, dass Sie in Ihren Verbindungen auf die richtigen Felder verweisen.
|
||||
</Callout>
|
||||
|
||||
## Verschachtelte Datenstrukturen
|
||||
|
||||
Viele Block-Ausgaben enthalten verschachtelte Datenstrukturen. Du kannst auf diese mit Punktnotation in Verbindungs-Tags zugreifen:
|
||||
|
||||
```
|
||||
<blockName.path.to.nested.data>
|
||||
```
|
||||
|
||||
Zum Beispiel:
|
||||
|
||||
- `<agent1.tokens.total>` - Greife auf die Gesamtzahl der Tokens aus einem Agent-Block zu
|
||||
- `<api1.data.results[0].id>` - Greife auf die ID des ersten Ergebnisses einer API-Antwort zu
|
||||
- `<function1.result.calculations.total>` - Greife auf ein verschachteltes Feld im Ergebnis eines Funktionsblocks zu
|
||||
42
apps/docs/content/docs/de/connections/index.mdx
Normal file
42
apps/docs/content/docs/de/connections/index.mdx
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
title: Übersicht
|
||||
description: Verbinde deine Blöcke miteinander.
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { ConnectIcon } from '@/components/icons'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Verbindungen sind die Pfade, die den Datenfluss zwischen Blöcken in deinem Workflow ermöglichen. Sie definieren, wie Informationen von einem Block zum anderen weitergegeben werden und ermöglichen dir, komplexe, mehrstufige Prozesse zu erstellen.
|
||||
|
||||
<Callout type="info">
|
||||
Richtig konfigurierte Verbindungen sind entscheidend für die Erstellung effektiver Workflows. Sie bestimmen, wie
|
||||
Daten durch dein System fließen und wie Blöcke miteinander interagieren.
|
||||
</Callout>
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="connections.mp4" />
|
||||
</div>
|
||||
|
||||
## Verbindungstypen
|
||||
|
||||
Sim unterstützt verschiedene Arten von Verbindungen, die verschiedene Workflow-Muster ermöglichen:
|
||||
|
||||
<Cards>
|
||||
<Card title="Grundlagen der Verbindungen" href="/connections/basics">
|
||||
Lerne, wie Verbindungen funktionieren und wie du sie in deinen Workflows erstellst
|
||||
</Card>
|
||||
<Card title="Verbindungs-Tags" href="/connections/tags">
|
||||
Verstehe, wie du Verbindungs-Tags verwendest, um auf Daten zwischen Blöcken zu verweisen
|
||||
</Card>
|
||||
<Card title="Datenstruktur" href="/connections/data-structure">
|
||||
Erkunde die Ausgabedatenstrukturen verschiedener Blocktypen
|
||||
</Card>
|
||||
<Card title="Datenzugriff" href="/connections/accessing-data">
|
||||
Lerne Techniken für den Zugriff und die Manipulation verbundener Daten
|
||||
</Card>
|
||||
<Card title="Best Practices" href="/connections/best-practices">
|
||||
Folge empfohlenen Mustern für effektives Verbindungsmanagement
|
||||
</Card>
|
||||
</Cards>
|
||||
109
apps/docs/content/docs/de/connections/tags.mdx
Normal file
109
apps/docs/content/docs/de/connections/tags.mdx
Normal file
@@ -0,0 +1,109 @@
|
||||
---
|
||||
title: Tags
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Verbindungs-Tags sind visuelle Darstellungen der verfügbaren Daten aus verbundenen Blöcken und bieten eine einfache Möglichkeit, auf Daten zwischen Blöcken und Ausgaben aus vorherigen Blöcken in Ihrem Workflow zu verweisen.
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="connections.mp4" />
|
||||
</div>
|
||||
|
||||
### Was sind Verbindungs-Tags?
|
||||
|
||||
Verbindungs-Tags sind interaktive Elemente, die erscheinen, wenn Blöcke verbunden werden. Sie repräsentieren die Daten, die von einem Block zum anderen fließen können und ermöglichen es Ihnen:
|
||||
|
||||
- Verfügbare Daten aus Quellblöcken zu visualisieren
|
||||
- Auf bestimmte Datenfelder in Zielblöcken zu verweisen
|
||||
- Dynamische Datenflüsse zwischen Blöcken zu erstellen
|
||||
|
||||
<Callout type="info">
|
||||
Verbindungs-Tags machen es einfach zu sehen, welche Daten aus vorherigen Blöcken verfügbar sind und diese in Ihrem
|
||||
aktuellen Block zu verwenden, ohne sich komplexe Datenstrukturen merken zu müssen.
|
||||
</Callout>
|
||||
|
||||
## Verwendung von Verbindungs-Tags
|
||||
|
||||
Es gibt zwei Hauptmethoden, um Verbindungs-Tags in Ihren Workflows zu verwenden:
|
||||
|
||||
<div className="my-6 grid grid-cols-1 gap-4 md:grid-cols-2">
|
||||
<div className="rounded-lg border border-gray-200 p-4 dark:border-gray-800">
|
||||
<h3 className="mb-2 text-lg font-medium">Drag and Drop</h3>
|
||||
<div className="text-sm text-gray-600 dark:text-gray-400">
|
||||
Klicken Sie auf einen Verbindungs-Tag und ziehen Sie ihn in Eingabefelder von Zielblöcken. Ein Dropdown-Menü wird
|
||||
angezeigt, das verfügbare Werte zeigt.
|
||||
</div>
|
||||
<ol className="mt-2 list-decimal pl-5 text-sm text-gray-600 dark:text-gray-400">
|
||||
<li>Fahren Sie mit dem Mauszeiger über einen Verbindungs-Tag, um verfügbare Daten zu sehen</li>
|
||||
<li>Klicken und ziehen Sie den Tag in ein Eingabefeld</li>
|
||||
<li>Wählen Sie das spezifische Datenfeld aus dem Dropdown-Menü</li>
|
||||
<li>Die Referenz wird automatisch eingefügt</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div className="rounded-lg border border-gray-200 p-4 dark:border-gray-800">
|
||||
<h3 className="mb-2 text-lg font-medium">Spitze-Klammer-Syntax</h3>
|
||||
<div className="text-sm text-gray-600 dark:text-gray-400">
|
||||
Geben Sie <code><></code> in Eingabefeldern ein, um ein Dropdown-Menü mit verfügbaren Verbindungswerten
|
||||
aus vorherigen Blöcken zu sehen.
|
||||
</div>
|
||||
<ol className="mt-2 list-decimal pl-5 text-sm text-gray-600 dark:text-gray-400">
|
||||
<li>Klicken Sie in ein beliebiges Eingabefeld, in dem Sie verbundene Daten verwenden möchten</li>
|
||||
<li>
|
||||
Geben Sie <code><></code> ein, um das Verbindungs-Dropdown-Menü aufzurufen
|
||||
</li>
|
||||
<li>Durchsuchen und wählen Sie die Daten aus, auf die Sie verweisen möchten</li>
|
||||
<li>Tippen Sie weiter oder wählen Sie aus dem Dropdown-Menü, um die Referenz zu vervollständigen</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
## Tag-Syntax
|
||||
|
||||
Verbindungs-Tags verwenden eine einfache Syntax, um auf Daten zu verweisen:
|
||||
|
||||
```
|
||||
<blockName.path.to.data>
|
||||
```
|
||||
|
||||
Wobei:
|
||||
|
||||
- `blockName` ist der Name des Quellblocks
|
||||
- `path.to.data` ist der Pfad zum spezifischen Datenfeld
|
||||
|
||||
Zum Beispiel:
|
||||
|
||||
- `<agent1.content>` - Verweist auf das Inhaltsfeld eines Blocks mit der ID "agent1"
|
||||
- `<api2.data.users[0].name>` - Verweist auf den Namen des ersten Benutzers im Benutzer-Array aus dem Datenfeld eines Blocks mit der ID "api2"
|
||||
|
||||
## Dynamische Tag-Referenzen
|
||||
|
||||
Verbindungs-Tags werden zur Laufzeit ausgewertet, was bedeutet:
|
||||
|
||||
1. Sie verweisen immer auf die aktuellsten Daten
|
||||
2. Sie können in Ausdrücken verwendet und mit statischem Text kombiniert werden
|
||||
3. Sie können in andere Datenstrukturen eingebettet werden
|
||||
|
||||
### Beispiele
|
||||
|
||||
```javascript
|
||||
// Reference in text
|
||||
"The user's name is <userBlock.name>"
|
||||
|
||||
// Reference in JSON
|
||||
{
|
||||
"userName": "<userBlock.name>",
|
||||
"orderTotal": <apiBlock.data.total>
|
||||
}
|
||||
|
||||
// Reference in code
|
||||
const greeting = "Hello, <userBlock.name>!";
|
||||
const total = <apiBlock.data.total> * 1.1; // Add 10% tax
|
||||
```
|
||||
|
||||
<Callout type="warning">
|
||||
Wenn Sie Verbindungs-Tags in numerischen Kontexten verwenden, stellen Sie sicher, dass die referenzierten Daten tatsächlich eine Zahl sind,
|
||||
um Typkonvertierungsprobleme zu vermeiden.
|
||||
</Callout>
|
||||
161
apps/docs/content/docs/de/copilot/index.mdx
Normal file
161
apps/docs/content/docs/de/copilot/index.mdx
Normal file
@@ -0,0 +1,161 @@
|
||||
---
|
||||
title: Copilot
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { MessageCircle, Package, Zap, Infinity as InfinityIcon, Brain, BrainCircuit } from 'lucide-react'
|
||||
|
||||
Copilot ist dein Assistent im Editor, der dir hilft, Workflows mit Sim Copilot zu erstellen und zu bearbeiten sowie diese zu verstehen und zu verbessern. Er kann:
|
||||
|
||||
- **Erklären**: Beantwortet Fragen zu Sim und deinem aktuellen Workflow
|
||||
- **Anleiten**: Schlägt Bearbeitungen und Best Practices vor
|
||||
- **Bearbeiten**: Nimmt Änderungen an Blöcken, Verbindungen und Einstellungen vor, wenn du zustimmst
|
||||
|
||||
<Callout type="info">
|
||||
Copilot ist ein von Sim verwalteter Dienst. Für selbst gehostete Installationen generiere einen Copilot API-Schlüssel in der gehosteten App (sim.ai → Einstellungen → Copilot)
|
||||
1. Gehe zu [sim.ai](https://sim.ai) → Einstellungen → Copilot und generiere einen Copilot API-Schlüssel
|
||||
2. Setze `COPILOT_API_KEY` in deiner selbst gehosteten Umgebung auf diesen Wert
|
||||
</Callout>
|
||||
|
||||
## Kontextmenü (@)
|
||||
|
||||
Verwende das `@` Symbol, um auf verschiedene Ressourcen zu verweisen und Copilot mehr Kontext über deinen Arbeitsbereich zu geben:
|
||||
|
||||
<Image
|
||||
src="/static/copilot/copilot-menu.png"
|
||||
alt="Copilot-Kontextmenü mit verfügbaren Referenzoptionen"
|
||||
width={600}
|
||||
height={400}
|
||||
/>
|
||||
|
||||
Das `@` Menü bietet Zugriff auf:
|
||||
- **Chats**: Verweise auf vorherige Copilot-Gespräche
|
||||
- **Alle Workflows**: Verweise auf beliebige Workflows in deinem Arbeitsbereich
|
||||
- **Workflow-Blöcke**: Verweise auf bestimmte Blöcke aus Workflows
|
||||
- **Blöcke**: Verweise auf Blocktypen und Vorlagen
|
||||
- **Wissen**: Verweise auf deine hochgeladenen Dokumente und Wissensdatenbank
|
||||
- **Dokumentation**: Verweise auf Sim-Dokumentation
|
||||
- **Vorlagen**: Verweise auf Workflow-Vorlagen
|
||||
- **Logs**: Verweise auf Ausführungsprotokolle und Ergebnisse
|
||||
|
||||
Diese kontextbezogenen Informationen helfen Copilot, genauere und relevantere Unterstützung für deinen spezifischen Anwendungsfall zu bieten.
|
||||
|
||||
## Modi
|
||||
|
||||
<Cards>
|
||||
<Card
|
||||
title={
|
||||
<span className="inline-flex items-center gap-2">
|
||||
<MessageCircle className="h-4 w-4 text-muted-foreground" />
|
||||
Fragen
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<div className="m-0 text-sm">
|
||||
Frage-Antwort-Modus für Erklärungen, Anleitungen und Vorschläge ohne Änderungen an deinem Workflow vorzunehmen.
|
||||
</div>
|
||||
</Card>
|
||||
<Card
|
||||
title={
|
||||
<span className="inline-flex items-center gap-2">
|
||||
<Package className="h-4 w-4 text-muted-foreground" />
|
||||
Agent
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<div className="m-0 text-sm">
|
||||
Erstellen-und-Bearbeiten-Modus. Copilot schlägt spezifische Änderungen vor (Blöcke hinzufügen, Variablen verbinden, Einstellungen anpassen) und wendet sie an, wenn du zustimmst.
|
||||
</div>
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Tiefenebenen
|
||||
|
||||
<Cards>
|
||||
<Card
|
||||
title={
|
||||
<span className="inline-flex items-center gap-2">
|
||||
<Zap className="h-4 w-4 text-muted-foreground" />
|
||||
Schnell
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<div className="m-0 text-sm">Am schnellsten und günstigsten. Ideal für kleine Änderungen, einfache Workflows und geringfügige Anpassungen.</div>
|
||||
</Card>
|
||||
<Card
|
||||
title={
|
||||
<span className="inline-flex items-center gap-2">
|
||||
<InfinityIcon className="h-4 w-4 text-muted-foreground" />
|
||||
Auto
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<div className="m-0 text-sm">Ausgewogene Geschwindigkeit und Denkleistung. Empfohlene Standardeinstellung für die meisten Aufgaben.</div>
|
||||
</Card>
|
||||
<Card
|
||||
title={
|
||||
<span className="inline-flex items-center gap-2">
|
||||
<Brain className="h-4 w-4 text-muted-foreground" />
|
||||
Erweitert
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<div className="m-0 text-sm">Mehr Denkleistung für umfangreichere Workflows und komplexe Änderungen bei gleichzeitiger Leistungsfähigkeit.</div>
|
||||
</Card>
|
||||
<Card
|
||||
title={
|
||||
<span className="inline-flex items-center gap-2">
|
||||
<BrainCircuit className="h-4 w-4 text-muted-foreground" />
|
||||
Behemoth
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<div className="m-0 text-sm">Maximale Denkleistung für tiefgreifende Planung, Fehlerbehebung und komplexe architektonische Änderungen.</div>
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
### Modusauswahl-Oberfläche
|
||||
|
||||
Du kannst einfach zwischen verschiedenen Denkmodi über den Modusauswähler in der Copilot-Oberfläche wechseln:
|
||||
|
||||
<Image
|
||||
src="/static/copilot/copilot-models.png"
|
||||
alt="Copilot-Modusauswahl zeigt den erweiterten Modus mit MAX-Umschalter"
|
||||
width={600}
|
||||
height={300}
|
||||
/>
|
||||
|
||||
Die Oberfläche ermöglicht dir:
|
||||
- **Denkebene auswählen**: Wähle zwischen Schnell, Auto, Erweitert oder Behemoth
|
||||
- **MAX-Modus aktivieren**: Umschalten für maximale Denkfähigkeiten, wenn du die gründlichste Analyse benötigst
|
||||
- **Modusbeschreibungen anzeigen**: Verstehe, wofür jeder Modus optimiert ist
|
||||
|
||||
Wähle deinen Modus basierend auf der Komplexität deiner Aufgabe - verwende Schnell für einfache Fragen und Behemoth für komplexe architektonische Änderungen.
|
||||
|
||||
## Abrechnung und Kostenberechnung
|
||||
|
||||
### Wie Kosten berechnet werden
|
||||
|
||||
Die Copilot-Nutzung wird pro Token vom zugrundeliegenden LLM abgerechnet:
|
||||
|
||||
- **Eingabe-Tokens**: werden zum Basistarif des Anbieters berechnet (**zum Selbstkostenpreis**)
|
||||
- **Ausgabe-Tokens**: werden mit dem **1,5-fachen** des Basisausgabepreises des Anbieters berechnet
|
||||
|
||||
```javascript
|
||||
copilotCost = (inputTokens × inputPrice + outputTokens × (outputPrice × 1.5)) / 1,000,000
|
||||
```
|
||||
|
||||
| Komponente | Angewendeter Tarif |
|
||||
|------------|------------------------|
|
||||
| Input | inputPrice |
|
||||
| Output | outputPrice × 1,5 |
|
||||
|
||||
<Callout type="warning">
|
||||
Die angezeigten Preise spiegeln die Tarife vom 4. September 2025 wider. Überprüfen Sie die Anbieterdokumentation für aktuelle Preise.
|
||||
</Callout>
|
||||
|
||||
<Callout type="info">
|
||||
Modellpreise werden pro Million Token berechnet. Die Berechnung teilt durch 1.000.000, um die tatsächlichen Kosten zu ermitteln. Siehe <a href="/execution/costs">die Seite zur Kostenberechnung</a> für Hintergründe und Beispiele.
|
||||
</Callout>
|
||||
551
apps/docs/content/docs/de/execution/api.mdx
Normal file
551
apps/docs/content/docs/de/execution/api.mdx
Normal file
@@ -0,0 +1,551 @@
|
||||
---
|
||||
title: Externe API
|
||||
---
|
||||
|
||||
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { CodeBlock } from 'fumadocs-ui/components/codeblock'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Sim bietet eine umfassende externe API zum Abfragen von Workflow-Ausführungsprotokollen und zum Einrichten von Webhooks für Echtzeit-Benachrichtigungen, wenn Workflows abgeschlossen werden.
|
||||
|
||||
## Authentifizierung
|
||||
|
||||
Alle API-Anfragen erfordern einen API-Schlüssel, der im Header `x-api-key` übergeben wird:
|
||||
|
||||
```bash
|
||||
curl -H "x-api-key: YOUR_API_KEY" \
|
||||
https://sim.ai/api/v1/logs?workspaceId=YOUR_WORKSPACE_ID
|
||||
```
|
||||
|
||||
Sie können API-Schlüssel in Ihren Benutzereinstellungen im Sim-Dashboard generieren.
|
||||
|
||||
## Logs-API
|
||||
|
||||
Alle API-Antworten enthalten Informationen über Ihre Workflow-Ausführungslimits und -nutzung:
|
||||
|
||||
```json
|
||||
"limits": {
|
||||
"workflowExecutionRateLimit": {
|
||||
"sync": {
|
||||
"limit": 60, // Max sync workflow executions per minute
|
||||
"remaining": 58, // Remaining sync workflow executions
|
||||
"resetAt": "..." // When the window resets
|
||||
},
|
||||
"async": {
|
||||
"limit": 60, // Max async workflow executions per minute
|
||||
"remaining": 59, // Remaining async workflow executions
|
||||
"resetAt": "..." // When the window resets
|
||||
}
|
||||
},
|
||||
"usage": {
|
||||
"currentPeriodCost": 1.234, // Current billing period usage in USD
|
||||
"limit": 10, // Usage limit in USD
|
||||
"plan": "pro", // Current subscription plan
|
||||
"isExceeded": false // Whether limit is exceeded
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Hinweis:** Die Ratenbegrenzungen in der Antwort beziehen sich auf Workflow-Ausführungen. Die Ratenbegrenzungen für den Aufruf dieses API-Endpunkts befinden sich in den Antwort-Headern (`X-RateLimit-*`).
|
||||
|
||||
### Logs abfragen
|
||||
|
||||
Fragen Sie Workflow-Ausführungsprotokolle mit umfangreichen Filteroptionen ab.
|
||||
|
||||
<Tabs items={['Request', 'Response']}>
|
||||
<Tab value="Request">
|
||||
|
||||
```http
|
||||
GET /api/v1/logs
|
||||
```
|
||||
|
||||
**Erforderliche Parameter:**
|
||||
- `workspaceId` - Ihre Workspace-ID
|
||||
|
||||
**Optionale Filter:**
|
||||
- `workflowIds` - Kommagetrennte Workflow-IDs
|
||||
- `folderIds` - Kommagetrennte Ordner-IDs
|
||||
- `triggers` - Kommagetrennte Auslösertypen: `api`, `webhook`, `schedule`, `manual`, `chat`
|
||||
- `level` - Nach Level filtern: `info`, `error`
|
||||
- `startDate` - ISO-Zeitstempel für den Beginn des Datumsbereichs
|
||||
- `endDate` - ISO-Zeitstempel für das Ende des Datumsbereichs
|
||||
- `executionId` - Exakte Übereinstimmung der Ausführungs-ID
|
||||
- `minDurationMs` - Minimale Ausführungsdauer in Millisekunden
|
||||
- `maxDurationMs` - Maximale Ausführungsdauer in Millisekunden
|
||||
- `minCost` - Minimale Ausführungskosten
|
||||
- `maxCost` - Maximale Ausführungskosten
|
||||
- `model` - Nach verwendetem KI-Modell filtern
|
||||
|
||||
**Paginierung:**
|
||||
- `limit` - Ergebnisse pro Seite (Standard: 100)
|
||||
- `cursor` - Cursor für die nächste Seite
|
||||
- `order` - Sortierreihenfolge: `desc`, `asc` (Standard: desc)
|
||||
|
||||
**Detailebene:**
|
||||
- `details` - Detailebene der Antwort: `basic`, `full` (Standard: basic)
|
||||
- `includeTraceSpans` - Trace-Spans einschließen (Standard: false)
|
||||
- `includeFinalOutput` - Endgültige Ausgabe einschließen (Standard: false)
|
||||
</Tab>
|
||||
<Tab value="Response">
|
||||
|
||||
```json
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"id": "log_abc123",
|
||||
"workflowId": "wf_xyz789",
|
||||
"executionId": "exec_def456",
|
||||
"level": "info",
|
||||
"trigger": "api",
|
||||
"startedAt": "2025-01-01T12:34:56.789Z",
|
||||
"endedAt": "2025-01-01T12:34:57.123Z",
|
||||
"totalDurationMs": 334,
|
||||
"cost": {
|
||||
"total": 0.00234
|
||||
},
|
||||
"files": null
|
||||
}
|
||||
],
|
||||
"nextCursor": "eyJzIjoiMjAyNS0wMS0wMVQxMjozNDo1Ni43ODlaIiwiaWQiOiJsb2dfYWJjMTIzIn0",
|
||||
"limits": {
|
||||
"workflowExecutionRateLimit": {
|
||||
"sync": {
|
||||
"limit": 60,
|
||||
"remaining": 58,
|
||||
"resetAt": "2025-01-01T12:35:56.789Z"
|
||||
},
|
||||
"async": {
|
||||
"limit": 60,
|
||||
"remaining": 59,
|
||||
"resetAt": "2025-01-01T12:35:56.789Z"
|
||||
}
|
||||
},
|
||||
"usage": {
|
||||
"currentPeriodCost": 1.234,
|
||||
"limit": 10,
|
||||
"plan": "pro",
|
||||
"isExceeded": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Log-Details abrufen
|
||||
|
||||
Rufen Sie detaillierte Informationen zu einem bestimmten Logeintrag ab.
|
||||
|
||||
<Tabs items={['Request', 'Response']}>
|
||||
<Tab value="Request">
|
||||
|
||||
```http
|
||||
GET /api/v1/logs/{id}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="Response">
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"id": "log_abc123",
|
||||
"workflowId": "wf_xyz789",
|
||||
"executionId": "exec_def456",
|
||||
"level": "info",
|
||||
"trigger": "api",
|
||||
"startedAt": "2025-01-01T12:34:56.789Z",
|
||||
"endedAt": "2025-01-01T12:34:57.123Z",
|
||||
"totalDurationMs": 334,
|
||||
"workflow": {
|
||||
"id": "wf_xyz789",
|
||||
"name": "My Workflow",
|
||||
"description": "Process customer data"
|
||||
},
|
||||
"executionData": {
|
||||
"traceSpans": [...],
|
||||
"finalOutput": {...}
|
||||
},
|
||||
"cost": {
|
||||
"total": 0.00234,
|
||||
"tokens": {
|
||||
"prompt": 123,
|
||||
"completion": 456,
|
||||
"total": 579
|
||||
},
|
||||
"models": {
|
||||
"gpt-4o": {
|
||||
"input": 0.001,
|
||||
"output": 0.00134,
|
||||
"total": 0.00234,
|
||||
"tokens": {
|
||||
"prompt": 123,
|
||||
"completion": 456,
|
||||
"total": 579
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"limits": {
|
||||
"workflowExecutionRateLimit": {
|
||||
"sync": {
|
||||
"limit": 60,
|
||||
"remaining": 58,
|
||||
"resetAt": "2025-01-01T12:35:56.789Z"
|
||||
},
|
||||
"async": {
|
||||
"limit": 60,
|
||||
"remaining": 59,
|
||||
"resetAt": "2025-01-01T12:35:56.789Z"
|
||||
}
|
||||
},
|
||||
"usage": {
|
||||
"currentPeriodCost": 1.234,
|
||||
"limit": 10,
|
||||
"plan": "pro",
|
||||
"isExceeded": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Ausführungsdetails abrufen
|
||||
|
||||
Rufen Sie Ausführungsdetails einschließlich des Workflow-Zustandsschnappschusses ab.
|
||||
|
||||
<Tabs items={['Request', 'Response']}>
|
||||
<Tab value="Request">
|
||||
|
||||
```http
|
||||
GET /api/v1/logs/executions/{executionId}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="Response">
|
||||
|
||||
```json
|
||||
{
|
||||
"executionId": "exec_def456",
|
||||
"workflowId": "wf_xyz789",
|
||||
"workflowState": {
|
||||
"blocks": {...},
|
||||
"edges": [...],
|
||||
"loops": {...},
|
||||
"parallels": {...}
|
||||
},
|
||||
"executionMetadata": {
|
||||
"trigger": "api",
|
||||
"startedAt": "2025-01-01T12:34:56.789Z",
|
||||
"endedAt": "2025-01-01T12:34:57.123Z",
|
||||
"totalDurationMs": 334,
|
||||
"cost": {...}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Webhook-Abonnements
|
||||
|
||||
Erhalten Sie Echtzeitbenachrichtigungen, wenn Workflow-Ausführungen abgeschlossen werden. Webhooks werden über die Sim-Benutzeroberfläche im Workflow-Editor konfiguriert.
|
||||
|
||||
### Konfiguration
|
||||
|
||||
Webhooks können für jeden Workflow über die Benutzeroberfläche des Workflow-Editors konfiguriert werden. Klicken Sie auf das Webhook-Symbol in der Kontrollleiste, um Ihre Webhook-Abonnements einzurichten.
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="configure-webhook.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
**Verfügbare Konfigurationsoptionen:**
|
||||
- `url`: Ihre Webhook-Endpunkt-URL
|
||||
- `secret`: Optionales Geheimnis für die HMAC-Signaturverifizierung
|
||||
- `includeFinalOutput`: Die endgültige Ausgabe des Workflows in die Nutzlast einschließen
|
||||
- `includeTraceSpans`: Detaillierte Ausführungs-Trace-Spans einschließen
|
||||
- `includeRateLimits`: Informationen zum Ratelimit des Workflow-Besitzers einschließen
|
||||
- `includeUsageData`: Nutzungs- und Abrechnungsdaten des Workflow-Besitzers einschließen
|
||||
- `levelFilter`: Array von Log-Ebenen, die empfangen werden sollen (`info`, `error`)
|
||||
- `triggerFilter`: Array von Auslösertypen, die empfangen werden sollen (`api`, `webhook`, `schedule`, `manual`, `chat`)
|
||||
- `active`: Webhook-Abonnement aktivieren/deaktivieren
|
||||
|
||||
### Webhook-Nutzlast
|
||||
|
||||
Wenn eine Workflow-Ausführung abgeschlossen ist, sendet Sim eine POST-Anfrage an Ihre Webhook-URL:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "evt_123",
|
||||
"type": "workflow.execution.completed",
|
||||
"timestamp": 1735925767890,
|
||||
"data": {
|
||||
"workflowId": "wf_xyz789",
|
||||
"executionId": "exec_def456",
|
||||
"status": "success",
|
||||
"level": "info",
|
||||
"trigger": "api",
|
||||
"startedAt": "2025-01-01T12:34:56.789Z",
|
||||
"endedAt": "2025-01-01T12:34:57.123Z",
|
||||
"totalDurationMs": 334,
|
||||
"cost": {
|
||||
"total": 0.00234,
|
||||
"tokens": {
|
||||
"prompt": 123,
|
||||
"completion": 456,
|
||||
"total": 579
|
||||
},
|
||||
"models": {
|
||||
"gpt-4o": {
|
||||
"input": 0.001,
|
||||
"output": 0.00134,
|
||||
"total": 0.00234,
|
||||
"tokens": {
|
||||
"prompt": 123,
|
||||
"completion": 456,
|
||||
"total": 579
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"files": null,
|
||||
"finalOutput": {...}, // Only if includeFinalOutput=true
|
||||
"traceSpans": [...], // Only if includeTraceSpans=true
|
||||
"rateLimits": {...}, // Only if includeRateLimits=true
|
||||
"usage": {...} // Only if includeUsageData=true
|
||||
},
|
||||
"links": {
|
||||
"log": "/v1/logs/log_abc123",
|
||||
"execution": "/v1/logs/executions/exec_def456"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Webhook-Header
|
||||
|
||||
Jede Webhook-Anfrage enthält diese Header:
|
||||
|
||||
- `sim-event`: Ereignistyp (immer `workflow.execution.completed`)
|
||||
- `sim-timestamp`: Unix-Zeitstempel in Millisekunden
|
||||
- `sim-delivery-id`: Eindeutige Lieferungs-ID für Idempotenz
|
||||
- `sim-signature`: HMAC-SHA256-Signatur zur Verifizierung (falls Secret konfiguriert)
|
||||
- `Idempotency-Key`: Identisch mit der Lieferungs-ID zur Erkennung von Duplikaten
|
||||
|
||||
### Signaturverifizierung
|
||||
|
||||
Wenn Sie ein Webhook-Secret konfigurieren, überprüfen Sie die Signatur, um sicherzustellen, dass der Webhook von Sim stammt:
|
||||
|
||||
<Tabs items={['Node.js', 'Python']}>
|
||||
<Tab value="Node.js">
|
||||
|
||||
```javascript
|
||||
import crypto from 'crypto';
|
||||
|
||||
function verifyWebhookSignature(body, signature, secret) {
|
||||
const [timestampPart, signaturePart] = signature.split(',');
|
||||
const timestamp = timestampPart.replace('t=', '');
|
||||
const expectedSignature = signaturePart.replace('v1=', '');
|
||||
|
||||
const signatureBase = `${timestamp}.${body}`;
|
||||
const hmac = crypto.createHmac('sha256', secret);
|
||||
hmac.update(signatureBase);
|
||||
const computedSignature = hmac.digest('hex');
|
||||
|
||||
return computedSignature === expectedSignature;
|
||||
}
|
||||
|
||||
// In your webhook handler
|
||||
app.post('/webhook', (req, res) => {
|
||||
const signature = req.headers['sim-signature'];
|
||||
const body = JSON.stringify(req.body);
|
||||
|
||||
if (!verifyWebhookSignature(body, signature, process.env.WEBHOOK_SECRET)) {
|
||||
return res.status(401).send('Invalid signature');
|
||||
}
|
||||
|
||||
// Process the webhook...
|
||||
});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="Python">
|
||||
|
||||
```python
|
||||
import hmac
|
||||
import hashlib
|
||||
import json
|
||||
|
||||
def verify_webhook_signature(body: str, signature: str, secret: str) -> bool:
|
||||
timestamp_part, signature_part = signature.split(',')
|
||||
timestamp = timestamp_part.replace('t=', '')
|
||||
expected_signature = signature_part.replace('v1=', '')
|
||||
|
||||
signature_base = f"{timestamp}.{body}"
|
||||
computed_signature = hmac.new(
|
||||
secret.encode(),
|
||||
signature_base.encode(),
|
||||
hashlib.sha256
|
||||
).hexdigest()
|
||||
|
||||
return hmac.compare_digest(computed_signature, expected_signature)
|
||||
|
||||
# In your webhook handler
|
||||
@app.route('/webhook', methods=['POST'])
|
||||
def webhook():
|
||||
signature = request.headers.get('sim-signature')
|
||||
body = json.dumps(request.json)
|
||||
|
||||
if not verify_webhook_signature(body, signature, os.environ['WEBHOOK_SECRET']):
|
||||
return 'Invalid signature', 401
|
||||
|
||||
# Process the webhook...
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Wiederholungsrichtlinie
|
||||
|
||||
Fehlgeschlagene Webhook-Zustellungen werden mit exponentiellem Backoff und Jitter wiederholt:
|
||||
|
||||
- Maximale Versuche: 5
|
||||
- Wiederholungsverzögerungen: 5 Sekunden, 15 Sekunden, 1 Minute, 3 Minuten, 10 Minuten
|
||||
- Jitter: Bis zu 10% zusätzliche Verzögerung, um Überlastungen zu vermeiden
|
||||
- Nur HTTP 5xx und 429 Antworten lösen Wiederholungen aus
|
||||
- Zustellungen haben ein Timeout nach 30 Sekunden
|
||||
|
||||
<Callout type="info">
|
||||
Webhook-Zustellungen werden asynchron verarbeitet und beeinträchtigen nicht die Leistung der Workflow-Ausführung.
|
||||
</Callout>
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Polling-Strategie**: Verwenden Sie beim Abfragen von Logs die cursorbasierte Paginierung mit `order=asc` und `startDate`, um neue Logs effizient abzurufen.
|
||||
|
||||
2. **Webhook-Sicherheit**: Konfigurieren Sie immer ein Webhook-Secret und überprüfen Sie Signaturen, um sicherzustellen, dass Anfragen von Sim stammen.
|
||||
|
||||
3. **Idempotenz**: Verwenden Sie den `Idempotency-Key`Header, um doppelte Webhook-Zustellungen zu erkennen und zu behandeln.
|
||||
|
||||
4. **Datenschutz**: Standardmäßig werden `finalOutput` und `traceSpans` von den Antworten ausgeschlossen. Aktivieren Sie diese nur, wenn Sie die Daten benötigen und die Datenschutzauswirkungen verstehen.
|
||||
|
||||
5. **Rate-Limiting**: Implementieren Sie exponentielles Backoff, wenn Sie 429-Antworten erhalten. Überprüfen Sie den `Retry-After`Header für die empfohlene Wartezeit.
|
||||
|
||||
## Rate-Limiting
|
||||
|
||||
Die API implementiert Rate-Limiting, um eine faire Nutzung zu gewährleisten:
|
||||
|
||||
- **Kostenloser Plan**: 10 Anfragen pro Minute
|
||||
- **Pro-Plan**: 30 Anfragen pro Minute
|
||||
- **Team-Plan**: 60 Anfragen pro Minute
|
||||
- **Enterprise-Plan**: Individuelle Limits
|
||||
|
||||
Informationen zum Rate-Limit sind in den Antwort-Headern enthalten:
|
||||
- `X-RateLimit-Limit`: Maximale Anfragen pro Zeitfenster
|
||||
- `X-RateLimit-Remaining`: Verbleibende Anfragen im aktuellen Zeitfenster
|
||||
- `X-RateLimit-Reset`: ISO-Zeitstempel, wann das Zeitfenster zurückgesetzt wird
|
||||
|
||||
## Beispiel: Abfragen neuer Logs
|
||||
|
||||
```javascript
|
||||
let cursor = null;
|
||||
const workspaceId = 'YOUR_WORKSPACE_ID';
|
||||
const startDate = new Date().toISOString();
|
||||
|
||||
async function pollLogs() {
|
||||
const params = new URLSearchParams({
|
||||
workspaceId,
|
||||
startDate,
|
||||
order: 'asc',
|
||||
limit: '100'
|
||||
});
|
||||
|
||||
if (cursor) {
|
||||
params.append('cursor', cursor);
|
||||
}
|
||||
|
||||
const response = await fetch(
|
||||
`https://sim.ai/api/v1/logs?${params}`,
|
||||
{
|
||||
headers: {
|
||||
'x-api-key': 'YOUR_API_KEY'
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
|
||||
// Process new logs
|
||||
for (const log of data.data) {
|
||||
console.log(`New execution: ${log.executionId}`);
|
||||
}
|
||||
|
||||
// Update cursor for next poll
|
||||
if (data.nextCursor) {
|
||||
cursor = data.nextCursor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Poll every 30 seconds
|
||||
setInterval(pollLogs, 30000);
|
||||
```
|
||||
|
||||
## Beispiel: Verarbeitung von Webhooks
|
||||
|
||||
```javascript
|
||||
import express from 'express';
|
||||
import crypto from 'crypto';
|
||||
|
||||
const app = express();
|
||||
app.use(express.json());
|
||||
|
||||
app.post('/sim-webhook', (req, res) => {
|
||||
// Verify signature
|
||||
const signature = req.headers['sim-signature'];
|
||||
const body = JSON.stringify(req.body);
|
||||
|
||||
if (!verifyWebhookSignature(body, signature, process.env.WEBHOOK_SECRET)) {
|
||||
return res.status(401).send('Invalid signature');
|
||||
}
|
||||
|
||||
// Check timestamp to prevent replay attacks
|
||||
const timestamp = parseInt(req.headers['sim-timestamp']);
|
||||
const fiveMinutesAgo = Date.now() - (5 * 60 * 1000);
|
||||
|
||||
if (timestamp < fiveMinutesAgo) {
|
||||
return res.status(401).send('Timestamp too old');
|
||||
}
|
||||
|
||||
// Process the webhook
|
||||
const event = req.body;
|
||||
|
||||
switch (event.type) {
|
||||
case 'workflow.execution.completed':
|
||||
const { workflowId, executionId, status, cost } = event.data;
|
||||
|
||||
if (status === 'error') {
|
||||
console.error(`Workflow ${workflowId} failed: ${executionId}`);
|
||||
// Handle error...
|
||||
} else {
|
||||
console.log(`Workflow ${workflowId} completed: ${executionId}`);
|
||||
console.log(`Cost: $${cost.total}`);
|
||||
// Process successful execution...
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Return 200 to acknowledge receipt
|
||||
res.status(200).send('OK');
|
||||
});
|
||||
|
||||
app.listen(3000, () => {
|
||||
console.log('Webhook server listening on port 3000');
|
||||
});
|
||||
```
|
||||
132
apps/docs/content/docs/de/execution/basics.mdx
Normal file
132
apps/docs/content/docs/de/execution/basics.mdx
Normal file
@@ -0,0 +1,132 @@
|
||||
---
|
||||
title: Grundlagen
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Das Verständnis der Workflow-Ausführung in Sim ist entscheidend für die Erstellung effizienter und zuverlässiger Automatisierungen. Die Ausführungs-Engine verwaltet automatisch Abhängigkeiten, Parallelität und Datenfluss, um sicherzustellen, dass Ihre Workflows reibungslos und vorhersehbar ablaufen.
|
||||
|
||||
## Wie Workflows ausgeführt werden
|
||||
|
||||
Die Ausführungs-Engine von Sim verarbeitet Workflows intelligent, indem sie Abhängigkeiten analysiert und Blöcke in der effizientesten Reihenfolge ausführt.
|
||||
|
||||
### Parallele Ausführung als Standard
|
||||
|
||||
Mehrere Blöcke werden gleichzeitig ausgeführt, wenn sie nicht voneinander abhängig sind. Diese parallele Ausführung verbessert die Leistung erheblich, ohne dass eine manuelle Konfiguration erforderlich ist.
|
||||
|
||||
<Image
|
||||
src="/static/execution/concurrency.png"
|
||||
alt="Mehrere Blöcke, die nach dem Start-Block parallel ausgeführt werden"
|
||||
width={800}
|
||||
height={500}
|
||||
/>
|
||||
|
||||
In diesem Beispiel werden sowohl der Kundensupport- als auch der Deep-Researcher-Agentenblock gleichzeitig nach dem Start-Block ausgeführt, was die Effizienz maximiert.
|
||||
|
||||
### Automatische Ausgabekombination
|
||||
|
||||
Wenn Blöcke mehrere Abhängigkeiten haben, wartet die Ausführungs-Engine automatisch auf den Abschluss aller Abhängigkeiten und stellt dann ihre kombinierten Ausgaben dem nächsten Block zur Verfügung. Keine manuelle Kombination erforderlich.
|
||||
|
||||
<Image
|
||||
src="/static/execution/combination.png"
|
||||
alt="Funktionsblock, der automatisch Ausgaben von mehreren vorherigen Blöcken empfängt"
|
||||
width={800}
|
||||
height={500}
|
||||
/>
|
||||
|
||||
Der Funktionsblock erhält Ausgaben von beiden Agentenblöcken, sobald diese abgeschlossen sind, sodass Sie die kombinierten Ergebnisse verarbeiten können.
|
||||
|
||||
### Intelligentes Routing
|
||||
|
||||
Workflows können sich in mehrere Richtungen verzweigen, indem sie Routing-Blöcke verwenden. Die Ausführungs-Engine unterstützt sowohl deterministisches Routing (mit Bedingungsblöcken) als auch KI-gesteuertes Routing (mit Router-Blöcken).
|
||||
|
||||
<Image
|
||||
src="/static/execution/routing.png"
|
||||
alt="Workflow, der sowohl bedingte als auch router-basierte Verzweigungen zeigt"
|
||||
width={800}
|
||||
height={500}
|
||||
/>
|
||||
|
||||
Dieser Workflow zeigt, wie die Ausführung unterschiedlichen Pfaden basierend auf Bedingungen oder KI-Entscheidungen folgen kann, wobei jeder Pfad unabhängig ausgeführt wird.
|
||||
|
||||
## Blocktypen
|
||||
|
||||
Sim bietet verschiedene Arten von Blöcken, die spezifische Zwecke in Ihren Workflows erfüllen:
|
||||
|
||||
<Cards>
|
||||
<Card title="Auslöser" href="/triggers">
|
||||
**Starter-Blöcke** initiieren Workflows und **Webhook-Blöcke** reagieren auf externe Ereignisse. Jeder Workflow benötigt einen Auslöser, um die Ausführung zu beginnen.
|
||||
</Card>
|
||||
|
||||
<Card title="Verarbeitungsblöcke" href="/blocks">
|
||||
**Agent-Blöcke** interagieren mit KI-Modellen, **Funktionsblöcke** führen benutzerdefinierten Code aus und **API-Blöcke** verbinden sich mit externen Diensten. Diese Blöcke transformieren und verarbeiten Ihre Daten.
|
||||
</Card>
|
||||
|
||||
<Card title="Kontrollfluss" href="/blocks">
|
||||
**Router-Blöcke** nutzen KI, um Pfade zu wählen, **Bedingungsblöcke** verzweigen basierend auf Logik und **Schleifen-/Parallelblöcke** handhaben Iterationen und Nebenläufigkeit.
|
||||
</Card>
|
||||
|
||||
<Card title="Ausgabe & Antwort" href="/blocks">
|
||||
**Antwortblöcke** formatieren endgültige Ausgaben für APIs und Chat-Schnittstellen und liefern strukturierte Ergebnisse aus Ihren Workflows.
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
Alle Blöcke werden automatisch basierend auf ihren Abhängigkeiten ausgeführt - Sie müssen die Ausführungsreihenfolge oder das Timing nicht manuell verwalten.
|
||||
|
||||
## Ausführungsauslöser
|
||||
|
||||
Workflows können auf verschiedene Weise ausgelöst werden, abhängig von Ihrem Anwendungsfall:
|
||||
|
||||
### Manuelles Testen
|
||||
Klicken Sie im Workflow-Editor auf "Ausführen", um Ihren Workflow während der Entwicklung zu testen. Perfekt für Debugging und Validierung.
|
||||
|
||||
### Geplante Ausführung
|
||||
Richten Sie wiederkehrende Ausführungen mit Cron-Ausdrücken ein. Ideal für regelmäßige Datenverarbeitung, Berichte oder Wartungsaufgaben.
|
||||
|
||||
### API-Bereitstellung
|
||||
Stellen Sie Workflows als HTTP-Endpunkte bereit, die programmatisch von Ihren Anwendungen aufgerufen werden können.
|
||||
|
||||
### Webhook-Integration
|
||||
Reagieren Sie in Echtzeit auf Ereignisse von externen Diensten wie GitHub, Stripe oder benutzerdefinierten Systemen.
|
||||
|
||||
### Chat-Schnittstelle
|
||||
Erstellen Sie Konversationsschnittstellen, die auf benutzerdefinierten Subdomains für benutzerorientierte KI-Anwendungen gehostet werden.
|
||||
|
||||
<Callout type="info">
|
||||
Erfahren Sie mehr über jeden Auslösertyp im [Abschnitt Auslöser](/triggers) der Dokumentation.
|
||||
</Callout>
|
||||
|
||||
## Ausführungsüberwachung
|
||||
|
||||
Wenn Workflows ausgeführt werden, bietet Sim Echtzeit-Einblick in den Ausführungsprozess:
|
||||
|
||||
- **Live-Block-Status**: Sehen Sie, welche Blöcke gerade ausgeführt werden, abgeschlossen sind oder fehlgeschlagen sind
|
||||
- **Ausführungsprotokolle**: Detaillierte Protokolle erscheinen in Echtzeit und zeigen Eingaben, Ausgaben und eventuelle Fehler
|
||||
- **Leistungskennzahlen**: Verfolgen Sie die Ausführungszeit und Kosten für jeden Block
|
||||
- **Pfadvisualisierung**: Verstehen Sie, welche Ausführungspfade durch Ihren Workflow genommen wurden
|
||||
|
||||
<Callout type="info">
|
||||
Alle Ausführungsdetails werden erfasst und sind auch nach Abschluss der Workflows zur Überprüfung verfügbar, was bei der Fehlerbehebung und Optimierung hilft.
|
||||
</Callout>
|
||||
|
||||
## Wichtige Ausführungsprinzipien
|
||||
|
||||
Das Verständnis dieser Grundprinzipien wird Ihnen helfen, bessere Workflows zu erstellen:
|
||||
|
||||
1. **Abhängigkeitsbasierte Ausführung**: Blöcke werden nur ausgeführt, wenn alle ihre Abhängigkeiten abgeschlossen sind
|
||||
2. **Automatische Parallelisierung**: Unabhängige Blöcke laufen gleichzeitig ohne Konfiguration
|
||||
3. **Intelligenter Datenfluss**: Ausgaben fließen automatisch zu verbundenen Blöcken
|
||||
4. **Fehlerbehandlung**: Fehlgeschlagene Blöcke stoppen ihren Ausführungspfad, beeinflussen aber keine unabhängigen Pfade
|
||||
5. **Zustandspersistenz**: Alle Blockausgaben und Ausführungsdetails werden für die Fehlerbehebung gespeichert
|
||||
|
||||
## Nächste Schritte
|
||||
|
||||
Nachdem Sie die Grundlagen der Ausführung verstanden haben, erkunden Sie:
|
||||
- **[Blocktypen](/blocks)** - Erfahren Sie mehr über spezifische Block-Funktionen
|
||||
- **[Protokollierung](/execution/logging)** - Überwachen Sie Workflow-Ausführungen und beheben Sie Probleme
|
||||
- **[Kostenberechnung](/execution/costs)** - Verstehen und optimieren Sie Workflow-Kosten
|
||||
- **[Auslöser](/triggers)** - Richten Sie verschiedene Möglichkeiten ein, Ihre Workflows auszuführen
|
||||
221
apps/docs/content/docs/de/execution/costs.mdx
Normal file
221
apps/docs/content/docs/de/execution/costs.mdx
Normal file
@@ -0,0 +1,221 @@
|
||||
---
|
||||
title: Kostenberechnung
|
||||
---
|
||||
|
||||
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
Sim berechnet automatisch die Kosten für alle Workflow-Ausführungen und bietet transparente Preise basierend auf der Nutzung von KI-Modellen und Ausführungsgebühren. Das Verständnis dieser Kosten hilft Ihnen, Workflows zu optimieren und Ihr Budget effektiv zu verwalten.
|
||||
|
||||
## Wie Kosten berechnet werden
|
||||
|
||||
Jede Workflow-Ausführung umfasst zwei Kostenkomponenten:
|
||||
|
||||
**Basis-Ausführungsgebühr**: 0,001 $ pro Ausführung
|
||||
|
||||
**KI-Modellnutzung**: Variable Kosten basierend auf dem Token-Verbrauch
|
||||
|
||||
```javascript
|
||||
modelCost = (inputTokens × inputPrice + outputTokens × outputPrice) / 1,000,000
|
||||
totalCost = baseExecutionCharge + modelCost
|
||||
```
|
||||
|
||||
<Callout type="info">
|
||||
KI-Modellpreise werden pro Million Token berechnet. Die Berechnung teilt durch 1.000.000, um die tatsächlichen Kosten zu ermitteln. Workflows ohne KI-Blöcke verursachen nur die Basis-Ausführungsgebühr.
|
||||
</Callout>
|
||||
|
||||
## Modellaufschlüsselung in Logs
|
||||
|
||||
Für Workflows mit KI-Blöcken können Sie detaillierte Kosteninformationen in den Logs einsehen:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/logs/logs-cost.png"
|
||||
alt="Modellaufschlüsselung"
|
||||
width={600}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Die Modellaufschlüsselung zeigt:
|
||||
- **Token-Nutzung**: Eingabe- und Ausgabe-Token-Anzahl für jedes Modell
|
||||
- **Kostenaufschlüsselung**: Einzelkosten pro Modell und Operation
|
||||
- **Modellverteilung**: Welche Modelle verwendet wurden und wie oft
|
||||
- **Gesamtkosten**: Gesamtkosten für die gesamte Workflow-Ausführung
|
||||
|
||||
## Preisoptionen
|
||||
|
||||
<Tabs items={['Gehostete Modelle', 'Eigener API-Schlüssel']}>
|
||||
<Tab>
|
||||
**Gehostete Modelle** - Sim stellt API-Schlüssel mit einem 2,5-fachen Preismultiplikator bereit:
|
||||
|
||||
| Modell | Basispreis (Eingabe/Ausgabe) | Gehosteter Preis (Eingabe/Ausgabe) |
|
||||
|-------|---------------------------|----------------------------|
|
||||
| GPT-4o | 2,50 $ / 10,00 $ | 6,25 $ / 25,00 $ |
|
||||
| GPT-4.1 | 2,00 $ / 8,00 $ | 5,00 $ / 20,00 $ |
|
||||
| o1 | 15,00 $ / 60,00 $ | 37,50 $ / 150,00 $ |
|
||||
| o3 | 2,00 $ / 8,00 $ | 5,00 $ / 20,00 $ |
|
||||
| Claude 3.5 Sonnet | 3,00 $ / 15,00 $ | 7,50 $ / 37,50 $ |
|
||||
| Claude Opus 4.0 | 15,00 $ / 75,00 $ | 37,50 $ / 187,50 $ |
|
||||
|
||||
*Der 2,5-fache Multiplikator deckt Infrastruktur- und API-Verwaltungskosten ab.*
|
||||
</Tab>
|
||||
|
||||
<Tab>
|
||||
**Ihre eigenen API-Schlüssel** - Nutzen Sie jedes Modell zum Basispreis:
|
||||
|
||||
| Anbieter | Modelle | Eingabe / Ausgabe |
|
||||
|----------|---------|----------------|
|
||||
| Google | Gemini 2.5 | 0,15 $ / 0,60 $ |
|
||||
| Deepseek | V3, R1 | 0,75 $ / 1,00 $ |
|
||||
| xAI | Grok 4, Grok 3 | 5,00 $ / 25,00 $ |
|
||||
| Groq | Llama 4 Scout | 0,40 $ / 0,60 $ |
|
||||
| Cerebras | Llama 3.3 70B | 0,94 $ / 0,94 $ |
|
||||
| Ollama | Lokale Modelle | Kostenlos |
|
||||
|
||||
*Bezahlen Sie Anbieter direkt ohne Aufschlag*
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Callout type="warning">
|
||||
Die angezeigten Preise spiegeln die Tarife vom 10. September 2025 wider. Überprüfen Sie die Anbieterdokumentation für aktuelle Preise.
|
||||
</Callout>
|
||||
|
||||
## Kostenoptimierungsstrategien
|
||||
|
||||
<Accordions>
|
||||
<Accordion title="Modellauswahl">
|
||||
Wählen Sie Modelle basierend auf der Komplexität der Aufgabe. Einfache Aufgaben können GPT-4.1-nano ($0,10/$0,40) verwenden, während komplexes Denken möglicherweise o1 oder Claude Opus erfordert.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Prompt-Engineering">
|
||||
Gut strukturierte, präzise Prompts reduzieren den Token-Verbrauch ohne Qualitätseinbußen.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Lokale Modelle">
|
||||
Verwenden Sie Ollama für unkritische Aufgaben, um API-Kosten vollständig zu eliminieren.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Caching und Wiederverwendung">
|
||||
Speichern Sie häufig verwendete Ergebnisse in Variablen oder Dateien, um wiederholte KI-Modellaufrufe zu vermeiden.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Batch-Verarbeitung">
|
||||
Verarbeiten Sie mehrere Elemente in einer einzigen KI-Anfrage anstatt einzelne Aufrufe zu tätigen.
|
||||
</Accordion>
|
||||
</Accordions>
|
||||
|
||||
## Nutzungsüberwachung
|
||||
|
||||
Überwachen Sie Ihre Nutzung und Abrechnung unter Einstellungen → Abonnement:
|
||||
|
||||
- **Aktuelle Nutzung**: Echtzeit-Nutzung und Kosten für den aktuellen Zeitraum
|
||||
- **Nutzungslimits**: Plangrenzen mit visuellen Fortschrittsanzeigen
|
||||
- **Abrechnungsdetails**: Prognostizierte Gebühren und Mindestverpflichtungen
|
||||
- **Planverwaltung**: Upgrade-Optionen und Abrechnungsverlauf
|
||||
|
||||
### Programmatische Nutzungsverfolgung
|
||||
|
||||
Sie können Ihre aktuelle Nutzung und Limits programmatisch über die API abfragen:
|
||||
|
||||
**Endpunkt:**
|
||||
|
||||
```text
|
||||
GET /api/users/me/usage-limits
|
||||
```
|
||||
|
||||
**Authentifizierung:**
|
||||
- Fügen Sie Ihren API-Schlüssel im `X-API-Key` Header hinzu
|
||||
|
||||
**Beispielanfrage:**
|
||||
|
||||
```bash
|
||||
curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" https://sim.ai/api/users/me/usage-limits
|
||||
```
|
||||
|
||||
**Beispielantwort:**
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"rateLimit": {
|
||||
"sync": { "isLimited": false, "limit": 10, "remaining": 10, "resetAt": "2025-09-08T22:51:55.999Z" },
|
||||
"async": { "isLimited": false, "limit": 50, "remaining": 50, "resetAt": "2025-09-08T22:51:56.155Z" },
|
||||
"authType": "api"
|
||||
},
|
||||
"usage": {
|
||||
"currentPeriodCost": 12.34,
|
||||
"limit": 100,
|
||||
"plan": "pro"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Antwortfelder:**
|
||||
- `currentPeriodCost` spiegelt die Nutzung im aktuellen Abrechnungszeitraum wider
|
||||
- `limit` wird aus individuellen Limits (Free/Pro) oder gepoolten Organisationslimits (Team/Enterprise) abgeleitet
|
||||
- `plan` ist der aktive Plan mit der höchsten Priorität, der mit Ihrem Benutzer verknüpft ist
|
||||
|
||||
## Planlimits
|
||||
|
||||
Verschiedene Abonnementpläne haben unterschiedliche Nutzungslimits:
|
||||
|
||||
| Plan | Monatliches Nutzungslimit | Ratengrenze (pro Minute) |
|
||||
|------|-------------------|-------------------------|
|
||||
| **Free** | $10 | 5 sync, 10 async |
|
||||
| **Pro** | $100 | 10 sync, 50 async |
|
||||
| **Team** | $500 (gepoolt) | 50 sync, 100 async |
|
||||
| **Enterprise** | Individuell | Individuell |
|
||||
|
||||
## Best Practices für Kostenmanagement
|
||||
|
||||
1. **Regelmäßig überwachen**: Prü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. **Passende Modelle verwenden**: Stimmen Sie die Modellkomplexität auf die Aufgabenanforderungen ab
|
||||
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 [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
|
||||
|
||||
**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
|
||||
153
apps/docs/content/docs/de/execution/index.mdx
Normal file
153
apps/docs/content/docs/de/execution/index.mdx
Normal file
@@ -0,0 +1,153 @@
|
||||
---
|
||||
title: Übersicht
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
Die Ausführungs-Engine von Sim bringt Ihre Workflows zum Leben, indem sie Blöcke in der richtigen Reihenfolge verarbeitet, den Datenfluss verwaltet und Fehler elegant behandelt, sodass Sie genau verstehen können, wie Workflows in Sim ausgeführt werden.
|
||||
|
||||
<Callout type="info">
|
||||
Jede Workflow-Ausführung folgt einem deterministischen Pfad, der auf Ihren Blockverbindungen und Ihrer Logik basiert, um vorhersehbare und zuverlässige Ergebnisse zu gewährleisten.
|
||||
</Callout>
|
||||
|
||||
## Dokumentationsübersicht
|
||||
|
||||
<Cards>
|
||||
<Card title="Grundlagen der Ausführung" href="/execution/basics">
|
||||
Erfahren Sie mehr über den grundlegenden Ausführungsablauf, Blocktypen und wie Daten durch Ihren
|
||||
Workflow fließen
|
||||
</Card>
|
||||
|
||||
<Card title="Protokollierung" href="/execution/logging">
|
||||
Überwachen Sie Workflow-Ausführungen mit umfassender Protokollierung und Echtzeit-Sichtbarkeit
|
||||
</Card>
|
||||
|
||||
<Card title="Kostenberechnung" href="/execution/costs">
|
||||
Verstehen Sie, wie die Kosten für Workflow-Ausführungen berechnet und optimiert werden
|
||||
</Card>
|
||||
|
||||
<Card title="Externe API" href="/execution/api">
|
||||
Greifen Sie programmgesteuert über REST-API auf Ausführungsprotokolle zu und richten Sie Webhooks ein
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Schlüsselkonzepte
|
||||
|
||||
### Topologische Ausführung
|
||||
Blöcke werden in Abhängigkeitsreihenfolge ausgeführt, ähnlich wie eine Tabellenkalkulation Zellen neu berechnet. Die Ausführungs-Engine bestimmt automatisch, welche Blöcke basierend auf abgeschlossenen Abhängigkeiten ausgeführt werden können.
|
||||
|
||||
### Pfadverfolgung
|
||||
Die Engine verfolgt aktiv Ausführungspfade durch Ihren Workflow. Router- und Bedingungsblöcke aktualisieren diese Pfade dynamisch und stellen sicher, dass nur relevante Blöcke ausgeführt werden.
|
||||
|
||||
### Schichtbasierte Verarbeitung
|
||||
Anstatt Blöcke einzeln auszuführen, identifiziert die Engine Schichten von Blöcken, die parallel ausgeführt werden können, und optimiert so die Leistung für komplexe Workflows.
|
||||
|
||||
### Ausführungskontext
|
||||
Jeder Workflow behält während der Ausführung einen umfangreichen Kontext bei, der Folgendes enthält:
|
||||
- Block-Ausgaben und -Zustände
|
||||
- Aktive Ausführungspfade
|
||||
- Verfolgung von Schleifen- und Paralleliterationen
|
||||
- Umgebungsvariablen
|
||||
- Routing-Entscheidungen
|
||||
|
||||
## Ausführungsauslöser
|
||||
|
||||
Workflows können über mehrere Kanäle ausgeführt werden:
|
||||
|
||||
- **Manuell**: Testen und debuggen direkt im Editor
|
||||
- **Als API bereitstellen**: Einen HTTP-Endpunkt erstellen, der mit API-Schlüsseln gesichert ist
|
||||
- **Als Chat bereitstellen**: Eine Konversationsschnittstelle auf einer benutzerdefinierten Subdomain erstellen
|
||||
- **Webhooks**: Auf externe Ereignisse von Drittanbieterdiensten reagieren
|
||||
- **Geplant**: Nach einem wiederkehrenden Zeitplan mit Cron-Ausdrücken ausführen
|
||||
|
||||
### Als API bereitstellen
|
||||
|
||||
Wenn Sie einen Workflow als API bereitstellen, macht Sim Folgendes:
|
||||
- Erstellt einen eindeutigen HTTP-Endpunkt: `https://sim.ai/api/workflows/{workflowId}/execute`
|
||||
- Generiert einen API-Schlüssel zur Authentifizierung
|
||||
- Akzeptiert POST-Anfragen mit JSON-Payloads
|
||||
- Gibt Workflow-Ausführungsergebnisse als JSON zurück
|
||||
|
||||
Beispiel für einen API-Aufruf:
|
||||
|
||||
```bash
|
||||
curl -X POST https://sim.ai/api/workflows/your-workflow-id/execute \
|
||||
-H "X-API-Key: your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"input": "your data here"}'
|
||||
```
|
||||
|
||||
### Als Chat bereitstellen
|
||||
|
||||
Die Chat-Bereitstellung erstellt eine Konversationsschnittstelle für Ihren Workflow:
|
||||
- Gehostet auf einer benutzerdefinierten Subdomain: `https://your-name.sim.ai`
|
||||
- Optionale Authentifizierung (öffentlich, passwortgeschützt oder E-Mail-basiert)
|
||||
- Anpassbare Benutzeroberfläche mit Ihrem Branding
|
||||
- Streaming-Antworten für Echtzeit-Interaktion
|
||||
- Perfekt für KI-Assistenten, Support-Bots oder interaktive Tools
|
||||
|
||||
Jede Bereitstellungsmethode übergibt Daten an den Starter-Block Ihres Workflows und beginnt so den Ausführungsfluss.
|
||||
|
||||
## Deployment-Snapshots
|
||||
|
||||
Alle öffentlichen Einstiegspunkte—API, Chat, Zeitplan, Webhook und manuelle Ausführungen—führen den aktiven Deployment-Snapshot des Workflows aus. Veröffentliche ein neues Deployment, wann immer du die Arbeitsfläche änderst, damit jeder Trigger die aktualisierte Version verwendet.
|
||||
|
||||
<div className='flex justify-center my-6'>
|
||||
<Image
|
||||
src='/static/execution/deployment-versions-light.png'
|
||||
alt='Tabelle mit Deployment-Versionen'
|
||||
width={500}
|
||||
height={280}
|
||||
className='rounded-xl border border-border shadow-sm'
|
||||
/>
|
||||
</div>
|
||||
|
||||
Das Deploy-Modal behält eine vollständige Versionshistorie bei—inspiziere jeden Snapshot, vergleiche ihn mit deinem Entwurf und führe Upgrades oder Rollbacks mit einem Klick durch, wenn du eine frühere Version wiederherstellen musst.
|
||||
|
||||
## Programmatische Ausführung
|
||||
|
||||
Führe Workflows aus deinen Anwendungen mit unseren offiziellen SDKs aus:
|
||||
|
||||
```bash
|
||||
# TypeScript/JavaScript
|
||||
npm install simstudio-ts-sdk
|
||||
|
||||
# Python
|
||||
pip install simstudio-sdk
|
||||
```
|
||||
|
||||
```typescript
|
||||
// TypeScript Example
|
||||
import { SimStudioClient } from 'simstudio-ts-sdk';
|
||||
|
||||
const client = new SimStudioClient({
|
||||
apiKey: 'your-api-key'
|
||||
});
|
||||
|
||||
const result = await client.executeWorkflow('workflow-id', {
|
||||
input: { message: 'Hello' }
|
||||
});
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Design für Zuverlässigkeit
|
||||
- Behandle Fehler elegant mit geeigneten Fallback-Pfaden
|
||||
- Verwende Umgebungsvariablen für sensible Daten
|
||||
- Füge Logging zu Funktionsblöcken für Debugging hinzu
|
||||
|
||||
### Leistung optimieren
|
||||
- Minimiere externe API-Aufrufe wo möglich
|
||||
- Nutze parallele Ausführung für unabhängige Operationen
|
||||
- Cache Ergebnisse mit Memory-Blöcken, wenn angemessen
|
||||
|
||||
### Ausführungen überwachen
|
||||
- Überprüfe Logs regelmäßig, um Leistungsmuster zu verstehen
|
||||
- Verfolge Kosten für KI-Modellnutzung
|
||||
- Verwende Workflow-Snapshots zur Fehlerbehebung
|
||||
|
||||
## Was kommt als nächstes?
|
||||
|
||||
Beginne mit [Ausführungsgrundlagen](/execution/basics), um zu verstehen, wie Workflows laufen, und erkunde dann [Logging](/execution/logging), um deine Ausführungen zu überwachen, sowie [Kostenberechnung](/execution/costs), um deine Ausgaben zu optimieren.
|
||||
150
apps/docs/content/docs/de/execution/logging.mdx
Normal file
150
apps/docs/content/docs/de/execution/logging.mdx
Normal file
@@ -0,0 +1,150 @@
|
||||
---
|
||||
title: Protokollierung
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
Sim bietet umfassende Protokollierung für alle Workflow-Ausführungen und gibt Ihnen vollständige Transparenz darüber, wie Ihre Workflows laufen, welche Daten durch sie fließen und wo möglicherweise Probleme auftreten.
|
||||
|
||||
## Protokollierungssystem
|
||||
|
||||
Sim bietet zwei komplementäre Protokollierungsschnittstellen, die verschiedenen Workflows und Anwendungsfällen entsprechen:
|
||||
|
||||
### Echtzeit-Konsole
|
||||
|
||||
Während der manuellen oder Chat-Workflow-Ausführung erscheinen Protokolle in Echtzeit im Konsolen-Panel auf der rechten Seite des Workflow-Editors:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/logs/console.png"
|
||||
alt="Echtzeit-Konsolen-Panel"
|
||||
width={400}
|
||||
height={300}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Die Konsole zeigt:
|
||||
- Fortschritt der Blockausführung mit Hervorhebung des aktiven Blocks
|
||||
- Echtzeit-Ausgaben nach Abschluss der Blöcke
|
||||
- Ausführungszeit für jeden Block
|
||||
- Erfolgs-/Fehlerstatusanzeigen
|
||||
|
||||
### Protokollseite
|
||||
|
||||
Alle Workflow-Ausführungen – ob manuell ausgelöst, über API, Chat, Zeitplan oder Webhook – werden auf der dedizierten Protokollseite protokolliert:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/logs/logs.png"
|
||||
alt="Protokollseite"
|
||||
width={600}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Die Protokollseite bietet:
|
||||
- Umfassende Filterung nach Zeitraum, Status, Auslösertyp, Ordner und Workflow
|
||||
- Suchfunktion über alle Protokolle
|
||||
- Live-Modus für Echtzeit-Updates
|
||||
- 7-tägige Protokollaufbewahrung (erweiterbar für längere Aufbewahrung)
|
||||
|
||||
## Protokolldetails-Seitenleiste
|
||||
|
||||
Durch Klicken auf einen Protokolleintrag öffnet sich eine detaillierte Seitenleistenansicht:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/logs/logs-sidebar.png"
|
||||
alt="Protokoll-Seitenleiste mit Details"
|
||||
width={600}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
### Block-Eingabe/Ausgabe
|
||||
|
||||
Sehen Sie den vollständigen Datenfluss für jeden Block mit Tabs zum Umschalten zwischen:
|
||||
|
||||
<Tabs items={['Output', 'Input']}>
|
||||
<Tab>
|
||||
**Output-Tab** zeigt das Ausführungsergebnis des Blocks:
|
||||
- Strukturierte Daten mit JSON-Formatierung
|
||||
- Markdown-Rendering für KI-generierte Inhalte
|
||||
- Kopierschaltfläche für einfache Datenextraktion
|
||||
</Tab>
|
||||
|
||||
<Tab>
|
||||
**Input-Tab** zeigt, was an den Block übergeben wurde:
|
||||
- Aufgelöste Variablenwerte
|
||||
- Referenzierte Ausgaben anderer Blöcke
|
||||
- Verwendete Umgebungsvariablen
|
||||
- API-Schlüssel werden aus Sicherheitsgründen automatisch unkenntlich gemacht
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Ausführungszeitlinie
|
||||
|
||||
Für Workflow-übergreifende Protokolle, sehen Sie detaillierte Ausführungsmetriken:
|
||||
- Start- und Endzeitstempel
|
||||
- Gesamtdauer des Workflows
|
||||
- Ausführungszeiten einzelner Blöcke
|
||||
- Identifikation von Leistungsengpässen
|
||||
|
||||
## Workflow-Snapshots
|
||||
|
||||
Für jede protokollierte Ausführung klicken Sie auf "Snapshot anzeigen", um den exakten Workflow-Zustand zum Ausführungszeitpunkt zu sehen:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/logs/logs-frozen-canvas.png"
|
||||
alt="Workflow-Snapshot"
|
||||
width={600}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Der Snapshot bietet:
|
||||
- Eingefrorene Arbeitsfläche, die die Workflow-Struktur zeigt
|
||||
- Block-Zustände und Verbindungen, wie sie während der Ausführung waren
|
||||
- Klicken Sie auf einen beliebigen Block, um dessen Ein- und Ausgaben zu sehen
|
||||
- Nützlich zum Debuggen von Workflows, die seitdem geändert wurden
|
||||
|
||||
<Callout type="info">
|
||||
Workflow-Snapshots sind nur für Ausführungen verfügbar, die nach der Einführung des erweiterten Protokollierungssystems durchgeführt wurden. Ältere migrierte Protokolle zeigen die Meldung "Protokollierter Zustand nicht gefunden".
|
||||
</Callout>
|
||||
|
||||
## Protokollaufbewahrung
|
||||
|
||||
- **Kostenloser Plan**: 7 Tage Protokollaufbewahrung
|
||||
- **Pro-Plan**: 30 Tage Protokollaufbewahrung
|
||||
- **Team-Plan**: 90 Tage Protokollaufbewahrung
|
||||
- **Enterprise-Plan**: Individuelle Aufbewahrungszeiträume verfügbar
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Für die Entwicklung
|
||||
- Verwenden Sie die Echtzeit-Konsole für sofortiges Feedback während des Testens
|
||||
- Überprüfen Sie Block-Ein- und Ausgaben, um den Datenfluss zu verifizieren
|
||||
- Nutzen Sie Workflow-Snapshots, um funktionierende mit fehlerhaften Versionen zu vergleichen
|
||||
|
||||
### Für die Produktion
|
||||
- Überwachen Sie die Protokollseite regelmäßig auf Fehler oder Leistungsprobleme
|
||||
- Richten Sie Filter ein, um sich auf bestimmte Workflows oder Zeiträume zu konzentrieren
|
||||
- Verwenden Sie den Live-Modus während kritischer Bereitstellungen, um Ausführungen in Echtzeit zu beobachten
|
||||
|
||||
### Für das Debugging
|
||||
- Überprüfen Sie immer die Ausführungszeitlinie, um langsame Blöcke zu identifizieren
|
||||
- Vergleichen Sie Eingaben zwischen funktionierenden und fehlerhaften Ausführungen
|
||||
- Verwenden Sie Workflow-Snapshots, um den genauen Zustand zu sehen, wenn Probleme aufgetreten sind
|
||||
|
||||
## Nächste Schritte
|
||||
|
||||
- Erfahren Sie mehr über die [Kostenberechnung](/execution/costs), um die Preisgestaltung von Workflows zu verstehen
|
||||
- Erkunden Sie die [externe API](/execution/api) für programmatischen Zugriff auf Protokolle
|
||||
- Richten Sie [Webhook-Benachrichtigungen](/execution/api#webhook-subscriptions) für Echtzeit-Warnungen ein
|
||||
193
apps/docs/content/docs/de/getting-started/index.mdx
Normal file
193
apps/docs/content/docs/de/getting-started/index.mdx
Normal file
@@ -0,0 +1,193 @@
|
||||
---
|
||||
title: Erste Schritte
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { File, Files, Folder } from 'fumadocs-ui/components/files'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import {
|
||||
AgentIcon,
|
||||
ApiIcon,
|
||||
ChartBarIcon,
|
||||
CodeIcon,
|
||||
ConditionalIcon,
|
||||
ConnectIcon,
|
||||
ExaAIIcon,
|
||||
FirecrawlIcon,
|
||||
GmailIcon,
|
||||
NotionIcon,
|
||||
PerplexityIcon,
|
||||
SlackIcon,
|
||||
} from '@/components/icons'
|
||||
import { Video } from '@/components/ui/video'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
Dieses Tutorial führt dich durch den Aufbau deines ersten KI-Workflows in Sim. Wir erstellen einen Personen-Recherche-Agenten, der Informationen über Personen mithilfe modernster LLM-Suchwerkzeuge finden kann.
|
||||
|
||||
<Callout type="info">
|
||||
Dieses Tutorial dauert etwa 10 Minuten und behandelt die wesentlichen Konzepte zum Erstellen von Workflows in Sim.
|
||||
</Callout>
|
||||
|
||||
## Was wir erstellen
|
||||
|
||||
Einen Personen-Recherche-Agenten, der:
|
||||
1. Den Namen einer Person über eine Chat-Schnittstelle empfängt
|
||||
2. Einen KI-Agenten mit erweiterten Suchfähigkeiten nutzt
|
||||
3. Das Web mithilfe modernster LLM-Suchwerkzeuge (Exa und Linkup) durchsucht
|
||||
4. Strukturierte Informationen mithilfe eines Antwortformats extrahiert
|
||||
5. Umfassende Daten über die Person zurückgibt
|
||||
|
||||
<Image
|
||||
src="/static/getting-started/started-1.png"
|
||||
alt="Beispiel für erste Schritte"
|
||||
width={800}
|
||||
height={500}
|
||||
/>
|
||||
|
||||
## Schritt-für-Schritt-Anleitung
|
||||
|
||||
<Steps>
|
||||
<Step title="Workflow erstellen und KI-Agenten hinzufügen">
|
||||
Öffne Sim und klicke im Dashboard auf "Neuer Workflow". Benenne ihn "Erste Schritte".
|
||||
|
||||
Wenn du einen neuen Workflow erstellst, enthält er automatisch einen **Start-Block** - dies ist der Einstiegspunkt, der Eingaben von Benutzern empfängt. Für dieses Beispiel werden wir den Workflow über den Chat auslösen, daher müssen wir am Start-Block nichts konfigurieren.
|
||||
|
||||
Ziehe nun einen **Agenten-Block** aus dem Blockbereich auf der linken Seite auf die Arbeitsfläche.
|
||||
|
||||
Konfiguriere den Agenten-Block:
|
||||
- **Modell**: Wähle "OpenAI GPT-4o"
|
||||
- **System-Prompt**: "Du bist ein Personen-Recherche-Agent. Wenn dir ein Personenname gegeben wird, nutze deine verfügbaren Suchwerkzeuge, um umfassende Informationen über diese Person zu finden, einschließlich ihres Standorts, Berufs, Bildungshintergrunds und anderer relevanter Details."
|
||||
- **Benutzer-Prompt**: Ziehe die Verbindung vom Ausgabefeld des Start-Blocks in dieses Feld (dies verbindet `<start.input>` mit dem Benutzer-Prompt)
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="getting-started/started-2.mp4" width={700} height={450} />
|
||||
</div>
|
||||
</Step>
|
||||
|
||||
<Step title="Werkzeuge zum Agenten hinzufügen">
|
||||
Verbessern wir unseren Agenten mit Werkzeugen für bessere Fähigkeiten. Klicke auf den Agenten-Block, um ihn auszuwählen.
|
||||
|
||||
Im Bereich **Werkzeuge**:
|
||||
- Klicke auf **Werkzeug hinzufügen**
|
||||
- Wähle **Exa** aus den verfügbaren Werkzeugen
|
||||
- Wähle **Linkup** aus den verfügbaren Werkzeugen
|
||||
- Füge deine API-Schlüssel für beide Werkzeuge hinzu (dies ermöglicht dem Agenten, das Web zu durchsuchen und auf zusätzliche Informationen zuzugreifen)
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="getting-started/started-3.mp4" width={700} height={450} />
|
||||
</div>
|
||||
</Step>
|
||||
|
||||
<Step title="Den grundlegenden Workflow testen">
|
||||
Jetzt testen wir unseren Workflow. Gehe zum **Chat-Panel** auf der rechten Seite des Bildschirms.
|
||||
|
||||
Im Chat-Panel:
|
||||
- Klicke auf das Dropdown-Menü und wähle `agent1.content` (dies zeigt uns die Ausgabe unseres Agenten)
|
||||
- Gib eine Testnachricht ein, wie: "John ist ein Softwareentwickler aus San Francisco, der Informatik an der Stanford University studiert hat."
|
||||
- Klicke auf "Senden", um den Workflow auszuführen
|
||||
|
||||
Du solltest die Antwort des Agenten sehen, der die in deinem Text beschriebene Person analysiert.
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="getting-started/started-4.mp4" width={700} height={450} />
|
||||
</div>
|
||||
</Step>
|
||||
|
||||
<Step title="Strukturierte Ausgabe hinzufügen">
|
||||
Jetzt lassen wir unseren Agenten strukturierte Daten zurückgeben. Klicke auf den Agenten-Block, um ihn auszuwählen.
|
||||
|
||||
Im Bereich **Antwortformat**:
|
||||
- Klicke auf das **Zauberstab-Symbol** (✨) neben dem Schema-Feld
|
||||
- Gib in der erscheinenden Aufforderung ein: "Erstelle ein Schema namens Person, das Standort, Beruf und Bildung enthält"
|
||||
- Die KI generiert automatisch ein JSON-Schema für dich
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="getting-started/started-5.mp4" width={700} height={450} />
|
||||
</div>
|
||||
</Step>
|
||||
|
||||
<Step title="Die strukturierte Ausgabe testen">
|
||||
Gehe zurück zum **Chat-Panel**.
|
||||
|
||||
Da wir ein Antwortformat hinzugefügt haben, sind jetzt neue Ausgabeoptionen verfügbar:
|
||||
- Klicke auf das Dropdown-Menü und wähle die neue Option für strukturierte Ausgabe (das Schema, das wir gerade erstellt haben)
|
||||
- Gib eine neue Testnachricht ein, wie: "Sarah ist eine Marketing-Managerin aus New York, die einen MBA von der Harvard Business School hat."
|
||||
- Klicke auf "Senden", um den Workflow erneut auszuführen
|
||||
|
||||
Du solltest jetzt eine strukturierte JSON-Ausgabe sehen, bei der die Informationen der Person in die Felder Standort, Beruf und Bildung gegliedert sind.
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="getting-started/started-6.mp4" width={700} height={450} />
|
||||
</div>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Was du gerade erstellt hast
|
||||
|
||||
Herzlichen Glückwunsch! Du hast deinen ersten KI-Workflow erstellt, der:
|
||||
- ✅ Texteingaben über eine Chat-Schnittstelle empfängt
|
||||
- ✅ KI nutzt, um Informationen aus unstrukturiertem Text zu extrahieren
|
||||
- ✅ Externe Tools (Exa und Linkup) für erweiterte Funktionen integriert
|
||||
- ✅ Strukturierte JSON-Daten mit KI-generierten Schemas zurückgibt
|
||||
- ✅ Workflow-Tests und Iterationen demonstriert
|
||||
- ✅ Die Leistungsfähigkeit des visuellen Workflow-Aufbaus zeigt
|
||||
|
||||
## Wichtige Konzepte, die du gelernt hast
|
||||
|
||||
### Verwendete Block-Typen
|
||||
|
||||
<Files>
|
||||
<File
|
||||
name="Start Block"
|
||||
icon={<ConnectIcon className="h-4 w-4" />}
|
||||
annotation="Einstiegspunkt für Benutzereingaben (automatisch enthalten)"
|
||||
/>
|
||||
<File
|
||||
name="Agent Block"
|
||||
icon={<AgentIcon className="h-4 w-4" />}
|
||||
annotation="KI-Modell für Textverarbeitung und -analyse"
|
||||
/>
|
||||
</Files>
|
||||
|
||||
### Grundlegende Workflow-Konzepte
|
||||
|
||||
**Datenfluss**: Variablen fließen zwischen Blöcken durch das Ziehen von Verbindungen
|
||||
|
||||
**Chat-Schnittstelle**: Teste Workflows in Echtzeit mit dem Chat-Panel mit verschiedenen Ausgabeoptionen
|
||||
|
||||
**Tool-Integration**: Erweitere die Fähigkeiten des Agenten durch Hinzufügen externer Tools wie Exa und Linkup
|
||||
|
||||
**Variablenreferenzen**: Greife auf Block-Ausgaben mit der `<blockName.output>` Syntax zu
|
||||
|
||||
**Strukturierte Ausgabe**: Verwende JSON-Schemas, um konsistente, strukturierte Daten von der KI zu erhalten
|
||||
|
||||
**KI-generierte Schemas**: Nutze den Zauberstab (✨), um Schemas mit natürlicher Sprache zu generieren
|
||||
|
||||
**Iterative Entwicklung**: Teste, modifiziere und teste Workflows einfach erneut
|
||||
|
||||
## Nächste Schritte
|
||||
|
||||
<Cards>
|
||||
<Card title="Weitere Blöcke hinzufügen" href="/blocks">
|
||||
Erfahre mehr über API-, Funktions- und Bedingungsblöcke
|
||||
</Card>
|
||||
<Card title="Tools verwenden" href="/tools">
|
||||
Integration mit externen Diensten wie Gmail, Slack und Notion
|
||||
</Card>
|
||||
<Card title="Benutzerdefinierte Logik hinzufügen" href="/blocks/function">
|
||||
Verwende Funktionsblöcke für benutzerdefinierte Datenverarbeitung
|
||||
</Card>
|
||||
<Card title="Deinen Workflow bereitstellen" href="/execution">
|
||||
Mache deinen Workflow über REST API zugänglich
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Brauchst du Hilfe?
|
||||
|
||||
**Bei einem Schritt hängengeblieben?** Schau in unserer [Blocks-Dokumentation](/blocks) nach detaillierten Erklärungen zu jeder Komponente.
|
||||
|
||||
**Möchten Sie mehr Beispiele sehen?** Durchsuchen Sie unsere [Tools-Dokumentation](/tools), um zu sehen, welche Integrationen verfügbar sind.
|
||||
|
||||
**Bereit für die Bereitstellung?** Erfahren Sie mehr über [Ausführung und Bereitstellung](/execution), um Ihre Workflows zu aktivieren.
|
||||
60
apps/docs/content/docs/de/index.mdx
Normal file
60
apps/docs/content/docs/de/index.mdx
Normal file
@@ -0,0 +1,60 @@
|
||||
---
|
||||
title: Dokumentation
|
||||
---
|
||||
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
|
||||
# Sim Dokumentation
|
||||
|
||||
Willkommen bei Sim, einem visuellen Workflow-Builder für KI-Anwendungen. Erstellen Sie leistungsstarke KI-Agenten, Automatisierungs-Workflows und Datenverarbeitungs-Pipelines, indem Sie Blöcke auf einer Leinwand verbinden.
|
||||
|
||||
## Schnellstart
|
||||
|
||||
<Cards>
|
||||
<Card title="Einführung" href="/introduction">
|
||||
Erfahren Sie, was Sie mit Sim erstellen können
|
||||
</Card>
|
||||
<Card title="Erste Schritte" href="/getting-started">
|
||||
Erstellen Sie Ihren ersten Workflow in 10 Minuten
|
||||
</Card>
|
||||
<Card title="Workflow-Blöcke" href="/blocks">
|
||||
Lernen Sie die Bausteine kennen
|
||||
</Card>
|
||||
<Card title="Tools & Integrationen" href="/tools">
|
||||
Entdecken Sie über 80 integrierte Schnittstellen
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Kernkonzepte
|
||||
|
||||
<Cards>
|
||||
<Card title="Verbindungen" href="/connections">
|
||||
Verstehen Sie, wie Daten zwischen Blöcken fließen
|
||||
</Card>
|
||||
<Card title="Variablen" href="/variables">
|
||||
Arbeiten Sie mit Workflow- und Umgebungsvariablen
|
||||
</Card>
|
||||
<Card title="Ausführung" href="/execution">
|
||||
Überwachen Sie Workflow-Ausführungen und verwalten Sie Kosten
|
||||
</Card>
|
||||
<Card title="Trigger" href="/triggers">
|
||||
Starten Sie Workflows über API, Webhooks oder Zeitpläne
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Erweiterte Funktionen
|
||||
|
||||
<Cards>
|
||||
<Card title="Team-Management" href="/permissions/roles-and-permissions">
|
||||
Richten Sie Workspace-Rollen und Berechtigungen ein
|
||||
</Card>
|
||||
<Card title="YAML-Konfiguration" href="/yaml">
|
||||
Definieren Sie Workflows als Code
|
||||
</Card>
|
||||
<Card title="MCP-Integration" href="/mcp">
|
||||
Verbinden Sie externe Dienste mit dem Model Context Protocol
|
||||
</Card>
|
||||
<Card title="SDKs" href="/sdks">
|
||||
Integrieren Sie Sim in Ihre Anwendungen
|
||||
</Card>
|
||||
</Cards>
|
||||
85
apps/docs/content/docs/de/introduction/index.mdx
Normal file
85
apps/docs/content/docs/de/introduction/index.mdx
Normal file
@@ -0,0 +1,85 @@
|
||||
---
|
||||
title: Einführung
|
||||
---
|
||||
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
Sim ist ein visueller Workflow-Builder für KI-Anwendungen, mit dem Sie KI-Agenten-Workflows visuell erstellen können. Erstellen Sie leistungsstarke KI-Agenten, Automatisierungs-Workflows und Datenverarbeitungs-Pipelines, indem Sie Blöcke auf einer Leinwand verbinden – ganz ohne Programmierung.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/introduction.png"
|
||||
alt="Sim visuelle Workflow-Leinwand"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Was Sie erstellen können
|
||||
|
||||
**KI-Assistenten & Chatbots**
|
||||
Erstellen Sie intelligente Agenten, die im Web suchen, auf Ihren Kalender zugreifen, E-Mails senden und mit Ihren Geschäftstools interagieren können.
|
||||
|
||||
**Geschäftsprozessautomatisierung**
|
||||
Automatisieren Sie wiederkehrende Aufgaben wie Dateneingabe, Berichtserstellung, Kundenservice-Antworten und Content-Erstellung.
|
||||
|
||||
**Datenverarbeitung & -analyse**
|
||||
Gewinnen Sie Erkenntnisse aus Dokumenten, analysieren Sie Datensätze, erstellen Sie Berichte und synchronisieren Sie Daten zwischen Systemen.
|
||||
|
||||
**API-Integrations-Workflows**
|
||||
Verbinden Sie mehrere Dienste zu einheitlichen Endpunkten, orchestrieren Sie komplexe Geschäftslogik und verwalten Sie ereignisgesteuerte Automatisierung.
|
||||
|
||||
## Wie es funktioniert
|
||||
|
||||
**Visuelle Leinwand**
|
||||
Ziehen Sie Blöcke per Drag-and-drop, um Workflows zu erstellen. Verbinden Sie KI-Modelle, Datenbanken, APIs und Geschäftstools mit einfachen Point-and-Click-Verbindungen.
|
||||
|
||||
**Intelligente Blöcke**
|
||||
Wählen Sie aus Verarbeitungsblöcken (KI-Agenten, APIs, Funktionen), Logikblöcken (Bedingungen, Schleifen, Router) und Ausgabeblöcken (Antworten, Evaluatoren).
|
||||
|
||||
**Mehrere Auslöser**
|
||||
Starten Sie Workflows über Chat-Schnittstelle, REST API, Webhooks, geplante Jobs oder externe Ereignisse von Diensten wie Slack und GitHub.
|
||||
|
||||
**Team-Zusammenarbeit**
|
||||
Arbeiten Sie gleichzeitig mit Teammitgliedern am selben Workflow mit Echtzeit-Bearbeitung und Berechtigungsverwaltung.
|
||||
|
||||
## Integrierte Anbindungen
|
||||
|
||||
Sim verbindet sich von Haus aus mit über 80 Diensten:
|
||||
|
||||
- **KI-Modelle**: OpenAI, Anthropic, Google, Groq, Cerebras, lokale Ollama-Modelle
|
||||
- **Kommunikation**: Gmail, Slack, Teams, Telegram, WhatsApp
|
||||
- **Produktivität**: Notion, Google Sheets, Airtable, Monday.com
|
||||
- **Entwicklung**: GitHub, Jira, Linear, Browser-Automatisierung
|
||||
- **Suche & Web**: Google Search, Perplexity, Firecrawl, Exa AI
|
||||
- **Datenbanken**: PostgreSQL, MySQL, Supabase, Pinecone, Qdrant
|
||||
|
||||
Benötigen Sie etwas Maßgeschneidertes? Nutzen Sie unsere [MCP-Integration](/mcp), um jeden externen Dienst anzubinden.
|
||||
|
||||
## Bereitstellungsoptionen
|
||||
|
||||
**Cloud-gehostet**: Starten Sie sofort bei [sim.ai](https://sim.ai) mit verwalteter Infrastruktur, automatischer Skalierung und integriertem Monitoring.
|
||||
|
||||
**Selbst-gehostet**: Stellen Sie die Anwendung auf Ihrer eigenen Infrastruktur mit Docker bereit, mit Unterstützung für lokale KI-Modelle über Ollama für vollständige Datenprivatsphäre.
|
||||
|
||||
## Nächste Schritte
|
||||
|
||||
Bereit, Ihren ersten KI-Workflow zu erstellen?
|
||||
|
||||
<Cards>
|
||||
<Card title="Erste Schritte" href="/getting-started">
|
||||
Erstellen Sie Ihren ersten Workflow in 10 Minuten
|
||||
</Card>
|
||||
<Card title="Workflow-Bausteine" href="/blocks">
|
||||
Erfahren Sie mehr über die Bausteine
|
||||
</Card>
|
||||
<Card title="Tools & Integrationen" href="/tools">
|
||||
Entdecken Sie über 60 integrierte Schnittstellen
|
||||
</Card>
|
||||
<Card title="Team-Berechtigungen" href="/permissions/roles-and-permissions">
|
||||
Richten Sie Workspace-Rollen und Berechtigungen ein
|
||||
</Card>
|
||||
</Cards>
|
||||
113
apps/docs/content/docs/de/knowledgebase/index.mdx
Normal file
113
apps/docs/content/docs/de/knowledgebase/index.mdx
Normal file
@@ -0,0 +1,113 @@
|
||||
---
|
||||
title: Wissensdatenbank
|
||||
---
|
||||
|
||||
import { Video } from '@/components/ui/video'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
Die Wissensdatenbank ermöglicht es Ihnen, Ihre Dokumente hochzuladen, zu verarbeiten und mit intelligenter Vektorsuche und Chunking zu durchsuchen. Dokumente verschiedener Typen werden automatisch verarbeitet, eingebettet und durchsuchbar gemacht. Ihre Dokumente werden intelligent in Chunks aufgeteilt, und Sie können sie mit natürlichsprachlichen Abfragen anzeigen, bearbeiten und durchsuchen.
|
||||
|
||||
## Upload und Verarbeitung
|
||||
|
||||
Laden Sie einfach Ihre Dokumente hoch, um zu beginnen. Sim verarbeitet sie automatisch im Hintergrund, extrahiert Text, erstellt Embeddings und teilt sie in durchsuchbare Chunks auf.
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="knowledgebase-1.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
Das System übernimmt den gesamten Verarbeitungsprozess für Sie:
|
||||
|
||||
1. **Textextraktion**: Inhalte werden aus Ihren Dokumenten mit spezialisierten Parsern für jeden Dateityp extrahiert
|
||||
2. **Intelligentes Chunking**: Dokumente werden in sinnvolle Chunks mit konfigurierbarer Größe und Überlappung aufgeteilt
|
||||
3. **Embedding-Generierung**: Vektoreinbettungen werden für semantische Suchfunktionen erstellt
|
||||
4. **Verarbeitungsstatus**: Verfolgen Sie den Fortschritt während Ihre Dokumente verarbeitet werden
|
||||
|
||||
## Unterstützte Dateitypen
|
||||
|
||||
Sim unterstützt PDF, Word (DOC/DOCX), Klartext (TXT), Markdown (MD), HTML, Excel (XLS/XLSX), PowerPoint (PPT/PPTX) und CSV-Dateien. Dateien können bis zu 100MB groß sein, wobei die optimale Leistung bei Dateien unter 50MB liegt. Sie können mehrere Dokumente gleichzeitig hochladen, und PDF-Dateien werden mit OCR-Verarbeitung für gescannte Dokumente unterstützt.
|
||||
|
||||
## Anzeigen und Bearbeiten von Chunks
|
||||
|
||||
Sobald Ihre Dokumente verarbeitet sind, können Sie die einzelnen Chunks anzeigen und bearbeiten. Dies gibt Ihnen volle Kontrolle darüber, wie Ihre Inhalte organisiert und durchsucht werden.
|
||||
|
||||
<Image src="/static/knowledgebase/knowledgebase.png" alt="Dokumentchunk-Ansicht mit verarbeiteten Inhalten" width={800} height={500} />
|
||||
|
||||
### Chunk-Konfiguration
|
||||
- **Standardgröße der Chunks**: 1.024 Zeichen
|
||||
- **Konfigurierbarer Bereich**: 100-4.000 Zeichen pro Chunk
|
||||
- **Intelligente Überlappung**: Standardmäßig 200 Zeichen zur Kontexterhaltung
|
||||
- **Hierarchische Aufteilung**: Respektiert Dokumentstruktur (Abschnitte, Absätze, Sätze)
|
||||
|
||||
### Bearbeitungsfunktionen
|
||||
- **Chunk-Inhalt bearbeiten**: Textinhalt einzelner Chunks ändern
|
||||
- **Chunk-Grenzen anpassen**: Chunks bei Bedarf zusammenführen oder teilen
|
||||
- **Metadaten hinzufügen**: Chunks mit zusätzlichem Kontext anreichern
|
||||
- **Massenoperationen**: Effiziente Verwaltung mehrerer Chunks
|
||||
|
||||
## Erweiterte PDF-Verarbeitung
|
||||
|
||||
Für PDF-Dokumente bietet Sim erweiterte Verarbeitungsfunktionen:
|
||||
|
||||
### OCR-Unterstützung
|
||||
Bei Konfiguration mit Azure oder [Mistral OCR](https://docs.mistral.ai/ocr/):
|
||||
- **Verarbeitung gescannter Dokumente**: Text aus bildbasierten PDFs extrahieren
|
||||
- **Umgang mit gemischten Inhalten**: Verarbeitung von PDFs mit Text und Bildern
|
||||
- **Hohe Genauigkeit**: Fortschrittliche KI-Modelle gewährleisten präzise Textextraktion
|
||||
|
||||
## Verwendung des Wissensblocks in Workflows
|
||||
|
||||
Sobald Ihre Dokumente verarbeitet sind, können Sie sie in Ihren KI-Workflows über den Wissensblock nutzen. Dies ermöglicht Retrieval-Augmented Generation (RAG), wodurch Ihre KI-Agenten auf Ihre Dokumentinhalte zugreifen und darüber nachdenken können, um genauere, kontextbezogene Antworten zu liefern.
|
||||
|
||||
<Image src="/static/knowledgebase/knowledgebase-2.png" alt="Verwendung des Wissensblocks in Workflows" width={800} height={500} />
|
||||
|
||||
### Funktionen des Wissensblocks
|
||||
- **Semantische Suche**: Relevante Inhalte mit natürlichsprachlichen Abfragen finden
|
||||
- **Kontextintegration**: Automatisches Einbinden relevanter Chunks in Agenten-Prompts
|
||||
- **Dynamischer Abruf**: Suche erfolgt in Echtzeit während der Workflow-Ausführung
|
||||
- **Relevanzbewertung**: Ergebnisse nach semantischer Ähnlichkeit geordnet
|
||||
|
||||
### Integrationsoptionen
|
||||
- **System-Prompts**: Kontext für Ihre KI-Agenten bereitstellen
|
||||
- **Dynamischer Kontext**: Suche und Einbindung relevanter Informationen während Gesprächen
|
||||
- **Dokumentübergreifende Suche**: Abfrage über Ihre gesamte Wissensdatenbank
|
||||
- **Gefilterte Suche**: Kombination mit Tags für präzisen Inhaltsabruf
|
||||
|
||||
## Vektorsuchtechnologie
|
||||
|
||||
Sim verwendet Vektorsuche, die von [pgvector](https://github.com/pgvector/pgvector) unterstützt wird, um die Bedeutung und den Kontext Ihrer Inhalte zu verstehen:
|
||||
|
||||
### Semantisches Verständnis
|
||||
- **Kontextuelle Suche**: Findet relevante Inhalte, auch wenn exakte Schlüsselwörter nicht übereinstimmen
|
||||
- **Konzeptbasierte Abfrage**: Versteht Beziehungen zwischen Ideen
|
||||
- **Mehrsprachige Unterstützung**: Funktioniert über verschiedene Sprachen hinweg
|
||||
- **Synonymerkennung**: Findet verwandte Begriffe und Konzepte
|
||||
|
||||
### Suchfunktionen
|
||||
- **Natürlichsprachige Abfragen**: Stellen Sie Fragen in natürlicher Sprache
|
||||
- **Ähnlichkeitssuche**: Finden Sie konzeptionell ähnliche Inhalte
|
||||
- **Hybridsuche**: Kombiniert Vektor- und traditionelle Schlüsselwortsuche
|
||||
- **Konfigurierbare Ergebnisse**: Steuern Sie die Anzahl und den Relevanz-Schwellenwert der Ergebnisse
|
||||
|
||||
## Dokumentenverwaltung
|
||||
|
||||
### Organisationsfunktionen
|
||||
- **Massenupload**: Laden Sie mehrere Dateien gleichzeitig über die asynchrone API hoch
|
||||
- **Verarbeitungsstatus**: Echtzeit-Updates zum Dokumentenverarbeitungsprozess
|
||||
- **Suchen und Filtern**: Finden Sie Dokumente schnell in großen Sammlungen
|
||||
- **Metadaten-Tracking**: Automatische Erfassung von Dateiinformationen und Verarbeitungsdetails
|
||||
|
||||
### Sicherheit und Datenschutz
|
||||
- **Sichere Speicherung**: Dokumente werden mit Sicherheit auf Unternehmensniveau gespeichert
|
||||
- **Zugriffskontrolle**: Workspace-basierte Berechtigungen
|
||||
- **Verarbeitungsisolierung**: Jeder Workspace hat eine isolierte Dokumentenverarbeitung
|
||||
- **Datenaufbewahrung**: Konfigurieren Sie Richtlinien zur Dokumentenaufbewahrung
|
||||
|
||||
## Erste Schritte
|
||||
|
||||
1. **Navigieren Sie zu Ihrer Wissensdatenbank**: Zugriff über Ihre Workspace-Seitenleiste
|
||||
2. **Dokumente hochladen**: Drag & Drop oder wählen Sie Dateien zum Hochladen aus
|
||||
3. **Verarbeitung überwachen**: Beobachten Sie, wie Dokumente verarbeitet und in Chunks aufgeteilt werden
|
||||
4. **Chunks erkunden**: Sehen und bearbeiten Sie die verarbeiteten Inhalte
|
||||
5. **Zu Workflows hinzufügen**: Verwenden Sie den Wissensblock, um ihn in Ihre KI-Agenten zu integrieren
|
||||
|
||||
Die Wissensdatenbank verwandelt Ihre statischen Dokumente in eine intelligente, durchsuchbare Ressource, die Ihre KI-Workflows für fundiertere und kontextbezogenere Antworten nutzen können.
|
||||
108
apps/docs/content/docs/de/knowledgebase/tags.mdx
Normal file
108
apps/docs/content/docs/de/knowledgebase/tags.mdx
Normal file
@@ -0,0 +1,108 @@
|
||||
---
|
||||
title: Tags und Filterung
|
||||
---
|
||||
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Tags bieten eine leistungsstarke Möglichkeit, Ihre Dokumente zu organisieren und präzise Filterungen für Ihre Vektorsuchen zu erstellen. Durch die Kombination von tag-basierter Filterung mit semantischer Suche können Sie genau die Inhalte aus Ihrer Wissensdatenbank abrufen, die Sie benötigen.
|
||||
|
||||
## Tags zu Dokumenten hinzufügen
|
||||
|
||||
Sie können jedem Dokument in Ihrer Wissensdatenbank benutzerdefinierte Tags hinzufügen, um Ihre Inhalte zu organisieren und zu kategorisieren und so leichter auffindbar zu machen.
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="knowledgebase-tag.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
### Tag-Verwaltung
|
||||
- **Benutzerdefinierte Tags**: Erstellen Sie Ihr eigenes Tag-System, das zu Ihrem Arbeitsablauf passt
|
||||
- **Mehrere Tags pro Dokument**: Wenden Sie so viele Tags wie nötig auf jedes Dokument an, es stehen 7 Tag-Slots pro Wissensdatenbank zur Verfügung, die von allen Dokumenten in der Wissensdatenbank gemeinsam genutzt werden
|
||||
- **Tag-Organisation**: Gruppieren Sie verwandte Dokumente mit einheitlichen Tags
|
||||
|
||||
### Best Practices für Tags
|
||||
- **Einheitliche Benennung**: Verwenden Sie standardisierte Tag-Namen für alle Ihre Dokumente
|
||||
- **Beschreibende Tags**: Verwenden Sie klare, aussagekräftige Tag-Namen
|
||||
- **Regelmäßige Bereinigung**: Entfernen Sie ungenutzte oder veraltete Tags regelmäßig
|
||||
|
||||
## Verwendung von Tags in Wissensblöcken
|
||||
|
||||
Tags werden besonders leistungsstark, wenn sie mit dem Wissensblock in Ihren Workflows kombiniert werden. Sie können Ihre Suchen auf bestimmte getaggte Inhalte filtern und so sicherstellen, dass Ihre KI-Agenten die relevantesten Informationen erhalten.
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="knowledgebase-tag2.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
## Suchmodi
|
||||
|
||||
Der Wissensblock unterstützt drei verschiedene Suchmodi, abhängig davon, was Sie angeben:
|
||||
|
||||
### 1. Nur-Tag-Suche
|
||||
Wenn Sie **nur Tags angeben** (keine Suchanfrage):
|
||||
- **Direkter Abruf**: Ruft alle Dokumente ab, die die angegebenen Tags haben
|
||||
- **Keine Vektorsuche**: Ergebnisse basieren ausschließlich auf Tag-Übereinstimmung
|
||||
- **Schnelle Leistung**: Schneller Abruf ohne semantische Verarbeitung
|
||||
- **Exakte Übereinstimmung**: Nur Dokumente mit allen angegebenen Tags werden zurückgegeben
|
||||
|
||||
**Anwendungsfall**: Wenn du alle Dokumente aus einer bestimmten Kategorie oder einem Projekt benötigst
|
||||
|
||||
### 2. Nur Vektorsuche
|
||||
Wenn du **nur eine Suchanfrage angibst** (keine Tags):
|
||||
- **Semantische Suche**: Findet Inhalte basierend auf Bedeutung und Kontext
|
||||
- **Vollständige Wissensdatenbank**: Durchsucht alle Dokumente
|
||||
- **Relevanz-Ranking**: Ergebnisse nach semantischer Ähnlichkeit geordnet
|
||||
- **Natürliche Sprache**: Verwende Fragen oder Phrasen, um relevante Inhalte zu finden
|
||||
|
||||
**Anwendungsfall**: Wenn du die relevantesten Inhalte unabhängig von der Organisation benötigst
|
||||
|
||||
### 3. Kombinierte Tag-Filterung + Vektorsuche
|
||||
Wenn du **sowohl Tags als auch eine Suchanfrage angibst**:
|
||||
1. **Zuerst**: Filtere Dokumente auf solche mit den angegebenen Tags
|
||||
2. **Dann**: Führe eine Vektorsuche innerhalb dieser gefilterten Teilmenge durch
|
||||
3. **Ergebnis**: Semantisch relevante Inhalte nur aus deinen getaggten Dokumenten
|
||||
|
||||
**Anwendungsfall**: Wenn du relevante Inhalte aus einer bestimmten Kategorie oder einem Projekt benötigst
|
||||
|
||||
### Suchkonfiguration
|
||||
|
||||
#### Tag-Filterung
|
||||
- **Mehrere Tags**: Verwende mehrere Tags für ODER-Logik (Dokument muss einen oder mehrere der Tags haben)
|
||||
- **Tag-Kombinationen**: Mische verschiedene Tag-Typen für präzise Filterung
|
||||
- **Groß-/Kleinschreibung**: Tag-Abgleich ist unabhängig von Groß-/Kleinschreibung
|
||||
- **Teilabgleich**: Exakte Übereinstimmung des Tag-Namens erforderlich
|
||||
|
||||
#### Vektorsuche-Parameter
|
||||
- **Abfragekomplexität**: Fragen in natürlicher Sprache funktionieren am besten
|
||||
- **Ergebnislimits**: Konfiguriere, wie viele Chunks abgerufen werden sollen
|
||||
- **Relevanzschwelle**: Lege minimale Ähnlichkeitswerte fest
|
||||
- **Kontextfenster**: Passe die Chunk-Größe an deinen Anwendungsfall an
|
||||
|
||||
## Integration mit Workflows
|
||||
|
||||
### Konfiguration des Wissensblocks
|
||||
1. **Wissensdatenbank auswählen**: Wähle aus, welche Wissensdatenbank durchsucht werden soll
|
||||
2. **Tags hinzufügen**: Gib Filterungs-Tags an (optional)
|
||||
3. **Anfrage eingeben**: Füge deine Suchanfrage hinzu (optional)
|
||||
4. **Ergebnisse konfigurieren**: Lege die Anzahl der abzurufenden Chunks fest
|
||||
5. **Suche testen**: Sieh dir die Ergebnisse an, bevor du sie im Workflow verwendest
|
||||
|
||||
### Dynamische Tag-Nutzung
|
||||
- **Variable Tags**: Verwenden Sie Workflow-Variablen als Tag-Werte
|
||||
- **Bedingte Filterung**: Wenden Sie verschiedene Tags basierend auf Workflow-Logik an
|
||||
- **Kontextbezogene Suche**: Passen Sie Tags basierend auf dem Gesprächskontext an
|
||||
- **Mehrstufige Filterung**: Verfeinern Sie Suchen durch Workflow-Schritte
|
||||
|
||||
### Leistungsoptimierung
|
||||
- **Effiziente Filterung**: Tag-Filterung erfolgt vor der Vektorsuche für bessere Leistung
|
||||
- **Caching**: Häufig verwendete Tag-Kombinationen werden für Geschwindigkeit zwischengespeichert
|
||||
- **Parallele Verarbeitung**: Mehrere Tag-Suchen können gleichzeitig ausgeführt werden
|
||||
- **Ressourcenmanagement**: Automatische Optimierung der Suchressourcen
|
||||
|
||||
## Erste Schritte mit Tags
|
||||
|
||||
1. **Planen Sie Ihre Tag-Struktur**: Entscheiden Sie sich für einheitliche Namenskonventionen
|
||||
2. **Beginnen Sie mit dem Taggen**: Fügen Sie Ihren vorhandenen Dokumenten relevante Tags hinzu
|
||||
3. **Testen Sie Kombinationen**: Experimentieren Sie mit Tag- und Suchanfragekombinationen
|
||||
4. **Integration in Workflows**: Verwenden Sie den Knowledge-Block mit Ihrer Tagging-Strategie
|
||||
5. **Verfeinern Sie im Laufe der Zeit**: Passen Sie Ihren Tagging-Ansatz basierend auf Suchergebnissen an
|
||||
|
||||
Tags verwandeln Ihre Wissensdatenbank von einem einfachen Dokumentenspeicher in ein präzise organisiertes, durchsuchbares Intelligenzsystem, das Ihre KI-Workflows mit chirurgischer Präzision navigieren können.
|
||||
140
apps/docs/content/docs/de/mcp/index.mdx
Normal file
140
apps/docs/content/docs/de/mcp/index.mdx
Normal file
@@ -0,0 +1,140 @@
|
||||
---
|
||||
title: MCP (Model Context Protocol)
|
||||
---
|
||||
|
||||
import { Video } from '@/components/ui/video'
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
|
||||
Das Model Context Protocol ([MCP](https://modelcontextprotocol.com/)) ermöglicht es Ihnen, externe Tools und Dienste über ein standardisiertes Protokoll zu verbinden, wodurch Sie APIs und Dienste direkt in Ihre Workflows integrieren können. Mit MCP können Sie die Fähigkeiten von Sim erweitern, indem Sie benutzerdefinierte Integrationen hinzufügen, die nahtlos mit Ihren Agenten und Workflows zusammenarbeiten.
|
||||
|
||||
## Was ist MCP?
|
||||
|
||||
MCP ist ein offener Standard, der es KI-Assistenten ermöglicht, sich sicher mit externen Datenquellen und Tools zu verbinden. Es bietet eine standardisierte Methode, um:
|
||||
|
||||
- Verbindungen zu Datenbanken, APIs und Dateisystemen herzustellen
|
||||
- Auf Echtzeitdaten von externen Diensten zuzugreifen
|
||||
- Benutzerdefinierte Tools und Skripte auszuführen
|
||||
- Sicheren, kontrollierten Zugriff auf externe Ressourcen zu gewährleisten
|
||||
|
||||
## Hinzufügen von MCP-Servern
|
||||
|
||||
MCP-Server stellen Sammlungen von Tools bereit, die Ihre Agenten nutzen können. Sie können MCP-Server auf zwei Arten hinzufügen:
|
||||
|
||||
### Über die Workspace-Einstellungen
|
||||
|
||||
Konfigurieren Sie MCP-Server auf Workspace-Ebene, damit alle Teammitglieder sie nutzen können:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="mcp-1.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
1. Navigieren Sie zu Ihren Workspace-Einstellungen
|
||||
2. Gehen Sie zum Abschnitt **MCP-Server**
|
||||
3. Klicken Sie auf **MCP-Server hinzufügen**
|
||||
4. Geben Sie die Server-Konfigurationsdetails ein
|
||||
5. Speichern Sie die Konfiguration
|
||||
|
||||
<Callout type="info">
|
||||
MCP-Server, die in den Workspace-Einstellungen konfiguriert sind, stehen allen Workspace-Mitgliedern entsprechend ihrer Berechtigungsstufen zur Verfügung.
|
||||
</Callout>
|
||||
|
||||
### Über die Agenten-Konfiguration
|
||||
|
||||
Sie können MCP-Server auch direkt innerhalb eines Agenten-Blocks hinzufügen und konfigurieren:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="mcp-2.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
Dies ist nützlich, wenn Sie schnell eine bestimmte Integration für einen speziellen Workflow einrichten müssen.
|
||||
|
||||
## Verwendung von MCP-Tools in Agenten
|
||||
|
||||
Sobald MCP-Server konfiguriert sind, werden ihre Tools innerhalb Ihrer Agentenblöcke verfügbar:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="mcp-3.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
1. Öffnen Sie einen **Agenten**-Block
|
||||
2. Im Abschnitt **Tools** sehen Sie verfügbare MCP-Tools
|
||||
3. Wählen Sie die Tools aus, die der Agent verwenden soll
|
||||
4. Der Agent kann nun während der Ausführung auf diese Tools zugreifen
|
||||
|
||||
## Eigenständiger MCP-Tool-Block
|
||||
|
||||
Für eine genauere Kontrolle können Sie den dedizierten MCP-Tool-Block verwenden, um bestimmte MCP-Tools auszuführen:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="mcp-4.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
Der MCP-Tool-Block ermöglicht es Ihnen:
|
||||
- Jedes konfigurierte MCP-Tool direkt auszuführen
|
||||
- Spezifische Parameter an das Tool zu übergeben
|
||||
- Die Ausgabe des Tools in nachfolgenden Workflow-Schritten zu verwenden
|
||||
- Mehrere MCP-Tools miteinander zu verketten
|
||||
|
||||
### Wann MCP-Tool vs. Agent verwenden
|
||||
|
||||
**Verwenden Sie einen Agenten mit MCP-Tools, wenn:**
|
||||
- Sie möchten, dass die KI entscheidet, welche Tools zu verwenden sind
|
||||
- Sie komplexe Überlegungen benötigen, wann und wie Tools eingesetzt werden sollen
|
||||
- Sie eine natürlichsprachliche Interaktion mit den Tools wünschen
|
||||
|
||||
**Verwenden Sie den MCP-Tool-Block, wenn:**
|
||||
- Sie eine deterministische Tool-Ausführung benötigen
|
||||
- Sie ein bestimmtes Tool mit bekannten Parametern ausführen möchten
|
||||
- Sie strukturierte Workflows mit vorhersehbaren Schritten erstellen
|
||||
|
||||
## Berechtigungsanforderungen
|
||||
|
||||
MCP-Funktionalität erfordert spezifische Workspace-Berechtigungen:
|
||||
|
||||
| Aktion | Erforderliche Berechtigung |
|
||||
|--------|-------------------|
|
||||
| MCP-Server in den Einstellungen konfigurieren | **Admin** |
|
||||
| MCP-Tools in Agenten verwenden | **Schreiben** oder **Admin** |
|
||||
| Verfügbare MCP-Tools anzeigen | **Lesen**, **Schreiben** oder **Admin** |
|
||||
| MCP-Tool-Blöcke ausführen | **Schreiben** oder **Admin** |
|
||||
|
||||
## Häufige Anwendungsfälle
|
||||
|
||||
### Datenbankintegration
|
||||
Verbinden Sie sich mit Datenbanken, um Daten innerhalb Ihrer Workflows abzufragen, einzufügen oder zu aktualisieren.
|
||||
|
||||
### API-Integrationen
|
||||
Greifen Sie auf externe APIs und Webdienste zu, die keine integrierten Sim-Integrationen haben.
|
||||
|
||||
### Dateisystemzugriff
|
||||
Lesen, schreiben und bearbeiten Sie Dateien auf lokalen oder entfernten Dateisystemen.
|
||||
|
||||
### Benutzerdefinierte Geschäftslogik
|
||||
Führen Sie benutzerdefinierte Skripte oder Tools aus, die auf die Bedürfnisse Ihrer Organisation zugeschnitten sind.
|
||||
|
||||
### Echtzeit-Datenzugriff
|
||||
Rufen Sie während der Workflow-Ausführung Live-Daten von externen Systemen ab.
|
||||
|
||||
## Sicherheitsüberlegungen
|
||||
|
||||
- MCP-Server laufen mit den Berechtigungen des Benutzers, der sie konfiguriert hat
|
||||
- Überprüfen Sie immer die Quellen von MCP-Servern vor der Installation
|
||||
- Verwenden Sie Umgebungsvariablen für sensible Konfigurationsdaten
|
||||
- Überprüfen Sie die Fähigkeiten des MCP-Servers, bevor Sie Agenten Zugriff gewähren
|
||||
|
||||
## Fehlerbehebung
|
||||
|
||||
### MCP-Server erscheint nicht
|
||||
- Überprüfen Sie, ob die Serverkonfiguration korrekt ist
|
||||
- Prüfen Sie, ob Sie die erforderlichen Berechtigungen haben
|
||||
- Stellen Sie sicher, dass der MCP-Server läuft und zugänglich ist
|
||||
|
||||
### Fehler bei der Tool-Ausführung
|
||||
- Überprüfen Sie, ob die Tool-Parameter korrekt formatiert sind
|
||||
- Prüfen Sie die MCP-Server-Logs auf Fehlermeldungen
|
||||
- Stellen Sie sicher, dass die erforderliche Authentifizierung konfiguriert ist
|
||||
|
||||
### Berechtigungsfehler
|
||||
- Bestätigen Sie Ihre Workspace-Berechtigungsstufe
|
||||
- Prüfen Sie, ob der MCP-Server zusätzliche Authentifizierung erfordert
|
||||
- Überprüfen Sie, ob der Server für Ihren Workspace richtig konfiguriert ist
|
||||
161
apps/docs/content/docs/de/permissions/roles-and-permissions.mdx
Normal file
161
apps/docs/content/docs/de/permissions/roles-and-permissions.mdx
Normal file
@@ -0,0 +1,161 @@
|
||||
---
|
||||
title: Rollen und Berechtigungen
|
||||
---
|
||||
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Wenn Sie Teammitglieder zu Ihrer Organisation oder Ihrem Workspace einladen, müssen Sie entscheiden, welche Zugriffsebene Sie ihnen gewähren möchten. Dieser Leitfaden erklärt, was Benutzer mit jeder Berechtigungsstufe tun können, und hilft Ihnen, Teamrollen und die Zugriffsrechte jeder Berechtigungsstufe zu verstehen.
|
||||
|
||||
## Wie man jemanden zu einem Workspace einlädt
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="invitations.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
## Berechtigungsstufen für Workspaces
|
||||
|
||||
Beim Einladen einer Person zu einem Workspace können Sie eine von drei Berechtigungsstufen zuweisen:
|
||||
|
||||
| Berechtigung | Was sie tun können |
|
||||
|------------|------------------|
|
||||
| **Lesen** | Workflows ansehen, Ausführungsergebnisse sehen, aber keine Änderungen vornehmen |
|
||||
| **Schreiben** | Workflows erstellen und bearbeiten, Workflows ausführen, Umgebungsvariablen verwalten |
|
||||
| **Admin** | Alles, was Schreiben kann, plus Benutzer einladen/entfernen und Workspace-Einstellungen verwalten |
|
||||
|
||||
## Was jede Berechtigungsstufe tun kann
|
||||
|
||||
Hier ist eine detaillierte Aufschlüsselung dessen, was Benutzer mit jeder Berechtigungsstufe tun können:
|
||||
|
||||
### Leseberechtigung
|
||||
**Perfekt für:** Stakeholder, Beobachter oder Teammitglieder, die Einblick benötigen, aber keine Änderungen vornehmen sollten
|
||||
|
||||
**Was sie tun können:**
|
||||
- Alle Workflows im Workspace ansehen
|
||||
- Workflow-Ausführungsergebnisse und Protokolle einsehen
|
||||
- Workflow-Konfigurationen und Einstellungen durchsuchen
|
||||
- Umgebungsvariablen anzeigen (aber nicht bearbeiten)
|
||||
|
||||
**Was sie nicht tun können:**
|
||||
- Workflows erstellen, bearbeiten oder löschen
|
||||
- Workflows ausführen oder bereitstellen
|
||||
- Workspace-Einstellungen ändern
|
||||
- Andere Benutzer einladen
|
||||
|
||||
### Schreibberechtigung
|
||||
**Perfekt für:** Entwickler, Content-Ersteller oder Teammitglieder, die aktiv an Automatisierungen arbeiten
|
||||
|
||||
**Was sie tun können:**
|
||||
- Alles, was Benutzer mit Leseberechtigung können, plus:
|
||||
- Workflows erstellen, bearbeiten und löschen
|
||||
- Workflows ausführen und bereitstellen
|
||||
- Workspace-Umgebungsvariablen hinzufügen, bearbeiten und löschen
|
||||
- Alle verfügbaren Tools und Integrationen nutzen
|
||||
- In Echtzeit bei der Workflow-Bearbeitung zusammenarbeiten
|
||||
|
||||
**Was sie nicht können:**
|
||||
- Benutzer zum Workspace einladen oder daraus entfernen
|
||||
- Workspace-Einstellungen ändern
|
||||
- Den Workspace löschen
|
||||
|
||||
### Admin-Berechtigung
|
||||
**Perfekt für:** Teamleiter, Projektmanager oder technische Leiter, die den Workspace verwalten müssen
|
||||
|
||||
**Was sie können:**
|
||||
- Alles, was Benutzer mit Schreibrechten können, plus:
|
||||
- Neue Benutzer mit beliebiger Berechtigungsstufe zum Workspace einladen
|
||||
- Benutzer aus dem Workspace entfernen
|
||||
- Workspace-Einstellungen und Integrationen verwalten
|
||||
- Verbindungen zu externen Tools konfigurieren
|
||||
- Von anderen Benutzern erstellte Workflows löschen
|
||||
|
||||
**Was sie nicht können:**
|
||||
- Den Workspace löschen (das kann nur der Workspace-Besitzer)
|
||||
- Den Workspace-Besitzer aus dem Workspace entfernen
|
||||
|
||||
---
|
||||
|
||||
## Workspace-Besitzer vs. Admin
|
||||
|
||||
Jeder Workspace hat einen **Besitzer** (die Person, die ihn erstellt hat) sowie eine beliebige Anzahl von **Admins**.
|
||||
|
||||
### Workspace-Besitzer
|
||||
- Hat alle Admin-Berechtigungen
|
||||
- Kann den Workspace löschen
|
||||
- Kann nicht aus dem Workspace entfernt werden
|
||||
- Kann die Eigentümerschaft an einen anderen Benutzer übertragen
|
||||
|
||||
### Workspace-Admin
|
||||
- Kann alles tun außer den Workspace löschen oder den Besitzer entfernen
|
||||
- Kann vom Besitzer oder anderen Admins aus dem Workspace entfernt werden
|
||||
|
||||
---
|
||||
|
||||
## Häufige Szenarien
|
||||
|
||||
### Einen neuen Entwickler zum Team hinzufügen
|
||||
1. **Organisationsebene**: Laden Sie ihn als **Organisationsmitglied** ein
|
||||
2. **Workspace-Ebene**: Geben Sie ihm **Schreib**-Berechtigung, damit er Workflows erstellen und bearbeiten kann
|
||||
|
||||
### Einen Projektmanager hinzufügen
|
||||
1. **Organisationsebene**: Laden Sie ihn als **Organisationsmitglied** ein
|
||||
2. **Workspace-Ebene**: Geben Sie ihm **Admin**-Berechtigung, damit er das Team verwalten und alles einsehen kann
|
||||
|
||||
### Einen Stakeholder oder Kunden hinzufügen
|
||||
1. **Organisationsebene**: Laden Sie ihn als **Organisationsmitglied** ein
|
||||
2. **Workspace-Ebene**: Geben Sie ihm **Lese**-Berechtigung, damit er den Fortschritt sehen, aber keine Änderungen vornehmen kann
|
||||
|
||||
---
|
||||
|
||||
## Umgebungsvariablen
|
||||
|
||||
Benutzer können zwei Arten von Umgebungsvariablen erstellen:
|
||||
|
||||
### Persönliche Umgebungsvariablen
|
||||
- Nur für den einzelnen Benutzer sichtbar
|
||||
- Verfügbar in allen Workflows, die sie ausführen
|
||||
- Werden in den Benutzereinstellungen verwaltet
|
||||
|
||||
### Workspace-Umgebungsvariablen
|
||||
- **Leserecht**: Kann Variablennamen und -werte sehen
|
||||
- **Schreib-/Administratorrecht**: Kann Variablen hinzufügen, bearbeiten und löschen
|
||||
- Verfügbar für alle Workspace-Mitglieder
|
||||
- Wenn eine persönliche Variable denselben Namen wie eine Workspace-Variable hat, hat die persönliche Variable Vorrang
|
||||
|
||||
---
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Mit minimalen Berechtigungen beginnen
|
||||
Geben Sie Benutzern die niedrigste Berechtigungsstufe, die sie für ihre Arbeit benötigen. Sie können die Berechtigungen später immer erhöhen.
|
||||
|
||||
### Organisationsstruktur klug nutzen
|
||||
- Machen Sie vertrauenswürdige Teamleiter zu **Organisationsadministratoren**
|
||||
- Die meisten Teammitglieder sollten **Organisationsmitglieder** sein
|
||||
- Reservieren Sie Workspace-**Admin**-Berechtigungen für Personen, die Benutzer verwalten müssen
|
||||
|
||||
### Berechtigungen regelmäßig überprüfen
|
||||
Überprüfen Sie regelmäßig, wer Zugriff auf was hat, besonders wenn Teammitglieder ihre Rollen wechseln oder das Unternehmen verlassen.
|
||||
|
||||
### Sicherheit von Umgebungsvariablen
|
||||
- Verwenden Sie persönliche Umgebungsvariablen für sensible API-Schlüssel
|
||||
- Verwenden Sie Workspace-Umgebungsvariablen für gemeinsame Konfigurationen
|
||||
- Überprüfen Sie regelmäßig, wer Zugriff auf sensible Variablen hat
|
||||
|
||||
---
|
||||
|
||||
## Organisationsrollen
|
||||
|
||||
Wenn Sie jemanden zu Ihrer Organisation einladen, können Sie eine von zwei Rollen zuweisen:
|
||||
|
||||
### Organisationsadministrator
|
||||
**Was sie tun können:**
|
||||
- Teammitglieder zur Organisation einladen und entfernen
|
||||
- Neue Workspaces erstellen
|
||||
- Abrechnungs- und Abonnementeinstellungen verwalten
|
||||
- Zugriff auf alle Workspaces innerhalb der Organisation
|
||||
|
||||
### Organisationsmitglied
|
||||
**Was sie tun können:**
|
||||
- Zugriff auf Workspaces, zu denen sie speziell eingeladen wurden
|
||||
- Liste der Organisationsmitglieder anzeigen
|
||||
- Können keine neuen Personen einladen oder Organisationseinstellungen verwalten
|
||||
758
apps/docs/content/docs/de/sdks/python.mdx
Normal file
758
apps/docs/content/docs/de/sdks/python.mdx
Normal file
@@ -0,0 +1,758 @@
|
||||
---
|
||||
title: Python
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
|
||||
Das offizielle Python SDK für Sim ermöglicht es Ihnen, Workflows programmatisch aus Ihren Python-Anwendungen mithilfe des offiziellen Python SDKs auszuführen.
|
||||
|
||||
<Callout type="info">
|
||||
Das Python SDK unterstützt Python 3.8+ mit asynchroner Ausführungsunterstützung, automatischer Ratenbegrenzung mit exponentiellem Backoff und Nutzungsverfolgung.
|
||||
</Callout>
|
||||
|
||||
## Installation
|
||||
|
||||
Installieren Sie das SDK mit pip:
|
||||
|
||||
```bash
|
||||
pip install simstudio-sdk
|
||||
```
|
||||
|
||||
## Schnellstart
|
||||
|
||||
Hier ist ein einfaches Beispiel für den Einstieg:
|
||||
|
||||
```python
|
||||
from simstudio import SimStudioClient
|
||||
|
||||
# Initialize the client
|
||||
client = SimStudioClient(
|
||||
api_key="your-api-key-here",
|
||||
base_url="https://sim.ai" # optional, defaults to https://sim.ai
|
||||
)
|
||||
|
||||
# Execute a workflow
|
||||
try:
|
||||
result = client.execute_workflow("workflow-id")
|
||||
print("Workflow executed successfully:", result)
|
||||
except Exception as error:
|
||||
print("Workflow execution failed:", error)
|
||||
```
|
||||
|
||||
## API-Referenz
|
||||
|
||||
### SimStudioClient
|
||||
|
||||
#### Konstruktor
|
||||
|
||||
```python
|
||||
SimStudioClient(api_key: str, base_url: str = "https://sim.ai")
|
||||
```
|
||||
|
||||
**Parameter:**
|
||||
- `api_key` (str): Ihr Sim API-Schlüssel
|
||||
- `base_url` (str, optional): Basis-URL für die Sim API
|
||||
|
||||
#### Methoden
|
||||
|
||||
##### execute_workflow()
|
||||
|
||||
Führt einen Workflow mit optionalen Eingabedaten aus.
|
||||
|
||||
```python
|
||||
result = client.execute_workflow(
|
||||
"workflow-id",
|
||||
input_data={"message": "Hello, world!"},
|
||||
timeout=30.0 # 30 seconds
|
||||
)
|
||||
```
|
||||
|
||||
**Parameter:**
|
||||
- `workflow_id` (str): Die ID des auszuführenden Workflows
|
||||
- `input_data` (dict, optional): Eingabedaten, die an den Workflow übergeben werden
|
||||
- `timeout` (float, optional): Timeout in Sekunden (Standard: 30.0)
|
||||
- `stream` (bool, optional): Streaming-Antworten aktivieren (Standard: False)
|
||||
- `selected_outputs` (list[str], optional): Block-Ausgaben, die im `blockName.attribute`Format gestreamt werden sollen (z.B. `["agent1.content"]`)
|
||||
- `async_execution` (bool, optional): Asynchron ausführen (Standard: False)
|
||||
|
||||
**Rückgabe:** `WorkflowExecutionResult | AsyncExecutionResult`
|
||||
|
||||
Wenn `async_execution=True`, wird sofort mit einer Task-ID zum Abfragen zurückgegeben. Andernfalls wird auf den Abschluss gewartet.
|
||||
|
||||
##### get_workflow_status()
|
||||
|
||||
Den Status eines Workflows abrufen (Bereitstellungsstatus usw.).
|
||||
|
||||
```python
|
||||
status = client.get_workflow_status("workflow-id")
|
||||
print("Is deployed:", status.is_deployed)
|
||||
```
|
||||
|
||||
**Parameter:**
|
||||
- `workflow_id` (str): Die ID des Workflows
|
||||
|
||||
**Rückgabe:** `WorkflowStatus`
|
||||
|
||||
##### validate_workflow()
|
||||
|
||||
Überprüfen, ob ein Workflow für die Ausführung bereit ist.
|
||||
|
||||
```python
|
||||
is_ready = client.validate_workflow("workflow-id")
|
||||
if is_ready:
|
||||
# Workflow is deployed and ready
|
||||
pass
|
||||
```
|
||||
|
||||
**Parameter:**
|
||||
- `workflow_id` (str): Die ID des Workflows
|
||||
|
||||
**Rückgabe:** `bool`
|
||||
|
||||
##### get_job_status()
|
||||
|
||||
Den Status einer asynchronen Job-Ausführung abrufen.
|
||||
|
||||
```python
|
||||
status = client.get_job_status("task-id-from-async-execution")
|
||||
print("Status:", status["status"]) # 'queued', 'processing', 'completed', 'failed'
|
||||
if status["status"] == "completed":
|
||||
print("Output:", status["output"])
|
||||
```
|
||||
|
||||
**Parameter:**
|
||||
- `task_id` (str): Die Task-ID, die von der asynchronen Ausführung zurückgegeben wurde
|
||||
|
||||
**Rückgabe:** `Dict[str, Any]`
|
||||
|
||||
**Antwortfelder:**
|
||||
- `success` (bool): Ob die Anfrage erfolgreich war
|
||||
- `taskId` (str): Die Task-ID
|
||||
- `status` (str): Einer der Werte `'queued'`, `'processing'`, `'completed'`, `'failed'`, `'cancelled'`
|
||||
- `metadata` (dict): Enthält `startedAt`, `completedAt` und `duration`
|
||||
- `output` (any, optional): Die Workflow-Ausgabe (wenn abgeschlossen)
|
||||
- `error` (any, optional): Fehlerdetails (wenn fehlgeschlagen)
|
||||
- `estimatedDuration` (int, optional): Geschätzte Dauer in Millisekunden (wenn in Bearbeitung/in Warteschlange)
|
||||
|
||||
##### execute_with_retry()
|
||||
|
||||
Einen Workflow mit automatischer Wiederholung bei Ratenbegrenzungsfehlern unter Verwendung von exponentiellem Backoff ausführen.
|
||||
|
||||
```python
|
||||
result = client.execute_with_retry(
|
||||
"workflow-id",
|
||||
input_data={"message": "Hello"},
|
||||
timeout=30.0,
|
||||
max_retries=3, # Maximum number of retries
|
||||
initial_delay=1.0, # Initial delay in seconds
|
||||
max_delay=30.0, # Maximum delay in seconds
|
||||
backoff_multiplier=2.0 # Exponential backoff multiplier
|
||||
)
|
||||
```
|
||||
|
||||
**Parameter:**
|
||||
- `workflow_id` (str): Die ID des auszuführenden Workflows
|
||||
- `input_data` (dict, optional): Eingabedaten, die an den Workflow übergeben werden
|
||||
- `timeout` (float, optional): Timeout in Sekunden
|
||||
- `stream` (bool, optional): Streaming-Antworten aktivieren
|
||||
- `selected_outputs` (list, optional): Block-Ausgaben zum Streamen
|
||||
- `async_execution` (bool, optional): Asynchron ausführen
|
||||
- `max_retries` (int, optional): Maximale Anzahl von Wiederholungen (Standard: 3)
|
||||
- `initial_delay` (float, optional): Anfängliche Verzögerung in Sekunden (Standard: 1.0)
|
||||
- `max_delay` (float, optional): Maximale Verzögerung in Sekunden (Standard: 30.0)
|
||||
- `backoff_multiplier` (float, optional): Backoff-Multiplikator (Standard: 2.0)
|
||||
|
||||
**Rückgabewert:** `WorkflowExecutionResult | AsyncExecutionResult`
|
||||
|
||||
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.
|
||||
|
||||
##### get_rate_limit_info()
|
||||
|
||||
Ruft die aktuellen Rate-Limit-Informationen aus der letzten API-Antwort ab.
|
||||
|
||||
```python
|
||||
rate_limit_info = client.get_rate_limit_info()
|
||||
if rate_limit_info:
|
||||
print("Limit:", rate_limit_info.limit)
|
||||
print("Remaining:", rate_limit_info.remaining)
|
||||
print("Reset:", datetime.fromtimestamp(rate_limit_info.reset))
|
||||
```
|
||||
|
||||
**Rückgabewert:** `RateLimitInfo | None`
|
||||
|
||||
##### get_usage_limits()
|
||||
|
||||
Ruft aktuelle Nutzungslimits und Kontingentinformationen für dein Konto ab.
|
||||
|
||||
```python
|
||||
limits = client.get_usage_limits()
|
||||
print("Sync requests remaining:", limits.rate_limit["sync"]["remaining"])
|
||||
print("Async requests remaining:", limits.rate_limit["async"]["remaining"])
|
||||
print("Current period cost:", limits.usage["currentPeriodCost"])
|
||||
print("Plan:", limits.usage["plan"])
|
||||
```
|
||||
|
||||
**Rückgabewert:** `UsageLimits`
|
||||
|
||||
**Antwortstruktur:**
|
||||
|
||||
```python
|
||||
{
|
||||
"success": bool,
|
||||
"rateLimit": {
|
||||
"sync": {
|
||||
"isLimited": bool,
|
||||
"limit": int,
|
||||
"remaining": int,
|
||||
"resetAt": str
|
||||
},
|
||||
"async": {
|
||||
"isLimited": bool,
|
||||
"limit": int,
|
||||
"remaining": int,
|
||||
"resetAt": str
|
||||
},
|
||||
"authType": str # 'api' or 'manual'
|
||||
},
|
||||
"usage": {
|
||||
"currentPeriodCost": float,
|
||||
"limit": float,
|
||||
"plan": str # e.g., 'free', 'pro'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
##### set_api_key()
|
||||
|
||||
Aktualisiert den API-Schlüssel.
|
||||
|
||||
```python
|
||||
client.set_api_key("new-api-key")
|
||||
```
|
||||
|
||||
##### set_base_url()
|
||||
|
||||
Aktualisiert die Basis-URL.
|
||||
|
||||
```python
|
||||
client.set_base_url("https://my-custom-domain.com")
|
||||
```
|
||||
|
||||
##### close()
|
||||
|
||||
Schließt die zugrunde liegende HTTP-Sitzung.
|
||||
|
||||
```python
|
||||
client.close()
|
||||
```
|
||||
|
||||
## Datenklassen
|
||||
|
||||
### WorkflowExecutionResult
|
||||
|
||||
```python
|
||||
@dataclass
|
||||
class WorkflowExecutionResult:
|
||||
success: bool
|
||||
output: Optional[Any] = None
|
||||
error: Optional[str] = None
|
||||
logs: Optional[List[Any]] = None
|
||||
metadata: Optional[Dict[str, Any]] = None
|
||||
trace_spans: Optional[List[Any]] = None
|
||||
total_duration: Optional[float] = None
|
||||
```
|
||||
|
||||
### AsyncExecutionResult
|
||||
|
||||
```python
|
||||
@dataclass
|
||||
class AsyncExecutionResult:
|
||||
success: bool
|
||||
task_id: str
|
||||
status: str # 'queued'
|
||||
created_at: str
|
||||
links: Dict[str, str] # e.g., {"status": "/api/jobs/{taskId}"}
|
||||
```
|
||||
|
||||
### WorkflowStatus
|
||||
|
||||
```python
|
||||
@dataclass
|
||||
class WorkflowStatus:
|
||||
is_deployed: bool
|
||||
deployed_at: Optional[str] = None
|
||||
is_published: bool = False
|
||||
needs_redeployment: bool = False
|
||||
```
|
||||
|
||||
### RateLimitInfo
|
||||
|
||||
```python
|
||||
@dataclass
|
||||
class RateLimitInfo:
|
||||
limit: int
|
||||
remaining: int
|
||||
reset: int
|
||||
retry_after: Optional[int] = None
|
||||
```
|
||||
|
||||
### UsageLimits
|
||||
|
||||
```python
|
||||
@dataclass
|
||||
class UsageLimits:
|
||||
success: bool
|
||||
rate_limit: Dict[str, Any]
|
||||
usage: Dict[str, Any]
|
||||
```
|
||||
|
||||
### SimStudioError
|
||||
|
||||
```python
|
||||
class SimStudioError(Exception):
|
||||
def __init__(self, message: str, code: Optional[str] = None, status: Optional[int] = None):
|
||||
super().__init__(message)
|
||||
self.code = code
|
||||
self.status = status
|
||||
```
|
||||
|
||||
**Häufige Fehlercodes:**
|
||||
- `UNAUTHORIZED`: Ungültiger API-Schlüssel
|
||||
- `TIMEOUT`: Zeitüberschreitung bei der Anfrage
|
||||
- `RATE_LIMIT_EXCEEDED`: Ratengrenze überschritten
|
||||
- `USAGE_LIMIT_EXCEEDED`: Nutzungsgrenze überschritten
|
||||
- `EXECUTION_ERROR`: Workflow-Ausführung fehlgeschlagen
|
||||
|
||||
## Beispiele
|
||||
|
||||
### Grundlegende Workflow-Ausführung
|
||||
|
||||
<Steps>
|
||||
<Step title="Client initialisieren">
|
||||
Richten Sie den SimStudioClient mit Ihrem API-Schlüssel ein.
|
||||
</Step>
|
||||
<Step title="Workflow validieren">
|
||||
Prüfen Sie, ob der Workflow bereitgestellt und für die Ausführung bereit ist.
|
||||
</Step>
|
||||
<Step title="Workflow ausführen">
|
||||
Führen Sie den Workflow mit Ihren Eingabedaten aus.
|
||||
</Step>
|
||||
<Step title="Ergebnis verarbeiten">
|
||||
Verarbeiten Sie das Ausführungsergebnis und behandeln Sie eventuelle Fehler.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
```python
|
||||
import os
|
||||
from simstudio import SimStudioClient
|
||||
|
||||
client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
|
||||
|
||||
def run_workflow():
|
||||
try:
|
||||
# Check if workflow is ready
|
||||
is_ready = client.validate_workflow("my-workflow-id")
|
||||
if not is_ready:
|
||||
raise Exception("Workflow is not deployed or ready")
|
||||
|
||||
# Execute the workflow
|
||||
result = client.execute_workflow(
|
||||
"my-workflow-id",
|
||||
input_data={
|
||||
"message": "Process this data",
|
||||
"user_id": "12345"
|
||||
}
|
||||
)
|
||||
|
||||
if result.success:
|
||||
print("Output:", result.output)
|
||||
print("Duration:", result.metadata.get("duration") if result.metadata else None)
|
||||
else:
|
||||
print("Workflow failed:", result.error)
|
||||
|
||||
except Exception as error:
|
||||
print("Error:", error)
|
||||
|
||||
run_workflow()
|
||||
```
|
||||
|
||||
### Fehlerbehandlung
|
||||
|
||||
Behandeln Sie verschiedene Fehlertypen, die während der Workflow-Ausführung auftreten können:
|
||||
|
||||
```python
|
||||
from simstudio import SimStudioClient, SimStudioError
|
||||
import os
|
||||
|
||||
client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
|
||||
|
||||
def execute_with_error_handling():
|
||||
try:
|
||||
result = client.execute_workflow("workflow-id")
|
||||
return result
|
||||
except SimStudioError as error:
|
||||
if error.code == "UNAUTHORIZED":
|
||||
print("Invalid API key")
|
||||
elif error.code == "TIMEOUT":
|
||||
print("Workflow execution timed out")
|
||||
elif error.code == "USAGE_LIMIT_EXCEEDED":
|
||||
print("Usage limit exceeded")
|
||||
elif error.code == "INVALID_JSON":
|
||||
print("Invalid JSON in request body")
|
||||
else:
|
||||
print(f"Workflow error: {error}")
|
||||
raise
|
||||
except Exception as error:
|
||||
print(f"Unexpected error: {error}")
|
||||
raise
|
||||
```
|
||||
|
||||
### Verwendung des Kontextmanagers
|
||||
|
||||
Verwenden Sie den Client als Kontextmanager, um die Ressourcenbereinigung automatisch zu handhaben:
|
||||
|
||||
---CODE-PLACEHOLDER-ef99d3dd509e04865d5b6b0e0e03d3f8---
|
||||
|
||||
### Batch-Workflow-Ausführung
|
||||
|
||||
Führen Sie mehrere Workflows effizient aus:
|
||||
|
||||
```python
|
||||
from simstudio import SimStudioClient
|
||||
import os
|
||||
|
||||
client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
|
||||
|
||||
def execute_workflows_batch(workflow_data_pairs):
|
||||
"""Execute multiple workflows with different input data."""
|
||||
results = []
|
||||
|
||||
for workflow_id, input_data in workflow_data_pairs:
|
||||
try:
|
||||
# Validate workflow before execution
|
||||
if not client.validate_workflow(workflow_id):
|
||||
print(f"Skipping {workflow_id}: not deployed")
|
||||
continue
|
||||
|
||||
result = client.execute_workflow(workflow_id, input_data)
|
||||
results.append({
|
||||
"workflow_id": workflow_id,
|
||||
"success": result.success,
|
||||
"output": result.output,
|
||||
"error": result.error
|
||||
})
|
||||
|
||||
except Exception as error:
|
||||
results.append({
|
||||
"workflow_id": workflow_id,
|
||||
"success": False,
|
||||
"error": str(error)
|
||||
})
|
||||
|
||||
return results
|
||||
|
||||
# Example usage
|
||||
workflows = [
|
||||
("workflow-1", {"type": "analysis", "data": "sample1"}),
|
||||
("workflow-2", {"type": "processing", "data": "sample2"}),
|
||||
]
|
||||
|
||||
results = execute_workflows_batch(workflows)
|
||||
for result in results:
|
||||
print(f"Workflow {result['workflow_id']}: {'Success' if result['success'] else 'Failed'}")
|
||||
```
|
||||
|
||||
### Asynchrone Workflow-Ausführung
|
||||
|
||||
Führen Sie Workflows asynchron für lang laufende Aufgaben aus:
|
||||
|
||||
```python
|
||||
import os
|
||||
import time
|
||||
from simstudio import SimStudioClient
|
||||
|
||||
client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
|
||||
|
||||
def execute_async():
|
||||
try:
|
||||
# Start async execution
|
||||
result = client.execute_workflow(
|
||||
"workflow-id",
|
||||
input_data={"data": "large dataset"},
|
||||
async_execution=True # Execute asynchronously
|
||||
)
|
||||
|
||||
# Check if result is an async execution
|
||||
if hasattr(result, 'task_id'):
|
||||
print(f"Task ID: {result.task_id}")
|
||||
print(f"Status endpoint: {result.links['status']}")
|
||||
|
||||
# Poll for completion
|
||||
status = client.get_job_status(result.task_id)
|
||||
|
||||
while status["status"] in ["queued", "processing"]:
|
||||
print(f"Current status: {status['status']}")
|
||||
time.sleep(2) # Wait 2 seconds
|
||||
status = client.get_job_status(result.task_id)
|
||||
|
||||
if status["status"] == "completed":
|
||||
print("Workflow completed!")
|
||||
print(f"Output: {status['output']}")
|
||||
print(f"Duration: {status['metadata']['duration']}")
|
||||
else:
|
||||
print(f"Workflow failed: {status['error']}")
|
||||
|
||||
except Exception as error:
|
||||
print(f"Error: {error}")
|
||||
|
||||
execute_async()
|
||||
```
|
||||
|
||||
### Rate-Limiting und Wiederholungsversuche
|
||||
|
||||
Behandle Rate-Limits automatisch mit exponentiellem Backoff:
|
||||
|
||||
```python
|
||||
import os
|
||||
from simstudio import SimStudioClient, SimStudioError
|
||||
|
||||
client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
|
||||
|
||||
def execute_with_retry_handling():
|
||||
try:
|
||||
# Automatically retries on rate limit
|
||||
result = client.execute_with_retry(
|
||||
"workflow-id",
|
||||
input_data={"message": "Process this"},
|
||||
max_retries=5,
|
||||
initial_delay=1.0,
|
||||
max_delay=60.0,
|
||||
backoff_multiplier=2.0
|
||||
)
|
||||
|
||||
print(f"Success: {result}")
|
||||
except SimStudioError as error:
|
||||
if error.code == "RATE_LIMIT_EXCEEDED":
|
||||
print("Rate limit exceeded after all retries")
|
||||
|
||||
# Check rate limit info
|
||||
rate_limit_info = client.get_rate_limit_info()
|
||||
if rate_limit_info:
|
||||
from datetime import datetime
|
||||
reset_time = datetime.fromtimestamp(rate_limit_info.reset)
|
||||
print(f"Rate limit resets at: {reset_time}")
|
||||
|
||||
execute_with_retry_handling()
|
||||
```
|
||||
|
||||
### Nutzungsüberwachung
|
||||
|
||||
Überwache deine Kontonutzung und -limits:
|
||||
|
||||
```python
|
||||
import os
|
||||
from simstudio import SimStudioClient
|
||||
|
||||
client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
|
||||
|
||||
def check_usage():
|
||||
try:
|
||||
limits = client.get_usage_limits()
|
||||
|
||||
print("=== Rate Limits ===")
|
||||
print("Sync requests:")
|
||||
print(f" Limit: {limits.rate_limit['sync']['limit']}")
|
||||
print(f" Remaining: {limits.rate_limit['sync']['remaining']}")
|
||||
print(f" Resets at: {limits.rate_limit['sync']['resetAt']}")
|
||||
print(f" Is limited: {limits.rate_limit['sync']['isLimited']}")
|
||||
|
||||
print("\nAsync requests:")
|
||||
print(f" Limit: {limits.rate_limit['async']['limit']}")
|
||||
print(f" Remaining: {limits.rate_limit['async']['remaining']}")
|
||||
print(f" Resets at: {limits.rate_limit['async']['resetAt']}")
|
||||
print(f" Is limited: {limits.rate_limit['async']['isLimited']}")
|
||||
|
||||
print("\n=== Usage ===")
|
||||
print(f"Current period cost: ${limits.usage['currentPeriodCost']:.2f}")
|
||||
print(f"Limit: ${limits.usage['limit']:.2f}")
|
||||
print(f"Plan: {limits.usage['plan']}")
|
||||
|
||||
percent_used = (limits.usage['currentPeriodCost'] / limits.usage['limit']) * 100
|
||||
print(f"Usage: {percent_used:.1f}%")
|
||||
|
||||
if percent_used > 80:
|
||||
print("⚠️ Warning: You are approaching your usage limit!")
|
||||
|
||||
except Exception as error:
|
||||
print(f"Error checking usage: {error}")
|
||||
|
||||
check_usage()
|
||||
```
|
||||
|
||||
### Streaming-Workflow-Ausführung
|
||||
|
||||
Führe Workflows mit Echtzeit-Streaming-Antworten aus:
|
||||
|
||||
```python
|
||||
from simstudio import SimStudioClient
|
||||
import os
|
||||
|
||||
client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
|
||||
|
||||
def execute_with_streaming():
|
||||
"""Execute workflow with streaming enabled."""
|
||||
try:
|
||||
# Enable streaming for specific block outputs
|
||||
result = client.execute_workflow(
|
||||
"workflow-id",
|
||||
input_data={"message": "Count to five"},
|
||||
stream=True,
|
||||
selected_outputs=["agent1.content"] # Use blockName.attribute format
|
||||
)
|
||||
|
||||
print("Workflow result:", result)
|
||||
except Exception as error:
|
||||
print("Error:", error)
|
||||
|
||||
execute_with_streaming()
|
||||
```
|
||||
|
||||
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":", two"}
|
||||
|
||||
data: {"event":"done","success":true,"output":{},"metadata":{"duration":610}}
|
||||
|
||||
data: [DONE]
|
||||
```
|
||||
|
||||
**Flask-Streaming-Beispiel:**
|
||||
|
||||
```python
|
||||
from flask import Flask, Response, stream_with_context
|
||||
import requests
|
||||
import json
|
||||
import os
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/stream-workflow')
|
||||
def stream_workflow():
|
||||
"""Stream workflow execution to the client."""
|
||||
|
||||
def generate():
|
||||
response = requests.post(
|
||||
'https://sim.ai/api/workflows/WORKFLOW_ID/execute',
|
||||
headers={
|
||||
'Content-Type': 'application/json',
|
||||
'X-API-Key': os.getenv('SIM_API_KEY')
|
||||
},
|
||||
json={
|
||||
'message': 'Generate a story',
|
||||
'stream': True,
|
||||
'selectedOutputs': ['agent1.content']
|
||||
},
|
||||
stream=True
|
||||
)
|
||||
|
||||
for line in response.iter_lines():
|
||||
if line:
|
||||
decoded_line = line.decode('utf-8')
|
||||
if decoded_line.startswith('data: '):
|
||||
data = decoded_line[6:] # Remove 'data: ' prefix
|
||||
|
||||
if data == '[DONE]':
|
||||
break
|
||||
|
||||
try:
|
||||
parsed = json.loads(data)
|
||||
if 'chunk' in parsed:
|
||||
yield f"data: {json.dumps(parsed)}\n\n"
|
||||
elif parsed.get('event') == 'done':
|
||||
yield f"data: {json.dumps(parsed)}\n\n"
|
||||
print("Execution complete:", parsed.get('metadata'))
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
|
||||
return Response(
|
||||
stream_with_context(generate()),
|
||||
mimetype='text/event-stream'
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
```
|
||||
|
||||
### Umgebungskonfiguration
|
||||
|
||||
Konfiguriere den Client mit Umgebungsvariablen:
|
||||
|
||||
<Tabs items={['Development', 'Production']}>
|
||||
<Tab value="Development">
|
||||
|
||||
```python
|
||||
import os
|
||||
from simstudio import SimStudioClient
|
||||
|
||||
# Development configuration
|
||||
client = SimStudioClient(
|
||||
api_key=os.getenv("SIM_API_KEY")
|
||||
base_url=os.getenv("SIM_BASE_URL", "https://sim.ai")
|
||||
)
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="Production">
|
||||
|
||||
```python
|
||||
import os
|
||||
from simstudio import SimStudioClient
|
||||
|
||||
# Production configuration with error handling
|
||||
api_key = os.getenv("SIM_API_KEY")
|
||||
if not api_key:
|
||||
raise ValueError("SIM_API_KEY environment variable is required")
|
||||
|
||||
client = SimStudioClient(
|
||||
api_key=api_key,
|
||||
base_url=os.getenv("SIM_BASE_URL", "https://sim.ai")
|
||||
)
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## API-Schlüssel erhalten
|
||||
|
||||
<Steps>
|
||||
<Step title="Bei Sim anmelden">
|
||||
Navigiere zu [Sim](https://sim.ai) und melde dich bei deinem Konto an.
|
||||
</Step>
|
||||
<Step title="Öffne deinen Workflow">
|
||||
Navigiere zu dem Workflow, den du programmatisch ausführen möchtest.
|
||||
</Step>
|
||||
<Step title="Deploye deinen Workflow">
|
||||
Klicke auf "Deploy", um deinen Workflow zu deployen, falls dies noch nicht geschehen ist.
|
||||
</Step>
|
||||
<Step title="Erstelle oder wähle einen API-Schlüssel">
|
||||
Wähle während des Deployment-Prozesses einen API-Schlüssel aus oder erstelle einen neuen.
|
||||
</Step>
|
||||
<Step title="Kopiere den API-Schlüssel">
|
||||
Kopiere den API-Schlüssel zur Verwendung in deiner Python-Anwendung.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Anforderungen
|
||||
|
||||
- Python 3.8+
|
||||
- requests >= 2.25.0
|
||||
|
||||
## Lizenz
|
||||
|
||||
Apache-2.0
|
||||
1053
apps/docs/content/docs/de/sdks/typescript.mdx
Normal file
1053
apps/docs/content/docs/de/sdks/typescript.mdx
Normal file
File diff suppressed because it is too large
Load Diff
161
apps/docs/content/docs/de/tools/airtable.mdx
Normal file
161
apps/docs/content/docs/de/tools/airtable.mdx
Normal file
@@ -0,0 +1,161 @@
|
||||
---
|
||||
title: Airtable
|
||||
description: Airtable lesen, erstellen und aktualisieren
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="airtable"
|
||||
color="#E0E0E0"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
|
||||
|
||||
viewBox='0 -20.5 256 256'
|
||||
version='1.1'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
xmlnsXlink='http://www.w3.org/1999/xlink'
|
||||
preserveAspectRatio='xMidYMid'
|
||||
>
|
||||
<g>
|
||||
<path
|
||||
d='M114.25873,2.70101695 L18.8604023,42.1756384 C13.5552723,44.3711638 13.6102328,51.9065311 18.9486282,54.0225085 L114.746142,92.0117514 C123.163769,95.3498757 132.537419,95.3498757 140.9536,92.0117514 L236.75256,54.0225085 C242.08951,51.9065311 242.145916,44.3711638 236.83934,42.1756384 L141.442459,2.70101695 C132.738459,-0.900338983 122.961284,-0.900338983 114.25873,2.70101695'
|
||||
fill='#FFBF00'
|
||||
/>
|
||||
<path
|
||||
d='M136.349071,112.756863 L136.349071,207.659101 C136.349071,212.173089 140.900664,215.263892 145.096461,213.600615 L251.844122,172.166219 C254.281184,171.200072 255.879376,168.845451 255.879376,166.224705 L255.879376,71.3224678 C255.879376,66.8084791 251.327783,63.7176768 247.131986,65.3809537 L140.384325,106.815349 C137.94871,107.781496 136.349071,110.136118 136.349071,112.756863'
|
||||
fill='#26B5F8'
|
||||
/>
|
||||
<path
|
||||
d='M111.422771,117.65355 L79.742409,132.949912 L76.5257763,134.504714 L9.65047684,166.548104 C5.4112904,168.593211 0.000578531073,165.503855 0.000578531073,160.794612 L0.000578531073,71.7210757 C0.000578531073,70.0173017 0.874160452,68.5463864 2.04568588,67.4384994 C2.53454463,66.9481944 3.08848814,66.5446689 3.66412655,66.2250305 C5.26231864,65.2661153 7.54173107,65.0101153 9.47981017,65.7766689 L110.890522,105.957098 C116.045234,108.002206 116.450206,115.225166 111.422771,117.65355'
|
||||
fill='#ED3049'
|
||||
/>
|
||||
<path
|
||||
d='M111.422771,117.65355 L79.742409,132.949912 L2.04568588,67.4384994 C2.53454463,66.9481944 3.08848814,66.5446689 3.66412655,66.2250305 C5.26231864,65.2661153 7.54173107,65.0101153 9.47981017,65.7766689 L110.890522,105.957098 C116.045234,108.002206 116.450206,115.225166 111.422771,117.65355'
|
||||
fillOpacity='0.25'
|
||||
fill='#000000'
|
||||
/>
|
||||
</g>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[Airtable](https://airtable.com/) ist eine leistungsstarke cloudbasierte Plattform, die die Funktionalität einer Datenbank mit der Einfachheit einer Tabellenkalkulation verbindet. Sie ermöglicht Benutzern, flexible Datenbanken zur Organisation, Speicherung und Zusammenarbeit an Informationen zu erstellen.
|
||||
|
||||
Mit Airtable können Sie:
|
||||
|
||||
- **Benutzerdefinierte Datenbanken erstellen**: Maßgeschneiderte Lösungen für Projektmanagement, Content-Kalender, Bestandsverfolgung und mehr entwickeln
|
||||
- **Daten visualisieren**: Ihre Informationen als Raster, Kanban-Board, Kalender oder Galerie anzeigen
|
||||
- **Arbeitsabläufe automatisieren**: Auslöser und Aktionen einrichten, um wiederkehrende Aufgaben zu automatisieren
|
||||
- **Mit anderen Tools integrieren**: Verbindung zu Hunderten anderer Anwendungen durch native Integrationen und APIs herstellen
|
||||
|
||||
In Sim ermöglicht die Airtable-Integration Ihren Agenten, programmatisch mit Ihren Airtable-Basen zu interagieren. Dies erlaubt nahtlose Datenoperationen wie das Abrufen von Informationen, Erstellen neuer Datensätze und Aktualisieren vorhandener Daten - alles innerhalb Ihrer Agenten-Workflows. Nutzen Sie Airtable als dynamische Datenquelle oder -ziel für Ihre Agenten, sodass sie im Rahmen ihrer Entscheidungsfindung und Aufgabenausführung auf strukturierte Informationen zugreifen und diese bearbeiten können.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Nutzungsanweisungen
|
||||
|
||||
Integriert Airtable in den Workflow. Kann Airtable-Datensätze erstellen, abrufen, auflisten oder aktualisieren. Erfordert OAuth. Kann im Trigger-Modus verwendet werden, um einen Workflow auszulösen, wenn eine Aktualisierung an einer Airtable-Tabelle vorgenommen wird.
|
||||
|
||||
## Tools
|
||||
|
||||
### `airtable_list_records`
|
||||
|
||||
Datensätze aus einer Airtable-Tabelle lesen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `baseId` | string | Ja | ID der Airtable-Basis |
|
||||
| `tableId` | string | Ja | ID der Tabelle |
|
||||
| `maxRecords` | number | Nein | Maximale Anzahl der zurückzugebenden Datensätze |
|
||||
| `filterFormula` | string | Nein | Formel zum Filtern von Datensätzen \(z.B. "\(\{Feldname\} = \'Wert\'\)"\) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `records` | json | Array der abgerufenen Airtable-Datensätze |
|
||||
|
||||
### `airtable_get_record`
|
||||
|
||||
Einen einzelnen Datensatz aus einer Airtable-Tabelle anhand seiner ID abrufen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `baseId` | string | Ja | ID der Airtable-Basis |
|
||||
| `tableId` | string | Ja | ID oder Name der Tabelle |
|
||||
| `recordId` | string | Ja | ID des abzurufenden Datensatzes |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `record` | json | Abgerufener Airtable-Datensatz mit id, createdTime und fields |
|
||||
| `metadata` | json | Operationsmetadaten einschließlich Datensatzanzahl |
|
||||
|
||||
### `airtable_create_records`
|
||||
|
||||
Neue Datensätze in eine Airtable-Tabelle schreiben
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `baseId` | string | Ja | ID der Airtable-Basis |
|
||||
| `tableId` | string | Ja | ID oder Name der Tabelle |
|
||||
| `records` | json | Ja | Array von zu erstellenden Datensätzen, jeder mit einem `fields` Objekt |
|
||||
| `fields` | string | Nein | Keine Beschreibung |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `records` | json | Array der erstellten Airtable-Datensätze |
|
||||
|
||||
### `airtable_update_record`
|
||||
|
||||
Einen vorhandenen Datensatz in einer Airtable-Tabelle nach ID aktualisieren
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `baseId` | string | Ja | ID der Airtable-Basis |
|
||||
| `tableId` | string | Ja | ID oder Name der Tabelle |
|
||||
| `recordId` | string | Ja | ID des zu aktualisierenden Datensatzes |
|
||||
| `fields` | json | Ja | Ein Objekt, das die Feldnamen und ihre neuen Werte enthält |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `record` | json | Aktualisierter Airtable-Datensatz mit ID, Erstellungszeit und Feldern |
|
||||
| `metadata` | json | Operationsmetadaten einschließlich Datensatzanzahl und aktualisierter Feldnamen |
|
||||
|
||||
### `airtable_update_multiple_records`
|
||||
|
||||
Mehrere vorhandene Datensätze in einer Airtable-Tabelle aktualisieren
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `baseId` | string | Ja | ID der Airtable-Basis |
|
||||
| `tableId` | string | Ja | ID oder Name der Tabelle |
|
||||
| `records` | json | Ja | Array von zu aktualisierenden Datensätzen, jeder mit einer `id` und einem `fields`-Objekt |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `records` | json | Array der aktualisierten Airtable-Datensätze |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `airtable`
|
||||
109
apps/docs/content/docs/de/tools/arxiv.mdx
Normal file
109
apps/docs/content/docs/de/tools/arxiv.mdx
Normal file
@@ -0,0 +1,109 @@
|
||||
---
|
||||
title: ArXiv
|
||||
description: Suche und rufe wissenschaftliche Arbeiten von ArXiv ab
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="arxiv"
|
||||
color="#E0E0E0"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon" id='logomark' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17.732 24.269'>
|
||||
<g id='tiny'>
|
||||
<path
|
||||
d='M573.549,280.916l2.266,2.738,6.674-7.84c.353-.47.52-.717.353-1.117a1.218,1.218,0,0,0-1.061-.748h0a.953.953,0,0,0-.712.262Z'
|
||||
transform='translate(-566.984 -271.548)'
|
||||
fill='#bdb9b4'
|
||||
/>
|
||||
<path
|
||||
d='M579.525,282.225l-10.606-10.174a1.413,1.413,0,0,0-.834-.5,1.09,1.09,0,0,0-1.027.66c-.167.4-.047.681.319,1.206l8.44,10.242h0l-6.282,7.716a1.336,1.336,0,0,0-.323,1.3,1.114,1.114,0,0,0,1.04.69A.992.992,0,0,0,571,293l8.519-7.92A1.924,1.924,0,0,0,579.525,282.225Z'
|
||||
transform='translate(-566.984 -271.548)'
|
||||
fill='#b31b1b'
|
||||
/>
|
||||
<path
|
||||
d='M584.32,293.912l-8.525-10.275,0,0L573.53,280.9l-1.389,1.254a2.063,2.063,0,0,0,0,2.965l10.812,10.419a.925.925,0,0,0,.742.282,1.039,1.039,0,0,0,.953-.667A1.261,1.261,0,0,0,584.32,293.912Z'
|
||||
transform='translate(-566.984 -271.548)'
|
||||
fill='#bdb9b4'
|
||||
/>
|
||||
</g>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[ArXiv](https://arxiv.org/) ist ein kostenfreies, frei zugängliches Repository für wissenschaftliche Forschungsarbeiten in Bereichen wie Physik, Mathematik, Informatik, quantitative Biologie, quantitative Finanzwissenschaft, Statistik, Elektrotechnik, Systemwissenschaften und Wirtschaftswissenschaften. ArXiv bietet eine umfangreiche Sammlung von Preprints und veröffentlichten Artikeln und ist damit eine primäre Ressource für Forscher und Praktiker weltweit.
|
||||
|
||||
Mit ArXiv können Sie:
|
||||
|
||||
- **Nach wissenschaftlichen Arbeiten suchen**: Finden Sie Forschungsarbeiten anhand von Schlüsselwörtern, Autorennamen, Titeln, Kategorien und mehr
|
||||
- **Metadaten von Arbeiten abrufen**: Zugriff auf Abstracts, Autorenlisten, Veröffentlichungsdaten und andere bibliografische Informationen
|
||||
- **Volltext-PDFs herunterladen**: Erhalten Sie den vollständigen Text der meisten Arbeiten für eingehende Studien
|
||||
- **Autorenbeiträge erkunden**: Sehen Sie alle Arbeiten eines bestimmten Autors
|
||||
- **Auf dem Laufenden bleiben**: Entdecken Sie die neuesten Einreichungen und Trendthemen in Ihrem Fachgebiet
|
||||
|
||||
In Sim ermöglicht die ArXiv-Integration Ihren Agenten, wissenschaftliche Arbeiten von ArXiv programmatisch zu suchen, abzurufen und zu analysieren. Dies erlaubt Ihnen, Literaturrecherchen zu automatisieren, Forschungsassistenten zu erstellen oder aktuelles wissenschaftliches Wissen in Ihre agentischen Workflows einzubinden. Nutzen Sie ArXiv als dynamische Datenquelle für Forschung, Entdeckung und Wissensextraktion innerhalb Ihrer Sim-Projekte.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Nutzungsanleitung
|
||||
|
||||
Integriert ArXiv in den Workflow. Kann nach Arbeiten suchen, Arbeitsdetails abrufen und Autorenarbeiten finden. Benötigt kein OAuth oder einen API-Schlüssel.
|
||||
|
||||
## Tools
|
||||
|
||||
### `arxiv_search`
|
||||
|
||||
Suche nach wissenschaftlichen Artikeln auf ArXiv nach Schlüsselwörtern, Autoren, Titeln oder anderen Feldern.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `searchQuery` | string | Ja | Die auszuführende Suchanfrage |
|
||||
| `searchField` | string | Nein | Feld, in dem gesucht werden soll: all, ti \(Titel\), au \(Autor\), abs \(Abstract\), co \(Kommentar\), jr \(Journal\), cat \(Kategorie\), rn \(Berichtsnummer\) |
|
||||
| `maxResults` | number | Nein | Maximale Anzahl der zurückzugebenden Ergebnisse \(Standard: 10, max: 2000\) |
|
||||
| `sortBy` | string | Nein | Sortieren nach: relevance, lastUpdatedDate, submittedDate \(Standard: relevance\) |
|
||||
| `sortOrder` | string | Nein | Sortierreihenfolge: ascending, descending \(Standard: descending\) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `papers` | json | Array von Artikeln, die der Suchanfrage entsprechen |
|
||||
|
||||
### `arxiv_get_paper`
|
||||
|
||||
Erhalte detaillierte Informationen über einen bestimmten ArXiv-Artikel anhand seiner ID.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `paperId` | string | Ja | ArXiv-Artikel-ID \(z.B. "1706.03762"\) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `paper` | json | Detaillierte Informationen über den angeforderten ArXiv-Artikel |
|
||||
|
||||
### `arxiv_get_author_papers`
|
||||
|
||||
Suche nach Artikeln eines bestimmten Autors auf ArXiv.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `authorName` | string | Ja | Zu suchender Autorenname |
|
||||
| `maxResults` | number | Nein | Maximale Anzahl der zurückzugebenden Ergebnisse \(Standard: 10, max: 2000\) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `authorPapers` | json | Array von Publikationen, die vom angegebenen Autor verfasst wurden |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `arxiv`
|
||||
90
apps/docs/content/docs/de/tools/browser_use.mdx
Normal file
90
apps/docs/content/docs/de/tools/browser_use.mdx
Normal file
@@ -0,0 +1,90 @@
|
||||
---
|
||||
title: Browser-Nutzung
|
||||
description: Browser-Automatisierungsaufgaben ausführen
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="browser_use"
|
||||
color="#E0E0E0"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
version='1.0'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
|
||||
|
||||
viewBox='0 0 150 150'
|
||||
preserveAspectRatio='xMidYMid meet'
|
||||
>
|
||||
<g transform='translate(0,150) scale(0.05,-0.05)' fill='#000000' stroke='none'>
|
||||
<path
|
||||
d='M786 2713 c-184 -61 -353 -217 -439 -405 -76 -165 -65 -539 19 -666
|
||||
l57 -85 -48 -124 c-203 -517 -79 -930 346 -1155 159 -85 441 -71 585 28 l111
|
||||
77 196 -76 c763 -293 1353 304 1051 1063 -77 191 -77 189 -14 282 163 239 97
|
||||
660 -140 893 -235 231 -528 256 -975 83 l-96 -37 -121 67 c-144 79 -383 103
|
||||
-532 55z m459 -235 c88 -23 96 -51 22 -79 -29 -11 -84 -47 -121 -80 -57 -50
|
||||
-84 -59 -178 -59 -147 0 -190 -44 -238 -241 -102 -424 -230 -440 -230 -29 1
|
||||
417 289 606 745 488z m1046 -18 c174 -85 266 -309 239 -582 -26 -256 -165
|
||||
-165 -230 151 -73 356 -469 332 -954 -58 -587 -472 -829 -1251 -388 -1251 108
|
||||
0 126 -7 214 -80 54 -44 104 -80 113 -80 54 0 -2 -43 -89 -69 -220 -66 -426
|
||||
-22 -568 120 -599 599 871 2232 1663 1849z m-234 -510 c969 -1036 357 -1962
|
||||
-787 -1190 -254 171 -348 303 -323 454 21 128 40 123 231 -59 691 -658 1362
|
||||
-583 1052 117 -106 239 -366 585 -504 671 l-72 44 98 45 c150 68 169 63 305
|
||||
-82z m-329 -310 c161 -184 163 -160 -30 -338 -188 -173 -180 -173 -386 19
|
||||
-163 153 -163 157 7 324 218 213 219 213 409 -5z m354 -375 c92 -239 -179
|
||||
-462 -377 -309 l-46 35 186 163 c211 186 209 185 237 111z'
|
||||
/>
|
||||
</g>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[BrowserUse](https://browser-use.com/) ist eine leistungsstarke Browser-Automatisierungsplattform, die es ermöglicht, Browser-Aufgaben programmatisch zu erstellen und auszuführen. Sie bietet eine Möglichkeit, Webinteraktionen durch natürlichsprachliche Anweisungen zu automatisieren, sodass Sie Websites navigieren, Formulare ausfüllen, Daten extrahieren und komplexe Aktionssequenzen durchführen können, ohne Code zu schreiben.
|
||||
|
||||
Mit BrowserUse können Sie:
|
||||
|
||||
- **Webinteraktionen automatisieren**: Zu Websites navigieren, Buttons klicken, Formulare ausfüllen und andere Browser-Aktionen durchführen
|
||||
- **Daten extrahieren**: Inhalte von Websites extrahieren, einschließlich Text, Bilder und strukturierte Daten
|
||||
- **Komplexe Workflows ausführen**: Mehrere Aktionen verketten, um anspruchsvolle Web-Aufgaben zu erledigen
|
||||
- **Aufgabenausführung überwachen**: Browser-Aufgaben in Echtzeit mit visuellem Feedback beobachten
|
||||
- **Ergebnisse programmatisch verarbeiten**: Strukturierte Ausgaben von Web-Automatisierungsaufgaben erhalten
|
||||
|
||||
In Sim ermöglicht die BrowserUse-Integration Ihren Agenten, mit dem Web zu interagieren, als wären sie menschliche Benutzer. Dies ermöglicht Szenarien wie Recherche, Datenerfassung, Formularübermittlung und Web-Tests - alles durch einfache natürlichsprachliche Anweisungen. Ihre Agenten können Informationen von Websites sammeln, mit Webanwendungen interagieren und Aktionen durchführen, die normalerweise manuelles Browsen erfordern würden, wodurch ihre Fähigkeiten erweitert werden, um das gesamte Web als Ressource einzubeziehen.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Nutzungsanleitung
|
||||
|
||||
Integrieren Sie Browser Use in den Workflow. Kann im Web navigieren und Aktionen ausführen, als ob ein echter Benutzer mit dem Browser interagieren würde. Erfordert API-Schlüssel.
|
||||
|
||||
## Tools
|
||||
|
||||
### `browser_use_run_task`
|
||||
|
||||
Führt eine Browser-Automatisierungsaufgabe mit BrowserUse aus
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `task` | string | Ja | Was der Browser-Agent tun soll |
|
||||
| `variables` | json | Nein | Optionale Variablen zur Verwendung als Secrets \(Format: \{key: value\}\) |
|
||||
| `format` | string | Nein | Keine Beschreibung |
|
||||
| `save_browser_data` | boolean | Nein | Ob Browser-Daten gespeichert werden sollen |
|
||||
| `model` | string | Nein | Zu verwendende LLM-Modell \(Standard: gpt-4o\) |
|
||||
| `apiKey` | string | Ja | API-Schlüssel für die BrowserUse API |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `id` | string | Aufgabenausführungskennung |
|
||||
| `success` | boolean | Status der Aufgabenfertigstellung |
|
||||
| `output` | json | Ausgabedaten der Aufgabe |
|
||||
| `steps` | json | Ausgeführte Schritte |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `browser_use`
|
||||
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`
|
||||
97
apps/docs/content/docs/de/tools/confluence.mdx
Normal file
97
apps/docs/content/docs/de/tools/confluence.mdx
Normal file
@@ -0,0 +1,97 @@
|
||||
---
|
||||
title: Confluence
|
||||
description: Mit Confluence interagieren
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="confluence"
|
||||
color="#E0E0E0"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
|
||||
|
||||
viewBox='0 3 21 24'
|
||||
focusable='false'
|
||||
fill='none'
|
||||
aria-hidden='true'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
>
|
||||
<path
|
||||
fill='#1868DB'
|
||||
d='M20.602 20.234c-6.584-3.183-8.507-3.66-11.281-3.66-3.255 0-6.03 1.355-8.507 5.16l-.407.622c-.333.513-.407.696-.407.915s.111.403.518.659l4.18 2.598c.221.146.406.22.591.22.222 0 .37-.11.592-.44l.666-1.024c1.035-1.574 1.96-2.086 3.144-2.086 1.035 0 2.256.293 3.772 1.025l4.365 2.049c.444.22.925.11 1.146-.403l2.072-4.537c.222-.512.074-.842-.444-1.098M1.406 12.22c6.583 3.184 8.507 3.66 11.28 3.66 3.256 0 6.03-1.354 8.508-5.16l.407-.622c.332-.512.406-.695.406-.915s-.11-.402-.518-.658L17.31 5.927c-.222-.147-.407-.22-.592-.22-.222 0-.37.11-.592.44l-.665 1.024c-1.036 1.573-1.96 2.086-3.144 2.086-1.036 0-2.257-.293-3.773-1.025L4.18 6.183c-.444-.22-.925-.11-1.147.402L.962 11.123c-.222.512-.074.841.444 1.098'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[Confluence](https://www.atlassian.com/software/confluence) ist Atlassians leistungsstarke Plattform für Teamzusammenarbeit und Wissensmanagement. Sie dient als zentraler Arbeitsbereich, in dem Teams Informationen über Abteilungen und Organisationen hinweg erstellen, organisieren und teilen können.
|
||||
|
||||
Mit Confluence können Sie:
|
||||
|
||||
- **Strukturierte Dokumentation erstellen**: Umfassende Wikis, Projektpläne und Wissensbasen mit umfangreicher Formatierung aufbauen
|
||||
- **In Echtzeit zusammenarbeiten**: Gemeinsam mit Teammitgliedern an Dokumenten arbeiten, mit Kommentaren, Erwähnungen und Bearbeitungsfunktionen
|
||||
- **Informationen hierarchisch organisieren**: Inhalte mit Bereichen, Seiten und verschachtelten Hierarchien für intuitive Navigation strukturieren
|
||||
- **Mit anderen Tools integrieren**: Verbindung mit Jira, Trello und anderen Atlassian-Produkten für nahtlose Workflow-Integration
|
||||
- **Zugriffsberechtigungen kontrollieren**: Verwalten, wer bestimmte Inhalte ansehen, bearbeiten oder kommentieren kann
|
||||
|
||||
In Sim ermöglicht die Confluence-Integration Ihren Agenten den Zugriff auf die Wissensdatenbank Ihrer Organisation. Agenten können Informationen von Confluence-Seiten abrufen, nach bestimmten Inhalten suchen und bei Bedarf sogar Dokumentationen aktualisieren. Dies ermöglicht es Ihren Workflows, das in Ihrer Confluence-Instanz gespeicherte kollektive Wissen zu nutzen und Agenten zu erstellen, die auf interne Dokumentationen verweisen, etablierte Verfahren befolgen und aktuelle Informationsressourcen als Teil ihrer Tätigkeiten pflegen können.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Nutzungsanweisungen
|
||||
|
||||
Integriert Confluence in den Workflow. Kann Seiten lesen und aktualisieren. Erfordert OAuth.
|
||||
|
||||
## Tools
|
||||
|
||||
### `confluence_retrieve`
|
||||
|
||||
Ruft Inhalte von Confluence-Seiten über die Confluence-API ab.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `domain` | string | Ja | Ihre Confluence-Domain (z.B. ihrfirma.atlassian.net) |
|
||||
| `pageId` | string | Ja | Confluence-Seiten-ID zum Abrufen |
|
||||
| `cloudId` | string | Nein | Confluence Cloud-ID für die Instanz. Wenn nicht angegeben, wird sie über die Domain abgerufen. |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `ts` | string | Zeitstempel des Abrufs |
|
||||
| `pageId` | string | Confluence-Seiten-ID |
|
||||
| `content` | string | Seiteninhalt ohne HTML-Tags |
|
||||
| `title` | string | Seitentitel |
|
||||
|
||||
### `confluence_update`
|
||||
|
||||
Aktualisiert eine Confluence-Seite über die Confluence-API.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `domain` | string | Ja | Ihre Confluence-Domain (z.B. ihrfirma.atlassian.net) |
|
||||
| `pageId` | string | Ja | Confluence-Seiten-ID zum Aktualisieren |
|
||||
| `title` | string | Nein | Neuer Titel für die Seite |
|
||||
| `content` | string | Nein | Neuer Inhalt für die Seite im Confluence-Speicherformat |
|
||||
| `version` | number | Nein | Versionsnummer der Seite (erforderlich zur Vermeidung von Konflikten) |
|
||||
| `cloudId` | string | Nein | Confluence Cloud-ID für die Instanz. Wenn nicht angegeben, wird sie über die Domain abgerufen. |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `ts` | string | Zeitstempel der Aktualisierung |
|
||||
| `pageId` | string | Confluence-Seiten-ID |
|
||||
| `title` | string | Aktualisierter Seitentitel |
|
||||
| `success` | boolean | Erfolgsstatus der Aktualisierungsoperation |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `confluence`
|
||||
142
apps/docs/content/docs/de/tools/discord.mdx
Normal file
142
apps/docs/content/docs/de/tools/discord.mdx
Normal file
@@ -0,0 +1,142 @@
|
||||
---
|
||||
title: Discord
|
||||
description: Mit Discord interagieren
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="discord"
|
||||
color="#E0E0E0"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
|
||||
|
||||
viewBox='0 -28.5 256 256'
|
||||
version='1.1'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
xmlnsXlink='http://www.w3.org/1999/xlink'
|
||||
preserveAspectRatio='xMidYMid'
|
||||
>
|
||||
<g>
|
||||
<path
|
||||
d='M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z'
|
||||
fill='currentColor'
|
||||
fillRule='nonzero'
|
||||
/>
|
||||
</g>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[Discord](https://discord.com) ist eine leistungsstarke Kommunikationsplattform, die es dir ermöglicht, dich mit Freunden, Communities und Teams zu verbinden. Sie bietet eine Reihe von Funktionen für die Teamzusammenarbeit, darunter Textkanäle, Sprachkanäle und Videoanrufe.
|
||||
|
||||
Mit einem Discord-Account oder -Bot kannst du:
|
||||
|
||||
- **Nachrichten senden**: Nachrichten an einen bestimmten Kanal senden
|
||||
- **Nachrichten abrufen**: Nachrichten aus einem bestimmten Kanal abrufen
|
||||
- **Server abrufen**: Informationen über einen bestimmten Server abrufen
|
||||
- **Benutzer abrufen**: Informationen über einen bestimmten Benutzer abrufen
|
||||
|
||||
In Sim ermöglicht die Discord-Integration deinen Agenten den Zugriff auf die Discord-Server deiner Organisation. Agenten können Informationen aus Discord-Kanälen abrufen, nach bestimmten Benutzern suchen, Serverinformationen erhalten und Nachrichten senden. Dies ermöglicht deinen Workflows, sich mit deinen Discord-Communities zu integrieren, Benachrichtigungen zu automatisieren und interaktive Erlebnisse zu schaffen.
|
||||
|
||||
> **Wichtig:** Um Nachrichteninhalte lesen zu können, benötigt dein Discord-Bot die Berechtigung "Message Content Intent" im Discord Developer Portal. Ohne diese Berechtigung erhältst du zwar weiterhin Nachrichten-Metadaten, aber das Inhaltsfeld wird leer angezeigt.
|
||||
|
||||
Discord-Komponenten in Sim verwenden effizientes Lazy Loading und rufen Daten nur bei Bedarf ab, um API-Aufrufe zu minimieren und Rate-Limiting zu verhindern. Die Token-Aktualisierung erfolgt automatisch im Hintergrund, um deine Verbindung aufrechtzuerhalten.
|
||||
|
||||
### Einrichtung deines Discord-Bots
|
||||
|
||||
1. Gehe zum [Discord Developer Portal](https://discord.com/developers/applications)
|
||||
2. Erstelle eine neue Anwendung und navigiere zum "Bot"-Tab
|
||||
3. Erstelle einen Bot und kopiere deinen Bot-Token
|
||||
4. Aktiviere unter "Privileged Gateway Intents" den **Message Content Intent**, um Nachrichteninhalte lesen zu können
|
||||
5. Lade deinen Bot mit den entsprechenden Berechtigungen auf deine Server ein
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Nutzungsanleitung
|
||||
|
||||
Integriert Discord in den Workflow. Kann Nachrichten senden und empfangen, Server-Informationen abrufen und Benutzerinformationen erhalten. Erfordert einen Bot-API-Schlüssel.
|
||||
|
||||
## Tools
|
||||
|
||||
### `discord_send_message`
|
||||
|
||||
Eine Nachricht an einen Discord-Kanal senden
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Ja | Der Bot-Token zur Authentifizierung |
|
||||
| `channelId` | string | Ja | Die Discord-Kanal-ID, an die die Nachricht gesendet werden soll |
|
||||
| `content` | string | Nein | Der Textinhalt der Nachricht |
|
||||
| `serverId` | string | Ja | Die Discord-Server-ID \(Guild-ID\) |
|
||||
| `files` | file[] | Nein | Dateien, die an die Nachricht angehängt werden sollen |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Erfolgs- oder Fehlermeldung |
|
||||
| `data` | object | Discord-Nachrichtendaten |
|
||||
|
||||
### `discord_get_messages`
|
||||
|
||||
Nachrichten aus einem Discord-Kanal abrufen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Ja | Der Bot-Token zur Authentifizierung |
|
||||
| `channelId` | string | Ja | Die Discord-Kanal-ID, von der Nachrichten abgerufen werden sollen |
|
||||
| `limit` | number | Nein | Maximale Anzahl der abzurufenden Nachrichten \(Standard: 10, max: 100\) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Erfolgs- oder Fehlermeldung |
|
||||
| `messages` | array | Array von Discord-Nachrichten mit vollständigen Metadaten |
|
||||
|
||||
### `discord_get_server`
|
||||
|
||||
Informationen über einen Discord-Server (Guild) abrufen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Ja | Der Bot-Token zur Authentifizierung |
|
||||
| `serverId` | string | Ja | Die Discord-Server-ID \(Guild-ID\) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Erfolgs- oder Fehlermeldung |
|
||||
| `data` | object | Discord-Server \(Guild\) Informationen |
|
||||
|
||||
### `discord_get_user`
|
||||
|
||||
Informationen über einen Discord-Benutzer abrufen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `botToken` | string | Ja | Discord-Bot-Token zur Authentifizierung |
|
||||
| `userId` | string | Ja | Die Discord-Benutzer-ID |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `message` | string | Erfolgs- oder Fehlermeldung |
|
||||
| `data` | object | Discord-Benutzerinformationen |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `discord`
|
||||
67
apps/docs/content/docs/de/tools/elevenlabs.mdx
Normal file
67
apps/docs/content/docs/de/tools/elevenlabs.mdx
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: ElevenLabs
|
||||
description: TTS mit ElevenLabs konvertieren
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="elevenlabs"
|
||||
color="#181C1E"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
|
||||
|
||||
viewBox='0 0 876 876'
|
||||
fill='none'
|
||||
>
|
||||
<path d='M498 138H618V738H498V138Z' fill='currentColor' />
|
||||
<path d='M258 138H378V738H258V138Z' fill='currentColor' />
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[ElevenLabs](https://elevenlabs.io/) ist eine hochmoderne Text-to-Speech-Plattform, die unglaublich natürliche und ausdrucksstarke KI-Stimmen erzeugt. Sie bietet einige der realistischsten und emotional nuanciertesten synthetischen Stimmen, die heute verfügbar sind, was sie ideal für die Erstellung lebensechter Audioinhalte macht.
|
||||
|
||||
Mit ElevenLabs können Sie:
|
||||
|
||||
- **Natürlich klingende Sprache generieren**: Audio erstellen, das kaum von menschlicher Sprache zu unterscheiden ist
|
||||
- **Aus vielfältigen Stimmoptionen wählen**: Zugriff auf eine Bibliothek vorgefertigter Stimmen mit verschiedenen Akzenten, Tonlagen und Eigenschaften
|
||||
- **Stimmen klonen**: Benutzerdefinierte Stimmen basierend auf Audiobeispielen erstellen (mit entsprechenden Genehmigungen)
|
||||
- **Sprachparameter steuern**: Stabilität, Klarheit und emotionalen Ton anpassen, um die Ausgabe zu optimieren
|
||||
- **Realistische Emotionen hinzufügen**: Natürlich klingende Emotionen wie Freude, Traurigkeit oder Aufregung einbauen
|
||||
|
||||
In Sim ermöglicht die ElevenLabs-Integration Ihren Agenten, Text in lebensechte Sprache umzuwandeln, was die Interaktivität und das Engagement Ihrer Anwendungen verbessert. Dies ist besonders wertvoll für die Erstellung von Sprachassistenten, die Generierung von Audioinhalten, die Entwicklung barrierefreier Anwendungen oder den Aufbau von Konversationsschnittstellen, die menschlicher wirken. Die Integration ermöglicht es Ihnen, die fortschrittlichen Sprachsynthesefähigkeiten von ElevenLabs nahtlos in Ihre Agenten-Workflows zu integrieren und so die Lücke zwischen textbasierter KI und natürlicher menschlicher Kommunikation zu schließen.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Nutzungsanleitung
|
||||
|
||||
ElevenLabs in den Workflow integrieren. Kann Text in Sprache umwandeln. Erfordert API-Schlüssel.
|
||||
|
||||
## Tools
|
||||
|
||||
### `elevenlabs_tts`
|
||||
|
||||
TTS mit ElevenLabs-Stimmen konvertieren
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `text` | string | Ja | Der Text, der in Sprache umgewandelt werden soll |
|
||||
| `voiceId` | string | Ja | Die ID der zu verwendenden Stimme |
|
||||
| `modelId` | string | Nein | Die ID des zu verwendenden Modells \(standardmäßig eleven_monolingual_v1\) |
|
||||
| `apiKey` | string | Ja | Ihr ElevenLabs API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `audioUrl` | string | Die URL der generierten Audiodatei |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `elevenlabs`
|
||||
148
apps/docs/content/docs/de/tools/exa.mdx
Normal file
148
apps/docs/content/docs/de/tools/exa.mdx
Normal file
File diff suppressed because one or more lines are too long
77
apps/docs/content/docs/de/tools/file.mdx
Normal file
77
apps/docs/content/docs/de/tools/file.mdx
Normal file
@@ -0,0 +1,77 @@
|
||||
---
|
||||
title: Datei
|
||||
description: Mehrere Dateien lesen und parsen
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="file"
|
||||
color="#40916C"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
|
||||
|
||||
viewBox='0 0 23 28'
|
||||
fill='none'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
>
|
||||
<path
|
||||
d='M8 15.2H15.2M8 20H11.6M2 4.4V23.6C2 24.2365 2.25286 24.847 2.70294 25.2971C3.15303 25.7471 3.76348 26 4.4 26H18.8C19.4365 26 20.047 25.7471 20.4971 25.2971C20.9471 24.847 21.2 24.2365 21.2 23.6V9.6104C21.2 9.29067 21.136 8.97417 21.012 8.67949C20.8879 8.38481 20.7062 8.11789 20.4776 7.8944L15.1496 2.684C14.7012 2.24559 14.0991 2.00008 13.472 2H4.4C3.76348 2 3.15303 2.25286 2.70294 2.70294C2.25286 3.15303 2 3.76348 2 4.4Z'
|
||||
stroke='currentColor'
|
||||
strokeWidth='2.25'
|
||||
strokeLinecap='round'
|
||||
strokeLinejoin='round'
|
||||
/>
|
||||
<path
|
||||
d='M14 2V6.8C14 7.43652 14.2529 8.04697 14.7029 8.49706C15.153 8.94714 15.7635 9.2 16.4 9.2H21.2'
|
||||
stroke='currentColor'
|
||||
strokeWidth='2.25'
|
||||
strokeLinejoin='round'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
Das Datei-Parser-Tool bietet eine leistungsstarke Möglichkeit, Inhalte aus verschiedenen Dateiformaten zu extrahieren und zu verarbeiten, wodurch Dokumentendaten einfach in Ihre Agent-Workflows integriert werden können. Dieses Tool unterstützt mehrere Dateiformate und kann Dateien mit einer Größe von bis zu 200 MB verarbeiten.
|
||||
|
||||
Mit dem Datei-Parser können Sie:
|
||||
|
||||
- **Mehrere Dateiformate verarbeiten**: Text aus PDFs, CSVs, Word-Dokumenten (DOCX), Textdateien und mehr extrahieren
|
||||
- **Große Dateien verarbeiten**: Dokumente mit einer Größe von bis zu 200 MB verarbeiten
|
||||
- **Dateien von URLs parsen**: Inhalte direkt aus online gehosteten Dateien extrahieren, indem Sie deren URLs angeben
|
||||
- **Mehrere Dateien gleichzeitig verarbeiten**: Mehrere Dateien in einem einzigen Vorgang hochladen und parsen
|
||||
- **Strukturierte Daten extrahieren**: Formatierung und Struktur der Originaldokumente wenn möglich beibehalten
|
||||
|
||||
Das Datei-Parser-Tool ist besonders nützlich für Szenarien, in denen Ihre Agenten mit Dokumenteninhalten arbeiten müssen, wie z.B. bei der Analyse von Berichten, der Extraktion von Daten aus Tabellenkalkulationen oder der Verarbeitung von Text aus verschiedenen Dokumentenquellen. Es vereinfacht den Prozess, Dokumenteninhalte für Ihre Agenten verfügbar zu machen, sodass sie genauso einfach mit in Dateien gespeicherten Informationen arbeiten können wie mit direkter Texteingabe.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Gebrauchsanweisung
|
||||
|
||||
Datei in den Workflow integrieren. Kann eine Datei manuell hochladen oder eine Datei-URL einfügen.
|
||||
|
||||
## Tools
|
||||
|
||||
### `file_parser`
|
||||
|
||||
Parsen einer oder mehrerer hochgeladener Dateien oder Dateien von URLs (Text, PDF, CSV, Bilder usw.)
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `filePath` | string | Ja | Pfad zu der/den Datei(en). Kann ein einzelner Pfad, URL oder ein Array von Pfaden sein. |
|
||||
| `fileType` | string | Nein | Typ der zu parsenden Datei (wird automatisch erkannt, wenn nicht angegeben) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `files` | array | Array der geparsten Dateien |
|
||||
| `combinedContent` | string | Kombinierter Inhalt aller geparsten Dateien |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `file`
|
||||
124
apps/docs/content/docs/de/tools/firecrawl.mdx
Normal file
124
apps/docs/content/docs/de/tools/firecrawl.mdx
Normal file
@@ -0,0 +1,124 @@
|
||||
---
|
||||
title: Firecrawl
|
||||
description: Durchsuche oder durchforste das Web
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="firecrawl"
|
||||
color="#181C1E"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon" viewBox='0 0 642 600' xmlns='http://www.w3.org/2000/svg' >
|
||||
<path
|
||||
d='M301 63C299 91 303 122 298 149C295 158 289 165 283 169C274 172 266 170 261 167C253 176 248 183 244 191C230 226 226 263 226 301C216 310 203 317 192 310C179 295 175 277 174 259C161 273 153 288 146 304C141 321 138 336 137 352C140 372 145 388 152 402C161 421 174 435 187 449C181 462 165 453 157 450C158 454 161 458 165 461C195 490 231 500 268 509C240 494 211 471 195 442C179 413 172 378 180 344C191 353 200 362 211 364C223 365 232 361 236 353C247 274 299 214 323 143C322 136 327 140 329 142C354 165 367 191 375 218C387 254 381 294 379 329C393 345 413 334 424 329C429 342 432 352 429 362C427 378 417 388 413 400C422 407 433 403 440 400C432 423 419 442 404 460C383 483 358 501 335 512C379 502 420 491 449 459C443 458 427 464 428 452C443 437 464 423 472 403C482 383 485 362 484 339C482 307 472 280 458 254C459 267 452 276 445 284C434 289 426 279 424 272C415 247 424 220 418 198C415 179 405 165 397 150C370 114 336 86 303 64'
|
||||
fill='rgb(253,76,31)'
|
||||
/>
|
||||
<path
|
||||
d='M324 141C303 214 249 273 244 354C235 359 229 364 223 366C205 367 193 357 182 347C180 350 179 353 180 357C178 374 178 390 182 403C185 421 193 434 200 448C212 465 227 480 243 491C258 500 269 513 285 512C284 508 257 485 252 468C241 450 235 433 233 414C241 415 254 420 263 412C260 387 265 363 273 343C281 323 293 306 310 295C317 289 324 285 330 282C328 307 328 331 329 355C330 368 332 379 338 389C358 394 376 384 388 370C383 386 377 401 371 415C376 414 381 411 385 408C383 421 380 431 376 441C366 467 356 491 334 510C358 499 381 483 400 461C418 442 430 423 440 403C432 404 421 410 413 404C414 386 428 377 427 360C429 349 428 340 424 332C413 336 404 341 392 339C386 338 381 334 379 330C380 292 385 248 371 214C366 195 358 180 349 165C341 155 333 145 323 140'
|
||||
fill='rgb(254,156,69)'
|
||||
/>
|
||||
<path
|
||||
d='M330 284C309 293 289 311 279 332C267 356 261 383 265 411C256 420 242 418 235 412C237 438 245 459 258 479C269 493 281 507 295 513C288 495 265 472 265 446C272 447 281 454 288 444C296 425 303 407 309 388C317 406 321 427 336 443C346 449 358 446 363 438C355 464 348 489 334 511C344 501 352 491 357 480C370 457 379 435 385 412C380 411 376 416 371 418C376 401 382 386 387 371C379 382 369 388 358 391C348 394 337 392 334 383C324 353 328 316 330 285'
|
||||
fill='rgb(254,220,87)'
|
||||
/>
|
||||
<path
|
||||
d='M311 389C303 407 297 426 289 445C282 454 273 450 268 445C267 472 285 492 302 512C299 514 297 514 294 514C297 514 299 514 301 514C314 515 325 512 334 513C341 495 355 467 362 443C357 446 351 448 344 447C337 446 334 441 330 438C320 422 316 406 311 391'
|
||||
fill='rgb(251,250,202)'
|
||||
/>
|
||||
<path
|
||||
d='M187 163C188 181 167 187 164 203C158 215 158 228 159 241C172 233 183 221 188 209C193 194 192 178 188 166'
|
||||
fill='rgb(253,76,31)'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[Firecrawl](https://firecrawl.dev/) ist eine leistungsstarke Web-Scraping- und Content-Extraktions-API, die sich nahtlos in Sim integriert und Entwicklern ermöglicht, saubere, strukturierte Inhalte von jeder Website zu extrahieren. Diese Integration bietet eine einfache Möglichkeit, Webseiten in nutzbare Datenformate wie Markdown und HTML umzuwandeln und dabei die wesentlichen Inhalte zu bewahren.
|
||||
|
||||
Mit Firecrawl in Sim können Sie:
|
||||
|
||||
- **Saubere Inhalte extrahieren**: Entfernen Sie Werbung, Navigationselemente und andere Ablenkungen, um nur den Hauptinhalt zu erhalten
|
||||
- **In strukturierte Formate umwandeln**: Transformieren Sie Webseiten in Markdown, HTML oder JSON
|
||||
- **Metadaten erfassen**: Extrahieren Sie SEO-Metadaten, Open Graph-Tags und andere Seiteninformationen
|
||||
- **JavaScript-lastige Seiten verarbeiten**: Verarbeiten Sie Inhalte von modernen Webanwendungen, die auf JavaScript basieren
|
||||
- **Inhalte filtern**: Konzentrieren Sie sich auf bestimmte Teile einer Seite mit CSS-Selektoren
|
||||
- **Skalierbar verarbeiten**: Bewältigen Sie umfangreiche Scraping-Anforderungen mit einer zuverlässigen API
|
||||
- **Im Web suchen**: Führen Sie intelligente Websuchen durch und erhalten Sie strukturierte Ergebnisse
|
||||
- **Ganze Websites crawlen**: Durchsuchen Sie mehrere Seiten einer Website und aggregieren Sie deren Inhalte
|
||||
|
||||
In Sim ermöglicht die Firecrawl-Integration Ihren Agenten, programmatisch auf Webinhalte zuzugreifen und diese als Teil ihrer Workflows zu verarbeiten. Unterstützte Operationen umfassen:
|
||||
|
||||
- **Scrape**: Extrahieren Sie strukturierte Inhalte (Markdown, HTML, Metadaten) von einer einzelnen Webseite.
|
||||
- **Search**: Durchsuchen Sie das Web nach Informationen mit Firecrawls intelligenten Suchfunktionen.
|
||||
- **Crawl**: Durchsuchen Sie mehrere Seiten einer Website und erhalten Sie strukturierte Inhalte und Metadaten für jede Seite.
|
||||
|
||||
Dies ermöglicht Ihren Agenten, Informationen von Websites zu sammeln, strukturierte Daten zu extrahieren und diese Informationen zu nutzen, um Entscheidungen zu treffen oder Erkenntnisse zu gewinnen – ohne sich mit den Komplexitäten des rohen HTML-Parsings oder der Browser-Automatisierung auseinandersetzen zu müssen. Konfigurieren Sie einfach den Firecrawl-Block mit Ihrem API-Schlüssel, wählen Sie die Operation (Scrape, Search oder Crawl) und geben Sie die relevanten Parameter an. Ihre Agenten können sofort mit Webinhalten in einem sauberen, strukturierten Format arbeiten.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Nutzungsanweisungen
|
||||
|
||||
Integrieren Sie Firecrawl in den Workflow. Kann Websites durchsuchen, scrapen oder crawlen. Benötigt API-Schlüssel.
|
||||
|
||||
## Tools
|
||||
|
||||
### `firecrawl_scrape`
|
||||
|
||||
Extrahieren Sie strukturierte Inhalte von Webseiten mit umfassender Metadaten-Unterstützung. Konvertiert Inhalte in Markdown oder HTML und erfasst dabei SEO-Metadaten, Open Graph-Tags und Seiteninformationen.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `url` | string | Ja | Die URL, von der Inhalte extrahiert werden sollen |
|
||||
| `scrapeOptions` | json | Nein | Optionen für das Content-Scraping |
|
||||
| `apiKey` | string | Ja | Firecrawl API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `markdown` | string | Seiteninhalt im Markdown-Format |
|
||||
| `html` | string | Roher HTML-Inhalt der Seite |
|
||||
| `metadata` | object | Seiten-Metadaten einschließlich SEO- und Open Graph-Informationen |
|
||||
|
||||
### `firecrawl_search`
|
||||
|
||||
Suche nach Informationen im Web mit Firecrawl
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `query` | string | Ja | Die zu verwendende Suchanfrage |
|
||||
| `apiKey` | string | Ja | Firecrawl API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `data` | array | Suchergebnisdaten |
|
||||
|
||||
### `firecrawl_crawl`
|
||||
|
||||
Crawlen Sie ganze Websites und extrahieren Sie strukturierte Inhalte von allen zugänglichen Seiten
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `url` | string | Ja | Die Website-URL zum Crawlen |
|
||||
| `limit` | number | Nein | Maximale Anzahl der zu crawlenden Seiten \(Standard: 100\) |
|
||||
| `onlyMainContent` | boolean | Nein | Nur Hauptinhalt von Seiten extrahieren |
|
||||
| `apiKey` | string | Ja | Firecrawl API-Schlüssel |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `pages` | array | Array von gecrawlten Seiten mit ihrem Inhalt und Metadaten |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `firecrawl`
|
||||
232
apps/docs/content/docs/de/tools/generic_webhook.mdx
Normal file
232
apps/docs/content/docs/de/tools/generic_webhook.mdx
Normal file
@@ -0,0 +1,232 @@
|
||||
---
|
||||
title: Webhook
|
||||
description: Empfangen Sie Webhooks von jedem Dienst durch Konfiguration eines
|
||||
benutzerdefinierten Webhooks.
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="generic_webhook"
|
||||
color="#10B981"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
fill='currentColor'
|
||||
|
||||
|
||||
viewBox='0 0 24 24'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
>
|
||||
<path d='M17.974 7A4.967 4.967 0 0 0 18 6.5a5.5 5.5 0 1 0-8.672 4.491L7.18 15.114A2.428 2.428 0 0 0 6.496 15 2.5 2.5 0 1 0 9 17.496a2.36 2.36 0 0 0-.93-1.925l2.576-4.943-.41-.241A4.5 4.5 0 1 1 17 6.5a4.8 4.8 0 0 1-.022.452zM6.503 18.999a1.5 1.5 0 1 1 1.496-1.503A1.518 1.518 0 0 1 6.503 19zM18.5 12a5.735 5.735 0 0 0-1.453.157l-2.744-3.941A2.414 2.414 0 0 0 15 6.5a2.544 2.544 0 1 0-1.518 2.284l3.17 4.557.36-.13A4.267 4.267 0 0 1 18.5 13a4.5 4.5 0 1 1-.008 9h-.006a4.684 4.684 0 0 1-3.12-1.355l-.703.71A5.653 5.653 0 0 0 18.49 23h.011a5.5 5.5 0 0 0 0-11zM11 6.5A1.5 1.5 0 1 1 12.5 8 1.509 1.509 0 0 1 11 6.5zM18.5 20a2.5 2.5 0 1 0-2.447-3h-5.05l-.003.497A4.546 4.546 0 0 1 6.5 22 4.526 4.526 0 0 1 2 17.5a4.596 4.596 0 0 1 3.148-4.37l-.296-.954A5.606 5.606 0 0 0 1 17.5 5.532 5.532 0 0 0 6.5 23a5.573 5.573 0 0 0 5.478-5h4.08a2.487 2.487 0 0 0 2.442 2zm0-4a1.5 1.5 0 1 1-1.5 1.5 1.509 1.509 0 0 1 1.5-1.5z' />
|
||||
<path fill='none' d='M0 0h24v24H0z' />
|
||||
</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
|
||||
130
apps/docs/content/docs/de/tools/github.mdx
Normal file
130
apps/docs/content/docs/de/tools/github.mdx
Normal file
@@ -0,0 +1,130 @@
|
||||
---
|
||||
title: GitHub
|
||||
description: Interagiere mit GitHub oder löse Workflows durch GitHub-Events aus
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="github"
|
||||
color="#181C1E"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon" viewBox='0 0 26 26' xmlns='http://www.w3.org/2000/svg'>
|
||||
<path
|
||||
d='M13 0C11.2928 0 9.60235 0.336255 8.02511 0.989566C6.44788 1.64288 5.01477 2.60045 3.80761 3.80761C1.36964 6.24558 0 9.55219 0 13C0 18.746 3.731 23.621 8.892 25.35C9.542 25.454 9.75 25.051 9.75 24.7V22.503C6.149 23.283 5.382 20.761 5.382 20.761C4.784 19.253 3.939 18.85 3.939 18.85C2.756 18.044 4.03 18.07 4.03 18.07C5.33 18.161 6.019 19.409 6.019 19.409C7.15 21.385 9.061 20.8 9.802 20.488C9.919 19.643 10.257 19.071 10.621 18.746C7.735 18.421 4.706 17.303 4.706 12.35C4.706 10.907 5.2 9.75 6.045 8.827C5.915 8.502 5.46 7.15 6.175 5.395C6.175 5.395 7.267 5.044 9.75 6.721C10.777 6.435 11.895 6.292 13 6.292C14.105 6.292 15.223 6.435 16.25 6.721C18.733 5.044 19.825 5.395 19.825 5.395C20.54 7.15 20.085 8.502 19.955 8.827C20.8 9.75 21.294 10.907 21.294 12.35C21.294 17.316 18.252 18.408 15.353 18.733C15.821 19.136 16.25 19.929 16.25 21.138V24.7C16.25 25.051 16.458 25.467 17.121 25.35C22.282 23.608 26 18.746 26 13C26 11.2928 25.6637 9.60235 25.0104 8.02511C24.3571 6.44788 23.3995 5.01477 22.1924 3.80761C20.9852 2.60045 19.5521 1.64288 17.9749 0.989566C16.3977 0.336255 14.7072 0 13 0Z'
|
||||
fill='currentColor'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[GitHub](https://github.com/) ist die weltweit führende Plattform für Softwareentwicklung und Versionskontrolle mit Git. Sie bietet eine kollaborative Umgebung, in der Entwickler Code hosten und überprüfen, Projekte verwalten und gemeinsam Software erstellen können.
|
||||
|
||||
Mit GitHub kannst du:
|
||||
|
||||
- **Repositories hosten**: Speichere deinen Code in öffentlichen oder privaten Repositories mit Versionskontrolle
|
||||
- **An Code zusammenarbeiten**: Nutze Pull Requests, um Änderungen vorzuschlagen, Code zu überprüfen und Beiträge zusammenzuführen
|
||||
- **Issues verfolgen**: Erstelle, weise zu und verwalte Issues, um Arbeit zu organisieren und Fehler zu verfolgen
|
||||
- **Workflows automatisieren**: Nutze GitHub Actions, um Code automatisch zu erstellen, zu testen und bereitzustellen
|
||||
- **Projekte verwalten**: Organisiere Arbeit mit Projektboards, Meilensteinen und Aufgabenverfolgung
|
||||
- **Code dokumentieren**: Erstelle und pflege Dokumentation mit GitHub Pages und Wikis
|
||||
|
||||
In Sim ermöglicht die GitHub-Integration Ihren Agenten die direkte Interaktion mit GitHub-Repositories und -Workflows. Dies erlaubt leistungsstarke Automatisierungsszenarien wie Unterstützung bei Code-Reviews, Pull-Request-Management, Issue-Tracking und Repository-Exploration. Ihre Agenten können Repository-Daten abrufen, Code-Änderungen analysieren, Kommentare zu Pull Requests posten und andere GitHub-Operationen programmatisch durchführen. Diese Integration überbrückt die Lücke zwischen Ihren KI-Workflows und Ihren Entwicklungsprozessen und ermöglicht eine nahtlose Zusammenarbeit zwischen Ihren Agenten und Ihrem Entwicklungsteam.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Nutzungsanweisungen
|
||||
|
||||
Integrieren Sie Github in den Workflow. Kann PR-Details abrufen, PR-Kommentare erstellen, Repository-Informationen abrufen und den neuesten Commit anzeigen. Erfordert einen GitHub-Token-API-Schlüssel. Kann im Trigger-Modus verwendet werden, um einen Workflow auszulösen, wenn ein PR erstellt wird, kommentiert wird oder ein Commit gepusht wird.
|
||||
|
||||
## Tools
|
||||
|
||||
### `github_pr`
|
||||
|
||||
PR-Details einschließlich Diff und geänderte Dateien abrufen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `owner` | string | Ja | Repository-Besitzer |
|
||||
| `repo` | string | Ja | Repository-Name |
|
||||
| `pullNumber` | number | Ja | Pull-Request-Nummer |
|
||||
| `apiKey` | string | Ja | GitHub-API-Token |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Menschenlesbare PR-Zusammenfassung |
|
||||
| `metadata` | object | Detaillierte PR-Metadaten einschließlich Dateiänderungen |
|
||||
|
||||
### `github_comment`
|
||||
|
||||
Kommentare zu GitHub PRs erstellen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `owner` | string | Ja | Repository-Besitzer |
|
||||
| `repo` | string | Ja | Repository-Name |
|
||||
| `body` | string | Ja | Kommentarinhalt |
|
||||
| `pullNumber` | number | Ja | Pull-Request-Nummer |
|
||||
| `path` | string | Nein | Dateipfad für Review-Kommentar |
|
||||
| `position` | number | Nein | Zeilennummer für Review-Kommentar |
|
||||
| `commentType` | string | Nein | Kommentartyp \(pr_comment oder file_comment\) |
|
||||
| `line` | number | Nein | Zeilennummer für Review-Kommentar |
|
||||
| `side` | string | Nein | Seite des Diffs \(LEFT oder RIGHT\) |
|
||||
| `commitId` | string | Nein | Der SHA des Commits, der kommentiert werden soll |
|
||||
| `apiKey` | string | Ja | GitHub API-Token |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Menschenlesbare Kommentarbestätigung |
|
||||
| `metadata` | object | Kommentar-Metadaten |
|
||||
|
||||
### `github_repo_info`
|
||||
|
||||
Ruft umfassende GitHub-Repository-Metadaten ab, einschließlich Sterne, Forks, Issues und Hauptsprache. Unterstützt sowohl öffentliche als auch private Repositories mit optionaler Authentifizierung.
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `owner` | string | Ja | Repository-Besitzer \(Benutzer oder Organisation\) |
|
||||
| `repo` | string | Ja | Repository-Name |
|
||||
| `apiKey` | string | Ja | GitHub Personal Access Token |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Menschenlesbare Repository-Zusammenfassung |
|
||||
| `metadata` | object | Repository-Metadaten |
|
||||
|
||||
### `github_latest_commit`
|
||||
|
||||
Ruft den neuesten Commit aus einem GitHub-Repository ab
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `owner` | string | Ja | Repository-Besitzer (Benutzer oder Organisation) |
|
||||
| `repo` | string | Ja | Repository-Name |
|
||||
| `branch` | string | Nein | Branch-Name (standardmäßig der Standard-Branch des Repositories) |
|
||||
| `apiKey` | string | Ja | GitHub API-Token |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Menschenlesbare Commit-Zusammenfassung |
|
||||
| `metadata` | object | Commit-Metadaten |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `github`
|
||||
144
apps/docs/content/docs/de/tools/gmail.mdx
Normal file
144
apps/docs/content/docs/de/tools/gmail.mdx
Normal file
@@ -0,0 +1,144 @@
|
||||
---
|
||||
title: Gmail
|
||||
description: Gmail senden oder Workflows von Gmail-Ereignissen auslösen
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="gmail"
|
||||
color="#E0E0E0"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
viewBox='0 0 48 48'
|
||||
|
||||
|
||||
|
||||
>
|
||||
<path fill='#4caf50' d='M45,16.2l-5,2.75l-5,4.75L35,40h7c1.657,0,3-1.343,3-3V16.2z' />
|
||||
<path fill='#1e88e5' d='M3,16.2l3.614,1.71L13,23.7V40H6c-1.657,0-3-1.343-3-3V16.2z' />
|
||||
<polygon
|
||||
fill='#e53935'
|
||||
points='35,11.2 24,19.45 13,11.2 12,17 13,23.7 24,31.95 35,23.7 36,17'
|
||||
/>
|
||||
<path
|
||||
fill='#c62828'
|
||||
d='M3,12.298V16.2l10,7.5V11.2L9.876,8.859C9.132,8.301,8.228,8,7.298,8h0C4.924,8,3,9.924,3,12.298z'
|
||||
/>
|
||||
<path
|
||||
fill='#fbc02d'
|
||||
d='M45,12.298V16.2l-10,7.5V11.2l3.124-2.341C38.868,8.301,39.772,8,40.702,8h0 C43.076,8,45,9.924,45,12.298z'
|
||||
/>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[Gmail](https://gmail.com) ist Googles beliebter E-Mail-Dienst, der eine robuste Plattform zum Senden, Empfangen und Verwalten von E-Mail-Kommunikation bietet. Mit über 1,8 Milliarden aktiven Nutzern weltweit bietet Gmail eine funktionsreiche Erfahrung mit leistungsstarken Suchfunktionen, Organisationstools und Integrationsoptionen.
|
||||
|
||||
Mit Gmail können Sie:
|
||||
|
||||
- **E-Mails senden und empfangen**: Kommunizieren Sie mit Kontakten über eine übersichtliche, intuitive Benutzeroberfläche
|
||||
- **Nachrichten organisieren**: Verwenden Sie Labels, Ordner und Filter, um Ihren Posteingang zu organisieren
|
||||
- **Effizient suchen**: Finden Sie bestimmte Nachrichten schnell mit Googles leistungsstarker Suchtechnologie
|
||||
- **Workflows automatisieren**: Erstellen Sie Filter und Regeln, um eingehende E-Mails automatisch zu verarbeiten
|
||||
- **Von überall zugreifen**: Nutzen Sie Gmail geräteübergreifend mit synchronisierten Inhalten und Einstellungen
|
||||
- **Mit anderen Diensten integrieren**: Verbinden Sie sich mit Google Kalender, Drive und anderen Produktivitätstools
|
||||
|
||||
In Sim ermöglicht die Gmail-Integration Ihren Agenten, E-Mails programmatisch zu senden, zu lesen und zu durchsuchen. Dies ermöglicht leistungsstarke Automatisierungsszenarien wie das Senden von Benachrichtigungen, die Verarbeitung eingehender Nachrichten, das Extrahieren von Informationen aus E-Mails und das Verwalten von Kommunikationsabläufen. Ihre Agenten können personalisierte E-Mails verfassen und senden, nach bestimmten Nachrichten mit Gmails Abfragesyntax suchen und Inhalte aus E-Mails extrahieren, um sie in anderen Teilen Ihres Workflows zu verwenden. In Kürze werden Agenten auch in der Lage sein, in Echtzeit auf neue E-Mails zu achten, was reaktionsschnelle Workflows ermöglicht, die Aktionen basierend auf eingehenden Nachrichten auslösen können. Diese Integration überbrückt die Lücke zwischen Ihren KI-Workflows und E-Mail-Kommunikationen und ermöglicht eine nahtlose Interaktion mit einer der weltweit am häufigsten genutzten Kommunikationsplattformen.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Nutzungsanleitung
|
||||
|
||||
Gmail in den Workflow integrieren. Kann E-Mails senden, lesen und durchsuchen. Erfordert OAuth. Kann im Trigger-Modus verwendet werden, um einen Workflow auszulösen, wenn eine neue E-Mail empfangen wird.
|
||||
|
||||
## Tools
|
||||
|
||||
### `gmail_send`
|
||||
|
||||
E-Mails über Gmail versenden
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `to` | string | Ja | E-Mail-Adresse des Empfängers |
|
||||
| `subject` | string | Ja | Betreff der E-Mail |
|
||||
| `body` | string | Ja | Inhalt der E-Mail |
|
||||
| `cc` | string | Nein | CC-Empfänger (durch Komma getrennt) |
|
||||
| `bcc` | string | Nein | BCC-Empfänger (durch Komma getrennt) |
|
||||
| `attachments` | file[] | Nein | Dateien, die an die E-Mail angehängt werden sollen |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Erfolgsmeldung |
|
||||
| `metadata` | object | E-Mail-Metadaten |
|
||||
|
||||
### `gmail_draft`
|
||||
|
||||
E-Mail-Entwürfe in Gmail erstellen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `to` | string | Ja | E-Mail-Adresse des Empfängers |
|
||||
| `subject` | string | Ja | Betreff der E-Mail |
|
||||
| `body` | string | Ja | Inhalt der E-Mail |
|
||||
| `cc` | string | Nein | CC-Empfänger (durch Komma getrennt) |
|
||||
| `bcc` | string | Nein | BCC-Empfänger (durch Komma getrennt) |
|
||||
| `attachments` | file[] | Nein | Dateien, die an den E-Mail-Entwurf angehängt werden sollen |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Erfolgsmeldung |
|
||||
| `metadata` | object | Entwurfs-Metadaten |
|
||||
|
||||
### `gmail_read`
|
||||
|
||||
E-Mails von Gmail lesen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `messageId` | string | Nein | ID der zu lesenden Nachricht |
|
||||
| `folder` | string | Nein | Ordner/Label, aus dem E-Mails gelesen werden sollen |
|
||||
| `unreadOnly` | boolean | Nein | Nur ungelesene Nachrichten abrufen |
|
||||
| `maxResults` | number | Nein | Maximale Anzahl abzurufender Nachrichten \(Standard: 1, max: 10\) |
|
||||
| `includeAttachments` | boolean | Nein | E-Mail-Anhänge herunterladen und einschließen |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Textinhalt der E-Mail |
|
||||
| `metadata` | json | Metadaten der E-Mail |
|
||||
| `attachments` | file[] | Anhänge der E-Mail |
|
||||
|
||||
### `gmail_search`
|
||||
|
||||
E-Mails in Gmail durchsuchen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `query` | string | Ja | Suchanfrage für E-Mails |
|
||||
| `maxResults` | number | Nein | Maximale Anzahl zurückzugebender Ergebnisse |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Zusammenfassung der Suchergebnisse |
|
||||
| `metadata` | object | Such-Metadaten |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `gmail`
|
||||
204
apps/docs/content/docs/de/tools/google_calendar.mdx
Normal file
204
apps/docs/content/docs/de/tools/google_calendar.mdx
Normal file
@@ -0,0 +1,204 @@
|
||||
---
|
||||
title: Google Kalender
|
||||
description: Google Kalender-Ereignisse verwalten
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
|
||||
<BlockInfoCard
|
||||
type="google_calendar"
|
||||
color="#E0E0E0"
|
||||
icon={true}
|
||||
iconSvg={`<svg className="block-icon"
|
||||
|
||||
version='1.1'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
xmlnsXlink='http://www.w3.org/1999/xlink'
|
||||
x='0px'
|
||||
y='0px'
|
||||
viewBox='0 0 200 200'
|
||||
enableBackground='new 0 0 200 200'
|
||||
xmlSpace='preserve'
|
||||
>
|
||||
<g>
|
||||
<g transform='translate(3.75 3.75)'>
|
||||
<path
|
||||
fill='#FFFFFF'
|
||||
d='M148.882,43.618l-47.368-5.263l-57.895,5.263L38.355,96.25l5.263,52.632l52.632,6.579l52.632-6.579
|
||||
l5.263-53.947L148.882,43.618z'
|
||||
/>
|
||||
<path
|
||||
fill='#1A73E8'
|
||||
d='M65.211,125.276c-3.934-2.658-6.658-6.539-8.145-11.671l9.132-3.763c0.829,3.158,2.276,5.605,4.342,7.342
|
||||
c2.053,1.737,4.553,2.592,7.474,2.592c2.987,0,5.553-0.908,7.697-2.724s3.224-4.132,3.224-6.934c0-2.868-1.132-5.211-3.395-7.026
|
||||
s-5.105-2.724-8.5-2.724h-5.276v-9.039H76.5c2.921,0,5.382-0.789,7.382-2.368c2-1.579,3-3.737,3-6.487
|
||||
c0-2.447-0.895-4.395-2.684-5.855s-4.053-2.197-6.803-2.197c-2.684,0-4.816,0.711-6.395,2.145s-2.724,3.197-3.447,5.276
|
||||
l-9.039-3.763c1.197-3.395,3.395-6.395,6.618-8.987c3.224-2.592,7.342-3.895,12.342-3.895c3.697,0,7.026,0.711,9.974,2.145
|
||||
c2.947,1.434,5.263,3.421,6.934,5.947c1.671,2.539,2.5,5.382,2.5,8.539c0,3.224-0.776,5.947-2.329,8.184
|
||||
c-1.553,2.237-3.461,3.947-5.724,5.145v0.539c2.987,1.25,5.421,3.158,7.342,5.724c1.908,2.566,2.868,5.632,2.868,9.211
|
||||
s-0.908,6.776-2.724,9.579c-1.816,2.803-4.329,5.013-7.513,6.618c-3.197,1.605-6.789,2.421-10.776,2.421
|
||||
C73.408,129.263,69.145,127.934,65.211,125.276z'
|
||||
/>
|
||||
<path
|
||||
fill='#1A73E8'
|
||||
d='M121.25,79.961l-9.974,7.25l-5.013-7.605l17.987-12.974h6.895v61.197h-9.895L121.25,79.961z'
|
||||
/>
|
||||
<path
|
||||
fill='#EA4335'
|
||||
d='M148.882,196.25l47.368-47.368l-23.684-10.526l-23.684,10.526l-10.526,23.684L148.882,196.25z'
|
||||
/>
|
||||
<path
|
||||
fill='#34A853'
|
||||
d='M33.092,172.566l10.526,23.684h105.263v-47.368H43.618L33.092,172.566z'
|
||||
/>
|
||||
<path
|
||||
fill='#4285F4'
|
||||
d='M12.039-3.75C3.316-3.75-3.75,3.316-3.75,12.039v136.842l23.684,10.526l23.684-10.526V43.618h105.263
|
||||
l10.526-23.684L148.882-3.75H12.039z'
|
||||
/>
|
||||
<path
|
||||
fill='#188038'
|
||||
d='M-3.75,148.882v31.579c0,8.724,7.066,15.789,15.789,15.789h31.579v-47.368H-3.75z'
|
||||
/>
|
||||
<path
|
||||
fill='#FBBC04'
|
||||
d='M148.882,43.618v105.263h47.368V43.618l-23.684-10.526L148.882,43.618z'
|
||||
/>
|
||||
<path
|
||||
fill='#1967D2'
|
||||
d='M196.25,43.618V12.039c0-8.724-7.066-15.789-15.789-15.789h-31.579v47.368H196.25z'
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
{/* MANUAL-CONTENT-START:intro */}
|
||||
[Google Kalender](https://calendar.google.com) ist Googles leistungsstarker Kalender- und Planungsdienst, der eine umfassende Plattform für die Verwaltung von Ereignissen, Meetings und Terminen bietet. Mit nahtloser Integration in Googles Ökosystem und weitverbreiteter Nutzung bietet Google Kalender robuste Funktionen für persönliche und berufliche Planungsbedürfnisse.
|
||||
|
||||
Mit Google Kalender können Sie:
|
||||
|
||||
- **Ereignisse erstellen und verwalten**: Planen Sie Meetings, Termine und Erinnerungen mit detaillierten Informationen
|
||||
- **Kalendereinladungen versenden**: Benachrichtigen und koordinieren Sie automatisch mit Teilnehmern durch E-Mail-Einladungen
|
||||
- **Ereigniserstellung mit natürlicher Sprache**: Fügen Sie schnell Ereignisse mit Umgangssprache hinzu, wie "Meeting mit John morgen um 15 Uhr"
|
||||
- **Ereignisse anzeigen und suchen**: Finden und greifen Sie einfach auf Ihre geplanten Ereignisse über mehrere Kalender hinweg zu
|
||||
- **Mehrere Kalender verwalten**: Organisieren Sie verschiedene Arten von Ereignissen über verschiedene Kalender hinweg
|
||||
|
||||
In Sim ermöglicht die Google Kalender-Integration Ihren Agenten, Kalenderereignisse programmatisch zu erstellen, zu lesen und zu verwalten. Dies ermöglicht leistungsstarke Automatisierungsszenarien wie das Planen von Meetings, das Versenden von Kalendereinladungen, das Überprüfen der Verfügbarkeit und das Verwalten von Ereignisdetails. Ihre Agenten können Ereignisse mit natürlichsprachlicher Eingabe erstellen, automatisierte Kalendereinladungen an Teilnehmer senden, Ereignisinformationen abrufen und bevorstehende Ereignisse auflisten. Diese Integration überbrückt die Lücke zwischen Ihren KI-Workflows und der Kalenderverwaltung und ermöglicht eine nahtlose Planungsautomatisierung und Koordination mit einer der weltweit am häufigsten genutzten Kalenderplattformen.
|
||||
{/* MANUAL-CONTENT-END */}
|
||||
|
||||
## Nutzungsanweisungen
|
||||
|
||||
Integriert Google Kalender in den Workflow. Kann Kalenderereignisse erstellen, lesen, aktualisieren und auflisten. Erfordert OAuth.
|
||||
|
||||
## Tools
|
||||
|
||||
### `google_calendar_create`
|
||||
|
||||
Erstellt ein neues Ereignis in Google Kalender
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `calendarId` | string | Nein | Kalender-ID \(standardmäßig primary\) |
|
||||
| `summary` | string | Ja | Ereignistitel/Zusammenfassung |
|
||||
| `description` | string | Nein | Ereignisbeschreibung |
|
||||
| `location` | string | Nein | Ereignisort |
|
||||
| `startDateTime` | string | Ja | Startdatum und -uhrzeit \(RFC3339-Format, z.B. 2025-06-03T10:00:00-08:00\) |
|
||||
| `endDateTime` | string | Ja | Enddatum und -uhrzeit \(RFC3339-Format, z.B. 2025-06-03T11:00:00-08:00\) |
|
||||
| `timeZone` | string | Nein | Zeitzone \(z.B. America/Los_Angeles\) |
|
||||
| `attendees` | array | Nein | Array mit E-Mail-Adressen der Teilnehmer |
|
||||
| `sendUpdates` | string | Nein | Wie Updates an Teilnehmer gesendet werden: all, externalOnly oder none |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Bestätigungsnachricht zur Ereigniserstellung |
|
||||
| `metadata` | json | Metadaten des erstellten Ereignisses einschließlich ID, Status und Details |
|
||||
|
||||
### `google_calendar_list`
|
||||
|
||||
Ereignisse aus Google Kalender auflisten
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `calendarId` | string | Nein | Kalender-ID \(standardmäßig primary\) |
|
||||
| `timeMin` | string | Nein | Untere Grenze für Ereignisse \(RFC3339-Zeitstempel, z.B. 2025-06-03T00:00:00Z\) |
|
||||
| `timeMax` | string | Nein | Obere Grenze für Ereignisse \(RFC3339-Zeitstempel, z.B. 2025-06-04T00:00:00Z\) |
|
||||
| `orderBy` | string | Nein | Reihenfolge der zurückgegebenen Ereignisse \(startTime oder updated\) |
|
||||
| `showDeleted` | boolean | Nein | Gelöschte Ereignisse einbeziehen |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Zusammenfassung der gefundenen Ereignisanzahl |
|
||||
| `metadata` | json | Liste der Ereignisse mit Paginierungstoken und Ereignisdetails |
|
||||
|
||||
### `google_calendar_get`
|
||||
|
||||
Ein bestimmtes Ereignis aus Google Kalender abrufen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `calendarId` | string | Nein | Kalender-ID (standardmäßig primary) |
|
||||
| `eventId` | string | Ja | Ereignis-ID zum Abrufen |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Bestätigungsnachricht zum Abrufen des Ereignisses |
|
||||
| `metadata` | json | Ereignisdetails einschließlich ID, Status, Zeiten und Teilnehmer |
|
||||
|
||||
### `google_calendar_quick_add`
|
||||
|
||||
Ereignisse aus natürlichsprachlichem Text erstellen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `calendarId` | string | Nein | Kalender-ID (standardmäßig primary) |
|
||||
| `text` | string | Ja | Natürlichsprachlicher Text, der das Ereignis beschreibt (z.B. "Meeting mit John morgen um 15 Uhr") |
|
||||
| `attendees` | array | Nein | Array von E-Mail-Adressen der Teilnehmer (auch durch Komma getrennte Zeichenfolge akzeptiert) |
|
||||
| `sendUpdates` | string | Nein | Wie Updates an Teilnehmer gesendet werden: all, externalOnly oder none |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Bestätigungsnachricht zur Ereigniserstellung aus natürlicher Sprache |
|
||||
| `metadata` | json | Metadaten des erstellten Ereignisses einschließlich analysierter Details |
|
||||
|
||||
### `google_calendar_invite`
|
||||
|
||||
Teilnehmer zu einem bestehenden Google Kalender-Ereignis einladen
|
||||
|
||||
#### Eingabe
|
||||
|
||||
| Parameter | Typ | Erforderlich | Beschreibung |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `calendarId` | string | Nein | Kalender-ID (standardmäßig primär) |
|
||||
| `eventId` | string | Ja | Ereignis-ID, zu der Teilnehmer eingeladen werden sollen |
|
||||
| `attendees` | array | Ja | Array von E-Mail-Adressen der einzuladenden Teilnehmer |
|
||||
| `sendUpdates` | string | Nein | Wie Updates an Teilnehmer gesendet werden: all, externalOnly oder none |
|
||||
| `replaceExisting` | boolean | Nein | Ob bestehende Teilnehmer ersetzt oder hinzugefügt werden sollen (standardmäßig false) |
|
||||
|
||||
#### Ausgabe
|
||||
|
||||
| Parameter | Typ | Beschreibung |
|
||||
| --------- | ---- | ----------- |
|
||||
| `content` | string | Bestätigungsnachricht für die Teilnehmereinladung mit E-Mail-Zustellungsstatus |
|
||||
| `metadata` | json | Aktualisierte Ereignismetadaten einschließlich Teilnehmerliste und Details |
|
||||
|
||||
## Hinweise
|
||||
|
||||
- Kategorie: `tools`
|
||||
- Typ: `google_calendar`
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user