Integrazioni

Pipedream

Esegui Thunderbit da uno step Code di Pipedream — Node.js o Python, scegli tu

Pipedream è il cugino developer-friendly di Zapier — ogni workflow è uno script vero che puoi modificare. Usa uno step Code per il pieno controllo o l'azione HTTP / Webhook per il path no-code.

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 sorgente HTTP

Per /batch/distill, aggiungi una sorgente HTTP / Webhook come trigger di un secondo workflow, poi punta callback.url di Thunderbit sull'URL della sorgente che ti dà Pipedream. Il trigger si attiva quando il batch finisce — i tuoi step downstream vedono l'array completo dei risultati.

Suggerimenti

  • Conserva l'API Key come Env Var Pipedream (per workspace o per workflow), non nel codice
  • Il free tier di Pipedream limita il compute per step — tieni il Markdown snello prima delle chiamate LLM downstream

Correlati