Intégrations

Pipedream

Exécute Thunderbit depuis une étape Code Pipedream — Node.js ou Python, à toi de choisir

Pipedream est le cousin développeur de Zapier — chaque workflow est un vrai script que tu peux éditer. Utilise une étape Code pour un contrôle total ou l'action HTTP / Webhook pour la voie no-code.

Étape Code (Node.js)

import { defineComponent } from '@pipedream/core';

export default defineComponent({
  props: {
    thunderbit: { type: 'app', app: 'thunderbit' }, // or use an env var
    url:        { type: 'string' },
  },
  async run({ steps, $ }) {
    const res = await fetch(
      'https://openapi.thunderbit.com/openapi/v1/distill',
      {
        method: 'POST',
        headers: {
          Authorization: `Bearer ${process.env.THUNDERBIT_API_KEY}`,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({ url: this.url, renderMode: 'basic' }),
      },
    );
    const json = await res.json();
    return json.data.markdown;
  },
});

Étape Code (Python)

import os, httpx

def handler(pd: "pipedream"):
    res = httpx.post(
        "https://openapi.thunderbit.com/openapi/v1/distill",
        headers={"Authorization": f"Bearer {os.environ['THUNDERBIT_API_KEY']}"},
        json={"url": pd.steps["trigger"]["event"]["url"], "renderMode": "basic"},
        timeout=60.0,
    )
    return res.json()["data"]["markdown"]

Batch avec source HTTP

Pour /batch/distill, ajoute une source HTTP / Webhook comme trigger d'un second workflow, puis pointe callback.url de Thunderbit vers l'URL de source que Pipedream te donne. Le trigger se déclenche quand le batch se termine — tes étapes suivantes voient le tableau complet de résultats.

Astuces

  • Stocke l'API Key comme Env Var Pipedream (par workspace ou par workflow), pas dans le code
  • Le tier gratuit de Pipedream limite le compute par étape — garde le Markdown trim avant les appels LLM en aval

Liens connexes