Integraciones

Pipedream

Ejecuta Thunderbit desde un Code step de Pipedream — Node.js o Python, tú decides

Pipedream es la prima developer-friendly de Zapier — cada workflow es un script real que puedes editar. Usa un Code step para control total o la acción HTTP / Webhook para la vía sin código.

Code step (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;
  },
});

Code step (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 con HTTP source

Para /batch/distill, añade una source HTTP / Webhook como trigger de un segundo workflow y apunta el callback.url de Thunderbit a la URL de source que Pipedream te dé. El trigger se dispara cuando el batch termina — los pasos siguientes ven el array completo de resultados.

Consejos

  • Guarda la API Key como Env Var de Pipedream (por workspace o por workflow), no en código
  • El plan gratuito de Pipedream limita el cómputo por step — recorta el Markdown antes de las llamadas LLM siguientes

Relacionado