Перейти к содержанию
НОВОЕПознакомьтесь с Alaaddin — вашим ИИ-джинном с голосом. trig8n запускается 1 января 2027. Что нового

Библиотека / Строительные блоки и утилиты

Строительные блоки и утилиты

Batch structured AI calls via OpenRouter, Data Tables, and webhooks

When an API call/webhook arrives, it provides a reusable building block with OpenRouter and Claude using Model Selector, Data Table.

Что делает

# Use this for your AI Agent's skill Purpose. Use this endpoint for repetitive, independent AI tasks such as classification, extraction, rewriting, and structured generation. Have the main agent plan once, then use a script to send many similar calls to external models. This can save the main agent's context and time when its full capabilities are unnecessary for each item. Keep deterministic IDs, dates, URLs, and exact quotes in the script. ### Onboard an unconfigured person 1. Check whether EXTERNALIZED_AI_URL and EXTERNALIZED_AI_API_TOKEN are configured. Report only “present” or “missing”. Never print or log the token value. If either is missing, stop before making a paid request. 2. Ask the person to request the production webhook URL and a personal token from the workflow owner. Deliver tokens through a verified private channel. 3. Store them locally as EXTERNALIZED_AI_URL=... and EXTERNALIZED_AI_API_TOKEN=... in .env, without quotes. Keep the file out of version control. Never put the token in this skill, source code, a prompt, or a URL. 4. Test one cheap, authorized call. If it returns 401, ask the owner to check the token and the users.auth_token lookup. ### Build and send a batch Use one aiMode per request. Split small and big work into separate requests. Send at most 50 calls to POST $EXTERNALIZED_AI_URL with Content-Type: application/json and X-API-Key: $EXTERNALIZED_AI_API_TOKEN. Only the first 50 are processed if a request contains more. json { "calls": [{ "systemPrompt": "Shared rules for this item type.", "userMessage": "Task and source text for one item.", "jsonSchema": "{\"type\":\"object\",\"properties\":{\"label\":{\"type\":\"string\"}},\"required\":[\"label\"]}", "aiMode": "small" }] } jsonSchema must be a JSON-encoded string, not a nested object. Use small for routine bulk work and big for the stronger tier. Keep the system prompt shared across similar items; put item-specific content in userMessage. ### Logging and sensitive input The logs table stores the user's email and the full submitted calls payload, including systemPrompt, userMessage, jsonSchema, and aiMode. The sub-workflow currently wraps the calls array in a property named callCount; that property contains the payload, not a numeric count. Treat all submitted source text and prompts as retained data. Do not send secrets or content the organization does not permit storing. Ask

Шаги

  1. Webhook
  2. Error
  3. Stop and Error
  4. Check Auth
  5. Valid?
  6. Respond to Webhook
  7. Basic LLM Chain
  8. Structured Output Parser
  9. Model Selector
  10. 3.8 Flash
  11. Found?
  12. Success
  13. Get team member
  14. Stop and Error1

Всего шагов: 22.

Похожие автоматизации