mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-10 07:27:57 -05:00
feat(i18n): update translations (#1496)
This commit is contained in:
@@ -175,56 +175,30 @@ Verwenden Sie einen `Memory`Block mit einer konsistenten `id` (zum Beispiel `cha
|
||||
- Lesen Sie den Gesprächsverlauf für den Kontext
|
||||
- Hängen Sie die Antwort des Agenten nach dessen Ausführung an
|
||||
|
||||
```yaml
|
||||
# 1) Add latest user message
|
||||
- Memory (operation: add)
|
||||
id: chat
|
||||
role: user
|
||||
content: {{input}}
|
||||
|
||||
# 2) Load conversation history
|
||||
- Memory (operation: get)
|
||||
id: chat
|
||||
|
||||
# 3) Run the agent with prior messages available
|
||||
- Agent
|
||||
System Prompt: ...
|
||||
User Prompt: |
|
||||
Use the conversation so far:
|
||||
{{memory_get.memories}}
|
||||
Current user message: {{input}}
|
||||
|
||||
# 4) Store the agent reply
|
||||
- Memory (operation: add)
|
||||
id: chat
|
||||
role: assistant
|
||||
content: {{agent.content}}
|
||||
```
|
||||
|
||||
Siehe die `Memory`Block-Referenz für Details: [/tools/memory](/tools/memory).
|
||||
Siehe die [`Memory`](/tools/memory) Blockreferenz für Details.
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<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
|
||||
<strong>System-Prompt</strong>: Anweisungen, die das Verhalten und die Rolle des Agenten definieren
|
||||
</li>
|
||||
<li>
|
||||
<strong>User Prompt</strong>: Eingabetext oder -daten zur Verarbeitung
|
||||
<strong>Benutzer-Prompt</strong>: Eingabetext oder zu verarbeitende Daten
|
||||
</li>
|
||||
<li>
|
||||
<strong>Model</strong>: KI-Modellauswahl (OpenAI, Anthropic, Google, etc.)
|
||||
<strong>Modell</strong>: KI-Modellauswahl (OpenAI, Anthropic, Google, usw.)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Temperature</strong>: Steuerung der Antwort-Zufälligkeit (0-2)
|
||||
<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>Response Format</strong>: JSON-Schema für strukturierte Ausgabe
|
||||
<strong>Antwortformat</strong>: JSON-Schema für strukturierte Ausgabe
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
@@ -261,7 +235,7 @@ Siehe die `Memory`Block-Referenz für Details: [/tools/memory](/tools/memory).
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
### Automatisierung des Kundendienstes
|
||||
### Automatisierung des Kundenservice
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Bearbeitung von Kundenanfragen mit Datenbankzugriff</h4>
|
||||
@@ -269,9 +243,9 @@ Siehe die `Memory`Block-Referenz für Details: [/tools/memory](/tools/memory).
|
||||
<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 verfasst eine klare E-Mail-Antwort</li>
|
||||
<li>Agent erstellt eine klare E-Mail-Antwort</li>
|
||||
<li>Gmail sendet die Antwort an den Kunden</li>
|
||||
<li>Konversation wird im Speicher gesichert, um den Verlauf für zukünftige Nachrichten zu erhalten</li>
|
||||
<li>Konversation wird im Memory gespeichert, um den Verlauf für zukünftige Nachrichten beizubehalten</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
@@ -287,20 +261,20 @@ Siehe die `Memory`Block-Referenz für Details: [/tools/memory](/tools/memory).
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Werkzeuggestützter Rechercheassistent
|
||||
### Werkzeuggestützter Forschungsassistent
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Szenario: Rechercheassistent mit Websuche und Dokumentenzugriff</h4>
|
||||
<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 Search-Tool</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 Recherchebericht</li>
|
||||
<li>Agent erstellt umfassenden Forschungsbericht</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Best Practices
|
||||
## Bewährte Praktiken
|
||||
|
||||
- **Sei spezifisch in System-Prompts**: Definiere die Rolle, den Tonfall und die Einschränkungen des Agenten klar. Je spezifischer deine Anweisungen sind, desto besser kann der Agent seinen vorgesehenen Zweck erfüllen.
|
||||
- **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 Tools effektiv**: Integriere Tools, die den Zweck des Agenten ergänzen und seine Fähigkeiten erweitern. Sei selektiv bei der Auswahl der Tools, um den Agenten nicht zu überfordern. Für Aufgaben mit wenig Überschneidung verwende einen anderen Agent-Block für die besten Ergebnisse.
|
||||
- **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.
|
||||
|
||||
@@ -24,15 +24,7 @@ Der API-Trigger stellt Ihren Workflow als sicheren HTTP-Endpunkt bereit. Senden
|
||||
|
||||
Fügen Sie für jeden Parameter ein Feld **Eingabeformat** hinzu. Die Ausgabeschlüssel zur Laufzeit spiegeln das Schema wider und sind auch unter `<api.input>` verfügbar.
|
||||
|
||||
```yaml
|
||||
- type: string
|
||||
name: userId
|
||||
value: demo-user # optional manual test value
|
||||
- type: number
|
||||
name: maxTokens
|
||||
```
|
||||
|
||||
Manuelle Ausführungen im Editor verwenden die Spalte `value`, damit Sie testen können, ohne eine Anfrage zu senden. Während der Ausführung füllt der Resolver sowohl `<api.userId>` als auch `<api.input.userId>`.
|
||||
Manuelle Ausführungen im Editor verwenden die Spalte `value`, damit Sie testen können, ohne eine Anfrage zu senden. Während der Ausführung füllt der Resolver sowohl `<api.userId>` als auch `<api.input.userId>` aus.
|
||||
|
||||
## Anfrage-Beispiel
|
||||
|
||||
@@ -56,5 +48,5 @@ Erfolgreiche Antworten geben das serialisierte Ausführungsergebnis vom Executor
|
||||
Wenn kein Eingabeformat definiert ist, stellt der Executor das rohe JSON nur unter `<api.input>` bereit.
|
||||
|
||||
<Callout type="warning">
|
||||
Ein Workflow kann nur einen API-Trigger enthalten. Veröffentlichen Sie eine neue Bereitstellung nach Änderungen, damit der Endpunkt aktuell bleibt.
|
||||
Ein Workflow kann nur einen API-Trigger enthalten. Veröffentlichen Sie nach Änderungen eine neue Bereitstellung, damit der Endpunkt aktuell bleibt.
|
||||
</Callout>
|
||||
|
||||
@@ -10,7 +10,6 @@ type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
- connections
|
||||
properties:
|
||||
type:
|
||||
@@ -22,21 +21,23 @@ properties:
|
||||
description: Display name for this loop block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- loopType
|
||||
description: Optional. If omitted, defaults will be applied.
|
||||
properties:
|
||||
loopType:
|
||||
type: string
|
||||
enum: [for, forEach]
|
||||
description: Type of loop to execute
|
||||
default: for
|
||||
iterations:
|
||||
type: number
|
||||
description: Number of iterations (for 'for' loops)
|
||||
default: 5
|
||||
minimum: 1
|
||||
maximum: 1000
|
||||
collection:
|
||||
type: string
|
||||
description: Collection to iterate over (for 'forEach' loops)
|
||||
default: ""
|
||||
maxConcurrency:
|
||||
type: number
|
||||
description: Maximum concurrent executions
|
||||
@@ -45,13 +46,10 @@ properties:
|
||||
maximum: 10
|
||||
connections:
|
||||
type: object
|
||||
required:
|
||||
- loop
|
||||
properties:
|
||||
# Nested format (recommended)
|
||||
loop:
|
||||
type: object
|
||||
required:
|
||||
- start
|
||||
properties:
|
||||
start:
|
||||
type: string
|
||||
@@ -59,26 +57,37 @@ properties:
|
||||
end:
|
||||
type: string
|
||||
description: Target block ID for loop completion (optional)
|
||||
# Direct handle format (alternative)
|
||||
loop-start-source:
|
||||
type: string | string[]
|
||||
description: Target block ID to execute inside the loop (direct format)
|
||||
loop-end-source:
|
||||
type: string | string[]
|
||||
description: Target block ID for loop completion (direct format, optional)
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
note: Use either the nested 'loop' format OR the direct 'loop-start-source' format, not both
|
||||
```
|
||||
|
||||
## Verbindungskonfiguration
|
||||
|
||||
Loop-Blöcke verwenden ein spezielles Verbindungsformat mit einem `loop`Abschnitt:
|
||||
Loop-Blöcke unterstützen zwei Verbindungsformate:
|
||||
|
||||
### Direktes Handle-Format (Alternative)
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
loop:
|
||||
start: <string> # Target block ID to execute inside the loop
|
||||
end: <string> # Target block ID after loop completion (optional)
|
||||
loop-start-source: <string> # Target block ID to execute inside the loop
|
||||
loop-end-source: <string> # Target block ID after loop completion (optional)
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
Beide Formate funktionieren identisch. Verwenden Sie das Format, das Ihnen besser gefällt.
|
||||
|
||||
## Konfiguration von untergeordneten Blöcken
|
||||
|
||||
Blöcke innerhalb einer Schleife müssen ihre `parentId` auf die Loop-Block-ID setzen:
|
||||
Blöcke innerhalb einer Schleife müssen ihre `parentId` auf die Loop-Block-ID gesetzt haben. Die Eigenschaft `extent` wird automatisch auf `'parent'` gesetzt und muss nicht angegeben werden:
|
||||
|
||||
```yaml
|
||||
loop-1:
|
||||
@@ -106,7 +115,7 @@ process-item:
|
||||
|
||||
## Beispiele
|
||||
|
||||
### For-Schleife (feste Iterationen)
|
||||
### For-Schleife (feste Anzahl von Iterationen)
|
||||
|
||||
```yaml
|
||||
countdown-loop:
|
||||
@@ -227,7 +236,7 @@ store-analysis:
|
||||
};
|
||||
```
|
||||
|
||||
### Schleife mit paralleler Verarbeitung
|
||||
### Schleife für parallele Verarbeitung
|
||||
|
||||
```yaml
|
||||
parallel-processing-loop:
|
||||
@@ -261,9 +270,62 @@ process-task:
|
||||
success: task-completed
|
||||
```
|
||||
|
||||
### Beispiel für direktes Handle-Format
|
||||
|
||||
Dieselbe Schleife kann mit dem direkten Handle-Format geschrieben werden:
|
||||
|
||||
```yaml
|
||||
my-loop:
|
||||
type: loop
|
||||
name: "Process Items"
|
||||
inputs:
|
||||
loopType: forEach
|
||||
collection: <start.items>
|
||||
connections:
|
||||
loop-start-source: process-item # Direct handle format
|
||||
loop-end-source: final-results # Direct handle format
|
||||
error: handle-error
|
||||
|
||||
process-item:
|
||||
type: agent
|
||||
name: "Process Item"
|
||||
parentId: my-loop
|
||||
inputs:
|
||||
systemPrompt: "Process this item"
|
||||
userPrompt: <loop.currentItem>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
### Minimales Schleifenbeispiel (mit Standardwerten)
|
||||
|
||||
Sie können den Abschnitt `inputs` vollständig weglassen, dann werden Standardwerte angewendet:
|
||||
|
||||
```yaml
|
||||
simple-loop:
|
||||
type: loop
|
||||
name: "Simple Loop"
|
||||
# No inputs section - defaults to loopType: 'for', iterations: 5
|
||||
connections:
|
||||
loop-start-source: process-step
|
||||
loop-end-source: complete
|
||||
|
||||
process-step:
|
||||
type: agent
|
||||
name: "Process Step"
|
||||
parentId: simple-loop
|
||||
inputs:
|
||||
systemPrompt: "Execute step"
|
||||
userPrompt: "Step <loop.index>"
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
Diese Schleife führt standardmäßig 5 Iterationen aus.
|
||||
|
||||
## Schleifenvariablen
|
||||
|
||||
Innerhalb von untergeordneten Schleifenblöcken sind diese speziellen Variablen verfügbar:
|
||||
Innerhalb von Schleifenunterblöcken sind diese speziellen Variablen verfügbar:
|
||||
|
||||
```yaml
|
||||
# Available in all child blocks of the loop
|
||||
@@ -290,6 +352,6 @@ final-processor:
|
||||
- Verwenden Sie forEach für die Verarbeitung von Sammlungen, for-Schleifen für feste Iterationen
|
||||
- Erwägen Sie die Verwendung von maxConcurrency für I/O-gebundene Operationen
|
||||
- Integrieren Sie Fehlerbehandlung für eine robuste Schleifenausführung
|
||||
- Verwenden Sie aussagekräftige Namen für Schleifen-Unterblöcke
|
||||
- Verwenden Sie aussagekräftige Namen für Schleifenunterblöcke
|
||||
- Testen Sie zuerst mit kleinen Sammlungen
|
||||
- Überwachen Sie die Ausführungszeit bei großen Sammlungen
|
||||
- Überwachen Sie die Ausführungszeit für große Sammlungen
|
||||
@@ -175,33 +175,7 @@ Utiliza un bloque `Memory` con un `id` consistente (por ejemplo, `chat`) para pe
|
||||
- Lee el historial de conversación para contexto
|
||||
- Añade la respuesta del agente después de que se ejecute
|
||||
|
||||
```yaml
|
||||
# 1) Add latest user message
|
||||
- Memory (operation: add)
|
||||
id: chat
|
||||
role: user
|
||||
content: {{input}}
|
||||
|
||||
# 2) Load conversation history
|
||||
- Memory (operation: get)
|
||||
id: chat
|
||||
|
||||
# 3) Run the agent with prior messages available
|
||||
- Agent
|
||||
System Prompt: ...
|
||||
User Prompt: |
|
||||
Use the conversation so far:
|
||||
{{memory_get.memories}}
|
||||
Current user message: {{input}}
|
||||
|
||||
# 4) Store the agent reply
|
||||
- Memory (operation: add)
|
||||
id: chat
|
||||
role: assistant
|
||||
content: {{agent.content}}
|
||||
```
|
||||
|
||||
Consulta la referencia del bloque `Memory` para más detalles: [/tools/memory](/tools/memory).
|
||||
Consulta la referencia del bloque [`Memory`](/tools/memory) para más detalles.
|
||||
|
||||
## Entradas y salidas
|
||||
|
||||
@@ -212,7 +186,7 @@ Consulta la referencia del bloque `Memory` para más detalles: [/tools/memory](/
|
||||
<strong>Prompt del sistema</strong>: Instrucciones que definen el comportamiento y rol del agente
|
||||
</li>
|
||||
<li>
|
||||
<strong>Prompt del usuario</strong>: Texto de entrada o datos a procesar
|
||||
<strong>Prompt del usuario</strong>: Texto o datos de entrada para procesar
|
||||
</li>
|
||||
<li>
|
||||
<strong>Modelo</strong>: Selección del modelo de IA (OpenAI, Anthropic, Google, etc.)
|
||||
@@ -231,13 +205,13 @@ Consulta la referencia del bloque `Memory` para más detalles: [/tools/memory](/
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>agent.content</strong>: Texto de respuesta o datos estructurados del agente
|
||||
<strong>agent.content</strong>: Texto de respuesta del agente o datos estructurados
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.tokens</strong>: Objeto de estadísticas de uso de tokens
|
||||
<strong>agent.tokens</strong>: Objeto con estadísticas de uso de tokens
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.tool_calls</strong>: Array de detalles de ejecución de herramientas
|
||||
<strong>agent.tool_calls</strong>: Array con detalles de ejecución de herramientas
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.cost</strong>: Costo estimado de la llamada a la API (si está disponible)
|
||||
@@ -247,7 +221,7 @@ Consulta la referencia del bloque `Memory` para más detalles: [/tools/memory](/
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Contenido</strong>: Salida de respuesta principal del agente
|
||||
<strong>Contenido</strong>: Salida principal de respuesta del agente
|
||||
</li>
|
||||
<li>
|
||||
<strong>Metadatos</strong>: Estadísticas de uso y detalles de ejecución
|
||||
@@ -267,15 +241,15 @@ Consulta la referencia del bloque `Memory` para más detalles: [/tools/memory](/
|
||||
<h4 className="font-medium">Escenario: Gestionar consultas de clientes con acceso a base de datos</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>El usuario envía un ticket de soporte a través del bloque API</li>
|
||||
<li>El agente verifica pedidos/suscripciones en Postgres y busca en la base de conocimientos para obtener orientación</li>
|
||||
<li>El agente verifica pedidos/suscripciones en Postgres y busca en la base de conocimientos</li>
|
||||
<li>Si se necesita escalamiento, el agente crea una incidencia en Linear con el contexto relevante</li>
|
||||
<li>El agente redacta una respuesta clara por correo electrónico</li>
|
||||
<li>Gmail envía la respuesta al cliente</li>
|
||||
<li>La conversación se guarda en Memoria para mantener el historial para mensajes futuros</li>
|
||||
<li>La conversación se guarda en Memory para mantener el historial para mensajes futuros</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Análisis de contenido multi-modelo
|
||||
### Análisis de contenido con múltiples modelos
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Escenario: Analizar contenido con diferentes modelos de IA</h4>
|
||||
@@ -287,13 +261,13 @@ Consulta la referencia del bloque `Memory` para más detalles: [/tools/memory](/
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Asistente de investigación con herramientas
|
||||
### Asistente de investigación potenciado por herramientas
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Escenario: Asistente de investigación con búsqueda web y acceso a documentos</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Consulta del usuario recibida a través de entrada</li>
|
||||
<li>El agente busca en la web usando la herramienta de Google Search</li>
|
||||
<li>El agente busca en la web utilizando la herramienta de Google Search</li>
|
||||
<li>El agente accede a la base de datos de Notion para documentos internos</li>
|
||||
<li>El agente compila un informe de investigación completo</li>
|
||||
</ol>
|
||||
@@ -301,6 +275,6 @@ Consulta la referencia del bloque `Memory` para más detalles: [/tools/memory](/
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
- **Sé específico en los prompts del sistema**: Define claramente el rol, tono y limitaciones del agente. Cuanto más específicas sean tus instrucciones, mejor podrá el agente cumplir con su propósito previsto.
|
||||
- **Sé específico en los prompts del sistema**: Define claramente el rol del agente, el tono y las limitaciones. Cuanto más específicas sean tus instrucciones, mejor podrá el agente cumplir con su propósito previsto.
|
||||
- **Elige la configuración de temperatura adecuada**: Usa configuraciones de temperatura más bajas (0-0.3) cuando la precisión es importante, o aumenta la temperatura (0.7-2.0) para respuestas más creativas o variadas
|
||||
- **Aprovecha las herramientas de manera efectiva**: Integra herramientas que complementen el propósito del agente y mejoren sus capacidades. Sé selectivo sobre qué herramientas proporcionas para evitar sobrecargar al agente. Para tareas con poca superposición, usa otro bloque de Agente para obtener los mejores resultados.
|
||||
- **Aprovecha las herramientas de manera efectiva**: Integra herramientas que complementen el propósito del agente y mejoren sus capacidades. Sé selectivo sobre qué herramientas proporcionas para evitar sobrecargar al agente. Para tareas con poco solapamiento, usa otro bloque de Agente para obtener los mejores resultados.
|
||||
|
||||
@@ -24,14 +24,6 @@ El disparador de API expone tu flujo de trabajo como un punto de conexión HTTP
|
||||
|
||||
Añade un campo de **Formato de entrada** para cada parámetro. Las claves de salida en tiempo de ejecución reflejan el esquema y también están disponibles bajo `<api.input>`.
|
||||
|
||||
```yaml
|
||||
- type: string
|
||||
name: userId
|
||||
value: demo-user # optional manual test value
|
||||
- type: number
|
||||
name: maxTokens
|
||||
```
|
||||
|
||||
Las ejecuciones manuales en el editor utilizan la columna `value` para que puedas realizar pruebas sin enviar una solicitud. Durante la ejecución, el resolutor completa tanto `<api.userId>` como `<api.input.userId>`.
|
||||
|
||||
## Ejemplo de solicitud
|
||||
@@ -44,17 +36,17 @@ curl -X POST \
|
||||
-d '{"userId":"demo-user","maxTokens":1024}'
|
||||
```
|
||||
|
||||
Las respuestas exitosas devuelven el resultado de ejecución serializado del Ejecutor. Los errores muestran fallos de validación, autenticación o del flujo de trabajo.
|
||||
Las respuestas exitosas devuelven el resultado de ejecución serializado del Ejecutor. Los errores muestran fallos de validación, autenticación o flujo de trabajo.
|
||||
|
||||
## Referencia de salida
|
||||
|
||||
| Referencia | Descripción |
|
||||
|-----------|-------------|
|
||||
| `<api.field>` | Campo definido en el formato de entrada |
|
||||
| `<api.field>` | Campo definido en el Formato de Entrada |
|
||||
| `<api.input>` | Cuerpo completo estructurado de la solicitud |
|
||||
|
||||
Si no se define un formato de entrada, el ejecutor expone el JSON sin procesar solo en `<api.input>`.
|
||||
Si no se define un Formato de Entrada, el ejecutor expone el JSON sin procesar solo en `<api.input>`.
|
||||
|
||||
<Callout type="warning">
|
||||
Un flujo de trabajo puede contener solo un disparador de API. Publica una nueva implementación después de realizar cambios para que el punto de conexión se mantenga actualizado.
|
||||
Un flujo de trabajo puede contener solo un Disparador de API. Publica una nueva implementación después de realizar cambios para que el punto de conexión se mantenga actualizado.
|
||||
</Callout>
|
||||
|
||||
@@ -10,7 +10,6 @@ type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
- connections
|
||||
properties:
|
||||
type:
|
||||
@@ -22,21 +21,23 @@ properties:
|
||||
description: Display name for this loop block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- loopType
|
||||
description: Optional. If omitted, defaults will be applied.
|
||||
properties:
|
||||
loopType:
|
||||
type: string
|
||||
enum: [for, forEach]
|
||||
description: Type of loop to execute
|
||||
default: for
|
||||
iterations:
|
||||
type: number
|
||||
description: Number of iterations (for 'for' loops)
|
||||
default: 5
|
||||
minimum: 1
|
||||
maximum: 1000
|
||||
collection:
|
||||
type: string
|
||||
description: Collection to iterate over (for 'forEach' loops)
|
||||
default: ""
|
||||
maxConcurrency:
|
||||
type: number
|
||||
description: Maximum concurrent executions
|
||||
@@ -45,13 +46,10 @@ properties:
|
||||
maximum: 10
|
||||
connections:
|
||||
type: object
|
||||
required:
|
||||
- loop
|
||||
properties:
|
||||
# Nested format (recommended)
|
||||
loop:
|
||||
type: object
|
||||
required:
|
||||
- start
|
||||
properties:
|
||||
start:
|
||||
type: string
|
||||
@@ -59,26 +57,37 @@ properties:
|
||||
end:
|
||||
type: string
|
||||
description: Target block ID for loop completion (optional)
|
||||
# Direct handle format (alternative)
|
||||
loop-start-source:
|
||||
type: string | string[]
|
||||
description: Target block ID to execute inside the loop (direct format)
|
||||
loop-end-source:
|
||||
type: string | string[]
|
||||
description: Target block ID for loop completion (direct format, optional)
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
note: Use either the nested 'loop' format OR the direct 'loop-start-source' format, not both
|
||||
```
|
||||
|
||||
## Configuración de conexión
|
||||
|
||||
Los bloques Loop utilizan un formato de conexión especial con una sección `loop`:
|
||||
Los bloques de bucle admiten dos formatos de conexión:
|
||||
|
||||
### Formato de manejador directo (alternativo)
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
loop:
|
||||
start: <string> # Target block ID to execute inside the loop
|
||||
end: <string> # Target block ID after loop completion (optional)
|
||||
loop-start-source: <string> # Target block ID to execute inside the loop
|
||||
loop-end-source: <string> # Target block ID after loop completion (optional)
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
Ambos formatos funcionan de manera idéntica. Usa el que prefieras.
|
||||
|
||||
## Configuración de bloques secundarios
|
||||
|
||||
Los bloques dentro de un bucle deben tener su `parentId` configurado con el ID del bloque loop:
|
||||
Los bloques dentro de un bucle deben tener su `parentId` configurado con el ID del bloque de bucle. La propiedad `extent` se establece automáticamente como `'parent'` y no necesita ser especificada:
|
||||
|
||||
```yaml
|
||||
loop-1:
|
||||
@@ -261,6 +270,59 @@ process-task:
|
||||
success: task-completed
|
||||
```
|
||||
|
||||
### Ejemplo de formato de manejador directo
|
||||
|
||||
El mismo bucle puede escribirse usando el formato de manejador directo:
|
||||
|
||||
```yaml
|
||||
my-loop:
|
||||
type: loop
|
||||
name: "Process Items"
|
||||
inputs:
|
||||
loopType: forEach
|
||||
collection: <start.items>
|
||||
connections:
|
||||
loop-start-source: process-item # Direct handle format
|
||||
loop-end-source: final-results # Direct handle format
|
||||
error: handle-error
|
||||
|
||||
process-item:
|
||||
type: agent
|
||||
name: "Process Item"
|
||||
parentId: my-loop
|
||||
inputs:
|
||||
systemPrompt: "Process this item"
|
||||
userPrompt: <loop.currentItem>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
### Ejemplo de bucle mínimo (usando valores predeterminados)
|
||||
|
||||
Puedes omitir completamente la sección `inputs`, y se aplicarán los valores predeterminados:
|
||||
|
||||
```yaml
|
||||
simple-loop:
|
||||
type: loop
|
||||
name: "Simple Loop"
|
||||
# No inputs section - defaults to loopType: 'for', iterations: 5
|
||||
connections:
|
||||
loop-start-source: process-step
|
||||
loop-end-source: complete
|
||||
|
||||
process-step:
|
||||
type: agent
|
||||
name: "Process Step"
|
||||
parentId: simple-loop
|
||||
inputs:
|
||||
systemPrompt: "Execute step"
|
||||
userPrompt: "Step <loop.index>"
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
Este bucle ejecutará 5 iteraciones por defecto.
|
||||
|
||||
## Variables de bucle
|
||||
|
||||
Dentro de los bloques secundarios del bucle, estas variables especiales están disponibles:
|
||||
@@ -286,10 +348,10 @@ final-processor:
|
||||
|
||||
## Mejores prácticas
|
||||
|
||||
- Establece límites razonables de iteración para evitar tiempos de ejecución prolongados
|
||||
- Establece límites de iteración razonables para evitar tiempos de ejecución largos
|
||||
- Usa forEach para procesar colecciones, bucles for para iteraciones fijas
|
||||
- Considera usar maxConcurrency para operaciones limitadas por E/S
|
||||
- Incluye manejo de errores para una ejecución robusta de bucles
|
||||
- Incluye manejo de errores para una ejecución robusta del bucle
|
||||
- Usa nombres descriptivos para los bloques secundarios del bucle
|
||||
- Prueba primero con colecciones pequeñas
|
||||
- Monitorea el tiempo de ejecución para colecciones grandes
|
||||
@@ -175,33 +175,7 @@ Utilisez un bloc `Memory` avec un `id` cohérent (par exemple, `chat`) pour cons
|
||||
- Lisez l'historique de conversation pour le contexte
|
||||
- Ajoutez la réponse de l'Agent après son exécution
|
||||
|
||||
```yaml
|
||||
# 1) Add latest user message
|
||||
- Memory (operation: add)
|
||||
id: chat
|
||||
role: user
|
||||
content: {{input}}
|
||||
|
||||
# 2) Load conversation history
|
||||
- Memory (operation: get)
|
||||
id: chat
|
||||
|
||||
# 3) Run the agent with prior messages available
|
||||
- Agent
|
||||
System Prompt: ...
|
||||
User Prompt: |
|
||||
Use the conversation so far:
|
||||
{{memory_get.memories}}
|
||||
Current user message: {{input}}
|
||||
|
||||
# 4) Store the agent reply
|
||||
- Memory (operation: add)
|
||||
id: chat
|
||||
role: assistant
|
||||
content: {{agent.content}}
|
||||
```
|
||||
|
||||
Consultez la référence du bloc `Memory` pour plus de détails : [/tools/memory](/tools/memory).
|
||||
Voir la référence du bloc [`Memory`](/tools/memory) pour plus de détails.
|
||||
|
||||
## Entrées et sorties
|
||||
|
||||
@@ -209,51 +183,51 @@ Consultez la référence du bloc `Memory` pour plus de détails : [/tools/memory
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Prompt système</strong> : Instructions définissant le comportement et le rôle de l'agent
|
||||
<strong>Prompt système</strong> : instructions définissant le comportement et le rôle de l'agent
|
||||
</li>
|
||||
<li>
|
||||
<strong>Prompt utilisateur</strong> : Texte d'entrée ou données à traiter
|
||||
<strong>Prompt utilisateur</strong> : texte ou données d'entrée à traiter
|
||||
</li>
|
||||
<li>
|
||||
<strong>Modèle</strong> : Sélection du modèle d'IA (OpenAI, Anthropic, Google, etc.)
|
||||
<strong>Modèle</strong> : sélection du modèle d'IA (OpenAI, Anthropic, Google, etc.)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Température</strong> : Contrôle de l'aléatoire des réponses (0-2)
|
||||
<strong>Température</strong> : contrôle de l'aléatoire des réponses (0-2)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Outils</strong> : Tableau d'outils disponibles pour l'appel de fonctions
|
||||
<strong>Outils</strong> : tableau des outils disponibles pour l'appel de fonctions
|
||||
</li>
|
||||
<li>
|
||||
<strong>Format de réponse</strong> : Schéma JSON pour une sortie structurée
|
||||
<strong>Format de réponse</strong> : schéma JSON pour une sortie structurée
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>agent.content</strong> : Texte de réponse de l'agent ou données structurées
|
||||
<strong>agent.content</strong> : texte de réponse de l'agent ou données structurées
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.tokens</strong> : Objet de statistiques d'utilisation des tokens
|
||||
<strong>agent.tokens</strong> : objet de statistiques d'utilisation des tokens
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.tool_calls</strong> : Tableau des détails d'exécution des outils
|
||||
<strong>agent.tool_calls</strong> : tableau des détails d'exécution des outils
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.cost</strong> : Coût estimé de l'appel API (si disponible)
|
||||
<strong>agent.cost</strong> : coût estimé de l'appel API (si disponible)
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Contenu</strong> : Sortie de réponse principale de l'agent
|
||||
<strong>Contenu</strong> : sortie de réponse principale de l'agent
|
||||
</li>
|
||||
<li>
|
||||
<strong>Métadonnées</strong> : Statistiques d'utilisation et détails d'exécution
|
||||
<strong>Métadonnées</strong> : statistiques d'utilisation et détails d'exécution
|
||||
</li>
|
||||
<li>
|
||||
<strong>Accès</strong> : Disponible dans les blocs après l'agent
|
||||
<strong>Accès</strong> : disponible dans les blocs après l'agent
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
@@ -268,7 +242,7 @@ Consultez la référence du bloc `Memory` pour plus de détails : [/tools/memory
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>L'utilisateur soumet un ticket de support via le bloc API</li>
|
||||
<li>L'agent vérifie les commandes/abonnements dans Postgres et recherche des conseils dans la base de connaissances</li>
|
||||
<li>Si une escalade est nécessaire, l'agent crée un ticket Linear avec le contexte pertinent</li>
|
||||
<li>Si une escalade est nécessaire, l'agent crée un problème Linear avec le contexte pertinent</li>
|
||||
<li>L'agent rédige une réponse par e-mail claire</li>
|
||||
<li>Gmail envoie la réponse au client</li>
|
||||
<li>La conversation est enregistrée dans Memory pour conserver l'historique des messages futurs</li>
|
||||
@@ -278,7 +252,7 @@ Consultez la référence du bloc `Memory` pour plus de détails : [/tools/memory
|
||||
### Analyse de contenu multi-modèles
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scénario : analyser du contenu avec différents modèles d'IA</h4>
|
||||
<h4 className="font-medium">Scénario : analyser le contenu avec différents modèles d'IA</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Le bloc de fonction traite le document téléchargé</li>
|
||||
<li>L'agent avec GPT-4o effectue une analyse technique</li>
|
||||
|
||||
@@ -24,14 +24,6 @@ Le déclencheur d'API expose votre flux de travail en tant que point de terminai
|
||||
|
||||
Ajoutez un champ **Format d'entrée** pour chaque paramètre. Les clés de sortie d'exécution reflètent le schéma et sont également disponibles sous `<api.input>`.
|
||||
|
||||
```yaml
|
||||
- type: string
|
||||
name: userId
|
||||
value: demo-user # optional manual test value
|
||||
- type: number
|
||||
name: maxTokens
|
||||
```
|
||||
|
||||
Les exécutions manuelles dans l'éditeur utilisent la colonne `value` pour que vous puissiez tester sans envoyer de requête. Pendant l'exécution, le résolveur remplit à la fois `<api.userId>` et `<api.input.userId>`.
|
||||
|
||||
## Exemple de requête
|
||||
@@ -44,17 +36,17 @@ curl -X POST \
|
||||
-d '{"userId":"demo-user","maxTokens":1024}'
|
||||
```
|
||||
|
||||
Les réponses réussies renvoient le résultat d'exécution sérialisé de l'Exécuteur. Les erreurs révèlent des problèmes de validation, d'authentification ou d'échec du flux de travail.
|
||||
Les réponses réussies renvoient le résultat d'exécution sérialisé de l'exécuteur. Les erreurs révèlent des problèmes de validation, d'authentification ou d'échec du workflow.
|
||||
|
||||
## Référence de sortie
|
||||
## Référence des sorties
|
||||
|
||||
| Référence | Description |
|
||||
|-----------|-------------|
|
||||
| `<api.field>` | Champ défini dans le Format d'entrée |
|
||||
| `<api.input>` | Corps de la requête structuré complet |
|
||||
| `<api.field>` | Champ défini dans le format d'entrée |
|
||||
| `<api.input>` | Corps de requête structuré complet |
|
||||
|
||||
Si aucun Format d'entrée n'est défini, l'exécuteur expose le JSON brut uniquement à `<api.input>`.
|
||||
Si aucun format d'entrée n'est défini, l'exécuteur expose uniquement le JSON brut à `<api.input>`.
|
||||
|
||||
<Callout type="warning">
|
||||
Un flux de travail ne peut contenir qu'un seul déclencheur d'API. Publiez un nouveau déploiement après les modifications pour que le point de terminaison reste à jour.
|
||||
Un workflow ne peut contenir qu'un seul déclencheur API. Publiez un nouveau déploiement après les modifications pour que le point de terminaison reste à jour.
|
||||
</Callout>
|
||||
|
||||
@@ -10,7 +10,6 @@ type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
- connections
|
||||
properties:
|
||||
type:
|
||||
@@ -22,21 +21,23 @@ properties:
|
||||
description: Display name for this loop block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- loopType
|
||||
description: Optional. If omitted, defaults will be applied.
|
||||
properties:
|
||||
loopType:
|
||||
type: string
|
||||
enum: [for, forEach]
|
||||
description: Type of loop to execute
|
||||
default: for
|
||||
iterations:
|
||||
type: number
|
||||
description: Number of iterations (for 'for' loops)
|
||||
default: 5
|
||||
minimum: 1
|
||||
maximum: 1000
|
||||
collection:
|
||||
type: string
|
||||
description: Collection to iterate over (for 'forEach' loops)
|
||||
default: ""
|
||||
maxConcurrency:
|
||||
type: number
|
||||
description: Maximum concurrent executions
|
||||
@@ -45,13 +46,10 @@ properties:
|
||||
maximum: 10
|
||||
connections:
|
||||
type: object
|
||||
required:
|
||||
- loop
|
||||
properties:
|
||||
# Nested format (recommended)
|
||||
loop:
|
||||
type: object
|
||||
required:
|
||||
- start
|
||||
properties:
|
||||
start:
|
||||
type: string
|
||||
@@ -59,26 +57,37 @@ properties:
|
||||
end:
|
||||
type: string
|
||||
description: Target block ID for loop completion (optional)
|
||||
# Direct handle format (alternative)
|
||||
loop-start-source:
|
||||
type: string | string[]
|
||||
description: Target block ID to execute inside the loop (direct format)
|
||||
loop-end-source:
|
||||
type: string | string[]
|
||||
description: Target block ID for loop completion (direct format, optional)
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
note: Use either the nested 'loop' format OR the direct 'loop-start-source' format, not both
|
||||
```
|
||||
|
||||
## Configuration de connexion
|
||||
|
||||
Les blocs Loop utilisent un format de connexion spécial avec une section `loop` :
|
||||
Les blocs de boucle prennent en charge deux formats de connexion :
|
||||
|
||||
### Format de gestion directe (alternative)
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
loop:
|
||||
start: <string> # Target block ID to execute inside the loop
|
||||
end: <string> # Target block ID after loop completion (optional)
|
||||
loop-start-source: <string> # Target block ID to execute inside the loop
|
||||
loop-end-source: <string> # Target block ID after loop completion (optional)
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
Les deux formats fonctionnent de manière identique. Utilisez celui que vous préférez.
|
||||
|
||||
## Configuration des blocs enfants
|
||||
|
||||
Les blocs à l'intérieur d'une boucle doivent avoir leur `parentId` défini sur l'ID du bloc de boucle :
|
||||
Les blocs à l'intérieur d'une boucle doivent avoir leur `parentId` défini sur l'ID du bloc de boucle. La propriété `extent` est automatiquement définie sur `'parent'` et n'a pas besoin d'être spécifiée :
|
||||
|
||||
```yaml
|
||||
loop-1:
|
||||
@@ -261,9 +270,62 @@ process-task:
|
||||
success: task-completed
|
||||
```
|
||||
|
||||
### Exemple de format de gestion directe
|
||||
|
||||
La même boucle peut être écrite en utilisant le format de gestion directe :
|
||||
|
||||
```yaml
|
||||
my-loop:
|
||||
type: loop
|
||||
name: "Process Items"
|
||||
inputs:
|
||||
loopType: forEach
|
||||
collection: <start.items>
|
||||
connections:
|
||||
loop-start-source: process-item # Direct handle format
|
||||
loop-end-source: final-results # Direct handle format
|
||||
error: handle-error
|
||||
|
||||
process-item:
|
||||
type: agent
|
||||
name: "Process Item"
|
||||
parentId: my-loop
|
||||
inputs:
|
||||
systemPrompt: "Process this item"
|
||||
userPrompt: <loop.currentItem>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
### Exemple de boucle minimale (utilisant les valeurs par défaut)
|
||||
|
||||
Vous pouvez omettre entièrement la section `inputs`, et les valeurs par défaut seront appliquées :
|
||||
|
||||
```yaml
|
||||
simple-loop:
|
||||
type: loop
|
||||
name: "Simple Loop"
|
||||
# No inputs section - defaults to loopType: 'for', iterations: 5
|
||||
connections:
|
||||
loop-start-source: process-step
|
||||
loop-end-source: complete
|
||||
|
||||
process-step:
|
||||
type: agent
|
||||
name: "Process Step"
|
||||
parentId: simple-loop
|
||||
inputs:
|
||||
systemPrompt: "Execute step"
|
||||
userPrompt: "Step <loop.index>"
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
Cette boucle exécutera 5 itérations par défaut.
|
||||
|
||||
## Variables de boucle
|
||||
|
||||
À l'intérieur des blocs enfants de la boucle, ces variables spéciales sont disponibles :
|
||||
À l'intérieur des blocs enfants de boucle, ces variables spéciales sont disponibles :
|
||||
|
||||
```yaml
|
||||
# Available in all child blocks of the loop
|
||||
|
||||
@@ -172,33 +172,7 @@ When responding to questions about investments, include risk disclaimers.
|
||||
- コンテキストのために会話履歴を読み取る
|
||||
- エージェントの実行後に返信を追加
|
||||
|
||||
```yaml
|
||||
# 1) Add latest user message
|
||||
- Memory (operation: add)
|
||||
id: chat
|
||||
role: user
|
||||
content: {{input}}
|
||||
|
||||
# 2) Load conversation history
|
||||
- Memory (operation: get)
|
||||
id: chat
|
||||
|
||||
# 3) Run the agent with prior messages available
|
||||
- Agent
|
||||
System Prompt: ...
|
||||
User Prompt: |
|
||||
Use the conversation so far:
|
||||
{{memory_get.memories}}
|
||||
Current user message: {{input}}
|
||||
|
||||
# 4) Store the agent reply
|
||||
- Memory (operation: add)
|
||||
id: chat
|
||||
role: assistant
|
||||
content: {{agent.content}}
|
||||
```
|
||||
|
||||
詳細については`Memory`ブロックリファレンスを参照してください: [/tools/memory](/tools/memory)。
|
||||
詳細については[`Memory`](/tools/memory)ブロックリファレンスを参照してください。
|
||||
|
||||
## 入力と出力
|
||||
|
||||
@@ -209,7 +183,7 @@ When responding to questions about investments, include risk disclaimers.
|
||||
<strong>システムプロンプト</strong>: エージェントの動作と役割を定義する指示
|
||||
</li>
|
||||
<li>
|
||||
<strong>ユーザープロンプト</strong>: 処理する入力テキストまたはデータ
|
||||
<strong>ユーザープロンプト</strong>: 処理するテキストまたはデータ入力
|
||||
</li>
|
||||
<li>
|
||||
<strong>モデル</strong>: AIモデルの選択(OpenAI、Anthropic、Google など)
|
||||
@@ -221,14 +195,14 @@ When responding to questions about investments, include risk disclaimers.
|
||||
<strong>ツール</strong>: 関数呼び出し用の利用可能なツールの配列
|
||||
</li>
|
||||
<li>
|
||||
<strong>レスポンス形式</strong>: 構造化出力用のJSONスキーマ
|
||||
<strong>レスポンス形式</strong>: 構造化された出力のためのJSONスキーマ
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>agent.content</strong>: エージェントのレスポンステキストまたは構造化データ
|
||||
<strong>agent.content</strong>: エージェントの応答テキストまたは構造化データ
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.tokens</strong>: トークン使用統計オブジェクト
|
||||
@@ -237,14 +211,14 @@ When responding to questions about investments, include risk disclaimers.
|
||||
<strong>agent.tool_calls</strong>: ツール実行詳細の配列
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.cost</strong>: 推定APIコールコスト(利用可能な場合)
|
||||
<strong>agent.cost</strong>: 推定APIコール費用(利用可能な場合)
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>コンテンツ</strong>: エージェントからの主要なレスポンス出力
|
||||
<strong>コンテンツ</strong>: エージェントからの主要な応答出力
|
||||
</li>
|
||||
<li>
|
||||
<strong>メタデータ</strong>: 使用統計と実行詳細
|
||||
@@ -261,43 +235,43 @@ When responding to questions about investments, include risk disclaimers.
|
||||
### カスタマーサポートの自動化
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">シナリオ:データベースアクセスによる顧客問い合わせ対応</h4>
|
||||
<h4 className="font-medium">シナリオ: データベースアクセスによる顧客問い合わせ対応</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>ユーザーがAPIブロックを通じてサポートチケットを送信</li>
|
||||
<li>ユーザーがAPIブロック経由でサポートチケットを送信</li>
|
||||
<li>エージェントがPostgresで注文/サブスクリプションを確認し、ナレッジベースでガイダンスを検索</li>
|
||||
<li>エスカレーションが必要な場合、エージェントは関連コンテキストを含むLinearの課題を作成</li>
|
||||
<li>エージェントが明確なメール返信を作成</li>
|
||||
<li>エージェントが明確な返信メールを作成</li>
|
||||
<li>Gmailが顧客に返信を送信</li>
|
||||
<li>将来のメッセージのために会話履歴を維持するため、会話がメモリに保存される</li>
|
||||
<li>将来のメッセージのために履歴を維持するため、会話がメモリに保存される</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### マルチモデルコンテンツ分析
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">シナリオ:異なるAIモデルでコンテンツを分析</h4>
|
||||
<h4 className="font-medium">シナリオ: 異なるAIモデルでコンテンツを分析</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>ファンクションブロックがアップロードされた文書を処理</li>
|
||||
<li>関数ブロックがアップロードされた文書を処理</li>
|
||||
<li>GPT-4oを搭載したエージェントが技術的分析を実行</li>
|
||||
<li>Claudeを搭載したエージェントが感情やトーンを分析</li>
|
||||
<li>ファンクションブロックが最終レポート用に結果を統合</li>
|
||||
<li>Claudeを搭載したエージェントが感情とトーンを分析</li>
|
||||
<li>関数ブロックが最終レポート用に結果を統合</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### ツール活用型リサーチアシスタント
|
||||
### ツール搭載型リサーチアシスタント
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">シナリオ:ウェブ検索と文書アクセス機能を持つリサーチアシスタント</h4>
|
||||
<h4 className="font-medium">シナリオ:ウェブ検索とドキュメントアクセス機能を持つリサーチアシスタント</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>入力を通じてユーザークエリを受信</li>
|
||||
<li>入力からユーザークエリを受信</li>
|
||||
<li>エージェントがGoogle検索ツールを使用してウェブを検索</li>
|
||||
<li>エージェントが社内文書用のNotionデータベースにアクセス</li>
|
||||
<li>エージェントが包括的な調査レポートをまとめる</li>
|
||||
<li>エージェントが包括的な調査レポートを作成</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## ベストプラクティス
|
||||
|
||||
- **システムプロンプトを具体的に**: エージェントの役割、トーン、制限を明確に定義してください。指示が具体的であればあるほど、エージェントは目的を果たすことができます。
|
||||
- **適切な温度設定を選択**: 精度が重要な場合は低い温度設定(0〜0.3)を使用し、よりクリエイティブまたは多様な応答には温度を上げる(0.7〜2.0)
|
||||
- **ツールを効果的に活用**: エージェントの目的を補完し、その能力を強化するツールを統合してください。エージェントに負担をかけないよう、提供するツールを選択的にしてください。重複の少いタスクには、最良の結果を得るために別のエージェントブロックを使用してください。
|
||||
- **システムプロンプトで具体的に指示する**:エージェントの役割、トーン、制限を明確に定義してください。指示が具体的であればあるほど、エージェントは目的を果たすことができます。
|
||||
- **適切な温度設定を選択する**:精度が重要な場合は低い温度設定(0〜0.3)を使用し、よりクリエイティブまたは多様な応答を得るには温度を上げる(0.7〜2.0)
|
||||
- **ツールを効果的に活用する**:エージェントの目的を補完し、その能力を強化するツールを統合してください。エージェントに負担をかけないよう、提供するツールを選択的にしてください。重複の少いタスクには、最良の結果を得るために別のエージェントブロックを使用してください。
|
||||
|
||||
@@ -24,15 +24,7 @@ APIトリガーは、ワークフローを安全なHTTPエンドポイントと
|
||||
|
||||
各パラメータに**入力フォーマット**フィールドを追加します。実行時の出力キーはスキーマを反映し、`<api.input>`でも利用できます。
|
||||
|
||||
```yaml
|
||||
- type: string
|
||||
name: userId
|
||||
value: demo-user # optional manual test value
|
||||
- type: number
|
||||
name: maxTokens
|
||||
```
|
||||
|
||||
エディタでの手動実行では、リクエストを送信せずにテストできるように`value`列を使用します。実行中、リゾルバは`<api.userId>`と`<api.input.userId>`の両方に値を設定します。
|
||||
エディタでの手動実行は `value` 列を使用するため、リクエストを送信せずにテストできます。実行中、リゾルバーは `<api.userId>` と `<api.input.userId>` の両方に値を設定します。
|
||||
|
||||
## リクエスト例
|
||||
|
||||
@@ -44,7 +36,7 @@ curl -X POST \
|
||||
-d '{"userId":"demo-user","maxTokens":1024}'
|
||||
```
|
||||
|
||||
成功したレスポンスはエグゼキュータからのシリアル化された実行結果を返します。エラーは検証、認証、またはワークフローの失敗を表示します。
|
||||
成功したレスポンスはエグゼキュータからシリアル化された実行結果を返します。エラーは検証、認証、またはワークフローの失敗を表示します。
|
||||
|
||||
## 出力リファレンス
|
||||
|
||||
@@ -53,8 +45,8 @@ curl -X POST \
|
||||
| `<api.field>` | 入力フォーマットで定義されたフィールド |
|
||||
| `<api.input>` | 構造化されたリクエスト本文全体 |
|
||||
|
||||
入力フォーマットが定義されていない場合、エグゼキュータは生のJSONを`<api.input>`でのみ公開します。
|
||||
入力フォーマットが定義されていない場合、エグゼキュータは生のJSONを `<api.input>` のみで公開します。
|
||||
|
||||
<Callout type="warning">
|
||||
ワークフローには1つのAPIトリガーしか含めることができません。変更後は新しいデプロイメントを公開して、エンドポイントを最新の状態に保ってください。
|
||||
ワークフローには1つのAPIトリガーのみ含めることができます。変更後は新しいデプロイメントを公開して、エンドポイントを最新の状態に保ってください。
|
||||
</Callout>
|
||||
|
||||
@@ -10,7 +10,6 @@ type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
- connections
|
||||
properties:
|
||||
type:
|
||||
@@ -22,21 +21,23 @@ properties:
|
||||
description: Display name for this loop block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- loopType
|
||||
description: Optional. If omitted, defaults will be applied.
|
||||
properties:
|
||||
loopType:
|
||||
type: string
|
||||
enum: [for, forEach]
|
||||
description: Type of loop to execute
|
||||
default: for
|
||||
iterations:
|
||||
type: number
|
||||
description: Number of iterations (for 'for' loops)
|
||||
default: 5
|
||||
minimum: 1
|
||||
maximum: 1000
|
||||
collection:
|
||||
type: string
|
||||
description: Collection to iterate over (for 'forEach' loops)
|
||||
default: ""
|
||||
maxConcurrency:
|
||||
type: number
|
||||
description: Maximum concurrent executions
|
||||
@@ -45,13 +46,10 @@ properties:
|
||||
maximum: 10
|
||||
connections:
|
||||
type: object
|
||||
required:
|
||||
- loop
|
||||
properties:
|
||||
# Nested format (recommended)
|
||||
loop:
|
||||
type: object
|
||||
required:
|
||||
- start
|
||||
properties:
|
||||
start:
|
||||
type: string
|
||||
@@ -59,26 +57,37 @@ properties:
|
||||
end:
|
||||
type: string
|
||||
description: Target block ID for loop completion (optional)
|
||||
# Direct handle format (alternative)
|
||||
loop-start-source:
|
||||
type: string | string[]
|
||||
description: Target block ID to execute inside the loop (direct format)
|
||||
loop-end-source:
|
||||
type: string | string[]
|
||||
description: Target block ID for loop completion (direct format, optional)
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
note: Use either the nested 'loop' format OR the direct 'loop-start-source' format, not both
|
||||
```
|
||||
|
||||
## 接続設定
|
||||
|
||||
ループブロックは `loop` セクションを持つ特別な接続形式を使用します:
|
||||
ループブロックは2つの接続形式をサポートしています:
|
||||
|
||||
### 直接ハンドル形式(代替)
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
loop:
|
||||
start: <string> # Target block ID to execute inside the loop
|
||||
end: <string> # Target block ID after loop completion (optional)
|
||||
loop-start-source: <string> # Target block ID to execute inside the loop
|
||||
loop-end-source: <string> # Target block ID after loop completion (optional)
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
## 子ブロック設定
|
||||
両方の形式は同じように機能します。お好みの方を使用してください。
|
||||
|
||||
ループ内のブロックは、その `parentId` をループブロックIDに設定する必要があります:
|
||||
## 子ブロックの設定
|
||||
|
||||
ループ内のブロックは、その `parentId` をループブロックIDに設定する必要があります。`extent` プロパティは自動的に `'parent'` に設定されるため、指定する必要はありません:
|
||||
|
||||
```yaml
|
||||
loop-1:
|
||||
@@ -261,6 +270,59 @@ process-task:
|
||||
success: task-completed
|
||||
```
|
||||
|
||||
### 直接ハンドル形式の例
|
||||
|
||||
同じループは直接ハンドル形式を使用して記述することもできます:
|
||||
|
||||
```yaml
|
||||
my-loop:
|
||||
type: loop
|
||||
name: "Process Items"
|
||||
inputs:
|
||||
loopType: forEach
|
||||
collection: <start.items>
|
||||
connections:
|
||||
loop-start-source: process-item # Direct handle format
|
||||
loop-end-source: final-results # Direct handle format
|
||||
error: handle-error
|
||||
|
||||
process-item:
|
||||
type: agent
|
||||
name: "Process Item"
|
||||
parentId: my-loop
|
||||
inputs:
|
||||
systemPrompt: "Process this item"
|
||||
userPrompt: <loop.currentItem>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
### 最小限のループ例(デフォルトを使用)
|
||||
|
||||
`inputs` セクションを完全に省略することができ、デフォルト値が適用されます:
|
||||
|
||||
```yaml
|
||||
simple-loop:
|
||||
type: loop
|
||||
name: "Simple Loop"
|
||||
# No inputs section - defaults to loopType: 'for', iterations: 5
|
||||
connections:
|
||||
loop-start-source: process-step
|
||||
loop-end-source: complete
|
||||
|
||||
process-step:
|
||||
type: agent
|
||||
name: "Process Step"
|
||||
parentId: simple-loop
|
||||
inputs:
|
||||
systemPrompt: "Execute step"
|
||||
userPrompt: "Step <loop.index>"
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
このループはデフォルトで5回の反復を実行します。
|
||||
|
||||
## ループ変数
|
||||
|
||||
ループ子ブロック内では、以下の特殊変数が利用可能です:
|
||||
@@ -274,7 +336,7 @@ process-task:
|
||||
|
||||
## 出力参照
|
||||
|
||||
ループが完了した後、集約された結果を参照できます:
|
||||
ループが完了した後、その集計結果を参照できます:
|
||||
|
||||
```yaml
|
||||
# In blocks after the loop
|
||||
@@ -286,10 +348,10 @@ final-processor:
|
||||
|
||||
## ベストプラクティス
|
||||
|
||||
- 長い実行時間を避けるために適切な繰り返し回数の制限を設定する
|
||||
- 長い実行時間を避けるため、適切な繰り返し制限を設定する
|
||||
- コレクション処理にはforEachを、固定回数の繰り返しにはforループを使用する
|
||||
- I/O処理の多い操作にはmaxConcurrencyの使用を検討する
|
||||
- I/O処理が多い操作にはmaxConcurrencyの使用を検討する
|
||||
- 堅牢なループ実行のためにエラー処理を含める
|
||||
- ループの子ブロックには説明的な名前を使用する
|
||||
- ループ子ブロックには説明的な名前を使用する
|
||||
- 最初に小さなコレクションでテストする
|
||||
- 大きなコレクションの実行時間を監視する
|
||||
@@ -172,44 +172,18 @@ Agent 模块通过统一的推理接口支持多个 LLM 提供商。可用模型
|
||||
- 读取对话历史以获取上下文
|
||||
- 在代理运行后附加其回复
|
||||
|
||||
```yaml
|
||||
# 1) Add latest user message
|
||||
- Memory (operation: add)
|
||||
id: chat
|
||||
role: user
|
||||
content: {{input}}
|
||||
|
||||
# 2) Load conversation history
|
||||
- Memory (operation: get)
|
||||
id: chat
|
||||
|
||||
# 3) Run the agent with prior messages available
|
||||
- Agent
|
||||
System Prompt: ...
|
||||
User Prompt: |
|
||||
Use the conversation so far:
|
||||
{{memory_get.memories}}
|
||||
Current user message: {{input}}
|
||||
|
||||
# 4) Store the agent reply
|
||||
- Memory (operation: add)
|
||||
id: chat
|
||||
role: assistant
|
||||
content: {{agent.content}}
|
||||
```
|
||||
|
||||
有关详细信息,请参阅 `Memory` 块参考:[工具/内存](/tools/memory)。
|
||||
有关详细信息,请参阅 [`Memory`](/tools/memory) 块引用。
|
||||
|
||||
## 输入和输出
|
||||
|
||||
<Tabs items={['配置', '变量', '结果']}>
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>系统提示</strong>:定义代理行为和角色的指令
|
||||
</li>
|
||||
<li>
|
||||
<strong>用户提示</strong>:要处理的输入文本或数据
|
||||
<strong>用户提示</strong>:需要处理的输入文本或数据
|
||||
</li>
|
||||
<li>
|
||||
<strong>模型</strong>:AI 模型选择(OpenAI、Anthropic、Google 等)
|
||||
@@ -218,7 +192,7 @@ Agent 模块通过统一的推理接口支持多个 LLM 提供商。可用模型
|
||||
<strong>温度</strong>:响应随机性控制(0-2)
|
||||
</li>
|
||||
<li>
|
||||
<strong>工具</strong>:可用于函数调用的工具数组
|
||||
<strong>工具</strong>:可用工具数组,用于功能调用
|
||||
</li>
|
||||
<li>
|
||||
<strong>响应格式</strong>:用于结构化输出的 JSON Schema
|
||||
@@ -234,10 +208,10 @@ Agent 模块通过统一的推理接口支持多个 LLM 提供商。可用模型
|
||||
<strong>agent.tokens</strong>:令牌使用统计对象
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.tool_calls</strong>:工具执行详细信息数组
|
||||
<strong>agent.tool_calls</strong>:工具执行详情数组
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.cost</strong>:API 调用的估计成本(如果可用)
|
||||
<strong>agent.cost</strong>:估算的 API 调用成本(如果可用)
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
@@ -247,7 +221,7 @@ Agent 模块通过统一的推理接口支持多个 LLM 提供商。可用模型
|
||||
<strong>内容</strong>:代理的主要响应输出
|
||||
</li>
|
||||
<li>
|
||||
<strong>元数据</strong>:使用统计信息和执行详细信息
|
||||
<strong>元数据</strong>:使用统计和执行详情
|
||||
</li>
|
||||
<li>
|
||||
<strong>访问</strong>:在代理之后的块中可用
|
||||
@@ -261,9 +235,9 @@ Agent 模块通过统一的推理接口支持多个 LLM 提供商。可用模型
|
||||
### 客户支持自动化
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">场景:通过数据库访问处理客户咨询</h4>
|
||||
<h4 className="font-medium">场景:通过数据库访问处理客户查询</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>用户通过 API 模块提交支持工单</li>
|
||||
<li>用户通过 API 块提交支持工单</li>
|
||||
<li>代理在 Postgres 中检查订单/订阅,并在知识库中搜索指导</li>
|
||||
<li>如果需要升级,代理会创建一个包含相关上下文的 Linear 问题</li>
|
||||
<li>代理起草一封清晰的电子邮件回复</li>
|
||||
@@ -277,10 +251,10 @@ Agent 模块通过统一的推理接口支持多个 LLM 提供商。可用模型
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">场景:使用不同的 AI 模型分析内容</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>功能模块处理上传的文档</li>
|
||||
<li>功能块处理上传的文档</li>
|
||||
<li>使用 GPT-4o 的代理执行技术分析</li>
|
||||
<li>使用 Claude 的代理分析情感和语气</li>
|
||||
<li>功能模块结合结果生成最终报告</li>
|
||||
<li>功能块结合结果生成最终报告</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
@@ -298,6 +272,6 @@ Agent 模块通过统一的推理接口支持多个 LLM 提供商。可用模型
|
||||
|
||||
## 最佳实践
|
||||
|
||||
- **在系统提示中具体说明**:清晰定义代理的角色、语气和限制。您的指令越具体,代理就越能更好地实现其预期目的。
|
||||
- **选择合适的温度设置**:当准确性很重要时,使用较低的温度设置(0-0.3);当需要更具创意或多样化的响应时,增加温度(0.7-2.0)。
|
||||
- **有效利用工具**:集成与代理目的互补并增强其能力的工具。选择性地提供工具,以避免让代理不堪重负。对于重叠较少的任务,使用另一个代理模块以获得最佳结果。
|
||||
- **在系统提示中具体说明**:清晰定义代理的角色、语气和限制。您的指令越具体,代理越能更好地完成其预期目的。
|
||||
- **选择合适的温度设置**:当准确性很重要时,使用较低的温度设置(0-0.3);当需要更具创意或多样化的响应时,可将温度提高(0.7-2.0)。
|
||||
- **有效利用工具**:集成与代理目的互补并增强其能力的工具。选择性地提供工具,以避免让代理不堪重负。对于重叠较少的任务,使用另一个代理块以获得最佳效果。
|
||||
|
||||
@@ -24,15 +24,7 @@ API 触发器将您的工作流公开为一个安全的 HTTP 端点。将 JSON
|
||||
|
||||
为每个参数添加一个 **输入格式** 字段。运行时输出键会镜像该模式,并且也可以在 `<api.input>` 下使用。
|
||||
|
||||
```yaml
|
||||
- type: string
|
||||
name: userId
|
||||
value: demo-user # optional manual test value
|
||||
- type: number
|
||||
name: maxTokens
|
||||
```
|
||||
|
||||
编辑器中的手动运行使用 `value` 列,因此您可以在不发送请求的情况下进行测试。在执行期间,解析器会填充 `<api.userId>` 和 `<api.input.userId>`。
|
||||
在编辑器中手动运行使用 `value` 列,因此您可以在不发送请求的情况下进行测试。在执行过程中,解析器会填充 `<api.userId>` 和 `<api.input.userId>`。
|
||||
|
||||
## 请求示例
|
||||
|
||||
@@ -44,17 +36,17 @@ curl -X POST \
|
||||
-d '{"userId":"demo-user","maxTokens":1024}'
|
||||
```
|
||||
|
||||
成功的响应会返回来自执行器的序列化执行结果。错误会显示验证、身份验证或工作流失败的原因。
|
||||
成功的响应会返回来自执行器的序列化执行结果。错误会显示验证、认证或工作流失败的信息。
|
||||
|
||||
## 输出参考
|
||||
|
||||
| 参考 | 描述 |
|
||||
|-----------|-------------|
|
||||
| `<api.field>` | 在输入格式中定义的字段 |
|
||||
| `<api.field>` | 输入格式中定义的字段 |
|
||||
| `<api.input>` | 整个结构化请求体 |
|
||||
|
||||
如果未定义输入格式,执行器仅在 `<api.input>` 处公开原始 JSON。
|
||||
如果未定义输入格式,执行器仅在 `<api.input>` 处暴露原始 JSON。
|
||||
|
||||
<Callout type="warning">
|
||||
一个工作流只能包含一个 API 触发器。更改后请发布新的部署,以确保端点保持最新。
|
||||
一个工作流只能包含一个 API 触发器。更改后发布新的部署,以确保端点保持最新。
|
||||
</Callout>
|
||||
|
||||
@@ -10,7 +10,6 @@ type: object
|
||||
required:
|
||||
- type
|
||||
- name
|
||||
- inputs
|
||||
- connections
|
||||
properties:
|
||||
type:
|
||||
@@ -22,21 +21,23 @@ properties:
|
||||
description: Display name for this loop block
|
||||
inputs:
|
||||
type: object
|
||||
required:
|
||||
- loopType
|
||||
description: Optional. If omitted, defaults will be applied.
|
||||
properties:
|
||||
loopType:
|
||||
type: string
|
||||
enum: [for, forEach]
|
||||
description: Type of loop to execute
|
||||
default: for
|
||||
iterations:
|
||||
type: number
|
||||
description: Number of iterations (for 'for' loops)
|
||||
default: 5
|
||||
minimum: 1
|
||||
maximum: 1000
|
||||
collection:
|
||||
type: string
|
||||
description: Collection to iterate over (for 'forEach' loops)
|
||||
default: ""
|
||||
maxConcurrency:
|
||||
type: number
|
||||
description: Maximum concurrent executions
|
||||
@@ -45,13 +46,10 @@ properties:
|
||||
maximum: 10
|
||||
connections:
|
||||
type: object
|
||||
required:
|
||||
- loop
|
||||
properties:
|
||||
# Nested format (recommended)
|
||||
loop:
|
||||
type: object
|
||||
required:
|
||||
- start
|
||||
properties:
|
||||
start:
|
||||
type: string
|
||||
@@ -59,26 +57,37 @@ properties:
|
||||
end:
|
||||
type: string
|
||||
description: Target block ID for loop completion (optional)
|
||||
# Direct handle format (alternative)
|
||||
loop-start-source:
|
||||
type: string | string[]
|
||||
description: Target block ID to execute inside the loop (direct format)
|
||||
loop-end-source:
|
||||
type: string | string[]
|
||||
description: Target block ID for loop completion (direct format, optional)
|
||||
error:
|
||||
type: string
|
||||
description: Target block ID for error handling
|
||||
note: Use either the nested 'loop' format OR the direct 'loop-start-source' format, not both
|
||||
```
|
||||
|
||||
## 连接配置
|
||||
|
||||
Loop 块使用一种特殊的连接格式,其中包含一个 `loop` 部分:
|
||||
循环块支持两种连接格式:
|
||||
|
||||
### 直接句柄格式(替代方案)
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
loop:
|
||||
start: <string> # Target block ID to execute inside the loop
|
||||
end: <string> # Target block ID after loop completion (optional)
|
||||
loop-start-source: <string> # Target block ID to execute inside the loop
|
||||
loop-end-source: <string> # Target block ID after loop completion (optional)
|
||||
error: <string> # Target block ID for error handling (optional)
|
||||
```
|
||||
|
||||
两种格式的功能完全相同,可根据您的喜好选择使用。
|
||||
|
||||
## 子块配置
|
||||
|
||||
循环中的块必须将其 `parentId` 设置为循环块的 ID:
|
||||
循环中的块必须将其 `parentId` 设置为循环块的 ID。`extent` 属性会自动设置为 `'parent'`,无需手动指定:
|
||||
|
||||
```yaml
|
||||
loop-1:
|
||||
@@ -261,9 +270,62 @@ process-task:
|
||||
success: task-completed
|
||||
```
|
||||
|
||||
### 直接句柄格式示例
|
||||
|
||||
同一个循环可以使用直接句柄格式编写:
|
||||
|
||||
```yaml
|
||||
my-loop:
|
||||
type: loop
|
||||
name: "Process Items"
|
||||
inputs:
|
||||
loopType: forEach
|
||||
collection: <start.items>
|
||||
connections:
|
||||
loop-start-source: process-item # Direct handle format
|
||||
loop-end-source: final-results # Direct handle format
|
||||
error: handle-error
|
||||
|
||||
process-item:
|
||||
type: agent
|
||||
name: "Process Item"
|
||||
parentId: my-loop
|
||||
inputs:
|
||||
systemPrompt: "Process this item"
|
||||
userPrompt: <loop.currentItem>
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
### 最小循环示例(使用默认值)
|
||||
|
||||
您可以完全省略 `inputs` 部分,系统将应用默认值:
|
||||
|
||||
```yaml
|
||||
simple-loop:
|
||||
type: loop
|
||||
name: "Simple Loop"
|
||||
# No inputs section - defaults to loopType: 'for', iterations: 5
|
||||
connections:
|
||||
loop-start-source: process-step
|
||||
loop-end-source: complete
|
||||
|
||||
process-step:
|
||||
type: agent
|
||||
name: "Process Step"
|
||||
parentId: simple-loop
|
||||
inputs:
|
||||
systemPrompt: "Execute step"
|
||||
userPrompt: "Step <loop.index>"
|
||||
model: gpt-4o
|
||||
apiKey: '{{OPENAI_API_KEY}}'
|
||||
```
|
||||
|
||||
此循环默认将执行 5 次迭代。
|
||||
|
||||
## 循环变量
|
||||
|
||||
在循环的子块中,可以使用以下特殊变量:
|
||||
在循环子块中,可以使用以下特殊变量:
|
||||
|
||||
```yaml
|
||||
# Available in all child blocks of the loop
|
||||
@@ -274,7 +336,7 @@ process-task:
|
||||
|
||||
## 输出引用
|
||||
|
||||
循环完成后,可以引用其聚合结果:
|
||||
循环完成后,您可以引用其聚合结果:
|
||||
|
||||
```yaml
|
||||
# In blocks after the loop
|
||||
@@ -286,10 +348,10 @@ final-processor:
|
||||
|
||||
## 最佳实践
|
||||
|
||||
- 设置合理的迭代限制以避免长时间的执行
|
||||
- 使用 forEach 处理集合,使用 for 循环处理固定迭代
|
||||
- 对于 I/O 密集型操作,考虑使用 maxConcurrency
|
||||
- 设置合理的迭代限制以避免长时间执行
|
||||
- 使用 forEach 处理集合,使用 for 循环进行固定迭代
|
||||
- 考虑对 I/O 密集型操作使用 maxConcurrency
|
||||
- 包含错误处理以确保循环执行的健壮性
|
||||
- 为循环子块使用描述性名称
|
||||
- 先用小集合进行测试
|
||||
- 对大集合的执行时间进行监控
|
||||
- 对于大集合,监控执行时间
|
||||
@@ -3378,19 +3378,18 @@ checksums:
|
||||
content/38: 1b693e51b5b8e31dd088c602663daab4
|
||||
content/39: 5003cde407a705d39b969eff5bdab18a
|
||||
content/40: 624199f0ed2378588024cfe6055d6b6b
|
||||
content/41: 8accff30f8b36f6fc562b44d8fe271dd
|
||||
content/42: fc62aefa5b726f57f2c9a17a276e601f
|
||||
content/43: d72903dda50a36b12ec050a06ef23a1b
|
||||
content/44: 19984dc55d279f1ae3226edf4b62aaa3
|
||||
content/45: 9c2f91f89a914bf4661512275e461104
|
||||
content/46: adc97756961688b2f4cc69b773c961c9
|
||||
content/47: 7b0c309be79b5e1ab30e58a98ea0a778
|
||||
content/48: ac70442527be4edcc6b0936e2e5dc8c1
|
||||
content/49: a298d382850ddaa0b53e19975b9d12d2
|
||||
content/50: 27535bb1de08548a7389708045c10714
|
||||
content/51: 6f366fdb6389a03bfc4d83c12fa4099d
|
||||
content/52: b2a4a0c279f47d58a2456f25a1e1c6f9
|
||||
content/53: 17af9269613458de7f8e36a81b2a6d30
|
||||
content/41: a2c636da376e80aa3427ce26b2dce0fd
|
||||
content/42: d72903dda50a36b12ec050a06ef23a1b
|
||||
content/43: 19984dc55d279f1ae3226edf4b62aaa3
|
||||
content/44: 9c2f91f89a914bf4661512275e461104
|
||||
content/45: adc97756961688b2f4cc69b773c961c9
|
||||
content/46: 7b0c309be79b5e1ab30e58a98ea0a778
|
||||
content/47: ac70442527be4edcc6b0936e2e5dc8c1
|
||||
content/48: a298d382850ddaa0b53e19975b9d12d2
|
||||
content/49: 27535bb1de08548a7389708045c10714
|
||||
content/50: 6f366fdb6389a03bfc4d83c12fa4099d
|
||||
content/51: b2a4a0c279f47d58a2456f25a1e1c6f9
|
||||
content/52: 17af9269613458de7f8e36a81b2a6d30
|
||||
fa2a1ea3b95cd7608e0a7d78834b7d49:
|
||||
meta/title: d8df37d5e95512e955c43661de8a40d0
|
||||
meta/description: d25527b81409cb3d42d9841e8ed318d4
|
||||
@@ -3567,30 +3566,39 @@ checksums:
|
||||
meta/title: 27e1d8e6df8b8d3ee07124342bcc5599
|
||||
meta/description: 5a19804a907fe2a0c7ddc8a933e7e147
|
||||
content/0: 07f0ef1d9ef5ee2993ab113d95797f37
|
||||
content/1: c7dc738fa39cff694ecc04dca0aec33e
|
||||
content/1: 200b847a5b848c11a507cecfcb381e02
|
||||
content/2: dd7f8a45778d4dddd9bda78c19f046a4
|
||||
content/3: 298c570bb45cd493870e9406dc8be50e
|
||||
content/4: d4346df7c1c5da08e84931d2d449023a
|
||||
content/5: bacf5914637cc0c1e00dfac72f60cf1f
|
||||
content/6: 700ac74ffe23bbcc102b001676ee1818
|
||||
content/7: d7c2f6c70070e594bffd0af3d20bbccb
|
||||
content/8: 33b9b1e9744318597da4b925b0995be2
|
||||
content/9: caa663af7342e02001aca78c23695b22
|
||||
content/10: 1fa44e09185c753fec303e2c73e44eaf
|
||||
content/11: d794cf2ea75f4aa8e73069f41fe8bc45
|
||||
content/12: f9553f38263ad53c261995083622bdde
|
||||
content/13: e4625b8a75814b2fcfe3c643a47e22cc
|
||||
content/14: 20ee0fd34f3baab1099a2f8fb06b13cf
|
||||
content/15: 73a9d04015d0016a994cf1e8fe8d5c12
|
||||
content/16: 9a71a905db9dd5d43bdd769f006caf14
|
||||
content/17: 18c31983f32539861fd5b4e8dd943169
|
||||
content/18: 55300ae3e3c3213c4ad82c1cf21c89b2
|
||||
content/19: 8a8aa301371bd07b15c6f568a8e7826f
|
||||
content/20: a98cce6db23d9a86ac51179100f32529
|
||||
content/21: b5a605662dbb6fc20ad37fdb436f0581
|
||||
content/22: 2b204164f64dcf034baa6e5367679735
|
||||
content/23: b2a4a0c279f47d58a2456f25a1e1c6f9
|
||||
content/24: 15ebde5d554a3ec6000f71cf32b16859
|
||||
content/3: b1870986cdef32b6cf3c79a4cd56a8b0
|
||||
content/4: 5e7c060bf001ead8fb4005385509e857
|
||||
content/5: 1de0d605f73842c3464e7fb2e09fb92c
|
||||
content/6: 1a8e292ce7cc3adb2fe38cf2f5668b43
|
||||
content/7: bacf5914637cc0c1e00dfac72f60cf1f
|
||||
content/8: 336fdb536f9f5654d4d69a5adb1cf071
|
||||
content/9: d7c2f6c70070e594bffd0af3d20bbccb
|
||||
content/10: 33b9b1e9744318597da4b925b0995be2
|
||||
content/11: caa663af7342e02001aca78c23695b22
|
||||
content/12: 1fa44e09185c753fec303e2c73e44eaf
|
||||
content/13: d794cf2ea75f4aa8e73069f41fe8bc45
|
||||
content/14: f9553f38263ad53c261995083622bdde
|
||||
content/15: e4625b8a75814b2fcfe3c643a47e22cc
|
||||
content/16: 20ee0fd34f3baab1099a2f8fb06b13cf
|
||||
content/17: 73a9d04015d0016a994cf1e8fe8d5c12
|
||||
content/18: 9a71a905db9dd5d43bdd769f006caf14
|
||||
content/19: b4017a890213e9ac0afd6b2cfc1bdefc
|
||||
content/20: 479fd4d587cd0a1b8d27dd440e019215
|
||||
content/21: db263bbe8b5984777eb738e9e4c3ec71
|
||||
content/22: 1128c613d71aad35f668367ba2065a01
|
||||
content/23: 12be239d6ea36a71b022996f56d66901
|
||||
content/24: aa2240ef8ced8d9b67f7ab50665caae5
|
||||
content/25: 5cce1d6a21fae7252b8670a47a2fae9e
|
||||
content/26: 18c31983f32539861fd5b4e8dd943169
|
||||
content/27: 55300ae3e3c3213c4ad82c1cf21c89b2
|
||||
content/28: 8a8aa301371bd07b15c6f568a8e7826f
|
||||
content/29: a98cce6db23d9a86ac51179100f32529
|
||||
content/30: b5a605662dbb6fc20ad37fdb436f0581
|
||||
content/31: 2b204164f64dcf034baa6e5367679735
|
||||
content/32: b2a4a0c279f47d58a2456f25a1e1c6f9
|
||||
content/33: 15ebde5d554a3ec6000f71cf32b16859
|
||||
132869ed8674995bace940b1cefc4241:
|
||||
meta/title: a753d6bd11bc5876c739b95c6d174914
|
||||
meta/description: 71efdaceb123c4d6b6ee19c085cd9f0f
|
||||
@@ -3958,12 +3966,11 @@ checksums:
|
||||
content/3: b3c762557a1a308f3531ef1f19701807
|
||||
content/4: bf29da79344f37eeadd4c176aa19b8ff
|
||||
content/5: ae52879ebefa5664a6b7bf8ce5dd57ab
|
||||
content/6: 5e1cbe37c5714b16c908c7e0fe0b23e3
|
||||
content/7: ce487c9bc7a730e7d9da4a87b8eaa0a6
|
||||
content/8: e73f4b831f5b77c71d7d86c83abcbf11
|
||||
content/9: 07e064793f3e0bbcb02c4dc6083b6daa
|
||||
content/10: a702b191c3f94458bee880d33853e0cb
|
||||
content/11: ce110ab5da3ff96f8cbf96ce3376fc51
|
||||
content/12: 83f9b3ab46b0501c8eb3989bec3f4f1b
|
||||
content/13: e00be80effb71b0acb014f9aa53dfbe1
|
||||
content/14: 847a381137856ded9faa5994fbc489fb
|
||||
content/6: ce487c9bc7a730e7d9da4a87b8eaa0a6
|
||||
content/7: e73f4b831f5b77c71d7d86c83abcbf11
|
||||
content/8: 07e064793f3e0bbcb02c4dc6083b6daa
|
||||
content/9: a702b191c3f94458bee880d33853e0cb
|
||||
content/10: ce110ab5da3ff96f8cbf96ce3376fc51
|
||||
content/11: 83f9b3ab46b0501c8eb3989bec3f4f1b
|
||||
content/12: e00be80effb71b0acb014f9aa53dfbe1
|
||||
content/13: 847a381137856ded9faa5994fbc489fb
|
||||
|
||||
Reference in New Issue
Block a user