Início/Modelos & APIs/Módulo 2.2

Modelos & APIs · Módulo 2/5

Perplexity dentro do n8n

Workflow pronto para importar no n8n.

Descrição

_(sem descrição)_

Recursos baixados

Texto de 36-how-to-use-perplexity-inside-n8n.json

{
  "name": "Perplexity",
  "nodes": [
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "value": "1N77n0wYkWx0gGKxW8qWIXYqjH8wRvE1gEd1aOSALJ4c",
          "mode": "list",
          "cachedResultName": "Media Links",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N77n0wYkWx0gGKxW8qWIXYqjH8wRvE1gEd1aOSALJ4c/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N77n0wYkWx0gGKxW8qWIXYqjH8wRvE1gEd1aOSALJ4c/edit#gid=0"
        },
        "event": "rowAdded",
        "options": {}
      },
      "id": "342b3035-765f-456f-9268-9f5a8192e0b4",
      "name": "Google Sheets Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "typeVersion": 1,
      "position": [
        780,
        580
      ],
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "YEOmkRWtTPYLyMqx",
          "name": "Google Sheets Trigger account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Get all the input items (articles)\nconst articles = $input.all();\n\n// Get the most recent article (assuming it's the last one in the array)\nconst latestArticle = articles[articles.length - 1];\n\n// Return the most recent article as the output for the next node\nreturn [latestArticle];"
      },
      "id": "987bf3fd-4a39-4cd8-aed1-47cb99922805",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1020,
        580
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer SEU_TOKEN_AQUI"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"model\": \"llama-3.1-sonar-small-128k-online\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"Summarize the following article in detail\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Article:  {{ $json['Media Post Links '] }}\"\n    }  \n  ],\n\n  \"max_tokens\": 500,\n  \"temperature\": 0.2,\n  \"top_p\": 0.9,\n  \"return_citations\": true,\n  \"search_domain_filter\": [\n    \"perplexity.ai\"\n  ],\n  \"return_images\": false,\n  \"return_related_questions\": false,\n  \"search_recency_filter\": \"month\",\n  \"top_k\": 0,\n  \"stream\": false,\n  \"presence_penalty\": 0,\n  \"frequency_penalty\": 1\n}",
        "options": {}
      },
      "id": "35156388-751b-412c-a2aa-35922379ea49",
      "name": "Perplexity",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1220,
        580
      ]
    }
  ],
  "pinData": {},
  "connections": {
    "Google Sheets Trigger": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Perplexity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "48f665c5-6b66-4934-8420-37907fcd8110",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "ae56acec072bc16273543d89bb011ed9ab6cf3dacd823d15e41231870330f72a"
  },
  "id": "wyeCjz6p0cUvoYnx",
  "tags": []
}
← Anterior
Agentes com LLMs open-source (Ollama)
Próximo →
278 modelos com uma única API